@astryxdesign/cli 0.7.2-canary.55d8dff → 0.7.2-canary.577a62e

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 (404) hide show
  1. package/README.md +163 -143
  2. package/api/build/_adapter.d.mts +8 -0
  3. package/api/build/_adapter.mjs +12 -1
  4. package/api/build/build.doc.mjs +4 -0
  5. package/api/build/kit/kit.mjs +3 -11
  6. package/api/component/_adapter.d.mts +31 -0
  7. package/api/component/_adapter.mjs +119 -11
  8. package/api/component/component.doc.mjs +6 -1
  9. package/api/component/component.mjs +60 -10
  10. package/api/component/doc-links.test.mjs +386 -0
  11. package/api/discover/_adapter.d.mts +132 -12
  12. package/api/discover/_adapter.mjs +488 -27
  13. package/api/discover/_adapter.test.mjs +599 -17
  14. package/api/discover/_catalog-view.d.mts +16 -5
  15. package/api/discover/_catalog-view.mjs +32 -8
  16. package/api/discover/detail/doc/doc.mjs +9 -1
  17. package/api/discover/discover.d.mts +11 -0
  18. package/api/discover/discover.doc.mjs +9 -7
  19. package/api/discover/discover.mjs +121 -19
  20. package/api/discover/discover.type.d.mts +20 -7
  21. package/api/discover/discover.type.mjs +17 -7
  22. package/api/discover/list/list.d.mts +4 -3
  23. package/api/discover/list/list.mjs +17 -10
  24. package/api/docs/_adapter.d.mts +63 -0
  25. package/api/docs/_adapter.mjs +312 -18
  26. package/api/docs/docs.doc.mjs +2 -1
  27. package/api/docs/docs.mjs +2 -1
  28. package/api/docs/docs.test.mjs +5 -2
  29. package/api/docs/integration-tree.test.mjs +22 -0
  30. package/api/docs/list/list.mjs +12 -2
  31. package/api/docs/reference-blocks.test.mjs +1 -3
  32. package/api/doctor/_adapter.d.mts +108 -0
  33. package/api/doctor/_adapter.mjs +223 -4
  34. package/api/doctor/doctor.d.mts +199 -0
  35. package/api/doctor/doctor.doc.mjs +3 -2
  36. package/api/doctor/doctor.mjs +503 -31
  37. package/api/doctor/doctor.test.mjs +137 -14
  38. package/api/doctor/release-checks.test.mjs +156 -0
  39. package/api/doctor/theme-checks.mjs +16 -3
  40. package/api/doctor/theme-checks.test.mjs +223 -7
  41. package/api/error.d.mts +10 -0
  42. package/api/error.mjs +25 -0
  43. package/api/gap-report/gap-report.d.mts +3 -0
  44. package/api/gap-report/gap-report.doc.mjs +11 -3
  45. package/api/gap-report/gap-report.mjs +152 -48
  46. package/api/gap-report/gap-report.test.mjs +233 -0
  47. package/api/gap-report/gap-report.type.d.mts +41 -0
  48. package/api/gap-report/gap-report.type.mjs +18 -0
  49. package/api/hook/_adapter.mjs +3 -11
  50. package/api/hook/hook.doc.mjs +4 -0
  51. package/api/hook/list/list.d.mts +1 -1
  52. package/api/init/_adapter.d.mts +22 -0
  53. package/api/init/_adapter.mjs +59 -0
  54. package/api/init/init.d.mts +7 -5
  55. package/api/init/init.doc.mjs +28 -7
  56. package/api/init/init.mjs +28 -4
  57. package/api/init/init.type.d.mts +48 -3
  58. package/api/init/init.type.mjs +37 -3
  59. package/api/init/run/run.d.mts +1 -1
  60. package/api/init/run/run.mjs +15 -4
  61. package/api/init/user/user.d.mts +14 -0
  62. package/api/init/user/user.mjs +87 -0
  63. package/api/init/user/user.test.mjs +232 -0
  64. package/api/integration/_adapter.d.mts +33 -0
  65. package/api/integration/_adapter.mjs +58 -0
  66. package/api/integration/authoring-checks.mjs +100 -5
  67. package/api/integration/authoring-checks.test.mjs +769 -0
  68. package/api/integration/authoring-checks.type.d.mts +134 -0
  69. package/api/integration/authoring-checks.type.mjs +60 -1
  70. package/api/integration/integrationCheck.doc.mjs +1 -1
  71. package/api/integration/integrationComponentConflicts.doc.mjs +3 -1
  72. package/api/integration/integrationDocConflicts.doc.mjs +22 -5
  73. package/api/integration/pack-check.mjs +303 -13
  74. package/api/integration/pack-check.test.mjs +371 -10
  75. package/api/integration/validate-integration-fixes.test.mjs +67 -0
  76. package/api/integration/validate-integration.d.mts +8 -0
  77. package/api/integration/validate-integration.mjs +55 -9
  78. package/api/integration/validate-integration.test.mjs +77 -8
  79. package/api/integration/validate-integration.type.d.mts +8 -0
  80. package/api/integration/validate-integration.type.mjs +3 -1
  81. package/api/integration/validate-unread-theme-folders.test.mjs +3 -2
  82. package/api/integration/validateIntegration.doc.mjs +1 -1
  83. package/api/search/_adapter.d.mts +11 -0
  84. package/api/search/_adapter.mjs +25 -0
  85. package/api/search/search.d.mts +10 -8
  86. package/api/search/search.doc.mjs +8 -3
  87. package/api/search/search.mjs +130 -57
  88. package/api/search/search.test.mjs +15 -1
  89. package/api/search/search.type.d.mts +14 -1
  90. package/api/search/search.type.mjs +6 -1
  91. package/api/swizzle/_adapter.mjs +2 -2
  92. package/api/swizzle/copy/copy.mjs +1 -1
  93. package/api/template/template-integration.test.mjs +1 -1
  94. package/api/theme/_adapter.d.mts +16 -0
  95. package/api/theme/_adapter.mjs +32 -5
  96. package/api/theme/build/build.d.mts +2 -1
  97. package/api/theme/build/build.mjs +70 -14
  98. package/api/theme/build/build.packed-old-core.test.mjs +20 -3
  99. package/api/theme/build/font-warning.mjs +5 -3
  100. package/api/theme/build/font-warning.test.mjs +2 -1
  101. package/api/theme/remove/remove.test.mjs +2 -2
  102. package/api/theme/targets/targets.mjs +3 -10
  103. package/api/theme/themeTargets.doc.mjs +4 -0
  104. package/api/theme/use/use.test.mjs +1 -1
  105. package/api/upgrade/_adapter.d.mts +40 -2
  106. package/api/upgrade/_adapter.mjs +118 -5
  107. package/api/upgrade/run/cli-behind-core.test.mjs +438 -0
  108. package/api/upgrade/run/run.mjs +35 -2
  109. package/api/upgrade/status/status.d.mts +21 -5
  110. package/api/upgrade/status/status.mjs +45 -8
  111. package/api/upgrade/upgrade.doc.mjs +6 -3
  112. package/api/upgrade/upgrade.mjs +5 -1
  113. package/api/upgrade/upgrade.type.d.mts +23 -0
  114. package/api/upgrade/upgrade.type.mjs +16 -1
  115. package/assets/codemods/runner.mjs +7 -1
  116. package/assets/discover/official-packages.json +367 -0
  117. package/assets/docs/author-a-theme.doc.mjs +2 -2
  118. package/assets/docs/browser-support.doc.mjs +1 -1
  119. package/assets/docs/getting-started.doc.mjs +23 -3
  120. package/assets/docs/styling-overview.doc.mjs +1 -1
  121. package/assets/docs/theme.doc.mjs +1 -1
  122. package/assets/docs/tree/add-a-component.doc.mjs +11 -1
  123. package/assets/docs/tree/add-a-theme.doc.mjs +12 -2
  124. package/assets/docs/tree/add-a-topic.doc.mjs +46 -4
  125. package/assets/docs/tree/agent-guidance.doc.mjs +18 -4
  126. package/assets/docs/tree/building-blocks.doc.mjs +4 -0
  127. package/assets/docs/tree/check-the-props.doc.mjs +8 -3
  128. package/assets/docs/tree/check-your-docs.doc.mjs +20 -8
  129. package/assets/docs/tree/checks.doc.mjs +14 -14
  130. package/assets/docs/tree/ci-and-containers.doc.mjs +88 -0
  131. package/assets/docs/tree/cli-command.doc.mjs +142 -0
  132. package/assets/docs/tree/cli.doc.mjs +6 -0
  133. package/assets/docs/tree/codemods.doc.mjs +13 -3
  134. package/assets/docs/tree/commands.doc.mjs +7 -1
  135. package/assets/docs/tree/component-imports.doc.mjs +11 -1
  136. package/assets/docs/tree/components.doc.mjs +6 -0
  137. package/assets/docs/tree/computer-agent-guide.doc.mjs +160 -0
  138. package/assets/docs/tree/computer-integrations.doc.mjs +93 -0
  139. package/assets/docs/tree/configuration.doc.mjs +7 -3
  140. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +36 -6
  141. package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
  142. package/assets/docs/tree/describe-the-component.doc.mjs +1 -1
  143. package/assets/docs/tree/docs.doc.mjs +6 -0
  144. package/assets/docs/tree/document-the-theme.doc.mjs +2 -2
  145. package/assets/docs/tree/extend-or-replace.doc.mjs +13 -3
  146. package/assets/docs/tree/generate-a-palette.doc.mjs +2 -2
  147. package/assets/docs/tree/global-integrations.doc.mjs +124 -0
  148. package/assets/docs/tree/global.doc.mjs +131 -0
  149. package/assets/docs/tree/grade-template-with-agent.doc.mjs +4 -4
  150. package/assets/docs/tree/install-once.doc.mjs +105 -0
  151. package/assets/docs/tree/integrations.doc.mjs +5 -1
  152. package/assets/docs/tree/layout-spacing.doc.mjs +2 -3
  153. package/assets/docs/tree/layout.doc.mjs +6 -6
  154. package/assets/docs/tree/links.doc.mjs +1 -1
  155. package/assets/docs/tree/migration-setup.doc.mjs +2 -2
  156. package/assets/docs/tree/monorepos.doc.mjs +84 -0
  157. package/assets/docs/tree/problems.doc.mjs +205 -0
  158. package/assets/docs/tree/project-global-or-both.doc.mjs +131 -0
  159. package/assets/docs/tree/publishing.doc.mjs +5 -5
  160. package/assets/docs/tree/quick-start.doc.mjs +17 -7
  161. package/assets/docs/tree/reference.doc.mjs +192 -0
  162. package/assets/docs/tree/replace-a-core-component.doc.mjs +11 -1
  163. package/assets/docs/tree/replace-a-core-template.doc.mjs +4 -4
  164. package/assets/docs/tree/scaffold.doc.mjs +1 -1
  165. package/assets/docs/tree/sections-and-placement.doc.mjs +5 -5
  166. package/assets/docs/tree/see-it-in-an-app.doc.mjs +13 -3
  167. package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
  168. package/assets/docs/tree/single-component.doc.mjs +3 -3
  169. package/assets/docs/tree/start-a-template.doc.mjs +15 -5
  170. package/assets/docs/tree/template-doc-overview.doc.mjs +2 -2
  171. package/assets/docs/tree/templates.doc.mjs +6 -0
  172. package/assets/docs/tree/test-in-an-app.doc.mjs +4 -4
  173. package/assets/docs/tree/test-template-in-app.doc.mjs +4 -4
  174. package/assets/docs/tree/themes.doc.mjs +4 -0
  175. package/assets/docs/tree/troubleshooting.doc.mjs +19 -11
  176. package/assets/docs/tree/uninstall.doc.mjs +109 -0
  177. package/assets/docs/tree/updates.doc.mjs +92 -0
  178. package/assets/docs/tree/upgrading.doc.mjs +3 -3
  179. package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +11 -1
  180. package/assets/docs/tree/verify-packed-template.doc.mjs +2 -2
  181. package/assets/docs/tree/versioning.doc.mjs +3 -3
  182. package/assets/docs/tree/who-answers.doc.mjs +119 -0
  183. package/assets/docs/tree/write-the-template-file.doc.mjs +3 -3
  184. package/assets/docs/working-with-ai.doc.mjs +23 -9
  185. package/authoring/debug/parse.d.mts +5 -5
  186. package/authoring/discover/discover.doc.mjs +7 -1
  187. package/authoring/doctypes/_schema.d.mts +8 -3
  188. package/authoring/doctypes/_schema.mjs +1 -0
  189. package/authoring/doctypes/command/command.doc.mjs +6 -0
  190. package/authoring/doctypes/command/type.ts +14 -0
  191. package/authoring/doctypes/component/component.doc.mjs +1 -1
  192. package/authoring/doctypes/component/type.ts +8 -0
  193. package/authoring/doctypes/hook/type.ts +4 -0
  194. package/authoring/doctypes/reference/reference.doc.mjs +1 -1
  195. package/authoring/index.d.ts +1 -0
  196. package/authoring/integration/integration.doc.mjs +18 -2
  197. package/authoring/integration/parse.test.mjs +11 -0
  198. package/authoring/integration/schema.d.mts +14 -3
  199. package/authoring/integration/schema.mjs +33 -2
  200. package/authoring/integration/type.ts +8 -0
  201. package/clients/cli/bin/astryx.mjs +20 -3
  202. package/clients/cli/cli-command.test.mjs +166 -0
  203. package/clients/cli/commands/blog.doc.mjs +1 -0
  204. package/clients/cli/commands/build-theme.batch-report.test.mjs +14 -2
  205. package/clients/cli/commands/build-theme.font-warning.test.mjs +3 -3
  206. package/clients/cli/commands/build-theme.mjs +25 -12
  207. package/clients/cli/commands/build.doc.mjs +1 -0
  208. package/clients/cli/commands/build.exit-codes-doc.test.mjs +4 -0
  209. package/clients/cli/commands/component.doc.mjs +1 -0
  210. package/clients/cli/commands/discover.broken-integration.test.mjs +11 -7
  211. package/clients/cli/commands/discover.doc.mjs +9 -1
  212. package/clients/cli/commands/discover.mjs +144 -93
  213. package/clients/cli/commands/discover.no-source.test.mjs +448 -33
  214. package/clients/cli/commands/discover.sources.test.mjs +20 -1
  215. package/clients/cli/commands/docs.doc.mjs +1 -0
  216. package/clients/cli/commands/docs.mjs +49 -19
  217. package/clients/cli/commands/docs.test.mjs +2 -2
  218. package/clients/cli/commands/doctor-integration-components.doc.mjs +4 -2
  219. package/clients/cli/commands/doctor-integration-docs.doc.mjs +20 -5
  220. package/clients/cli/commands/doctor-integration-templates.doc.mjs +1 -0
  221. package/clients/cli/commands/doctor-integration-validate.doc.mjs +10 -1
  222. package/clients/cli/commands/doctor-integration.test.mjs +52 -4
  223. package/clients/cli/commands/doctor.doc.mjs +12 -2
  224. package/clients/cli/commands/doctor.mjs +102 -7
  225. package/clients/cli/commands/doctor.test.mjs +10 -4
  226. package/clients/cli/commands/gap-report.doc.mjs +15 -2
  227. package/clients/cli/commands/gap-report.mjs +24 -2
  228. package/clients/cli/commands/gap-report.test.mjs +79 -0
  229. package/clients/cli/commands/hook.doc.mjs +1 -0
  230. package/clients/cli/commands/init.behavior.test.mjs +5 -0
  231. package/clients/cli/commands/init.doc.mjs +29 -3
  232. package/clients/cli/commands/integration-add.doc.mjs +7 -0
  233. package/clients/cli/commands/integration-authoring.test.mjs +49 -3
  234. package/clients/cli/commands/integration-check.doc.mjs +10 -2
  235. package/clients/cli/commands/integration-check.test.mjs +175 -1
  236. package/clients/cli/commands/integration-pack.doc.mjs +8 -1
  237. package/clients/cli/commands/integration-verify.doc.mjs +8 -1
  238. package/clients/cli/commands/integration.mjs +15 -9
  239. package/clients/cli/commands/json-contract.test.mjs +11 -2
  240. package/clients/cli/commands/manifest.doc.mjs +1 -0
  241. package/clients/cli/commands/outside-project.test.mjs +774 -0
  242. package/clients/cli/commands/search.doc.mjs +1 -0
  243. package/clients/cli/commands/search.mjs +16 -11
  244. package/clients/cli/commands/search.test.mjs +429 -296
  245. package/clients/cli/commands/setup-nudge.test.mjs +26 -4
  246. package/clients/cli/commands/swizzle.doc.mjs +7 -0
  247. package/clients/cli/commands/swizzle.routing.test.mjs +1 -1
  248. package/clients/cli/commands/template.doc.mjs +1 -0
  249. package/clients/cli/commands/theme-add-lifecycle.test.mjs +3 -3
  250. package/clients/cli/commands/theme-add.doc.mjs +8 -1
  251. package/clients/cli/commands/theme-build.doc.mjs +1 -0
  252. package/clients/cli/commands/theme-eject.doc.mjs +1 -0
  253. package/clients/cli/commands/theme-list.behavior.test.mjs +6 -0
  254. package/clients/cli/commands/theme-list.doc.mjs +1 -0
  255. package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -0
  256. package/clients/cli/commands/theme-remove.doc.mjs +7 -0
  257. package/clients/cli/commands/theme-targets.doc.mjs +1 -0
  258. package/clients/cli/commands/theme-template.doc.mjs +1 -0
  259. package/clients/cli/commands/theme-use.doc.mjs +7 -0
  260. package/clients/cli/commands/upgrade.config-ordering.test.mjs +2 -1
  261. package/clients/cli/commands/upgrade.doc.mjs +22 -1
  262. package/clients/cli/commands/upgrade.file-protection.test.mjs +3 -2
  263. package/clients/cli/commands/upgrade.hook-output.test.mjs +2 -1
  264. package/clients/cli/commands/upgrade.older-cli.test.mjs +160 -0
  265. package/clients/cli/index.mjs +84 -13
  266. package/clients/cli/lib/cli-error.mjs +4 -1
  267. package/clients/cli/lib/component-format.test.mjs +1 -1
  268. package/clients/cli/lib/define-command.mjs +2 -2
  269. package/clients/cli/lib/json-shim.mjs +3 -1
  270. package/clients/cli/lib/manifest.d.ts +9 -0
  271. package/clients/cli/lib/manifest.mjs +17 -1
  272. package/clients/cli/lib/manifest.test.mjs +25 -0
  273. package/foundation/agent-docs/agent-doc-state.d.mts +21 -6
  274. package/foundation/agent-docs/agent-doc-state.mjs +29 -7
  275. package/foundation/agent-docs/agent-docs.d.mts +2 -2
  276. package/foundation/agent-docs/agent-docs.mjs +3 -3
  277. package/foundation/agent-docs/computer-agent-text.d.mts +133 -0
  278. package/foundation/agent-docs/computer-agent-text.mjs +623 -0
  279. package/foundation/agent-docs/computer-agent-text.test.mjs +602 -0
  280. package/foundation/config/project.d.mts +35 -3
  281. package/foundation/config/project.mjs +145 -8
  282. package/foundation/config/project.test.mjs +66 -0
  283. package/foundation/config/theme-state.mjs +5 -4
  284. package/foundation/discovery/cli-self-docs.mjs +20 -3
  285. package/foundation/discovery/cli-self-docs.test.mjs +3 -2
  286. package/foundation/discovery/component-replacement.mjs +2 -1
  287. package/foundation/discovery/copied-passages.d.mts +216 -0
  288. package/foundation/discovery/copied-passages.mjs +720 -0
  289. package/foundation/discovery/copied-passages.test.mjs +124 -0
  290. package/foundation/discovery/doc-consistency.d.mts +34 -0
  291. package/foundation/discovery/doc-consistency.mjs +513 -0
  292. package/foundation/discovery/doc-consistency.test.mjs +347 -0
  293. package/foundation/discovery/doc-fluff.d.mts +112 -0
  294. package/foundation/discovery/doc-fluff.mjs +328 -0
  295. package/foundation/discovery/doc-fluff.test.mjs +142 -0
  296. package/foundation/discovery/doc-types.mjs +12 -5
  297. package/foundation/discovery/doc-types.test.mjs +46 -2
  298. package/foundation/discovery/docs-discovery.d.mts +7 -0
  299. package/foundation/discovery/docs-discovery.mjs +26 -2
  300. package/foundation/discovery/prop-drift.d.mts +25 -6
  301. package/foundation/discovery/prop-drift.mjs +171 -6
  302. package/foundation/discovery/prop-drift.test.mjs +65 -0
  303. package/foundation/discovery/runner-allowlist.d.mts +40 -0
  304. package/foundation/discovery/runner-allowlist.mjs +53 -0
  305. package/foundation/discovery/stray-pointers.d.mts +52 -0
  306. package/foundation/discovery/stray-pointers.mjs +293 -0
  307. package/foundation/discovery/stray-pointers.test.mjs +86 -0
  308. package/foundation/discovery/template-needs.mjs +5 -2
  309. package/foundation/discovery/theme-imports.mjs +8 -4
  310. package/foundation/discovery/theme-imports.test.mjs +1 -1
  311. package/foundation/doc-compiler/doc-loads.test.mjs +36 -0
  312. package/foundation/doc-compiler/inputs.mjs +4 -1
  313. package/foundation/doc-compiler/links.d.mts +32 -0
  314. package/foundation/doc-compiler/links.mjs +163 -26
  315. package/foundation/doc-compiler/links.test.mjs +97 -4
  316. package/foundation/doc-compiler/read.d.mts +1 -1
  317. package/foundation/doc-compiler/tree.mjs +30 -1
  318. package/foundation/doc-compiler/tree.test.mjs +8 -1
  319. package/foundation/env/cli-command.d.mts +83 -0
  320. package/foundation/env/cli-command.mjs +152 -0
  321. package/foundation/env/cli-command.test.mjs +129 -0
  322. package/foundation/env/node-version.test.mjs +15 -3
  323. package/foundation/env/package-manager.d.mts +93 -9
  324. package/foundation/env/package-manager.global.test.mjs +66 -0
  325. package/foundation/env/package-manager.mjs +184 -13
  326. package/foundation/env/package-manager.test.mjs +341 -15
  327. package/foundation/env/project-scope.d.mts +9 -0
  328. package/foundation/env/project-scope.mjs +33 -0
  329. package/foundation/env/search-path.d.mts +42 -0
  330. package/foundation/env/search-path.mjs +205 -0
  331. package/foundation/env/search-path.test.mjs +122 -0
  332. package/foundation/env/user-dirs.d.mts +39 -0
  333. package/foundation/env/user-dirs.mjs +93 -0
  334. package/foundation/env/user-dirs.test.mjs +72 -0
  335. package/foundation/env/user-settings.d.mts +46 -0
  336. package/foundation/env/user-settings.mjs +106 -0
  337. package/foundation/env/user-settings.test.mjs +64 -0
  338. package/foundation/fs/file-protection.mjs +15 -1
  339. package/foundation/fs/module-loader.d.mts +2 -1
  340. package/foundation/fs/module-loader.mjs +60 -4
  341. package/foundation/fs/module-loader.stdout.test.mjs +3 -2
  342. package/foundation/fs/module-loader.test.mjs +194 -0
  343. package/foundation/fs/path-compare.d.mts +33 -0
  344. package/foundation/fs/path-compare.mjs +73 -0
  345. package/foundation/fs/paths.d.mts +57 -1
  346. package/foundation/fs/paths.mjs +131 -3
  347. package/foundation/fs/paths.test.mjs +10 -1
  348. package/foundation/integrations/computer-integrations.d.mts +78 -0
  349. package/foundation/integrations/computer-integrations.mjs +316 -0
  350. package/foundation/integrations/computer-integrations.test.mjs +292 -0
  351. package/foundation/integrations/contribution-inventory.d.mts +11 -0
  352. package/foundation/integrations/contribution-inventory.mjs +50 -2
  353. package/foundation/integrations/integration-warnings.mjs +3 -2
  354. package/foundation/integrations/integration-warnings.test.mjs +8 -9
  355. package/foundation/integrations/integrations.d.mts +25 -1
  356. package/foundation/integrations/integrations.mjs +46 -3
  357. package/foundation/integrations/issue.ts +6 -0
  358. package/foundation/integrations/validate-contributions.d.mts +2 -0
  359. package/foundation/integrations/validate-contributions.mjs +41 -1
  360. package/foundation/release/agent-text-worker.d.mts +4 -0
  361. package/foundation/release/agent-text-worker.mjs +52 -0
  362. package/foundation/release/cache.d.mts +310 -0
  363. package/foundation/release/cache.mjs +1216 -0
  364. package/foundation/release/cache.test.mjs +920 -0
  365. package/foundation/release/choose.d.mts +207 -0
  366. package/foundation/release/choose.mjs +677 -0
  367. package/foundation/release/choose.test.mjs +427 -0
  368. package/foundation/release/core-worker.d.mts +4 -0
  369. package/foundation/release/core-worker.mjs +38 -0
  370. package/foundation/release/global-state.d.mts +259 -0
  371. package/foundation/release/global-state.mjs +472 -0
  372. package/foundation/release/global-state.test.mjs +381 -0
  373. package/foundation/release/handoff.d.mts +60 -0
  374. package/foundation/release/handoff.e2e.test.mjs +278 -0
  375. package/foundation/release/handoff.mjs +357 -0
  376. package/foundation/release/lock-lease.d.mts +23 -0
  377. package/foundation/release/lock-lease.mjs +80 -0
  378. package/foundation/release/notices.d.mts +253 -0
  379. package/foundation/release/notices.mjs +596 -0
  380. package/foundation/release/notices.test.mjs +565 -0
  381. package/foundation/release/npm-guard.d.mts +4 -0
  382. package/foundation/release/npm-guard.mjs +126 -0
  383. package/foundation/release/project.d.mts +141 -0
  384. package/foundation/release/project.mjs +466 -0
  385. package/foundation/release/project.test.mjs +288 -0
  386. package/foundation/release/refresh-worker.d.mts +4 -0
  387. package/foundation/release/refresh-worker.mjs +27 -0
  388. package/foundation/release/run-context.d.mts +47 -0
  389. package/foundation/release/run-context.mjs +149 -0
  390. package/foundation/release/update-notice-env.d.mts +28 -0
  391. package/foundation/release/update-notice-env.mjs +39 -0
  392. package/foundation/response/base.d.ts +26 -3
  393. package/foundation/response/error-codes.d.mts +3 -1
  394. package/foundation/response/error-codes.doc.mjs +12 -0
  395. package/foundation/response/error-codes.mjs +17 -0
  396. package/foundation/response/error-codes.test.mjs +2 -0
  397. package/foundation/response/json-contract.test.mjs +7 -2
  398. package/foundation/response/json.mjs +4 -1
  399. package/foundation/response/response-types.doc.mjs +17 -11
  400. package/foundation/response/response-types.doc.test.mjs +46 -0
  401. package/foundation/response/response.doc.mjs +3 -3
  402. package/foundation/xle/browser-imports.test.mjs +74 -0
  403. package/package.json +11 -11
  404. package/scripts/postinstall.mjs +21 -2
