@astryxdesign/cli 0.7.2 → 0.7.3-canary.0bf23bd

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 (337) hide show
  1. package/README.md +104 -71
  2. package/api/build/_adapter.d.mts +58 -0
  3. package/api/build/_adapter.mjs +115 -3
  4. package/api/build/blocks/blocks.d.mts +42 -0
  5. package/api/build/blocks/blocks.mjs +169 -0
  6. package/api/build/blocks/blocks.test.mjs +108 -0
  7. package/api/build/blocks/blocks.weights.json +1 -0
  8. package/api/build/build.mjs +25 -6
  9. package/api/build/kit/answer.d.mts +14 -0
  10. package/api/build/kit/answer.mjs +85 -0
  11. package/api/build/kit/answer.test.mjs +38 -0
  12. package/api/build/kit/kind.d.mts +25 -0
  13. package/api/build/kit/kind.mjs +170 -0
  14. package/api/build/kit/kit.d.mts +2 -4
  15. package/api/build/kit/kit.mjs +8 -398
  16. package/api/build/kit/rank.d.mts +3 -32
  17. package/api/build/kit/rank.mjs +25 -342
  18. package/api/build/kit/rank.test.mjs +2 -1
  19. package/api/build/kit/signals.d.mts +60 -0
  20. package/api/build/kit/signals.mjs +284 -0
  21. package/api/build/kit/start.d.mts +32 -0
  22. package/api/build/kit/start.mjs +163 -0
  23. package/api/build/kit/words.d.mts +72 -0
  24. package/api/build/kit/words.mjs +202 -0
  25. package/api/build/tree.d.mts +20 -0
  26. package/api/build/tree.mjs +52 -0
  27. package/api/build/tree.test.mjs +177 -0
  28. package/api/build/tree.weights.json +1 -0
  29. package/api/component/component.mjs +17 -3
  30. package/api/component/component.test.mjs +15 -0
  31. package/api/component/doc-links.test.mjs +2 -2
  32. package/api/discover/_adapter.mjs +36 -9
  33. package/api/discover/_adapter.test.mjs +42 -0
  34. package/api/docs/_adapter.d.mts +2 -2
  35. package/api/docs/_adapter.mjs +78 -23
  36. package/api/docs/docs-homes.test.mjs +127 -0
  37. package/api/docs/docs.doc.mjs +3 -3
  38. package/api/docs/docs.test.mjs +35 -19
  39. package/api/docs/integration-tree.test.mjs +20 -20
  40. package/api/docs/integrationDocs.test.mjs +1 -1
  41. package/api/docs/namespace-section.test.mjs +6 -6
  42. package/api/docs/reference-blocks.test.mjs +2 -2
  43. package/api/doctor/doctor.mjs +102 -24
  44. package/api/doctor/doctor.test.mjs +37 -12
  45. package/api/hook/hook.mjs +1 -1
  46. package/api/init/init.doc.mjs +20 -6
  47. package/api/init/init.test.mjs +18 -2
  48. package/api/init/init.type.d.mts +3 -3
  49. package/api/init/init.type.mjs +3 -3
  50. package/api/init/remove/remove.mjs +17 -4
  51. package/api/init/remove/remove.test.mjs +114 -2
  52. package/api/init/run/run.mjs +69 -6
  53. package/api/integration/_adapter.d.mts +8 -0
  54. package/api/integration/_adapter.mjs +21 -1
  55. package/api/integration/authoring-checks.mjs +83 -9
  56. package/api/integration/authoring-checks.test.mjs +220 -0
  57. package/api/integration/pack-check.mjs +123 -4
  58. package/api/integration/pack-check.test.mjs +87 -0
  59. package/api/integration/validate-integration-case-disk.test.mjs +111 -0
  60. package/api/integration/validate-integration-gaps.test.mjs +1964 -0
  61. package/api/integration/validate-integration.d.mts +11 -2
  62. package/api/integration/validate-integration.mjs +250 -32
  63. package/api/integration/validate-integration.type.d.mts +59 -1
  64. package/api/integration/validate-integration.type.mjs +46 -2
  65. package/api/integration/validateIntegration.doc.mjs +1 -1
  66. package/api/search/ORDERING.md +28 -0
  67. package/api/search/_adapter.d.mts +82 -2
  68. package/api/search/_adapter.mjs +157 -10
  69. package/api/search/_adapter.test.mjs +173 -0
  70. package/api/search/_candidate-score.d.mts +40 -0
  71. package/api/search/_candidate-score.mjs +238 -0
  72. package/api/search/_cards.json +6098 -0
  73. package/api/search/_compound.d.mts +50 -0
  74. package/api/search/_compound.mjs +170 -0
  75. package/api/search/_doc-searcher.d.mts +4 -0
  76. package/api/search/_doc-searcher.mjs +23 -0
  77. package/api/search/_doc-searcher.test.mjs +36 -0
  78. package/api/search/_doc-searcher.weights.json +1 -0
  79. package/api/search/_doc-text.d.mts +30 -0
  80. package/api/search/_doc-text.mjs +87 -0
  81. package/api/search/_entries.d.mts +52 -0
  82. package/api/search/_entries.mjs +214 -0
  83. package/api/search/_features.d.mts +35 -0
  84. package/api/search/_features.mjs +155 -0
  85. package/api/search/_gather-components.d.mts +26 -0
  86. package/api/search/_gather-components.mjs +284 -0
  87. package/api/search/_gather-docs.d.mts +20 -0
  88. package/api/search/_gather-docs.mjs +254 -0
  89. package/api/search/_gather-hooks.d.mts +12 -0
  90. package/api/search/_gather-hooks.mjs +52 -0
  91. package/api/search/_gather-templates.d.mts +25 -0
  92. package/api/search/_gather-templates.mjs +107 -0
  93. package/api/search/_lexical.d.mts +135 -0
  94. package/api/search/_lexical.mjs +351 -0
  95. package/api/search/_main-searcher.d.mts +19 -0
  96. package/api/search/_main-searcher.mjs +115 -0
  97. package/api/search/_main-searcher.test.mjs +106 -0
  98. package/api/search/_main-searcher.weights.json +1 -0
  99. package/api/search/_module-doc.d.mts +32 -0
  100. package/api/search/_module-doc.mjs +78 -0
  101. package/api/search/_order.d.mts +32 -0
  102. package/api/search/_order.mjs +162 -0
  103. package/api/search/_order.test.mjs +72 -0
  104. package/api/search/_priority.d.mts +50 -0
  105. package/api/search/_priority.mjs +139 -0
  106. package/api/search/_query-words.d.mts +25 -0
  107. package/api/search/_query-words.mjs +92 -0
  108. package/api/search/_query.d.mts +65 -0
  109. package/api/search/_query.mjs +176 -0
  110. package/api/search/_result.d.mts +97 -0
  111. package/api/search/_result.mjs +150 -0
  112. package/api/search/_score.d.mts +60 -0
  113. package/api/search/_score.mjs +283 -0
  114. package/api/search/_synonyms.d.mts +21 -0
  115. package/api/search/_synonyms.mjs +67 -0
  116. package/api/search/_template-searcher.d.mts +4 -0
  117. package/api/search/_template-searcher.mjs +23 -0
  118. package/api/search/_template-searcher.test.mjs +40 -0
  119. package/api/search/_template-searcher.weights.json +1 -0
  120. package/api/search/_titles.d.mts +33 -0
  121. package/api/search/_titles.mjs +65 -0
  122. package/api/search/_words.d.mts +64 -0
  123. package/api/search/_words.mjs +157 -0
  124. package/api/search/search.d.mts +22 -305
  125. package/api/search/search.doc.mjs +8 -6
  126. package/api/search/search.mjs +56 -2482
  127. package/api/search/search.test.mjs +14 -14
  128. package/api/search/search.type.d.mts +6 -1
  129. package/api/search/search.type.mjs +6 -1
  130. package/api/search/tree.d.mts +15 -0
  131. package/api/search/tree.mjs +40 -0
  132. package/api/search/tree.test.mjs +66 -0
  133. package/api/search/tree.weights.json +1 -0
  134. package/api/theme/build/build.packed-old-core.test.mjs +1 -0
  135. package/api/upgrade/_adapter.d.mts +57 -9
  136. package/api/upgrade/_adapter.mjs +198 -28
  137. package/api/upgrade/registry/registry.d.mts +10 -4
  138. package/api/upgrade/registry/registry.mjs +33 -16
  139. package/api/upgrade/registry/registry.test.mjs +85 -0
  140. package/api/upgrade/run/run.d.mts +4 -2
  141. package/api/upgrade/run/run.mjs +13 -2
  142. package/api/upgrade/run/run.test.mjs +417 -3
  143. package/api/upgrade/upgrade.doc.mjs +10 -5
  144. package/api/upgrade/upgrade.mjs +13 -2
  145. package/api/upgrade/upgrade.test.mjs +194 -0
  146. package/api/upgrade/upgrade.type.d.mts +5 -3
  147. package/api/upgrade/upgrade.type.mjs +8 -6
  148. package/assets/codemods/transforms/v0.7.0/__tests__/validate-data-token-ownership.test.mjs +11 -0
  149. package/assets/codemods/transforms/v0.7.0/validate-data-token-ownership.mjs +3 -3
  150. package/assets/docs/author-a-theme.doc.mjs +2 -2
  151. package/assets/docs/is-my-code-good.doc.mjs +287 -0
  152. package/assets/docs/tree/add-a-component.doc.mjs +1 -1
  153. package/assets/docs/tree/add-a-theme.doc.mjs +1 -1
  154. package/assets/docs/tree/add-a-topic.doc.mjs +2 -2
  155. package/assets/docs/tree/agent-guidance.doc.mjs +1 -1
  156. package/assets/docs/tree/api.doc.mjs +6 -0
  157. package/assets/docs/tree/{integrations.doc.mjs → authoring.doc.mjs} +15 -6
  158. package/assets/docs/tree/block-template.doc.mjs +1 -1
  159. package/assets/docs/tree/build-the-template.doc.mjs +1 -1
  160. package/assets/docs/tree/building-blocks.doc.mjs +2 -2
  161. package/assets/docs/tree/check-the-props.doc.mjs +1 -1
  162. package/assets/docs/tree/check-your-docs.doc.mjs +2 -2
  163. package/assets/docs/tree/checks.doc.mjs +2 -2
  164. package/assets/docs/tree/cli-command.doc.mjs +1 -1
  165. package/assets/docs/tree/cli.doc.mjs +1 -1
  166. package/assets/docs/tree/codemods.doc.mjs +1 -1
  167. package/assets/docs/tree/component-family.doc.mjs +1 -1
  168. package/assets/docs/tree/component-imports.doc.mjs +1 -1
  169. package/assets/docs/tree/components.doc.mjs +1 -1
  170. package/assets/docs/tree/configuration.doc.mjs +1 -1
  171. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +1 -1
  172. package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
  173. package/assets/docs/tree/describe-the-component.doc.mjs +1 -1
  174. package/assets/docs/tree/docs.doc.mjs +1 -1
  175. package/assets/docs/tree/document-the-template.doc.mjs +1 -1
  176. package/assets/docs/tree/document-the-theme.doc.mjs +1 -1
  177. package/assets/docs/tree/export-template-assets.doc.mjs +1 -1
  178. package/assets/docs/tree/extend-or-replace.doc.mjs +1 -1
  179. package/assets/docs/{authoring.doc.mjs → tree/field-reference.doc.mjs} +4 -3
  180. package/assets/docs/tree/fonts-and-assets.doc.mjs +1 -1
  181. package/assets/docs/tree/generate-a-palette.doc.mjs +1 -1
  182. package/assets/docs/tree/global-integrations.doc.mjs +2 -2
  183. package/assets/docs/tree/grade-template-with-agent.doc.mjs +4 -4
  184. package/assets/docs/tree/help.doc.mjs +2 -2
  185. package/assets/docs/tree/host-entry.doc.mjs +128 -0
  186. package/assets/docs/tree/links.doc.mjs +1 -1
  187. package/assets/docs/tree/package-and-test.doc.mjs +1 -1
  188. package/assets/docs/tree/page-template.doc.mjs +1 -1
  189. package/assets/docs/tree/publishing.doc.mjs +1 -1
  190. package/assets/docs/tree/quick-start.doc.mjs +1 -1
  191. package/assets/docs/tree/replace-a-core-component.doc.mjs +1 -1
  192. package/assets/docs/tree/replace-a-core-template.doc.mjs +1 -1
  193. package/assets/docs/tree/sections-and-placement.doc.mjs +1 -1
  194. package/assets/docs/tree/see-it-in-an-app.doc.mjs +1 -1
  195. package/assets/docs/tree/ship.doc.mjs +2 -2
  196. package/assets/docs/tree/short-and-findable.doc.mjs +1 -1
  197. package/assets/docs/tree/single-component.doc.mjs +1 -1
  198. package/assets/docs/tree/start-a-template.doc.mjs +1 -1
  199. package/assets/docs/tree/subcomponent.doc.mjs +1 -1
  200. package/assets/docs/tree/template-assets.doc.mjs +1 -1
  201. package/assets/docs/tree/template-doc-overview.doc.mjs +2 -2
  202. package/assets/docs/tree/template-fonts.doc.mjs +1 -1
  203. package/assets/docs/tree/template-grading-rubric.doc.mjs +17 -38
  204. package/assets/docs/tree/template-icons.doc.mjs +1 -1
  205. package/assets/docs/tree/template-images-media.doc.mjs +1 -1
  206. package/assets/docs/tree/template-styles.doc.mjs +1 -1
  207. package/assets/docs/tree/templates.doc.mjs +1 -1
  208. package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
  209. package/assets/docs/tree/test-template-in-app.doc.mjs +1 -1
  210. package/assets/docs/tree/themes.doc.mjs +1 -1
  211. package/assets/docs/tree/tokens-data.doc.mjs +2 -2
  212. package/assets/docs/tree/troubleshooting.doc.mjs +1 -1
  213. package/assets/docs/tree/upgrading.doc.mjs +1 -1
  214. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +1 -1
  215. package/assets/docs/tree/verify-packed-template.doc.mjs +1 -1
  216. package/assets/docs/tree/versioning.doc.mjs +1 -1
  217. package/assets/docs/tree/write-good-templates.doc.mjs +1 -1
  218. package/assets/docs/tree/write-the-template-file.doc.mjs +1 -1
  219. package/assets/docs/use-integrations.doc.mjs +120 -0
  220. package/assets/docs/working-with-ai.doc.mjs +6 -2
  221. package/assets/templates/themes/butter/butterTheme.ts +4 -2
  222. package/assets/templates/themes/stone/stoneTheme.ts +4 -2
  223. package/assets/templates/themes/y2k/y2kTheme.ts +4 -2
  224. package/authoring/debug/parse.d.mts +1 -1
  225. package/authoring/doctypes/schema/schema.doc.mjs +1 -1
  226. package/authoring/integration/integration.doc.mjs +1 -1
  227. package/authoring/integration/type.ts +1 -1
  228. package/clients/cli/bin/astryx.mjs +7 -78
  229. package/clients/cli/command-result-coverage.test.mjs +6 -5
  230. package/clients/cli/commands/build-theme.color-scheme.test.mjs +1 -1
  231. package/clients/cli/commands/{component/index.mjs → component.mjs} +37 -37
  232. package/clients/cli/commands/component.test.mjs +6 -6
  233. package/clients/cli/commands/docs.doc.mjs +2 -2
  234. package/clients/cli/commands/docs.mjs +1 -1
  235. package/clients/cli/commands/docs.test.mjs +14 -14
  236. package/clients/cli/commands/doctor.mjs +30 -0
  237. package/clients/cli/commands/doctor.test.mjs +65 -0
  238. package/clients/cli/commands/{hook/index.mjs → hook.mjs} +22 -22
  239. package/clients/cli/commands/import-hint-correctness.test.mjs +1 -1
  240. package/clients/cli/commands/init.behavior.test.mjs +230 -1
  241. package/clients/cli/commands/init.doc.mjs +28 -9
  242. package/clients/cli/commands/init.flag-help.test.mjs +1 -0
  243. package/clients/cli/commands/init.mjs +2 -2
  244. package/clients/cli/commands/integration-check.test.mjs +48 -0
  245. package/clients/cli/commands/integration.doc.mjs +1 -1
  246. package/clients/cli/commands/manifest.doc.mjs +1 -1
  247. package/clients/cli/commands/manifest.mjs +67 -0
  248. package/clients/cli/commands/outside-project.test.mjs +2 -1
  249. package/clients/cli/commands/postinstall.doc.mjs +23 -0
  250. package/clients/cli/commands/postinstall.mjs +31 -0
  251. package/clients/cli/commands/setup-nudge.test.mjs +61 -0
  252. package/clients/cli/commands/{build-theme.mjs → theme.mjs} +1 -1
  253. package/clients/cli/commands/upgrade.doc.mjs +4 -2
  254. package/clients/cli/commands/upgrade.mjs +9 -2
  255. package/clients/cli/commands/upgrade.subfolder-path.test.mjs +97 -0
  256. package/clients/cli/index.mjs +29 -86
  257. package/clients/cli/lib/component-format.mjs +1 -1
  258. package/clients/cli/lib/define-command.mjs +12 -7
  259. package/clients/cli/lib/exit-codes.test.mjs +5 -0
  260. package/clients/cli/lib/manifest.test.mjs +12 -0
  261. package/clients/cli/lib/welcome-box.mjs +50 -0
  262. package/clients/cli/run.mjs +108 -0
  263. package/foundation/agent-docs/agent-doc-state.d.mts +20 -7
  264. package/foundation/agent-docs/agent-doc-state.mjs +35 -8
  265. package/foundation/agent-docs/agent-docs.d.mts +100 -12
  266. package/foundation/agent-docs/agent-docs.mjs +1012 -100
  267. package/foundation/agent-docs/agent-docs.path-safety.test.mjs +1239 -17
  268. package/foundation/agent-docs/agent-docs.test.mjs +683 -39
  269. package/foundation/config/project.mjs +20 -22
  270. package/foundation/config/project.test.mjs +56 -0
  271. package/foundation/discovery/authoring-self-docs.d.mts +7 -0
  272. package/foundation/discovery/authoring-self-docs.mjs +16 -4
  273. package/foundation/discovery/authoring-self-docs.test.mjs +15 -3
  274. package/foundation/discovery/authoring-surface.d.mts +1 -1
  275. package/foundation/discovery/authoring-surface.mjs +2 -2
  276. package/foundation/discovery/authoring-surface.test.mjs +1 -1
  277. package/foundation/discovery/cli-self-docs.d.mts +2 -1
  278. package/foundation/discovery/cli-self-docs.mjs +4 -3
  279. package/foundation/discovery/cli-self-docs.test.mjs +2 -2
  280. package/foundation/discovery/component-discovery.d.mts +37 -0
  281. package/foundation/discovery/component-discovery.mjs +80 -5
  282. package/foundation/discovery/component-loader.d.mts +1 -1
  283. package/foundation/discovery/docs-discovery.mjs +14 -1
  284. package/foundation/discovery/module-exports.d.mts +41 -0
  285. package/foundation/discovery/module-exports.mjs +253 -0
  286. package/foundation/discovery/runner-allowlist.d.mts +2 -4
  287. package/foundation/discovery/runner-allowlist.mjs +2 -4
  288. package/foundation/discovery/runner-commands.d.mts +77 -0
  289. package/foundation/discovery/runner-commands.mjs +294 -0
  290. package/foundation/discovery/runner-commands.test.mjs +128 -0
  291. package/foundation/discovery/stray-pointers.test.mjs +1 -1
  292. package/foundation/discovery/template-adapter.mjs +18 -1
  293. package/foundation/discovery/template-needs.mjs +1 -44
  294. package/foundation/discovery/theme-discovery.mjs +147 -3
  295. package/foundation/doc-compiler/doc-loads.test.mjs +33 -9
  296. package/foundation/doc-compiler/read.mjs +59 -1
  297. package/foundation/doc-compiler/read.test.mjs +11 -2
  298. package/foundation/doc-compiler/split-topic-keywords.test.mjs +3 -2
  299. package/foundation/doc-compiler/tree.d.mts +32 -6
  300. package/foundation/doc-compiler/tree.mjs +77 -43
  301. package/foundation/doc-compiler/tree.test.mjs +7 -7
  302. package/foundation/fs/paths.d.mts +70 -8
  303. package/foundation/fs/paths.mjs +556 -38
  304. package/foundation/fs/paths.test.mjs +430 -54
  305. package/foundation/fs/read-record.d.mts +18 -0
  306. package/foundation/fs/read-record.mjs +131 -0
  307. package/foundation/fs/read-record.test.mjs +77 -0
  308. package/foundation/integrations/autolink.d.mts +2 -1
  309. package/foundation/integrations/autolink.mjs +4 -13
  310. package/foundation/integrations/computer-integrations.d.mts +6 -3
  311. package/foundation/integrations/computer-integrations.mjs +38 -9
  312. package/foundation/integrations/contribution-inventory.d.mts +15 -20
  313. package/foundation/integrations/contribution-inventory.mjs +41 -5
  314. package/foundation/integrations/integrations.d.mts +27 -1
  315. package/foundation/integrations/integrations.mjs +61 -2
  316. package/foundation/integrations/validate-contributions.d.mts +115 -0
  317. package/foundation/integrations/validate-contributions.mjs +1168 -13
  318. package/foundation/release/handoff.d.mts +23 -4
  319. package/foundation/release/handoff.mjs +175 -8
  320. package/foundation/release/run-context.mjs +14 -0
  321. package/foundation/response/response-types.doc.mjs +1 -1
  322. package/foundation/route/route.d.mts +285 -0
  323. package/foundation/route/route.mjs +324 -0
  324. package/foundation/route/route.test.mjs +153 -0
  325. package/foundation/runtime/hosted-runtime.test.mjs +403 -0
  326. package/foundation/runtime/locked-versions.d.mts +32 -0
  327. package/foundation/runtime/locked-versions.mjs +65 -0
  328. package/foundation/runtime/package-root.d.mts +91 -0
  329. package/foundation/runtime/package-root.mjs +174 -0
  330. package/foundation/runtime/package-set.d.mts +62 -0
  331. package/foundation/runtime/package-set.mjs +130 -0
  332. package/foundation/runtime/package-set.test.mjs +432 -0
  333. package/host/door-conformance.test.mjs +274 -0
  334. package/host/index.d.ts +116 -0
  335. package/host/index.mjs +295 -0
  336. package/host/index.test.mjs +302 -0
  337. package/package.json +14 -9
