@canonical/pragma-cli 0.34.0 → 0.36.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/bundled-skills/add-standard/SKILL.md +338 -0
- package/bundled-skills/adoption-a1-styles/SKILL.md +269 -0
- package/bundled-skills/adoption-a2-components/SKILL.md +291 -0
- package/bundled-skills/adoption-a3-forms/SKILL.md +260 -0
- package/bundled-skills/anatomy-author/ANATOMY_DSL_SPEC.md +406 -0
- package/bundled-skills/anatomy-author/SKILL.md +1226 -0
- package/bundled-skills/design-auditor/SKILL.md +455 -0
- package/bundled-skills/implement-component/SKILL.md +333 -0
- package/bundled-skills/specify-component/SKILL.md +331 -0
- package/bundled-skills/specify-pattern/SKILL.md +292 -0
- package/dist/.build-ok +0 -0
- package/dist/package.json +84 -0
- package/dist/pragma.conf.js +1016 -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 +294 -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 +148 -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/harnessInventory.js +195 -0
- package/dist/src/capabilities/doctor/checks/harnessInventory.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 +349 -0
- package/dist/src/capabilities/doctor/checks/targetHealth.js.map +1 -0
- package/dist/src/capabilities/doctor/doctor.render.js +164 -0
- package/dist/src/capabilities/doctor/doctor.render.js.map +1 -0
- package/dist/src/capabilities/doctor/doctor.verb.js +49 -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 +86 -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 +72 -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 +57 -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 +172 -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 +390 -0
- package/dist/src/capabilities/setup/operations/setupGenerator.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupLsp.js +329 -0
- package/dist/src/capabilities/setup/operations/setupLsp.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupMcp.js +253 -0
- package/dist/src/capabilities/setup/operations/setupMcp.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupSkills.js +594 -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 +271 -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 +387 -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 +328 -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/index.js +27 -0
- package/dist/src/capabilities/shared/index.js.map +1 -0
- package/dist/src/capabilities/shared/packageManager.js +349 -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 +281 -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 +309 -0
- package/dist/src/capabilities/sources/installSkills.js.map +1 -0
- package/dist/src/capabilities/sources/runUpdate.js +460 -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 +135 -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 +52 -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 +87 -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 +34 -0
- package/dist/src/kernel/index.js.map +1 -0
- package/dist/src/kernel/interactivity.js +68 -0
- package/dist/src/kernel/interactivity.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 +274 -0
- package/dist/src/kernel/packs/resolveEntity.js.map +1 -0
- package/dist/src/kernel/packs/runBodies.js +140 -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 +421 -0
- package/dist/src/kernel/packs/schema.js.map +1 -0
- package/dist/src/kernel/packs/sparql/applyFilters.js +167 -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 +480 -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 +219 -0
- package/dist/src/kernel/project/cli/globalFlags.js.map +1 -0
- package/dist/src/kernel/project/cli/helpFormat.js +58 -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 +227 -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 +315 -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 +105 -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/vocabulary.js +174 -0
- package/dist/src/kernel/render/vocabulary.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 +22 -23
- package/pragma.conf.ts +486 -90
- package/src/bin.ts +274 -82
- package/src/capabilities/block.parity.test.ts +29 -12
- package/src/capabilities/block.shipped.exec.test.ts +282 -0
- package/src/capabilities/block.tierRank.exec.test.ts +300 -0
- 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 +24 -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.parity.test.ts +4 -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 +75 -8
- package/src/capabilities/doctor/checks/checkPragmaVersion.ts +2 -2
- package/src/capabilities/doctor/checks/checkShellCompletions.test.ts +76 -29
- package/src/capabilities/doctor/checks/checkShellCompletions.ts +63 -17
- package/src/capabilities/doctor/checks/harnessInventory.test.ts +219 -0
- package/src/capabilities/doctor/checks/harnessInventory.ts +298 -0
- 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 +444 -0
- package/src/capabilities/doctor/doctor.render.test.ts +125 -38
- package/src/capabilities/doctor/doctor.render.ts +74 -74
- package/src/capabilities/doctor/doctor.test.ts +338 -37
- package/src/capabilities/doctor/doctor.verb.ts +8 -3
- package/src/capabilities/doctor/runChecks.ts +65 -63
- package/src/capabilities/doctor/types.ts +22 -15
- package/src/capabilities/emptyRecovery.test.ts +21 -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 +13 -5
- package/src/capabilities/info/info.render.ts +7 -3
- package/src/capabilities/info/info.test.ts +37 -1
- package/src/capabilities/info/info.verb.ts +1 -1
- package/src/capabilities/info/types.ts +10 -2
- 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/renderVocabularySync.test.ts +82 -0
- package/src/capabilities/resources/provider.ts +342 -85
- package/src/capabilities/resources/resources.test.ts +355 -59
- package/src/capabilities/scopeTypeSync.test.ts +29 -15
- package/src/capabilities/setup/buildPlan.ts +240 -0
- package/src/capabilities/setup/index.ts +7 -7
- package/src/capabilities/setup/mode.ts +74 -0
- package/src/capabilities/setup/operations/index.ts +79 -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 +478 -334
- package/src/capabilities/setup/operations/setupLsp.ts +420 -67
- package/src/capabilities/setup/operations/setupMcp.ts +238 -127
- package/src/capabilities/setup/operations/setupSkills.ts +667 -105
- package/src/capabilities/setup/plan.render.ts +336 -0
- package/src/capabilities/setup/plan.ts +241 -0
- package/src/capabilities/setup/setup.mcp.correctness.test.ts +432 -0
- package/src/capabilities/setup/setup.render.test.ts +297 -75
- package/src/capabilities/setup/setup.render.ts +45 -77
- package/src/capabilities/setup/setup.test.ts +1819 -225
- package/src/capabilities/setup/setup.verb.ts +288 -78
- package/src/capabilities/setup/shell.test.ts +86 -0
- package/src/capabilities/setup/shell.ts +137 -11
- package/src/capabilities/setup/targets.ts +435 -0
- package/src/capabilities/setup/types.ts +23 -70
- package/src/capabilities/shared/assertExecOk.ts +68 -10
- package/src/capabilities/shared/index.ts +43 -0
- package/src/capabilities/shared/packageManager.test.ts +470 -0
- package/src/capabilities/shared/packageManager.ts +425 -34
- package/src/capabilities/skill/bundledSkills.test.ts +347 -0
- package/src/capabilities/skill/discover.ts +131 -10
- package/src/capabilities/skill/index.ts +1 -1
- package/src/capabilities/skill/render.ts +10 -9
- package/src/capabilities/skill/skill.test.ts +22 -7
- 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 +265 -10
- package/src/capabilities/sources/runUpdate.ts +131 -23
- package/src/capabilities/sources/sources.test.ts +382 -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 +4 -4
- package/src/capabilities/surface.test.ts +136 -19
- package/src/capabilities/upgrade/runUpgrade.ts +53 -14
- package/src/capabilities/upgrade/types.ts +10 -2
- package/src/capabilities/upgrade/upgrade.render.ts +13 -7
- package/src/capabilities/upgrade/upgrade.test.ts +75 -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 +36 -1
- package/src/identity.test.ts +57 -29
- 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 +16 -3
- 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 +50 -35
- 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 +27 -3
- 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 +35 -0
- package/src/kernel/interactivity.test.ts +76 -0
- package/src/kernel/interactivity.ts +69 -0
- package/src/kernel/packs/collect.ts +12 -16
- package/src/kernel/packs/compile.test.ts +222 -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 +25 -6
- package/src/kernel/packs/resolveEntity.test.ts +274 -0
- package/src/kernel/packs/resolveEntity.ts +200 -42
- package/src/kernel/packs/runBodies.ts +86 -22
- package/src/kernel/packs/sample.ts +1 -1
- package/src/kernel/packs/schema.ts +78 -5
- package/src/kernel/packs/sparql/applyFilters.ts +136 -16
- package/src/kernel/packs/sparql/buildLookupQuery.test.ts +290 -0
- package/src/kernel/packs/sparql/buildLookupQuery.ts +367 -17
- 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 +77 -4
- package/src/kernel/packs/types.ts +136 -0
- package/src/kernel/packs/uniqueness.ts +1 -1
- package/src/kernel/project/cli/buildProgram.test.ts +218 -12
- package/src/kernel/project/cli/buildProgram.ts +84 -18
- package/src/kernel/project/cli/constants.ts +34 -0
- package/src/kernel/project/cli/dispatch.test.ts +160 -2
- package/src/kernel/project/cli/dispatch.ts +226 -45
- 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 +134 -31
- package/src/kernel/project/cli/helpFormat.ts +14 -2
- package/src/kernel/project/cli/rootHelp.ts +74 -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 +55 -10
- 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 +59 -6
- package/src/kernel/render/turtle.ts +222 -0
- package/src/kernel/render/vocabulary.ts +276 -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 +277 -4
- package/src/testing/PARITY_GAPS.ts +9 -3
- package/src/testing/behavioral/docExamples.test.ts +16 -0
- package/src/testing/behavioral/errorMatrix.mcp.test.ts +112 -9
- 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.firstInstall.test.ts +7 -2
- 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 +10 -7
- 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/__snapshots__/eval.test.ts.snap +26 -1
- package/src/testing/eval/cases/effectful.ts +3 -2
- package/src/testing/eval/cases/readNouns.ts +245 -9
- package/src/testing/fixtures/blockGraph.ts +104 -10
- package/src/testing/fixtures/graph/canonical.ts +182 -13
- 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/capabilities/shared/bands.ts +0 -16
- package/src/kernel/config/__snapshots__/firstRun.test.ts.snap +0 -11
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tiny, self-contained Markdown→terminal styler — `chalk` only, no parser, no
|
|
3
|
+
* new dependency. It covers exactly the constructs the colophon Markdown uses:
|
|
4
|
+
* ATX headings, `-`/`*` bullets, fenced ```code``` blocks, and inline
|
|
5
|
+
* `**bold**` / `` `code` `` spans. Deliberately minimal: no wrapping, no tables,
|
|
6
|
+
* no nested lists.
|
|
7
|
+
*
|
|
8
|
+
* Single consumer today (`pragma colophon`); a promotion candidate to
|
|
9
|
+
* `kernel/render/` if another verb ever wants the same helper. Determinism note:
|
|
10
|
+
* styling routes through the shared {@link RenderStyle} seam (color only on a
|
|
11
|
+
* color-capable TTY), so piped / redirected / CI output — where `supports-color`
|
|
12
|
+
* can report a level with no TTY — stays byte-for-byte the color-free structural
|
|
13
|
+
* transform, and a test can force either mode by passing an explicit style.
|
|
14
|
+
*/
|
|
15
|
+
import chalk from "chalk";
|
|
16
|
+
import { defaultStyle } from "../../kernel/render/style.js";
|
|
17
|
+
/** Full ANSI escape sequences (`ESC [ … final-letter`) — colour/cursor codes. */
|
|
18
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: deliberate control-char scrub
|
|
19
|
+
const ANSI_ESCAPE = /\x1b\[[0-9;]*[A-Za-z]/g;
|
|
20
|
+
/** Stray C0 control chars + DEL, keeping tab (`\x09`) and newline (`\x0a`). */
|
|
21
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: deliberate control-char scrub
|
|
22
|
+
const C0_CONTROLS = /[\x00-\x08\x0b-\x1f\x7f]/g;
|
|
23
|
+
/**
|
|
24
|
+
* Strip ANSI escape sequences and stray C0/DEL control characters from a line.
|
|
25
|
+
*
|
|
26
|
+
* The colophon body carries pack-authored domain text (the "domain-as-data"
|
|
27
|
+
* model), so a hostile or careless pack could otherwise smuggle raw terminal
|
|
28
|
+
* control codes — cursor moves, colour resets, screen clears — straight to the
|
|
29
|
+
* terminal. We apply our OWN styling via `chalk` afterwards, so any control char
|
|
30
|
+
* in the source is unwanted; scrub each line before styling.
|
|
31
|
+
*/
|
|
32
|
+
function stripControl(line) {
|
|
33
|
+
return line.replace(ANSI_ESCAPE, "").replace(C0_CONTROLS, "");
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Style inline `**bold**` and `` `code` `` spans within one line. The `**` / `` ` ``
|
|
37
|
+
* markers are ALWAYS consumed; off a TTY the styler is inert, so the markers drop
|
|
38
|
+
* with no color (byte-identical to the pre-seam `chalk.level = 0` behavior).
|
|
39
|
+
*/
|
|
40
|
+
function styleInline(text, style) {
|
|
41
|
+
return text
|
|
42
|
+
.replace(/\*\*([^*]+)\*\*/g, (_match, inner) => style.bold(inner))
|
|
43
|
+
.replace(/`([^`]+)`/g, (_match, inner) => style.cyan(inner));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Render a Markdown string to styled terminal text.
|
|
47
|
+
*
|
|
48
|
+
* @param markdown - The authored Markdown body.
|
|
49
|
+
* @param style - The TTY styler; defaults to the process style. On a color-capable
|
|
50
|
+
* terminal headings/bullets/inline spans are tinted; off a TTY the styler is
|
|
51
|
+
* inert, so the output is byte-identical to the color-free structural form.
|
|
52
|
+
* @returns The styled terminal string (no trailing newline).
|
|
53
|
+
*/
|
|
54
|
+
export function renderMarkdownToTerminal(markdown, style = defaultStyle()) {
|
|
55
|
+
const lines = [];
|
|
56
|
+
let inFence = false;
|
|
57
|
+
for (const rawLine of markdown.split("\n")) {
|
|
58
|
+
// Scrub pack-authored terminal control codes BEFORE our own styling
|
|
59
|
+
// (colophon bodies are domain-as-data — never a channel for raw ANSI).
|
|
60
|
+
const raw = stripControl(rawLine);
|
|
61
|
+
// A fence toggles code mode; the ``` markers themselves are dropped.
|
|
62
|
+
if (raw.trimStart().startsWith("```")) {
|
|
63
|
+
inFence = !inFence;
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (inFence) {
|
|
67
|
+
lines.push(style.dim(` ${raw}`));
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const heading = /^(#{1,6})\s+(.+)$/.exec(raw);
|
|
71
|
+
if (heading) {
|
|
72
|
+
const level = heading[1]?.length ?? 1;
|
|
73
|
+
const text = styleInline(heading[2] ?? "", style);
|
|
74
|
+
// H1 earns bold+underline on a TTY; underline is outside the RenderStyle
|
|
75
|
+
// seam, so reach for chalk only when the styler is enabled.
|
|
76
|
+
lines.push(level === 1 && style.enabled
|
|
77
|
+
? chalk.bold.underline(text)
|
|
78
|
+
: style.bold(text));
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const bullet = /^\s*[-*]\s+(.+)$/.exec(raw);
|
|
82
|
+
if (bullet) {
|
|
83
|
+
lines.push(` ${style.cyan("•")} ${styleInline(bullet[1] ?? "", style)}`);
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
lines.push(styleInline(raw, style));
|
|
87
|
+
}
|
|
88
|
+
return lines.join("\n");
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=markdownTerminal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdownTerminal.js","sourceRoot":"","sources":["../../../../src/capabilities/colophon/markdownTerminal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAoB,MAAM,8BAA8B,CAAC;AAE9E,iFAAiF;AACjF,yFAAyF;AACzF,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAC7C,+EAA+E;AAC/E,yFAAyF;AACzF,MAAM,WAAW,GAAG,2BAA2B,CAAC;AAEhD;;;;;;;;GAQG;AACH,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAChE,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,IAAY,EAAE,KAAkB;IACnD,OAAO,IAAI;SACR,OAAO,CAAC,kBAAkB,EAAE,CAAC,MAAM,EAAE,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACzE,OAAO,CAAC,YAAY,EAAE,CAAC,MAAM,EAAE,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AACzE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CACtC,QAAgB,EAChB,QAAqB,YAAY,EAAE;IAEnC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,OAAO,GAAG,KAAK,CAAC;IAEpB,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3C,oEAAoE;QACpE,uEAAuE;QACvE,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;QAClC,qEAAqE;QACrE,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YACtC,OAAO,GAAG,CAAC,OAAO,CAAC;YACnB,SAAS;QACX,CAAC;QACD,IAAI,OAAO,EAAE,CAAC;YACZ,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC;YAClC,SAAS;QACX,CAAC;QAED,MAAM,OAAO,GAAG,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC9C,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;YACtC,MAAM,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;YAClD,yEAAyE;YACzE,4DAA4D;YAC5D,KAAK,CAAC,IAAI,CACR,KAAK,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO;gBAC1B,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;gBAC5B,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CACrB,CAAC;YACF,SAAS;QACX,CAAC;QAED,MAAM,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,MAAM,EAAE,CAAC;YACX,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;YAC1E,SAAS;QACX,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data shapes for `pragma colophon`.
|
|
3
|
+
*
|
|
4
|
+
* A colophon (the printer's end-note on how a book is made) for the toolchain:
|
|
5
|
+
* one section narrating how the distribution itself is built — declared in its
|
|
6
|
+
* config, not authored in code — followed by one section per active pack/domain
|
|
7
|
+
* that declares a `colophon`. Storeless and read-only.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/capabilities/colophon/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collect the `config show` payload — the verb's run body (lazily imported).
|
|
3
|
+
*
|
|
4
|
+
* Storeless: read the layered config and pass it through with its provenance,
|
|
5
|
+
* minus the declared story BODIES (see {@link withoutStoryBodies}). Dynamic-
|
|
6
|
+
* imported by the spec so building the tree never pulls the config reader (or
|
|
7
|
+
* zod) onto the fast path.
|
|
8
|
+
*/
|
|
9
|
+
import { readConfig } from "../../kernel/config/index.js";
|
|
10
|
+
/** A pack declaration with any declared story bodies dropped. */
|
|
11
|
+
function nameAndSourceOnly(pack) {
|
|
12
|
+
if (typeof pack === "string")
|
|
13
|
+
return pack;
|
|
14
|
+
return {
|
|
15
|
+
name: pack.name,
|
|
16
|
+
...(pack.source === undefined ? {} : { source: pack.source }),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The effective config with declared story BODIES dropped — `packs` entries keep
|
|
21
|
+
* `{ name, source }`, and the top-level `stories` array is omitted.
|
|
22
|
+
*
|
|
23
|
+
* A PROJECTION of the payload, not a hiding of config: `origins` still reports
|
|
24
|
+
* where `packs` and `stories` came from, the plain and llm renders already print
|
|
25
|
+
* pack NAMES only, and `pragma capabilities` lists the verbs the stories
|
|
26
|
+
* produce. It exists because the bodies are SPARQL — the distribution's own five
|
|
27
|
+
* stories take `config show --format json` from 1.3 KB to 11 KB, and MCP returns
|
|
28
|
+
* the JSON formatter's output, so every `config_show` tool call would carry
|
|
29
|
+
* ~2.7k tokens of query text: the largest payload in the surface, for its least
|
|
30
|
+
* useful content.
|
|
31
|
+
*/
|
|
32
|
+
function withoutStoryBodies(config) {
|
|
33
|
+
const { stories, ...rest } = config;
|
|
34
|
+
return {
|
|
35
|
+
...rest,
|
|
36
|
+
...(config.packs === undefined
|
|
37
|
+
? {}
|
|
38
|
+
: { packs: config.packs.map(nameAndSourceOnly) }),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Assemble the resolved config with provenance for the current runtime.
|
|
43
|
+
*
|
|
44
|
+
* @param runtime - The per-invocation runtime.
|
|
45
|
+
* @returns The config-show payload.
|
|
46
|
+
* @note Impure — reads the config layers from disk.
|
|
47
|
+
*/
|
|
48
|
+
export async function collectConfigShow(runtime) {
|
|
49
|
+
const layers = await readConfig(runtime.cwd);
|
|
50
|
+
return {
|
|
51
|
+
config: withoutStoryBodies(layers.config),
|
|
52
|
+
origins: layers.origins,
|
|
53
|
+
...(layers.project.path ? { projectConfigPath: layers.project.path } : {}),
|
|
54
|
+
globalConfigPath: layers.global.path,
|
|
55
|
+
projectExists: layers.project.exists,
|
|
56
|
+
globalExists: layers.global.exists,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=collectConfigShow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectConfigShow.js","sourceRoot":"","sources":["../../../../src/capabilities/config/collectConfigShow.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI1D,iEAAiE;AACjE,SAAS,iBAAiB,CAAC,IAAqB;IAC9C,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC1C,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;KAC9D,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,kBAAkB,CAAC,MAAoB;IAC9C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;IACpC,OAAO;QACL,GAAG,IAAI;QACP,GAAG,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS;YAC5B,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE,CAAC;KACpD,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,OAAsB;IAEtB,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,OAAO;QACL,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC;QACzC,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI;QACpC,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM;QACpC,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatters for the config writers (`set` and `unset`) — plain, llm, json.
|
|
3
|
+
*
|
|
4
|
+
* One shared formatter (the field-table pattern): a set reports the value and
|
|
5
|
+
* the file it landed in; an unset reports the removed field.
|
|
6
|
+
*/
|
|
7
|
+
export const configFieldFormatters = {
|
|
8
|
+
plain(data) {
|
|
9
|
+
return data.reset
|
|
10
|
+
? `Reset ${data.field} (removed from ${data.path})`
|
|
11
|
+
: `Set ${data.field} = ${data.value} (written to ${data.path})`;
|
|
12
|
+
},
|
|
13
|
+
llm(data) {
|
|
14
|
+
return data.reset
|
|
15
|
+
? `Reset \`${data.field}\` — removed from the global config.`
|
|
16
|
+
: `Set \`${data.field}\` = \`${data.value}\` in the global config.`;
|
|
17
|
+
},
|
|
18
|
+
json(data) {
|
|
19
|
+
return JSON.stringify(data);
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=field.render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.render.js","sourceRoot":"","sources":["../../../../src/capabilities/config/field.render.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,CAAC,MAAM,qBAAqB,GAAkC;IAClE,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,KAAK;YACf,CAAC,CAAC,SAAS,IAAI,CAAC,KAAK,kBAAkB,IAAI,CAAC,IAAI,GAAG;YACnD,CAAC,CAAC,OAAO,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,gBAAgB,IAAI,CAAC,IAAI,GAAG,CAAC;IACpE,CAAC;IAED,GAAG,CAAC,IAAI;QACN,OAAO,IAAI,CAAC,KAAK;YACf,CAAC,CAAC,WAAW,IAAI,CAAC,KAAK,sCAAsC;YAC7D,CAAC,CAAC,SAAS,IAAI,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,0BAA0B,CAAC;IACxE,CAAC;IAED,IAAI,CAAC,IAAI;QACP,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The config field table — one declarative row per writable field. Since AV-228
|
|
3
|
+
* B3 retired the per-field `config tier`/`channel`/`detail` verbs, this table no
|
|
4
|
+
* longer emits verbs of its own: it is the shared source of truth that drives
|
|
5
|
+
* `config set <key> <value>` and `config get`/`config unset` (via `runSet` →
|
|
6
|
+
* `runField`), giving each its `<key>` enum, enum validation, and positional
|
|
7
|
+
* shaping for free.
|
|
8
|
+
*/
|
|
9
|
+
import { DETAIL_LEVELS } from "../../constants.js";
|
|
10
|
+
import { CHANNELS } from "../../kernel/config/types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Values `config set` refuses for a FREE-STRING field: clearing a field is a
|
|
13
|
+
* command (`config unset <key>`), not a magic value — a value spelled `none`
|
|
14
|
+
* conflated "remove the field" with "set it to the string none". They stay
|
|
15
|
+
* reserved (rather than becoming writable) so the strings cannot silently
|
|
16
|
+
* change meaning; the rejection names `unset` as the owner of the job.
|
|
17
|
+
*/
|
|
18
|
+
export const RESERVED_CLEAR_VALUES = [
|
|
19
|
+
"none",
|
|
20
|
+
"default",
|
|
21
|
+
"-",
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* The three writable fields. `channel`/`detail` are fixed enums;
|
|
25
|
+
* `tier` is a free string, cleared with `config unset tier`.
|
|
26
|
+
*/
|
|
27
|
+
export const CONFIG_FIELDS = [
|
|
28
|
+
{
|
|
29
|
+
field: "tier",
|
|
30
|
+
positional: "path",
|
|
31
|
+
kind: "string",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
field: "channel",
|
|
35
|
+
positional: "name",
|
|
36
|
+
kind: "enum",
|
|
37
|
+
values: CHANNELS,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
field: "detail",
|
|
41
|
+
positional: "level",
|
|
42
|
+
kind: "enum",
|
|
43
|
+
values: DETAIL_LEVELS,
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../src/capabilities/config/fields.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAcxD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAsB;IACtD,MAAM;IACN,SAAS;IACT,GAAG;CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAA+B;IACvD;QACE,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,QAAQ;KACf;IACD;QACE,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,QAAQ;KACjB;IACD;QACE,KAAK,EAAE,QAAQ;QACf,UAAU,EAAE,OAAO;QACnB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,aAAa;KACtB;CACF,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `config get <key>` — read ONE resolved config value, scriptably.
|
|
3
|
+
*
|
|
4
|
+
* `config show` dumps everything with provenance; scripting one value out of
|
|
5
|
+
* it needed `--format json` plus a JSON tool. `get` prints the bare resolved
|
|
6
|
+
* value on stdout (an unset field prints nothing, exit 0), so shell
|
|
7
|
+
* substitution works directly; the json form carries the field, the value,
|
|
8
|
+
* and the layer that supplied it.
|
|
9
|
+
*
|
|
10
|
+
* The plain and llm forms are the SAME bare value, which is the one place in
|
|
11
|
+
* the grammar where those two forms may not differ: `TIER=$(… config get
|
|
12
|
+
* tier)` pipes stdout, and a pipe auto-selects llm, so a decorated llm line
|
|
13
|
+
* would put backticks and a provenance clause into the variable the command
|
|
14
|
+
* exists to fill. Provenance has a home already — `--format json` here, and
|
|
15
|
+
* `config show` for the whole picture.
|
|
16
|
+
*/
|
|
17
|
+
import { BIN_NAME } from "../../constants.js";
|
|
18
|
+
import { asVerb } from "../../kernel/spec/asVerb.js";
|
|
19
|
+
import { CONFIG_FIELDS } from "./fields.js";
|
|
20
|
+
/** The readable field names — the `<key>` enum, in covenant order. */
|
|
21
|
+
const CONFIG_KEYS = CONFIG_FIELDS.map((field) => field.field);
|
|
22
|
+
/** The bare value, or nothing at all when the field is unset. */
|
|
23
|
+
const bareValue = (data) => data.value === undefined ? "" : String(data.value);
|
|
24
|
+
const configGetFormatters = {
|
|
25
|
+
// The bare value IS the contract: `TIER=$(pragma config get tier)`.
|
|
26
|
+
plain: bareValue,
|
|
27
|
+
llm: bareValue,
|
|
28
|
+
json: (data) => JSON.stringify(data),
|
|
29
|
+
};
|
|
30
|
+
const getVerb = {
|
|
31
|
+
path: ["config", "get"],
|
|
32
|
+
summary: "Print one resolved config value.",
|
|
33
|
+
doc: "Reads the effective value of a single field after layering — built-in defaults, the global config, and the nearest project config. Prints the bare value (nothing when the field is unset), so the output substitutes directly into a shell.",
|
|
34
|
+
params: [
|
|
35
|
+
{
|
|
36
|
+
kind: "enum",
|
|
37
|
+
name: "key",
|
|
38
|
+
doc: "The config field to read.",
|
|
39
|
+
values: CONFIG_KEYS,
|
|
40
|
+
required: true,
|
|
41
|
+
positional: true,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
output: { formatters: configGetFormatters },
|
|
45
|
+
examples: [
|
|
46
|
+
{ cmd: `${BIN_NAME} config get tier` },
|
|
47
|
+
{ cmd: `${BIN_NAME} config get channel --format json` },
|
|
48
|
+
],
|
|
49
|
+
capability: {
|
|
50
|
+
needsStore: false,
|
|
51
|
+
mutates: false,
|
|
52
|
+
mcp: {
|
|
53
|
+
expose: true,
|
|
54
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
run: (params, runtime) => import("./runGet.js").then((m) => m.runGet(params, runtime)),
|
|
58
|
+
};
|
|
59
|
+
/** The `config get` verb. */
|
|
60
|
+
export const configGetVerb = asVerb(getVerb);
|
|
61
|
+
//# sourceMappingURL=get.verb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.verb.js","sourceRoot":"","sources":["../../../../src/capabilities/config/get.verb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,sEAAsE;AACtE,MAAM,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAE9D,iEAAiE;AACjE,MAAM,SAAS,GAAG,CAAC,IAAmB,EAAU,EAAE,CAChD,IAAI,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAErD,MAAM,mBAAmB,GAA8B;IACrD,oEAAoE;IACpE,KAAK,EAAE,SAAS;IAChB,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;CACrC,CAAC;AAEF,MAAM,OAAO,GAAqD;IAChE,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC;IACvB,OAAO,EAAE,kCAAkC;IAC3C,GAAG,EAAE,8OAA8O;IACnP,MAAM,EAAE;QACN;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,KAAK;YACX,GAAG,EAAE,2BAA2B;YAChC,MAAM,EAAE,WAAW;YACnB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;SACjB;KACF;IACD,MAAM,EAAE,EAAE,UAAU,EAAE,mBAAmB,EAAE;IAC3C,QAAQ,EAAE;QACR,EAAE,GAAG,EAAE,GAAG,QAAQ,kBAAkB,EAAE;QACtC,EAAE,GAAG,EAAE,GAAG,QAAQ,mCAAmC,EAAE;KACxD;IACD,UAAU,EAAE;QACV,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,KAAK;QACd,GAAG,EAAE;YACH,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;SAC1D;KACF;IACD,GAAG,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CACvB,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/D,CAAC;AAEF,6BAA6B;AAC7B,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/capabilities/config/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The config write bodies (lazily imported, off the fast path).
|
|
3
|
+
*
|
|
4
|
+
* {@link runField} resolves the single positional and composes the write as a
|
|
5
|
+
* Task over the kernel `writeConfigField` (global-layer only). An enum field
|
|
6
|
+
* re-validates its value as a belt-and-braces backstop — the CLI `coerceParam`
|
|
7
|
+
* and the MCP zod schema already reject a non-member before `run`, but a
|
|
8
|
+
* direct call (a test, a future caller) must not slip an invalid value to
|
|
9
|
+
* disk. Clearing a field is its own verb ({@link runUnset}); the values that
|
|
10
|
+
* used to double as clear-markers are refused with the verb named.
|
|
11
|
+
*/
|
|
12
|
+
import { map } from "@canonical/task";
|
|
13
|
+
import { writeConfigField } from "../../kernel/config/index.js";
|
|
14
|
+
import { cliRecovery, PragmaError } from "../../kernel/error/index.js";
|
|
15
|
+
import { RESERVED_CLEAR_VALUES } from "./fields.js";
|
|
16
|
+
/**
|
|
17
|
+
* Build the Task that writes one config field.
|
|
18
|
+
*
|
|
19
|
+
* @param spec - The field-table row for the target field.
|
|
20
|
+
* @param params - The coerced param bag (carries the single positional).
|
|
21
|
+
* @returns A Task yielding the write outcome.
|
|
22
|
+
* @throws PragmaError INVALID_INPUT for an out-of-set enum value (backstop),
|
|
23
|
+
* or for a reserved clear-marker on a free-string field — clearing is
|
|
24
|
+
* `config unset <key>`'s job, and the error names it.
|
|
25
|
+
*/
|
|
26
|
+
export function runField(spec, params) {
|
|
27
|
+
const value = String(params[spec.positional] ?? "");
|
|
28
|
+
if (spec.kind === "string" && RESERVED_CLEAR_VALUES.includes(value)) {
|
|
29
|
+
throw PragmaError.invalidInput(spec.field, value, {
|
|
30
|
+
recovery: cliRecovery(`config unset ${spec.field}`, "Clear the field with the unset command."),
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if (spec.kind === "enum" && !(spec.values ?? []).includes(value)) {
|
|
34
|
+
throw PragmaError.invalidInput(spec.field, value, {
|
|
35
|
+
validOptions: [...(spec.values ?? [])],
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return map(writeConfigField(spec.field, value), (result) => ({
|
|
39
|
+
field: result.field,
|
|
40
|
+
value,
|
|
41
|
+
path: result.path,
|
|
42
|
+
reset: false,
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Build the Task that clears one config field — removes it from the global
|
|
47
|
+
* layer so the built-in default (or a project config) applies again.
|
|
48
|
+
*
|
|
49
|
+
* @param spec - The field-table row for the target field.
|
|
50
|
+
* @returns A Task yielding the reset outcome.
|
|
51
|
+
*/
|
|
52
|
+
export function runUnset(spec) {
|
|
53
|
+
return map(writeConfigField(spec.field, undefined), (result) => ({
|
|
54
|
+
field: result.field,
|
|
55
|
+
path: result.path,
|
|
56
|
+
reset: true,
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=runField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runField.js","sourceRoot":"","sources":["../../../../src/capabilities/config/runField.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,GAAG,EAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAwB,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAG1E;;;;;;;;;GASG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAqB,EACrB,MAA+B;IAE/B,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC;IAEpD,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,qBAAqB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACpE,MAAM,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE;YAChD,QAAQ,EAAE,WAAW,CACnB,gBAAgB,IAAI,CAAC,KAAK,EAAE,EAC5B,yCAAyC,CAC1C;SACF,CAAC,CAAC;IACL,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACjE,MAAM,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE;YAChD,YAAY,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;SACvC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CACR,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,EACnC,CAAC,MAAM,EAAqB,EAAE,CAAC,CAAC;QAC9B,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,KAAK;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,KAAK;KACb,CAAC,CACH,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAqB;IAC5C,OAAO,GAAG,CACR,gBAAgB,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,CAAC,EACvC,CAAC,MAAM,EAAqB,EAAE,CAAC,CAAC;QAC9B,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,IAAI;KACZ,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `config get <key>` read body (lazily imported, off the fast path).
|
|
3
|
+
*
|
|
4
|
+
* Reads the layered config and projects the one requested field with the
|
|
5
|
+
* layer that supplied it — the same resolution `config show` reports, scoped
|
|
6
|
+
* to a single value.
|
|
7
|
+
*/
|
|
8
|
+
import { readConfig } from "../../kernel/config/index.js";
|
|
9
|
+
import { resolveFieldSpec } from "./runSet.js";
|
|
10
|
+
/**
|
|
11
|
+
* Resolve one config field's effective value and provenance.
|
|
12
|
+
*
|
|
13
|
+
* @param params - The coerced param bag carrying `key`.
|
|
14
|
+
* @param runtime - The per-invocation runtime (its cwd anchors the layering).
|
|
15
|
+
* @returns The field, its resolved value (absent when unset), and its source.
|
|
16
|
+
* @note Impure — reads the config layers from disk.
|
|
17
|
+
*/
|
|
18
|
+
export async function runGet(params, runtime) {
|
|
19
|
+
const spec = resolveFieldSpec(params);
|
|
20
|
+
const layers = await readConfig(runtime.cwd);
|
|
21
|
+
const value = layers.config[spec.field];
|
|
22
|
+
return {
|
|
23
|
+
field: spec.field,
|
|
24
|
+
...(value === undefined ? {} : { value }),
|
|
25
|
+
source: layers.origins[spec.field],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=runGet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runGet.js","sourceRoot":"","sources":["../../../../src/capabilities/config/runGet.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,MAA+B,EAC/B,OAAsB;IAEtB,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO;QACL,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;QACzC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `config set <key> <value>` write body (lazily imported, off the fast path).
|
|
3
|
+
*
|
|
4
|
+
* `config set` is the single-command form of the per-field setters: it resolves
|
|
5
|
+
* `<key>` to its {@link ConfigFieldSpec} and delegates to the SAME
|
|
6
|
+
* {@link runField} write path, so reset sentinels, enum re-validation, and the
|
|
7
|
+
* global-layer write all behave identically to `config <field>`. An unknown key
|
|
8
|
+
* is a backstop INVALID_INPUT — the CLI enum coerce and the MCP schema already
|
|
9
|
+
* reject a non-member first, but a direct call must not slip through.
|
|
10
|
+
*/
|
|
11
|
+
import { PragmaError } from "../../kernel/error/index.js";
|
|
12
|
+
import { CONFIG_FIELDS } from "./fields.js";
|
|
13
|
+
import { runField, runUnset as runFieldUnset } from "./runField.js";
|
|
14
|
+
/**
|
|
15
|
+
* Resolve `<key>` to its field-table row.
|
|
16
|
+
*
|
|
17
|
+
* @param params - The coerced param bag carrying `key`.
|
|
18
|
+
* @returns The matching {@link ConfigFieldSpec}.
|
|
19
|
+
* @throws PragmaError INVALID_INPUT for an unknown key (backstop — the CLI
|
|
20
|
+
* enum coerce and the MCP schema already reject a non-member first).
|
|
21
|
+
*/
|
|
22
|
+
export function resolveFieldSpec(params) {
|
|
23
|
+
const key = String(params.key ?? "");
|
|
24
|
+
const spec = CONFIG_FIELDS.find((field) => field.field === key);
|
|
25
|
+
if (!spec) {
|
|
26
|
+
throw PragmaError.invalidInput("key", key, {
|
|
27
|
+
validOptions: CONFIG_FIELDS.map((field) => field.field),
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return spec;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Build the Task that writes the config field named by `<key>`.
|
|
34
|
+
*
|
|
35
|
+
* @param params - The coerced param bag: `key` (field name) and `value`.
|
|
36
|
+
* @returns A Task yielding the write outcome.
|
|
37
|
+
*/
|
|
38
|
+
export function runSet(params) {
|
|
39
|
+
const spec = resolveFieldSpec(params);
|
|
40
|
+
// Re-key the value under the field's own positional (`path`/`name`/`level`) so
|
|
41
|
+
// runField reads it exactly as the per-field verb would.
|
|
42
|
+
return runField(spec, { [spec.positional]: String(params.value ?? "") });
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Build the Task that clears the config field named by `<key>`.
|
|
46
|
+
*
|
|
47
|
+
* @param params - The coerced param bag carrying `key`.
|
|
48
|
+
* @returns A Task yielding the reset outcome.
|
|
49
|
+
*/
|
|
50
|
+
export function runUnset(params) {
|
|
51
|
+
return runFieldUnset(resolveFieldSpec(params));
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=runSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runSet.js","sourceRoot":"","sources":["../../../../src/capabilities/config/runSet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAwB,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,eAAe,CAAC;AAGpE;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAA+B;IAE/B,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,GAAG,CAAC,CAAC;IAChE,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,WAAW,CAAC,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE;YACzC,YAAY,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;SACxD,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CACpB,MAA+B;IAE/B,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACtC,+EAA+E;IAC/E,yDAAyD;IACzD,OAAO,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CACtB,MAA+B;IAE/B,OAAO,aAAa,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `config set <key> <value>` — the one-command config setter (ADDITIVE).
|
|
3
|
+
*
|
|
4
|
+
* The single form for writing config: `pragma config set tier apps/lxd`. Since
|
|
5
|
+
* AV-228 B3 retired the per-field `config tier`/`channel`/`detail` verbs, this
|
|
6
|
+
* is now the ONLY config setter. It drives the shared write path (`runField`
|
|
7
|
+
* via `runSet`), so it inherits enum re-validation and the global-layer-only
|
|
8
|
+
* write from the {@link CONFIG_FIELDS} table; clearing a field is `config
|
|
9
|
+
* unset <key>`'s job.
|
|
10
|
+
*
|
|
11
|
+
* Covenant shape: `<key>` is an ENUM over the field names (better completion +
|
|
12
|
+
* validation; the token still emits as `<key>`), `<value>` a free string, so
|
|
13
|
+
* the verb emits `{ v:"set", args:["<key>","<value>"], mutates:true,
|
|
14
|
+
* mcp:"config_set" }` — no flags, storeless, exposed to MCP.
|
|
15
|
+
*/
|
|
16
|
+
import { BIN_NAME } from "../../constants.js";
|
|
17
|
+
import { asVerb } from "../../kernel/spec/asVerb.js";
|
|
18
|
+
import { configFieldFormatters } from "./field.render.js";
|
|
19
|
+
import { CONFIG_FIELDS } from "./fields.js";
|
|
20
|
+
/** The writable field names, in covenant order — the `<key>` enum. */
|
|
21
|
+
const CONFIG_KEYS = CONFIG_FIELDS.map((field) => field.field);
|
|
22
|
+
const setVerb = {
|
|
23
|
+
path: ["config", "set"],
|
|
24
|
+
summary: "Set a config field by name.",
|
|
25
|
+
doc: "Write a global config field by name. `key` is one of `tier`, `channel`, or `detail`; clearing a field is `config unset <key>`'s job, and the values that used to double as clear-markers are refused. Written to the global layer only — project configs are authored by hand.",
|
|
26
|
+
params: [
|
|
27
|
+
{
|
|
28
|
+
kind: "enum",
|
|
29
|
+
name: "key",
|
|
30
|
+
doc: "The config field to write.",
|
|
31
|
+
values: CONFIG_KEYS,
|
|
32
|
+
required: true,
|
|
33
|
+
positional: true,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
kind: "string",
|
|
37
|
+
name: "value",
|
|
38
|
+
doc: "The value to write.",
|
|
39
|
+
required: true,
|
|
40
|
+
positional: true,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
output: { formatters: configFieldFormatters },
|
|
44
|
+
examples: [
|
|
45
|
+
{
|
|
46
|
+
cmd: `${BIN_NAME} config set tier apps/lxd`,
|
|
47
|
+
note: "scope reads to a tier",
|
|
48
|
+
},
|
|
49
|
+
{ cmd: `${BIN_NAME} config set channel experimental` },
|
|
50
|
+
{ cmd: `${BIN_NAME} config unset tier`, note: "clear the tier" },
|
|
51
|
+
],
|
|
52
|
+
capability: {
|
|
53
|
+
needsStore: false,
|
|
54
|
+
mutates: true,
|
|
55
|
+
mcp: {
|
|
56
|
+
expose: true,
|
|
57
|
+
annotations: { readOnlyHint: false, openWorldHint: false },
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
// Lazily import the write body (off the fast path); the `Task` arm is the same
|
|
61
|
+
// honest cast the per-field verbs use — see fields.ts.
|
|
62
|
+
run: (params) => import("./runSet.js").then((m) => m.runSet(params)),
|
|
63
|
+
};
|
|
64
|
+
/** The `config set` verb. */
|
|
65
|
+
export const configSetVerb = asVerb(setVerb);
|
|
66
|
+
//# sourceMappingURL=set.verb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set.verb.js","sourceRoot":"","sources":["../../../../src/capabilities/config/set.verb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,sEAAsE;AACtE,MAAM,WAAW,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAE9D,MAAM,OAAO,GAAyD;IACpE,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC;IACvB,OAAO,EAAE,6BAA6B;IACtC,GAAG,EAAE,gRAAgR;IACrR,MAAM,EAAE;QACN;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,KAAK;YACX,GAAG,EAAE,4BAA4B;YACjC,MAAM,EAAE,WAAW;YACnB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;SACjB;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,OAAO;YACb,GAAG,EAAE,qBAAqB;YAC1B,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,IAAI;SACjB;KACF;IACD,MAAM,EAAE,EAAE,UAAU,EAAE,qBAAqB,EAAE;IAC7C,QAAQ,EAAE;QACR;YACE,GAAG,EAAE,GAAG,QAAQ,2BAA2B;YAC3C,IAAI,EAAE,uBAAuB;SAC9B;QACD,EAAE,GAAG,EAAE,GAAG,QAAQ,kCAAkC,EAAE;QACtD,EAAE,GAAG,EAAE,GAAG,QAAQ,oBAAoB,EAAE,IAAI,EAAE,gBAAgB,EAAE;KACjE;IACD,UAAU,EAAE;QACV,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,IAAI;QACb,GAAG,EAAE;YACH,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE;SAC3D;KACF;IACD,+EAA+E;IAC/E,uDAAuD;IACvD,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,CACd,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAC/B,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CACqB;CAC1C,CAAC;AAEF,6BAA6B;AAC7B,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatters for `pragma config show` — plain, llm, json (no ink).
|
|
3
|
+
*
|
|
4
|
+
* Each resolved field carries a `[global]`/`[project]` origin marker so the
|
|
5
|
+
* user sees which layer won; default values carry no marker. Ported from the
|
|
6
|
+
* v1 config-show formatters.
|
|
7
|
+
*/
|
|
8
|
+
import { defaultStyle } from "../../kernel/render/style.js";
|
|
9
|
+
/** A `[layer]` marker for values a config file supplied (blank for defaults). */
|
|
10
|
+
function originMarker(origin) {
|
|
11
|
+
return origin === "default" ? "" : ` [${origin}]`;
|
|
12
|
+
}
|
|
13
|
+
/** Summarize a list of named entries as a comma-separated set of names. */
|
|
14
|
+
function entryNames(entries) {
|
|
15
|
+
const names = entries.map((entry) => typeof entry === "string" ? entry : entry.name);
|
|
16
|
+
return names.length > 0 ? names.join(", ") : "(none)";
|
|
17
|
+
}
|
|
18
|
+
/** The resolved rows, in display order, shared by the plain + beautified forms. */
|
|
19
|
+
function configRows(data) {
|
|
20
|
+
const { config, origins } = data;
|
|
21
|
+
return [
|
|
22
|
+
["tier", config.tier ?? "(none)", originMarker(origins.tier)],
|
|
23
|
+
["channel", config.channel, originMarker(origins.channel)],
|
|
24
|
+
["detail", config.detail ?? "standard", originMarker(origins.detail)],
|
|
25
|
+
["packs", entryNames(config.packs ?? []), originMarker(origins.packs)],
|
|
26
|
+
[
|
|
27
|
+
"global config",
|
|
28
|
+
`${data.globalConfigPath}${data.globalExists ? "" : " (not found)"}`,
|
|
29
|
+
"",
|
|
30
|
+
],
|
|
31
|
+
["project config", data.projectConfigPath ?? "(not found)", ""],
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Render `config show` as plain text.
|
|
36
|
+
*
|
|
37
|
+
* @param data - The resolved config-show payload.
|
|
38
|
+
* @param style - TTY styling; defaults to the process style. On a color-capable
|
|
39
|
+
* terminal the `key:` column is aligned + dim, values cyan, and `[layer]`
|
|
40
|
+
* markers dim; off a TTY the styler is inert, so the output is byte-identical
|
|
41
|
+
* to the pre-beautify `key: value[marker]` form.
|
|
42
|
+
* @returns The formatted config block.
|
|
43
|
+
*/
|
|
44
|
+
export function renderConfigShowPlain(data, style = defaultStyle()) {
|
|
45
|
+
const rows = configRows(data);
|
|
46
|
+
if (!style.enabled) {
|
|
47
|
+
return rows
|
|
48
|
+
.map(([label, value, marker]) => `${label}: ${value}${marker}`)
|
|
49
|
+
.join("\n");
|
|
50
|
+
}
|
|
51
|
+
const keyWidth = Math.max(...rows.map(([label]) => `${label}:`.length));
|
|
52
|
+
return rows
|
|
53
|
+
.map(([label, value, marker]) => {
|
|
54
|
+
const key = style.dim(`${label}:`.padEnd(keyWidth));
|
|
55
|
+
const tail = marker ? style.dim(marker) : "";
|
|
56
|
+
return `${key} ${style.cyan(value)}${tail}`;
|
|
57
|
+
})
|
|
58
|
+
.join("\n");
|
|
59
|
+
}
|
|
60
|
+
export const configShowFormatters = {
|
|
61
|
+
plain(data) {
|
|
62
|
+
return renderConfigShowPlain(data);
|
|
63
|
+
},
|
|
64
|
+
llm(data) {
|
|
65
|
+
const { config, origins } = data;
|
|
66
|
+
const lines = [
|
|
67
|
+
"## Configuration",
|
|
68
|
+
"",
|
|
69
|
+
`- **Tier:** ${config.tier ?? "none"}${originMarker(origins.tier)}`,
|
|
70
|
+
`- **Channel:** ${config.channel}${originMarker(origins.channel)}`,
|
|
71
|
+
`- **Detail:** ${config.detail ?? "standard"}${originMarker(origins.detail)}`,
|
|
72
|
+
`- **Packs:** ${entryNames(config.packs ?? [])}${originMarker(origins.packs)}`,
|
|
73
|
+
`- **Global config:** \`${data.globalConfigPath}\``,
|
|
74
|
+
];
|
|
75
|
+
if (data.projectConfigPath) {
|
|
76
|
+
lines.push(`- **Project config:** \`${data.projectConfigPath}\``);
|
|
77
|
+
}
|
|
78
|
+
return lines.join("\n");
|
|
79
|
+
},
|
|
80
|
+
json(data) {
|
|
81
|
+
return JSON.stringify(data);
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=show.render.js.map
|