@@ -27,7 +27,7 @@ export const docs = {
27
27
  {
28
28
  type: 'code',
29
29
  lang: 'bash',
30
- code: 'npx astryx integration verify',
30
+ code: 'astryx integration verify',
31
31
  },
32
32
  {
33
33
  type: 'prose',
@@ -67,7 +67,7 @@ export const docs = {
67
67
  'Whether the copied file type-checks in every supported app toolchain.',
68
68
  'Whether package-owned CSS, fonts, icons, images, or media load in a browser.',
69
69
  'Whether layout, color modes, keyboard and pointer input, and real content work.',
70
- 'Whether a template id collides with Core, or whether a `replaces` target exists. Run `npx astryx doctor integration templates` for those.',
70
+ 'Whether a template id collides with Core, or whether a `replaces` target exists. Run `astryx doctor integration templates` for those.',
71
71
  'How the template scores on quality.',
72
72
  ],
73
73
  },
@@ -54,13 +54,13 @@ export const docs = {
54
54
  rows: [
55
55
  [
56
56
  'A component name, such as `AcmeCarousel`',
57
- 'Imports, and `npx astryx component AcmeCarousel`',
57
+ 'Imports, and `astryx component AcmeCarousel`',
58
58
  ],
59
59
  [
60
60
  'A template id, such as `acme-dashboard`',
61
- '`npx astryx template acme-dashboard`',
61
+ '`astryx template acme-dashboard`',
62
62
  ],
63
- ['A theme slug, such as `ocean`', '`npx astryx theme add ocean`'],
63
+ ['A theme slug, such as `ocean`', '`astryx theme add ocean`'],
64
64
  [
65
65
  'A topic name or route, such as `acme/deploying`',
66
66
  'Reads of the old name, and links to it from other docs',
@@ -0,0 +1,119 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file `astryx docs global/who-answers`: which version answers in each folder, the
5
+ * hand-off, and how to see who answered (spec AST-081 FR2, FR3, FR5, FR9).
6
+ */
7
+
8
+ /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
9
+ export const docs = {
10
+ type: 'generic',
11
+ name: 'who-answers',
12
+ placement: {
13
+ parent: 'namespace:global',
14
+ slot: 'guides',
15
+ order: 3,
16
+ },
17
+ title: 'Which version runs, and why',
18
+ category: 'guide',
19
+ keywords: [
20
+ 'which release',
21
+ 'wrong version',
22
+ 'different version',
23
+ 'answered by',
24
+ 'answeredBy',
25
+ 'hand-off',
26
+ 'handed over',
27
+ 'project version',
28
+ ],
29
+ description:
30
+ "Inside a project, the project's own CLI answers, whichever astryx command you start; in a project with only Core, the astryx command you started answers. Outside a project, your global install answers. How to see which one did.",
31
+ sections: [
32
+ {
33
+ id: 'in-a-project',
34
+ title: "In a project, the project's version",
35
+ content: [
36
+ {
37
+ type: 'list',
38
+ style: 'unordered',
39
+ items: [
40
+ "The project installs the CLI, as recommended: that CLI answers, whatever its version, as it always has. When you type the global astryx command instead, it passes the run to the project's CLI, with the same arguments, input, output, and exit status, so either command gives the same answer.",
41
+ "The project installs only Core, or nothing is installed yet, as in a fresh clone: the astryx command you started answers, as it always has. When its version differs from the project's Core, a hint after the command, once a day, names the command that adds the CLI at Core's version.",
42
+ "The project's CLI is installed but cannot start: the CLI version equal to the project's Core answers instead (from the installed Core, else the lockfile, else the newest one the declared range allows), installed once into a cache.",
43
+ ],
44
+ },
45
+ {
46
+ type: 'prose',
47
+ text: "Components come from `@astryxdesign/core`, and templates, docs, and agent guides come from the CLI. In a project, that Core is the one the project installs, so component commands work offline once the project's dependencies are installed. Outside a project, or in a project with nothing installed yet (a fresh clone), they use the answering version's own Core, from beside the CLI or the cache; when that Core cannot be downloaded, the error says to install the project's dependencies. When the project's CLI and Core are different versions, `astryx doctor` warns and prints the command that brings them to one version.",
48
+ },
49
+ ],
50
+ },
51
+ {
52
+ id: 'outside',
53
+ title: 'Outside a project, your global install',
54
+ content: [
55
+ {
56
+ type: 'prose',
57
+ text: 'In a folder that belongs to no project, your global install answers as a brand-new project on its version would, so you and your agents can read every component and doc. It never installs a newer version by itself.',
58
+ },
59
+ {
60
+ type: 'prose',
61
+ text: 'A few commands work on your computer rather than a folder, such as `astryx init --user`: your global install answers them in any folder.',
62
+ },
63
+ ],
64
+ },
65
+ {
66
+ id: 'see-it',
67
+ title: 'See which version answered',
68
+ content: [
69
+ {
70
+ type: 'prose',
71
+ text: 'In a project with only Core, the hint looks like this, after the command, at most once a day per project:',
72
+ },
73
+ {
74
+ type: 'code',
75
+ lang: 'text',
76
+ code: 'astryx: this project has no Astryx CLI installed; answered by CLI 0.7.2 while its Core is 0.6.8. To match, run: npm install @astryxdesign/cli@0.6.8',
77
+ },
78
+ {
79
+ type: 'prose',
80
+ text: "Otherwise, in text mode, one line on standard error names the version, unless the project's own CLI answered directly:",
81
+ },
82
+ {
83
+ type: 'code',
84
+ lang: 'text',
85
+ code: "astryx: answered by this project's CLI 0.6.8, handed over from CLI 0.7.2\nastryx: answered by CLI 0.6.8 with Core 0.6.8, the release that matches this project's Core\nastryx: answered by CLI 0.7.2 with Core 0.7.2, outside a project\nastryx: answered by CLI 0.7.2 with Core 0.7.2, for this computer",
86
+ },
87
+ {
88
+ type: 'prose',
89
+ text: 'With `--json` nothing extra prints; every result carries `meta.answeredBy` instead ({@link generic:reference}):',
90
+ },
91
+ {
92
+ type: 'code',
93
+ lang: 'json',
94
+ code: '{"meta": {"answeredBy": {"cli": "0.7.2", "core": "0.6.8", "copy": "starting"}}}',
95
+ },
96
+ ],
97
+ },
98
+ {
99
+ id: 'printed-commands',
100
+ title: 'Commands Astryx prints',
101
+ content: [
102
+ {
103
+ type: 'prose',
104
+ text: "Commands the CLI prints for you to run start with a name that reaches the same version: the project's runner (such as `pnpm exec astryx`) in a project, `astryx` outside a project when your global install answered, and otherwise the CLI pinned to the version, such as `npx @astryxdesign/cli@0.6.8`. An integration can name its own command: {@link generic:cli-command}.",
105
+ },
106
+ ],
107
+ },
108
+ {
109
+ id: 'more',
110
+ title: 'More on global mode',
111
+ content: [
112
+ {
113
+ type: 'prose',
114
+ text: 'This page is part of {@link namespace:global}, which explains what global mode is and how each part works. To check your computer, run `astryx doctor` outside any project ({@link command:doctor}). Monorepos: {@link generic:monorepos}.',
115
+ },
116
+ ],
117
+ },
118
+ ],
119
+ };
@@ -44,13 +44,13 @@ export const docs = {
44
44
  type: 'code',
45
45
  lang: 'bash',
46
46
  code: `# Page: src/app/account/page.tsx
47
- npx astryx template acme-account src/app/account
47
+ astryx template acme-account src/app/account
48
48
 
49
49
  # Block: src/features/account/acme-stat-card.tsx
50
- npx astryx template acme-stat-card src/features/account
50
+ astryx template acme-stat-card src/features/account
51
51
 
52
52
  # Exact destination for either kind
53
- npx astryx template acme-stat-card src/features/account/StatusCard.tsx`,
53
+ astryx template acme-stat-card src/features/account/StatusCard.tsx`,
54
54
  },
55
55
  {
56
56
  type: 'prose',
@@ -36,7 +36,7 @@ export const docs = {
36
36
  type: 'code',
37
37
  lang: 'text',
38
38
  label: 'Paste this into your AI',
39
- code: 'Install @astryxdesign/cli and run `npx @astryxdesign/cli init --features agents` to set up your Astryx context. Read the generated file.',
39
+ code: 'Install @astryxdesign/cli and run `astryx init --features agents` to set up your Astryx context. Read the generated file.',
40
40
  },
41
41
  {
42
42
  type: 'prose',
@@ -50,12 +50,16 @@ export const docs = {
50
50
  type: 'code',
51
51
  lang: 'bash',
52
52
  label: 'Manual options',
53
- code: `npx @astryxdesign/cli init --features agents --agent claude # CLAUDE.md if present, else .claude/CLAUDE.md
54
- npx @astryxdesign/cli init --features agents --agent cursor # .cursorrules if present, else AGENTS.md
55
- npx @astryxdesign/cli init --features agents --agent codex # AGENTS.md (Copilot, Codex, etc.)
56
- npx @astryxdesign/cli init --features agents --agent hermes # .hermes.md or HERMES.md if present, else AGENTS.md
57
- npx @astryxdesign/cli init --features agents --agent muse # AGENTS.md (Muse)
58
- npx @astryxdesign/cli init --features agents --agent all # every agent file present, else AGENTS.md and .claude/CLAUDE.md`,
53
+ code: `astryx init --features agents --agent claude # CLAUDE.md if present, else .claude/CLAUDE.md
54
+ astryx init --features agents --agent cursor # .cursorrules if present, else AGENTS.md
55
+ astryx init --features agents --agent codex # AGENTS.md (Copilot, Codex, etc.)
56
+ astryx init --features agents --agent hermes # .hermes.md or HERMES.md if present, else AGENTS.md
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`,
59
+ },
60
+ {
61
+ type: 'prose',
62
+ text: "For agents that work outside any one project, your global install keeps one short Astryx skill, `~/.agents/skills/astryx/SKILL.md`, linked into the skill folders agent tools read, such as `~/.claude/skills/astryx`. It tells agents Astryx is there and when to use it; `astryx init --user` writes it now or, with `--remove-agents`, turns it off. Inside a project, agents follow that project's own agent docs. See {@link generic:computer-agent-guide}.",
59
63
  },
60
64
  ],
61
65
  },
@@ -92,7 +96,7 @@ npx @astryxdesign/cli init --features agents --agent all # every agent fil
92
96
  type: 'code',
93
97
  lang: 'bash',
94
98
  label: 'Install as a Cursor project rule',
95
- code: `npx @astryxdesign/cli init --features agents --agent-docs-path .cursor/rules/astryx.mdc`,
99
+ code: `astryx init --features agents --agent-docs-path .cursor/rules/astryx.mdc`,
96
100
  },
97
101
  {
98
102
  type: 'prose',
@@ -117,7 +121,7 @@ npx @astryxdesign/cli init --features agents --agent all # every agent fil
117
121
  2. How do you make a Dialog non-dismissible?
118
122
  3. What prop does Selector use for its items?
119
123
 
120
- If you don't know all three, run \`npx @astryxdesign/cli init --features agents\` to generate agent docs, then read the generated file.`,
124
+ If you don't know all three, run \`astryx init --features agents\` to generate agent docs, then read the generated file.`,
121
125
  },
122
126
  ],
