@canonical/pragma-cli 0.34.0 → 0.35.0
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 +153 -30
- package/dist/.build-ok +0 -0
- package/dist/package.json +83 -0
- package/dist/pragma.conf.js +814 -0
- package/dist/pragma.conf.js.map +1 -0
- package/dist/src/bin.js +356 -0
- package/dist/src/bin.js.map +1 -0
- package/dist/src/capabilities/capabilities/capabilities.render.js +70 -0
- package/dist/src/capabilities/capabilities/capabilities.render.js.map +1 -0
- package/dist/src/capabilities/capabilities/capabilities.verb.js +59 -0
- package/dist/src/capabilities/capabilities/capabilities.verb.js.map +1 -0
- package/dist/src/capabilities/capabilities/catalog.js +130 -0
- package/dist/src/capabilities/capabilities/catalog.js.map +1 -0
- package/dist/src/capabilities/capabilities/hints.js +195 -0
- package/dist/src/capabilities/capabilities/hints.js.map +1 -0
- package/dist/src/capabilities/capabilities/index.js +11 -0
- package/dist/src/capabilities/capabilities/index.js.map +1 -0
- package/dist/src/capabilities/capabilities/types.js +11 -0
- package/dist/src/capabilities/capabilities/types.js.map +1 -0
- package/dist/src/capabilities/colophon/collectColophon.js +83 -0
- package/dist/src/capabilities/colophon/collectColophon.js.map +1 -0
- package/dist/src/capabilities/colophon/colophon.render.js +59 -0
- package/dist/src/capabilities/colophon/colophon.render.js.map +1 -0
- package/dist/src/capabilities/colophon/colophon.verb.js +43 -0
- package/dist/src/capabilities/colophon/colophon.verb.js.map +1 -0
- package/dist/src/capabilities/colophon/index.js +5 -0
- package/dist/src/capabilities/colophon/index.js.map +1 -0
- package/dist/src/capabilities/colophon/markdownTerminal.js +90 -0
- package/dist/src/capabilities/colophon/markdownTerminal.js.map +1 -0
- package/dist/src/capabilities/colophon/types.js +10 -0
- package/dist/src/capabilities/colophon/types.js.map +1 -0
- package/dist/src/capabilities/config/collectConfigShow.js +59 -0
- package/dist/src/capabilities/config/collectConfigShow.js.map +1 -0
- package/dist/src/capabilities/config/field.render.js +22 -0
- package/dist/src/capabilities/config/field.render.js.map +1 -0
- package/dist/src/capabilities/config/fields.js +46 -0
- package/dist/src/capabilities/config/fields.js.map +1 -0
- package/dist/src/capabilities/config/get.verb.js +61 -0
- package/dist/src/capabilities/config/get.verb.js.map +1 -0
- package/dist/src/capabilities/config/index.js +5 -0
- package/dist/src/capabilities/config/index.js.map +1 -0
- package/dist/src/capabilities/config/runField.js +59 -0
- package/dist/src/capabilities/config/runField.js.map +1 -0
- package/dist/src/capabilities/config/runGet.js +28 -0
- package/dist/src/capabilities/config/runGet.js.map +1 -0
- package/dist/src/capabilities/config/runSet.js +53 -0
- package/dist/src/capabilities/config/runSet.js.map +1 -0
- package/dist/src/capabilities/config/set.verb.js +66 -0
- package/dist/src/capabilities/config/set.verb.js.map +1 -0
- package/dist/src/capabilities/config/show.render.js +84 -0
- package/dist/src/capabilities/config/show.render.js.map +1 -0
- package/dist/src/capabilities/config/show.verb.js +44 -0
- package/dist/src/capabilities/config/show.verb.js.map +1 -0
- package/dist/src/capabilities/config/types.js +5 -0
- package/dist/src/capabilities/config/types.js.map +1 -0
- package/dist/src/capabilities/config/unset.verb.js +49 -0
- package/dist/src/capabilities/config/unset.verb.js.map +1 -0
- package/dist/src/capabilities/create/cliProjection.js +195 -0
- package/dist/src/capabilities/create/cliProjection.js.map +1 -0
- package/dist/src/capabilities/create/constants.js +47 -0
- package/dist/src/capabilities/create/constants.js.map +1 -0
- package/dist/src/capabilities/create/create.render.js +100 -0
- package/dist/src/capabilities/create/create.render.js.map +1 -0
- package/dist/src/capabilities/create/create.verb.js +438 -0
- package/dist/src/capabilities/create/create.verb.js.map +1 -0
- package/dist/src/capabilities/create/createHelp.js +47 -0
- package/dist/src/capabilities/create/createHelp.js.map +1 -0
- package/dist/src/capabilities/create/createSurface.generated.js +394 -0
- package/dist/src/capabilities/create/createSurface.generated.js.map +1 -0
- package/dist/src/capabilities/create/generatorToVerbSpec.js +106 -0
- package/dist/src/capabilities/create/generatorToVerbSpec.js.map +1 -0
- package/dist/src/capabilities/create/index.js +18 -0
- package/dist/src/capabilities/create/index.js.map +1 -0
- package/dist/src/capabilities/create/messages.js +16 -0
- package/dist/src/capabilities/create/messages.js.map +1 -0
- package/dist/src/capabilities/create/mount.js +293 -0
- package/dist/src/capabilities/create/mount.js.map +1 -0
- package/dist/src/capabilities/create/pathJail.js +65 -0
- package/dist/src/capabilities/create/pathJail.js.map +1 -0
- package/dist/src/capabilities/create/pickGenerator.js +53 -0
- package/dist/src/capabilities/create/pickGenerator.js.map +1 -0
- package/dist/src/capabilities/create/types.js +2 -0
- package/dist/src/capabilities/create/types.js.map +1 -0
- package/dist/src/capabilities/distribution.js +40 -0
- package/dist/src/capabilities/distribution.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkKeStore.js +40 -0
- package/dist/src/capabilities/doctor/checks/checkKeStore.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkNodeVersion.js +21 -0
- package/dist/src/capabilities/doctor/checks/checkNodeVersion.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkPackageRefs.js +92 -0
- package/dist/src/capabilities/doctor/checks/checkPackageRefs.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkPragmaVersion.js +19 -0
- package/dist/src/capabilities/doctor/checks/checkPragmaVersion.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkShellCompletions.js +199 -0
- package/dist/src/capabilities/doctor/checks/checkShellCompletions.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/index.js +27 -0
- package/dist/src/capabilities/doctor/checks/index.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/mcpCommand.js +57 -0
- package/dist/src/capabilities/doctor/checks/mcpCommand.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/targetHealth.js +205 -0
- package/dist/src/capabilities/doctor/checks/targetHealth.js.map +1 -0
- package/dist/src/capabilities/doctor/doctor.render.js +185 -0
- package/dist/src/capabilities/doctor/doctor.render.js.map +1 -0
- package/dist/src/capabilities/doctor/doctor.verb.js +45 -0
- package/dist/src/capabilities/doctor/doctor.verb.js.map +1 -0
- package/dist/src/capabilities/doctor/index.js +5 -0
- package/dist/src/capabilities/doctor/index.js.map +1 -0
- package/dist/src/capabilities/doctor/runChecks.js +83 -0
- package/dist/src/capabilities/doctor/runChecks.js.map +1 -0
- package/dist/src/capabilities/doctor/types.js +5 -0
- package/dist/src/capabilities/doctor/types.js.map +1 -0
- package/dist/src/capabilities/graph/index.js +19 -0
- package/dist/src/capabilities/graph/index.js.map +1 -0
- package/dist/src/capabilities/graph/inspect.render.js +76 -0
- package/dist/src/capabilities/graph/inspect.render.js.map +1 -0
- package/dist/src/capabilities/graph/inspect.verb.js +53 -0
- package/dist/src/capabilities/graph/inspect.verb.js.map +1 -0
- package/dist/src/capabilities/graph/query.render.js +73 -0
- package/dist/src/capabilities/graph/query.render.js.map +1 -0
- package/dist/src/capabilities/graph/query.verb.js +49 -0
- package/dist/src/capabilities/graph/query.verb.js.map +1 -0
- package/dist/src/capabilities/graph/runQuery.js +41 -0
- package/dist/src/capabilities/graph/runQuery.js.map +1 -0
- package/dist/src/capabilities/index.js +56 -0
- package/dist/src/capabilities/index.js.map +1 -0
- package/dist/src/capabilities/info/collectInfo.js +66 -0
- package/dist/src/capabilities/info/collectInfo.js.map +1 -0
- package/dist/src/capabilities/info/index.js +5 -0
- package/dist/src/capabilities/info/index.js.map +1 -0
- package/dist/src/capabilities/info/info.render.js +53 -0
- package/dist/src/capabilities/info/info.render.js.map +1 -0
- package/dist/src/capabilities/info/info.verb.js +42 -0
- package/dist/src/capabilities/info/info.verb.js.map +1 -0
- package/dist/src/capabilities/info/types.js +5 -0
- package/dist/src/capabilities/info/types.js.map +1 -0
- package/dist/src/capabilities/meta/complete.verb.js +43 -0
- package/dist/src/capabilities/meta/complete.verb.js.map +1 -0
- package/dist/src/capabilities/meta/index.js +13 -0
- package/dist/src/capabilities/meta/index.js.map +1 -0
- package/dist/src/capabilities/meta/mcp.verb.js +34 -0
- package/dist/src/capabilities/meta/mcp.verb.js.map +1 -0
- package/dist/src/capabilities/ontology/index.js +21 -0
- package/dist/src/capabilities/ontology/index.js.map +1 -0
- package/dist/src/capabilities/ontology/queries.js +123 -0
- package/dist/src/capabilities/ontology/queries.js.map +1 -0
- package/dist/src/capabilities/ontology/render.js +66 -0
- package/dist/src/capabilities/ontology/render.js.map +1 -0
- package/dist/src/capabilities/ontology/verbs.js +181 -0
- package/dist/src/capabilities/ontology/verbs.js.map +1 -0
- package/dist/src/capabilities/prompt/index.js +16 -0
- package/dist/src/capabilities/prompt/index.js.map +1 -0
- package/dist/src/capabilities/prompt/prompt.render.js +78 -0
- package/dist/src/capabilities/prompt/prompt.render.js.map +1 -0
- package/dist/src/capabilities/prompt/types.js +10 -0
- package/dist/src/capabilities/prompt/types.js.map +1 -0
- package/dist/src/capabilities/prompt/verbs.js +93 -0
- package/dist/src/capabilities/prompt/verbs.js.map +1 -0
- package/dist/src/capabilities/resources/index.js +10 -0
- package/dist/src/capabilities/resources/index.js.map +1 -0
- package/dist/src/capabilities/resources/provider.js +423 -0
- package/dist/src/capabilities/resources/provider.js.map +1 -0
- package/dist/src/capabilities/setup/buildPlan.js +168 -0
- package/dist/src/capabilities/setup/buildPlan.js.map +1 -0
- package/dist/src/capabilities/setup/index.js +5 -0
- package/dist/src/capabilities/setup/index.js.map +1 -0
- package/dist/src/capabilities/setup/mode.js +53 -0
- package/dist/src/capabilities/setup/mode.js.map +1 -0
- package/dist/src/capabilities/setup/operations/index.js +39 -0
- package/dist/src/capabilities/setup/operations/index.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupCompletions.js +160 -0
- package/dist/src/capabilities/setup/operations/setupCompletions.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupConfig.js +101 -0
- package/dist/src/capabilities/setup/operations/setupConfig.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupGenerator.js +343 -0
- package/dist/src/capabilities/setup/operations/setupGenerator.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupLsp.js +277 -0
- package/dist/src/capabilities/setup/operations/setupLsp.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupMcp.js +207 -0
- package/dist/src/capabilities/setup/operations/setupMcp.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupSkills.js +316 -0
- package/dist/src/capabilities/setup/operations/setupSkills.js.map +1 -0
- package/dist/src/capabilities/setup/plan.js +128 -0
- package/dist/src/capabilities/setup/plan.js.map +1 -0
- package/dist/src/capabilities/setup/plan.render.js +193 -0
- package/dist/src/capabilities/setup/plan.render.js.map +1 -0
- package/dist/src/capabilities/setup/setup.render.js +54 -0
- package/dist/src/capabilities/setup/setup.render.js.map +1 -0
- package/dist/src/capabilities/setup/setup.verb.js +334 -0
- package/dist/src/capabilities/setup/setup.verb.js.map +1 -0
- package/dist/src/capabilities/setup/shell.js +196 -0
- package/dist/src/capabilities/setup/shell.js.map +1 -0
- package/dist/src/capabilities/setup/targets.js +263 -0
- package/dist/src/capabilities/setup/targets.js.map +1 -0
- package/dist/src/capabilities/setup/types.js +5 -0
- package/dist/src/capabilities/setup/types.js.map +1 -0
- package/dist/src/capabilities/shared/assertExecOk.js +137 -0
- package/dist/src/capabilities/shared/assertExecOk.js.map +1 -0
- package/dist/src/capabilities/shared/bands.js +16 -0
- package/dist/src/capabilities/shared/bands.js.map +1 -0
- package/dist/src/capabilities/shared/index.js +26 -0
- package/dist/src/capabilities/shared/index.js.map +1 -0
- package/dist/src/capabilities/shared/packageManager.js +103 -0
- package/dist/src/capabilities/shared/packageManager.js.map +1 -0
- package/dist/src/capabilities/shared/registry.js +55 -0
- package/dist/src/capabilities/shared/registry.js.map +1 -0
- package/dist/src/capabilities/skill/discover.js +195 -0
- package/dist/src/capabilities/skill/discover.js.map +1 -0
- package/dist/src/capabilities/skill/index.js +10 -0
- package/dist/src/capabilities/skill/index.js.map +1 -0
- package/dist/src/capabilities/skill/render.js +49 -0
- package/dist/src/capabilities/skill/render.js.map +1 -0
- package/dist/src/capabilities/skill/verbs.js +83 -0
- package/dist/src/capabilities/skill/verbs.js.map +1 -0
- package/dist/src/capabilities/sources/collectStatus.js +103 -0
- package/dist/src/capabilities/sources/collectStatus.js.map +1 -0
- package/dist/src/capabilities/sources/index.js +13 -0
- package/dist/src/capabilities/sources/index.js.map +1 -0
- package/dist/src/capabilities/sources/installSkills.js +167 -0
- package/dist/src/capabilities/sources/installSkills.js.map +1 -0
- package/dist/src/capabilities/sources/runUpdate.js +394 -0
- package/dist/src/capabilities/sources/runUpdate.js.map +1 -0
- package/dist/src/capabilities/sources/status.render.js +64 -0
- package/dist/src/capabilities/sources/status.render.js.map +1 -0
- package/dist/src/capabilities/sources/status.verb.js +40 -0
- package/dist/src/capabilities/sources/status.verb.js.map +1 -0
- package/dist/src/capabilities/sources/types.js +6 -0
- package/dist/src/capabilities/sources/types.js.map +1 -0
- package/dist/src/capabilities/sources/update.render.js +34 -0
- package/dist/src/capabilities/sources/update.render.js.map +1 -0
- package/dist/src/capabilities/sources/update.verb.js +55 -0
- package/dist/src/capabilities/sources/update.verb.js.map +1 -0
- package/dist/src/capabilities/upgrade/index.js +5 -0
- package/dist/src/capabilities/upgrade/index.js.map +1 -0
- package/dist/src/capabilities/upgrade/runUpgrade.js +99 -0
- package/dist/src/capabilities/upgrade/runUpgrade.js.map +1 -0
- package/dist/src/capabilities/upgrade/types.js +5 -0
- package/dist/src/capabilities/upgrade/types.js.map +1 -0
- package/dist/src/capabilities/upgrade/upgrade.render.js +44 -0
- package/dist/src/capabilities/upgrade/upgrade.render.js.map +1 -0
- package/dist/src/capabilities/upgrade/upgrade.verb.js +52 -0
- package/dist/src/capabilities/upgrade/upgrade.verb.js.map +1 -0
- package/dist/src/capabilities/version/index.js +10 -0
- package/dist/src/capabilities/version/index.js.map +1 -0
- package/dist/src/capabilities/version/version.verb.js +36 -0
- package/dist/src/capabilities/version/version.verb.js.map +1 -0
- package/dist/src/constants.js +82 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/index.js +12 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/kernel/completion/complete.js +66 -0
- package/dist/src/kernel/completion/complete.js.map +1 -0
- package/dist/src/kernel/completion/emitScripts.js +92 -0
- package/dist/src/kernel/completion/emitScripts.js.map +1 -0
- package/dist/src/kernel/completion/entitySource.js +285 -0
- package/dist/src/kernel/completion/entitySource.js.map +1 -0
- package/dist/src/kernel/completion/index.js +14 -0
- package/dist/src/kernel/completion/index.js.map +1 -0
- package/dist/src/kernel/completion/model.js +301 -0
- package/dist/src/kernel/completion/model.js.map +1 -0
- package/dist/src/kernel/completion/parse.js +253 -0
- package/dist/src/kernel/completion/parse.js.map +1 -0
- package/dist/src/kernel/completion/rank.js +101 -0
- package/dist/src/kernel/completion/rank.js.map +1 -0
- package/dist/src/kernel/completion/resolve.js +100 -0
- package/dist/src/kernel/completion/resolve.js.map +1 -0
- package/dist/src/kernel/completion/templates/bash.js +209 -0
- package/dist/src/kernel/completion/templates/bash.js.map +1 -0
- package/dist/src/kernel/completion/templates/fish.js +214 -0
- package/dist/src/kernel/completion/templates/fish.js.map +1 -0
- package/dist/src/kernel/completion/templates/index.js +23 -0
- package/dist/src/kernel/completion/templates/index.js.map +1 -0
- package/dist/src/kernel/completion/templates/shared.js +98 -0
- package/dist/src/kernel/completion/templates/shared.js.map +1 -0
- package/dist/src/kernel/completion/templates/zsh.js +201 -0
- package/dist/src/kernel/completion/templates/zsh.js.map +1 -0
- package/dist/src/kernel/completion/types.js +13 -0
- package/dist/src/kernel/completion/types.js.map +1 -0
- package/dist/src/kernel/config/defaults.js +17 -0
- package/dist/src/kernel/config/defaults.js.map +1 -0
- package/dist/src/kernel/config/evaluateProjectConfig.js +126 -0
- package/dist/src/kernel/config/evaluateProjectConfig.js.map +1 -0
- package/dist/src/kernel/config/findProjectConfig.js +43 -0
- package/dist/src/kernel/config/findProjectConfig.js.map +1 -0
- package/dist/src/kernel/config/firstRun.js +34 -0
- package/dist/src/kernel/config/firstRun.js.map +1 -0
- package/dist/src/kernel/config/globalConfig.js +79 -0
- package/dist/src/kernel/config/globalConfig.js.map +1 -0
- package/dist/src/kernel/config/index.js +16 -0
- package/dist/src/kernel/config/index.js.map +1 -0
- package/dist/src/kernel/config/paths.js +35 -0
- package/dist/src/kernel/config/paths.js.map +1 -0
- package/dist/src/kernel/config/readConfig.js +78 -0
- package/dist/src/kernel/config/readConfig.js.map +1 -0
- package/dist/src/kernel/config/schema.js +130 -0
- package/dist/src/kernel/config/schema.js.map +1 -0
- package/dist/src/kernel/config/types.js +19 -0
- package/dist/src/kernel/config/types.js.map +1 -0
- package/dist/src/kernel/config/writeConfigField.js +59 -0
- package/dist/src/kernel/config/writeConfigField.js.map +1 -0
- package/dist/src/kernel/copy.js +43 -0
- package/dist/src/kernel/copy.js.map +1 -0
- package/dist/src/kernel/error/PragmaError.js +149 -0
- package/dist/src/kernel/error/PragmaError.js.map +1 -0
- package/dist/src/kernel/error/constants.js +40 -0
- package/dist/src/kernel/error/constants.js.map +1 -0
- package/dist/src/kernel/error/fromTaskError.js +96 -0
- package/dist/src/kernel/error/fromTaskError.js.map +1 -0
- package/dist/src/kernel/error/index.js +13 -0
- package/dist/src/kernel/error/index.js.map +1 -0
- package/dist/src/kernel/error/recovery.js +52 -0
- package/dist/src/kernel/error/recovery.js.map +1 -0
- package/dist/src/kernel/error/renderError.js +115 -0
- package/dist/src/kernel/error/renderError.js.map +1 -0
- package/dist/src/kernel/error/serialize.js +25 -0
- package/dist/src/kernel/error/serialize.js.map +1 -0
- package/dist/src/kernel/error/types.js +9 -0
- package/dist/src/kernel/error/types.js.map +1 -0
- package/dist/src/kernel/index.js +25 -0
- package/dist/src/kernel/index.js.map +1 -0
- package/dist/src/kernel/packs/collect.js +187 -0
- package/dist/src/kernel/packs/collect.js.map +1 -0
- package/dist/src/kernel/packs/compile.js +304 -0
- package/dist/src/kernel/packs/compile.js.map +1 -0
- package/dist/src/kernel/packs/disclosure.js +76 -0
- package/dist/src/kernel/packs/disclosure.js.map +1 -0
- package/dist/src/kernel/packs/glob.js +38 -0
- package/dist/src/kernel/packs/glob.js.map +1 -0
- package/dist/src/kernel/packs/graphql/buildLookupDocument.js +258 -0
- package/dist/src/kernel/packs/graphql/buildLookupDocument.js.map +1 -0
- package/dist/src/kernel/packs/graphql/fetchGraphqlLookup.js +157 -0
- package/dist/src/kernel/packs/graphql/fetchGraphqlLookup.js.map +1 -0
- package/dist/src/kernel/packs/graphql/index.js +20 -0
- package/dist/src/kernel/packs/graphql/index.js.map +1 -0
- package/dist/src/kernel/packs/graphql/nameMap.js +63 -0
- package/dist/src/kernel/packs/graphql/nameMap.js.map +1 -0
- package/dist/src/kernel/packs/index.js +34 -0
- package/dist/src/kernel/packs/index.js.map +1 -0
- package/dist/src/kernel/packs/iri.js +110 -0
- package/dist/src/kernel/packs/iri.js.map +1 -0
- package/dist/src/kernel/packs/renderPack.js +129 -0
- package/dist/src/kernel/packs/renderPack.js.map +1 -0
- package/dist/src/kernel/packs/resolveEntity.js +223 -0
- package/dist/src/kernel/packs/resolveEntity.js.map +1 -0
- package/dist/src/kernel/packs/runBodies.js +87 -0
- package/dist/src/kernel/packs/runBodies.js.map +1 -0
- package/dist/src/kernel/packs/sample.js +56 -0
- package/dist/src/kernel/packs/sample.js.map +1 -0
- package/dist/src/kernel/packs/schema.js +369 -0
- package/dist/src/kernel/packs/schema.js.map +1 -0
- package/dist/src/kernel/packs/sparql/applyFilters.js +68 -0
- package/dist/src/kernel/packs/sparql/applyFilters.js.map +1 -0
- package/dist/src/kernel/packs/sparql/applySearch.js +25 -0
- package/dist/src/kernel/packs/sparql/applySearch.js.map +1 -0
- package/dist/src/kernel/packs/sparql/buildLookupQuery.js +217 -0
- package/dist/src/kernel/packs/sparql/buildLookupQuery.js.map +1 -0
- package/dist/src/kernel/packs/sparql/escape.js +21 -0
- package/dist/src/kernel/packs/sparql/escape.js.map +1 -0
- package/dist/src/kernel/packs/sparql/index.js +31 -0
- package/dist/src/kernel/packs/sparql/index.js.map +1 -0
- package/dist/src/kernel/packs/sparql/runSelect.js +101 -0
- package/dist/src/kernel/packs/sparql/runSelect.js.map +1 -0
- package/dist/src/kernel/packs/types.js +30 -0
- package/dist/src/kernel/packs/types.js.map +1 -0
- package/dist/src/kernel/packs/uniqueness.js +30 -0
- package/dist/src/kernel/packs/uniqueness.js.map +1 -0
- package/dist/src/kernel/project/cli/buildProgram.js +263 -0
- package/dist/src/kernel/project/cli/buildProgram.js.map +1 -0
- package/dist/src/kernel/project/cli/constants.js +27 -0
- package/dist/src/kernel/project/cli/constants.js.map +1 -0
- package/dist/src/kernel/project/cli/dispatch.js +420 -0
- package/dist/src/kernel/project/cli/dispatch.js.map +1 -0
- package/dist/src/kernel/project/cli/exitCodes.js +66 -0
- package/dist/src/kernel/project/cli/exitCodes.js.map +1 -0
- package/dist/src/kernel/project/cli/globalFlags.js +216 -0
- package/dist/src/kernel/project/cli/globalFlags.js.map +1 -0
- package/dist/src/kernel/project/cli/helpFormat.js +59 -0
- package/dist/src/kernel/project/cli/helpFormat.js.map +1 -0
- package/dist/src/kernel/project/cli/index.js +14 -0
- package/dist/src/kernel/project/cli/index.js.map +1 -0
- package/dist/src/kernel/project/cli/rootHelp.js +197 -0
- package/dist/src/kernel/project/cli/rootHelp.js.map +1 -0
- package/dist/src/kernel/project/cli/suggest.js +75 -0
- package/dist/src/kernel/project/cli/suggest.js.map +1 -0
- package/dist/src/kernel/project/cli/suggestNames.js +96 -0
- package/dist/src/kernel/project/cli/suggestNames.js.map +1 -0
- package/dist/src/kernel/project/cli/verbHelp.js +131 -0
- package/dist/src/kernel/project/cli/verbHelp.js.map +1 -0
- package/dist/src/kernel/project/mcp/buildServer.js +67 -0
- package/dist/src/kernel/project/mcp/buildServer.js.map +1 -0
- package/dist/src/kernel/project/mcp/envelope.js +37 -0
- package/dist/src/kernel/project/mcp/envelope.js.map +1 -0
- package/dist/src/kernel/project/mcp/index.js +8 -0
- package/dist/src/kernel/project/mcp/index.js.map +1 -0
- package/dist/src/kernel/project/mcp/instructions.js +44 -0
- package/dist/src/kernel/project/mcp/instructions.js.map +1 -0
- package/dist/src/kernel/project/mcp/mcpError.js +42 -0
- package/dist/src/kernel/project/mcp/mcpError.js.map +1 -0
- package/dist/src/kernel/project/mcp/prompts/index.js +36 -0
- package/dist/src/kernel/project/mcp/prompts/index.js.map +1 -0
- package/dist/src/kernel/project/mcp/prompts/provider.js +98 -0
- package/dist/src/kernel/project/mcp/prompts/provider.js.map +1 -0
- package/dist/src/kernel/project/mcp/prompts/source.js +154 -0
- package/dist/src/kernel/project/mcp/prompts/source.js.map +1 -0
- package/dist/src/kernel/project/mcp/registerVerb.js +300 -0
- package/dist/src/kernel/project/mcp/registerVerb.js.map +1 -0
- package/dist/src/kernel/project/mcp/serve.js +35 -0
- package/dist/src/kernel/project/mcp/serve.js.map +1 -0
- package/dist/src/kernel/render/compactUri.js +24 -0
- package/dist/src/kernel/render/compactUri.js.map +1 -0
- package/dist/src/kernel/render/contracts.js +10 -0
- package/dist/src/kernel/render/contracts.js.map +1 -0
- package/dist/src/kernel/render/disclosure.js +34 -0
- package/dist/src/kernel/render/disclosure.js.map +1 -0
- package/dist/src/kernel/render/envelope.js +30 -0
- package/dist/src/kernel/render/envelope.js.map +1 -0
- package/dist/src/kernel/render/formatters.js +27 -0
- package/dist/src/kernel/render/formatters.js.map +1 -0
- package/dist/src/kernel/render/index.js +15 -0
- package/dist/src/kernel/render/index.js.map +1 -0
- package/dist/src/kernel/render/prefixes.js +46 -0
- package/dist/src/kernel/render/prefixes.js.map +1 -0
- package/dist/src/kernel/render/renderers.js +468 -0
- package/dist/src/kernel/render/renderers.js.map +1 -0
- package/dist/src/kernel/render/style.js +85 -0
- package/dist/src/kernel/render/style.js.map +1 -0
- package/dist/src/kernel/render/turtle.js +194 -0
- package/dist/src/kernel/render/turtle.js.map +1 -0
- package/dist/src/kernel/render/writeStdout.js +43 -0
- package/dist/src/kernel/render/writeStdout.js.map +1 -0
- package/dist/src/kernel/runtime/boot.js +49 -0
- package/dist/src/kernel/runtime/boot.js.map +1 -0
- package/dist/src/kernel/runtime/facade.js +39 -0
- package/dist/src/kernel/runtime/facade.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/build.js +122 -0
- package/dist/src/kernel/runtime/graphpack/build.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/buildIndex.js +303 -0
- package/dist/src/kernel/runtime/graphpack/buildIndex.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.generated.js +6 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.generated.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.index.generated.js +4 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.index.generated.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.stories.generated.js +4 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.stories.generated.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded.js +82 -0
- package/dist/src/kernel/runtime/graphpack/embedded.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/hash.js +38 -0
- package/dist/src/kernel/runtime/graphpack/hash.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/index.js +11 -0
- package/dist/src/kernel/runtime/graphpack/index.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/manifest.js +145 -0
- package/dist/src/kernel/runtime/graphpack/manifest.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/read.js +92 -0
- package/dist/src/kernel/runtime/graphpack/read.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/schemas.js +70 -0
- package/dist/src/kernel/runtime/graphpack/schemas.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/stories.js +68 -0
- package/dist/src/kernel/runtime/graphpack/stories.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/types.js +55 -0
- package/dist/src/kernel/runtime/graphpack/types.js.map +1 -0
- package/dist/src/kernel/runtime/index.js +8 -0
- package/dist/src/kernel/runtime/index.js.map +1 -0
- package/dist/src/kernel/runtime/loadSession.js +34 -0
- package/dist/src/kernel/runtime/loadSession.js.map +1 -0
- package/dist/src/kernel/runtime/paths.js +78 -0
- package/dist/src/kernel/runtime/paths.js.map +1 -0
- package/dist/src/kernel/runtime/probe.js +37 -0
- package/dist/src/kernel/runtime/probe.js.map +1 -0
- package/dist/src/kernel/runtime/readEntity.js +363 -0
- package/dist/src/kernel/runtime/readEntity.js.map +1 -0
- package/dist/src/kernel/runtime/refs/gitOps.js +65 -0
- package/dist/src/kernel/runtime/refs/gitOps.js.map +1 -0
- package/dist/src/kernel/runtime/refs/index.js +29 -0
- package/dist/src/kernel/runtime/refs/index.js.map +1 -0
- package/dist/src/kernel/runtime/refs/parseRef.js +70 -0
- package/dist/src/kernel/runtime/refs/parseRef.js.map +1 -0
- package/dist/src/kernel/runtime/refs/resolve.js +332 -0
- package/dist/src/kernel/runtime/refs/resolve.js.map +1 -0
- package/dist/src/kernel/runtime/resolveSources.js +62 -0
- package/dist/src/kernel/runtime/resolveSources.js.map +1 -0
- package/dist/src/kernel/runtime/store.js +75 -0
- package/dist/src/kernel/runtime/store.js.map +1 -0
- package/dist/src/kernel/runtime/storeReadiness.js +51 -0
- package/dist/src/kernel/runtime/storeReadiness.js.map +1 -0
- package/dist/src/kernel/runtime/types.js +11 -0
- package/dist/src/kernel/runtime/types.js.map +1 -0
- package/dist/src/kernel/spec/asVerb.js +21 -0
- package/dist/src/kernel/spec/asVerb.js.map +1 -0
- package/dist/src/kernel/spec/emitReference.js +578 -0
- package/dist/src/kernel/spec/emitReference.js.map +1 -0
- package/dist/src/kernel/spec/emitSurface.js +202 -0
- package/dist/src/kernel/spec/emitSurface.js.map +1 -0
- package/dist/src/kernel/spec/index.js +11 -0
- package/dist/src/kernel/spec/index.js.map +1 -0
- package/dist/src/kernel/spec/surfaceConformance.js +103 -0
- package/dist/src/kernel/spec/surfaceConformance.js.map +1 -0
- package/dist/src/kernel/spec/types.js +14 -0
- package/dist/src/kernel/spec/types.js.map +1 -0
- package/dist/src/kernel/spec/validate.js +110 -0
- package/dist/src/kernel/spec/validate.js.map +1 -0
- package/dist/src/kernel/vocabulary.js +97 -0
- package/dist/src/kernel/vocabulary.js.map +1 -0
- package/dist/src/types.js +11 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +20 -22
- package/pragma.conf.ts +249 -60
- package/src/bin.ts +267 -82
- package/src/capabilities/block.parity.test.ts +6 -3
- package/src/capabilities/capabilities/capabilities.render.ts +1 -1
- package/src/capabilities/capabilities/capabilities.verb.ts +1 -1
- package/src/capabilities/capabilities/catalog.ts +3 -3
- package/src/capabilities/capabilities/hints.ts +32 -7
- package/src/capabilities/capabilities/index.ts +1 -1
- package/src/capabilities/colophon/collectColophon.ts +35 -24
- package/src/capabilities/colophon/colophon.render.ts +25 -1
- package/src/capabilities/colophon/colophon.test.ts +42 -21
- package/src/capabilities/colophon/colophon.verb.ts +4 -4
- package/src/capabilities/config/collectConfigShow.test.ts +1 -0
- package/src/capabilities/config/collectConfigShow.ts +3 -3
- package/src/capabilities/config/field.render.ts +4 -5
- package/src/capabilities/config/fields.ts +17 -10
- package/src/capabilities/config/get.verb.ts +70 -0
- package/src/capabilities/config/getUnset.test.ts +264 -0
- package/src/capabilities/config/index.ts +5 -1
- package/src/capabilities/config/runField.ts +40 -22
- package/src/capabilities/config/runGet.ts +34 -0
- package/src/capabilities/config/runSet.ts +35 -9
- package/src/capabilities/config/set.test.ts +48 -14
- package/src/capabilities/config/set.verb.ts +8 -7
- package/src/capabilities/config/show.render.ts +1 -1
- package/src/capabilities/config/show.verb.ts +9 -6
- package/src/capabilities/config/types.ts +18 -4
- package/src/capabilities/config/unset.verb.ts +58 -0
- package/src/capabilities/create/byteEquality.subprocess.test.ts +2 -3
- package/src/capabilities/create/byteEquality.test.ts +25 -11
- package/src/capabilities/create/cliProjection.ts +227 -0
- package/src/capabilities/create/constants.ts +36 -61
- package/src/capabilities/create/create.mcp.test.ts +89 -5
- package/src/capabilities/create/create.render.ts +71 -7
- package/src/capabilities/create/create.test.ts +433 -219
- package/src/capabilities/create/create.verb.ts +297 -328
- package/src/capabilities/create/createGrammar.test.ts +865 -0
- package/src/capabilities/create/createHelp.ts +71 -0
- package/src/capabilities/create/createSurface.generated.ts +400 -0
- package/src/capabilities/create/crossCli.subprocess.test.ts +745 -0
- package/src/capabilities/create/cwdJail.test.ts +24 -5
- package/src/capabilities/create/generatorToVerbSpec.test.ts +186 -0
- package/src/capabilities/create/generatorToVerbSpec.ts +13 -11
- package/src/capabilities/create/index.ts +7 -4
- package/src/capabilities/create/messages.ts +18 -0
- package/src/capabilities/create/mount.ts +391 -0
- package/src/capabilities/create/pathJail.test.ts +90 -0
- package/src/capabilities/create/pathJail.ts +8 -5
- package/src/capabilities/create/pickGenerator.ts +23 -35
- package/src/capabilities/create/shippedCreate.subprocess.test.ts +164 -0
- package/src/capabilities/create/types.ts +20 -0
- package/src/capabilities/distribution.test.ts +3 -1
- package/src/capabilities/distribution.ts +10 -15
- package/src/capabilities/doctor/checks/checkKeStore.ts +7 -5
- package/src/capabilities/doctor/checks/checkPackageRefs.ts +6 -4
- package/src/capabilities/doctor/checks/checkPragmaVersion.ts +2 -2
- package/src/capabilities/doctor/checks/checkShellCompletions.test.ts +72 -27
- package/src/capabilities/doctor/checks/checkShellCompletions.ts +59 -13
- package/src/capabilities/doctor/checks/index.ts +27 -0
- package/src/capabilities/doctor/checks/mcpCommand.test.ts +100 -0
- package/src/capabilities/doctor/checks/mcpCommand.ts +69 -0
- package/src/capabilities/doctor/checks/targetHealth.ts +274 -0
- package/src/capabilities/doctor/doctor.render.test.ts +18 -7
- package/src/capabilities/doctor/doctor.render.ts +43 -19
- package/src/capabilities/doctor/doctor.test.ts +123 -34
- package/src/capabilities/doctor/doctor.verb.ts +3 -3
- package/src/capabilities/doctor/runChecks.ts +62 -63
- package/src/capabilities/doctor/types.ts +20 -4
- package/src/capabilities/emptyRecovery.test.ts +13 -8
- package/src/capabilities/graph/examples.exec.test.ts +107 -0
- package/src/capabilities/graph/index.ts +1 -1
- package/src/capabilities/graph/inspect.render.ts +70 -22
- package/src/capabilities/graph/inspect.test.ts +260 -5
- package/src/capabilities/graph/inspect.verb.ts +18 -6
- package/src/capabilities/graph/query.render.ts +15 -3
- package/src/capabilities/graph/query.verb.ts +3 -3
- package/src/capabilities/graph/runQuery.ts +2 -3
- package/src/capabilities/index.ts +3 -1
- package/src/capabilities/info/collectInfo.ts +5 -4
- package/src/capabilities/info/info.render.ts +1 -1
- package/src/capabilities/info/info.verb.ts +1 -1
- package/src/capabilities/lazy.test.ts +32 -0
- package/src/capabilities/meta/complete.verb.ts +1 -1
- package/src/capabilities/meta/index.ts +1 -1
- package/src/capabilities/meta/mcp.verb.ts +10 -8
- package/src/capabilities/ontology/index.ts +15 -11
- package/src/capabilities/ontology/ontology.test.ts +6 -55
- package/src/capabilities/ontology/queries.ts +2 -2
- package/src/capabilities/ontology/render.ts +3 -4
- package/src/capabilities/ontology/verbs.ts +27 -68
- package/src/capabilities/prompt/index.ts +2 -2
- package/src/capabilities/prompt/prompt.render.ts +6 -2
- package/src/capabilities/prompt/types.ts +1 -1
- package/src/capabilities/prompt/verbs.ts +4 -5
- package/src/capabilities/reference.test.ts +63 -0
- package/src/capabilities/resources/provider.ts +342 -85
- package/src/capabilities/resources/resources.test.ts +355 -59
- package/src/capabilities/setup/buildPlan.ts +236 -0
- package/src/capabilities/setup/index.ts +7 -7
- package/src/capabilities/setup/mode.ts +74 -0
- package/src/capabilities/setup/operations/index.ts +74 -0
- package/src/capabilities/setup/operations/setupCompletions.ts +97 -24
- package/src/capabilities/setup/operations/setupConfig.ts +124 -0
- package/src/capabilities/setup/operations/setupGenerator.ts +396 -326
- package/src/capabilities/setup/operations/setupLsp.ts +329 -68
- package/src/capabilities/setup/operations/setupMcp.ts +137 -97
- package/src/capabilities/setup/operations/setupSkills.ts +336 -108
- package/src/capabilities/setup/plan.render.ts +241 -0
- package/src/capabilities/setup/plan.ts +236 -0
- package/src/capabilities/setup/setup.mcp.correctness.test.ts +432 -0
- package/src/capabilities/setup/setup.render.test.ts +281 -73
- package/src/capabilities/setup/setup.render.ts +45 -77
- package/src/capabilities/setup/setup.test.ts +972 -209
- package/src/capabilities/setup/setup.verb.ts +223 -71
- package/src/capabilities/setup/shell.test.ts +86 -0
- package/src/capabilities/setup/shell.ts +137 -11
- package/src/capabilities/setup/targets.ts +367 -0
- package/src/capabilities/setup/types.ts +18 -57
- package/src/capabilities/shared/assertExecOk.ts +68 -10
- package/src/capabilities/shared/index.ts +32 -0
- package/src/capabilities/shared/packageManager.test.ts +55 -0
- package/src/capabilities/shared/packageManager.ts +62 -6
- package/src/capabilities/skill/discover.ts +37 -5
- package/src/capabilities/skill/index.ts +1 -1
- package/src/capabilities/skill/render.ts +10 -9
- package/src/capabilities/skill/skill.test.ts +7 -5
- package/src/capabilities/skill/verbs.ts +3 -4
- package/src/capabilities/sources/collectStatus.ts +7 -2
- package/src/capabilities/sources/index.ts +1 -1
- package/src/capabilities/sources/installSkills.ts +84 -7
- package/src/capabilities/sources/runUpdate.ts +53 -21
- package/src/capabilities/sources/sources.test.ts +154 -2
- package/src/capabilities/sources/status.render.ts +1 -1
- package/src/capabilities/sources/status.verb.ts +1 -1
- package/src/capabilities/sources/update.render.ts +1 -1
- package/src/capabilities/sources/update.verb.ts +1 -1
- package/src/capabilities/surface.test.ts +134 -17
- package/src/capabilities/upgrade/runUpgrade.ts +8 -8
- package/src/capabilities/upgrade/upgrade.render.ts +4 -5
- package/src/capabilities/upgrade/upgrade.test.ts +3 -3
- package/src/capabilities/upgrade/upgrade.verb.ts +1 -1
- package/src/capabilities/version/index.ts +12 -0
- package/src/capabilities/version/version.test.ts +66 -0
- package/src/capabilities/version/version.verb.ts +39 -0
- package/src/constants.ts +31 -1
- package/src/identity.test.ts +40 -25
- package/src/kernel/completion/__snapshots__/emitScripts.test.ts.snap +15 -13
- package/src/kernel/completion/complete.test.ts +12 -2
- package/src/kernel/completion/complete.ts +1 -1
- package/src/kernel/completion/emitScripts.ts +1 -1
- package/src/kernel/completion/entitySource.test.ts +1 -1
- package/src/kernel/completion/entitySource.ts +21 -8
- package/src/kernel/completion/model.test.ts +164 -12
- package/src/kernel/completion/model.ts +94 -14
- package/src/kernel/completion/parse.test.ts +4 -7
- package/src/kernel/completion/parse.ts +15 -0
- package/src/kernel/completion/resolve.test.ts +0 -1
- package/src/kernel/completion/safety.test.ts +34 -26
- package/src/kernel/completion/shellDrive.test.ts +28 -9
- package/src/kernel/completion/templates/bash.ts +7 -2
- package/src/kernel/completion/templates/index.ts +23 -0
- package/src/kernel/completion/types.ts +7 -0
- package/src/kernel/config/defaults.test.ts +25 -2
- package/src/kernel/config/defaults.ts +4 -3
- package/src/kernel/config/evaluateProjectConfig.ts +31 -8
- package/src/kernel/config/firstRun.test.ts +44 -38
- package/src/kernel/config/firstRun.ts +24 -88
- package/src/kernel/config/index.ts +1 -1
- package/src/kernel/config/readConfig.test.ts +6 -3
- package/src/kernel/config/readConfig.ts +1 -1
- package/src/kernel/config/schema.ts +3 -1
- package/src/kernel/config/types.ts +3 -1
- package/src/kernel/copy.test.ts +34 -4
- package/src/kernel/copy.ts +54 -0
- package/src/kernel/error/PragmaError.test.ts +5 -2
- package/src/kernel/error/PragmaError.ts +4 -2
- package/src/kernel/error/constants.ts +7 -5
- package/src/kernel/error/fromTaskError.ts +28 -6
- package/src/kernel/error/recovery.ts +14 -0
- package/src/kernel/error/renderError.ts +42 -1
- package/src/kernel/error/types.ts +21 -1
- package/src/kernel/index.ts +26 -0
- package/src/kernel/packs/collect.ts +12 -16
- package/src/kernel/packs/compile.test.ts +130 -1
- package/src/kernel/packs/compile.ts +93 -3
- package/src/kernel/packs/disclosure.ts +2 -2
- package/src/kernel/packs/graphql/buildLookupDocument.ts +1 -1
- package/src/kernel/packs/graphql/fetchGraphqlLookup.ts +3 -4
- package/src/kernel/packs/graphql/index.ts +20 -0
- package/src/kernel/packs/index.ts +40 -0
- package/src/kernel/packs/iri.test.ts +73 -0
- package/src/kernel/packs/iri.ts +66 -14
- package/src/kernel/packs/renderPack.ts +24 -5
- package/src/kernel/packs/resolveEntity.test.ts +213 -0
- package/src/kernel/packs/resolveEntity.ts +112 -18
- package/src/kernel/packs/runBodies.ts +2 -3
- package/src/kernel/packs/sample.ts +1 -1
- package/src/kernel/packs/schema.ts +18 -1
- package/src/kernel/packs/sparql/applyFilters.ts +16 -17
- package/src/kernel/packs/sparql/buildLookupQuery.ts +75 -3
- package/src/kernel/packs/sparql/index.ts +37 -0
- package/src/kernel/packs/sparql/runSelect.test.ts +1 -1
- package/src/kernel/packs/sparql/runSelect.ts +3 -4
- package/src/kernel/packs/toolDescription.test.ts +42 -3
- package/src/kernel/packs/types.ts +13 -0
- package/src/kernel/packs/uniqueness.ts +1 -1
- package/src/kernel/project/cli/buildProgram.test.ts +147 -12
- package/src/kernel/project/cli/buildProgram.ts +77 -18
- package/src/kernel/project/cli/constants.ts +34 -0
- package/src/kernel/project/cli/dispatch.test.ts +160 -3
- package/src/kernel/project/cli/dispatch.ts +222 -42
- package/src/kernel/project/cli/exitCodes.ts +1 -1
- package/src/kernel/project/cli/globalFlags.test.ts +117 -1
- package/src/kernel/project/cli/globalFlags.ts +130 -30
- package/src/kernel/project/cli/helpFormat.ts +13 -0
- package/src/kernel/project/cli/rootHelp.ts +41 -12
- package/src/kernel/project/cli/suggest.test.ts +33 -1
- package/src/kernel/project/cli/suggest.ts +25 -1
- package/src/kernel/project/cli/verbHelp.test.ts +30 -0
- package/src/kernel/project/cli/verbHelp.ts +23 -7
- package/src/kernel/project/mcp/buildServer.ts +7 -4
- package/src/kernel/project/mcp/envelope.ts +2 -2
- package/src/kernel/project/mcp/instructions.ts +2 -2
- package/src/kernel/project/mcp/mcpError.ts +1 -1
- package/src/kernel/project/mcp/parity.test.ts +5 -2
- package/src/kernel/project/mcp/prompts/index.ts +37 -0
- package/src/kernel/project/mcp/prompts/source.ts +2 -2
- package/src/kernel/project/mcp/registerVerb.ts +35 -9
- package/src/kernel/project/mcp/serve.ts +2 -2
- package/src/kernel/render/__snapshots__/renderers.test.ts.snap +7 -4
- package/src/kernel/render/contracts.ts +21 -0
- package/src/kernel/render/envelope.ts +2 -3
- package/src/kernel/render/formatters.ts +1 -1
- package/src/kernel/render/renderers.test.ts +243 -6
- package/src/kernel/render/renderers.ts +222 -20
- package/src/kernel/render/style.test.ts +75 -24
- package/src/kernel/render/style.ts +31 -1
- package/src/kernel/render/turtle.ts +222 -0
- package/src/kernel/runtime/graphpack/buildIndex.ts +1 -1
- package/src/kernel/runtime/graphpack/embedded/pack.generated.ts +3 -3
- package/src/kernel/runtime/graphpack/embedded/pack.index.generated.ts +1 -1
- package/src/kernel/runtime/graphpack/embedded.ts +3 -3
- package/src/kernel/runtime/graphpack/manifest.ts +1 -1
- package/src/kernel/runtime/graphpack/read.ts +1 -2
- package/src/kernel/runtime/loadSession.ts +1 -1
- package/src/kernel/runtime/probe.ts +6 -6
- package/src/kernel/runtime/readEntity.ts +472 -28
- package/src/kernel/runtime/refs/index.ts +39 -0
- package/src/kernel/runtime/refs/parseRef.ts +2 -2
- package/src/kernel/runtime/refs/resolve.ts +4 -4
- package/src/kernel/runtime/storeReadiness.ts +1 -2
- package/src/kernel/runtime/types.ts +15 -1
- package/src/kernel/runtime/wasmEmbed.test.ts +37 -39
- package/src/kernel/spec/emitReference.ts +105 -30
- package/src/kernel/spec/emitSurface.ts +48 -6
- package/src/kernel/spec/surfaceConformance.test.ts +4 -2
- package/src/kernel/spec/types.ts +248 -4
- package/src/testing/behavioral/docExamples.test.ts +14 -0
- package/src/testing/behavioral/errorMatrix.mcp.test.ts +2 -2
- package/src/testing/behavioral/firstRun.e2e.test.ts +24 -24
- package/src/testing/behavioral/journeys.cli.test.ts +1 -1
- package/src/testing/behavioral/journeys.defaultPack.test.ts +7 -7
- package/src/testing/behavioral/journeys.implementation.test.ts +206 -0
- package/src/testing/behavioral/journeys.interactiveTty.e2e.test.ts +2 -2
- package/src/testing/behavioral/journeys.packageStories.test.ts +4 -4
- package/src/testing/behavioral/mcpServe.e2e.test.ts +57 -2
- package/src/testing/behavioral/mcpSurface.test.ts +1 -1
- package/src/testing/behavioral/rootCli.e2e.test.ts +26 -2
- package/src/testing/eval/cases/effectful.ts +3 -2
- package/src/testing/fixtures/blockGraph.ts +79 -0
- package/src/testing/fixtures/graph/canonical.ts +88 -2
- package/src/testing/fixtures/graph/defaultPack.ts +1 -1
- package/src/testing/helpers/blankCanonicalRanges.ts +36 -0
- package/src/testing/helpers/projectMcp.ts +32 -6
- package/src/testing/helpers/runCli.ts +35 -18
- package/src/testing/perf/budgets.test.ts +20 -9
- package/src/testing/perf/budgets.ts +58 -9
- package/src/testing/perf/codegen.test.ts +126 -0
- package/src/testing/perf/globalSetup.test.ts +286 -0
- package/src/testing/perf/globalSetup.ts +505 -23
- package/src/testing/perf/measure.test.ts +38 -0
- package/src/testing/perf/measure.ts +23 -4
- package/src/testing/setupXdgIsolation.ts +81 -21
- package/src/testing/tempRoot.globalSetup.ts +122 -0
- package/dist/pragma +0 -0
- package/src/capabilities/create/compiledCreate.subprocess.test.ts +0 -189
- package/src/capabilities/create/templates.embedded.generated.ts +0 -28
- package/src/capabilities/doctor/checks/checkConfigFile.ts +0 -42
- package/src/capabilities/doctor/checks/checkMcpCommands.ts +0 -114
- package/src/capabilities/doctor/checks/checkMcpConfigured.ts +0 -68
- package/src/capabilities/doctor/checks/checkSkillsSymlinked.ts +0 -61
- package/src/capabilities/doctor/checks/deriveBand.test.ts +0 -42
- package/src/capabilities/doctor/checks/deriveBand.ts +0 -28
- package/src/kernel/config/__snapshots__/firstRun.test.ts.snap +0 -11
|
@@ -0,0 +1,745 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PROTECTED — the cross-CLI conformance matrix: for every declared generator
|
|
3
|
+
* binding, THREE producers make the same tree from the same answers, byte for
|
|
4
|
+
* byte —
|
|
5
|
+
*
|
|
6
|
+
* (1) the shipped `dist/src/bin.js` entry (`pragma create <path…>`),
|
|
7
|
+
* (2) the REAL summon bin (`summon <path…>`, served the same generator
|
|
8
|
+
* packages through `--generators`), and
|
|
9
|
+
* (3) the conformance REFERENCE (`produceReference` — summon-core `execute`
|
|
10
|
+
* with `autoPrompt` and the shared stamp).
|
|
11
|
+
*
|
|
12
|
+
* THIS FILE IS THE CONTRACT. It replaced a generated prose document whose
|
|
13
|
+
* drift guard compared the emitter's output to itself and so could not fail
|
|
14
|
+
* for any behaviour change — the
|
|
15
|
+
* grammar-derivation rules, the interaction table, and the parity flag set
|
|
16
|
+
* this suite executes. Each producer's argv derives from the SAME fixture
|
|
17
|
+
* answers via `flagizeAnswers`, so the vectors are identical modulo the
|
|
18
|
+
* leading `create` — an argv hand-drift cannot fake parity.
|
|
19
|
+
*
|
|
20
|
+
* Help/flag parity is asserted over the PARITY SET (prompt-derived flags ∪
|
|
21
|
+
* the mutation trio `--dry-run`/`--undo`/`--yes`): each host's declared
|
|
22
|
+
* output extras sit outside the projection by design, and the generator-
|
|
23
|
+
* options sections of the two `--help` pages must agree STRUCTURALLY below
|
|
24
|
+
* the host blocks — same groups, rows, order, defaults; bytes stopped being
|
|
25
|
+
* the surface when pragma took the help seam's presentation half
|
|
26
|
+
* (`generatorStructure` carries the why). Wizard-script parity is asserted
|
|
27
|
+
* on the projection
|
|
28
|
+
* (`pendingPrompts` fidelity, in summon-core), NOT by driving two TUIs.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import { execFileSync, spawnSync } from "node:child_process";
|
|
32
|
+
import {
|
|
33
|
+
existsSync,
|
|
34
|
+
mkdirSync,
|
|
35
|
+
mkdtempSync,
|
|
36
|
+
readdirSync,
|
|
37
|
+
writeFileSync,
|
|
38
|
+
} from "node:fs";
|
|
39
|
+
import { tmpdir } from "node:os";
|
|
40
|
+
import { dirname, join, resolve } from "node:path";
|
|
41
|
+
import { fileURLToPath } from "node:url";
|
|
42
|
+
import {
|
|
43
|
+
CONFORMANCE_FIXTURES,
|
|
44
|
+
diffTrees,
|
|
45
|
+
flagizeAnswers,
|
|
46
|
+
formatTreeDiff,
|
|
47
|
+
isIdentical,
|
|
48
|
+
produceReference,
|
|
49
|
+
snapshotTree,
|
|
50
|
+
type TreeSnapshot,
|
|
51
|
+
} from "@canonical/summon-core/testing";
|
|
52
|
+
import { describe, expect, it } from "vitest";
|
|
53
|
+
import { blankCanonicalRanges } from "../../testing/helpers/blankCanonicalRanges.js";
|
|
54
|
+
import { CREATE_GENERATORS } from "./constants.js";
|
|
55
|
+
|
|
56
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
57
|
+
const repoRoot = resolve(here, "../../../../../..");
|
|
58
|
+
/**
|
|
59
|
+
* The shipped pragma entry. Spawned as `node <entry>` because the distribution
|
|
60
|
+
* emits JavaScript rather than a self-executing binary — so every call site
|
|
61
|
+
* below passes the entry as the runtime's FIRST argument.
|
|
62
|
+
*/
|
|
63
|
+
const pragmaEntry = join(repoRoot, "packages/cli/pragma/dist/src/bin.js");
|
|
64
|
+
const summonBin = join(repoRoot, "packages/cli/summon/src/bin.tsx");
|
|
65
|
+
|
|
66
|
+
const freshCwd = (prefix: string): string =>
|
|
67
|
+
mkdtempSync(join(tmpdir(), prefix));
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A one-file barrel package the summon bin discovers via `--generators`: it
|
|
71
|
+
* re-exports the three BUILT generator maps (`dist/esm`, exactly what a
|
|
72
|
+
* published install serves), merged — so the summon producer runs the same
|
|
73
|
+
* generator code the pragma binary bundles.
|
|
74
|
+
*/
|
|
75
|
+
function writeGeneratorFixture(): string {
|
|
76
|
+
const dir = mkdtempSync(join(tmpdir(), "crosscli-generators-"));
|
|
77
|
+
const dist = (pkg: string): string =>
|
|
78
|
+
`file://${join(repoRoot, "packages/summon", pkg, "dist/esm/index.js")}`;
|
|
79
|
+
writeFileSync(
|
|
80
|
+
join(dir, "package.json"),
|
|
81
|
+
JSON.stringify({ name: "summon-crosscli-fixture", main: "index.js" }),
|
|
82
|
+
);
|
|
83
|
+
writeFileSync(
|
|
84
|
+
join(dir, "index.js"),
|
|
85
|
+
`import { generators as component } from ${JSON.stringify(dist("component"))};
|
|
86
|
+
import { generators as pkg } from ${JSON.stringify(dist("package"))};
|
|
87
|
+
import { generators as application } from ${JSON.stringify(dist("application"))};
|
|
88
|
+
export const generators = { ...component, ...pkg, ...application };
|
|
89
|
+
`,
|
|
90
|
+
);
|
|
91
|
+
return dir;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const generatorsDir = writeGeneratorFixture();
|
|
95
|
+
|
|
96
|
+
/** The declared command path a fixture's logical generator id names. */
|
|
97
|
+
function commandPathOf(fixtureGenerator: string): string {
|
|
98
|
+
if (fixtureGenerator.includes("/")) return fixtureGenerator;
|
|
99
|
+
const binding =
|
|
100
|
+
CREATE_GENERATORS[fixtureGenerator as keyof typeof CREATE_GENERATORS];
|
|
101
|
+
return (binding?.paths[0] ?? fixtureGenerator) as string;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Producer (1): the compiled pragma binary. */
|
|
105
|
+
function producePragma(args: readonly string[]): TreeSnapshot {
|
|
106
|
+
const cwd = freshCwd("crosscli-pragma-");
|
|
107
|
+
execFileSync(process.execPath, [pragmaEntry, "create", ...args], {
|
|
108
|
+
cwd,
|
|
109
|
+
stdio: "pipe",
|
|
110
|
+
input: "",
|
|
111
|
+
});
|
|
112
|
+
return snapshotTree(cwd);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Producer (2): the real summon bin, served the same generators. */
|
|
116
|
+
function produceSummonBin(args: readonly string[]): TreeSnapshot {
|
|
117
|
+
const cwd = freshCwd("crosscli-summon-");
|
|
118
|
+
execFileSync("bun", [summonBin, "--generators", generatorsDir, ...args], {
|
|
119
|
+
cwd,
|
|
120
|
+
stdio: "pipe",
|
|
121
|
+
input: "",
|
|
122
|
+
});
|
|
123
|
+
return snapshotTree(cwd);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Spawn either bin for `--help` (never throws). Returns the combined text
|
|
128
|
+
* AND the exit status: a help page that stopped exiting 0 is a break the
|
|
129
|
+
* text comparison alone cannot see (a blanket exit-2 classification keeps
|
|
130
|
+
* the bytes identical).
|
|
131
|
+
*/
|
|
132
|
+
function helpOf(
|
|
133
|
+
bin: "pragma" | "summon",
|
|
134
|
+
path: readonly string[],
|
|
135
|
+
): { text: string; status: number | null } {
|
|
136
|
+
const cwd = freshCwd("crosscli-help-");
|
|
137
|
+
// Colour explicitly OFF: pragma's help renders through chalk, which
|
|
138
|
+
// honours FORCE_COLOR / CI env vars even piped (nx sets FORCE_COLOR for
|
|
139
|
+
// test tasks), and the structural cells below parse plain bytes. NO_COLOR
|
|
140
|
+
// is the one convention pragma's style seam obeys unconditionally;
|
|
141
|
+
// summon's shared renderer never colours, so its bytes are unaffected.
|
|
142
|
+
// FORCE_COLOR is removed rather than merely overridden — Bun warns on
|
|
143
|
+
// stderr when it sees both, and this helper folds stderr into the text.
|
|
144
|
+
const env = { ...process.env, NO_COLOR: "1" };
|
|
145
|
+
delete env.FORCE_COLOR;
|
|
146
|
+
const result =
|
|
147
|
+
bin === "pragma"
|
|
148
|
+
? spawnSync(
|
|
149
|
+
process.execPath,
|
|
150
|
+
[pragmaEntry, "create", ...path, "--help"],
|
|
151
|
+
{
|
|
152
|
+
cwd,
|
|
153
|
+
encoding: "utf-8",
|
|
154
|
+
input: "",
|
|
155
|
+
env,
|
|
156
|
+
},
|
|
157
|
+
)
|
|
158
|
+
: spawnSync(
|
|
159
|
+
"bun",
|
|
160
|
+
[summonBin, "--generators", generatorsDir, ...path, "--help"],
|
|
161
|
+
{ cwd, encoding: "utf-8", input: "", env },
|
|
162
|
+
);
|
|
163
|
+
return {
|
|
164
|
+
text: `${result.stdout ?? ""}${result.stderr ?? ""}`,
|
|
165
|
+
status: result.status,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** Every `--flag` token of a help page (dedup, sorted). */
|
|
170
|
+
function flagTokens(help: string): string[] {
|
|
171
|
+
return [
|
|
172
|
+
...new Set([...help.matchAll(/--[a-z][a-z-]*/g)].map((m) => m[0])),
|
|
173
|
+
].sort();
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/** One help section: its heading and its `[flags, description]` rows. */
|
|
177
|
+
interface HelpSection {
|
|
178
|
+
readonly heading: string;
|
|
179
|
+
readonly rows: readonly (readonly [flags: string, description: string])[];
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* The STRUCTURE of a help page's generator-option sections: every section
|
|
184
|
+
* below the host's standard-flag block, as heading + `[flags, description]`
|
|
185
|
+
* rows, with the presentation collapsed — the trailing heading colon and the
|
|
186
|
+
* column padding are each renderer's own. Presentation-independent on
|
|
187
|
+
* purpose: byte parity of these sections ended when pragma took the help
|
|
188
|
+
* seam's presentation half (`CommanderHost.renderHelp`) and began rendering
|
|
189
|
+
* the shared structure in its house style — the library decides STRUCTURE,
|
|
190
|
+
* the host effects PRESENTATION (the same split the usage errors pin) — so
|
|
191
|
+
* the parity surface below the host block is the groups, the rows, their
|
|
192
|
+
* order and their defaults, extracted here from each page's own bytes.
|
|
193
|
+
*/
|
|
194
|
+
function generatorStructure(help: string): HelpSection[] {
|
|
195
|
+
const blocks = help
|
|
196
|
+
.split(/\n{2,}/)
|
|
197
|
+
.map((block) => block.split("\n").filter((line) => line !== ""));
|
|
198
|
+
const sections = blocks
|
|
199
|
+
// A section is a non-indented heading over indented rows; the usage and
|
|
200
|
+
// description blocks are single lines and drop out here.
|
|
201
|
+
.filter(
|
|
202
|
+
(block) => block.length > 1 && !(block[0] as string).startsWith(" "),
|
|
203
|
+
)
|
|
204
|
+
.map((block) => ({
|
|
205
|
+
heading: (block[0] as string).replace(/:$/, ""),
|
|
206
|
+
rows: block.slice(1).map((row): [string, string] => {
|
|
207
|
+
const match = row.match(/^\s+(.+?)(?:\s{2,}(.*))?$/);
|
|
208
|
+
return [match?.[1] ?? row.trim(), match?.[2] ?? ""];
|
|
209
|
+
}),
|
|
210
|
+
}));
|
|
211
|
+
// Host flags live above the parity surface by design (each host declares
|
|
212
|
+
// its own standard block).
|
|
213
|
+
const globalAt = sections.findIndex((s) => s.heading === "Global Options");
|
|
214
|
+
return sections.slice(globalAt + 1);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/** The parity flag set: prompt-derived registered flags ∪ the mutation trio. */
|
|
218
|
+
async function paritySet(commandPath: string): Promise<Set<string>> {
|
|
219
|
+
const [{ buildOptionInfo }, { pickGenerator }] = await Promise.all([
|
|
220
|
+
import("@canonical/summon-core/projection"),
|
|
221
|
+
import("./pickGenerator.js"),
|
|
222
|
+
]);
|
|
223
|
+
const set = new Set(["--dry-run", "--undo", "--yes"]);
|
|
224
|
+
for (const prompt of pickGenerator(commandPath).prompts) {
|
|
225
|
+
// EVERY prompt registers a flag — the positional one is accepted both
|
|
226
|
+
// ways (`component react src/X` ≡ `component react --component-path=…`).
|
|
227
|
+
const token = buildOptionInfo(prompt).flags.split(" ")[0] as string;
|
|
228
|
+
set.add(token);
|
|
229
|
+
}
|
|
230
|
+
return set;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/** Each host's declared standard extras, outside the projection by design. */
|
|
234
|
+
const SUMMON_EXTRAS = new Set([
|
|
235
|
+
"--dry-run", // shared (short forms are host spellings of the same trio)
|
|
236
|
+
"--undo",
|
|
237
|
+
"--yes",
|
|
238
|
+
"--verbose",
|
|
239
|
+
"--show-files",
|
|
240
|
+
"--no-preview",
|
|
241
|
+
"--no-generated-stamp",
|
|
242
|
+
"--llm",
|
|
243
|
+
"--format",
|
|
244
|
+
"--help",
|
|
245
|
+
]);
|
|
246
|
+
const PRAGMA_EXTRAS = new Set(["--dry-run", "--undo", "--yes", "--help"]);
|
|
247
|
+
|
|
248
|
+
describe("cross-CLI conformance matrix (PROTECTED)", () => {
|
|
249
|
+
// The matrix is COMPLETE by declaration, not by convention: the two loops
|
|
250
|
+
// below iterate the shared fixture list (a literal in summon-core, whose
|
|
251
|
+
// own docblock says the ids are "conventional, not enforced"), so a SIXTH
|
|
252
|
+
// declared binding path would otherwise add zero byte-equality and
|
|
253
|
+
// help-parity cells, silently, while this describe's header claims "every
|
|
254
|
+
// declared generator binding". This cell closes the loop — and makes
|
|
255
|
+
// `commandPathOf`'s `paths[0]` narrowing explicit: the sort-equality holds
|
|
256
|
+
// only while every path of a multi-path binding is named by a fixture in
|
|
257
|
+
// full (a second `application/*` path with a bare-id fixture would redden
|
|
258
|
+
// here, which is the point).
|
|
259
|
+
it("every declared generator binding path is driven by a conformance fixture", () => {
|
|
260
|
+
expect(
|
|
261
|
+
[...CONFORMANCE_FIXTURES]
|
|
262
|
+
.map((fixture) => commandPathOf(fixture.generator))
|
|
263
|
+
.sort(),
|
|
264
|
+
).toEqual(
|
|
265
|
+
Object.values(CREATE_GENERATORS)
|
|
266
|
+
.flatMap((binding) => binding.paths as readonly string[])
|
|
267
|
+
.sort(),
|
|
268
|
+
);
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
for (const fixture of CONFORMANCE_FIXTURES) {
|
|
272
|
+
it(`${fixture.name}: summon bin ≡ pragma compiled binary ≡ the reference`, async () => {
|
|
273
|
+
const commandPath = commandPathOf(fixture.generator);
|
|
274
|
+
const { pickGenerator } = await import("./pickGenerator.js");
|
|
275
|
+
const generator = pickGenerator(commandPath);
|
|
276
|
+
|
|
277
|
+
// The one argv, derived from the shared answers.
|
|
278
|
+
const args = [
|
|
279
|
+
...commandPath.split("/"),
|
|
280
|
+
...flagizeAnswers(generator.prompts, fixture.answers),
|
|
281
|
+
"--yes",
|
|
282
|
+
];
|
|
283
|
+
|
|
284
|
+
let pragma = producePragma(args);
|
|
285
|
+
let summon = produceSummonBin(args);
|
|
286
|
+
let reference = await produceReference({
|
|
287
|
+
generator,
|
|
288
|
+
answers: fixture.answers,
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
// The application fixture resolves its @canonical/* range through
|
|
292
|
+
// THREE independent `npm view` calls (one per producer); an
|
|
293
|
+
// asymmetric registry outcome is an 11-range spurious red, so the
|
|
294
|
+
// ranges are blanked identically on all three snapshots — this cell
|
|
295
|
+
// proves the template surface, the offline cells own range truth.
|
|
296
|
+
if (fixture.name === "application") {
|
|
297
|
+
pragma = blankCanonicalRanges(pragma);
|
|
298
|
+
summon = blankCanonicalRanges(summon);
|
|
299
|
+
reference = blankCanonicalRanges(reference);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
expect(pragma.size).toBeGreaterThan(0);
|
|
303
|
+
|
|
304
|
+
const pragmaVsSummon = diffTrees(pragma, summon);
|
|
305
|
+
expect(
|
|
306
|
+
isIdentical(pragmaVsSummon),
|
|
307
|
+
formatTreeDiff(pragmaVsSummon, "pragma compiled", "summon bin"),
|
|
308
|
+
).toBe(true);
|
|
309
|
+
|
|
310
|
+
const pragmaVsReference = diffTrees(pragma, reference);
|
|
311
|
+
expect(
|
|
312
|
+
isIdentical(pragmaVsReference),
|
|
313
|
+
formatTreeDiff(pragmaVsReference, "pragma compiled", "the reference"),
|
|
314
|
+
).toBe(true);
|
|
315
|
+
}, 120_000);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
for (const fixture of CONFORMANCE_FIXTURES) {
|
|
319
|
+
it(`${fixture.name}: help/flag parity over the parity set + structurally equal generator sections`, async () => {
|
|
320
|
+
const commandPath = commandPathOf(fixture.generator);
|
|
321
|
+
const path = commandPath.split("/");
|
|
322
|
+
const { text: pragmaHelp, status: pragmaStatus } = helpOf("pragma", path);
|
|
323
|
+
const { text: summonHelp, status: summonStatus } = helpOf("summon", path);
|
|
324
|
+
|
|
325
|
+
// An informational exit stays 0 on BOTH bins — the classification
|
|
326
|
+
// branch nothing else in this suite observes.
|
|
327
|
+
expect(pragmaStatus).toBe(0);
|
|
328
|
+
expect(summonStatus).toBe(0);
|
|
329
|
+
|
|
330
|
+
const parity = await paritySet(commandPath);
|
|
331
|
+
|
|
332
|
+
const pragmaFlags = flagTokens(pragmaHelp).filter(
|
|
333
|
+
(flag) => !PRAGMA_EXTRAS.has(flag),
|
|
334
|
+
);
|
|
335
|
+
const summonFlags = flagTokens(summonHelp).filter(
|
|
336
|
+
(flag) => !SUMMON_EXTRAS.has(flag),
|
|
337
|
+
);
|
|
338
|
+
const expected = [...parity]
|
|
339
|
+
.filter((flag) => !["--dry-run", "--undo", "--yes"].includes(flag))
|
|
340
|
+
.sort();
|
|
341
|
+
expect(pragmaFlags).toEqual(expected);
|
|
342
|
+
expect(summonFlags).toEqual(expected);
|
|
343
|
+
// The trio itself appears on both pages (host spellings aside).
|
|
344
|
+
for (const flag of ["--dry-run", "--undo", "--yes"]) {
|
|
345
|
+
expect(flagTokens(pragmaHelp)).toContain(flag);
|
|
346
|
+
expect(flagTokens(summonHelp)).toContain(flag);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
// The GENERATOR-OPTIONS sections agree STRUCTURALLY below the host
|
|
350
|
+
// blocks (same buildOptionInfo, same groups, same rows, same order,
|
|
351
|
+
// same defaults) — see `generatorStructure` for why bytes are no
|
|
352
|
+
// longer the surface. Non-empty first, so a parser that extracted
|
|
353
|
+
// nothing from both pages cannot green the cell vacuously.
|
|
354
|
+
const pragmaStructure = generatorStructure(pragmaHelp);
|
|
355
|
+
expect(pragmaStructure.length).toBeGreaterThan(0);
|
|
356
|
+
expect(pragmaStructure).toEqual(generatorStructure(summonHelp));
|
|
357
|
+
}, 60_000);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// The refusal cell (row 6) is shared byte for byte: a bare non-TTY leaf
|
|
361
|
+
// refuses in BOTH bins with the same message and exit 2. Host framing
|
|
362
|
+
// exists ONLY under pragma's explicitly requested `--format json`/`--format
|
|
363
|
+
// llm` — never requested here — so picking the refusal line is a
|
|
364
|
+
// convenience, not a normalization; the full-stderr cell below pins the
|
|
365
|
+
// stronger byte fact for the default piped mode.
|
|
366
|
+
const refusalLine = (stderr: string): string | undefined =>
|
|
367
|
+
stderr.split("\n").find((line) => line.startsWith("Refusing to scaffold"));
|
|
368
|
+
|
|
369
|
+
for (const commandPath of Object.values(CREATE_GENERATORS).flatMap(
|
|
370
|
+
(binding) => binding.paths,
|
|
371
|
+
)) {
|
|
372
|
+
it(`${commandPath}: both bins refuse a bare non-TTY leaf with the same bytes, exit 2`, () => {
|
|
373
|
+
const path = commandPath.split("/");
|
|
374
|
+
const pragma = spawnSync(
|
|
375
|
+
process.execPath,
|
|
376
|
+
[pragmaEntry, "create", ...path],
|
|
377
|
+
{
|
|
378
|
+
cwd: freshCwd("crosscli-refuse-"),
|
|
379
|
+
encoding: "utf-8",
|
|
380
|
+
input: "",
|
|
381
|
+
},
|
|
382
|
+
);
|
|
383
|
+
const summon = spawnSync(
|
|
384
|
+
"bun",
|
|
385
|
+
[summonBin, "--generators", generatorsDir, ...path],
|
|
386
|
+
{ cwd: freshCwd("crosscli-refuse-"), encoding: "utf-8", input: "" },
|
|
387
|
+
);
|
|
388
|
+
expect(pragma.status).toBe(2);
|
|
389
|
+
expect(summon.status).toBe(2);
|
|
390
|
+
const pragmaRefusal = refusalLine(pragma.stderr ?? "");
|
|
391
|
+
expect(pragmaRefusal).toBeDefined();
|
|
392
|
+
expect(pragmaRefusal).toContain("Missing: --");
|
|
393
|
+
expect(pragmaRefusal).toBe(refusalLine(summon.stderr ?? ""));
|
|
394
|
+
}, 60_000);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// The retired ssr/router pair: `application/react` no longer declares the
|
|
398
|
+
// two prompts (SSR and the router are always-on facts — the old guard
|
|
399
|
+
// rejected the ONLY explicit spelling the refusal could name, a closed
|
|
400
|
+
// loop), so `--no-ssr` is an unknown option — Commander's DEFAULT usage
|
|
401
|
+
// error, byte-identical in both hosts (contract §2), exit 2, nothing
|
|
402
|
+
// written. The typed GENERATOR_INVALID_ANSWER pathway the guard used to
|
|
403
|
+
// exercise stays covered per-host by fixture generators
|
|
404
|
+
// (kernel/error/fromTaskError.test.ts, cli/summon's
|
|
405
|
+
// App.invalidAnswer.test.tsx + interaction.subprocess.test.ts) — no
|
|
406
|
+
// shipped generator raises it today.
|
|
407
|
+
it("application/react: the retired --no-ssr is an unknown option with IDENTICAL bytes in both hosts, exit 2, nothing written", () => {
|
|
408
|
+
// Full-stderr compare, so — as in every sibling whole-buffer cell —
|
|
409
|
+
// pragma's one-time first-run note (stderr by design) is kept off by
|
|
410
|
+
// seeding the global config it would otherwise create; unseeded, the
|
|
411
|
+
// cell is green only while an EARLIER cell in this file has already
|
|
412
|
+
// spent the note (red under `-t` isolation).
|
|
413
|
+
const configHome = mkdtempSync(join(tmpdir(), "crosscli-cfg-"));
|
|
414
|
+
mkdirSync(join(configHome, "pragma"));
|
|
415
|
+
writeFileSync(join(configHome, "pragma", "config.json"), "{}\n");
|
|
416
|
+
const pragmaCwd = freshCwd("crosscli-guard-");
|
|
417
|
+
const pragma = spawnSync(
|
|
418
|
+
process.execPath,
|
|
419
|
+
[
|
|
420
|
+
pragmaEntry,
|
|
421
|
+
"create",
|
|
422
|
+
"application",
|
|
423
|
+
"react",
|
|
424
|
+
"my-app",
|
|
425
|
+
"--no-ssr",
|
|
426
|
+
"--dry-run",
|
|
427
|
+
],
|
|
428
|
+
{
|
|
429
|
+
cwd: pragmaCwd,
|
|
430
|
+
encoding: "utf-8",
|
|
431
|
+
input: "",
|
|
432
|
+
env: { ...process.env, XDG_CONFIG_HOME: configHome },
|
|
433
|
+
},
|
|
434
|
+
);
|
|
435
|
+
expect(pragma.status).toBe(2);
|
|
436
|
+
expect(pragma.stderr).toContain("error: unknown option '--no-ssr'");
|
|
437
|
+
expect(readdirSync(pragmaCwd)).toEqual([]);
|
|
438
|
+
|
|
439
|
+
const summonCwd = freshCwd("crosscli-guard-");
|
|
440
|
+
const summon = spawnSync(
|
|
441
|
+
"bun",
|
|
442
|
+
[
|
|
443
|
+
summonBin,
|
|
444
|
+
"--generators",
|
|
445
|
+
generatorsDir,
|
|
446
|
+
"application",
|
|
447
|
+
"react",
|
|
448
|
+
"my-app",
|
|
449
|
+
"--no-ssr",
|
|
450
|
+
"--dry-run",
|
|
451
|
+
],
|
|
452
|
+
{ cwd: summonCwd, encoding: "utf-8", input: "" },
|
|
453
|
+
);
|
|
454
|
+
expect(summon.status).toBe(2);
|
|
455
|
+
expect(summon.stderr).toBe(pragma.stderr);
|
|
456
|
+
expect(readdirSync(summonCwd)).toEqual([]);
|
|
457
|
+
}, 60_000);
|
|
458
|
+
|
|
459
|
+
// The same refusal for an invalid EXPLICIT answer under `--yes` (run mode):
|
|
460
|
+
// validation runs before any UI or write in both hosts — downstream of the
|
|
461
|
+
// refuse decision (the cross-CLI matrix) — so neither may scaffold a tree
|
|
462
|
+
// carrying the invalid value. Before the hoist, summon validated only in
|
|
463
|
+
// the batch arms — `--dry-run` refused while a plain `--yes` run scaffolded
|
|
464
|
+
// `./Bad Name!/` with the broken name in its package.json.
|
|
465
|
+
const invalidValueLine = (stderr: string): string | undefined =>
|
|
466
|
+
stderr.split("\n").find((line) => line.startsWith("Invalid --"));
|
|
467
|
+
|
|
468
|
+
it("package: an invalid explicit --name under --yes refuses in both bins with the same line, exit 2, nothing written", () => {
|
|
469
|
+
const args = [
|
|
470
|
+
"package",
|
|
471
|
+
"--name",
|
|
472
|
+
"Bad Name!",
|
|
473
|
+
"--type",
|
|
474
|
+
"library",
|
|
475
|
+
"--description",
|
|
476
|
+
"A library.",
|
|
477
|
+
"--no-run-install",
|
|
478
|
+
"--yes",
|
|
479
|
+
];
|
|
480
|
+
const pragmaCwd = freshCwd("crosscli-invalid-");
|
|
481
|
+
const pragma = spawnSync(
|
|
482
|
+
process.execPath,
|
|
483
|
+
[pragmaEntry, "create", ...args],
|
|
484
|
+
{
|
|
485
|
+
cwd: pragmaCwd,
|
|
486
|
+
encoding: "utf-8",
|
|
487
|
+
input: "",
|
|
488
|
+
},
|
|
489
|
+
);
|
|
490
|
+
expect(pragma.status).toBe(2);
|
|
491
|
+
expect(pragma.stderr).toContain("INVALID_INPUT");
|
|
492
|
+
const pragmaInvalid = invalidValueLine(pragma.stderr ?? "");
|
|
493
|
+
expect(pragmaInvalid).toBeDefined();
|
|
494
|
+
expect(pragmaInvalid).toContain('Invalid --name "Bad Name!"');
|
|
495
|
+
expect(readdirSync(pragmaCwd)).toEqual([]);
|
|
496
|
+
|
|
497
|
+
const summonCwd = freshCwd("crosscli-invalid-");
|
|
498
|
+
const summon = spawnSync(
|
|
499
|
+
"bun",
|
|
500
|
+
[summonBin, "--generators", generatorsDir, ...args],
|
|
501
|
+
{ cwd: summonCwd, encoding: "utf-8", input: "" },
|
|
502
|
+
);
|
|
503
|
+
expect(summon.status).toBe(2);
|
|
504
|
+
// The bare shared line is summon's WHOLE stderr — byte-stable with the
|
|
505
|
+
// batch arms' wording, and byte-agreeing with pragma's core message.
|
|
506
|
+
expect(summon.stderr).toBe(`${pragmaInvalid}\n`);
|
|
507
|
+
expect(readdirSync(summonCwd)).toEqual([]);
|
|
508
|
+
}, 60_000);
|
|
509
|
+
|
|
510
|
+
// An output path that ESCAPES the invocation cwd fails the SHARED
|
|
511
|
+
// prompt-validate gate in both hosts: `appPath`'s own `validate` (like
|
|
512
|
+
// `componentPath`'s) rejects `..` traversal and absolute paths, so the two
|
|
513
|
+
// bins agree on the validation line, exit 2, and write NOTHING — before
|
|
514
|
+
// the fix summon exited 0 and scaffolded 75 entries outside the workspace
|
|
515
|
+
// where pragma's SEC-2 jail refused. The jail is now the host-level
|
|
516
|
+
// backstop behind this shared tier; its symlink-resolution check stays
|
|
517
|
+
// pragma-only (the cross-CLI matrix, a named follow-up — deliberately no
|
|
518
|
+
// cell pins that divergence).
|
|
519
|
+
it("application/react: a ../ escape fails the shared validator in both bins — exit 2, nothing written outside", () => {
|
|
520
|
+
const args = [
|
|
521
|
+
"application",
|
|
522
|
+
"react",
|
|
523
|
+
"../outside/app",
|
|
524
|
+
"--yes",
|
|
525
|
+
"--no-run-install",
|
|
526
|
+
];
|
|
527
|
+
const pragmaBase = freshCwd("crosscli-escape-");
|
|
528
|
+
mkdirSync(join(pragmaBase, "inner"));
|
|
529
|
+
const pragma = spawnSync(
|
|
530
|
+
process.execPath,
|
|
531
|
+
[pragmaEntry, "create", ...args],
|
|
532
|
+
{
|
|
533
|
+
cwd: join(pragmaBase, "inner"),
|
|
534
|
+
encoding: "utf-8",
|
|
535
|
+
input: "",
|
|
536
|
+
},
|
|
537
|
+
);
|
|
538
|
+
expect(pragma.status).toBe(2);
|
|
539
|
+
expect(pragma.stderr).toContain("INVALID_INPUT");
|
|
540
|
+
const pragmaInvalid = invalidValueLine(pragma.stderr ?? "");
|
|
541
|
+
expect(pragmaInvalid).toBeDefined();
|
|
542
|
+
expect(pragmaInvalid).toContain('Invalid --app-path "../outside/app"');
|
|
543
|
+
expect(readdirSync(pragmaBase)).toEqual(["inner"]);
|
|
544
|
+
expect(readdirSync(join(pragmaBase, "inner"))).toEqual([]);
|
|
545
|
+
|
|
546
|
+
const summonBase = freshCwd("crosscli-escape-");
|
|
547
|
+
mkdirSync(join(summonBase, "inner"));
|
|
548
|
+
const summon = spawnSync(
|
|
549
|
+
"bun",
|
|
550
|
+
[summonBin, "--generators", generatorsDir, ...args],
|
|
551
|
+
{ cwd: join(summonBase, "inner"), encoding: "utf-8", input: "" },
|
|
552
|
+
);
|
|
553
|
+
expect(summon.status).toBe(2);
|
|
554
|
+
expect(summon.stderr).toBe(`${pragmaInvalid}\n`);
|
|
555
|
+
expect(readdirSync(summonBase)).toEqual(["inner"]);
|
|
556
|
+
expect(readdirSync(join(summonBase, "inner"))).toEqual([]);
|
|
557
|
+
}, 60_000);
|
|
558
|
+
|
|
559
|
+
it("application/react: an absolute path fails the shared validator in both bins — exit 2, target never created", () => {
|
|
560
|
+
const target = join(freshCwd("crosscli-escape-abs-"), "abs-app");
|
|
561
|
+
const args = ["application", "react", target, "--yes", "--no-run-install"];
|
|
562
|
+
const pragmaCwd = freshCwd("crosscli-escape-");
|
|
563
|
+
const pragma = spawnSync(
|
|
564
|
+
process.execPath,
|
|
565
|
+
[pragmaEntry, "create", ...args],
|
|
566
|
+
{
|
|
567
|
+
cwd: pragmaCwd,
|
|
568
|
+
encoding: "utf-8",
|
|
569
|
+
input: "",
|
|
570
|
+
},
|
|
571
|
+
);
|
|
572
|
+
expect(pragma.status).toBe(2);
|
|
573
|
+
expect(pragma.stderr).toContain("INVALID_INPUT");
|
|
574
|
+
const pragmaInvalid = invalidValueLine(pragma.stderr ?? "");
|
|
575
|
+
expect(pragmaInvalid).toBeDefined();
|
|
576
|
+
expect(pragmaInvalid).toContain(`Invalid --app-path "${target}"`);
|
|
577
|
+
expect(existsSync(target)).toBe(false);
|
|
578
|
+
expect(readdirSync(pragmaCwd)).toEqual([]);
|
|
579
|
+
|
|
580
|
+
const summonCwd = freshCwd("crosscli-escape-");
|
|
581
|
+
const summon = spawnSync(
|
|
582
|
+
"bun",
|
|
583
|
+
[summonBin, "--generators", generatorsDir, ...args],
|
|
584
|
+
{ cwd: summonCwd, encoding: "utf-8", input: "" },
|
|
585
|
+
);
|
|
586
|
+
expect(summon.status).toBe(2);
|
|
587
|
+
expect(summon.stderr).toBe(`${pragmaInvalid}\n`);
|
|
588
|
+
expect(existsSync(target)).toBe(false);
|
|
589
|
+
expect(readdirSync(summonCwd)).toEqual([]);
|
|
590
|
+
}, 60_000);
|
|
591
|
+
|
|
592
|
+
it("component/react: the DEFAULT piped refusal matches on FULL stderr — no envelope on either side", () => {
|
|
593
|
+
// The whole stream, not a picked line: with the refusal line as the only
|
|
594
|
+
// bytes either bin writes, a framing line appearing on EITHER side breaks
|
|
595
|
+
// this cell. Pragma's one-time first-run note (stderr by design) is kept
|
|
596
|
+
// off by seeding the global config it would otherwise create.
|
|
597
|
+
const configHome = mkdtempSync(join(tmpdir(), "crosscli-cfg-"));
|
|
598
|
+
mkdirSync(join(configHome, "pragma"));
|
|
599
|
+
writeFileSync(join(configHome, "pragma", "config.json"), "{}\n");
|
|
600
|
+
const pragma = spawnSync(
|
|
601
|
+
process.execPath,
|
|
602
|
+
[pragmaEntry, "create", "component", "react"],
|
|
603
|
+
{
|
|
604
|
+
cwd: freshCwd("crosscli-refuse-"),
|
|
605
|
+
encoding: "utf-8",
|
|
606
|
+
input: "",
|
|
607
|
+
env: { ...process.env, XDG_CONFIG_HOME: configHome },
|
|
608
|
+
},
|
|
609
|
+
);
|
|
610
|
+
const summon = spawnSync(
|
|
611
|
+
"bun",
|
|
612
|
+
[summonBin, "--generators", generatorsDir, "component", "react"],
|
|
613
|
+
{ cwd: freshCwd("crosscli-refuse-"), encoding: "utf-8", input: "" },
|
|
614
|
+
);
|
|
615
|
+
expect(pragma.status).toBe(2);
|
|
616
|
+
expect(summon.status).toBe(2);
|
|
617
|
+
expect(pragma.stderr.startsWith("Refusing to scaffold")).toBe(true);
|
|
618
|
+
expect(pragma.stderr).toBe(summon.stderr);
|
|
619
|
+
}, 60_000);
|
|
620
|
+
|
|
621
|
+
// The refuse row WINS over invalid input: an invalid explicit answer with
|
|
622
|
+
// an INCOMPLETE answer set, non-TTY, no mode flag, must refuse — not
|
|
623
|
+
// validate first. Pragma's mount decides (and refuses) before the create
|
|
624
|
+
// runtime loads, so it CANNOT validate first; summon mirrors that order.
|
|
625
|
+
// One vector per invalid-value class (validateAnswers has exactly two):
|
|
626
|
+
// component/react drives a `validate` rejection (that leaf has no select),
|
|
627
|
+
// package drives a value outside a select's choices. Full stderr, nothing
|
|
628
|
+
// written, in both.
|
|
629
|
+
const refuseRowVectors: ReadonlyArray<{
|
|
630
|
+
name: string;
|
|
631
|
+
args: readonly string[];
|
|
632
|
+
}> = [
|
|
633
|
+
// `not-pascal` fails componentPath's own `validate`; the three confirm
|
|
634
|
+
// answers are missing, so the run is incomplete — the refuse row.
|
|
635
|
+
{
|
|
636
|
+
name: "component/react (validate class)",
|
|
637
|
+
args: ["component", "react", "not-pascal"],
|
|
638
|
+
},
|
|
639
|
+
// `bogus` sits outside packageType's choices; name/description are
|
|
640
|
+
// missing, so the run is incomplete — the refuse row wins here too.
|
|
641
|
+
{ name: "package (select class)", args: ["package", "--type", "bogus"] },
|
|
642
|
+
];
|
|
643
|
+
|
|
644
|
+
for (const vector of refuseRowVectors) {
|
|
645
|
+
it(`${vector.name}: an invalid explicit answer with INCOMPLETE input refuses — full stderr byte-identical, exit 2`, () => {
|
|
646
|
+
const configHome = mkdtempSync(join(tmpdir(), "crosscli-cfg-"));
|
|
647
|
+
mkdirSync(join(configHome, "pragma"));
|
|
648
|
+
writeFileSync(join(configHome, "pragma", "config.json"), "{}\n");
|
|
649
|
+
const pragmaCwd = freshCwd("crosscli-refuse-");
|
|
650
|
+
const pragma = spawnSync(
|
|
651
|
+
process.execPath,
|
|
652
|
+
[pragmaEntry, "create", ...vector.args],
|
|
653
|
+
{
|
|
654
|
+
cwd: pragmaCwd,
|
|
655
|
+
encoding: "utf-8",
|
|
656
|
+
input: "",
|
|
657
|
+
env: { ...process.env, XDG_CONFIG_HOME: configHome },
|
|
658
|
+
},
|
|
659
|
+
);
|
|
660
|
+
const summonCwd = freshCwd("crosscli-refuse-");
|
|
661
|
+
const summon = spawnSync(
|
|
662
|
+
"bun",
|
|
663
|
+
[summonBin, "--generators", generatorsDir, ...vector.args],
|
|
664
|
+
{ cwd: summonCwd, encoding: "utf-8", input: "" },
|
|
665
|
+
);
|
|
666
|
+
expect(pragma.status).toBe(2);
|
|
667
|
+
expect(summon.status).toBe(2);
|
|
668
|
+
expect(pragma.stderr.startsWith("Refusing to scaffold")).toBe(true);
|
|
669
|
+
expect(pragma.stderr).not.toContain("Invalid --");
|
|
670
|
+
expect(pragma.stderr).toBe(summon.stderr);
|
|
671
|
+
expect(readdirSync(pragmaCwd)).toEqual([]);
|
|
672
|
+
expect(readdirSync(summonCwd)).toEqual([]);
|
|
673
|
+
}, 60_000);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// The last unaligned member of Commander's usage-error trio: the shared
|
|
677
|
+
// excess-positional path and the bare-namespace help already agree; an
|
|
678
|
+
// unknown option exited 2 in pragma (its bin maps every parse failure)
|
|
679
|
+
// but 1 in summon (no exitOverride — Commander's own code stood).
|
|
680
|
+
it("component/react: an unknown option exits 2 in BOTH bins with the same error line", () => {
|
|
681
|
+
// Seed pragma's global config (as the full-stderr cells do) so its
|
|
682
|
+
// one-time first-run note does not precede the error line.
|
|
683
|
+
const configHome = mkdtempSync(join(tmpdir(), "crosscli-cfg-"));
|
|
684
|
+
mkdirSync(join(configHome, "pragma"));
|
|
685
|
+
writeFileSync(join(configHome, "pragma", "config.json"), "{}\n");
|
|
686
|
+
const args = ["component", "react", "src/components/Foo", "--bogus"];
|
|
687
|
+
const pragma = spawnSync(
|
|
688
|
+
process.execPath,
|
|
689
|
+
[pragmaEntry, "create", ...args],
|
|
690
|
+
{
|
|
691
|
+
cwd: freshCwd("crosscli-unknown-"),
|
|
692
|
+
encoding: "utf-8",
|
|
693
|
+
input: "",
|
|
694
|
+
env: { ...process.env, XDG_CONFIG_HOME: configHome },
|
|
695
|
+
},
|
|
696
|
+
);
|
|
697
|
+
const summon = spawnSync(
|
|
698
|
+
"bun",
|
|
699
|
+
[summonBin, "--generators", generatorsDir, ...args],
|
|
700
|
+
{ cwd: freshCwd("crosscli-unknown-"), encoding: "utf-8", input: "" },
|
|
701
|
+
);
|
|
702
|
+
expect(pragma.status).toBe(2);
|
|
703
|
+
expect(summon.status).toBe(2);
|
|
704
|
+
const line = "error: unknown option '--bogus'";
|
|
705
|
+
expect(pragma.stderr.split("\n")[0]).toBe(line);
|
|
706
|
+
expect(summon.stderr.split("\n")[0]).toBe(line);
|
|
707
|
+
}, 60_000);
|
|
708
|
+
|
|
709
|
+
// The unknown NAMESPACE segment is ONE grammar in both hosts: the shared
|
|
710
|
+
// `Did you mean '<chain> <segment>'?` form the excess-positional path
|
|
711
|
+
// already uses, owned by the projection — pragma's mount no longer
|
|
712
|
+
// re-implements the line and summon no longer falls to Commander's
|
|
713
|
+
// `(Did you mean react?)`. Full stderr per host: only the chain differs,
|
|
714
|
+
// naming each host's real invocation.
|
|
715
|
+
it("component reakt: the unknown-segment error carries the SHARED did-you-mean in both bins, exit 2", () => {
|
|
716
|
+
const configHome = mkdtempSync(join(tmpdir(), "crosscli-cfg-"));
|
|
717
|
+
mkdirSync(join(configHome, "pragma"));
|
|
718
|
+
writeFileSync(join(configHome, "pragma", "config.json"), "{}\n");
|
|
719
|
+
const pragma = spawnSync(
|
|
720
|
+
process.execPath,
|
|
721
|
+
[pragmaEntry, "create", "component", "reakt"],
|
|
722
|
+
{
|
|
723
|
+
cwd: freshCwd("crosscli-unknown-"),
|
|
724
|
+
encoding: "utf-8",
|
|
725
|
+
input: "",
|
|
726
|
+
env: { ...process.env, XDG_CONFIG_HOME: configHome },
|
|
727
|
+
},
|
|
728
|
+
);
|
|
729
|
+
const summon = spawnSync(
|
|
730
|
+
"bun",
|
|
731
|
+
[summonBin, "--generators", generatorsDir, "component", "reakt"],
|
|
732
|
+
{ cwd: freshCwd("crosscli-unknown-"), encoding: "utf-8", input: "" },
|
|
733
|
+
);
|
|
734
|
+
expect(pragma.status).toBe(2);
|
|
735
|
+
expect(summon.status).toBe(2);
|
|
736
|
+
expect(pragma.stderr).toBe(
|
|
737
|
+
"error: unknown command 'reakt'\n" +
|
|
738
|
+
"Did you mean 'pragma create component react'?\n",
|
|
739
|
+
);
|
|
740
|
+
expect(summon.stderr).toBe(
|
|
741
|
+
"error: unknown command 'reakt'\n" +
|
|
742
|
+
"Did you mean 'summon component react'?\n",
|
|
743
|
+
);
|
|
744
|
+
}, 60_000);
|
|
745
|
+
});
|