@astryxdesign/cli 0.6.3-canary.d0d49a4 → 0.6.3-canary.db4e378

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 (206) hide show
  1. package/README.md +86 -72
  2. package/api/build/build.doc.mjs +3 -3
  3. package/api/build/build.test.mjs +14 -3
  4. package/api/build/build.type.d.mts +35 -1
  5. package/api/build/build.type.mjs +24 -3
  6. package/api/build/help/help.d.mts +8 -5
  7. package/api/build/help/help.mjs +56 -6
  8. package/api/component/component.doc.mjs +12 -3
  9. package/api/component/component.mjs +31 -2
  10. package/api/component/component.test.mjs +38 -0
  11. package/api/component/component.type.d.mts +16 -5
  12. package/api/component/component.type.mjs +13 -5
  13. package/api/component/detail/blocks/blocks.d.mts +2 -1
  14. package/api/component/detail/blocks/blocks.mjs +4 -3
  15. package/api/component/list/list.d.mts +0 -5
  16. package/api/component/list/list.mjs +37 -9
  17. package/api/discover/discover.doc.mjs +1 -1
  18. package/api/gap-report/gap-report.doc.mjs +7 -4
  19. package/api/init/init.doc.mjs +4 -0
  20. package/api/init/init.test.mjs +41 -1
  21. package/api/init/remove/remove.mjs +1 -1
  22. package/api/init/run/run.mjs +20 -10
  23. package/api/integration/add-contribution.component-names.test.mjs +120 -0
  24. package/api/integration/add-contribution.mjs +11 -0
  25. package/api/integration/add-contribution.test.mjs +80 -0
  26. package/api/integration/integrationAdd.doc.mjs +7 -4
  27. package/api/integration/integrationAddComponent.doc.mjs +1 -1
  28. package/api/integration/validate-integration.mjs +2 -0
  29. package/api/integration/validate-integration.test.mjs +91 -0
  30. package/api/integration/validateIntegration.doc.mjs +1 -1
  31. package/api/json/envelope-types.test.mjs +76 -0
  32. package/api/json/parseResponse.doc.mjs +2 -2
  33. package/api/layout/expand/expand.mjs +7 -5
  34. package/api/layout/expand/expand.path-safety.test.mjs +53 -0
  35. package/api/layout/grammar/grammar.mjs +2 -1
  36. package/api/layout/layoutExpand.doc.mjs +1 -1
  37. package/api/search/search-return-type.test.mjs +54 -0
  38. package/api/search/search.d.mts +2 -9
  39. package/api/search/search.doc.mjs +5 -1
  40. package/api/search/search.mjs +10 -3
  41. package/api/search/search.test.mjs +34 -0
  42. package/api/swizzle/copy/copy.mjs +28 -11
  43. package/api/swizzle/swizzle.doc.mjs +1 -1
  44. package/api/template/copy/copy.mjs +17 -23
  45. package/api/template/copy/copy.test.mjs +17 -0
  46. package/api/template/template.doc.mjs +2 -1
  47. package/api/theme/add/add.binary.test.mjs +91 -0
  48. package/api/theme/add/add.mjs +20 -3
  49. package/api/theme/add/add.staging.test.mjs +66 -0
  50. package/api/theme/build/build.mjs +114 -37
  51. package/api/theme/build/build.public-component-vars.test.mjs +1 -1
  52. package/api/theme/build/build.receipt-doc.test.mjs +111 -0
  53. package/api/theme/build/font-warning.mjs +3 -3
  54. package/api/theme/build/font-warning.test.mjs +5 -2
  55. package/api/theme/palette/generate/generate.mjs +7 -2
  56. package/api/theme/palette/generate/generate.test.mjs +96 -0
  57. package/api/theme/palette/generate/generator.mjs +8 -1
  58. package/api/theme/palette/generate/generator.test.mjs +10 -0
  59. package/api/theme/template/template.mjs +11 -2
  60. package/api/theme/template/template.test.mjs +15 -0
  61. package/api/theme/themeBuild.doc.mjs +7 -4
  62. package/api/theme/themeTemplate.doc.mjs +4 -1
  63. package/api/upgrade/_adapter.mjs +27 -4
  64. package/api/upgrade/list/list.mjs +2 -1
  65. package/api/upgrade/list/list.test.mjs +73 -0
  66. package/api/upgrade/status/status.mjs +2 -2
  67. package/api/upgrade/upgrade.doc.mjs +2 -1
  68. package/api/upgrade/upgrade.type.d.mts +4 -0
  69. package/api/upgrade/upgrade.type.mjs +1 -0
  70. package/assets/codemods/term-log.mjs +32 -8
  71. package/assets/codemods/term-log.test.mjs +19 -1
  72. package/assets/codemods/transform-prop.mjs +109 -0
  73. package/assets/codemods/transform-prop.test.mjs +95 -0
  74. package/assets/codemods/transforms/v0.0.14/__tests__/rename-status-variants.test.mjs +86 -165
  75. package/assets/codemods/transforms/v0.0.14/rename-status-variants.mjs +72 -210
  76. package/assets/codemods/transforms/v0.1.8/__tests__/rename-avatar-size-scale.test.mjs +83 -115
  77. package/assets/codemods/transforms/v0.1.8/rename-avatar-size-scale.mjs +57 -186
  78. package/assets/codemods/transforms/v0.6.0/__tests__/next-codemods.test.mjs +47 -0
  79. package/assets/codemods/transforms/v0.6.0/rename-resizable-pixel-bounds.mjs +57 -10
  80. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaInlineRail.doc.mjs +14 -0
  81. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaInlineRail.tsx +61 -0
  82. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaOverscrollChaining.doc.mjs +14 -0
  83. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaOverscrollChaining.tsx +126 -0
  84. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaShowcase.doc.mjs +15 -0
  85. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaShowcase.tsx +86 -0
  86. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyGroupHeaders.doc.mjs +14 -0
  87. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyGroupHeaders.tsx +99 -0
  88. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyPassthrough.doc.mjs +14 -0
  89. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaStickyPassthrough.tsx +122 -0
  90. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaTwoAxisBoard.doc.mjs +14 -0
  91. package/assets/templates/blocks/components/ScrollableArea/ScrollableAreaTwoAxisBoard.tsx +95 -0
  92. package/assets/templates/pages/table-tree/page.tsx +1704 -0
  93. package/assets/templates/pages/table-tree/template.doc.mjs +12 -0
  94. package/authoring/config/config.doc.mjs +1 -1
  95. package/authoring/config/debug-composition.test.mjs +92 -0
  96. package/authoring/config/type.ts +15 -3
  97. package/clients/cli/command-load-failure.test.mjs +83 -0
  98. package/clients/cli/commands/blog.mjs +23 -8
  99. package/clients/cli/commands/blog.test.mjs +42 -1
  100. package/clients/cli/commands/build-theme.ascii-output.test.mjs +161 -0
  101. package/clients/cli/commands/build-theme.flag-docs.test.mjs +110 -0
  102. package/clients/cli/commands/build-theme.mjs +5 -5
  103. package/clients/cli/commands/build-theme.path-safety.test.mjs +86 -1
  104. package/clients/cli/commands/build-theme.variants.test.mjs +76 -0
  105. package/clients/cli/commands/build.doc.mjs +4 -1
  106. package/clients/cli/commands/build.exit-codes-doc.test.mjs +50 -0
  107. package/clients/cli/commands/build.mjs +32 -47
  108. package/clients/cli/commands/build.playbook.test.mjs +75 -0
  109. package/clients/cli/commands/build.text-fields.test.mjs +40 -0
  110. package/clients/cli/commands/component/index.mjs +2 -7
  111. package/clients/cli/commands/component-package.test.mjs +46 -0
  112. package/clients/cli/commands/component-resolution.test.mjs +21 -0
  113. package/clients/cli/commands/component.test.mjs +19 -0
  114. package/clients/cli/commands/detail-levels.test.mjs +2 -2
  115. package/clients/cli/commands/discover.broken-integration.test.mjs +48 -0
  116. package/clients/cli/commands/discover.components-flag.test.mjs +97 -0
  117. package/clients/cli/commands/discover.doc.mjs +4 -2
  118. package/clients/cli/commands/discover.mjs +3 -3
  119. package/clients/cli/commands/discover.text-projection.test.mjs +103 -0
  120. package/clients/cli/commands/doctor-integration.package-json.test.mjs +53 -0
  121. package/clients/cli/commands/doctor.mjs +6 -16
  122. package/clients/cli/commands/doctor.test.mjs +42 -0
  123. package/clients/cli/commands/gap-report.doc.mjs +16 -5
  124. package/clients/cli/commands/gap-report.test.mjs +72 -0
  125. package/clients/cli/commands/hook/index.mjs +7 -17
  126. package/clients/cli/commands/hook.text-projection.test.mjs +45 -0
  127. package/clients/cli/commands/init.doc.mjs +19 -8
  128. package/clients/cli/commands/init.flag-help.test.mjs +153 -0
  129. package/clients/cli/commands/integration-add.controls.test.mjs +132 -0
  130. package/clients/cli/commands/integration-add.doc.mjs +21 -5
  131. package/clients/cli/commands/interactive-guard.test.mjs +101 -24
  132. package/clients/cli/commands/json-contract.test.mjs +33 -0
  133. package/clients/cli/commands/layout-check.doc.mjs +14 -3
  134. package/clients/cli/commands/layout-expand.doc.mjs +21 -4
  135. package/clients/cli/commands/layout.doc.mjs +2 -2
  136. package/clients/cli/commands/layout.mjs +21 -9
  137. package/clients/cli/commands/layout.path-help.test.mjs +33 -0
  138. package/clients/cli/commands/layout.stdin-cap.test.mjs +47 -0
  139. package/clients/cli/commands/layout.text-fields.test.mjs +39 -0
  140. package/clients/cli/commands/no-prompt-wording.test.mjs +94 -0
  141. package/clients/cli/commands/search.doc.mjs +6 -3
  142. package/clients/cli/commands/search.mjs +17 -7
  143. package/clients/cli/commands/search.test.mjs +75 -0
  144. package/clients/cli/commands/swizzle.doc.mjs +2 -1
  145. package/clients/cli/commands/swizzle.path-safety.test.mjs +42 -0
  146. package/clients/cli/commands/template.doc.mjs +28 -6
  147. package/clients/cli/commands/template.flag-help.test.mjs +117 -0
  148. package/clients/cli/commands/template.path-help.test.mjs +40 -0
  149. package/clients/cli/commands/theme-add.doc.mjs +2 -1
  150. package/clients/cli/commands/theme-build.doc.mjs +7 -6
  151. package/clients/cli/commands/theme-palette-generate.test.mjs +19 -0
  152. package/clients/cli/commands/theme-template.behavior.test.mjs +12 -0
  153. package/clients/cli/commands/theme-template.doc.mjs +1 -1
  154. package/clients/cli/commands/upgrade.ascii-output.test.mjs +87 -0
  155. package/clients/cli/commands/upgrade.doc.mjs +17 -6
  156. package/clients/cli/commands/upgrade.flag-help.test.mjs +188 -0
  157. package/clients/cli/commands/upgrade.hook-output.test.mjs +88 -0
  158. package/clients/cli/index.mjs +13 -30
  159. package/clients/cli/latest-version-env.test.mjs +50 -0
  160. package/clients/cli/lib/cli-error.test.mjs +7 -0
  161. package/clients/cli/lib/component-format.mjs +9 -9
  162. package/clients/cli/lib/component-format.test.mjs +1 -1
  163. package/clients/cli/lib/define-command.mjs +32 -6
  164. package/clients/cli/lib/doc-text-ascii.test.mjs +82 -0
  165. package/clients/cli/lib/exit-codes.test.mjs +97 -0
  166. package/clients/cli/lib/hook-format.mjs +5 -5
  167. package/clients/cli/lib/json-shim.mjs +38 -2
  168. package/clients/cli/lib/json-shim.test.mjs +83 -0
  169. package/clients/cli/lib/manifest.d.ts +2 -0
  170. package/clients/cli/lib/manifest.mjs +22 -0
  171. package/clients/cli/lib/manifest.test.mjs +17 -0
  172. package/foundation/agent-docs/agent-docs.d.mts +4 -0
  173. package/foundation/agent-docs/agent-docs.mjs +69 -3
  174. package/foundation/agent-docs/agent-docs.path-safety.test.mjs +266 -4
  175. package/foundation/config/integration-debug.test.mjs +28 -3
  176. package/foundation/config/project.mjs +123 -9
  177. package/foundation/config/project.test.mjs +126 -0
  178. package/foundation/discovery/template-adapter.d.mts +14 -5
  179. package/foundation/discovery/template-adapter.fixture-refs.test.mjs +248 -0
  180. package/foundation/discovery/template-adapter.integration-isolation.test.mjs +94 -0
  181. package/foundation/discovery/template-adapter.mjs +292 -25
  182. package/foundation/discovery/theming-targets.test.mjs +4 -0
  183. package/foundation/fs/module-loader.d.mts +1 -0
  184. package/foundation/fs/module-loader.mjs +50 -1
  185. package/foundation/fs/module-loader.stdout.test.mjs +332 -0
  186. package/foundation/fs/path-safety.d.mts +3 -2
  187. package/foundation/fs/path-safety.mjs +49 -19
  188. package/foundation/fs/path-safety.test.mjs +50 -0
  189. package/foundation/fs/publish-file-hardlink-unavailable.test.mjs +129 -94
  190. package/foundation/integrations/autolink.mjs +6 -1
  191. package/foundation/response/base.d.ts +8 -4
  192. package/foundation/response/error-codes.doc.mjs +1 -2
  193. package/foundation/response/error-codes.mjs +1 -1
  194. package/foundation/response/error-codes.test.mjs +83 -0
  195. package/foundation/response/json-contract.test.mjs +11 -0
  196. package/foundation/response/json.d.mts +4 -2
  197. package/foundation/response/json.mjs +8 -10
  198. package/foundation/response/response-types.doc.mjs +10 -10
  199. package/foundation/response/response-types.doc.test.mjs +158 -0
  200. package/foundation/xle/expand.d.mts +2 -0
  201. package/foundation/xle/expand.mjs +3 -2
  202. package/foundation/xle/expand.test.mjs +54 -0
  203. package/package.json +9 -9
  204. package/clients/cli/lib/update-check.mjs +0 -83
  205. package/clients/cli/lib/update-check.test.mjs +0 -137
  206. package/clients/cli/update-hint-commands.test.mjs +0 -54