123
127
  },
@@ -242,5 +246,15 @@ astryx docs principles --dense`,
242
246
  },
243
247
  ],
244
248
  },
249
+ {
250
+ id: 'global-mode',
251
+ title: 'In global mode',
252
+ content: [
253
+ {
254
+ type: 'prose',
255
+ text: "In global mode: your global install keeps one Astryx skill in your home folder, linked into the folders agent tools read, so agents outside any project know Astryx is there; inside a project, its own agent docs come first. See {@link namespace:global} and {@link generic:computer-agent-guide}.",
256
+ },
257
+ ],
258
+ },
245
259
  ],
246
260
  };
@@ -44,9 +44,9 @@ declare const eventSchema: z.ZodObject<{
44
44
  args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
45
45
  options: z.ZodRecord<z.ZodString, z.ZodUnknown>;
46
46
  optionSources: z.ZodRecord<z.ZodString, z.ZodEnum<{
47
- default: "default";
48
47
  cli: "cli";
49
48
  env: "env";
49
+ default: "default";
50
50
  config: "config";
51
51
  implied: "implied";
52
52
  }>>;
@@ -75,16 +75,16 @@ declare const eventSchema: z.ZodObject<{
75
75
  resultCount: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
76
76
  emptyResult: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
77
77
  resultKind: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
78
- theme: "theme";
79
- component: "component";
80
78
  command: "command";
79
+ none: "none";
80
+ component: "component";
81
81
  hook: "hook";
82
- template: "template";
83
82
  doc: "doc";
83
+ template: "template";
84
+ theme: "theme";
84
85
  integration: "integration";
85
86
  migration: "migration";
86
87
  mixed: "mixed";
87
- none: "none";
88
88
  }>>>;
89
89
  directMatch: z.ZodDefault<z.ZodNullable<z.ZodBoolean>>;
90
90
  stdout: z.ZodString;
@@ -16,7 +16,7 @@ export const doc = {
16
16
  displayName: 'DiscoverSource',
17
17
  namespace: 'authoring',
18
18
  description:
19
- 'A source for `astryx discover`: an async function that returns a catalog of packages a project could add, their versions, and what each version adds. Set it as `discover` in astryx.config, or export it as `discover` from an integration manifest. Discover calls every source, the project one first, and one that throws, runs past 30 seconds, or returns an invalid catalog never hides the others; discover then uses the last good answer that source gave for the same request, or reports the source as failed when it saved none. Discover only reads: it prints the command that adds a package and never runs it.',
19
+ 'A source for `astryx discover`: an async function that returns a catalog of packages a project could add, their versions, and what each version adds. Set it as `discover` in astryx.config, or export it as `discover` from an integration manifest. Discover calls every source, the project one first, and then reads the official list the CLI carries; another source\'s entry for an official package is kept. A source that throws, runs past 30 seconds, or returns an invalid catalog never hides the others; discover then uses the last good answer that source gave for the same request, or reports the source as failed when it saved none. Discover only reads: it prints the command that adds a package and never runs it.',
20
20
  appliesTo:
21
21
  '`discover` in astryx.config.*, or the `discover` named export of astryx.integration.*',
22
22
  fields: [
@@ -135,4 +135,10 @@ export const doc = {
135
135
  '};',
136
136
  },
137
137
  ],
138
+ notes: [
139
+ {
140
+ type: 'prose',
141
+ text: "In global mode: the discover source of an integration installed for the computer is called in folders outside any project; inside a project, only the sources of integrations the project installs are. See {@link namespace:global} and {@link generic:global-integrations}.",
142
+ },
143
+ ],
138
144
  };
@@ -4,12 +4,12 @@
4
4
  /** Every authored doc-kind discriminant accepted by parseDoc. */
5
5
  export const AuthoredDocKindSchema: z.ZodEnum<{
6
6
  function: "function";
7
+ command: "command";
7
8
  component: "component";
8
9
  generic: "generic";
9
10
  page: "page";
10
11
  block: "block";
11
12
  schema: "schema";
12
- command: "command";
13
13
  enum: "enum";
14
14
  namespace: "namespace";
15
15
  }>;
@@ -497,6 +497,11 @@ export const CommandDocKindSchema: z.ZodObject<{
497
497
  code: z.ZodNumber;
498
498
  when: z.ZodString;
499
499
  }, z.core.$loose>>>;
500
+ outsideProject: z.ZodOptional<z.ZodEnum<{
501
+ same: "same";
502
+ refuse: "refuse";
503
+ own: "own";
504
+ }>>;
500
505
  related: z.ZodOptional<z.ZodArray<z.ZodString>>;
501
506
  notes: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
502
507
  type: z.ZodLiteral<"prose">;
@@ -582,12 +587,12 @@ export const NamespaceDocKindSchema: z.ZodObject<{
582
587
  accepts: z.ZodObject<{
583
588
  kinds: z.ZodArray<z.ZodEnum<{
584
589
  function: "function";
590
+ command: "command";
585
591
  component: "component";
586
592
  generic: "generic";
587
593
  page: "page";
588
594
  block: "block";
589
595
  schema: "schema";
590
- command: "command";
591
596
  enum: "enum";
592
597
  namespace: "namespace";
593
598
  }>>;
@@ -602,12 +607,12 @@ export const NamespaceDocKindSchema: z.ZodObject<{
602
607
  group: z.ZodString;
603
608
  kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<{
604
609
  function: "function";
610
+ command: "command";
605
611
  component: "component";
606
612
  generic: "generic";
607
613
  page: "page";
608
614
  block: "block";
609
615
  schema: "schema";
610
- command: "command";
611
616
  enum: "enum";
612
617
  namespace: "namespace";
613
618
  }>>>;
@@ -574,6 +574,7 @@ export const CommandDocKindSchema = z
574
574
  exitCodes: z
575
575
  .array(z.object({code: z.number(), when: z.string()}).passthrough())
576
576
  .optional(),
577
+ outsideProject: z.enum(['same', 'refuse', 'own']).optional(),
577
578
  related: z.array(z.string()).optional(),
578
579
  notes: z.array(ReferenceContentBlockSchema).optional(),
579
580
  })
@@ -198,6 +198,12 @@ export const doc = {
198
198
  },
199
199
  ],
200
200
  },
201
+ {
202
+ name: 'outsideProject',
203
+ type: "'same' | 'refuse' | 'own'",
204
+ description:
205
+ 'What the command does outside a project. `same`: the answer it gives in a new project. `refuse`: it writes nothing and fails, naming the app project or integration package it needs. `own`: something else. Every `refuse` and `own` command also carries an `In global mode:` note in its `notes` that tells readers exactly what it does. Every command and subcommand declares one, and `astryx manifest` publishes it; a command that only groups subcommands declares none. The CLI tests run every command in an empty folder and check what it does against this value; `astryx doctor` does not check it.',
206
+ },
201
207
  {
202
208
  name: 'deprecated',
203
209
  type: 'string',
@@ -40,6 +40,18 @@ export interface CommandOptionDoc {
40
40
  cliOnly?: boolean;
41
41
  }
42
42
 
43
+ /**
44
+ * What a command does in a folder outside any project:
45
+ * - `same`: it gives the answer it gives in a new project, reading the Core
46
+ * the answering release carries.
47
+ * - `refuse`: it writes nothing and fails before doing any work, naming the app
48
+ * project or integration package it needs.
49
+ * - `own`: it does something else.
50
+ * Every `refuse` and `own` command also carries an `In global mode:` note
51
+ * in its `notes`, for readers.
52
+ */
53
+ export type CommandOutsideProject = 'same' | 'refuse' | 'own';
54
+
43
55
  export interface CommandExampleDoc {
44
56
  label?: string;
45
57
  /** A full terminal invocation, e.g. 'astryx search button --json'. */
@@ -81,6 +93,8 @@ export interface CommandDoc extends AuthoredDocGraphFields {
81
93
  examples?: CommandExampleDoc[];
82
94
  /** Documented exit codes. */
83
95
  exitCodes?: {code: number; when: string}[];
96
+ /** What the command does outside a project: `same`, `refuse`, or `own`. Every command and subcommand declares one, and `astryx manifest` publishes it; a command that only groups subcommands declares none. */
97
+ outsideProject?: CommandOutsideProject;
84
98
  /** Deprecation notice — a DEP-* id and the replacement. */
85
99
  deprecated?: string;
86
100
  /** Related command names; the CLI links each to its doc. */
@@ -56,7 +56,7 @@ export const doc = {
56
56
  name: 'replaces',
57
57
  type: 'string',
58
58
  description:
59
- 'Integration components only: the exact `name` of the Core ComponentDoc this component takes over for unqualified lookup, so every app that loads the integration gets it from component detail, component lists, search, `swizzle <Name>`, and issue routing; `swizzle --list` keeps listing Core names. The Core original stays reachable with `--package @astryxdesign/core`. It takes effect only when the package\'s peer range starts at the release that applies it, `"@astryxdesign/cli": ">=0.6.7"` or later; without such a range the component keeps its own name and `doctor integration components` warns. Set it only to intentionally own a Core identity; give an alternative or variant its own name instead.',
59
+ 'Integration components only: the exact `name` of the Core ComponentDoc this component takes over for unqualified lookup, so every app that loads the integration gets it from component detail, component lists, search, `swizzle <Name>`, and issue routing; `swizzle --list` keeps listing Core names. The Core original stays reachable with `--package @astryxdesign/core`. It takes effect only when the package\'s peer range starts at the release that applies it, `"@astryxdesign/cli": ">=0.6.7"` or later; with a lower range nothing changes and `doctor integration components` warns ({@link generic:replace-a-core-component}). Set it only to intentionally own a Core identity; give an alternative or variant its own name instead.',
60
60
  },
61
61
  {
62
62
  name: 'keywords',
@@ -273,6 +273,14 @@ export interface ComponentRef {
273
273
  * Used by both `docsZh` (Chinese translation) and `docsDense` (compressed format).
274
274
  */
275
275
  export interface ComponentTranslationDoc {
276
+ /** Optional exact name from the base doc. Allowed so an overlay can say
277
+ * which component it translates; the overlay renders through the base
278
+ * doc, so this field is ignored at render time. */
279
+ name?: string;
280
+ /** Optional translated displayName. Allowed so the displayName backfill
281
+ * codemod (which adds `displayName` next to every `name:` field) does not
282
+ * break translation overlays. Ignored at render time. */
283
+ displayName?: string;
276
284
  /** Compressed/translated component description. */
277
285
  description?: string;
278
286
  /** Prop descriptions keyed by prop name. Only include props that have descriptions. */
@@ -68,6 +68,10 @@ export interface HookDoc extends AuthoredDocGraphFields {
68
68
  * Translation overlay for hook documentation.
69
69
  */
70
70
  export interface HookTranslationDoc {
71
+ /** Optional exact name from the base doc. Ignored at render time. */
72
+ name?: string;
73
+ /** Optional translated displayName. Ignored at render time. */
74
+ displayName?: string;
71
75
  /** Compressed/translated description. */
72
76
  description?: string;
73
77
  /** Param descriptions keyed by param name. */
@@ -152,7 +152,7 @@ export default {
152
152
  },
153
153
  {
154
154
  type: 'prose',
155
- text: 'Each `sections[].content` is an ordered array of ReferenceContentBlock, the stable discriminated union of prose, heading, code, table, list, and token-ref, plus the reference block (ReferenceDocBlock). A read inlines a reference block the way it inlines a token-ref, so `astryx docs`, in text and in `--json`, returns only the stable block kinds. Docs-graph-only workflow and collection blocks are exported separately as GraphContentBlock and accepted by NamespaceDoc. choice, callout, and checklist remain invalid. ReferenceContentBlock is also reused by the `notes` field on SchemaDoc and CommandDoc. Inside text, `{@link <target>}` links another doc by identity (`[<provider>:]<kind>:<name>`): the CLI prints the command that opens it, and `astryx doctor` warns on one that names no doc.',
155
+ text: 'Each `sections[].content` is an ordered array of ReferenceContentBlock, the stable discriminated union of prose, heading, code, table, list, and token-ref, plus the reference block (ReferenceDocBlock). A read inlines a reference block the way it inlines a token-ref, so `astryx docs`, in text and in `--json`, returns only the stable block kinds. Docs-graph-only workflow and collection blocks are exported separately as GraphContentBlock and accepted by NamespaceDoc. choice, callout, and checklist remain invalid. ReferenceContentBlock is also reused by the `notes` field on SchemaDoc and CommandDoc. Inside text, `{@link <target>}` links another doc by identity (`[<provider>:]<kind>:<name>`): the CLI prints the command that opens it, and `astryx doctor` warns on one that names no doc. Write a CLI command in text, shell code, or a table cell as a bare `astryx` command: a text read adds the runner the reader uses in front of it, and `--json` returns it as written.',
156
156
  },
157
157
  {
158
158
  type: 'prose',
@@ -163,6 +163,7 @@ export type {
163
163
  CommandArgDoc,
164
164
  CommandOptionDoc,
165
165
  CommandExampleDoc,
166
+ CommandOutsideProject,
166
167
  // enum
167
168
  EnumMemberDoc,
168
169
  } from './doctypes/types.js';
@@ -16,7 +16,7 @@ export const doc = {
16
16
  'The astryx.integration.* manifest that sits beside an integration ' +
17
17
  "package's package.json. It can preserve a stable provider identity across a package rename, " +
18
18
  "and points the CLI at the package's components, templates, codemods, doc topics, " +
19
- 'source themes, managed agent guidance, and issue tracker. Every field is optional.',
19
+ 'source themes, managed agent guidance, issue tracker, and the command its users run the CLI with. Every field is optional.',
20
20
  appliesTo: 'astryx.integration.{ts,mjs,js}',
21
21
  fields: [
22
22
  {
@@ -82,6 +82,13 @@ export const doc = {
82
82
  "Link to this integration's docs site, such as its home page. Catalogs that list the package may show it.",
83
83
  example: "'https://widgets.acme.dev'",
84
84
  },
85
+ {
86
+ name: 'cliCommand',
87
+ type: 'string',
88
+ description:
89
+ 'The command your users run the Astryx CLI with, when it is not their package manager, such as a wrapper your company ships. Every command the CLI prints in an app that loads your package starts with it, in place of `pnpm exec astryx` or `yarn astryx`: hints, errors, Doctor fixes, and doc text. One line, without a subcommand. If two loaded packages set different commands, neither is used and `astryx doctor` warns. An invalid value is ignored with an `invalid_cli_command` warning, and the rest of the manifest still loads. JSON output keeps commands bare.',
90
+ example: "'acme astryx'",
91
+ },
85
92
  ],
86
93
  examples: [
87
94
  {
@@ -100,6 +107,10 @@ export const doc = {
100
107
  },
101
108
  ],
102
109
  notes: [
110
+ {
111
+ type: 'prose',
112
+ text: "In global mode: a manifest loads the same way when users install your package for their computer, beside the global CLI, and then applies in folders outside any project; inside a project, only if the project installs it. Peer ranges for `@astryxdesign/core` and `@astryxdesign/cli` are checked against the global CLI's release. See {@link namespace:global} and {@link generic:global-integrations}.",
113
+ },
103
114
  {
104
115
  type: 'prose',
105
116
  text:
@@ -115,7 +126,12 @@ export const doc = {
115
126
  'trimmed, non-blank string of at most 240 Unicode code points with no ' +
116
127
  'line separators, control characters, NUL, or Astryx/XDS managed-marker ' +
117
128
  'text. The configured project may contain at most 32 integration lines ' +
118
- 'total.',
129
+ 'total. Write each command in a line as a bare `astryx` command; the ' +
130
+ 'managed block says once, before your lines, how the app starts the CLI.',
131
+ },
132
+ {
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`.",
119
135
  },
