@astryxdesign/cli 0.7.0-canary.e92e36f → 0.7.0-canary.eaca8eb

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 (75) hide show
  1. package/README.md +61 -61
  2. package/api/doctor/doctor.d.mts +30 -2
  3. package/api/doctor/doctor.doc.mjs +2 -1
  4. package/api/doctor/doctor.mjs +153 -3
  5. package/api/doctor/doctor.test.mjs +250 -4
  6. package/api/integration/pack-check.test.mjs +8 -0
  7. package/api/template/template.doc.mjs +1 -1
  8. package/api/template/template.type.mjs +1 -1
  9. package/api/theme/build/build.d.mts +0 -1
  10. package/api/theme/build/build.mjs +4 -29
  11. package/api/theme/build/family.mjs +1 -1
  12. package/assets/codemods/transforms/next/__tests__/migrate-field-input-styling.test.mjs +108 -0
  13. package/assets/codemods/transforms/next/__tests__/preserve-bottom-sheet-content-padding.test.mjs +178 -0
  14. package/assets/codemods/transforms/next/__tests__/validate-data-token-ownership.test.mjs +84 -0
  15. package/assets/codemods/transforms/next/index.mjs +24 -0
  16. package/assets/codemods/transforms/next/migrate-field-input-styling.mjs +198 -0
  17. package/assets/codemods/transforms/next/preserve-bottom-sheet-content-padding.mjs +242 -0
  18. package/assets/codemods/transforms/next/validate-data-token-ownership.mjs +102 -0
  19. package/assets/docs/author-a-theme.doc.mjs +1 -1
  20. package/assets/docs/spacing.doc.mjs +2 -2
  21. package/assets/docs/tree/tokens-data.doc.mjs +2 -2
  22. package/assets/docs/tree/tokens-spacing.doc.mjs +15 -15
  23. package/assets/docs/tree/tokens-usage.doc.mjs +1 -1
  24. package/assets/templates/blocks/components/BottomSheet/BottomSheetHeights.tsx +1 -1
  25. package/assets/templates/blocks/components/BottomSheet/BottomSheetMobileKeyboard.tsx +1 -1
  26. package/assets/templates/blocks/components/BottomSheet/BottomSheetNoScrim.tsx +1 -1
  27. package/assets/templates/blocks/components/BottomSheet/BottomSheetSnapPoints.tsx +1 -1
  28. package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorDeadlinePicker.tsx +1 -1
  29. package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorShowcase.tsx +1 -1
  30. package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorTreeSearch.tsx +1 -1
  31. package/assets/templates/blocks/components/Dialog/DialogAdaptivePresentation.tsx +1 -1
  32. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +1 -1
  33. package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.tsx +1 -1
  34. package/assets/templates/blocks/components/Selector/SelectorClearable.tsx +1 -1
  35. package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +2 -2
  36. package/assets/templates/blocks/components/Selector/SelectorShowcase.tsx +1 -1
  37. package/assets/templates/blocks/components/Selector/SelectorWithSections.tsx +1 -1
  38. package/assets/templates/blocks/components/SelectorOption/SelectorOptionBasic.tsx +1 -1
  39. package/assets/templates/blocks/components/SelectorOption/SelectorOptionShowcase.tsx +1 -1
  40. package/assets/templates/blocks/components/Slider/SliderFormattedValue.tsx +1 -1
  41. package/assets/templates/blocks/components/Slider/SliderRangeSlider.tsx +1 -1
  42. package/assets/templates/blocks/components/Slider/SliderShowcase.tsx +1 -1
  43. package/assets/templates/blocks/components/Slider/SliderWithMarks.tsx +1 -1
  44. package/assets/templates/blocks/components/Tokenizer/TokenizerClear.tsx +1 -1
  45. package/assets/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +2 -2
  46. package/assets/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +1 -1
  47. package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +1 -1
  48. package/assets/templates/blocks/components/Tokenizer/TokenizerMaxEntries.tsx +1 -1
  49. package/assets/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +2 -2
  50. package/assets/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +1 -1
  51. package/assets/templates/blocks/components/Tokenizer/TokenizerStates.tsx +4 -4
  52. package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +1 -1
  53. package/assets/templates/pages/canvas-editor/page.tsx +2 -2
  54. package/assets/templates/pages/form-wizard-vertical/page.tsx +1 -1
  55. package/assets/templates/pages/payment-form/page.tsx +1 -1
  56. package/assets/templates/pages/table-filter/page.tsx +11 -6
  57. package/assets/templates/pages/table-inbox/page.tsx +3 -1
  58. package/assets/templates/pages/theme-showcase/page.tsx +2 -2
  59. package/assets/templates/themes/butter/butterTheme.ts +12 -0
  60. package/assets/templates/themes/chocolate/chocolateTheme.ts +12 -0
  61. package/assets/templates/themes/matcha/matchaTheme.ts +14 -14
  62. package/assets/templates/themes/neutral/neutralTheme.ts +12 -0
  63. package/assets/templates/themes/stone/stoneTheme.ts +12 -0
  64. package/assets/templates/themes/y2k/y2kTheme.ts +10 -10
  65. package/assets/theme.template.ts +1 -1
  66. package/clients/cli/commands/build-theme.color-scheme.test.mjs +10 -6
  67. package/clients/cli/commands/build-theme.data-tokens.test.mjs +23 -75
  68. package/clients/cli/commands/doctor.doc.mjs +1 -1
  69. package/clients/cli/commands/doctor.test.mjs +33 -0
  70. package/foundation/discovery/template-needs.mjs +93 -11
  71. package/foundation/discovery/template-needs.test.mjs +106 -3
  72. package/foundation/env/package-manager.d.mts +13 -0
  73. package/foundation/env/package-manager.mjs +106 -63
  74. package/foundation/response/response-types.doc.mjs +1 -2
  75. package/package.json +9 -9