package/README.md CHANGED
@@ -51,8 +51,8 @@ Options:
51
51
 
52
52
  - `--type <component|hook|doc|template>`: restrict to a single domain
53
53
  - `--limit <n>`: cap the number of results (default 20)
54
- - `--detail`: include the import path and the match reason/score
55
- - `--json`: typed `{ type: 'search', data: { query, matchCount, results } }` envelope — `matchCount` is how many candidates matched in total, `results` the slice `--limit` allowed
54
+ - `--verbose`: also print each result's match score and reason
55
+ - `--json`: typed `{ apiVersion, type: 'search', data: { query, matchCount, results } }` envelope — `matchCount` is how many candidates matched in total, `results` the slice `--limit` allowed
56
56
 
57
57
  ## Commands
58
58
 
@@ -84,7 +84,7 @@ Options:
84
84
 
85
85
  These flags work with any command:
86
86
 
87
- - `--json`: Output as typed JSON envelope: `{ type, data }` (errors: `{ error, code, suggestions? }`)
87
+ - `--json`: Output as typed JSON envelope: `{ apiVersion, type, data, meta? }` (errors: `{ apiVersion, error, code, suggestions? }`)
88
88
  - `--detail <level>`: Detail level for list views, increasing in size: `brief` (names only, default for `--list`) < `compact` (names + 1-line descriptions) < `full` (full docs per entry). Single-item views default to `full`.