120
136
  {
121
137
  type: 'prose',
@@ -97,6 +97,17 @@ describe('parseIntegration (load boundary)', () => {
97
97
  expect(reason({docsiteUrl: 'nope'})).toContain('docsiteUrl');
98
98
  });
99
99
 
100
+ it('accepts a cliCommand and rejects one that is not a single clean line', () => {
101
+ expect(parseIntegration({cliCommand: 'acme astryx'})).toEqual({
102
+ cliCommand: 'acme astryx',
103
+ });
104
+ expect(reason({cliCommand: ''})).toContain('cliCommand');
105
+ expect(reason({cliCommand: ' acme astryx'})).toContain('cliCommand');
106
+ expect(reason({cliCommand: 'acme\nastryx'})).toContain('cliCommand');
107
+ expect(reason({cliCommand: 'a'.repeat(121)})).toContain('120');
108
+ expect(reason({cliCommand: 42})).toContain('cliCommand');
109
+ });
110
+
100
111
  it('rejects a noncanonical providerId', () => {
101
112
  expect(reason({providerId: 'Acme Widgets'})).toContain('providerId');
102
113
  });
@@ -3,12 +3,12 @@
3
3
 
4
4
  /**
5
5
  * Parse every default-manifest field except the independently isolated
6
- * `agentDocs` contribution.
6
+ * `agentDocs` and `cliCommand` fields.
7
7
  * @param {unknown} input
8
8
  * @param {string} label
9
- * @returns {Omit<AstryxIntegration, 'agentDocs'>}
9
+ * @returns {Omit<AstryxIntegration, 'agentDocs' | 'cliCommand'>}
10
10
  */
11
- export function parseIntegrationBase(input: unknown, label: string): Omit<AstryxIntegration, "agentDocs">;
11
+ export function parseIntegrationBase(input: unknown, label: string): Omit<AstryxIntegration, "agentDocs" | "cliCommand">;
12
12
  /**
13
13
  * Parse only the optional agent-doc contribution.
14
14
  * @param {unknown} input
@@ -16,6 +16,15 @@ export function parseIntegrationBase(input: unknown, label: string): Omit<Astryx
16
16
  * @returns {NonNullable<AstryxIntegration['agentDocs']>}
17
17
  */
18
18
  export function parseAgentDocsField(input: unknown, label: string): NonNullable<AstryxIntegration["agentDocs"]>;
19
+ /**
20
+ * Parse only the optional `cliCommand` field. Isolated like `agentDocs`: an
21
+ * invalid command is ignored with a warning, and the rest of the manifest
22
+ * still contributes.
23
+ * @param {unknown} input
24
+ * @param {string} label
25
+ * @returns {string}
26
+ */
27
+ export function parseCliCommandField(input: unknown, label: string): string;
19
28
  /**
20
29
  * The manifest keys this CLI does not know, in the order they were authored.
21
30
  *
@@ -28,6 +37,7 @@ export function parseAgentDocsField(input: unknown, label: string): NonNullable<
28
37
  * @returns {string[]}
29
38
  */
30
39
  export function unknownIntegrationKeys(input: unknown): string[];
40
+ export const cliCommandSchema: z.ZodString;
31
41
  export const agentDocsSchema: z.ZodObject<{
32
42
  append: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
33
43
  }, z.core.$strip>;
@@ -53,6 +63,7 @@ export const integrationSchema: z.ZodObject<{
53
63
  agentDocs: z.ZodOptional<z.ZodObject<{
54
64
  append: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
55
65
  }, z.core.$strip>>;
66
+ cliCommand: z.ZodOptional<z.ZodString>;
56
67
  }, z.core.$strip>;
57
68
  /**
58
69
  * Compile-time drift-lock: sealed schema must infer exactly {@link AstryxIntegration}.
@@ -19,6 +19,7 @@ import {formatZodError} from '../_shared/errors.mjs';
19
19
  /** @typedef {import('./type.js').AstryxIntegration} AstryxIntegration */
20
20
 
21
21
  const MAX_AGENT_DOC_LINES = 8;
22
+ const MAX_CLI_COMMAND_CODE_POINTS = 120;
22
23
  const MAX_AGENT_DOC_LINE_CODE_POINTS = 240;
23
24
  const MANAGED_MARKER_TEXT = /(?:ASTRYX|XDS):(START|END)/u;
24
25
  const PROVIDER_ID_RE =
@@ -51,6 +52,21 @@ function invalidAgentDocLine(value) {
51
52
  return null;
52
53
  }
53
54
 
55
+ export const cliCommandSchema = z.string().superRefine((value, ctx) => {
56
+ const message = invalidAgentDocLine(value);
57
+ if (message) {
58
+ ctx.addIssue({code: 'custom', message});
59
+ return;
60
+ }
61
+ const codePoints = [...value].length;
62
+ if (codePoints > MAX_CLI_COMMAND_CODE_POINTS) {
63
+ ctx.addIssue({
64
+ code: 'custom',
65
+ message: `must contain at most ${MAX_CLI_COMMAND_CODE_POINTS} Unicode code points (received ${codePoints})`,
66
+ });
67
+ }
68
+ });
69
+
54
70
  const agentDocLineSchema = z.string().superRefine((value, ctx) => {
55
71
  const message = invalidAgentDocLine(value);
56
72
  if (message) ctx.addIssue({code: 'custom', message});
@@ -92,14 +108,15 @@ export const integrationBaseSchema = z.object({
92
108
  // IS an authoring mistake and still fails here.
93
109
  export const integrationSchema = integrationBaseSchema.extend({
94
110
  agentDocs: agentDocsSchema.optional(),
111
+ cliCommand: cliCommandSchema.optional(),
95
112
  });
96
113
 
97
114
  /**
98
115
  * Parse every default-manifest field except the independently isolated
99
- * `agentDocs` contribution.
116
+ * `agentDocs` and `cliCommand` fields.
100
117
  * @param {unknown} input
101
118
  * @param {string} label
102
- * @returns {Omit<AstryxIntegration, 'agentDocs'>}
119
+ * @returns {Omit<AstryxIntegration, 'agentDocs' | 'cliCommand'>}
103
120
  */
104
121
  export function parseIntegrationBase(input, label) {
105
122
  const result = integrationBaseSchema.safeParse(input);
@@ -119,6 +136,20 @@ export function parseAgentDocsField(input, label) {
119
136
  return result.data;
120
137
  }
121
138
 
139
+ /**
140
+ * Parse only the optional `cliCommand` field. Isolated like `agentDocs`: an
141
+ * invalid command is ignored with a warning, and the rest of the manifest
142
+ * still contributes.
143
+ * @param {unknown} input
144
+ * @param {string} label
145
+ * @returns {string}
146
+ */
147
+ export function parseCliCommandField(input, label) {
148
+ const result = cliCommandSchema.safeParse(input);
149
+ if (!result.success) throw new Error(formatZodError(label, result.error));
150
+ return result.data;
151
+ }
152
+
122
153
  /**
123
154
  * Compile-time drift-lock: sealed schema must infer exactly {@link AstryxIntegration}.
124
155
  *