@@ -17,14 +17,14 @@ export const docs = {
17
17
  "order": 20
18
18
  },
19
19
  "category": "foundations",
20
- "description": "Colors for charts and graphs: one categorical accent per series, a neutral for labels and reference lines, and sequential ramps from 5 (darkest) to 1 (lightest) for ordered scales and heatmaps. Import dataVars from @astryxdesign/core/theme/dataTokens.stylex for CSS-capable code. Retaining any member emits the complete 56-variable group; an unused graph emits none.",
20
+ "description": "Colors for charts and graphs: one categorical accent per series, a neutral for labels and reference lines, and sequential ramps from 5 (darkest) to 1 (lightest) for ordered scales and heatmaps. Import dataVars from @astryxdesign/core/theme/dataTokens.stylex for CSS-capable code. Source compilation emits the complete 56-variable group when any member is retained and none for an unused graph. Prebuilt CSS consumers load @astryxdesign/core/astryx.css, which defines the complete group for the already-compiled dataVars entry.",
21
21
  "sections": [
22
22
  {
23
23
  "title": "Data Visualization Tokens",
24
24
  "content": [
25
25
  {
26
26
  "type": "prose",
27
- "text": "Colors for charts and graphs: one categorical accent per series, a neutral for labels and reference lines, and sequential ramps from 5 (darkest) to 1 (lightest) for ordered scales and heatmaps. Import dataVars from @astryxdesign/core/theme/dataTokens.stylex for CSS-capable code. Retaining any member emits the complete 56-variable group; an unused graph emits none."
27
+ "text": "Colors for charts and graphs: one categorical accent per series, a neutral for labels and reference lines, and sequential ramps from 5 (darkest) to 1 (lightest) for ordered scales and heatmaps. Import dataVars from @astryxdesign/core/theme/dataTokens.stylex for CSS-capable code. Source compilation emits the complete 56-variable group when any member is retained and none for an unused graph. Prebuilt CSS consumers load @astryxdesign/core/astryx.css, which defines the complete group for the already-compiled dataVars entry."
28
28
  },
29
29
  {
30
30
  "type": "table",
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/help/troubleshooting`: the messages the CLI
4
+ * @file `astryx docs authoring/help/troubleshooting`: the messages the CLI
5
5
  * prints while you build, verify, and install an integration, and the fix
6
6
  * for each.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/ship/upgrading`: update an integration
4
+ * @file `astryx docs authoring/ship/upgrading`: update an integration
5
5
  * package for each Astryx release, and the command apps run to upgrade with
6
6
  * it.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/themes/use-a-theme-in-an-app`:
4
+ * @file `astryx docs authoring/building-blocks/themes/use-a-theme-in-an-app`:
5
5
  * an app installs the integration and applies or extends the theme, like any theme.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/package-and-test/verify-packed-template`:
4
+ * @file `astryx docs authoring/building-blocks/templates/build-the-template/package-and-test/verify-packed-template`:
5
5
  * what `integration verify` checks for templates, and what it leaves to the
6
6
  * app test.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/ship/versioning`: version an integration
4
+ * @file `astryx docs authoring/ship/versioning`: version an integration
5
5
  * package, know which changes break apps, declare peer ranges, keep apps on
6
6
  * older CLIs working, and match codemod folders to versions.
7
7
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/write-good-templates`:
4
+ * @file `astryx docs authoring/building-blocks/templates/write-good-templates`:
5
5
  * what makes a template good, the rubric that scores it, and grading with an agent.
6
6
  */
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
3
  /**
4
- * @file `astryx docs cli/integrations/building-blocks/templates/build-the-template/write-the-template-file`:
4
+ * @file `astryx docs authoring/building-blocks/templates/build-the-template/write-the-template-file`:
5
5
  * what gets copied, where the copied file lands, and the imports and
6
6
  * export a copied template needs.
7
7
  */
@@ -0,0 +1,120 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
4
+
5
+ export const docs = {
6
+ type: 'generic',
7
+ name: 'use-integrations',
8
+ title: 'Use integrations',
9
+ category: 'guide',
10
+ description:
11
+ 'Install, discover, and use integration packages that add components, templates, themes, and docs to your app.',
12
+ keywords: [
13
+ 'install an integration',
14
+ 'add an integration',
15
+ 'install a package',
16
+ 'use an integration',
17
+ 'discover integrations',
18
+ 'integration',
19
+ 'package',
20
+ 'third party',
21
+ 'plugin',
22
+ 'extension',
23
+ ],
24
+
25
+ sections: [
26
+ {
27
+ title: 'Discover integrations',
28
+ content: [
29
+ {
30
+ type: 'prose',
31
+ text: 'Integration packages extend Astryx with extra components, templates, themes, docs, and codemods. They are published as regular npm packages.',
32
+ },
33
+ {
34
+ type: 'prose',
35
+ text: 'Search for what you need:',
36
+ },
37
+ {
38
+ type: 'code',
39
+ lang: 'bash',
40
+ code: 'astryx search carousel\nastryx discover',
41
+ },
42
+ {
43
+ type: 'prose',
44
+ text: '`search` looks across everything the CLI knows (components, docs, templates, themes, and hooks), so a word like "carousel" finds it whether it is a component, a template, or a doc page. `discover` lists every integration the project has, and, with a discover source, packages it could add.',
45
+ },
46
+ ],
47
+ },
48
+ {
49
+ title: 'Install an integration',
50
+ content: [
51
+ {
52
+ type: 'prose',
53
+ text: 'Install the package with your package manager. Integrations autolink: the CLI finds them among your dependencies, so installing is all it takes:',
54
+ },
55
+ {
56
+ type: 'code',
57
+ lang: 'bash',
58
+ code: 'npm install @acme/brand-integration',
59
+ },
60
+ {
61
+ type: 'prose',
62
+ text: 'Run `astryx doctor` to confirm everything is wired up. If you need to load a package that is not a direct dependency, add it explicitly to `astryx.config.mjs`:',
63
+ },
64
+ {
65
+ type: 'code',
66
+ lang: 'js',
67
+ label: 'Optional: explicit config entry',
68
+ code: "export default {\n integrations: ['@acme/brand-integration'],\n};",
69
+ },
70
+ ],
71
+ },
72
+ {
73
+ title: 'Use what it adds',
74
+ content: [
75
+ {
76
+ type: 'prose',
77
+ text: 'Once installed, the integration\'s contributions appear alongside Core:',
78
+ },
79
+ {
80
+ type: 'list',
81
+ style: 'unordered',
82
+ items: [
83
+ '`astryx component --list` shows its components next to Core components.',
84
+ '`astryx template --list` includes its page and block templates.',
85
+ '`astryx theme list` lists its themes; add one with `astryx theme add <slug> --package @acme/brand-integration`.',
86
+ '`astryx docs` shows any guides it provides.',
87
+ '`astryx search <query>` finds everything, from every installed integration.',
88
+ ],
89
+ },
90
+ {
91
+ type: 'prose',
92
+ text: 'Import components at the subpath the integration documents. Run `astryx component <Name>` to see the exact import:',
93
+ },
94
+ {
95
+ type: 'code',
96
+ lang: 'jsx',
97
+ code: "import {AcmeCarousel} from '@acme/brand-integration/components/AcmeCarousel';",
98
+ },
99
+ {
100
+ type: 'prose',
101
+ text: 'For themes, see {@link generic:use-a-theme}. To build an integration of your own, see {@link namespace:authoring}.',
102
+ },
103
+ ],
104
+ },
105
+ {
106
+ title: 'Check for problems',
107
+ content: [
108
+ {
109
+ type: 'prose',
110
+ text: 'Run `astryx doctor` to see integration issues: missing roots, invalid contributions, or a CLI version mismatch. The doctor check is the one place every issue for every package is listed.',
111
+ },
112
+ {
113
+ type: 'code',
114
+ lang: 'bash',
115
+ code: 'astryx doctor',
116
+ },
117
+ ],
118
+ },
119
+ ],
120
+ };
@@ -44,7 +44,7 @@ export const docs = {
44
44
  },
45
45
  {
46
46
  type: 'prose',
47
- text: "By default this creates `AGENTS.md` (the tool-agnostic standard most agents read). To target a specific tool's file instead:",
47
+ text: "By default this writes the instructions to `AGENTS.md` (the tool-agnostic standard most agents read), in the project root: the nearest folder whose `package.json` declares an Astryx package, else the nearest with any `package.json`. The search stops at the repository root. In the home folder, or in a settings folder in it outside a project, init writes no agent docs: every folder of the home folder whose name starts with a dot (`~/.claude`, `~/.gemini`, `~/.codex`) is a settings folder, and such a folder itself never counts as a project, even with a `package.json`; a project below it with its own `package.json`, such as an agent worktree, is set up normally. Claude Code skips `AGENTS.md` when the project has a `CLAUDE.md` or `.claude/CLAUDE.md`, so init also writes them to that file, even when it imports `AGENTS.md`: Claude Code does not follow that import in a session started in a subfolder. When both files exist, root `CLAUDE.md` gets the copy and a copy in `.claude/CLAUDE.md` is removed, unless the project ignores `CLAUDE.md`, in which case a `.claude/CLAUDE.md` the project commits keeps a copy. Gemini CLI reads only `GEMINI.md`, so init adds a one-line import of `AGENTS.md` there, unless `GEMINI.md` already imports it. `upgrade` keeps the copies in sync. The block between the Astryx markers belongs to Astryx: init and `upgrade` write, refresh, and remove it whatever the project's ignore rules or generated markers say, and never change the text around it. To target a specific tool's file instead:",
48
48
  },
49
49
  {
50
50
  type: 'code',
@@ -55,7 +55,11 @@ astryx init --features agents --agent cursor # .cursorrules if present, else
55
55
  astryx init --features agents --agent codex # AGENTS.md (Copilot, Codex, etc.)
56
56
  astryx init --features agents --agent hermes # .hermes.md or HERMES.md if present, else AGENTS.md
57
57
  astryx init --features agents --agent muse # AGENTS.md (Muse)
58
- astryx init --features agents --agent all # every agent file present, else AGENTS.md and .claude/CLAUDE.md`,
58
+ astryx init --features agents --agent all # every agent file present except GEMINI.md, else AGENTS.md and .claude/CLAUDE.md`,
59
+ },
60
+ {
61
+ type: 'prose',
62
+ text: 'With `--agent all`, `GEMINI.md` keeps its one-line import of `AGENTS.md`. With `--agent claude` or `--agent all`, as by default, when `CLAUDE.md` gets the instructions, `.claude/CLAUDE.md` gets none and a copy already there is removed, unless the project ignores `CLAUDE.md`: a fresh clone does not have it, so a `.claude/CLAUDE.md` the project commits gets a copy too, with `--agent claude` and `--agent all` alike. `init --remove-agents` removes them at the project root and in the folder it runs in.',
59
63
  },
60
64
  {
61
65
  type: 'prose',
@@ -81,7 +81,8 @@ const SECONDARY_SELECTOR = {
81
81
 
82
82
  /**
83
83
  * The secondary Button treatment on ComplexSelector triggers (AST-079 FR2), with
84
- * the hover kept off a disabled trigger, whose inner button is disabled.
84
+ * the hover kept off a disabled trigger, whose inner button is disabled
85
+ * (natively or, keeping its tab stop, with `aria-disabled`).
85
86
  */
86
87
  const SECONDARY_COMPLEX_SELECTOR = {
87
88
  backgroundColor: SECONDARY_BUTTON.backgroundColor,
@@ -89,7 +90,8 @@ const SECONDARY_COMPLEX_SELECTOR = {
89
90
  borderStyle: SECONDARY_BUTTON.borderStyle,
90
91
  borderColor: SECONDARY_BUTTON.borderColor,
91
92
  color: SECONDARY_BUTTON.color,
92
- ':hover:not(:has(> :disabled))': SECONDARY_BUTTON[':hover'],
93
+ ':hover:not(:has(> :is(:disabled, [aria-disabled="true"])))':
94
+ SECONDARY_BUTTON[':hover'],
93
95
  } as const;
94
96
 
95
97
  export const butterTheme = defineTheme({
@@ -100,14 +100,16 @@ const SECONDARY_SELECTOR = {
100
100
 
101
101
  /**
102
102
  * The secondary Button treatment on ComplexSelector triggers (AST-079 FR2), with
103
- * the hover kept off a disabled trigger, whose inner button is disabled.
103
+ * the hover kept off a disabled trigger, whose inner button is disabled
104
+ * (natively or, keeping its tab stop, with `aria-disabled`).
104
105
  */
105
106
  const SECONDARY_COMPLEX_SELECTOR = {
106
107
  backgroundColor: SECONDARY_BUTTON.backgroundColor,
107
108
  borderWidth: SECONDARY_BUTTON.borderWidth,
108
109
  borderStyle: SECONDARY_BUTTON.borderStyle,
109
110
  borderColor: SECONDARY_BUTTON.borderColor,
110
- ':hover:not(:has(> :disabled))': SECONDARY_BUTTON[':hover'],
111
+ ':hover:not(:has(> :is(:disabled, [aria-disabled="true"])))':
112
+ SECONDARY_BUTTON[':hover'],
111
113
  } as const;
112
114
 
113
115
  export const stoneTheme = defineTheme({
@@ -76,7 +76,8 @@ const SECONDARY_SELECTOR = {
76
76
 
77
77
  /**
78
78
  * The secondary Button treatment on ComplexSelector triggers (AST-079 FR2), with
79
- * the hover kept off a disabled trigger, whose inner button is disabled.
79
+ * the hover kept off a disabled trigger, whose inner button is disabled
80
+ * (natively or, keeping its tab stop, with `aria-disabled`).
80
81
  */
81
82
  const SECONDARY_COMPLEX_SELECTOR = {
82
83
  backgroundColor: SECONDARY_BUTTON.backgroundColor,
@@ -84,7 +85,8 @@ const SECONDARY_COMPLEX_SELECTOR = {
84
85
  borderStyle: SECONDARY_BUTTON.borderStyle,
85
86
  borderColor: SECONDARY_BUTTON.borderColor,
86
87
  color: SECONDARY_BUTTON.color,
87
- ':hover:not(:has(> :disabled))': SECONDARY_BUTTON[':hover'],
88
+ ':hover:not(:has(> :is(:disabled, [aria-disabled="true"])))':
89
+ SECONDARY_BUTTON[':hover'],
88
90
  } as const;
89
91
 
90
92
  export const y2kTheme = defineTheme({
@@ -79,9 +79,9 @@ declare const eventSchema: z.ZodObject<{
79
79
  none: "none";
80
80
  component: "component";
81
81
  hook: "hook";
82
+ theme: "theme";
82
83
  doc: "doc";
83
84
  template: "template";
84
- theme: "theme";
85
85
  integration: "integration";
86
86
  migration: "migration";
87
87
  mixed: "mixed";
@@ -49,7 +49,7 @@ export const doc = {
49
49
  name: 'namespace',
50
50
  type: 'string',
51
51
  description:
52
- "The group that reads this doc: 'authoring' for a file an author writes (a section of {@link generic:authoring}), or 'cli/api' for a shape the CLI returns (the docs tree adopts it by kind, as the leaf `cli/api/schemas/<name>`). Every schema doc the CLI ships declares one, and `astryx doctor` fails on one that is missing or that nothing reads.",
52
+ "The group that reads this doc: 'authoring' for a file an author writes (a section of {@link generic:field-reference}), or 'cli/api' for a shape the CLI returns (the docs tree adopts it by kind, as the leaf `cli/api/schemas/<name>`). Every schema doc the CLI ships declares one, and `astryx doctor` fails on one that is missing or that nothing reads.",
53
53
  },
54
54
  {
55
55
  name: 'aliases',
@@ -131,7 +131,7 @@ export const doc = {
131
131
  },
132
132
  {
133
133
  type: 'prose',
134
- text: "Set `cliCommand` only when your users run the CLI with a command other than their package manager's, such as `acme astryx`. The CLI picks the command it prints in this order: the `cliCommand` of the loaded integrations when they name one command, then the command a host tool names, then the package manager's. Two different `cliCommand` values cancel out, and `astryx doctor` warns in its `cli-command` check. See `astryx docs cli/integrations/building-blocks/configuration/cli-command`.",
134
+ text: "Set `cliCommand` only when your users run the CLI with a command other than their package manager's, such as `acme astryx`. The CLI picks the command it prints in this order: the `cliCommand` of the loaded integrations when they name one command, then the command a host tool names, then the package manager's. Two different `cliCommand` values cancel out, and `astryx doctor` warns in its `cli-command` check. See `astryx docs authoring/building-blocks/configuration/cli-command`.",
135
135
  },
136
136
  {
137
137
  type: 'prose',
@@ -11,7 +11,7 @@
11
11
  * The manifest module may also carry `debug` and `gapReport` NAMED exports.
12
12
  * They are not fields here on purpose: a CLI released before a given manifest
13
13
  * field existed could reject it and lose every contribution, while an unknown
14
- * named export is simply not read. See `astryx docs cli/integrations`.
14
+ * named export is simply not read. See `astryx docs authoring`.
15
15
  */
16
16
  export interface AstryxIntegration {
17
17
  /** Stable logical provider ID. Omit to use package.json#name. Set this only
@@ -53,84 +53,13 @@ if (!isNodeVersionSupported(process.versions.node)) {
53
53
  process.exit(1);
54
54
  }
55
55
 
56
- // Global mode: choose the release that answers this folder and, when it is
57
- // not this copy, hand the run to it before anything the project provides (its
58
- // astryx.config, integrations, or Core) is loaded. Returns only when this copy
59
- // answers. See foundation/release/handoff.mjs and spec AST-081 FR2 and FR9.
60
- const {startRun} = await importSrc('../../foundation/release/handoff.mjs');
61
- await startRun({
56
+ // Global mode: the run chooses the release that answers this folder and, when
57
+ // it is not this copy, hands the run to it before anything the project
58
+ // provides (its astryx.config, integrations, or Core) is loaded; only then
59
+ // does it load and dispatch the command. See clients/cli/run.mjs,
60
+ // foundation/release/handoff.mjs, and spec AST-081 FR2 and FR9.
61
+ const {runCli} = await importSrc('run.mjs');
62
+ await runCli({
62
63
  cliRoot: join(binDir, '..', '..', '..'),
63
64
  argv: process.argv.slice(2),
64
65
  });
65
-
66
- // Imports that transitively load `styleText` must happen AFTER the gate above,
67
- // so they are dynamically imported here rather than at the top of the module.
68
- const {
69
- program,
70
- loadProjectDebugHandler,
71
- loadProjectForHelp,
72
- handleVersionJsonPreflight,
73
- } = await importSrc('index.mjs');
74
- const {isJsonMode, toErrorEnvelope} = await importSrc('../../foundation/response/json.mjs');
75
- const {handleCommanderError} = await importSrc('lib/json-shim.mjs');
76
- const {setOutcome} = await importSrc('../../foundation/debug/index.mjs');
77
-
78
- /**
79
- * Top-level error boundary (contract guarantee #4): an uncaught throw must
80
- * never reach a --json consumer as a raw stack trace. If we're in JSON mode,
81
- * convert it to the contract's error envelope on stdout and exit 1; otherwise
82
- * preserve the normal human-facing behavior.
83
- *
84
- * We detect JSON mode two ways: the global flag (set once root options are
85
- * parsed) and a raw argv check, since a throw can occur during parsing/command
86
- * load — before the preAction hook engages the flag.
87
- */
88
- function inJsonMode() {
89
- return isJsonMode() || process.argv.slice(2).includes('--json');
90
- }
91
-
92
- /** @param {unknown} err */
93
- function handleFatal(err) {
94
- // CommanderError (parse errors, --help, unknown command) routes
95
- // through the JSON shim so that a --json consumer always gets a
96
- // valid envelope and the right exit code. handleCommanderError
97
- // calls process.exit when it owns the error.
98
- if (handleCommanderError(err)) return;
99
-
100
- // Anything still here is an uncaught throw or an unhandled rejection —
101
- // a bug rather than a user error, and the class of failure most worth
102
- // having a record of.
103
- setOutcome('fatal', {exitCode: 1, error: err});
104
-
105
- if (inJsonMode()) {
106
- // Only emit if a command didn't already produce an envelope.
107
- if (!process.__xdsJsonHandled) {
108
- process.__xdsJsonHandled = true;
109
- console.log(JSON.stringify(toErrorEnvelope(err), null, 2));
110
- }
111
- process.exit(1);
112
- }
113
- // Human mode: preserve Commander/Node default-ish behavior.
114
- console.error(err instanceof Error ? err.stack || err.message : String(err));
115
- process.exit(1);
116
- }
117
-
118
- process.on('unhandledRejection', handleFatal);
119
- process.on('uncaughtException', handleFatal);
120
-
121
- // Pick up the project's `debug` function before parsing, so parse errors and
122
- // `--help` — which short-circuit before any hook runs — are reported too.
123
- await loadProjectDebugHandler();
124
- // Help prints its commands while Commander parses, so a help run reads the
125
- // project's declared `cliCommand` here.
126
- await loadProjectForHelp();
127
-
128
- // `--version --json` answers and exits without Commander, so it runs here —
129
- // after the handler exists, or the run would go unrecorded.
130
- handleVersionJsonPreflight();
131
-
132
- try {
133
- await program.parseAsync(process.argv);
134
- } catch (err) {
135
- handleFatal(err);
136
- }
@@ -44,12 +44,13 @@ const NO_ACTION_OF_THEIR_OWN = [];
44
44
  /**
45
45
  * Commands that record for themselves instead of returning a descriptor.
46
46
  *
47
- * They cannot come from a CommandDoc — `manifest` introspects the live program,
48
- * `postinstall` is a package-script hook — so they carry the mark by hand. The
49
- * mark is a hatch, and a hatch nobody watches is a hole: this list is the
50
- * watch. The root program is checked separately below.
47
+ * Empty: every command, `manifest` and the hidden `postinstall` hook included,
48
+ * registers through defineCommand. The mark is a hatch, and a hatch nobody
49
+ * watches is a hole: this list is the watch. The root program is checked
50
+ * separately below.
51
+ * @type {string[]}
51
52
  */
52
- const RECORD_FOR_THEMSELVES = ['manifest', 'postinstall'];
53
+ const RECORD_FOR_THEMSELVES = [];
53
54
 
54
55
  /**
55
56
  * Every command in the program, depth first, with its fully qualified name.
@@ -73,7 +73,7 @@ describe('theme build color-scheme output', () => {
73
73
  const project = path.join(tmpDir, 'project');
74
74
  const themesDir = path.join(project, 'themes');
75
75
  // A raw light-dark() token value is what triggers the color-scheme
76
- // injection in build-theme.mjs. `defineTheme.test.ts` already covers the
76
+ // injection in theme.mjs. `defineTheme.test.ts` already covers the
77
77
  // separate [light, dark] tuple -> light-dark() conversion; this fixture
78
78
  // writes the string directly so this test stays focused on the CLI's own
79
79
  // color-scheme decision, not on that conversion.
@@ -6,30 +6,30 @@
6
6
  * Global options: --detail full|compact|brief, --lang en|zh|dense
7
7
  */
8
8
 
9
- import {findCoreDir} from '../../../../foundation/fs/paths.mjs';
9
+ import {findCoreDir} from '../../../foundation/fs/paths.mjs';
10
10
  import {
11
11
  resolveImportPath,
12
- } from '../../../../foundation/discovery/component-discovery.mjs';
12
+ } from '../../../foundation/discovery/component-discovery.mjs';
13
13
  import {
14
14
  formatFull,
15
15
  formatCompact,
16
16
  formatBrief,
17
17
  formatProps,
18
18
  formatBriefAll,
19
- } from '../../lib/component-format.mjs';
20
- import {resolveTheme} from '../../lib/resolve-theme.mjs';
21
- import {getCliInvocation} from '../../../../foundation/env/package-manager.mjs';
22
- import {jsonOut} from '../../../../foundation/response/json.mjs';
23
- import {emit, section, text, list, record, records, code} from '../../formatters/index.mjs';
24
- import {cliError} from '../../lib/cli-error.mjs';
25
- import {defineCommand} from '../../lib/define-command.mjs';
26
- import {resultSet} from '../../../../foundation/debug/index.mjs';
27
- import {ERROR_CODES} from '../../../../foundation/response/error-codes.mjs';
28
- import {component as componentApi} from '../../../../api/component/component.mjs';
29
- import {Project} from '../../../../foundation/config/project.mjs';
30
- import {warnOnIntegrationIssues} from '../../../../foundation/integrations/integration-warnings.mjs';
31
- import {doc as componentCommand} from '../component.doc.mjs';
32
- import {doc as componentFn} from '../../../../api/component/component.doc.mjs';
19
+ } from '../lib/component-format.mjs';
20
+ import {resolveTheme} from '../lib/resolve-theme.mjs';
21
+ import {getCliInvocation} from '../../../foundation/env/package-manager.mjs';
22
+ import {jsonOut} from '../../../foundation/response/json.mjs';
23
+ import {emit, section, text, list, record, records, code} from '../formatters/index.mjs';
24
+ import {cliError} from '../lib/cli-error.mjs';
25
+ import {defineCommand} from '../lib/define-command.mjs';
26
+ import {resultSet} from '../../../foundation/debug/index.mjs';
27
+ import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
28
+ import {component as componentApi} from '../../../api/component/component.mjs';
29
+ import {Project} from '../../../foundation/config/project.mjs';
30
+ import {warnOnIntegrationIssues} from '../../../foundation/integrations/integration-warnings.mjs';
31
+ import {doc as componentCommand} from './component.doc.mjs';
32
+ import {doc as componentFn} from '../../../api/component/component.doc.mjs';
33
33
 
34
34
  /**
35
35
  * The api layer's component() widens its return to `{type: string, data: unknown}`,
@@ -37,13 +37,13 @@ import {doc as componentFn} from '../../../../api/component/component.doc.mjs';
37
37
  * src/types/component to get narrowing + typed data.
38
38
  *
39
39
  * @typedef {(
40
- * | import('../../../../api/component/component.type.mjs').ComponentListResponse
41
- * | import('../../../../api/component/component.type.mjs').ComponentBatchResponse
42
- * | import('../../../../api/component/component.type.mjs').ComponentDetailResponse
43
- * | import('../../../../api/component/component.type.mjs').ComponentDetailPropsResponse
44
- * | import('../../../../api/component/component.type.mjs').ComponentDetailSourceResponse
45
- * | import('../../../../api/component/component.type.mjs').ComponentDetailShowcaseResponse
46
- * | import('../../../../api/component/component.type.mjs').ComponentDetailBlocksResponse
40
+ * | import('../../../api/component/component.type.mjs').ComponentListResponse
41
+ * | import('../../../api/component/component.type.mjs').ComponentBatchResponse
42
+ * | import('../../../api/component/component.type.mjs').ComponentDetailResponse
43
+ * | import('../../../api/component/component.type.mjs').ComponentDetailPropsResponse
44
+ * | import('../../../api/component/component.type.mjs').ComponentDetailSourceResponse
45
+ * | import('../../../api/component/component.type.mjs').ComponentDetailShowcaseResponse
46
+ * | import('../../../api/component/component.type.mjs').ComponentDetailBlocksResponse
47
47
  * )} ComponentResult
48
48
  */
49
49
 
@@ -57,7 +57,7 @@ import {doc as componentFn} from '../../../../api/component/component.doc.mjs';
57
57
  * the thing that resolved (the component) is not the thing being counted.
58
58
  *
59
59
  * @param {ComponentResult} result
60
- * @returns {import('../../../../foundation/debug/command-result.mjs').CommandResult}
60
+ * @returns {import('../../../foundation/debug/command-result.mjs').CommandResult}
61
61
  */
62
62
  function summarize(result) {
63
63
  switch (result.type) {
@@ -90,11 +90,11 @@ function summarize(result) {
90
90
 
91
91
  /**
92
92
  * Project one single-component API result through the existing formatter kit.
93
- * @param {import('../../../../api/component/component.type.mjs').ComponentSingleResponse} result
93
+ * @param {import('../../../api/component/component.type.mjs').ComponentSingleResponse} result
94
94
  * @param {string} requestedName
95
95
  * @param {'full'|'compact'|'brief'} detail
96
96
  * @param {Awaited<ReturnType<typeof resolveTheme>>} themeData
97
- * @returns {import('../../formatters/index.mjs').Block[]}
97
+ * @returns {import('../formatters/index.mjs').Block[]}
98
98
  */
99
99
  function componentDetailBlocks(result, requestedName, detail, themeData) {
100
100
  const requested = (requestedName.split('/').pop() ?? requestedName).replace(
@@ -111,7 +111,7 @@ function componentDetailBlocks(result, requestedName, detail, themeData) {
111
111
  : requested;
112
112
  switch (result.type) {
113
113
  case 'component.detail': {
114
- /** @type {import('../../formatters/index.mjs').Block[]} */
114
+ /** @type {import('../formatters/index.mjs').Block[]} */
115
115
  const out = [record({package: result.package})];
116
116
  if (result.data.parentDoc) {
117
117
  out.push(record(result.data, {fields: ['parentDoc']}));
@@ -150,7 +150,7 @@ function componentDetailBlocks(result, requestedName, detail, themeData) {
150
150
  /** @param {{package: string}} block @param {string} label */
151
151
  const owned = (block, label) =>
152
152
  block.package === result.package ? label : `${label} (${block.package})`;
153
- /** @type {import('../../formatters/index.mjs').Block[]} */
153
+ /** @type {import('../formatters/index.mjs').Block[]} */
154
154
  const out = [record({package: result.package})];
155
155
  if (showcase) {
156
156
  out.push(
@@ -243,7 +243,7 @@ export function registerComponent(program) {
243
243
  lang, zh, dense,
244
244
  }));
245
245
  } catch (e) {
246
- const err = /** @type {import('../../../../api/error.mjs').AstryxError} */ (e);
246
+ const err = /** @type {import('../../../api/error.mjs').AstryxError} */ (e);
247
247
  return cliError(err.message, {suggestions: err.suggestions, code: err.code});
248
248
  }
249
249
 
@@ -326,7 +326,7 @@ export function registerComponent(program) {
326
326
  // description), grouped by category. Fields mirror the JSON keys.
327
327
  const groups = result.data.components;
328
328
  const entries = Object.entries(groups);
329
- /** @type {import('../../formatters/index.mjs').Block[]} */
329
+ /** @type {import('../formatters/index.mjs').Block[]} */
330
330
  const out = [];
331
331
  for (const [cat, items] of entries) {
332
332
  // Skip the synthetic group header when there's only one ungrouped category
@@ -362,7 +362,7 @@ export function registerComponent(program) {
362
362
  nameCounts.set(item.name, set);
363
363
  }
364
364
  }
365
- /** @param {import('../../../../api/component/component.type.mjs').ComponentListEntry} item */
365
+ /** @param {import('../../../api/component/component.type.mjs').ComponentListEntry} item */
366
366
  const importCell = item => {
367
367
  // Use a precomputed import when the API supplies one (integration
368
368
  // components carry it); only fall back to the core resolver for
@@ -392,7 +392,7 @@ export function registerComponent(program) {
392
392
  }
393
393
 
394
394
  case 'component.batch': {
395
- /** @type {import('../../formatters/index.mjs').Block[]} */
395
+ /** @type {import('../formatters/index.mjs').Block[]} */
396
396
  const out = [
397
397
  section('Component batch'),
398
398
  record({count: result.data.count}),
@@ -474,8 +474,8 @@ export function registerComponent(program) {
474
474
 
475
475
  // Re-export lib functions for backward compatibility
476
476
  // (agent-docs.mjs, tests, and generate-skill-doc.sh import from here)
477
- export {discoverComponents, discoverExternalComponentsGrouped, findComponentReadme, findComponentSource, findExternalComponentDoc, resolveImportPath} from '../../../../foundation/discovery/component-discovery.mjs';
478
- export {discoverExternalPackages} from '../../../../foundation/fs/paths.mjs';
479
- export {loadDocs} from '../../../../foundation/discovery/component-loader.mjs';
480
- export {formatFull, formatCompact, formatBrief, formatProps, formatBriefAll} from '../../lib/component-format.mjs';
481
- export {levenshteinDistance, findClosestComponents, searchComponents} from '../../../../foundation/text/string-utils.mjs';
477
+ export {discoverComponents, discoverExternalComponentsGrouped, findComponentReadme, findComponentSource, findExternalComponentDoc, resolveImportPath} from '../../../foundation/discovery/component-discovery.mjs';
478
+ export {discoverExternalPackages} from '../../../foundation/fs/paths.mjs';
479
+ export {loadDocs} from '../../../foundation/discovery/component-loader.mjs';
480
+ export {formatFull, formatCompact, formatBrief, formatProps, formatBriefAll} from '../lib/component-format.mjs';
481
+ export {levenshteinDistance, findClosestComponents, searchComponents} from '../../../foundation/text/string-utils.mjs';