@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,216 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global-flag pre-parsing, ahead of Commander.
|
|
3
|
+
*
|
|
4
|
+
* `--format`, `--verbose`, `--no-headers`, and `--detail` may appear anywhere on the line, so
|
|
5
|
+
* they are scanned and stripped before Commander sees argv — otherwise
|
|
6
|
+
* `enablePositionalOptions()` scoping would reject a flag placed after a verb.
|
|
7
|
+
*
|
|
8
|
+
* ANYWHERE STOPS AT `--`. Everything after the option terminator is the user's
|
|
9
|
+
* data, not this program's flags: `block lookup -- --format` looks up a block
|
|
10
|
+
* literally named `--format`. Commander honours the terminator on its own, so
|
|
11
|
+
* a scan here that ignored it would parse — and strip — tokens Commander was
|
|
12
|
+
* about to hand through verbatim.
|
|
13
|
+
*
|
|
14
|
+
* A FLAG'S VALUE IS NEVER ANOTHER FLAG. `--detail --category css` supplies no
|
|
15
|
+
* detail; it is a valueless `--detail` followed by a separate flag. Reading the
|
|
16
|
+
* next token unconditionally would consume `--category` as the value and strip
|
|
17
|
+
* it, so the filter would vanish and the command would answer over the whole
|
|
18
|
+
* set instead — a wrong answer with no diagnostic.
|
|
19
|
+
* Ported from the v1 `parseGlobalFlags`, with two v2 changes: a new `--detail`
|
|
20
|
+
* flag and the `--format text` value replaced by `plain` (the kernel's
|
|
21
|
+
* {@link OutputFormat}) — `text` is not accepted; the bin rejects it with the
|
|
22
|
+
* valid list. The dedicated `--llm` flag was folded into `--format llm`,
|
|
23
|
+
* leaving auto-detection as the sole implicit trigger. Both the space
|
|
24
|
+
* (`--format json`) and equals (`--format=json`) forms are recognized.
|
|
25
|
+
*/
|
|
26
|
+
import { DETAIL_LEVELS } from "../../../constants.js";
|
|
27
|
+
/** The end-of-options separator: nothing after it is a flag of this program. */
|
|
28
|
+
const OPTION_TERMINATOR = "--";
|
|
29
|
+
/**
|
|
30
|
+
* The span of argv this program's flags may occupy — everything before the
|
|
31
|
+
* option terminator, or all of argv when there is none. Exported for the
|
|
32
|
+
* bin's retired-flag detection: a retired spelling AFTER the terminator is
|
|
33
|
+
* an operand, not a flag, and must not trigger a migration message.
|
|
34
|
+
*
|
|
35
|
+
* @param argv - The user's arguments.
|
|
36
|
+
* @returns The scannable span; the same array when no terminator is present.
|
|
37
|
+
*/
|
|
38
|
+
export function selectScanSpan(argv) {
|
|
39
|
+
const terminator = argv.indexOf(OPTION_TERMINATOR);
|
|
40
|
+
return terminator === -1 ? argv : argv.slice(0, terminator);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Whether a token can serve as a flag's value.
|
|
44
|
+
*
|
|
45
|
+
* A token starting with `-` is the next flag, not this one's value. Shared by
|
|
46
|
+
* every reader below so the space form cannot swallow a sibling flag at one
|
|
47
|
+
* call site while guarding against it at another.
|
|
48
|
+
*
|
|
49
|
+
* @param token - The token following a flag, if any.
|
|
50
|
+
* @returns True when the token is a value rather than another flag.
|
|
51
|
+
*/
|
|
52
|
+
function isFlagValue(token) {
|
|
53
|
+
return token !== undefined && !token.startsWith("-");
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Read a `--flag`'s value, accepting both `--flag value` and `--flag=value`.
|
|
57
|
+
*
|
|
58
|
+
* @param argv - Raw argv (already sliced to the user's arguments).
|
|
59
|
+
* @param flag - The flag including leading dashes (e.g. `--format`).
|
|
60
|
+
* @returns The value, or `undefined` when the flag is absent.
|
|
61
|
+
*/
|
|
62
|
+
function readFlagValue(argv, flag) {
|
|
63
|
+
const span = selectScanSpan(argv);
|
|
64
|
+
const equalsPrefix = `${flag}=`;
|
|
65
|
+
const equalsArg = span.find((arg) => arg.startsWith(equalsPrefix));
|
|
66
|
+
if (equalsArg !== undefined) {
|
|
67
|
+
return equalsArg.slice(equalsPrefix.length);
|
|
68
|
+
}
|
|
69
|
+
const spaceIndex = span.indexOf(flag);
|
|
70
|
+
if (spaceIndex === -1)
|
|
71
|
+
return undefined;
|
|
72
|
+
const value = span.at(spaceIndex + 1);
|
|
73
|
+
return isFlagValue(value) ? value : undefined;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Read a value flag's raw value exactly as typed, for validation.
|
|
77
|
+
*
|
|
78
|
+
* Unlike {@link parseGlobalFlags} this does not normalize — the caller decides
|
|
79
|
+
* how to reject an unknown value. A bare flag with no following value is
|
|
80
|
+
* reported as `""` (not `undefined`) so it is rejected rather than silently
|
|
81
|
+
* falling through. One reader for every validated global value flag, so a
|
|
82
|
+
* guard applied to one cannot silently miss its siblings.
|
|
83
|
+
*
|
|
84
|
+
* @param argv - Raw argv (the user's arguments).
|
|
85
|
+
* @param flag - The flag including leading dashes (e.g. `--format`).
|
|
86
|
+
* @returns The raw value, `""` for a valueless flag, or `undefined`.
|
|
87
|
+
*/
|
|
88
|
+
function readRawFlag(argv, flag) {
|
|
89
|
+
const span = selectScanSpan(argv);
|
|
90
|
+
const equalsPrefix = `${flag}=`;
|
|
91
|
+
const equalsArg = span.find((arg) => arg.startsWith(equalsPrefix));
|
|
92
|
+
if (equalsArg !== undefined)
|
|
93
|
+
return equalsArg.slice(equalsPrefix.length);
|
|
94
|
+
const spaceIndex = span.indexOf(flag);
|
|
95
|
+
if (spaceIndex === -1)
|
|
96
|
+
return undefined;
|
|
97
|
+
// `""` rather than `undefined`: a valueless flag must be REJECTED by the
|
|
98
|
+
// caller, not fall through to the default.
|
|
99
|
+
const value = span.at(spaceIndex + 1);
|
|
100
|
+
return isFlagValue(value) ? value : "";
|
|
101
|
+
}
|
|
102
|
+
/** The raw `--format` value as typed (see {@link readRawFlag}). */
|
|
103
|
+
export function readRawFormat(argv) {
|
|
104
|
+
return readRawFlag(argv, "--format");
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The raw `--detail` value as typed (see {@link readRawFlag}). Validated by
|
|
108
|
+
* the bin exactly as `--format` is — an unrecognized level used to be
|
|
109
|
+
* dropped silently, which is the same defect class as a filter that
|
|
110
|
+
* evaporates: wrong output with no diagnostic.
|
|
111
|
+
*/
|
|
112
|
+
export function readRawDetail(argv) {
|
|
113
|
+
return readRawFlag(argv, "--detail");
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The `--verbose=<x>` token, if present. `--verbose` takes no value — one
|
|
117
|
+
* flag, one spelling — and the program must not accept-and-ignore a second
|
|
118
|
+
* one: the bin rejects the token this finds.
|
|
119
|
+
*
|
|
120
|
+
* @param argv - Raw argv (the user's arguments).
|
|
121
|
+
* @returns The offending token, or `undefined`.
|
|
122
|
+
*/
|
|
123
|
+
export function findValuedVerbose(argv) {
|
|
124
|
+
return selectScanSpan(argv).find((arg) => arg.startsWith("--verbose="));
|
|
125
|
+
}
|
|
126
|
+
/** Read the real stdout/env output environment. @note Impure — reads process. */
|
|
127
|
+
function readOutputEnvironment() {
|
|
128
|
+
return {
|
|
129
|
+
isTty: process.stdout.isTTY === true,
|
|
130
|
+
noAutoLlm: Boolean(process.env.PRAGMA_NO_AUTO_LLM),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
/** Narrow a raw `--detail` value to a recognized level, else `undefined`. */
|
|
134
|
+
function readDetail(argv) {
|
|
135
|
+
const raw = readFlagValue(argv, "--detail");
|
|
136
|
+
if (raw !== undefined && DETAIL_LEVELS.includes(raw)) {
|
|
137
|
+
return raw;
|
|
138
|
+
}
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Extract the global flags from raw argv (the user's arguments, argv[2:]).
|
|
143
|
+
*
|
|
144
|
+
* Auto-LLM: with no explicit `--format` and a non-interactive stdout (piped or
|
|
145
|
+
* redirected — the shape an agent captures), `llm` defaults to true so agents
|
|
146
|
+
* get condensed Markdown without a flag. Any explicit `--format` overrides it —
|
|
147
|
+
* `--format plain` forces human output down a pipe, `--format llm` forces the
|
|
148
|
+
* condensed form even on a TTY — as does `PRAGMA_NO_AUTO_LLM`.
|
|
149
|
+
*
|
|
150
|
+
* @param argv - The user's arguments (no `node`/script prefix).
|
|
151
|
+
* @param env - Output environment probe (defaults to the real process).
|
|
152
|
+
* @returns The parsed global flags.
|
|
153
|
+
* @note Impure by default — reads process.stdout/env unless `env` is injected.
|
|
154
|
+
*/
|
|
155
|
+
export function parseGlobalFlags(argv, env = readOutputEnvironment()) {
|
|
156
|
+
const rawFormat = readFlagValue(argv, "--format");
|
|
157
|
+
const format = rawFormat === "json" ? "json" : rawFormat === "llm" ? "llm" : "plain";
|
|
158
|
+
const formatRequested = rawFormat !== undefined;
|
|
159
|
+
const autoLlm = !formatRequested && !env.isTty && !env.noAutoLlm;
|
|
160
|
+
const detail = readDetail(argv);
|
|
161
|
+
const span = selectScanSpan(argv);
|
|
162
|
+
return {
|
|
163
|
+
llm: format === "llm" || autoLlm,
|
|
164
|
+
autoLlm,
|
|
165
|
+
format,
|
|
166
|
+
verbose: span.includes("--verbose"),
|
|
167
|
+
// `--no-headers` suppresses the plain-table header row; it is global so
|
|
168
|
+
// every list-shaped verb honors one spelling.
|
|
169
|
+
...(span.includes("--no-headers") ? { noHeaders: true } : {}),
|
|
170
|
+
// `--quiet` silences success/progress (the report seam, interpreter logs,
|
|
171
|
+
// onboarding, calm notices) while error rendering stays untouched.
|
|
172
|
+
...(span.includes("--quiet") ? { quiet: true } : {}),
|
|
173
|
+
...(detail !== undefined ? { detail } : {}),
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Return a copy of argv with every global flag (and its value) removed.
|
|
178
|
+
*
|
|
179
|
+
* Since {@link parseGlobalFlags} pre-parses these, they are dropped so they do
|
|
180
|
+
* not collide with Commander's positional scoping, letting the user place them
|
|
181
|
+
* anywhere on the line — anywhere before the option terminator, which this
|
|
182
|
+
* stops at and hands through whole.
|
|
183
|
+
*
|
|
184
|
+
* @param argv - The user's arguments.
|
|
185
|
+
* @returns A new array with global flags stripped.
|
|
186
|
+
*/
|
|
187
|
+
export function stripGlobalFlags(argv) {
|
|
188
|
+
const result = [];
|
|
189
|
+
for (let i = 0; i < argv.length; i++) {
|
|
190
|
+
const arg = argv.at(i);
|
|
191
|
+
if (arg === undefined)
|
|
192
|
+
continue;
|
|
193
|
+
// Past the terminator nothing is ours: hand the remainder over untouched,
|
|
194
|
+
// terminator included, so Commander still sees where options end.
|
|
195
|
+
if (arg === OPTION_TERMINATOR) {
|
|
196
|
+
result.push(...argv.slice(i));
|
|
197
|
+
return result;
|
|
198
|
+
}
|
|
199
|
+
if (arg === "--verbose" || arg === "--no-headers" || arg === "--quiet") {
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
if (arg.startsWith("--format=") || arg.startsWith("--detail=")) {
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
if (arg === "--format" || arg === "--detail") {
|
|
206
|
+
// Skip the value ONLY when the next token is one. A valueless flag before
|
|
207
|
+
// another flag must leave that flag standing.
|
|
208
|
+
if (isFlagValue(argv.at(i + 1)))
|
|
209
|
+
i += 1;
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
result.push(arg);
|
|
213
|
+
}
|
|
214
|
+
return result;
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=globalFlags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"globalFlags.js","sourceRoot":"","sources":["../../../../../src/kernel/project/cli/globalFlags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,aAAa,EAAoB,MAAM,uBAAuB,CAAC;AAGxE,gFAAgF;AAChF,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAE/B;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,IAAuB;IACpD,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACnD,OAAO,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,WAAW,CAAC,KAAyB;IAC5C,OAAO,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;GAMG;AACH,SAAS,aAAa,CACpB,IAAuB,EACvB,IAAY;IAEZ,MAAM,IAAI,GAA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CAAC,CAAC;QACvB,IAAI,GAAG,KAAK,SAAS;YAAE,SAAS;QAEhC,0EAA0E;QAC1E,kEAAkE;QAClE,IAAI,GAAG,KAAK,iBAAiB,EAAE,CAAC;YAC9B,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9B,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,cAAc,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACvE,SAAS;QACX,CAAC;QACD,IAAI,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/D,SAAS;QACX,CAAC;QACD,IAAI,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,UAAU,EAAE,CAAC;YAC7C,0EAA0E;YAC1E,8CAA8C;YAC9C,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBAAE,CAAC,IAAI,CAAC,CAAC;YACxC,SAAS;QACX,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared help-rendering primitives — the ONE visual system every help page
|
|
3
|
+
* composes from.
|
|
4
|
+
*
|
|
5
|
+
* Root help (`rootHelp.ts`), noun help, and verb help (`verbHelp.ts`) all build
|
|
6
|
+
* their pages out of these helpers so the front door and the leaf pages read as
|
|
7
|
+
* the same CLI: a dim `Usage:` label, bold section headers, a cyan-term /
|
|
8
|
+
* dim-description two-column body, and a dim footer that points at the next help
|
|
9
|
+
* level. chalk auto-disables color off a TTY, so goldens, piped output, and MCP
|
|
10
|
+
* transports all capture plain text — only an interactive terminal gets color.
|
|
11
|
+
*/
|
|
12
|
+
import chalk from "chalk";
|
|
13
|
+
/** Two-space indent for every list body row. */
|
|
14
|
+
const INDENT = " ";
|
|
15
|
+
/** Two-space gap between a term column and its description. */
|
|
16
|
+
const GAP = " ";
|
|
17
|
+
/** A bold section header (`Flags`, `Verbs`, `Set up & maintain`). */
|
|
18
|
+
export function helpHeading(text) {
|
|
19
|
+
return chalk.bold(text);
|
|
20
|
+
}
|
|
21
|
+
/** Dim secondary text — an example note, or the footer line. */
|
|
22
|
+
export function helpDim(text) {
|
|
23
|
+
return chalk.dim(text);
|
|
24
|
+
}
|
|
25
|
+
/** A cyan term — a command, verb, flag, or example, as shown in the body. */
|
|
26
|
+
export function helpTerm(text) {
|
|
27
|
+
return chalk.cyan(text);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The wordmark's colour.
|
|
31
|
+
*
|
|
32
|
+
* `yellow` is a PALETTE slot, not a fixed hue: the 16-colour ANSI palette has no
|
|
33
|
+
* orange, and this slot is the one terminal themes render as orange — Ubuntu's
|
|
34
|
+
* among them. Naming the slot rather than a 256-colour or truecolour orange is
|
|
35
|
+
* what lets the wordmark follow the user's own theme instead of fighting it, and
|
|
36
|
+
* keeps it legible on light backgrounds where a hardcoded orange would not be.
|
|
37
|
+
*/
|
|
38
|
+
export function helpLogo(text) {
|
|
39
|
+
return chalk.yellow(text);
|
|
40
|
+
}
|
|
41
|
+
/** The `Usage:` line: a dim label followed by the given command shape. */
|
|
42
|
+
export function helpUsage(body) {
|
|
43
|
+
return `${chalk.dim("Usage:")} ${body}`;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Render aligned two-column rows: a cyan term padded to a common width, then its
|
|
47
|
+
* dim description. Pass an explicit `width` to align across several lists (the
|
|
48
|
+
* root's grouped sections share one column); omit it to size to these rows
|
|
49
|
+
* alone.
|
|
50
|
+
*
|
|
51
|
+
* @param rows - `[term, description]` pairs.
|
|
52
|
+
* @param width - Optional shared column width; defaults to the widest term.
|
|
53
|
+
* @returns One formatted line per row.
|
|
54
|
+
*/
|
|
55
|
+
export function helpColumns(rows, width) {
|
|
56
|
+
const column = width ?? Math.max(0, ...rows.map(([term]) => term.length));
|
|
57
|
+
return rows.map(([term, description]) => `${INDENT}${chalk.cyan(term.padEnd(column))}${GAP}${chalk.dim(description)}`.trimEnd());
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=helpFormat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpFormat.js","sourceRoot":"","sources":["../../../../../src/kernel/project/cli/helpFormat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,gDAAgD;AAChD,MAAM,MAAM,GAAG,IAAI,CAAC;AACpB,+DAA+D;AAC/D,MAAM,GAAG,GAAG,IAAI,CAAC;AAEjB,qEAAqE;AACrE,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;AAC1C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CACzB,IAA+D,EAC/D,KAAc;IAEd,MAAM,MAAM,GAAG,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,EAAE,CACtC,GAAG,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,CACvF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI projector barrel — the Commander program, dispatcher, help, and
|
|
3
|
+
* exit-code model. The bin composes these; tests build programs from arbitrary
|
|
4
|
+
* modules via the `projectCli` helper.
|
|
5
|
+
*/
|
|
6
|
+
export { buildProgram } from "./buildProgram.js";
|
|
7
|
+
export { dispatch, executeVerb, extractParams } from "./dispatch.js";
|
|
8
|
+
export { EXIT, mapExitCode } from "./exitCodes.js";
|
|
9
|
+
export { parseGlobalFlags, readRawFormat, stripGlobalFlags, } from "./globalFlags.js";
|
|
10
|
+
export { formatRootHelp } from "./rootHelp.js";
|
|
11
|
+
export { nounVerbMap, resolveUnknownCommand } from "./suggest.js";
|
|
12
|
+
export { suggestNames } from "./suggestNames.js";
|
|
13
|
+
export { formatNounHelp, formatVerbHelp } from "./verbHelp.js";
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/kernel/project/cli/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The curated root `--help` page.
|
|
3
|
+
*
|
|
4
|
+
* The kernel curates the nouns it ships — and only those. It names no domain:
|
|
5
|
+
* the nouns it does NOT curate lead the page untitled (the header one line up
|
|
6
|
+
* already carries the distribution's blurb) and describe themselves through
|
|
7
|
+
* their own verbs, so the front door follows the content instead of naming it.
|
|
8
|
+
* Every section is reconciled against the *live* nouns (from the registered
|
|
9
|
+
* verbs), so a noun that is not built yet is dropped and one the kernel has
|
|
10
|
+
* never heard of still surfaces.
|
|
11
|
+
*/
|
|
12
|
+
import { PROGRAM_LOGO } from "../../../constants.js";
|
|
13
|
+
import { helpColumns, helpDim, helpHeading, helpLogo, helpTerm, helpUsage, } from "./helpFormat.js";
|
|
14
|
+
/**
|
|
15
|
+
* The kernel's own nouns, grouped by task with curated summaries. Order is
|
|
16
|
+
* intentional: what people reach for most comes first; agent tooling comes last.
|
|
17
|
+
*
|
|
18
|
+
* @param programName - The CLI binary name (the distribution's `name`).
|
|
19
|
+
* @returns The task-oriented groups, in display order.
|
|
20
|
+
*/
|
|
21
|
+
function buildKernelGroups(programName) {
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
title: "Generate code",
|
|
25
|
+
nouns: [
|
|
26
|
+
{ noun: "create", summary: "Scaffold components, packages, and apps" },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: "Query & serve the graph",
|
|
31
|
+
nouns: [
|
|
32
|
+
{
|
|
33
|
+
noun: "graph",
|
|
34
|
+
summary: "Run SPARQL queries or inspect a URI directly",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
noun: "ontology",
|
|
38
|
+
summary: "Explore the loaded ontologies (classes, properties)",
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
title: "Set up & maintain",
|
|
44
|
+
nouns: [
|
|
45
|
+
{ noun: "doctor", summary: "Check environment health" },
|
|
46
|
+
{
|
|
47
|
+
noun: "setup",
|
|
48
|
+
summary: "Configure MCP, skills, completions, and the LSP",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
noun: "sources",
|
|
52
|
+
summary: "Build and refresh the local store from packs",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
noun: "config",
|
|
56
|
+
summary: `Read and write ${programName} configuration`,
|
|
57
|
+
},
|
|
58
|
+
{ noun: "info", summary: "Show version, config, and update status" },
|
|
59
|
+
{ noun: "version", summary: "Print the CLI version" },
|
|
60
|
+
{
|
|
61
|
+
noun: "upgrade",
|
|
62
|
+
summary: `Upgrade the ${programName} CLI to the latest version`,
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
title: "For AI agents",
|
|
68
|
+
nouns: [
|
|
69
|
+
{
|
|
70
|
+
noun: "capabilities",
|
|
71
|
+
summary: "Discover conventions, tools, and the discovery sequence",
|
|
72
|
+
},
|
|
73
|
+
// A colophon is the note at the back of a book: the typeface, the
|
|
74
|
+
// press, the paper. Nothing depends on it, which is the point — so
|
|
75
|
+
// this line does not argue for it. Every other summary in this column
|
|
76
|
+
// promises work done; this one just invites you to look.
|
|
77
|
+
{ noun: "colophon", summary: "Read the credits" },
|
|
78
|
+
{ noun: "skill", summary: "Browse agent skills from the active packs" },
|
|
79
|
+
{ noun: "prompt", summary: "Browse reusable prompt templates" },
|
|
80
|
+
// Curated for PLACEMENT, not for existence: `mcp serve` is an
|
|
81
|
+
// ordinary verb like every other, and this group is where a reader
|
|
82
|
+
// looks for it.
|
|
83
|
+
{ noun: "mcp", summary: "Start the MCP server over stdio" },
|
|
84
|
+
],
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
}
|
|
88
|
+
/** All distinct, non-hidden top-level nouns present in the registered verbs. */
|
|
89
|
+
function nounsFrom(verbs) {
|
|
90
|
+
const nouns = new Set();
|
|
91
|
+
for (const verb of verbs) {
|
|
92
|
+
if (verb.hidden)
|
|
93
|
+
continue;
|
|
94
|
+
nouns.add(verb.path[0]);
|
|
95
|
+
}
|
|
96
|
+
return nouns;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Summarise an uncurated noun from its first live verb — which is the pack's own
|
|
100
|
+
* `description` whenever the pack ships a `list` (`compilePack` compiles that
|
|
101
|
+
* verb first). The terminal period a pack sentence carries is dropped so the
|
|
102
|
+
* column reads as one voice with the kernel's own fragments.
|
|
103
|
+
*/
|
|
104
|
+
function summarizeNoun(noun, verbs) {
|
|
105
|
+
const first = verbs.find((v) => v.path[0] === noun && !v.hidden);
|
|
106
|
+
return (first?.summary ?? `${noun} commands`).replace(/\.$/, "");
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Build the curated root help string.
|
|
110
|
+
*
|
|
111
|
+
* @param programName - The CLI binary name (the distribution's `name`).
|
|
112
|
+
* @param description - The program description shown in the header.
|
|
113
|
+
* @param verbs - All registered verbs, used to derive the live noun set.
|
|
114
|
+
* @param issuesUrl - Where the preview notice sends feedback; the
|
|
115
|
+
* distribution's own, so a fork points at its own tracker.
|
|
116
|
+
* @param version - The version to stamp on the header. Passed in rather than
|
|
117
|
+
* read here so it is the SAME string `--version` prints: `buildProgram`
|
|
118
|
+
* resolves `options.version ?? VERSION`, and a host that overrides one must
|
|
119
|
+
* not be able to leave the other saying something else.
|
|
120
|
+
* @returns The formatted, colorized help text.
|
|
121
|
+
*/
|
|
122
|
+
export function formatRootHelp(programName, description, verbs, version, issuesUrl) {
|
|
123
|
+
const present = nounsFrom(verbs);
|
|
124
|
+
const kernel = buildKernelGroups(programName);
|
|
125
|
+
const curated = new Set(kernel.flatMap((g) => g.nouns.map((n) => n.noun)));
|
|
126
|
+
const groups = [
|
|
127
|
+
// Everything the kernel's curated table does not claim — in the shipped
|
|
128
|
+
// binary the bundled domain packs, in a fork whatever it ships. Untitled
|
|
129
|
+
// and first, so the domain leads the page without the kernel naming it.
|
|
130
|
+
{
|
|
131
|
+
nouns: [...present]
|
|
132
|
+
.filter((n) => !curated.has(n))
|
|
133
|
+
.sort()
|
|
134
|
+
.map((noun) => ({ noun, summary: summarizeNoun(noun, verbs) })),
|
|
135
|
+
},
|
|
136
|
+
...kernel.map((g) => ({
|
|
137
|
+
...g,
|
|
138
|
+
nouns: g.nouns.filter((n) => present.has(n.noun)),
|
|
139
|
+
})),
|
|
140
|
+
].filter((g) => g.nouns.length > 0);
|
|
141
|
+
// One column width across ALL groups so the noun column aligns section to
|
|
142
|
+
// section, not just within a section.
|
|
143
|
+
const nounWidth = Math.max(...groups.flatMap((g) => g.nouns.map((n) => n.noun.length)), 0);
|
|
144
|
+
const lines = [
|
|
145
|
+
// The wordmark leads when the distribution declares one. A fork ships its
|
|
146
|
+
// own art or none, so its front door is never branded with someone else's.
|
|
147
|
+
...(PROGRAM_LOGO.length > 0 ? [...PROGRAM_LOGO.map(helpLogo), ""] : []),
|
|
148
|
+
// `<name> v<version> — <blurb>`, the spelling `info` and `capabilities`
|
|
149
|
+
// already use, so the front door names the build the same way every other
|
|
150
|
+
// surface does. Dimmed: it answers "which build am I on" for someone who
|
|
151
|
+
// is already here, and must not compete with the name.
|
|
152
|
+
`${helpHeading(programName)} ${helpDim(`v${version}`)} — ${description}`,
|
|
153
|
+
"",
|
|
154
|
+
// The preview notice. Dimmed and directly under the header, because it
|
|
155
|
+
// qualifies what the reader has just been told the tool IS — a version
|
|
156
|
+
// number alone does not say "expect this to move".
|
|
157
|
+
//
|
|
158
|
+
// The URL is the distribution's declared `issuesUrl`, never a literal:
|
|
159
|
+
// `kernel/copy.test.ts` forbids the kernel naming a distribution, and a
|
|
160
|
+
// fork inviting feedback to someone else's tracker would be worse than a
|
|
161
|
+
// missing line. It is passed in for the same reason `version` is.
|
|
162
|
+
helpDim(`This is a preview version. Issues and suggestions: ${issuesUrl}`),
|
|
163
|
+
"",
|
|
164
|
+
helpUsage(`${programName} ${helpTerm("<command>")} ${helpDim("[subcommand] [flags]")}`),
|
|
165
|
+
"",
|
|
166
|
+
];
|
|
167
|
+
for (const group of groups) {
|
|
168
|
+
if (group.title)
|
|
169
|
+
lines.push(helpHeading(group.title));
|
|
170
|
+
lines.push(...helpColumns(group.nouns.map((n) => [n.noun, n.summary]), nounWidth));
|
|
171
|
+
lines.push("");
|
|
172
|
+
}
|
|
173
|
+
// The frozen global-flags block: these doc strings MUST stay byte-consistent
|
|
174
|
+
// with FIXED_SURFACE.globalFlags (emitSurface.ts) — restyle the LAYOUT only,
|
|
175
|
+
// never these strings.
|
|
176
|
+
lines.push(helpHeading("Global flags"));
|
|
177
|
+
const flags = [
|
|
178
|
+
[
|
|
179
|
+
"--format <plain|llm|json>",
|
|
180
|
+
"Select output format (llm = condensed Markdown for agents)",
|
|
181
|
+
],
|
|
182
|
+
[
|
|
183
|
+
"--detail <level>",
|
|
184
|
+
"Progressive-disclosure level (summary, standard, detailed)",
|
|
185
|
+
],
|
|
186
|
+
["--no-headers", "Hide the table header row in plain output"],
|
|
187
|
+
["--quiet", "Suppress success and progress output (errors still print)"],
|
|
188
|
+
["--verbose", "Diagnostic output on stderr (sources update)"],
|
|
189
|
+
["--help", "Show help (works on any command)"],
|
|
190
|
+
["--version", "Show the CLI version"],
|
|
191
|
+
];
|
|
192
|
+
lines.push(...helpColumns(flags));
|
|
193
|
+
lines.push("");
|
|
194
|
+
lines.push(helpDim(`Run \`${programName} <command> --help\` for details, or \`${programName} capabilities\` to get oriented.`));
|
|
195
|
+
return lines.join("\n");
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=rootHelp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rootHelp.js","sourceRoot":"","sources":["../../../../../src/kernel/project/cli/rootHelp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EACL,WAAW,EACX,OAAO,EACP,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,SAAS,GACV,MAAM,iBAAiB,CAAC;AAiBzB;;;;;;GAMG;AACH,SAAS,iBAAiB,CAAC,WAAmB;IAC5C,OAAO;QACL;YACE,KAAK,EAAE,eAAe;YACtB,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,yCAAyC,EAAE;aACvE;SACF;QACD;YACE,KAAK,EAAE,yBAAyB;YAChC,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,OAAO;oBACb,OAAO,EAAE,8CAA8C;iBACxD;gBACD;oBACE,IAAI,EAAE,UAAU;oBAChB,OAAO,EAAE,qDAAqD;iBAC/D;aACF;SACF;QACD;YACE,KAAK,EAAE,mBAAmB;YAC1B,KAAK,EAAE;gBACL,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,0BAA0B,EAAE;gBACvD;oBACE,IAAI,EAAE,OAAO;oBACb,OAAO,EAAE,iDAAiD;iBAC3D;gBACD;oBACE,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,8CAA8C;iBACxD;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,kBAAkB,WAAW,gBAAgB;iBACvD;gBACD,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,yCAAyC,EAAE;gBACpE,EAAE,IAA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AC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAU,CAAC,EACpD,SAAS,CACV,CACF,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,6EAA6E;IAC7E,6EAA6E;IAC7E,uBAAuB;IACvB,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC;IACxC,MAAM,KAAK,GAAuB;QAChC;YACE,2BAA2B;YAC3B,4DAA4D;SAC7D;QACD;YACE,kBAAkB;YAClB,4DAA4D;SAC7D;QACD,CAAC,cAAc,EAAE,2CAA2C,CAAC;QAC7D,CAAC,SAAS,EAAE,2DAA2D,CAAC;QACxE,CAAC,WAAW,EAAE,8CAA8C,CAAC;QAC7D,CAAC,QAAQ,EAAE,kCAAkC,CAAC;QAC9C,CAAC,WAAW,EAAE,sBAAsB,CAAC;KACtC,CAAC;IACF,KAAK,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;IAClC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEf,KAAK,CAAC,IAAI,CACR,OAAO,CACL,SAAS,WAAW,yCAAyC,WAAW,kCAAkC,CAC3G,CACF,CAAC;IAEF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turn an unknown command into an actionable "Did you mean?".
|
|
3
|
+
*
|
|
4
|
+
* When Commander rejects an unrecognized noun or verb, the bin resolves the
|
|
5
|
+
* offending token and the set of siblings it should have matched, then raises a
|
|
6
|
+
* `PragmaError.unknownVerb` (its suggestions ranked by `suggestNames`) rendered
|
|
7
|
+
* through the shared error renderers — so the plain path gets the same `Error:`
|
|
8
|
+
* prefix and "Did you mean?" list as every other error. The resolution is
|
|
9
|
+
* data-driven — a noun→verbs map built from the grammar — so no Commander
|
|
10
|
+
* internals leak into the suggester.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Curated suggestions for a token whose JOB exists under other names. Edit
|
|
14
|
+
* distance cannot rank these — `status` is nowhere near `info` textually —
|
|
15
|
+
* but a user typing the conventional spelling deserves the commands that own
|
|
16
|
+
* the job here, not the nearest-looking noun. Consulted before fuzzy ranking;
|
|
17
|
+
* adding a second spelling as a real command is the one thing this table must
|
|
18
|
+
* never become.
|
|
19
|
+
*/
|
|
20
|
+
const CURATED_SUGGESTIONS = {
|
|
21
|
+
status: ["info", "doctor"],
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The curated suggestions for an unknown token, if any.
|
|
25
|
+
*
|
|
26
|
+
* @param token - The unresolved command token.
|
|
27
|
+
* @returns The commands that own the token's job, or `undefined`.
|
|
28
|
+
*/
|
|
29
|
+
export function curatedSuggestions(token) {
|
|
30
|
+
return CURATED_SUGGESTIONS[token];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Build the noun → verb-labels map from the registered verbs.
|
|
34
|
+
*
|
|
35
|
+
* Hidden verbs are excluded. A self-verb (path length 1, e.g. `["info"]`)
|
|
36
|
+
* contributes an entry with no sub-verbs.
|
|
37
|
+
*
|
|
38
|
+
* @param verbs - All registered verbs.
|
|
39
|
+
* @returns A map from noun to its verb labels (empty for self-verbs).
|
|
40
|
+
*/
|
|
41
|
+
export function nounVerbMap(verbs) {
|
|
42
|
+
const map = new Map();
|
|
43
|
+
for (const verb of verbs) {
|
|
44
|
+
if (verb.hidden)
|
|
45
|
+
continue;
|
|
46
|
+
const [noun, sub] = verb.path;
|
|
47
|
+
const labels = map.get(noun) ?? [];
|
|
48
|
+
if (sub)
|
|
49
|
+
labels.push(sub);
|
|
50
|
+
map.set(noun, labels);
|
|
51
|
+
}
|
|
52
|
+
return map;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Locate the first token that does not resolve against the known commands.
|
|
56
|
+
*
|
|
57
|
+
* @param positionals - The stripped positional args (no flags), in order.
|
|
58
|
+
* @param nouns - The noun → verb-labels map from {@link nounVerbMap}.
|
|
59
|
+
* @returns The unresolved token with its candidates, or `undefined` when the
|
|
60
|
+
* args resolve cleanly.
|
|
61
|
+
*/
|
|
62
|
+
export function resolveUnknownCommand(positionals, nouns) {
|
|
63
|
+
const [noun, verb] = positionals;
|
|
64
|
+
if (noun === undefined)
|
|
65
|
+
return undefined;
|
|
66
|
+
if (!nouns.has(noun)) {
|
|
67
|
+
return { token: noun, candidates: [...nouns.keys()] };
|
|
68
|
+
}
|
|
69
|
+
const labels = nouns.get(noun) ?? [];
|
|
70
|
+
if (verb !== undefined && labels.length > 0 && !labels.includes(verb)) {
|
|
71
|
+
return { token: verb, candidates: labels };
|
|
72
|
+
}
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=suggest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggest.js","sourceRoot":"","sources":["../../../../../src/kernel/project/cli/suggest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH;;;;;;;GAOG;AACH,MAAM,mBAAmB,GAAgD;IACvE,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;CAC3B,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAAa;IAEb,OAAO,mBAAmB,CAAC,KAAK,CAAC,CAAC;AACpC,CAAC;AAQD;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,KAA0B;IACpD,MAAM,GAAG,GAAG,IAAI,GAAG,EAAoB,CAAC;IACxC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,MAAM;YAAE,SAAS;QAC1B,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,GAAG,CAAC,IAA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