89
89
  - `--zh`: Output docs in Chinese Simplified
90
90
  - `--dense`: Compressed format (token-efficient, useful for AI agents)
@@ -95,13 +95,14 @@ These flags work with any command:
95
95
  Every command supports `--json` for machine-readable output. Responses are typed envelopes:
96
96
 
97
97
  ```json
98
- {"type": "component.detail", "data": {"name": "Button", ...}}
98
+ {"apiVersion": 1, "type": "component.detail", "data": {"name": "Button", ...}}
99
99
  ```
100
100
 
101
101
  Errors:
102
102
 
103
103
  ```json
104
104
  {
105
+ "apiVersion": 1,
105
106
  "error": "No component named \"Buttn\"",
106
107
  "code": "ERR_UNKNOWN_COMPONENT",
107
108
  "suggestions": [{"name": "Button", "reason": "similar name"}]
@@ -175,7 +176,7 @@ if (isError(result)) {
175
176
  | `ERR_NO_SOURCE` | No source file could be located for the requested component/template. |
176
177
  | `ERR_INVALID_DOC` | A component's docs failed validation (malformed `.doc.mjs`). |
177
178
  | `ERR_FILE_NOT_FOUND` | A required input file did not exist. |
178
- | `ERR_FILE_EXISTS` | Refused to overwrite an existing file in non-interactive mode. |
179
+ | `ERR_FILE_EXISTS` | Refused to overwrite an existing file. |
179
180
  | `ERR_PATH_TRAVERSAL` | A path escaped its allowed root, or a name contained traversal markers. |
180
181
  | `ERR_WRITE_FAILED` | Writing output files failed (and was rolled back). |
181
182
  | `ERR_THEME_INVALID` | A theme definition or contributed theme catalog is invalid. |
@@ -199,8 +200,9 @@ if (isError(result)) {
199
200
 
200
201
  Agents don't have to scrape `--help` to learn the CLI. A single call returns a
201
202
  **self-describing manifest**: every command, its arguments, flags (with types,
202
- choices, and defaults), whether it supports `--json`, and the response `type`
203
- discriminators each command can emit. Think of it as an OpenAPI spec for the CLI.
203
+ choices, and defaults), whether it supports `--json`, the response `type`
204
+ discriminators each command can emit, and its documented exit codes. Think of it
205
+ as an OpenAPI spec for the CLI.
204
206
 
205
207
  ```bash
206
208
  astryx manifest --json # dedicated surface — type: "manifest"
@@ -262,6 +264,10 @@ Shape:
262
264
  "…",
263
265
  ],
264
266
  "examples": ["astryx component Button --props --json"],