package/README.md CHANGED
@@ -419,67 +419,67 @@ Every response has a `type` discriminant. The full set is below (generated from
419
419
 
420
420
  <!-- BEGIN GENERATED: response-types -->
421
421
 
422
- | Type | What `data` carries |
423
- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
424
- | `init.run` | The install receipt: the `mode` (`default` \| `features`), the features run, agent-doc files written, any soft `docsError`, whether theme guidance was emitted, the template outcome (`workflow` \| `created` \| `skipped`) plus its path, and whether the next-steps were emitted. |
425
- | `init.remove` | The removal receipt — returned when --remove-agents is set: `data.removed` is true when a managed agent-docs block was found and removed, and false when there was none to remove. |
426
- | `component.list` | The component catalog grouped by component group (each component's group field): `detail` (the level: names \| compact \| full) and `components`, the grouped map of names entries ({name, package, and optional canonical import for integrations}), brief entries ({name, package, description, import}), or a full ComponentDoc per entry with its package. |
427
- | `component.batch` | The component specialization of the shared `BatchResponse` and `BatchRow` types. An explicit programmatic selector array, or two or more CLI selectors, returns one ordered receipt: `count` plus `results`, one row per selector including duplicates. Every row carries `selector` and `status` (found \| not_found \| ambiguous \| error). A found row carries `result`, the same {type, data} response as one selector. An ambiguous row carries `code`, `error`, and `candidates` ({package, component, kind, installed}). Other failed rows carry `code`, `error`, and optional `suggestions` ({name, reason}). |
428
- | `component.detail` | One component's authored ComponentDoc plus ownership fields (package, the owner; import, the specifier; sourceAvailable, whether source exists) and parentDoc (present when the component is documented inside another component's doc, naming that doc). The envelope's package names the same owner. |
429
- | `component.detail.props` | Just one component's props table (ComponentPropDoc[]). The envelope's package names the npm package that owns the component. |
430
- | `component.detail.source` | One component's source file, as {component, source}. The envelope's package names the npm package that owns the component. |
431
- | `component.detail.showcase` | One component's showcase example, as {component, aspectRatio, source}. The envelope's package names the npm package that owns the component. |
432
- | `component.detail.blocks` | One component's example blocks, as {component, showcase, examples, related} of BlockEntry ({name, package, displayName, description, isShowcase, category}); each block names the package that owns it, and the envelope's package names the component's owner. |
433
- | `docs.list` | All reference-doc topics as DocsListEntry[] ({topic, description, package, replaces?}), in read order; meta.namespaces lists the docs tree's top-level namespaces, and meta.notLoaded each package whose docs did not load. |
434
- | `docs.detail` | One topic's full ReferenceDoc (the JSON read of a topic, --full, --dense, or a topic with one section), with token-ref blocks inlined and each section naming the package that wrote it, plus links ({up, previous, next}: the commands that open the level it sits in and its neighbors there). |
435
- | `docs.index` | One topic's section index, the text read of a topic with more than one section (and --index): the topic's name, title, and description, plus sections, each {id, title, package, summary} (pass the id as the section argument; package is the npm package that wrote the section; summary is the section's one-line summary), and links ({up, previous, next}: the commands that open the level it sits in and its neighbors there). |
436
- | `docs.detail.section` | One ReferenceSection of a topic, found by key or title, with token-ref blocks inlined, plus links ({up, previous, next}: the commands that open its topic index and the sections before and after it). The envelope's package names the npm package that wrote the section. |
437
- | `docs.node` | One node of the docs tree, read by its route: its id, kind, package, title, summary, and breadcrumb, plus a namespace's slots with their children (one level down, each naming its package) or a typed doc's content, and links ({up, previous, next, related}: the commands that open its parent, its neighbors, and the docs it names). |
438
- | `blog.list` | The feed URL plus every post parsed from the RSS feed, each with slug, title, description, date, type, authors, link, and plaintext URL. |
439
- | `blog.detail` | One post's metadata plus the feed URL and the post's full plaintext body. |
440
- | `discover.list` | The integrations the project loads (name, category, components, version, a list per other kind they add, and latest when a source knows it); with a discover source, meta.available lists what the project could add and meta.sources reports each source; when empty it carries meta.configured to tell "nothing configured" from "nothing discovered". |
441
- | `discover.detail` | One package, for an @scope/name or @scope/name@version query: what the shown version adds, whether the project has it, and, when a source knows the package, its versions, latest release, and the command that adds it. |
442
- | `discover.detail.doc` | The validated ComponentDoc for one installed component, for an @scope/name/Component query. |
443
- | `discover.item` | One item that is not an installed component, for an @scope/name/<item> query: its kind, name, package, version, and whether the project has the package. |
444
- | `discover.search` | The echoed query plus every matching item and package across all packages, each with its kind and whether the project has it, even when only one matches; total is set when --limit cut the list. |
445
- | `search` | The echoed query, `matchCount` (total matches, before `limit`), and results, a ranked SearchResultEntry[] bounded by `limit`: each {domain, name, package, score, reason, description, command} (package is the npm package that owns the result), plus import (components, hooks), title, parent (the command that opens the level above), and, for a hit on one section, section (docs), or displayName and kind (templates). |
446
- | `build.help` | The how-to-build-a-page playbook, emitted when no query is given: `playbook: true`, a title, the ordered steps (title, commands, optional returns), the on-system rules, and related lookups. Commands are bare subcommands for the caller to render with its own invocation. |
447
- | `build.kit` | The template to start from and its kit: query, hasResults, matchCount (never a cap), directMatch, start {name, package, command, basis, reason, alternatives, ...} (the start and each alternative name the package that owns the template), pages (search's closest templates), blocks and domain as SearchResultEntry[] (each naming its package), frame and foundation (Core component names), and hint {reason, commands} when thin. |
448
- | `swizzle.list` | The names of swizzlable components discoverable from cwd's @astryxdesign/core. The envelope's package is @astryxdesign/core. |
449
- | `swizzle.copy` | An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and, when the owner has an issues URL, feedback ({issuesUrl, ghCommand?}): where to report the gap that led to swizzling. The envelope's package names the same owning package. |
450
- | `gap-report.categories` | The fixed gap category values and human-readable labels. |
451
- | `gap-report.file` | An aggregate receipt: overall status, the selected package, issuesUrl (or null), deliveries in handler order, each {handlerType: project \| integration \| fallback, handler, audience, status, url, message}, and filedCount/routedOnlyCount totals. |
452
- | `template.list` | The effective discovered TemplateListEntry[] for pages and blocks. A winning replacement entry includes optional `replaces`, naming the Core id omitted from the default list. |
453
- | `template.show` | The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and demoMediaReplaced (how many Astryx demo media references were replaced with placeholders for you to swap for your own media). |
454
- | `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description and the components it composes. The envelope's package names the npm package that owns the template. |
455
- | `template.copy` | A scaffold receipt: template id, output directory, written file name, file count, demoMediaReplaced (how many Astryx demo media references were replaced with placeholders), notes (setup notes naming what the template needs that the project lacks — missing packages, missing StyleX compiler; empty when satisfied), missingPackages (external package names the template imports that are not in the project), and installCommand (a ready-to-run install command with the detected package manager and workspace version ranges; null when nothing is missing). The envelope's package names the npm package that owns the template. |
456
- | `template.cdn` | A write receipt for the no-build-step CDN starter page: the path (relative to cwd), the Astryx version every CDN URL was pinned to, whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
457
- | `hook.list` | The hook catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of hook names, brief entries, or a full HookDoc per entry. The envelope's package is @astryxdesign/core, the only package that ships hooks. |
458
- | `hook.detail` | One hook's full authored HookDoc. The envelope's package is @astryxdesign/core. |
459
- | `hook.detail.params` | Just one hook's parameters table (HookParamDoc[]). The envelope's package is @astryxdesign/core. |
460
- | `theme.build` | A theme build receipt: name, tokenCount and componentCount (override counts), sizeKB, the written outputs {css, cssDts, js, dts, and variantsDts when applicable}, warnings (defects to fix), and notices (advisories about a correct theme, such as a named font it does not load). |
461
- | `theme.build.check` | The --check receipt: theme name, an upToDate flag, the stale outputs (each {path, reason: missing \| outdated}), and the full list of checked paths. Writes nothing. |
462
- | `theme.build.batch` | Several themes built in one invocation: `count` plus one {file, receipt} per theme in argument order, where receipt is that theme's theme.build (or theme.build.check) envelope, or null when it produced no CSS. |
463
- | `theme.list` | Every bundled, installed package, and local theme as a ThemeListEntry[]. Each entry has slug, displayName, description, maintained, owner package or local root, source, added, and default fields. Optional meta.unmigratedCopies names earlier descriptor-less copies, their missing descriptor, and the upgrade command; those copies are not data entries. |
464
- | `theme.app` | The app theme record after add, remove, or use. It includes every added theme and its built imports, the default slug, generated module path, and the command change. After add, the envelope package names the npm package that owns the added theme; a local theme has none. |
465
- | `theme.eject` | A local source-fork receipt with the resolved slug, displayName, source theme maintained flag, source-selector package, outputDir, source entry, exportName, and every file written, including the descriptor. The written local descriptor always uses maintained: false. |
466
- | `theme.template` | A write receipt for the annotated theme template: the path (relative to cwd), whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
467
- | `theme.targets` | The whole themeable surface: the echoed filter, componentCount, and targets, one per theming target — {key, className, component, props, states}, where props and states are its legal override keys. |
468
- | `theme.palette.generate` | An author-reviewable OKLCH palette candidate, its reproducibility receipt, summary counts, and optional candidate/receipt file-write result. |
469
- | `upgrade.list` | Every available codemod, oldest→newest, as {name, package, title, version, optional}; returned for --list without running anything. |
470
- | `upgrade.registry` | The copied-composition receipt for --registry: applied, ok, the counts (found, current, wouldUpdate, updated, wouldMerge, merged, wouldRefreshReceipt, receiptsRefreshed, conflicts, missing, invalid, failed), and items. |
471
- | `upgrade.status` | A short-circuit outcome with no codemods run (up_to_date, no_codemods, or config_fixable), each carrying the agent-docs summary. |
472
- | `upgrade.run` | The run receipt: from/to versions, codemod count, integrations processed, the agent-docs summary, sourcePathFound (false when the resolved source directory does not exist, so no source file was read), and (apply mode) filesChanged, transformsApplied, and per-codemod errors. |
473
- | `manifest` | The CLI capability manifest: name, version, apiVersion, description, globalOptions, commands (each name, description, arguments, options, json, aliases?, responseTypes?, examples?, exitCodes? as [{code, when}], subcommands?), jsonSupported, and the flat responseTypes index. |
474
- | `help` | Help, in one of two shapes. A bare `astryx --json` returns the root manifest: name, version, commands (the command names), jsonSupported, and manifest (the full payload `astryx manifest --json` returns). `--help --json` on any command, or `astryx help [command] --json`, returns that command's help: command, description, usage, options (each flags, description, and defaultValue and choices when set), and subcommands (each name and description). data.manifest marks the first shape; data.usage marks the second. |
475
- | `version` | The CLI version, for `astryx --version --json`: {version}. |
476
- | `doctor` | The health-check report: `checks` (each with id, label, status: pass \| warn \| fail \| info, a message, and an optional fix, always present on warn and fail) plus a `summary` of counts per status. |
477
- | `integration.add` | A contribution-writer receipt: kind, name, optional root {path, created}, integration-manifest path, every affected project-relative path, written, and dryRun. |
478
- | `integration.pack-check` | The packed-package check: name, version, packable, tarball {filename, fileCount, size, unpackedSize} or null, inventory {manifest, roots [{kind, path, expectedFiles, missingFiles, complete}], expectedFiles, packedFiles}, contributions {local, packed}, each null or {themes [{slug, exportName}], components, templates [{id, type, name}], codemods [{version, id}], docs, agentDocsAppend}, and issues [{code, severity, message}]. |
479
- | `integration.validate` | The validation result: validated (false when nothing was validated: with no package.json the issues list carries one no_package error so the command exits 1, and with a package.json but no integration manifest the issues list is empty and proves nothing), the package name and version (both null when validated is false) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning \| error, message}. |
480
- | `integration.template-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking Core template-id conflicts as {id, severity: warning, integrationPackage, integrationType, integrationName, coreMatches, message, command}. |
481
- | `integration.component-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command. |
482
- | `integration.doc-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` \| `error`) and `relationship` (`replaces` \| `extends` \| `accidental`). |
422
+ | Type | What `data` carries |
423
+ | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
424
+ | `init.run` | The install receipt: the `mode` (`default` \| `features`), the features run, agent-doc files written, any soft `docsError`, whether theme guidance was emitted, the template outcome (`workflow` \| `created` \| `skipped`) plus its path, and whether the next-steps were emitted. |
425
+ | `init.remove` | The removal receipt — returned when --remove-agents is set: `data.removed` is true when a managed agent-docs block was found and removed, and false when there was none to remove. |
426
+ | `component.list` | The component catalog grouped by component group (each component's group field): `detail` (the level: names \| compact \| full) and `components`, the grouped map of names entries ({name, package, and optional canonical import for integrations}), brief entries ({name, package, description, import}), or a full ComponentDoc per entry with its package. |
427
+ | `component.batch` | The component specialization of the shared `BatchResponse` and `BatchRow` types. An explicit programmatic selector array, or two or more CLI selectors, returns one ordered receipt: `count` plus `results`, one row per selector including duplicates. Every row carries `selector` and `status` (found \| not_found \| ambiguous \| error). A found row carries `result`, the same {type, data} response as one selector. An ambiguous row carries `code`, `error`, and `candidates` ({package, component, kind, installed}). Other failed rows carry `code`, `error`, and optional `suggestions` ({name, reason}). |
428
+ | `component.detail` | One component's authored ComponentDoc plus ownership fields (package, the owner; import, the specifier; sourceAvailable, whether source exists) and parentDoc (present when the component is documented inside another component's doc, naming that doc). The envelope's package names the same owner. |
429
+ | `component.detail.props` | Just one component's props table (ComponentPropDoc[]). The envelope's package names the npm package that owns the component. |
430
+ | `component.detail.source` | One component's source file, as {component, source}. The envelope's package names the npm package that owns the component. |
431
+ | `component.detail.showcase` | One component's showcase example, as {component, aspectRatio, source}. The envelope's package names the npm package that owns the component. |
432
+ | `component.detail.blocks` | One component's example blocks, as {component, showcase, examples, related} of BlockEntry ({name, package, displayName, description, isShowcase, category}); each block names the package that owns it, and the envelope's package names the component's owner. |
433
+ | `docs.list` | All reference-doc topics as DocsListEntry[] ({topic, description, package, replaces?}), in read order; meta.namespaces lists the docs tree's top-level namespaces, and meta.notLoaded each package whose docs did not load. |
434
+ | `docs.detail` | One topic's full ReferenceDoc (the JSON read of a topic, --full, --dense, or a topic with one section), with token-ref blocks inlined and each section naming the package that wrote it, plus links ({up, previous, next}: the commands that open the level it sits in and its neighbors there). |
435
+ | `docs.index` | One topic's section index, the text read of a topic with more than one section (and --index): the topic's name, title, and description, plus sections, each {id, title, package, summary} (pass the id as the section argument; package is the npm package that wrote the section; summary is the section's one-line summary), and links ({up, previous, next}: the commands that open the level it sits in and its neighbors there). |
436
+ | `docs.detail.section` | One ReferenceSection of a topic, found by key or title, with token-ref blocks inlined, plus links ({up, previous, next}: the commands that open its topic index and the sections before and after it). The envelope's package names the npm package that wrote the section. |
437
+ | `docs.node` | One node of the docs tree, read by its route: its id, kind, package, title, summary, and breadcrumb, plus a namespace's slots with their children (one level down, each naming its package) or a typed doc's content, and links ({up, previous, next, related}: the commands that open its parent, its neighbors, and the docs it names). |
438
+ | `blog.list` | The feed URL plus every post parsed from the RSS feed, each with slug, title, description, date, type, authors, link, and plaintext URL. |
439
+ | `blog.detail` | One post's metadata plus the feed URL and the post's full plaintext body. |
440
+ | `discover.list` | The integrations the project loads (name, category, components, version, a list per other kind they add, and latest when a source knows it); with a discover source, meta.available lists what the project could add and meta.sources reports each source; when empty it carries meta.configured to tell "nothing configured" from "nothing discovered". |
441
+ | `discover.detail` | One package, for an @scope/name or @scope/name@version query: what the shown version adds, whether the project has it, and, when a source knows the package, its versions, latest release, and the command that adds it. |
442
+ | `discover.detail.doc` | The validated ComponentDoc for one installed component, for an @scope/name/Component query. |
443
+ | `discover.item` | One item that is not an installed component, for an @scope/name/<item> query: its kind, name, package, version, and whether the project has the package. |
444
+ | `discover.search` | The echoed query plus every matching item and package across all packages, each with its kind and whether the project has it, even when only one matches; total is set when --limit cut the list. |
445
+ | `search` | The echoed query, `matchCount` (total matches, before `limit`), and results, a ranked SearchResultEntry[] bounded by `limit`: each {domain, name, package, score, reason, description, command} (package is the npm package that owns the result), plus import (components, hooks), title, parent (the command that opens the level above), and, for a hit on one section, section (docs), or displayName and kind (templates). |
446
+ | `build.help` | The how-to-build-a-page playbook, emitted when no query is given: `playbook: true`, a title, the ordered steps (title, commands, optional returns), the on-system rules, and related lookups. Commands are bare subcommands for the caller to render with its own invocation. |
447
+ | `build.kit` | The template to start from and its kit: query, hasResults, matchCount (never a cap), directMatch, start {name, package, command, basis, reason, alternatives, ...} (the start and each alternative name the package that owns the template), pages (search's closest templates), blocks and domain as SearchResultEntry[] (each naming its package), frame and foundation (Core component names), and hint {reason, commands} when thin. |
448
+ | `swizzle.list` | The names of swizzlable components discoverable from cwd's @astryxdesign/core. The envelope's package is @astryxdesign/core. |
449
+ | `swizzle.copy` | An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and, when the owner has an issues URL, feedback ({issuesUrl, ghCommand?}): where to report the gap that led to swizzling. The envelope's package names the same owning package. |
450
+ | `gap-report.categories` | The fixed gap category values and human-readable labels. |
451
+ | `gap-report.file` | An aggregate receipt: overall status, the selected package, issuesUrl (or null), deliveries in handler order, each {handlerType: project \| integration \| fallback, handler, audience, status, url, message}, and filedCount/routedOnlyCount totals. |
452
+ | `template.list` | The effective discovered TemplateListEntry[] for pages and blocks. A winning replacement entry includes optional `replaces`, naming the Core id omitted from the default list. |
453
+ | `template.show` | The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and demoMediaReplaced (how many Astryx demo media references were replaced with placeholders for you to swap for your own media). |
454
+ | `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description and the components it composes. The envelope's package names the npm package that owns the template. |
455
+ | `template.copy` | A scaffold receipt: template id, output directory, written file name, file count, demoMediaReplaced (how many Astryx demo media references were replaced with placeholders), notes (setup notes naming what the template needs that the project lacks — missing packages, missing StyleX compiler; empty when satisfied), missingPackages (external package names the template imports that are not in the project), and installCommand (a ready-to-run install command with the detected package manager and workspace version ranges; null when nothing is missing, or when several lockfiles leave the package manager undetermined). The envelope's package names the npm package that owns the template. |
456
+ | `template.cdn` | A write receipt for the no-build-step CDN starter page: the path (relative to cwd), the Astryx version every CDN URL was pinned to, whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
457
+ | `hook.list` | The hook catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of hook names, brief entries, or a full HookDoc per entry. The envelope's package is @astryxdesign/core, the only package that ships hooks. |
458
+ | `hook.detail` | One hook's full authored HookDoc. The envelope's package is @astryxdesign/core. |
459
+ | `hook.detail.params` | Just one hook's parameters table (HookParamDoc[]). The envelope's package is @astryxdesign/core. |
460
+ | `theme.build` | A theme build receipt: name, tokenCount and componentCount (override counts), sizeKB, the written outputs {css, cssDts, js, dts, and variantsDts when applicable}, warnings (defects to fix), and notices (advisories about a correct theme, such as a named font it does not load). |
461
+ | `theme.build.check` | The --check receipt: theme name, an upToDate flag, the stale outputs (each {path, reason: missing \| outdated}), and the full list of checked paths. Writes nothing. |
462
+ | `theme.build.batch` | Several themes built in one invocation: `count` plus one {file, receipt} per theme in argument order, where receipt is that theme's theme.build (or theme.build.check) envelope, or null when it produced no CSS. |
463
+ | `theme.list` | Every bundled, installed package, and local theme as a ThemeListEntry[]. Each entry has slug, displayName, description, maintained, owner package or local root, source, added, and default fields. Optional meta.unmigratedCopies names earlier descriptor-less copies, their missing descriptor, and the upgrade command; those copies are not data entries. |
464
+ | `theme.app` | The app theme record after add, remove, or use. It includes every added theme and its built imports, the default slug, generated module path, and the command change. After add, the envelope package names the npm package that owns the added theme; a local theme has none. |
465
+ | `theme.eject` | A local source-fork receipt with the resolved slug, displayName, source theme maintained flag, source-selector package, outputDir, source entry, exportName, and every file written, including the descriptor. The written local descriptor always uses maintained: false. |
466
+ | `theme.template` | A write receipt for the annotated theme template: the path (relative to cwd), whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
467
+ | `theme.targets` | The whole themeable surface: the echoed filter, componentCount, and targets, one per theming target — {key, className, component, props, states}, where props and states are its legal override keys. |
468
+ | `theme.palette.generate` | An author-reviewable OKLCH palette candidate, its reproducibility receipt, summary counts, and optional candidate/receipt file-write result. |
469
+ | `upgrade.list` | Every available codemod, oldest→newest, as {name, package, title, version, optional}; returned for --list without running anything. |
470
+ | `upgrade.registry` | The copied-composition receipt for --registry: applied, ok, the counts (found, current, wouldUpdate, updated, wouldMerge, merged, wouldRefreshReceipt, receiptsRefreshed, conflicts, missing, invalid, failed), and items. |
471
+ | `upgrade.status` | A short-circuit outcome with no codemods run (up_to_date, no_codemods, or config_fixable), each carrying the agent-docs summary. |
472
+ | `upgrade.run` | The run receipt: from/to versions, codemod count, integrations processed, the agent-docs summary, sourcePathFound (false when the resolved source directory does not exist, so no source file was read), and (apply mode) filesChanged, transformsApplied, and per-codemod errors. |
473
+ | `manifest` | The CLI capability manifest: name, version, apiVersion, description, globalOptions, commands (each name, description, arguments, options, json, aliases?, responseTypes?, examples?, exitCodes? as [{code, when}], subcommands?), jsonSupported, and the flat responseTypes index. |
474
+ | `help` | Help, in one of two shapes. A bare `astryx --json` returns the root manifest: name, version, commands (the command names), jsonSupported, and manifest (the full payload `astryx manifest --json` returns). `--help --json` on any command, or `astryx help [command] --json`, returns that command's help: command, description, usage, options (each flags, description, and defaultValue and choices when set), and subcommands (each name and description). data.manifest marks the first shape; data.usage marks the second. |
475
+ | `version` | The CLI version, for `astryx --version --json`: {version}. |
476
+ | `doctor` | The health-check report: `checks` (each with id, label, status: pass \| warn \| fail \| info, a message, and an optional fix, always present on warn and fail) plus a `summary` of counts per status. |
477
+ | `integration.add` | A contribution-writer receipt: kind, name, optional root {path, created}, integration-manifest path, every affected project-relative path, written, and dryRun. |
478
+ | `integration.pack-check` | The packed-package check: name, version, packable, tarball {filename, fileCount, size, unpackedSize} or null, inventory {manifest, roots [{kind, path, expectedFiles, missingFiles, complete}], expectedFiles, packedFiles}, contributions {local, packed}, each null or {themes [{slug, exportName}], components, templates [{id, type, name}], codemods [{version, id}], docs, agentDocsAppend}, and issues [{code, severity, message}]. |
479
+ | `integration.validate` | The validation result: validated (false when nothing was validated: with no package.json the issues list carries one no_package error so the command exits 1, and with a package.json but no integration manifest the issues list is empty and proves nothing), the package name and version (both null when validated is false) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning \| error, message}. |
480
+ | `integration.template-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking Core template-id conflicts as {id, severity: warning, integrationPackage, integrationType, integrationName, coreMatches, message, command}. |
481
+ | `integration.component-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command. |
482
+ | `integration.doc-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` \| `error`) and `relationship` (`replaces` \| `extends` \| `accidental`). |
483
483
 
484
484
  <!-- END GENERATED: response-types -->
485
485
  <!-- Generated by scripts/generate-cli-readme.mjs from the response-types EnumDoc. Run `pnpm -F @astryxdesign/cli readme`. -->
@@ -49,6 +49,25 @@ export function checkConfig(ctx: DoctorContext): Promise<DoctorCheck>;
49
49
  * @returns {DoctorCheck}
50
50
  */
51
51
  export function checkImplicitIntegrations(ctx: DoctorContext): DoctorCheck;
52
+ /**
53
+ * Every integration named in astryx.config loads.
54
+ *
55
+ * A configured integration that cannot be loaded (not installed, no
56
+ * manifest, or a manifest that throws or fails its schema) is withdrawn
57
+ * whole, because none of its contribution roots is trustworthy
58
+ * (spec:AST-035 FR9). The project then runs without something it asked
59
+ * for, so this fails the CI gate.
60
+ *
61
+ * Two neighbours stay as they were. A problem inside one contribution kind
62
+ * leaves the rest of the integration working, so `integration-issues` keeps
63
+ * warning about it (spec:AST-035 FR9). An autolinked dependency that cannot
64
+ * be loaded stays informational in `implicit-integrations`: the project did
65
+ * not ask for it.
66
+ *
67
+ * @param {DoctorContext} ctx
68
+ * @returns {DoctorCheck}
69
+ */
70
+ export function checkConfiguredIntegrations(ctx: DoctorContext): DoctorCheck;
52
71
  /**
53
72
  * Check 7 — agent docs exist and contain the Astryx section markers.
54
73
  * @param {DoctorContext} ctx
@@ -253,13 +272,22 @@ export type DoctorContext = {
253
272
  severity: "warning" | "error";
254
273
  message: string;
255
274
  }[] | null | undefined;
275
+ autolinkFailures?: {
276
+ spec: string;
277
+ error: string;
278
+ }[] | null | undefined;
256
279
  /**
280
+ * Every name astryx.config lists, from the provider ledger: the package it
281
+ * reached (or failed to reach) and why loading failed, if it did. Set aside
282
+ * for a provider conflict, replaced by the package being authored, or
283
+ * repeated under another name all still count as configured.
257
284
  * installed dependencies whose integration manifest could not be loaded
258
285
  * Combined project-level integration issues, including cross-package template replacement warnings.
259
286
  */
260
- autolinkFailures?: {
287
+ configuredIntegrations?: {
261
288
  spec: string;
262
- error: string;
289
+ label: string;
290
+ error: string | null;
263
291
  }[] | null | undefined;
264
292
  /**
265
293
  * - Error thrown while resolving the config
@@ -18,7 +18,8 @@ export const doc = {
18
18
  description:
19
19
  'Runs a series of diagnostics: Node version, ' +
20
20
  '@astryxdesign/core install and version alignment with the CLI, installed ' +
21
- 'themes and wiring, astryx.config validity, integrations linked from ' +
21
+ 'themes and wiring, astryx.config validity, whether every integration ' +
22
+ 'astryx.config names loads (a failed one fails the run), integrations linked from ' +
22
23
  'package.json without a config entry, core peer dependencies, ' +
23
24
  'integration provider identity and contribution issues, agent docs, the ' +
24
25
  'detected package manager, and the health of the docs the CLI reads (authoring ' +
@@ -82,6 +82,11 @@ import {checkAppThemes, checkThemes} from './theme-checks.mjs';
82
82
  * could not be built, when it could not.
83
83
  * @property {Array<{package: string, code: string, severity: 'warning'|'error', message: string}>|null} [integrationIssues]
84
84
  * @property {Array<{spec: string, error: string}>|null} [autolinkFailures]
85
+ * @property {Array<{spec: string, label: string, error: string|null}>|null} [configuredIntegrations]
86
+ * Every name astryx.config lists, from the provider ledger: the package it
87
+ * reached (or failed to reach) and why loading failed, if it did. Set aside
88
+ * for a provider conflict, replaced by the package being authored, or
89
+ * repeated under another name all still count as configured.
85
90
  * installed dependencies whose integration manifest could not be loaded
86
91
  * Combined project-level integration issues, including cross-package template replacement warnings.
87
92
  * @property {Error|null} [configError] - Error thrown while resolving the config
@@ -319,12 +324,12 @@ export async function checkConfig(ctx) {
319
324
  }
320
325
  // Importing is not the whole test: the CLI also validates the config, and
321
326
  // a config it rejects leaves every project-aware command without the
322
- // project. That config is not clean, so this warns (exit code unchanged).
327
+ // project. Doctor is the CI gate, so that fails.
323
328
  if (ctx.projectError) {
324
329
  return {
325
330
  id: 'config',
326
331
  label: 'astryx.config.mjs',
327
- status: 'warn',
332
+ status: 'fail',
328
333
  message: `astryx.config.mjs loads, but the CLI could not load the project from it: ${firstLine(ctx.projectError)}`,
329
334
  fix: 'Fix what the message names. `astryx docs authoring config` lists every field astryx.config accepts.',
330
335
  };
@@ -475,6 +480,88 @@ function describeUnreadableManifests(failures) {
475
480
  );
476
481
  }
477
482
 
483
+ /**
484
+ * Every integration named in astryx.config loads.
485
+ *
486
+ * A configured integration that cannot be loaded (not installed, no
487
+ * manifest, or a manifest that throws or fails its schema) is withdrawn
488
+ * whole, because none of its contribution roots is trustworthy
489
+ * (spec:AST-035 FR9). The project then runs without something it asked
490
+ * for, so this fails the CI gate.
491
+ *
492
+ * Two neighbours stay as they were. A problem inside one contribution kind
493
+ * leaves the rest of the integration working, so `integration-issues` keeps
494
+ * warning about it (spec:AST-035 FR9). An autolinked dependency that cannot
495
+ * be loaded stays informational in `implicit-integrations`: the project did
496
+ * not ask for it.
497
+ *
498
+ * @param {DoctorContext} ctx
499
+ * @returns {DoctorCheck}
500
+ */
501
+ export function checkConfiguredIntegrations(ctx) {
502
+ const id = 'configured-integrations';
503
+ const label = 'Configured integrations';
504
+ if (ctx.integrations == null) {
505
+ // The config check reports a config the CLI cannot load.
506
+ return {
507
+ id,
508
+ label,
509
+ status: 'info',
510
+ message: skippedBecause(ctx, 'the project configuration could not be read'),
511
+ };
512
+ }
513
+ // What counts as configured is what astryx.config names, read from the
514
+ // provider ledger so a package set aside for a provider conflict, or the
515
+ // package being authored when its own config names it, still counts.
516
+ const configured =
517
+ ctx.configuredIntegrations ??
518
+ ctx.integrations
519
+ .filter(integration => !integration.__autolinked && !integration.__local)
520
+ .map(integration => ({
521
+ spec: integration.__spec,
522
+ label: integration.name ?? integration.__spec,
523
+ error:
524
+ integration.__loadError == null
525
+ ? null
526
+ : String(integration.__loadError),
527
+ }));
528
+ if (configured.length === 0) {
529
+ return {
530
+ id,
531
+ label,
532
+ status: 'info',
533
+ message: 'No integration is named in astryx.config.',
534
+ };
535
+ }
536
+ const plural = configured.length === 1 ? '' : 's';
537
+ const withdrawn = configured.filter(entry => entry.error != null);
538
+ if (withdrawn.length > 0) {
539
+ const listed = withdrawn
540
+ .map(
541
+ entry =>
542
+ `${entry.label} (${firstLine(String(entry.error)).slice(0, 160)})`,
543
+ )
544
+ .join('; ');
545
+ return {
546
+ id,
547
+ label,
548
+ status: 'fail',
549
+ message:
550
+ `${withdrawn.length} of ${configured.length} integration${plural} named in astryx.config could not be loaded, ` +
551
+ `so ${withdrawn.length === 1 ? 'it contributes' : 'they contribute'} nothing: ${listed}.`,
552
+ fix:
553
+ 'Install each one, fix its astryx.integration.* manifest (`astryx doctor integration validate <package>` says what is wrong), ' +
554
+ 'or remove it from `integrations` in astryx.config.',
555
+ };
556
+ }
557
+ return {
558
+ id,
559
+ label,
560
+ status: 'pass',
561
+ message: `${configured.length} integration${plural} named in astryx.config loaded: ${configured.map(entry => entry.label).join(', ')}.`,
562
+ };
563
+ }
564
+
478
565
  /**
479
566
  * Check 7 — agent docs exist and contain the Astryx section markers.
480
567
  * @param {DoctorContext} ctx
@@ -1201,6 +1288,7 @@ export const SYNC_CHECKS = [
1201
1288
  checkCoreInstalled,
1202
1289
  checkVersionAlignment,
1203
1290
  checkImplicitIntegrations,
1291
+ checkConfiguredIntegrations,
1204
1292
  checkProviderIdentity,
1205
1293
  checkIntegrationIssues,
1206
1294
  checkAgentDocs,
@@ -1244,6 +1332,8 @@ export async function runChecks(options = {}) {
1244
1332
  let integrationIssues = null;
1245
1333
  /** @type {Array<{spec: string, error: string}>|null} */
1246
1334
  let autolinkFailures = null;
1335
+ /** @type {Array<{spec: string, label: string, error: string|null}>|null} */
1336
+ let configuredIntegrations = null;
1247
1337
  /** @type {string|null} */
1248
1338
  let projectError = null;
1249
1339
  /** @type {import('../../foundation/config/project.mjs').Project | null} */
@@ -1261,7 +1351,66 @@ export async function runChecks(options = {}) {
1261
1351
  integrations = project.loadedIntegrations;
1262
1352
  // An installed dependency whose manifest cannot be loaded is kept out of
1263
1353
  // loadedIntegrations on purpose. The provider ledger still records it.
1264
- autolinkFailures = [...providerLedgerOf(project).values()]
1354
+ const ledgerMap = providerLedgerOf(project);
1355
+ const ledger = [...ledgerMap.values()];
1356
+ // The package that stands for a configured name: when the package
1357
+ // being authored replaces the configured copy, the authored package's
1358
+ // outcome is the one that matters, so a broken authored manifest fails
1359
+ // the check even though the configured copy itself loaded. A package
1360
+ // set aside for a provider conflict keeps its own outcome.
1361
+ /** @param {import('../../foundation/integrations/provider-resolution.mjs').ProviderLedgerEntry} entry */
1362
+ const standsFor = entry => {
1363
+ let current = entry;
1364
+ const seen = new Set();
1365
+ while (
1366
+ current.outcome === 'set-aside' &&
1367
+ current.reason === 'replaced-by-authored' &&
1368
+ current.winner != null &&
1369
+ !seen.has(current.winner) &&
1370
+ ledgerMap.has(current.winner)
1371
+ ) {
1372
+ seen.add(current.winner);
1373
+ current = /** @type {typeof entry} */ (ledgerMap.get(current.winner));
1374
+ }
1375
+ return current;
1376
+ };
1377
+ // Every package a configured name reached, however it was resolved.
1378
+ configuredIntegrations = ledger
1379
+ .filter(entry =>
1380
+ entry.refs.some(
1381
+ ref => ref.source === 'configured' && ref.repeat !== true,
1382
+ ),
1383
+ )
1384
+ .map(entry => {
1385
+ const ref = entry.refs.find(
1386
+ candidate => candidate.source === 'configured',
1387
+ );
1388
+ const effective = standsFor(entry);
1389
+ // When node_modules/<name> links back to the package being authored,
1390
+ // the configured and local candidates share one real path and one
1391
+ // entry whose outcome is the set-aside; the authored (`local`)
1392
+ // candidate on that entry carries the load error, so it is the
1393
+ // outcome that counts. Reading it from the ref, not by comparing
1394
+ // paths, holds whether or not the working directory is itself a
1395
+ // symlink.
1396
+ const authored = effective.refs.find(
1397
+ candidate => candidate.source === 'local',
1398
+ );
1399
+ const authoredError =
1400
+ authored?.integration?.__loadError ?? authored?.error ?? null;
1401
+ const loadError =
1402
+ effective.outcome === 'load-failed'
1403
+ ? (effective.error ?? 'its manifest could not be loaded')
1404
+ : authoredError != null
1405
+ ? String(authoredError)
1406
+ : null;
1407
+ return {
1408
+ spec: ref?.spec ?? entry.label,
1409
+ label: entry.integration?.name ?? ref?.spec ?? entry.label,
1410
+ error: loadError,
1411
+ };
1412
+ });
1413
+ autolinkFailures = ledger
1265
1414
  .filter(
1266
1415
  entry =>
1267
1416
  entry.outcome === 'load-failed' &&
@@ -1300,6 +1449,7 @@ export async function runChecks(options = {}) {
1300
1449
  docsCatalogError,
1301
1450
  integrationIssues,
1302
1451
  autolinkFailures,
1452
+ configuredIntegrations,
1303
1453
  configError,
1304
1454
  projectError,
1305
1455
  };