@astryxdesign/cli 0.7.17-canary.g5a3fd39 → 0.7.17-canary.g5cf5d69
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.
- package/README.md +64 -63
- package/api/build/_adapter.d.mts +51 -0
- package/api/build/_adapter.mjs +122 -6
- package/api/build/build.doc.mjs +1 -1
- package/api/build/build.mjs +23 -14
- package/api/build/build.type.d.mts +1 -1
- package/api/build/build.type.mjs +3 -3
- package/api/build/help/help.d.mts +15 -14
- package/api/build/help/help.mjs +62 -3
- package/api/build/kit/answer.mjs +2 -3
- package/api/build/kit/signals.d.mts +10 -0
- package/api/build/kit/signals.mjs +15 -2
- package/api/component/detail/blocks/blocks.mjs +2 -1
- package/api/discover/_adapter.d.mts +57 -6
- package/api/discover/_adapter.mjs +278 -49
- package/api/discover/_catalog-view.d.mts +7 -0
- package/api/discover/_catalog-view.mjs +10 -1
- package/api/discover/detail/detail.d.mts +3 -2
- package/api/discover/detail/detail.mjs +3 -2
- package/api/discover/detail/doc/doc.mjs +1 -1
- package/api/discover/discover.d.mts +24 -0
- package/api/discover/discover.doc.mjs +1 -1
- package/api/discover/discover.mjs +146 -25
- package/api/discover/discover.type.d.mts +6 -4
- package/api/discover/discover.type.mjs +6 -4
- package/api/discover/search/search.d.mts +22 -0
- package/api/discover/search/search.mjs +290 -70
- package/api/docs/_entry-names.mjs +4 -3
- package/api/doctor/_adapter.d.mts +43 -3
- package/api/doctor/_adapter.mjs +142 -18
- package/api/doctor/built-checks.d.mts +30 -3
- package/api/doctor/built-checks.mjs +132 -5
- package/api/doctor/doctor.d.mts +93 -6
- package/api/doctor/doctor.doc.mjs +2 -2
- package/api/doctor/doctor.mjs +524 -33
- package/api/doctor/doctor.type.d.mts +2 -1
- package/api/doctor/doctor.type.mjs +2 -1
- package/api/doctor/theme-checks.d.mts +19 -0
- package/api/doctor/theme-checks.mjs +74 -6
- package/api/hook/hook.type.d.mts +1 -1
- package/api/hook/hook.type.mjs +1 -1
- package/api/hook/list/list.mjs +11 -7
- package/api/icon/_adapter.d.mts +2 -1
- package/api/icon/_adapter.mjs +10 -15
- package/api/icon/_records.d.mts +3 -1
- package/api/icon/_records.mjs +30 -3
- package/api/icon/exportIconIndex.doc.mjs +1 -1
- package/api/icon/icon.doc.mjs +3 -3
- package/api/icon/icon.type.d.mts +32 -1
- package/api/icon/icon.type.mjs +19 -3
- package/api/icon/list/list.mjs +4 -1
- package/api/icon/rankIconIndex.doc.mjs +1 -1
- package/api/icon/search/icon-index.mjs +18 -8
- package/api/icon/search/search.d.mts +26 -3
- package/api/icon/search/search.mjs +155 -9
- package/api/init/_adapter.d.mts +14 -0
- package/api/init/_adapter.mjs +26 -4
- package/api/init/init.d.mts +1 -1
- package/api/init/init.doc.mjs +2 -2
- package/api/init/init.mjs +1 -1
- package/api/init/init.type.d.mts +29 -1
- package/api/init/init.type.mjs +14 -1
- package/api/init/run/run.d.mts +11 -1
- package/api/init/run/run.mjs +84 -5
- package/api/integration/_adapter.d.mts +5 -4
- package/api/integration/_adapter.mjs +7 -5
- package/api/integration/integrationCheck.doc.mjs +1 -1
- package/api/integration/pack-check.mjs +8 -9
- package/api/integration/validate-integration.d.mts +1 -1
- package/api/integration/validate-integration.mjs +26 -24
- package/api/integration/validate-integration.type.d.mts +5 -2
- package/api/integration/validate-integration.type.mjs +5 -2
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/render/_adapter.d.mts +4 -2
- package/api/render/_adapter.mjs +62 -21
- package/api/render/render.doc.mjs +8 -5
- package/api/render/render.mjs +1 -1
- package/api/render/render.type.d.mts +2 -0
- package/api/render/render.type.mjs +2 -0
- package/api/search/ORDERING.md +2 -2
- package/api/search/_candidate-score.d.mts +3 -0
- package/api/search/_candidate-score.mjs +36 -3
- package/api/search/_gather-docs.mjs +29 -2
- package/api/search/_gather-templates.mjs +2 -1
- package/api/search/_main-searcher.mjs +13 -0
- package/api/search/_named-keywords.d.mts +2 -1
- package/api/search/_named-keywords.mjs +48 -6
- package/api/search/_order.d.mts +36 -1
- package/api/search/_order.mjs +141 -3
- package/api/swizzle/list/list.mjs +8 -1
- package/api/swizzle/swizzle.type.d.mts +1 -1
- package/api/swizzle/swizzle.type.mjs +1 -1
- package/api/template/copy/copy.mjs +3 -4
- package/api/template/list/list.mjs +2 -1
- package/api/template/show/show.mjs +2 -1
- package/api/template/skeleton/skeleton.mjs +2 -1
- package/api/template/template.doc.mjs +1 -1
- package/api/template/template.mjs +19 -1
- package/api/template/template.type.d.mts +1 -0
- package/api/template/template.type.mjs +2 -1
- package/api/theme/_adapter.d.mts +1 -0
- package/api/theme/_adapter.mjs +3 -5
- package/api/theme/_app-provider.d.mts +42 -0
- package/api/theme/_app-provider.mjs +61 -27
- package/api/theme/build/build.d.mts +4 -10
- package/api/theme/build/build.mjs +165 -116
- package/api/theme/build/input-fields.d.mts +9 -0
- package/api/theme/build/input-fields.mjs +155 -16
- package/api/theme/build/radius-values.d.mts +18 -0
- package/api/theme/build/radius-values.mjs +76 -0
- package/api/theme/build/typography-values.mjs +7 -23
- package/api/theme/build/written-values.d.mts +18 -0
- package/api/theme/build/written-values.mjs +107 -31
- package/api/theme/eject/eject.mjs +6 -1
- package/api/theme/palette/generate/generator.mjs +24 -0
- package/api/theme/theme.type.d.mts +4 -2
- package/api/theme/theme.type.mjs +3 -2
- package/api/theme/themeBuild.doc.mjs +2 -2
- package/api/theme/themeEject.doc.mjs +1 -1
- package/api/theme-edit/_catalog.d.mts +40 -0
- package/api/theme-edit/_catalog.mjs +100 -22
- package/api/theme-edit/_check.mjs +213 -43
- package/api/theme-edit/_color.d.mts +14 -0
- package/api/theme-edit/_color.mjs +22 -0
- package/api/theme-edit/_compiler.mjs +52 -0
- package/api/theme-edit/_context.d.mts +20 -2
- package/api/theme-edit/_context.mjs +157 -29
- package/api/theme-edit/_edit.mjs +426 -58
- package/api/theme-edit/_how-question.d.mts +14 -0
- package/api/theme-edit/_how-question.mjs +1541 -127
- package/api/theme-edit/_how.mjs +43 -0
- package/api/theme-edit/_missed.mjs +107 -27
- package/api/theme-edit/_normal.d.mts +18 -4
- package/api/theme-edit/_normal.mjs +84 -3
- package/api/theme-edit/_palette.d.mts +9 -0
- package/api/theme-edit/_palette.mjs +158 -33
- package/api/theme-edit/_part-words.mjs +16 -3
- package/api/theme-edit/_parts.d.mts +8 -0
- package/api/theme-edit/_parts.mjs +120 -36
- package/api/theme-edit/_png.d.mts +24 -0
- package/api/theme-edit/_png.mjs +99 -0
- package/api/theme-edit/_preview-app.d.mts +16 -0
- package/api/theme-edit/_preview-app.mjs +52 -18
- package/api/theme-edit/_preview.d.mts +44 -26
- package/api/theme-edit/_preview.mjs +255 -67
- package/api/theme-edit/_project.d.mts +12 -1
- package/api/theme-edit/_project.mjs +16 -1
- package/api/theme-edit/_settings.d.mts +116 -0
- package/api/theme-edit/_settings.mjs +1197 -58
- package/api/theme-edit/_tables.d.mts +16 -0
- package/api/theme-edit/_tables.mjs +34 -4
- package/api/theme-edit/theme-edit.type.d.mts +15 -2
- package/api/theme-edit/theme-edit.type.mjs +8 -6
- package/api/upgrade/_adapter.d.mts +46 -7
- package/api/upgrade/_adapter.mjs +110 -15
- package/api/upgrade/registry/registry.d.mts +6 -3
- package/api/upgrade/registry/registry.mjs +21 -6
- package/api/upgrade/run/run.mjs +23 -11
- package/api/upgrade/upgrade.doc.mjs +4 -3
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/tree/agent-guidance.doc.mjs +3 -2
- package/assets/docs/tree/checks.doc.mjs +2 -2
- package/assets/docs/tree/host-entry.doc.mjs +4 -0
- package/assets/docs/tree/icon-definitions.doc.mjs +3 -3
- package/assets/docs/tree/icon-sets.doc.mjs +6 -6
- package/assets/docs/tree/problems.doc.mjs +3 -3
- package/assets/docs/tree/render-pages.doc.mjs +17 -3
- package/assets/docs/tree/share-a-page.doc.mjs +5 -5
- package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
- package/assets/docs/tree/troubleshooting.doc.mjs +8 -0
- package/assets/docs/tree/updates.doc.mjs +1 -1
- package/assets/docs/tree/versioning.doc.mjs +1 -1
- package/assets/docs/working-with-ai.doc.mjs +40 -5
- package/assets/docs-routes.generated.json +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/icons/installed-icon-set.doc.mjs +30 -0
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarInteractive.tsx +6 -1
- package/assets/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +1 -1
- package/assets/templates/blocks/components/LinkProvider/LinkProviderCustomLink.tsx +3 -1
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +6 -2
- package/assets/templates/pages/ai-chat-landing/page.tsx +1 -1
- package/assets/templates/pages/blank/page.tsx +4 -2
- package/assets/templates/pages/canvas-editor/page.tsx +3 -1
- package/assets/templates/pages/centered-hero/page.tsx +1 -1
- package/assets/templates/pages/checkout-wizard/page.tsx +1 -1
- package/assets/templates/pages/classic-gallery/page.tsx +1 -1
- package/assets/templates/pages/contact-form/page.tsx +2 -2
- package/assets/templates/pages/course-detail/page.tsx +1 -1
- package/assets/templates/pages/dashboard/page.tsx +24 -8
- package/assets/templates/pages/dashboard-alert-rail/page.tsx +4 -2
- package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +7 -3
- package/assets/templates/pages/dashboard-comparison/page.tsx +5 -2
- package/assets/templates/pages/dashboard-composition/page.tsx +10 -4
- package/assets/templates/pages/dashboard-progress/page.tsx +6 -3
- package/assets/templates/pages/dashboard-scorecard/page.tsx +17 -8
- package/assets/templates/pages/detail-page/page.tsx +22 -5
- package/assets/templates/pages/documentation/page.tsx +4 -2
- package/assets/templates/pages/documentation-design/page.tsx +5 -2
- package/assets/templates/pages/documentation-technical/page.tsx +4 -2
- package/assets/templates/pages/editor/page.tsx +28 -9
- package/assets/templates/pages/file-explorer/page.tsx +3 -1
- package/assets/templates/pages/form-two-column/page.tsx +1 -1
- package/assets/templates/pages/form-wizard/page.tsx +1 -1
- package/assets/templates/pages/form-wizard-dialog/page.tsx +3 -1
- package/assets/templates/pages/form-wizard-inline/page.tsx +1 -1
- package/assets/templates/pages/form-wizard-vertical/page.tsx +1 -1
- package/assets/templates/pages/gallery-hero/page.tsx +1 -1
- package/assets/templates/pages/ide/page.tsx +7 -2
- package/assets/templates/pages/kanban-board/page.tsx +10 -4
- package/assets/templates/pages/library/page.tsx +31 -61
- package/assets/templates/pages/login/page.tsx +4 -2
- package/assets/templates/pages/login-card/page.tsx +4 -2
- package/assets/templates/pages/login-split/page.tsx +3 -2
- package/assets/templates/pages/login-sso/page.tsx +4 -4
- package/assets/templates/pages/mixed-gallery/page.tsx +1 -1
- package/assets/templates/pages/payment-form/page.tsx +1 -1
- package/assets/templates/pages/product-detail/page.tsx +16 -4
- package/assets/templates/pages/product-gallery/page.tsx +1 -1
- package/assets/templates/pages/settings/page.tsx +10 -4
- package/assets/templates/pages/settings-dialog/page.tsx +5 -6
- package/assets/templates/pages/settings-sidebar/page.tsx +39 -13
- package/assets/templates/pages/side-gallery/page.tsx +1 -1
- package/assets/templates/pages/table/page.tsx +2 -2
- package/assets/templates/pages/table-filter/page.tsx +21 -6
- package/assets/templates/pages/table-grouped/page.tsx +23 -2
- package/assets/templates/pages/table-inbox/page.tsx +82 -32
- package/assets/templates/pages/theme-showcase/page.tsx +3 -2
- package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +12 -12
- package/assets/templates/themes/butter/butterTheme.ts +197 -4
- package/assets/templates/themes/chocolate/chocolateTheme.ts +72 -8
- package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +3 -3
- package/assets/templates/themes/gothic/gothicTheme.ts +114 -4
- package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +8 -8
- package/assets/templates/themes/matcha/matchaTheme.ts +48 -12
- package/assets/templates/themes/neutral/neutralTheme.ts +29 -0
- package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +2 -2
- package/assets/templates/themes/stone/stoneTheme.ts +69 -0
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +9 -9
- package/assets/templates/themes/y2k/y2kTheme.ts +249 -14
- package/authoring/codemod/parse.d.mts +0 -36
- package/authoring/codemod/parse.mjs +62 -41
- package/authoring/config/config.doc.mjs +1 -1
- package/authoring/config/parse.d.mts +0 -47
- package/authoring/config/parse.mjs +128 -103
- package/authoring/config/type.ts +4 -3
- package/authoring/debug/parse.d.mts +2 -2
- package/authoring/discover/parse.d.mts +2 -2
- package/authoring/discover/parse.mjs +52 -38
- package/authoring/discover/type.ts +2 -1
- package/authoring/doctypes/_schema.d.mts +834 -950
- package/authoring/doctypes/_schema.mjs +863 -825
- package/authoring/doctypes/command/parse.mjs +2 -2
- package/authoring/doctypes/component/parse.mjs +2 -2
- package/authoring/doctypes/enum/parse.mjs +2 -2
- package/authoring/doctypes/hook/parse.mjs +2 -2
- package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +1 -1
- package/authoring/doctypes/icon-definition/parse.d.mts +0 -24
- package/authoring/doctypes/icon-definition/parse.mjs +59 -43
- package/authoring/doctypes/icon-set/parse.d.mts +0 -75
- package/authoring/doctypes/icon-set/parse.mjs +239 -210
- package/authoring/doctypes/legacy.mjs +3 -3
- package/authoring/doctypes/namespace/parse.mjs +2 -2
- package/authoring/doctypes/reference/parse.mjs +2 -2
- package/authoring/doctypes/schema/parse.mjs +2 -2
- package/authoring/doctypes/template/parse.d.mts +0 -101
- package/authoring/doctypes/template/parse.mjs +131 -106
- package/authoring/doctypes/theme/parse.d.mts +0 -23
- package/authoring/doctypes/theme/parse.mjs +52 -36
- package/authoring/gap-report/parse.d.mts +1 -1
- package/authoring/integration/integration.doc.mjs +8 -0
- package/authoring/integration/schema.d.mts +14 -3
- package/authoring/integration/schema.mjs +20 -2
- package/authoring/integration/type.ts +14 -0
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/build.mjs +27 -13
- package/clients/cli/commands/component.mjs +14 -3
- package/clients/cli/commands/discover.doc.mjs +2 -2
- package/clients/cli/commands/discover.mjs +20 -3
- package/clients/cli/commands/docs.doc.mjs +11 -9
- package/clients/cli/commands/docs.mjs +50 -21
- package/clients/cli/commands/experimental/icon.mjs +330 -227
- package/clients/cli/commands/experimental/render.mjs +16 -1
- package/clients/cli/commands/experimental/theme.mjs +42 -17
- package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon-map.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-use.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
- package/clients/cli/commands/experimental-render.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
- package/clients/cli/commands/init.doc.mjs +36 -24
- package/clients/cli/commands/integration-check.doc.mjs +1 -1
- package/clients/cli/commands/mcp.doc.mjs +53 -0
- package/clients/cli/commands/mcp.mjs +51 -0
- package/clients/cli/commands/search.mjs +46 -9
- package/clients/cli/commands/template.mjs +3 -2
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +12 -2
- package/clients/cli/commands/upgrade.doc.mjs +3 -2
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/formatters/index.mjs +52 -6
- package/clients/cli/index.mjs +23 -17
- package/clients/cli/lib/base-gate.mjs +37 -5
- package/clients/cli/lib/define-command.mjs +82 -4
- package/clients/cli/lib/json-shim.mjs +61 -4
- package/clients/cli/lib/manifest.mjs +9 -1
- package/clients/cli/lib/mcp-server.mjs +286 -0
- package/clients/cli/lib/mcp-tools.mjs +405 -0
- package/clients/cli/lib/other-cli-words.mjs +99 -0
- package/clients/cli/lib/stray-option.mjs +27 -1
- package/clients/cli/lib/unknown-command.mjs +326 -11
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +1 -1
- package/foundation/agent-docs/agent-docs.d.mts +49 -1
- package/foundation/agent-docs/agent-docs.mjs +108 -7
- package/foundation/agent-docs/computer-agent-text.mjs +1 -1
- package/foundation/bases/core.d.mts +1 -1
- package/foundation/bases/core.mjs +3 -3
- package/foundation/bases/resolve.d.mts +4 -8
- package/foundation/bases/resolve.mjs +15 -21
- package/foundation/bases/state.d.mts +15 -9
- package/foundation/bases/state.mjs +33 -6
- package/foundation/config/project.d.mts +5 -4
- package/foundation/config/project.mjs +33 -17
- package/foundation/discovery/component-discovery.mjs +15 -28
- package/foundation/discovery/icon-imports.d.mts +66 -0
- package/foundation/discovery/icon-imports.mjs +225 -0
- package/foundation/discovery/icon-ranking.d.mts +12 -2
- package/foundation/discovery/icon-ranking.mjs +197 -10
- package/foundation/discovery/icon-set-checks.mjs +2 -1
- package/foundation/discovery/icon-set-discovery.d.mts +28 -0
- package/foundation/discovery/icon-set-discovery.mjs +42 -0
- package/foundation/discovery/icon-set-writer.d.mts +2 -11
- package/foundation/discovery/icon-set-writer.mjs +3 -29
- package/foundation/discovery/module-exports.d.mts +1 -1
- package/foundation/discovery/module-exports.mjs +136 -33
- package/foundation/discovery/name-roots.d.mts +5 -0
- package/foundation/discovery/name-roots.mjs +11 -0
- package/foundation/discovery/runner-allowlist.d.mts +1 -0
- package/foundation/discovery/runner-allowlist.mjs +2 -0
- package/foundation/discovery/runner-commands.mjs +1 -0
- package/foundation/discovery/template-adapter.d.mts +1 -1
- package/foundation/discovery/template-destination.d.mts +14 -6
- package/foundation/discovery/template-destination.mjs +42 -8
- package/foundation/discovery/template-icons.d.mts +45 -2
- package/foundation/discovery/template-icons.mjs +26 -54
- package/foundation/discovery/template-needs.d.mts +28 -2
- package/foundation/discovery/template-needs.mjs +92 -11
- package/foundation/discovery/theme-discovery.d.mts +8 -0
- package/foundation/discovery/theme-discovery.mjs +23 -6
- package/foundation/discovery/theme-imports.mjs +2 -4
- package/foundation/doc-compiler/parse-readable.mjs +4 -3
- package/foundation/doc-compiler/stored-docs.d.mts +13 -0
- package/foundation/doc-compiler/stored-docs.mjs +74 -3
- package/foundation/env/cli-command.d.mts +68 -10
- package/foundation/env/cli-command.mjs +116 -22
- package/foundation/env/project-scope.d.mts +9 -0
- package/foundation/env/project-scope.mjs +28 -2
- package/foundation/fs/gather-cache.d.mts +23 -0
- package/foundation/fs/gather-cache.mjs +94 -2
- package/foundation/fs/module-loader.d.mts +3 -1
- package/foundation/fs/module-loader.mjs +85 -5
- package/foundation/fs/read-record.mjs +9 -5
- package/foundation/identity/package-names.d.mts +18 -0
- package/foundation/identity/package-names.mjs +19 -0
- package/foundation/identity/providers.mjs +3 -2
- package/foundation/integrations/icon-features.d.mts +63 -0
- package/foundation/integrations/icon-features.mjs +54 -0
- package/foundation/integrations/integrations.d.mts +13 -1
- package/foundation/integrations/integrations.mjs +47 -6
- package/foundation/integrations/pack-state.d.mts +21 -0
- package/foundation/integrations/pack-state.mjs +42 -19
- package/foundation/integrations/validate-contributions.d.mts +11 -3
- package/foundation/integrations/validate-contributions.mjs +51 -13
- package/foundation/release/cache.d.mts +13 -1
- package/foundation/release/cache.mjs +94 -14
- package/foundation/release/notices.d.mts +15 -0
- package/foundation/release/notices.mjs +111 -7
- package/foundation/release/project.d.mts +3 -4
- package/foundation/release/project.mjs +5 -6
- package/foundation/render/client-bundle.d.mts +126 -0
- package/foundation/render/client-bundle.mjs +565 -0
- package/foundation/render/cut-short.d.mts +7 -1
- package/foundation/render/cut-short.mjs +46 -6
- package/foundation/render/embedded-imports.d.mts +4 -3
- package/foundation/render/embedded-imports.mjs +13 -8
- package/foundation/render/esbuild-dependency.d.mts +14 -0
- package/foundation/render/esbuild-dependency.mjs +41 -0
- package/foundation/render/file-header.mjs +5 -4
- package/foundation/render/page-worker.mjs +562 -86
- package/foundation/render/picture-chrome.mjs +54 -29
- package/foundation/render/picture-playwright.mjs +78 -42
- package/foundation/render/picture-window.d.mts +33 -0
- package/foundation/render/picture-window.mjs +78 -0
- package/foundation/render/render-page.d.mts +55 -4
- package/foundation/render/render-page.mjs +199 -28
- package/foundation/render/restore-folder.d.mts +13 -0
- package/foundation/render/restore-folder.mjs +30 -0
- package/foundation/render/served-packages.d.mts +2 -1
- package/foundation/render/served-packages.mjs +5 -3
- package/foundation/render/ts-paths.d.mts +11 -0
- package/foundation/render/ts-paths.mjs +27 -2
- package/foundation/render/value-uses.d.mts +43 -0
- package/foundation/render/value-uses.mjs +110 -0
- package/foundation/response/error-codes.d.mts +2 -1
- package/foundation/response/error-codes.doc.mjs +7 -1
- package/foundation/response/error-codes.mjs +10 -2
- package/foundation/response/response-types.doc.mjs +12 -12
- package/foundation/runtime/package-root.d.mts +8 -0
- package/foundation/runtime/package-root.mjs +20 -0
- package/foundation/suggest/other-command.d.mts +11 -0
- package/foundation/suggest/other-command.mjs +1 -1
- package/foundation/text/icon-id.d.mts +20 -0
- package/foundation/text/icon-id.mjs +40 -0
- package/foundation/text/icon-set-next.d.mts +25 -0
- package/foundation/text/icon-set-next.mjs +29 -0
- package/foundation/xle/browser.d.mts +2 -2
- package/package.json +7 -6
package/clients/cli/run.mjs
CHANGED
|
@@ -89,7 +89,7 @@ export async function runCli({cliRoot, argv, declinedProjectCli}) {
|
|
|
89
89
|
handleVersionJsonPreflight,
|
|
90
90
|
} = await import('./index.mjs');
|
|
91
91
|
// The base every project load reads, the one in createProgram included.
|
|
92
|
-
const {setRequestedBase} = await import('../../foundation/bases/
|
|
92
|
+
const {setRequestedBase} = await import('../../foundation/bases/state.mjs');
|
|
93
93
|
const {scanRootArgs} = await import('./lib/root-args.mjs');
|
|
94
94
|
const base = scanRootArgs(
|
|
95
95
|
process.argv.slice(2),
|
|
@@ -30,6 +30,9 @@ export function parseBlockVersion(content: string): string | null;
|
|
|
30
30
|
* @param {string} [installedVersion] Defaults to the installed core version.
|
|
31
31
|
* @param {string} [expectedBlock] Fully rendered block for this project. When
|
|
32
32
|
* present, byte differences are stale even if the Core version is unchanged.
|
|
33
|
+
* @param {{paths?: string[]}} [options] `paths`: the files to read, relative to
|
|
34
|
+
* `targetDir`, in place of the agent docs found there; a named file without
|
|
35
|
+
* the block makes the status `stale` (or `missing` when none has one).
|
|
33
36
|
* @returns {{
|
|
34
37
|
* installedVersion: string,
|
|
35
38
|
* status: 'missing' | 'stale' | 'current',
|
|
@@ -38,7 +41,9 @@ export function parseBlockVersion(content: string): string | null;
|
|
|
38
41
|
* blockVersions: string[],
|
|
39
42
|
* }}
|
|
40
43
|
*/
|
|
41
|
-
export function inspectAgentDocs(targetDir: string, installedVersion?: string, expectedBlock?: string
|
|
44
|
+
export function inspectAgentDocs(targetDir: string, installedVersion?: string, expectedBlock?: string, { paths }?: {
|
|
45
|
+
paths?: string[];
|
|
46
|
+
}): {
|
|
42
47
|
installedVersion: string;
|
|
43
48
|
status: "missing" | "stale" | "current";
|
|
44
49
|
files: Array<{
|
|
@@ -141,6 +146,13 @@ export function renderAgentDocsBlock(targetDir: string, { installedVersion, fres
|
|
|
141
146
|
installedVersion?: string;
|
|
142
147
|
fresh?: boolean;
|
|
143
148
|
}): Promise<string>;
|
|
149
|
+
/**
|
|
150
|
+
* The version an agent-docs block names when no caller gives one, as `init`
|
|
151
|
+
* writes it: the Core the folder reads, else this CLI's own.
|
|
152
|
+
* @param {string} targetDir
|
|
153
|
+
* @returns {string}
|
|
154
|
+
*/
|
|
155
|
+
export function agentDocsVersion(targetDir: string): string;
|
|
144
156
|
/**
|
|
145
157
|
* Get Astryx version from core package.
|
|
146
158
|
* @param {string|null} coreDir
|
|
@@ -229,6 +241,36 @@ export function removeAgentDocs(targetDir: string, { shownFrom, skip }?: {
|
|
|
229
241
|
export function removeProjectAgentDocs(cwd: string, { onSkipped }?: {
|
|
230
242
|
onSkipped?: (rel: string, reason: string) => void;
|
|
231
243
|
}): string[];
|
|
244
|
+
/**
|
|
245
|
+
* Each agent-doc file's text, or null when it does not exist. Init reads the
|
|
246
|
+
* files before and after it writes, so its receipt can say what changed.
|
|
247
|
+
* @param {string} dir
|
|
248
|
+
* @param {string[]} rels paths relative to `dir`
|
|
249
|
+
* @returns {Map<string, string | null>}
|
|
250
|
+
*/
|
|
251
|
+
export function readAgentDocTexts(dir: string, rels: string[]): Map<string, string | null>;
|
|
252
|
+
/**
|
|
253
|
+
* The Astryx version the managed block in `content` names. Only the block is
|
|
254
|
+
* read, so a version that the project's own text mentions never counts. Null
|
|
255
|
+
* when there is no block, the block is malformed, or it has no version line.
|
|
256
|
+
* @param {string} content
|
|
257
|
+
* @returns {string | null}
|
|
258
|
+
*/
|
|
259
|
+
export function managedBlockVersion(content: string): string | null;
|
|
260
|
+
/**
|
|
261
|
+
* What a write did to one agent-doc file, from its text before and after.
|
|
262
|
+
* `removed`: its Astryx block is gone. `created`: the file did not exist.
|
|
263
|
+
* `unchanged`: the text is the same. `updated`: anything else. `from` and
|
|
264
|
+
* `to` are the versions the block names before and after.
|
|
265
|
+
* @param {string | null} before
|
|
266
|
+
* @param {string | null} after
|
|
267
|
+
* @returns {{change: 'created' | 'updated' | 'unchanged' | 'removed', from: string | null, to: string | null}}
|
|
268
|
+
*/
|
|
269
|
+
export function agentDocChange(before: string | null, after: string | null): {
|
|
270
|
+
change: "created" | "updated" | "unchanged" | "removed";
|
|
271
|
+
from: string | null;
|
|
272
|
+
to: string | null;
|
|
273
|
+
};
|
|
232
274
|
/**
|
|
233
275
|
* Programmatic entry point for installing agent docs.
|
|
234
276
|
* Used by the init command, upgrade command, and agent-docs command.
|
|
@@ -286,6 +328,12 @@ export function installAgentDocs(targetDir: string, { zh, lang, agent, paths, on
|
|
|
286
328
|
onSkipped?: ((rel: string, reason: string) => void) | undefined;
|
|
287
329
|
refuseEscapes?: boolean | undefined;
|
|
288
330
|
}): string[];
|
|
331
|
+
/**
|
|
332
|
+
* The block's last line: how an agent removes the block. `--remove-agents`
|
|
333
|
+
* clears the project root and the working folder (cli-surface INV31); a copy
|
|
334
|
+
* it leaves, such as a file named with `--agent-docs-path`, comes out by hand.
|
|
335
|
+
*/
|
|
336
|
+
export const REMOVE_LINE: "To remove this block, run `astryx init --remove-agents`, which removes it from the agent files at the project root and in the folder you run it in; from any other file it leaves, delete everything from ASTRYX:START to ASTRYX:END.";
|
|
289
337
|
import { discoverAgentDocs } from './agent-doc-state.mjs';
|
|
290
338
|
import { isAstryxInitialized } from './agent-doc-state.mjs';
|
|
291
339
|
import { isAstryxPromptInReach } from './agent-doc-state.mjs';
|
|
@@ -49,6 +49,7 @@ import {ERROR_CODES} from '../response/error-codes.mjs';
|
|
|
49
49
|
import {
|
|
50
50
|
AGENTS_MD,
|
|
51
51
|
AGENT_DOC_PATHS,
|
|
52
|
+
holdsAstryxBlock,
|
|
52
53
|
CLAUDE_MD,
|
|
53
54
|
CLAUDE_DIR_MD,
|
|
54
55
|
CURSOR_RULES,
|
|
@@ -94,6 +95,15 @@ export {
|
|
|
94
95
|
} from './agent-docs-target.mjs';
|
|
95
96
|
|
|
96
97
|
const MAX_PROJECT_AGENT_DOC_LINES = 32;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The block's last line: how an agent removes the block. `--remove-agents`
|
|
101
|
+
* clears the project root and the working folder (cli-surface INV31); a copy
|
|
102
|
+
* it leaves, such as a file named with `--agent-docs-path`, comes out by hand.
|
|
103
|
+
*/
|
|
104
|
+
export const REMOVE_LINE =
|
|
105
|
+
'To remove this block, run `astryx init --remove-agents`, which removes it from the agent files at the project root and in the folder you run it in; from any other file it leaves, delete everything from ASTRYX:START to ASTRYX:END.';
|
|
106
|
+
|
|
97
107
|
const MANAGED_MARKER_TEXT = /(?:ASTRYX|XDS):(START|END)/u;
|
|
98
108
|
|
|
99
109
|
/** @param {unknown} value @returns {string} */
|
|
@@ -383,6 +393,9 @@ export function parseBlockVersion(content) {
|
|
|
383
393
|
* @param {string} [installedVersion] Defaults to the installed core version.
|
|
384
394
|
* @param {string} [expectedBlock] Fully rendered block for this project. When
|
|
385
395
|
* present, byte differences are stale even if the Core version is unchanged.
|
|
396
|
+
* @param {{paths?: string[]}} [options] `paths`: the files to read, relative to
|
|
397
|
+
* `targetDir`, in place of the agent docs found there; a named file without
|
|
398
|
+
* the block makes the status `stale` (or `missing` when none has one).
|
|
386
399
|
* @returns {{
|
|
387
400
|
* installedVersion: string,
|
|
388
401
|
* status: 'missing' | 'stale' | 'current',
|
|
@@ -391,27 +404,39 @@ export function parseBlockVersion(content) {
|
|
|
391
404
|
* blockVersions: string[],
|
|
392
405
|
* }}
|
|
393
406
|
*/
|
|
394
|
-
export function inspectAgentDocs(
|
|
395
|
-
|
|
407
|
+
export function inspectAgentDocs(
|
|
408
|
+
targetDir,
|
|
409
|
+
installedVersion,
|
|
410
|
+
expectedBlock,
|
|
411
|
+
{paths} = {},
|
|
412
|
+
) {
|
|
413
|
+
const version = installedVersion ?? agentDocsVersion(targetDir);
|
|
396
414
|
/** @type {Array<{path: string, blockVersion: string|null, legacy: boolean, stale: boolean}>} */
|
|
397
415
|
const files = [];
|
|
416
|
+
// Named files (init's --agent-docs-path) are the docs: one without the
|
|
417
|
+
// block keeps the set from being current.
|
|
418
|
+
let namedWithoutBlock = 0;
|
|
398
419
|
|
|
399
|
-
for (const rel of discoverAgentDocs(targetDir)) {
|
|
420
|
+
for (const rel of paths ?? discoverAgentDocs(targetDir)) {
|
|
400
421
|
/** @type {string} */
|
|
401
422
|
let content;
|
|
402
423
|
try {
|
|
403
424
|
content = fs.readFileSync(path.join(targetDir, rel), 'utf-8');
|
|
404
425
|
} catch {
|
|
426
|
+
if (paths) namedWithoutBlock++;
|
|
405
427
|
continue; // Unreadable — treat as absent.
|
|
406
428
|
}
|
|
407
429
|
const hasNew = content.includes(MARKER_START);
|
|
408
430
|
const hasLegacy = content.includes(LEGACY_MARKER_START);
|
|
409
|
-
if (!hasNew && !hasLegacy)
|
|
431
|
+
if (!hasNew && !hasLegacy) {
|
|
432
|
+
if (paths) namedWithoutBlock++;
|
|
433
|
+
continue; // Not a block we manage.
|
|
434
|
+
}
|
|
410
435
|
// An import of AGENTS.md names no version and never needs a refresh.
|
|
411
436
|
if (isAgentsImportBlock(rel, content)) continue;
|
|
412
437
|
|
|
413
438
|
const legacy = !hasNew && hasLegacy;
|
|
414
|
-
const blockVersion =
|
|
439
|
+
const blockVersion = managedBlockVersion(content);
|
|
415
440
|
let contentMatches = true;
|
|
416
441
|
if (expectedBlock != null) {
|
|
417
442
|
try {
|
|
@@ -440,7 +465,7 @@ export function inspectAgentDocs(targetDir, installedVersion, expectedBlock) {
|
|
|
440
465
|
/** @type {'missing' | 'stale' | 'current'} */
|
|
441
466
|
let status;
|
|
442
467
|
if (files.length === 0) status = 'missing';
|
|
443
|
-
else if (staleFiles.length > 0) status = 'stale';
|
|
468
|
+
else if (staleFiles.length > 0 || namedWithoutBlock > 0) status = 'stale';
|
|
444
469
|
else status = 'current';
|
|
445
470
|
|
|
446
471
|
return {installedVersion: version, status, files, staleFiles, blockVersions};
|
|
@@ -729,6 +754,10 @@ export function generateCompressedIndex(
|
|
|
729
754
|
}
|
|
730
755
|
}
|
|
731
756
|
}
|
|
757
|
+
// Last, so it follows any integration lines. Without it, an agent asked to
|
|
758
|
+
// take Astryx's text out deletes whole agent files or cuts one copy by hand
|
|
759
|
+
// and leaves the others.
|
|
760
|
+
lines.push(REMOVE_LINE);
|
|
732
761
|
lines.push(MARKER_END);
|
|
733
762
|
|
|
734
763
|
return lines.join('\n');
|
|
@@ -749,7 +778,7 @@ export async function renderAgentDocsBlock(
|
|
|
749
778
|
{installedVersion, fresh = false} = {},
|
|
750
779
|
) {
|
|
751
780
|
const coreDir = findCoreDir(targetDir);
|
|
752
|
-
const version = installedVersion ??
|
|
781
|
+
const version = installedVersion ?? agentDocsVersion(targetDir);
|
|
753
782
|
const project = await Project.load(targetDir, {fresh});
|
|
754
783
|
const failedIntegration = project.loadedIntegrations.find(
|
|
755
784
|
integration => integration.__loadError != null,
|
|
@@ -813,6 +842,16 @@ export async function renderAgentDocsBlock(
|
|
|
813
842
|
});
|
|
814
843
|
}
|
|
815
844
|
|
|
845
|
+
/**
|
|
846
|
+
* The version an agent-docs block names when no caller gives one, as `init`
|
|
847
|
+
* writes it: the Core the folder reads, else this CLI's own.
|
|
848
|
+
* @param {string} targetDir
|
|
849
|
+
* @returns {string}
|
|
850
|
+
*/
|
|
851
|
+
export function agentDocsVersion(targetDir) {
|
|
852
|
+
return getXdsVersion(findCoreDir(targetDir));
|
|
853
|
+
}
|
|
854
|
+
|
|
816
855
|
/**
|
|
817
856
|
* Get Astryx version from core package.
|
|
818
857
|
* @param {string|null} coreDir
|
|
@@ -1568,6 +1607,68 @@ function stripManagedBlock(filePath, compressedIndex) {
|
|
|
1568
1607
|
return false;
|
|
1569
1608
|
}
|
|
1570
1609
|
|
|
1610
|
+
/**
|
|
1611
|
+
* Each agent-doc file's text, or null when it does not exist. Init reads the
|
|
1612
|
+
* files before and after it writes, so its receipt can say what changed.
|
|
1613
|
+
* @param {string} dir
|
|
1614
|
+
* @param {string[]} rels paths relative to `dir`
|
|
1615
|
+
* @returns {Map<string, string | null>}
|
|
1616
|
+
*/
|
|
1617
|
+
export function readAgentDocTexts(dir, rels) {
|
|
1618
|
+
return new Map(
|
|
1619
|
+
rels.map(rel => {
|
|
1620
|
+
try {
|
|
1621
|
+
return [rel, fs.readFileSync(path.join(dir, rel), 'utf-8')];
|
|
1622
|
+
} catch {
|
|
1623
|
+
return [rel, null];
|
|
1624
|
+
}
|
|
1625
|
+
}),
|
|
1626
|
+
);
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
/**
|
|
1630
|
+
* The Astryx version the managed block in `content` names. Only the block is
|
|
1631
|
+
* read, so a version that the project's own text mentions never counts. Null
|
|
1632
|
+
* when there is no block, the block is malformed, or it has no version line.
|
|
1633
|
+
* @param {string} content
|
|
1634
|
+
* @returns {string | null}
|
|
1635
|
+
*/
|
|
1636
|
+
export function managedBlockVersion(content) {
|
|
1637
|
+
try {
|
|
1638
|
+
const block = findManagedBlock(content);
|
|
1639
|
+
return block ? parseBlockVersion(content.slice(block.start, block.end)) : null;
|
|
1640
|
+
} catch {
|
|
1641
|
+
return null;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
/**
|
|
1646
|
+
* What a write did to one agent-doc file, from its text before and after.
|
|
1647
|
+
* `removed`: its Astryx block is gone. `created`: the file did not exist.
|
|
1648
|
+
* `unchanged`: the text is the same. `updated`: anything else. `from` and
|
|
1649
|
+
* `to` are the versions the block names before and after.
|
|
1650
|
+
* @param {string | null} before
|
|
1651
|
+
* @param {string | null} after
|
|
1652
|
+
* @returns {{change: 'created' | 'updated' | 'unchanged' | 'removed', from: string | null, to: string | null}}
|
|
1653
|
+
*/
|
|
1654
|
+
export function agentDocChange(before, after) {
|
|
1655
|
+
const had = before != null && holdsAstryxBlock(before);
|
|
1656
|
+
const has = after != null && holdsAstryxBlock(after);
|
|
1657
|
+
const change =
|
|
1658
|
+
had && !has
|
|
1659
|
+
? 'removed'
|
|
1660
|
+
: before == null
|
|
1661
|
+
? 'created'
|
|
1662
|
+
: before === after
|
|
1663
|
+
? 'unchanged'
|
|
1664
|
+
: 'updated';
|
|
1665
|
+
return {
|
|
1666
|
+
change,
|
|
1667
|
+
from: had ? managedBlockVersion(/** @type {string} */ (before)) : null,
|
|
1668
|
+
to: has ? managedBlockVersion(/** @type {string} */ (after)) : null,
|
|
1669
|
+
};
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1571
1672
|
/**
|
|
1572
1673
|
* Programmatic entry point for installing agent docs.
|
|
1573
1674
|
* Used by the init command, upgrade command, and agent-docs command.
|
|
@@ -269,7 +269,7 @@ function bodyLines(run, install) {
|
|
|
269
269
|
// own workflow lines.
|
|
270
270
|
// A project that already installs Core gets the CLI at that version, as
|
|
271
271
|
// the CLI's own hint for that state says, never a newer CLI beside it.
|
|
272
|
-
`To build UI, work in a project folder (create one if there is none). Add \`@astryxdesign/core\` and \`@astryxdesign/cli\` to a new project or one without \`@astryxdesign/core\`; to a project that already has \`@astryxdesign/core\`, add \`@astryxdesign/cli\` at the same version. Run \`${run} init\` there and follow the agent docs it writes.`,
|
|
272
|
+
`To build UI, work in a project folder (create one if there is none). Add \`@astryxdesign/core\` and \`@astryxdesign/cli\` to a new project or one without \`@astryxdesign/core\`; to a project that already has \`@astryxdesign/core\`, add \`@astryxdesign/cli\` at the same version, pinned exactly when Core is (no \`^\` or \`~\`). Run \`${run} init\` there and follow the agent docs it writes.`,
|
|
273
273
|
WORKFLOW_TITLE,
|
|
274
274
|
...WORKFLOW_STEPS.map(step => step.replaceAll('`astryx ', `\`${run} `)),
|
|
275
275
|
`Before you deliver, re-read each file; ${SELF_CHECK_CSS}. Then build the project and deliver that build, not a description of it.`,
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file Core's base declaration, which the CLI holds.
|
|
5
|
-
* @input the step list
|
|
5
|
+
* @input Core's package name and the step list
|
|
6
6
|
* @output CORE_BASE_NAME and coreBase()
|
|
7
7
|
* @position foundation/bases — Core is declared the same way as any other
|
|
8
8
|
* base; the CLI's own code performs Core's steps, so Core needs no
|
|
9
9
|
* integration manifest.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import {CORE_PACKAGE_NAME} from '../identity/package-names.mjs';
|
|
13
13
|
import {BASE_STEPS} from './steps.mjs';
|
|
14
14
|
|
|
15
15
|
/** Core's package name. */
|
|
16
|
-
export const CORE_BASE_NAME =
|
|
16
|
+
export const CORE_BASE_NAME = CORE_PACKAGE_NAME;
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Core as a resolved base. Its version is read only when a caller asks for
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* Set the package `--base` names for this run; null when it names none.
|
|
6
|
-
* @param {string | null | undefined} name
|
|
7
|
-
*/
|
|
8
|
-
export function setRequestedBase(name: string | null | undefined): void;
|
|
9
|
-
/** @returns {string | null} */
|
|
10
|
-
export function requestedBase(): string | null;
|
|
11
4
|
/**
|
|
12
5
|
* Keep the integrations a project load found, before the base filter, so
|
|
13
6
|
* the requirement check and help resolve the base without loading the
|
|
@@ -82,9 +75,12 @@ export function resolveBase({ cwd, integrations, requested: name, failedToLoad,
|
|
|
82
75
|
* builds on Core and none is left out.
|
|
83
76
|
* @param {LoadedIntegration[]} integrations
|
|
84
77
|
* @param {ActiveBase} base
|
|
78
|
+
* @param {LoadedIntegration[]} [bases] every base the run knows, which
|
|
79
|
+
* decides what an integration builds on; the bases among `integrations`
|
|
80
|
+
* when omitted
|
|
85
81
|
* @returns {{kept: LoadedIntegration[], leftOut: Array<{integration: LoadedIntegration, buildsOn: string[]}>}}
|
|
86
82
|
*/
|
|
87
|
-
export function splitForBase(integrations: LoadedIntegration[], base: ActiveBase): {
|
|
83
|
+
export function splitForBase(integrations: LoadedIntegration[], base: ActiveBase, bases?: LoadedIntegration[]): {
|
|
88
84
|
kept: LoadedIntegration[];
|
|
89
85
|
leftOut: Array<{
|
|
90
86
|
integration: LoadedIntegration;
|
|
@@ -17,7 +17,11 @@ import {installedProjectCoreDir} from '../fs/paths.mjs';
|
|
|
17
17
|
import {resolveInstalledPackageDir} from '../integrations/installed-package.mjs';
|
|
18
18
|
import {CORE_BASE_NAME, coreBase} from './core.mjs';
|
|
19
19
|
import {BASE_CAPABILITIES} from './steps.mjs';
|
|
20
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
registerRunBaseResolver,
|
|
22
|
+
requestedBase,
|
|
23
|
+
setRequestedBase,
|
|
24
|
+
} from './state.mjs';
|
|
21
25
|
|
|
22
26
|
/**
|
|
23
27
|
* The one base a run reads.
|
|
@@ -39,22 +43,6 @@ import {registerRunBaseResolver} from './state.mjs';
|
|
|
39
43
|
|
|
40
44
|
/** @typedef {import('../integrations/integrations.mjs').LoadedIntegration} LoadedIntegration */
|
|
41
45
|
|
|
42
|
-
/** @type {string | null} */
|
|
43
|
-
let requested = null;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Set the package `--base` names for this run; null when it names none.
|
|
47
|
-
* @param {string | null | undefined} name
|
|
48
|
-
*/
|
|
49
|
-
export function setRequestedBase(name) {
|
|
50
|
-
requested = typeof name === 'string' && name.length > 0 ? name : null;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/** @returns {string | null} */
|
|
54
|
-
export function requestedBase() {
|
|
55
|
-
return requested;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
46
|
/** @type {Map<string, {integrations: LoadedIntegration[], failedToLoad: Array<{name: string, error: string}>}>} */
|
|
59
47
|
const candidatesByDir = new Map();
|
|
60
48
|
|
|
@@ -74,7 +62,7 @@ export function recordBaseCandidates(cwd, integrations, failedToLoad = []) {
|
|
|
74
62
|
/** Forget every recorded project. For tests. */
|
|
75
63
|
export function _resetBases() {
|
|
76
64
|
candidatesByDir.clear();
|
|
77
|
-
|
|
65
|
+
setRequestedBase(null);
|
|
78
66
|
}
|
|
79
67
|
|
|
80
68
|
/**
|
|
@@ -89,7 +77,7 @@ export function runBase(cwd = process.cwd()) {
|
|
|
89
77
|
cwd,
|
|
90
78
|
integrations: recorded?.integrations ?? [],
|
|
91
79
|
failedToLoad: recorded?.failedToLoad ?? [],
|
|
92
|
-
requested,
|
|
80
|
+
requested: requestedBase(),
|
|
93
81
|
});
|
|
94
82
|
}
|
|
95
83
|
|
|
@@ -270,10 +258,16 @@ export function resolveBase({
|
|
|
270
258
|
* builds on Core and none is left out.
|
|
271
259
|
* @param {LoadedIntegration[]} integrations
|
|
272
260
|
* @param {ActiveBase} base
|
|
261
|
+
* @param {LoadedIntegration[]} [bases] every base the run knows, which
|
|
262
|
+
* decides what an integration builds on; the bases among `integrations`
|
|
263
|
+
* when omitted
|
|
273
264
|
* @returns {{kept: LoadedIntegration[], leftOut: Array<{integration: LoadedIntegration, buildsOn: string[]}>}}
|
|
274
265
|
*/
|
|
275
|
-
export function splitForBase(
|
|
276
|
-
|
|
266
|
+
export function splitForBase(
|
|
267
|
+
integrations,
|
|
268
|
+
base,
|
|
269
|
+
bases = integrations.filter(isBaseIntegration),
|
|
270
|
+
) {
|
|
277
271
|
if (bases.length === 0 && base.core) return {kept: integrations, leftOut: []};
|
|
278
272
|
const baseNames = new Set([CORE_BASE_NAME, ...bases.map(b => b.name)]);
|
|
279
273
|
/** @type {LoadedIntegration[]} */
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Set the package `--base` names for this run; null when it names none.
|
|
6
|
+
* @param {string | null | undefined} name
|
|
7
|
+
*/
|
|
8
|
+
export function setRequestedBase(name: string | null | undefined): void;
|
|
9
|
+
/** @returns {string | null} */
|
|
10
|
+
export function requestedBase(): string | null;
|
|
4
11
|
/**
|
|
5
12
|
* Register the function that resolves the run's base.
|
|
6
|
-
* @param {() =>
|
|
13
|
+
* @param {() => BaseResolution} resolve
|
|
14
|
+
*/
|
|
15
|
+
export function registerRunBaseResolver(resolve: () => BaseResolution): void;
|
|
16
|
+
/**
|
|
17
|
+
* The resolver's answer for the run, or null when no resolver has loaded.
|
|
18
|
+
* @returns {BaseResolution | null}
|
|
7
19
|
*/
|
|
8
|
-
export function
|
|
9
|
-
ok: boolean;
|
|
10
|
-
base: {
|
|
11
|
-
name: string;
|
|
12
|
-
core: boolean;
|
|
13
|
-
version: string | null;
|
|
14
|
-
} | null;
|
|
15
|
-
}): void;
|
|
20
|
+
export function loadedRunBase(): BaseResolution | null;
|
|
16
21
|
/**
|
|
17
22
|
* The run's base when it resolves to a base other than Core; null when the
|
|
18
23
|
* run reads Core or its base does not resolve.
|
|
@@ -22,3 +27,4 @@ export function currentNonCoreBase(): {
|
|
|
22
27
|
name: string;
|
|
23
28
|
version: string | null;
|
|
24
29
|
} | null;
|
|
30
|
+
export type BaseResolution = import("./resolve.mjs").BaseResolution;
|
|
@@ -2,25 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file The run's base, readable by modules that load before the base
|
|
5
|
-
* resolver
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
5
|
+
* resolver: the package `--base` names, and the resolver's answer once it
|
|
6
|
+
* loads. It imports nothing, so the bin can record `--base`, and the modules
|
|
7
|
+
* it reads first can ask for the base, and pay nothing for it.
|
|
8
|
+
* @input `--base`, and the resolver, which registers itself when it loads
|
|
9
|
+
* @output requestedBase(), loadedRunBase() and currentNonCoreBase()
|
|
9
10
|
* @position foundation/bases — no resolver loaded means no project loaded,
|
|
10
11
|
* and Core answers
|
|
11
12
|
*/
|
|
12
13
|
|
|
13
|
-
/** @type {
|
|
14
|
+
/** @type {string | null} */
|
|
15
|
+
let requested = null;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Set the package `--base` names for this run; null when it names none.
|
|
19
|
+
* @param {string | null | undefined} name
|
|
20
|
+
*/
|
|
21
|
+
export function setRequestedBase(name) {
|
|
22
|
+
requested = typeof name === 'string' && name.length > 0 ? name : null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** @returns {string | null} */
|
|
26
|
+
export function requestedBase() {
|
|
27
|
+
return requested;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** @typedef {import('./resolve.mjs').BaseResolution} BaseResolution */
|
|
31
|
+
|
|
32
|
+
/** @type {(() => BaseResolution) | null} */
|
|
14
33
|
let resolver = null;
|
|
15
34
|
|
|
16
35
|
/**
|
|
17
36
|
* Register the function that resolves the run's base.
|
|
18
|
-
* @param {() =>
|
|
37
|
+
* @param {() => BaseResolution} resolve
|
|
19
38
|
*/
|
|
20
39
|
export function registerRunBaseResolver(resolve) {
|
|
21
40
|
resolver = resolve;
|
|
22
41
|
}
|
|
23
42
|
|
|
43
|
+
/**
|
|
44
|
+
* The resolver's answer for the run, or null when no resolver has loaded.
|
|
45
|
+
* @returns {BaseResolution | null}
|
|
46
|
+
*/
|
|
47
|
+
export function loadedRunBase() {
|
|
48
|
+
return resolver == null ? null : resolver();
|
|
49
|
+
}
|
|
50
|
+
|
|
24
51
|
/** True while the resolver runs, so a lookup it makes reads no base. */
|
|
25
52
|
let resolving = false;
|
|
26
53
|
|
|
@@ -210,12 +210,13 @@ export class Project {
|
|
|
210
210
|
* whose module does not resolve from the project is withdrawn without one.
|
|
211
211
|
*
|
|
212
212
|
* Icon sets are experimental (spec:AST-017 FR27): every surface but
|
|
213
|
-
* `astryx experimental icon` reads them only
|
|
214
|
-
*
|
|
215
|
-
* issue, unless `experimental` asks for the
|
|
213
|
+
* `astryx experimental icon` reads them only where the icon feature gate
|
|
214
|
+
* (foundation/integrations/icon-features.mjs) is on. Where it is off this
|
|
215
|
+
* answers no sets and records no issue, unless `experimental` asks for the
|
|
216
|
+
* installed sets anyway.
|
|
216
217
|
*
|
|
217
218
|
* @param {{experimental?: boolean}} [options] `experimental`: read the
|
|
218
|
-
* installed sets
|
|
219
|
+
* installed sets with the gate off, for `astryx experimental icon`
|
|
219
220
|
* @returns {Promise<{sets: import('../discovery/icon-set-discovery.mjs').DiscoveredIconSet[], withdrawn: import('../discovery/icon-set-discovery.mjs').WithdrawnIconSet[], choice: import('../discovery/icon-set-discovery.mjs').IconSetChoice}>}
|
|
220
221
|
*/
|
|
221
222
|
iconSets({ experimental }?: {
|
|
@@ -59,10 +59,10 @@ import {astryxCommandsOnSearchPath} from '../env/search-path.mjs';
|
|
|
59
59
|
import {resolveProviders} from '../integrations/provider-resolution.mjs';
|
|
60
60
|
import {
|
|
61
61
|
recordBaseCandidates,
|
|
62
|
-
requestedBase,
|
|
63
62
|
resolveBase,
|
|
64
63
|
splitForBase,
|
|
65
64
|
} from '../bases/resolve.mjs';
|
|
65
|
+
import {requestedBase} from '../bases/state.mjs';
|
|
66
66
|
import {coreBase} from '../bases/core.mjs';
|
|
67
67
|
import {
|
|
68
68
|
setProject as setDebugProject,
|
|
@@ -110,8 +110,10 @@ import {
|
|
|
110
110
|
} from '../../assets/codemods/integration-discovery.mjs';
|
|
111
111
|
import {validateLoadedIntegration} from '../integrations/validate-contributions.mjs';
|
|
112
112
|
import {persistedGather} from '../fs/gather-cache.mjs';
|
|
113
|
+
import {iconFeatureGate} from '../integrations/icon-features.mjs';
|
|
114
|
+
import {INSTALLED_ICON_SET_DOC} from '../discovery/name-roots.mjs';
|
|
113
115
|
|
|
114
|
-
import {
|
|
116
|
+
import {recordDeclaredSettings} from '../env/cli-command.mjs';
|
|
115
117
|
import {
|
|
116
118
|
hostedRun,
|
|
117
119
|
recordResolvedIntegrations,
|
|
@@ -651,9 +653,10 @@ export class Project {
|
|
|
651
653
|
}
|
|
652
654
|
// A hosted run returns each package it resolved (cli-surface INV30).
|
|
653
655
|
recordResolvedIntegrations(loadedIntegrations);
|
|
654
|
-
// The picker (getCliInvocation)
|
|
655
|
-
//
|
|
656
|
-
|
|
656
|
+
// The picker (getCliInvocation) and the install-command printers are
|
|
657
|
+
// synchronous, so the commands and install guidance these integrations
|
|
658
|
+
// declare are recorded here, where they become known.
|
|
659
|
+
recordDeclaredSettings(projectDir, loadedIntegrations);
|
|
657
660
|
|
|
658
661
|
// The debug recorder resolves its settings synchronously, long before any
|
|
659
662
|
// command gets here, so this is where a project's `debug` block gets a
|
|
@@ -847,9 +850,10 @@ export class Project {
|
|
|
847
850
|
return;
|
|
848
851
|
}
|
|
849
852
|
try {
|
|
850
|
-
// An experimental root is checked only
|
|
853
|
+
// An experimental root is checked only where icon features are on
|
|
851
854
|
// (spec:AST-017 FR27); the package's own checks read it either way.
|
|
852
|
-
const
|
|
855
|
+
const iconFeatures = iconFeatureGate(this).on;
|
|
856
|
+
const checked = iconFeatures
|
|
853
857
|
? integration
|
|
854
858
|
: {...integration, iconSets: undefined};
|
|
855
859
|
// A function of the files the checks read, which the kept gather
|
|
@@ -860,7 +864,7 @@ export class Project {
|
|
|
860
864
|
this.#cwd,
|
|
861
865
|
integration.__packageDir ?? null,
|
|
862
866
|
integration.name ?? null,
|
|
863
|
-
|
|
867
|
+
iconFeatures,
|
|
864
868
|
],
|
|
865
869
|
() => validateLoadedIntegration(checked),
|
|
866
870
|
ISSUES_CODEC,
|
|
@@ -1117,22 +1121,24 @@ export class Project {
|
|
|
1117
1121
|
* whose module does not resolve from the project is withdrawn without one.
|
|
1118
1122
|
*
|
|
1119
1123
|
* Icon sets are experimental (spec:AST-017 FR27): every surface but
|
|
1120
|
-
* `astryx experimental icon` reads them only
|
|
1121
|
-
*
|
|
1122
|
-
* issue, unless `experimental` asks for the
|
|
1124
|
+
* `astryx experimental icon` reads them only where the icon feature gate
|
|
1125
|
+
* (foundation/integrations/icon-features.mjs) is on. Where it is off this
|
|
1126
|
+
* answers no sets and records no issue, unless `experimental` asks for the
|
|
1127
|
+
* installed sets anyway.
|
|
1123
1128
|
*
|
|
1124
1129
|
* @param {{experimental?: boolean}} [options] `experimental`: read the
|
|
1125
|
-
* installed sets
|
|
1130
|
+
* installed sets with the gate off, for `astryx experimental icon`
|
|
1126
1131
|
* @returns {Promise<{sets: import('../discovery/icon-set-discovery.mjs').DiscoveredIconSet[], withdrawn: import('../discovery/icon-set-discovery.mjs').WithdrawnIconSet[], choice: import('../discovery/icon-set-discovery.mjs').IconSetChoice}>}
|
|
1127
1132
|
*/
|
|
1128
1133
|
async iconSets({experimental = false} = {}) {
|
|
1129
|
-
if (!experimental && !this
|
|
1134
|
+
if (!experimental && !iconFeatureGate(this).on) {
|
|
1130
1135
|
return {
|
|
1131
1136
|
sets: [],
|
|
1132
1137
|
withdrawn: [],
|
|
1133
1138
|
choice: {
|
|
1134
1139
|
status: /** @type {const} */ ('none'),
|
|
1135
|
-
reason:
|
|
1140
|
+
reason:
|
|
1141
|
+
'No icon-set package is installed and astryx.config sets no experimental.iconSet.',
|
|
1136
1142
|
},
|
|
1137
1143
|
};
|
|
1138
1144
|
}
|
|
@@ -1300,10 +1306,20 @@ export class Project {
|
|
|
1300
1306
|
}
|
|
1301
1307
|
}
|
|
1302
1308
|
|
|
1303
|
-
//
|
|
1309
|
+
// Where icon features are on (`iconSets()` reads no set otherwise), each installed
|
|
1304
1310
|
// icon set's own icon definitions join Astryx's under the
|
|
1305
1311
|
// `icon-definitions` namespace, marked with their package.
|
|
1306
|
-
const {sets} = await this.iconSets();
|
|
1312
|
+
const {sets, choice} = await this.iconSets();
|
|
1313
|
+
// The project's set adds one section to `icons`, in the name of the
|
|
1314
|
+
// package that ships it: how to find an icon from that set.
|
|
1315
|
+
if (choice.set) {
|
|
1316
|
+
catalog.add({
|
|
1317
|
+
name: 'installed-icon-set',
|
|
1318
|
+
package: choice.set.package,
|
|
1319
|
+
path: INSTALLED_ICON_SET_DOC,
|
|
1320
|
+
extendsTopic: 'icons',
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1307
1323
|
for (const set of sets) {
|
|
1308
1324
|
if (set.definitions.length === 0) continue;
|
|
1309
1325
|
const at = this.#loadedIntegrations.findIndex(
|
|
@@ -1484,7 +1500,7 @@ export class Project {
|
|
|
1484
1500
|
this.#loadedIntegrations.map(
|
|
1485
1501
|
integration => integration.__packageDir ?? integration.name ?? null,
|
|
1486
1502
|
),
|
|
1487
|
-
|
|
1503
|
+
iconFeatureGate(this).on,
|
|
1488
1504
|
this.#unloadedDependencies(),
|
|
1489
1505
|
before,
|
|
1490
1506
|
],
|