267
+ "exitCodes": [
268
+ {"code": 0, "when": "success"},
269
+ {"code": 1, "when": "…"},
270
+ ],
265
271
  },
266
272
  // …one entry per command; subcommands (e.g. `theme build`) nest under `subcommands`
267
273
  ],
@@ -343,9 +349,9 @@ import type {
343
349
  // ...import the response types for the commands you consume
344
350
  } from '@astryxdesign/cli/json';
345
351
 
346
- // parseResponse returns the structural { type, data, meta? } envelope; `data`
347
- // is `unknown` until you narrow it. Reconstruct the union you care about from
348
- // the per-command response types, then narrow on `type`:
352
+ // parseResponse returns the structural { apiVersion, type, data, meta? }
353
+ // envelope; `data` is `unknown` until you narrow it. Reconstruct the union you
354
+ // care about from the per-command response types, then narrow on `type`:
349
355
  type MyResponse =
350
356
  ComponentDetailResponse | ComponentListResponse | DocsListResponse;
351
357
 
@@ -391,63 +397,63 @@ Every response has a `type` discriminant. The full set is below (generated from
391
397
 
392
398
  <!-- BEGIN GENERATED: response-types -->
393
399
 
394
- | Type | What `data` carries |
395
- | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
396
- | `init.run` | The install receipt: the `mode` (`default` \| `features`), the features run, agent-doc files written, any soft `docsError`, whether theme guidance was emitted, the template outcome (`workflow` \| `created` \| `skipped`) plus its path, and whether the next-steps were emitted. |
397
- | `init.remove` | Confirmation that the managed agent-docs block was removed (`data.removed: true`) — returned when --remove-agents is set. |
398
- | `component.list` | The component catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of names entries ({name, package, and optional canonical import for integrations}), brief entries, or a full ComponentDoc per entry. |
399
- | `component.detail` | One component's authored ComponentDoc plus ownership metadata (owner package, import specifier, and whether source is available). |
400
- | `component.detail.props` | Just one component's props table (ComponentPropDoc[]). |
401
- | `component.detail.source` | One component's source file, as {component, source}. |
402
- | `component.detail.showcase` | One component's showcase example, as {component, aspectRatio, source}. |
403
- | `component.detail.blocks` | One component's example blocks, as {component, showcase, examples, related} of BlockEntry. |
404
- | `docs.list` | All reference-doc topics as DocsListEntry[] ({topic, description}), in discovery order. |
405
- | `docs.detail` | One topic's full ReferenceDoc, with token-ref blocks inlined. |
406
- | `docs.index` | One topic's section index (--index): each section's key, title, and one-line summary. |
407
- | `docs.detail.section` | One ReferenceSection of a topic, found by key or title, with token-ref blocks inlined. |
408
- | `blog.list` | The feed URL plus every post parsed from the RSS feed, each with slug, title, description, date, type, authors, link, and plaintext URL. |
409
- | `blog.detail` | One post's metadata plus the feed URL and the post's full plaintext body. |
410
- | `discover.list` | The configured external packages (name, category, components, version, description); when empty it carries meta.configured to tell "nothing configured" from "nothing discovered". |
411
- | `discover.detail` | A single external package entry, for an @scope/name query. |
412
- | `discover.detail.doc` | The validated ComponentDoc for one external component: an @scope/name/Component query, or a free-text term resolving to exactly one component. |
413
- | `discover.search` | The echoed query plus the matching {package, component} pairs, when a free-text term matches several components. |
414
- | `search` | The echoed query, `matchCount` (how many candidates matched in total, before `limit`), plus a ranked SearchResultEntry[] bounded by `limit` (domain, name, score, reason, description, follow-up command, and import path where relevant). |
415
- | `build.help` | A marker (`playbook: true`) that the renderer expands into the how-to-build-a-page workflow; emitted when no query is given. |
416
- | `build.kit` | The grouped composition kit: echoed query, hasResults/matchCount/directMatch fields (matchCount is the total matched, never a cap read back), the closest page templates, drop-in block patterns, idea-specific components/hooks, and the always-on frame + foundation component-name arrays. |
417
- | `swizzle.list` | The names of swizzlable components discoverable from cwd's @astryxdesign/core. |
418
- | `swizzle.copy` | An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and an optional maintainer note. |
419
- | `gap-report.categories` | The fixed gap category values and human-readable labels. |
420
- | `gap-report.file` | An aggregate receipt with overall status, the selected package and issues URL, ordered per-handler deliveries, and filedCount/routedOnlyCount totals. |
421
- | `template.list` | Every discovered template (page + block); each entry carries id, name, description, kind, owning package, optional category and componentsUsed, and readiness flags. |
422
- | `template.show` | The resolved template's raw source plus its description, kind, and the component names it composes. |
423
- | `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description and the components it composes. |
424
- | `template.copy` | A scaffold receipt: template id, output directory, written file name, and file count. |
425
- | `template.cdn` | A write receipt for the no-build-step CDN starter page: the path (relative to cwd), the Astryx version every CDN URL was pinned to, whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
426
- | `hook.list` | The hook catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of hook names, brief entries, or a full HookDoc per entry. |
427
- | `hook.detail` | One hook's full authored HookDoc. |
428
- | `hook.detail.params` | Just one hook's parameters table (HookParamDoc[]). |
429
- | `theme.build` | A theme build receipt: name, token- and component-override counts, output size, the written outputs {css, js, dts, and variantsDts when applicable}, and any validation warnings. |
430
- | `theme.build.check` | The --check receipt: theme name, an upToDate flag, the stale outputs (each {path, reason: missing \| outdated}), and the full list of checked paths. Writes nothing. |
431
- | `theme.build.batch` | Several themes built in one invocation: `count` plus one {file, receipt} per theme in argument order, where receipt is that theme's theme.build (or theme.build.check) envelope, or null when it produced no CSS. |
432
- | `theme.list` | Every bundled or installed integration theme as a ThemeListEntry[]: each with slug, displayName, description, maintained flag, and owner package. |
433
- | `theme.add` | A scaffold receipt: resolved slug, displayName, maintained flag, owner package, outputDir (relative to cwd), the theme entry file, its exportName, and the files written. |
434
- | `theme.template` | A write receipt for the annotated theme template: the path (relative to cwd), whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
435
- | `theme.targets` | The whole themeable surface: the echoed filter, the component count, and one entry per theming target — {key, className, component, props, states}, where props and states are its legal override keys. |
436
- | `theme.palette.generate` | An author-reviewable OKLCH palette candidate, its reproducibility receipt, summary counts, and optional candidate/receipt file-write result. |
437
- | `upgrade.list` | Every available codemod, oldest→newest, as {name, title, version, optional}; returned for --list without running anything. |
438
- | `upgrade.status` | A short-circuit outcome with no codemods run (up_to_date, no_codemods, or config_fixable), each carrying the agent-docs summary. |
439
- | `upgrade.run` | The run receipt: from/to versions, codemod count, integrations processed, the agent-docs summary, and (apply mode) filesChanged, transformsApplied, and per-codemod errors. |
440
- | `manifest` | The self-describing CLI capability manifest: name, version, apiVersion, global options, the command tree (args, options, json flag, response types, examples), the jsonSupported allowlist, and the flat responseTypes index. |
441
- | `doctor` | The health-check report: `checks` (each with id, label, status: pass \| warn \| fail \| info, a message, and a fix when not passing) plus a `summary` of counts per status. |
442
- | `integration.add` | A contribution-writer receipt: kind, name, optional root {path, created}, integration-manifest path, every affected project-relative path, written, and dryRun. |
443
- | `integration.pack-check` | The packed-package check: package identity, tarball facts, local and packed contribution inventories, and issues. |
444
- | `integration.validate` | The validation result: the package name and version (both null when no local manifest is found) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning \| error, message}. |
445
- | `integration.template-conflicts` | The integration identity, structural issues, and non-blocking conflicts where an integration template id is also owned by Core; each conflict includes the exact package-qualified command. |
446
- | `integration.component-conflicts` | The integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command. |
447
- | `integration.doc-conflicts` | The integration identity, structural issues, and Core doc overlaps classified as intentional replacements, intentional extensions, or accidental same-name conflicts. |
448
- | `layout.expand` | The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, and written (the output path, or null when nothing was written). |
449
- | `layout.check` | The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline). |
450
- | `layout.grammar` | The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry. |
400
+ | Type | What `data` carries |
401
+ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
402
+ | `init.run` | The install receipt: the `mode` (`default` \| `features`), the features run, agent-doc files written, any soft `docsError`, whether theme guidance was emitted, the template outcome (`workflow` \| `created` \| `skipped`) plus its path, and whether the next-steps were emitted. |
403
+ | `init.remove` | Confirmation that the managed agent-docs block was removed (`data.removed: true`) — returned when --remove-agents is set. |
404
+ | `component.list` | The component catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of names entries ({name, package, and optional canonical import for integrations}), brief entries, or a full ComponentDoc per entry. |
405
+ | `component.detail` | One component's authored ComponentDoc plus ownership fields (package, the owner; import, the specifier; sourceAvailable, whether source exists) and parentDoc (present when the component is documented inside another component's doc, naming that doc). |
406
+ | `component.detail.props` | Just one component's props table (ComponentPropDoc[]). |
407
+ | `component.detail.source` | One component's source file, as {component, source}. |
408
+ | `component.detail.showcase` | One component's showcase example, as {component, aspectRatio, source}. |
409
+ | `component.detail.blocks` | One component's example blocks, as {component, showcase, examples, related} of BlockEntry. |
410
+ | `docs.list` | All reference-doc topics as DocsListEntry[] ({topic, description}), in discovery order. |
411
+ | `docs.detail` | One topic's full ReferenceDoc, with token-ref blocks inlined. |
412
+ | `docs.index` | One topic's section index (--index): the topic's name, title, and description, plus sections, each {id, title, summary} (pass the id as the section argument; summary is the section's one-line summary). |
413
+ | `docs.detail.section` | One ReferenceSection of a topic, found by key or title, with token-ref blocks inlined. |
414
+ | `blog.list` | The feed URL plus every post parsed from the RSS feed, each with slug, title, description, date, type, authors, link, and plaintext URL. |
415
+ | `blog.detail` | One post's metadata plus the feed URL and the post's full plaintext body. |
416
+ | `discover.list` | The configured external packages (name, category, components, version, description); when empty it carries meta.configured to tell "nothing configured" from "nothing discovered". |
417
+ | `discover.detail` | A single external package entry, for an @scope/name query. |
418
+ | `discover.detail.doc` | The validated ComponentDoc for one external component: an @scope/name/Component query, or a free-text term resolving to exactly one component. |
419
+ | `discover.search` | The echoed query plus the matching {package, component} pairs, when a free-text term matches several components. |
420
+ | `search` | The echoed query, `matchCount` (total matches, before `limit`), and results, a ranked SearchResultEntry[] bounded by `limit`: each {domain, name, score, reason, description, command}, plus import (components, hooks), title (docs), or displayName and kind (templates). |
421
+ | `build.help` | The how-to-build-a-page playbook, emitted when no query is given: `playbook: true`, a title, the ordered steps (title, commands, optional returns), the on-system rules, and related lookups. Commands are bare subcommands for the caller to render with its own invocation. |
422
+ | `build.kit` | The composition kit: echoed query, hasResults, matchCount (total matched, never a cap), directMatch, pages (closest templates), blocks (drop-in patterns) and domain (idea components/hooks) as SearchResultEntry[], frame and foundation name arrays, and hint {reason, commands} when thin. |
423
+ | `swizzle.list` | The names of swizzlable components discoverable from cwd's @astryxdesign/core. |
424
+ | `swizzle.copy` | An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and an optional maintainer note. |
425
+ | `gap-report.categories` | The fixed gap category values and human-readable labels. |
426
+ | `gap-report.file` | An aggregate receipt: overall status, the selected package, issuesUrl (or null), deliveries in handler order, each {handlerType: project \| integration \| fallback, handler, audience, status, url, message}, and filedCount/routedOnlyCount totals. |
427
+ | `template.list` | Every discovered template (page + block); each entry carries id, name, description, kind, owning package, optional category and componentsUsed, and readiness flags. |
428
+ | `template.show` | The resolved template's raw source plus its description, kind, and the component names it composes. |
429
+ | `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description and the components it composes. |
430
+ | `template.copy` | A scaffold receipt: template id, output directory, written file name, and file count. |
431
+ | `template.cdn` | A write receipt for the no-build-step CDN starter page: the path (relative to cwd), the Astryx version every CDN URL was pinned to, whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
432
+ | `hook.list` | The hook catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of hook names, brief entries, or a full HookDoc per entry. |
433
+ | `hook.detail` | One hook's full authored HookDoc. |
434
+ | `hook.detail.params` | Just one hook's parameters table (HookParamDoc[]). |
435
+ | `theme.build` | A theme build receipt: name, tokenCount and componentCount (override counts), sizeKB, the written outputs {css, js, dts, and variantsDts when applicable}, warnings (defects to fix), and notices (advisories about a correct theme, such as a named font it does not load). |
436
+ | `theme.build.check` | The --check receipt: theme name, an upToDate flag, the stale outputs (each {path, reason: missing \| outdated}), and the full list of checked paths. Writes nothing. |
437
+ | `theme.build.batch` | Several themes built in one invocation: `count` plus one {file, receipt} per theme in argument order, where receipt is that theme's theme.build (or theme.build.check) envelope, or null when it produced no CSS. |
438
+ | `theme.list` | Every bundled or installed integration theme as a ThemeListEntry[]: each with slug, displayName, description, maintained flag, and owner package. |
439
+ | `theme.add` | A scaffold receipt: resolved slug, displayName, maintained flag, owner package, outputDir (relative to cwd), the theme entry file, its exportName, and the files written. |
440
+ | `theme.template` | A write receipt for the annotated theme template: the path (relative to cwd), whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
441
+ | `theme.targets` | The whole themeable surface: the echoed filter, componentCount, and targets, one per theming target — {key, className, component, props, states, deprecatedFor?}, where props and states are its legal override keys and deprecatedFor names the canonical replacement key. |
442
+ | `theme.palette.generate` | An author-reviewable OKLCH palette candidate, its reproducibility receipt, summary counts, and optional candidate/receipt file-write result. |
443
+ | `upgrade.list` | Every available codemod, oldest→newest, as {name, title, version, optional}; returned for --list without running anything. |
444
+ | `upgrade.status` | A short-circuit outcome with no codemods run (up_to_date, no_codemods, or config_fixable), each carrying the agent-docs summary. |
445
+ | `upgrade.run` | The run receipt: from/to versions, codemod count, integrations processed, the agent-docs summary, and (apply mode) filesChanged, transformsApplied, and per-codemod errors. |
446
+ | `manifest` | The CLI capability manifest: name, version, apiVersion, description, globalOptions, commands (each name, description, arguments, options, json, aliases?, responseTypes?, examples?, exitCodes? as [{code, when}], subcommands?), jsonSupported, and the flat responseTypes index. |
447
+ | `doctor` | The health-check report: `checks` (each with id, label, status: pass \| warn \| fail \| info, a message, and a fix when not passing) plus a `summary` of counts per status. |
448
+ | `integration.add` | A contribution-writer receipt: kind, name, optional root {path, created}, integration-manifest path, every affected project-relative path, written, and dryRun. |
449
+ | `integration.pack-check` | The packed-package check: name, version, packable, tarball {filename, fileCount, size, unpackedSize} or null, inventory {manifest, roots [{kind, path, expectedFiles, missingFiles, complete}], expectedFiles, packedFiles}, contributions {local, packed}, each null or {themes [{slug, exportName}], components, templates [{id, type, name}], codemods [{version, id}], docs, agentDocsAppend}, and issues [{code, severity, message}]. |
450
+ | `integration.validate` | The validation result: the package name and version (both null when no local manifest is found) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning \| error, message}. |
451
+ | `integration.template-conflicts` | The integration identity, structural issues, and non-blocking conflicts where an integration template id is also owned by Core; each conflict includes the exact package-qualified command. |
452
+ | `integration.component-conflicts` | The integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command. |
453
+ | `integration.doc-conflicts` | The integration identity, structural issues, and Core doc overlaps classified as intentional replacements, intentional extensions, or accidental same-name conflicts. |
454
+ | `layout.expand` | The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, and written (the output path, or null when nothing was written). |
455
+ | `layout.check` | The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline). |
456
+ | `layout.grammar` | The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry. |
451
457
 
452
458
  <!-- END GENERATED: response-types -->
453
459
  <!-- Generated by scripts/generate-cli-readme.mjs from the response-types EnumDoc. Run `pnpm -F @astryxdesign/cli readme`. -->
@@ -456,25 +462,33 @@ Every response has a `type` discriminant. The full set is below (generated from
456
462
 
457
463
  `astryx doctor` runs read-only health checks against your project and
458
464
  environment. Each record uses `[ok]`, `[warn]`, `[fail]`, or `[info]`, and
459
- includes an actionable `fix` when one is available. The exact checks and values
460
- depend on the project; the output shape is stable:
465
+ includes an actionable `fix` when one is available. Field names match the
466
+ `--json` keys. The exact checks and values depend on the project; the output
467
+ shape is stable:
461
468
 
462
469
  ```
463
470
  $ astryx doctor
464
471
  astryx doctor - diagnosing your setup
465
472
 
473
+ id: node-version
466
474
  status: [ok]
467
- check: Node.js version
475
+ label: Node.js version
468
476
  message: Node v24.18.1 meets the minimum (>=22.13.0).
469
477
 
478
+ id: themes
470
479
  status: [warn]
471
- check: Theme packages
480
+ label: Theme packages
472
481
  message: No @astryxdesign/theme-* packages are installed.
473
482
  fix: Install a theme, e.g. `npm install @astryxdesign/theme-neutral`, then import its CSS or set astryx.theme.
474
483
 
475
484
  ...
476
485
 
477
- Summary: 4 passed, 2 warnings, 0 failures, 2 info
486
+ summary
487
+
488
+ pass: 4
489
+ warn: 2
490
+ fail: 0
491
+ info: 2
478
492
 
479
493
  No failures - but review the [warn] warnings above when you can.
480
494
  ```
@@ -16,8 +16,8 @@ export const doc = {
16
16
  'Page-building assistant: the how-to-build playbook, or a composition kit for an idea.',
17
17
  description:
18
18
  'The "assemble a page" entry point. Called with no query it returns the ' +
19
- 'playbook signal that the renderer expands into the how-to-build-a-page ' +
20
- 'workflow. Called with a query it runs the unified search and groups the ' +
19
+ 'how-to-build-a-page playbook as data: the workflow steps with their ' +
20
+ 'commands, the on-system rules, and related lookups. Called with a query it runs the unified search and groups the ' +
21
21
  'hits into a composition KIT: the closest page templates, drop-in blocks, ' +
22
22
  'and idea-specific components/hooks, plus the always-on frame + foundation.',
23
23
  importPath: '@astryxdesign/cli/api',
@@ -54,7 +54,7 @@ export const doc = {
54
54
  {
55
55
  type: 'build.help',
56
56
  description:
57
- 'Emitted when the query is omitted: a pure marker (`data.playbook: true`) that the command renderer expands into the page-building workflow prose.',
57
+ 'Emitted when the query is omitted: the page-building playbook — `playbook: true`, a `title`, the ordered `steps` (each a `title`, its `commands`, and optionally what the step `returns`), the on-system `rules`, and `related` lookups. Each command is a bare subcommand ({command, purpose?}) for the caller to render with its own CLI invocation.',
58
58
  },
59
59
  {
60
60
  type: 'build.kit',
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file Tests for the build API (playbook signal + composition kit).
4
+ * @file Tests for the build API (playbook + composition kit).
5
5
  */
6
6
 
7
7
  import {describe, it, expect, vi} from 'vitest';
@@ -20,10 +20,21 @@ const REPO = path.resolve(
20
20
  vi.setConfig({testTimeout: 30000});
21
21
 
22
22
  describe('build API', () => {
23
- it('no query → build.help playbook signal', async () => {
23
+ it('no query → build.help carries the playbook as data', async () => {
24
24
  const r = await build();
25
25
  expect(r.type).toBe('build.help');
26
- expect(r.data).toEqual({playbook: true});
26
+ if (r.type !== 'build.help') return;
27
+ expect(r.data.playbook).toBe(true);
28
+ expect(r.data.title).toMatch(/build a page/i);
29
+ expect(r.data.steps.length).toBeGreaterThan(0);
30
+ for (const step of r.data.steps) {
31
+ expect(step.title).toBeTruthy();
32
+ expect(step.commands.length).toBeGreaterThan(0);
33
+ }
34
+ expect(r.data.rules.length).toBeGreaterThan(0);
35
+ // Bare subcommands: the caller adds its own invocation.
36
+ const commands = [...r.data.steps.flatMap(s => s.commands), ...r.data.related];
37
+ for (const {command} of commands) expect(command).not.toMatch(/^(astryx|npx|pnpm|yarn|bunx?)\b/);
27
38
  });
28
39
 
29
40
  it('query → build.kit with raw entries + static frame/foundation', async () => {
@@ -2,12 +2,46 @@
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
4
  /**
5
- * astryx --json build (no query) — the "how to build a page" playbook signal.
5
+ * A command the playbook tells the caller to run.
6
+ */
7
+ export type BuildPlaybookCommand = {
8
+ /**
9
+ * Bare subcommand with `<placeholder>` arguments (e.g. `template <name> --skeleton`) and no package-manager prefix — render it with your own CLI invocation.
10
+ */
11
+ command: string;
12
+ /**
13
+ * What running it is for.
14
+ */
15
+ purpose?: string | undefined;
16
+ };
17
+ /**
18
+ * One step of the page-building workflow.
19
+ */
20
+ export type BuildPlaybookStep = {
21
+ /**
22
+ * What to do.
23
+ */
24
+ title: string;
25
+ /**
26
+ * The commands for this step, in the order to run them.
27
+ */
28
+ commands: BuildPlaybookCommand[];
29
+ /**
30
+ * What the step's command gives back, when that decides the next step.
31
+ */
32
+ returns?: string | undefined;
33
+ };
34
+ /**
35
+ * astryx --json build (no query) — the "how to build a page" playbook.
6
36
  */
7
37
  export type BuildHelpResponse = {
8
38
  type: "build.help";
9
39
  data: {
10
40
  playbook: true;
41
+ title: string;
42
+ steps: BuildPlaybookStep[];
43
+ rules: string[];
44
+ related: BuildPlaybookCommand[];
11
45
  };
12
46
  };
13
47
  /**
@@ -2,17 +2,38 @@
2
2
 
3
3
  /**
4
4
  * @file Colocated types for the `build` command — source of truth for the
5
- * `build.help` (playbook signal) and `build.kit` (composition kit) JSON
6
- * responses. Re-exported by types/build.d.ts.
5
+ * `build.help` (playbook) and `build.kit` (composition kit) JSON responses.
6
+ * Re-exported by types/build.d.ts.
7
7
  */
8
8
 
9
9
  /**
10
- * astryx --json build (no query) — the "how to build a page" playbook signal.
10
+ * A command the playbook tells the caller to run.
11
+ *
12
+ * @typedef {object} BuildPlaybookCommand
13
+ * @property {string} command Bare subcommand with `<placeholder>` arguments (e.g. `template <name> --skeleton`) and no package-manager prefix — render it with your own CLI invocation.
14
+ * @property {string} [purpose] What running it is for.
15
+ */
16
+
17
+ /**
18
+ * One step of the page-building workflow.
19
+ *
20
+ * @typedef {object} BuildPlaybookStep
21
+ * @property {string} title What to do.
22
+ * @property {BuildPlaybookCommand[]} commands The commands for this step, in the order to run them.
23
+ * @property {string} [returns] What the step's command gives back, when that decides the next step.
24
+ */
25
+
26
+ /**
27
+ * astryx --json build (no query) — the "how to build a page" playbook.
11
28
  *
12
29
  * @typedef {object} BuildHelpResponse
13
30
  * @property {'build.help'} type
14
31
  * @property {object} data
15
32
  * @property {true} data.playbook Always true; marks this envelope as the playbook rather than a result set.
33
+ * @property {string} data.title The playbook's heading.
34
+ * @property {BuildPlaybookStep[]} data.steps The workflow, in order.
35
+ * @property {string[]} data.rules The rules that keep a page on-system.
36
+ * @property {BuildPlaybookCommand[]} data.related Lookups to reach for alongside the workflow.
16
37
  */
17
38
 
18
39
  /**
@@ -2,14 +2,17 @@
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
4
  /**
5
- * @file build.help leaf — the "how to build a page" playbook signal.
5
+ * @file build.help leaf — the "how to build a page" playbook.
6
6
  *
7
- * `build` with no query returns this envelope: a pure marker that the command
8
- * renderer expands into the workflow playbook prose. It carries no data beyond
9
- * `playbook: true`, so the JSON shape stays environment-agnostic and stable.
7
+ * `build` with no query returns this envelope. The playbook is data — steps,
8
+ * rules, and related lookups — so a `--json` or programmatic caller gets the
9
+ * same guidance the terminal shows. Commands are bare subcommands with no
10
+ * package-manager prefix, which keeps the JSON environment-agnostic; the CLI
11
+ * renders each one with the caller's invocation, as it does build.kit's
12
+ * `hint.commands`.
10
13
  */
11
14
  /**
12
- * The page-building playbook signal (emitted when `build` runs with no query).
15
+ * The page-building playbook (emitted when `build` runs with no query).
13
16
  *
14
17
  * @returns {import('../build.type.mjs').BuildHelpResponse}
15
18
  */
@@ -1,18 +1,68 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file build.help leaf — the "how to build a page" playbook signal.
4
+ * @file build.help leaf — the "how to build a page" playbook.
5
5
  *
6
- * `build` with no query returns this envelope: a pure marker that the command
7
- * renderer expands into the workflow playbook prose. It carries no data beyond
8
- * `playbook: true`, so the JSON shape stays environment-agnostic and stable.
6
+ * `build` with no query returns this envelope. The playbook is data — steps,
7
+ * rules, and related lookups — so a `--json` or programmatic caller gets the
8
+ * same guidance the terminal shows. Commands are bare subcommands with no
9
+ * package-manager prefix, which keeps the JSON environment-agnostic; the CLI
10
+ * renders each one with the caller's invocation, as it does build.kit's
11
+ * `hint.commands`.
9
12
  */
10
13
 
11
14
  /**
12
- * The page-building playbook signal (emitted when `build` runs with no query).
15
+ * The page-building playbook (emitted when `build` runs with no query).
13
16
  *
14
17
  * @returns {import('../build.type.mjs').BuildHelpResponse}
15
18
  */
16
19
  export function buildHelp() {
17
- return {type: 'build.help', data: {playbook: true}};
20
+ return {
21
+ type: 'build.help',
22
+ data: {
23
+ playbook: true,
24
+ title: 'How to build a page with Astryx',
25
+ steps: [
26
+ {
27
+ title: "Find a starting point for what you're building",
28
+ commands: [{command: 'build "<what you\'re building>"'}],
29
+ returns:
30
+ 'the closest [page] template, the [block]s that cover parts, and the [component]s to fill the gaps, with a recommended start',
31
+ },
32
+ {
33
+ title: 'If a [page] template matches, scaffold it and adapt',
34
+ commands: [{command: 'template <name> [path]'}],
35
+ },
36
+ {
37
+ title: 'If nothing matches exactly, compose',
38
+ commands: [
39
+ {
40
+ command: 'template <name> --skeleton',
41
+ purpose: "study a close page's layout",
42
+ },
43
+ {
44
+ command: 'template <BlockName>',
45
+ purpose: 'drop in each block from the kit',
46
+ },
47
+ {
48
+ command: 'component <Name>',
49
+ purpose: 'fill remaining gaps (read props)',
50
+ },
51
+ ],
52
+ },
53
+ ],
54
+ rules: [
55
+ 'No <div>/raw HTML for layout — use VStack/HStack/Grid/Stack/Card etc.',
56
+ 'No style={{}} — use component props, and design tokens for values.',
57
+ 'Wrap the app in <Theme theme={...}> and import core reset.css + astryx.css.',
58
+ ],
59
+ related: [
60
+ {command: 'docs tokens', purpose: 'the design tokens'},
61
+ {
62
+ command: 'search <query>',
63
+ purpose: 'a neutral lookup of any component, doc, or template',
64
+ },
65
+ ],
66
+ },
67
+ };
18
68
  }
@@ -91,7 +91,8 @@ export const doc = {
91
91
  {
92
92
  name: 'options.lang',
93
93
  type: 'string',
94
- description: 'Language code for localized doc content.',
94
+ description:
95
+ "Language code for localized doc content: 'en', 'zh', or 'dense'.",
95
96
  },
96
97
  {
97
98
  name: 'options.zh',
@@ -108,12 +109,12 @@ export const doc = {
108
109
  {
109
110
  type: 'component.list',
110
111
  description:
111
- "The catalog grouped by category. data.detail is the level ('names' | 'compact' | 'full') and data.components is the grouped map: names entries with name, package, and an optional canonical import for integrations; brief entries; or full ComponentDoc entries.",
112
+ "The catalog grouped by category. data.detail is the level ('names' | 'compact' | 'full') and data.components is the grouped map: names entries with name, package, and an optional canonical import for integration and legacy package components; brief entries; or full ComponentDoc entries.",
112
113
  },
113
114
  {
114
115
  type: 'component.detail',
115
116
  description:
116
- "One component's authored ComponentDoc plus ownership metadata (owner package, import specifier, whether source is available).",
117
+ "One component's authored ComponentDoc plus ownership metadata (owner package, import specifier, whether source is available). When the name is a sub-component documented in a parent's doc, the payload is scoped to it and parentDoc names that parent.",
117
118
  },
118
119
  {
119
120
  type: 'component.detail.props',
@@ -135,6 +136,14 @@ export const doc = {
135
136
  },
136
137
  ],
137
138
  throws: [
139
+ {
140
+ code: 'ERR_INVALID_DETAIL',
141
+ when: "options.detail is not 'full', 'compact', or 'brief'",
142
+ },
143
+ {
144
+ code: 'ERR_INVALID_LANG',
145
+ when: "options.lang is set to anything other than 'en', 'zh', or 'dense'",
146
+ },
138
147
  {
139
148
  code: 'ERR_CORE_NOT_FOUND',
140
149
  when: '@astryxdesign/core cannot be resolved from cwd',