@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,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `sources update` verb — resolve the configured packs, build the store,
|
|
3
|
+
* and point the project at it.
|
|
4
|
+
*
|
|
5
|
+
* A mutation (`mutates: true`) that needs the network (`needsNetwork: true`)
|
|
6
|
+
* but NOT the pre-booted store (`needsStore: false`): update is what *creates*
|
|
7
|
+
* the store, so the dispatcher must not try to boot it first (a cold boot would
|
|
8
|
+
* throw STORE_UNAVAILABLE). `run` returns a `Promise<Task<R>>` — the union's
|
|
9
|
+
* third arm — which the dispatcher awaits: for a real execution it resolves and
|
|
10
|
+
* builds before handing back the pointer-writing Task; for a preview
|
|
11
|
+
* (`runtime.mutation.preview`) it stays network-free and hands back a
|
|
12
|
+
* plan-only Task.
|
|
13
|
+
*/
|
|
14
|
+
import { BIN_NAME } from "../../constants.js";
|
|
15
|
+
import { updateFormatters } from "./update.render.js";
|
|
16
|
+
/** The `sources update` verb spec. */
|
|
17
|
+
export const updateVerb = {
|
|
18
|
+
path: ["sources", "update"],
|
|
19
|
+
summary: "Resolve configured packs and build the local store from them.",
|
|
20
|
+
doc: "Resolves each configured pack (git, file, or npm) and builds one local pack from them, which every later run reads without touching the network. Put a commit SHA in a pack source ref to pin it to that revision.",
|
|
21
|
+
params: [
|
|
22
|
+
{
|
|
23
|
+
kind: "boolean",
|
|
24
|
+
name: "skipInvalid",
|
|
25
|
+
doc: "Build from the sources that parse, warning about each one that does not, instead of failing the whole update.",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
output: { formatters: updateFormatters },
|
|
29
|
+
examples: [
|
|
30
|
+
{ cmd: `${BIN_NAME} sources update`, note: "resolve and build" },
|
|
31
|
+
{
|
|
32
|
+
cmd: `${BIN_NAME} sources update --skip-invalid`,
|
|
33
|
+
note: "build from the sources that parse, and name the ones dropped",
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
capability: {
|
|
37
|
+
needsStore: false,
|
|
38
|
+
mutates: true,
|
|
39
|
+
needsNetwork: true,
|
|
40
|
+
mcp: {
|
|
41
|
+
expose: true,
|
|
42
|
+
annotations: { readOnlyHint: false, openWorldHint: true },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
// `run` really returns `Promise<Task<R>>`: `buildUpdateTask` awaits config
|
|
46
|
+
// (and, on a real execution, resolves + builds) before handing back the
|
|
47
|
+
// pointer-writing Task — or, when `runtime.mutation.preview` is set, a
|
|
48
|
+
// network-free plan Task. The dispatcher and MCP handler both `await` this
|
|
49
|
+
// promise into a `Task`. The `VerbSpec.run` union is deliberately two-armed
|
|
50
|
+
// (`Promise<R> | Task<R>`) — a third `Promise<Task<R>>` arm would poison async
|
|
51
|
+
// read-verb inference — so the awaited-away Promise is presented through the
|
|
52
|
+
// `Task<R>` arm by this single, honest cast.
|
|
53
|
+
run: (params, runtime) => import("./runUpdate.js").then((module) => module.buildUpdateTask(runtime, params.skipInvalid === true)),
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=update.verb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.verb.js","sourceRoot":"","sources":["../../../../src/capabilities/sources/update.verb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,sCAAsC;AACtC,MAAM,CAAC,MAAM,UAAU,GAGnB;IACF,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IAC3B,OAAO,EAAE,+DAA+D;IACxE,GAAG,EAAE,oNAAoN;IACzN,MAAM,EAAE;QACN;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,aAAa;YACnB,GAAG,EAAE,+GAA+G;SACrH;KACF;IACD,MAAM,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE;IACxC,QAAQ,EAAE;QACR,EAAE,GAAG,EAAE,GAAG,QAAQ,iBAAiB,EAAE,IAAI,EAAE,mBAAmB,EAAE;QAChE;YACE,GAAG,EAAE,GAAG,QAAQ,gCAAgC;YAChD,IAAI,EAAE,8DAA8D;SACrE;KACF;IACD,UAAU,EAAE;QACV,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,IAAI;QACb,YAAY,EAAE,IAAI;QAClB,GAAG,EAAE;YACH,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE;SAC1D;KACF;IACD,2EAA2E;IAC3E,wEAAwE;IACxE,uEAAuE;IACvE,2EAA2E;IAC3E,4EAA4E;IAC5E,+EAA+E;IAC/E,6EAA6E;IAC7E,6CAA6C;IAC7C,GAAG,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CACvB,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CACvC,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,WAAW,KAAK,IAAI,CAAC,CACvB;CAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/capabilities/upgrade/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the `upgrade` Task (lazily imported, off the fast path).
|
|
3
|
+
*
|
|
4
|
+
* Async-setup then compose: read the channel, detect the install source, and
|
|
5
|
+
* check the registry (a preview-safe READ — no side effect), then return a Task
|
|
6
|
+
* shaped by the outcome. The `exec` effect is the SOLE mutation, so the effect
|
|
7
|
+
* seam does the rest for free:
|
|
8
|
+
*
|
|
9
|
+
* - `--dry-run` (dispatcher `dryRun`) MOCKS the exec and describes the plan —
|
|
10
|
+
* both the `Log` version-delta line AND the `Execute: <command>` line show,
|
|
11
|
+
* and nothing runs.
|
|
12
|
+
* - `--yes` / MCP `confirm` runs the exec for real; a nonzero exit is surfaced
|
|
13
|
+
* by `assertExecOk` as an actionable UNSUPPORTED (exit 1) — the interpreter
|
|
14
|
+
* RESOLVES on a nonzero exit, so the check is the consumer's job.
|
|
15
|
+
* - offline / already-latest carry NO exec — a real run just returns the status.
|
|
16
|
+
* - a non-global install (linked / ephemeral / workspace / unknown) also
|
|
17
|
+
* carries NO exec even when an update exists: there is no command pragma may
|
|
18
|
+
* run for it, so the task reports the delta plus the state's guidance and
|
|
19
|
+
* mutates nothing. `pmUpdateCommand` only accepts the global arm, so this is
|
|
20
|
+
* enforced by the types, not by convention.
|
|
21
|
+
*
|
|
22
|
+
* The whole registry read is preview-safe, so no `mutation.preview` gating is
|
|
23
|
+
* needed here (unlike `sources update`, whose heavy resolve must be gated).
|
|
24
|
+
* `run` returns `Promise<Task<R>>`, presented through the `Task<R>` arm by the
|
|
25
|
+
* honest cast at the verb (the `update.verb.ts` precedent).
|
|
26
|
+
*/
|
|
27
|
+
import { $, exec, gen, info, warn } from "@canonical/task";
|
|
28
|
+
import { assertExecOk, checkRegistryVersion, detectInstallSource, guardMissingBinary, PRAGMA_PACKAGE, pmUpdateCommand, updateGuidance, } from "../shared/index.js";
|
|
29
|
+
/**
|
|
30
|
+
* Resolve the upgrade state and compose the corresponding Task.
|
|
31
|
+
*
|
|
32
|
+
* @param rt - The per-invocation runtime.
|
|
33
|
+
* @returns A Task yielding the upgrade outcome (its exec runs only on a real,
|
|
34
|
+
* update-needed execution).
|
|
35
|
+
* @note Impure — reads the config + the registry (the exec is the only mutation,
|
|
36
|
+
* and it runs only under a real, update-needed execution).
|
|
37
|
+
*/
|
|
38
|
+
export async function runUpgrade(rt) {
|
|
39
|
+
const { channel } = (await rt.loadConfig()).config;
|
|
40
|
+
const install = detectInstallSource();
|
|
41
|
+
// Only a GLOBAL install has a sanctioned update command — the type of
|
|
42
|
+
// `pmUpdateCommand` enforces the narrowing. A linked checkout in particular
|
|
43
|
+
// must never be handed `npm i -g`: it would overwrite the development link.
|
|
44
|
+
const command = install.kind === "global"
|
|
45
|
+
? pmUpdateCommand(install, PRAGMA_PACKAGE)
|
|
46
|
+
: undefined;
|
|
47
|
+
const pm = install.label;
|
|
48
|
+
const kind = install.kind;
|
|
49
|
+
const current = rt.version;
|
|
50
|
+
const registry = await checkRegistryVersion(PRAGMA_PACKAGE, channel);
|
|
51
|
+
if (registry === undefined) {
|
|
52
|
+
const data = {
|
|
53
|
+
pm,
|
|
54
|
+
kind,
|
|
55
|
+
current,
|
|
56
|
+
latest: undefined,
|
|
57
|
+
...(command !== undefined ? { command } : {}),
|
|
58
|
+
offline: true,
|
|
59
|
+
alreadyLatest: false,
|
|
60
|
+
executed: false,
|
|
61
|
+
};
|
|
62
|
+
return gen(function* () {
|
|
63
|
+
yield* $(warn("Cannot reach the registry — skipped the update check."));
|
|
64
|
+
return data;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (registry.latest === current) {
|
|
68
|
+
const data = {
|
|
69
|
+
pm,
|
|
70
|
+
kind,
|
|
71
|
+
current,
|
|
72
|
+
latest: registry.latest,
|
|
73
|
+
...(command !== undefined ? { command } : {}),
|
|
74
|
+
offline: false,
|
|
75
|
+
alreadyLatest: true,
|
|
76
|
+
executed: false,
|
|
77
|
+
};
|
|
78
|
+
return gen(function* () {
|
|
79
|
+
yield* $(info(`Already at the latest version (${current}).`));
|
|
80
|
+
return data;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
if (install.kind !== "global") {
|
|
84
|
+
// An update exists, but this install has no command pragma may run for
|
|
85
|
+
// it — say so honestly and run NOTHING. (The discriminant narrowing is
|
|
86
|
+
// what lets `updateGuidance` accept `install` here.)
|
|
87
|
+
const guidance = updateGuidance(install);
|
|
88
|
+
const data = {
|
|
89
|
+
pm,
|
|
90
|
+
kind,
|
|
91
|
+
current,
|
|
92
|
+
latest: registry.latest,
|
|
93
|
+
guidance,
|
|
94
|
+
offline: false,
|
|
95
|
+
alreadyLatest: false,
|
|
96
|
+
executed: false,
|
|
97
|
+
};
|
|
98
|
+
return gen(function* () {
|
|
99
|
+
yield* $(info(`${current} → ${registry.latest}`));
|
|
100
|
+
yield* $(warn(`No automatic upgrade for this install: ${guidance}`));
|
|
101
|
+
return data;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
const updateCommand = pmUpdateCommand(install, PRAGMA_PACKAGE);
|
|
105
|
+
const data = {
|
|
106
|
+
pm,
|
|
107
|
+
kind,
|
|
108
|
+
current,
|
|
109
|
+
latest: registry.latest,
|
|
110
|
+
command: updateCommand,
|
|
111
|
+
offline: false,
|
|
112
|
+
alreadyLatest: false,
|
|
113
|
+
executed: true,
|
|
114
|
+
};
|
|
115
|
+
const parts = updateCommand.split(" ");
|
|
116
|
+
const bin = parts[0] ?? "npm";
|
|
117
|
+
const args = parts.slice(1);
|
|
118
|
+
// Guard the spawn: an absent package manager (`bin` not on PATH) REJECTS the
|
|
119
|
+
// exec with ENOENT, which would collapse to INTERNAL_ERROR ("report
|
|
120
|
+
// this issue"). Surface it as a named "`<pm>` not found on PATH" instead.
|
|
121
|
+
return guardMissingBinary(bin, {
|
|
122
|
+
message: `Install ${pm} (or your package manager) and ensure it is on your PATH, then try again.`,
|
|
123
|
+
}, gen(function* () {
|
|
124
|
+
// The version-delta rides a Log effect, so `--dry-run` describes it too.
|
|
125
|
+
yield* $(info(`${current} → ${registry.latest}`));
|
|
126
|
+
// The one mutation — mocked under dry-run, run for real under --yes/confirm.
|
|
127
|
+
// The interpreter RESOLVES on a nonzero exit (only a spawn error rejects),
|
|
128
|
+
// so inspect the result: a failed install (e.g. EACCES on a global
|
|
129
|
+
// `npm i -g`) must fail loudly, not report a silent success.
|
|
130
|
+
const result = yield* $(exec(bin, args, rt.cwd));
|
|
131
|
+
assertExecOk(updateCommand, result);
|
|
132
|
+
return data;
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=runUpgrade.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runUpgrade.js","sourceRoot":"","sources":["../../../../src/capabilities/upgrade/runUpgrade.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAa,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEtE,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,EAAiB;IAEjB,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;IACnD,MAAM,OAAO,GAAG,mBAAmB,EAAE,CAAC;IACtC,sEAAsE;IACtE,4EAA4E;IAC5E,4EAA4E;IAC5E,MAAM,OAAO,GACX,OAAO,CAAC,IAAI,KAAK,QAAQ;QACvB,CAAC,CAAC,eAAe,CAAC,OAAO,EAAE,cAAc,CAAC;QAC1C,CAAC,CAAC,SAAS,CAAC;IAChB,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC;IACzB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1B,MAAM,OAAO,GAAG,EAAE,CAAC,OAAO,CAAC;IAE3B,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IAErE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAgB;YACxB,EAAE;YACF,IAAI;YACJ,OAAO;YACP,MAAM,EAAE,SAAS;YACjB,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7C,OAAO,EAAE,IAAI;YACb,aAAa,EAAE,KAAK;YACpB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,OAAO,GAAG,CAAC,QAAQ,CAAC;YAClB,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC,CAAC;YACxE,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;QAChC,MAAM,IAAI,GAAgB;YACxB,EAAE;YACF,IAAI;YACJ,OAAO;YACP,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7C,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,IAAI;YACnB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,OAAO,GAAG,CAAC,QAAQ,CAAC;YAClB,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,kCAAkC,OAAO,IAAI,CAAC,CAAC,CAAC;YAC9D,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC9B,uEAAuE;QACvE,uEAAuE;QACvE,qDAAqD;QACrD,MAAM,QAAQ,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QACzC,MAAM,IAAI,GAAgB;YACxB,EAAE;YACF,IAAI;YACJ,OAAO;YACP,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,QAAQ;YACR,OAAO,EAAE,KAAK;YACd,aAAa,EAAE,KAAK;YACpB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,OAAO,GAAG,CAAC,QAAQ,CAAC;YAClB,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAClD,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,0CAA0C,QAAQ,EAAE,CAAC,CAAC,CAAC;YACrE,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,aAAa,GAAG,eAAe,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAgB;QACxB,EAAE;QACF,IAAI;QACJ,OAAO;QACP,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,OAAO,EAAE,aAAa;QACtB,OAAO,EAAE,KAAK;QACd,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC;IAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5B,6EAA6E;IAC7E,oEAAoE;IACpE,0EAA0E;IAC1E,OAAO,kBAAkB,CACvB,GAAG,EACH;QACE,OAAO,EAAE,WAAW,EAAE,2EAA2E;KAClG,EACD,GAAG,CAAC,QAAQ,CAAC;QACX,yEAAyE;QACzE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAClD,6EAA6E;QAC7E,2EAA2E;QAC3E,mEAAmE;QACnE,6DAA6D;QAC7D,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,YAAY,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/capabilities/upgrade/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatters for `pragma upgrade` — plain (chalk), llm, json.
|
|
3
|
+
*
|
|
4
|
+
* Renders the REAL-run outcome (the `--dry-run` plan is rendered by the
|
|
5
|
+
* dispatcher's plan renderer, not here), so there is no "would run" branch: a
|
|
6
|
+
* needed run always carries `executed: true`.
|
|
7
|
+
*/
|
|
8
|
+
import chalk from "chalk";
|
|
9
|
+
import { PRAGMA_PACKAGE } from "../shared/index.js";
|
|
10
|
+
export const upgradeFormatters = {
|
|
11
|
+
plain(data) {
|
|
12
|
+
const lines = [`Installed via: ${data.pm}`];
|
|
13
|
+
if (data.offline) {
|
|
14
|
+
lines.push("Cannot reach the registry — try again later.");
|
|
15
|
+
return lines.join("\n");
|
|
16
|
+
}
|
|
17
|
+
if (data.alreadyLatest) {
|
|
18
|
+
lines.push(`Already at the latest version (${data.current}).`);
|
|
19
|
+
return lines.join("\n");
|
|
20
|
+
}
|
|
21
|
+
lines.push("", `${PRAGMA_PACKAGE} ${data.current} → ${chalk.green(String(data.latest))}`, "");
|
|
22
|
+
if (data.executed) {
|
|
23
|
+
lines.push(`Ran: ${chalk.cyan(data.command)}`, "", `Updated to ${data.latest}.`);
|
|
24
|
+
}
|
|
25
|
+
else if (data.command) {
|
|
26
|
+
lines.push(`Run: ${chalk.cyan(data.command)}`);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
// No sanctioned command for this install (linked / ephemeral /
|
|
30
|
+
// workspace / unknown) — the guidance sentence is the whole story.
|
|
31
|
+
lines.push(`No automatic upgrade for this install: ${data.guidance}`);
|
|
32
|
+
}
|
|
33
|
+
return lines.join("\n");
|
|
34
|
+
},
|
|
35
|
+
llm(data) {
|
|
36
|
+
if (data.offline)
|
|
37
|
+
return "Upgrade check failed: cannot reach the registry.";
|
|
38
|
+
if (data.alreadyLatest) {
|
|
39
|
+
return `Already at the latest version (${data.current}).`;
|
|
40
|
+
}
|
|
41
|
+
if (data.executed)
|
|
42
|
+
return `Upgraded: ${data.current} → ${data.latest}`;
|
|
43
|
+
if (data.command) {
|
|
44
|
+
return `Update available: ${data.current} → ${data.latest} (\`${data.command}\`)`;
|
|
45
|
+
}
|
|
46
|
+
return `Update available: ${data.current} → ${data.latest} — ${data.guidance}`;
|
|
47
|
+
},
|
|
48
|
+
json(data) {
|
|
49
|
+
return JSON.stringify(data);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=upgrade.render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.render.js","sourceRoot":"","sources":["../../../../src/capabilities/upgrade/upgrade.render.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,MAAM,CAAC,MAAM,iBAAiB,GAA4B;IACxD,KAAK,CAAC,IAAI;QACR,MAAM,KAAK,GAAG,CAAC,kBAAkB,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5C,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,KAAK,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;YAC3D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QACD,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,KAAK,CAAC,IAAI,CAAC,kCAAkC,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;YAC/D,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QACD,KAAK,CAAC,IAAI,CACR,EAAE,EACF,GAAG,cAAc,KAAK,IAAI,CAAC,OAAO,MAAM,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,EAC1E,EAAE,CACH,CAAC;QACF,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,KAAK,CAAC,IAAI,CACR,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAClC,EAAE,EACF,cAAc,IAAI,CAAC,MAAM,GAAG,CAC7B,CAAC;QACJ,CAAC;aAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACxB,KAAK,CAAC,IAAI,CAAC,QAAQ,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACjD,CAAC;aAAM,CAAC;YACN,+DAA+D;YAC/D,mEAAmE;YACnE,KAAK,CAAC,IAAI,CAAC,0CAA0C,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxE,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,GAAG,CAAC,IAAI;QACN,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO,kDAAkD,CAAC;QAC5E,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,OAAO,kCAAkC,IAAI,CAAC,OAAO,IAAI,CAAC;QAC5D,CAAC;QACD,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO,aAAa,IAAI,CAAC,OAAO,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;QACvE,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,qBAAqB,IAAI,CAAC,OAAO,MAAM,IAAI,CAAC,MAAM,OAAO,IAAI,CAAC,OAAO,KAAK,CAAC;QACpF,CAAC;QACD,OAAO,qBAAqB,IAAI,CAAC,OAAO,MAAM,IAAI,CAAC,MAAM,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;IACjF,CAAC;IAED,IAAI,CAAC,IAAI;QACP,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `upgrade` verb spec (noun `upgrade`, self-verb).
|
|
3
|
+
*
|
|
4
|
+
* A storeless, network-touching mutation: check the registry, then run the
|
|
5
|
+
* package-manager update. `destructive: false` is load-bearing (D4) — upgrading
|
|
6
|
+
* replaces the binary, it destroys no user data — so `annotationsFor` emits
|
|
7
|
+
* `destructiveHint: false` rather than letting MCP clients default an unset hint
|
|
8
|
+
* on a non-read-only tool to `true`.
|
|
9
|
+
*
|
|
10
|
+
* `run` returns `Promise<Task<UpgradeData>>` (async registry read before the
|
|
11
|
+
* effects are known) presented through the `Task<R>` arm by the honest cast —
|
|
12
|
+
* the `update.verb.ts` precedent; a literal `Promise<Task>` union arm would
|
|
13
|
+
* poison async read-verb inference.
|
|
14
|
+
*/
|
|
15
|
+
import { BIN_NAME } from "../../constants.js";
|
|
16
|
+
import { asVerb } from "../../kernel/spec/asVerb.js";
|
|
17
|
+
import { upgradeFormatters } from "./upgrade.render.js";
|
|
18
|
+
const upgradeVerb = {
|
|
19
|
+
path: ["upgrade"],
|
|
20
|
+
summary: `Upgrade the ${BIN_NAME} CLI to the latest version.`,
|
|
21
|
+
doc: "Checks the registry for the active channel's latest release and runs your package manager's global-update command. Preview the update before applying it.",
|
|
22
|
+
params: [],
|
|
23
|
+
output: { formatters: upgradeFormatters },
|
|
24
|
+
examples: [
|
|
25
|
+
{ cmd: `${BIN_NAME} upgrade` },
|
|
26
|
+
{
|
|
27
|
+
cmd: `${BIN_NAME} upgrade --dry-run`,
|
|
28
|
+
note: "show the delta and the command",
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
capability: {
|
|
32
|
+
needsStore: false,
|
|
33
|
+
mutates: true,
|
|
34
|
+
destructive: false,
|
|
35
|
+
needsNetwork: true,
|
|
36
|
+
mcp: {
|
|
37
|
+
expose: true,
|
|
38
|
+
annotations: {
|
|
39
|
+
readOnlyHint: false,
|
|
40
|
+
destructiveHint: false,
|
|
41
|
+
openWorldHint: false,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
run: (_params, runtime) => import("./runUpgrade.js").then((m) => m.runUpgrade(runtime)),
|
|
46
|
+
};
|
|
47
|
+
/** The `upgrade` capability module. */
|
|
48
|
+
export const upgradeModule = {
|
|
49
|
+
name: "upgrade",
|
|
50
|
+
verbs: [asVerb(upgradeVerb)],
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=upgrade.verb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upgrade.verb.js","sourceRoot":"","sources":["../../../../src/capabilities/upgrade/upgrade.verb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,WAAW,GAAmD;IAClE,IAAI,EAAE,CAAC,SAAS,CAAC;IACjB,OAAO,EAAE,eAAe,QAAQ,6BAA6B;IAC7D,GAAG,EAAE,2JAA2J;IAChK,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE,UAAU,EAAE,iBAAiB,EAAE;IACzC,QAAQ,EAAE;QACR,EAAE,GAAG,EAAE,GAAG,QAAQ,UAAU,EAAE;QAC9B;YACE,GAAG,EAAE,GAAG,QAAQ,oBAAoB;YACpC,IAAI,EAAE,gCAAgC;SACvC;KACF;IACD,UAAU,EAAE;QACV,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,IAAI;QAClB,GAAG,EAAE;YACH,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE;gBACX,YAAY,EAAE,KAAK;gBACnB,eAAe,EAAE,KAAK;gBACtB,aAAa,EAAE,KAAK;aACrB;SACF;KACF;IACD,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CACxB,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CACnC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CACU;CACpC,CAAC;AAEF,uCAAuC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAqB;IAC7C,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;CAC7B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `version` capability barrel — the command form of `--version`.
|
|
3
|
+
*/
|
|
4
|
+
import { versionVerbSpec } from "./version.verb.js";
|
|
5
|
+
/** The `version` capability module. */
|
|
6
|
+
export const versionModule = {
|
|
7
|
+
name: "version",
|
|
8
|
+
verbs: [versionVerbSpec],
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/capabilities/version/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,uCAAuC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAqB;IAC7C,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,CAAC,eAAe,CAAC;CACzB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `pragma version` — the command form of `--version`.
|
|
3
|
+
*
|
|
4
|
+
* Users type it reflexively, so it exists and prints exactly the bytes the
|
|
5
|
+
* flag prints: the bare semver on stdout, storeless, no store or network
|
|
6
|
+
* touched. Withheld from MCP — the version already rides `info` and the
|
|
7
|
+
* server handshake's `serverInfo`.
|
|
8
|
+
*/
|
|
9
|
+
import { BIN_NAME, VERSION } from "../../constants.js";
|
|
10
|
+
import { asVerb } from "../../kernel/spec/asVerb.js";
|
|
11
|
+
const versionVerb = {
|
|
12
|
+
path: ["version"],
|
|
13
|
+
summary: "Print the CLI version.",
|
|
14
|
+
doc: "Prints the version `--version` prints — one value, two spellings of the same read.",
|
|
15
|
+
params: [],
|
|
16
|
+
output: {
|
|
17
|
+
formatters: {
|
|
18
|
+
plain: (version) => version,
|
|
19
|
+
llm: (version) => version,
|
|
20
|
+
json: (version) => JSON.stringify({ version }),
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
examples: [{ cmd: `${BIN_NAME} version` }],
|
|
24
|
+
capability: {
|
|
25
|
+
needsStore: false,
|
|
26
|
+
mutates: false,
|
|
27
|
+
mcp: {
|
|
28
|
+
expose: false,
|
|
29
|
+
reason: "the version rides `info` and the MCP handshake's serverInfo",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
run: async () => VERSION,
|
|
33
|
+
};
|
|
34
|
+
/** The `version` verb. */
|
|
35
|
+
export const versionVerbSpec = asVerb(versionVerb);
|
|
36
|
+
//# sourceMappingURL=version.verb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.verb.js","sourceRoot":"","sources":["../../../../src/capabilities/version/version.verb.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAGrD,MAAM,WAAW,GAA8C;IAC7D,IAAI,EAAE,CAAC,SAAS,CAAC;IACjB,OAAO,EAAE,wBAAwB;IACjC,GAAG,EAAE,oFAAoF;IACzF,MAAM,EAAE,EAAE;IACV,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO;YAC3B,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO;YACzB,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAC;SAC/C;KACF;IACD,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,QAAQ,UAAU,EAAE,CAAC;IAC1C,UAAU,EAAE;QACV,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,KAAK;QACd,GAAG,EAAE;YACH,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,6DAA6D;SACtE;KACF;IACD,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,OAAO;CACzB,CAAC;AAEF,0BAA0B;AAC1B,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package-level constants — the distribution's identity, projected.
|
|
3
|
+
*
|
|
4
|
+
* The bin name, MCP server name, description and issues URL are NOT authored
|
|
5
|
+
* here: they are read from the distribution config (`pragma.conf.ts`), so a fork
|
|
6
|
+
* changes values, not code. The import is static because the surfaces that need
|
|
7
|
+
* identity — `--help`, `__complete`, first-run onboarding, the MCP handshake —
|
|
8
|
+
* all run before or without the config layer. That is safe precisely because
|
|
9
|
+
* `pragma.conf.ts` is inert data: a plain object literal whose only import is a
|
|
10
|
+
* type. It reaches no zod schema, no fs, no evaluator. `capabilities/lazy.test.ts`
|
|
11
|
+
* pins that boundary, and `src/identity.test.ts` proves the projection.
|
|
12
|
+
*
|
|
13
|
+
* Also holds the stable cross-cutting enums: output formats here, and the
|
|
14
|
+
* detail levels re-exported from `kernel/config/types.ts`, where the config
|
|
15
|
+
* validator closes the `detail` field over them.
|
|
16
|
+
*/
|
|
17
|
+
import pkg from "../package.json" with { type: "json" };
|
|
18
|
+
import identity from "../pragma.conf.js";
|
|
19
|
+
import { DETAIL_LEVELS } from "./kernel/config/types.js";
|
|
20
|
+
/** CLI binary name — the distribution's `name`. */
|
|
21
|
+
const BIN_NAME = identity.name;
|
|
22
|
+
/**
|
|
23
|
+
* MCP server identity — the same name as the CLI bin, so agents already pointed
|
|
24
|
+
* at the server resolve it unchanged. Also the `serverInfo.name` the server
|
|
25
|
+
* introduces itself with on the wire (paired with {@link VERSION} by
|
|
26
|
+
* `buildServer`), so a peer reads the distribution's declared name, never a
|
|
27
|
+
* hardcoded one.
|
|
28
|
+
*/
|
|
29
|
+
const MCP_SERVER_NAME = identity.name;
|
|
30
|
+
/** One-line program description for help and server metadata. */
|
|
31
|
+
const PROGRAM_DESCRIPTION = identity.help;
|
|
32
|
+
/** Where the distribution asks users to file issues and feedback. */
|
|
33
|
+
const ISSUES_URL = identity.issuesUrl;
|
|
34
|
+
/** Semver version string read from package.json. */
|
|
35
|
+
const VERSION = pkg.version;
|
|
36
|
+
/**
|
|
37
|
+
* The project config filename the walker looks for and every surface that
|
|
38
|
+
* quotes it — diagnostics, the onboarding note, the generated reference, the
|
|
39
|
+
* surface covenant — names. It lives HERE rather than beside the walker so the
|
|
40
|
+
* quoting surfaces do not have to import `kernel/config/**`: the storeless
|
|
41
|
+
* `--help`/`__complete` graph is asserted to reach no config module, and
|
|
42
|
+
* `completion/safety.test.ts` fails the moment one arrives.
|
|
43
|
+
*/
|
|
44
|
+
const PROJECT_CONFIG_FILENAME = `${identity.name}.config.ts`;
|
|
45
|
+
/**
|
|
46
|
+
* The distribution's name plus a space: the prefix a `recovery.cli` hint carries
|
|
47
|
+
* so it quotes a command the installed binary answers to (D5). Kernel hints are
|
|
48
|
+
* authored through `cliRecovery`, which prepends it; `packs/schema.ts` REJECTS
|
|
49
|
+
* it in a user-authored pack's `emptyRecovery.cli`, because the CONSUMING
|
|
50
|
+
* distribution's renderer supplies its own. Use {@link BIN_NAME} for prose —
|
|
51
|
+
* this constant's trailing space belongs to the recovery invariant, not to
|
|
52
|
+
* sentences.
|
|
53
|
+
*/
|
|
54
|
+
const RECOVERY_CLI_PREFIX = `${identity.name} `;
|
|
55
|
+
/** The output formats the renderer selects between (`llm` = condensed Markdown). */
|
|
56
|
+
const OUTPUT_FORMATS = ["plain", "llm", "json"];
|
|
57
|
+
/** Default detail level when neither flag, config, nor spec pins one. */
|
|
58
|
+
const DEFAULT_DETAIL_LEVEL = "standard";
|
|
59
|
+
/**
|
|
60
|
+
* The wordmark `--help` opens with FOR A HUMAN READER, as raw ASCII-art lines.
|
|
61
|
+
*
|
|
62
|
+
* Whether it prints is decided at the one emit site (`rootHelp.ts`) from the
|
|
63
|
+
* invocation's global flags: a captured run (`--format llm`/`json`, including
|
|
64
|
+
* the `llm` a non-interactive stdout infers) gets the bare header instead. This
|
|
65
|
+
* constant is the ART, not the policy.
|
|
66
|
+
*
|
|
67
|
+
* PROJECTED from the distribution config, exactly like {@link BIN_NAME} and
|
|
68
|
+
* {@link PROGRAM_DESCRIPTION} — a wordmark spells a name, so it is identity, and
|
|
69
|
+
* `kernel/copy.test.ts` forbids any kernel string from naming the distribution.
|
|
70
|
+
* Authoring the art here would have branded a fork's front door with someone
|
|
71
|
+
* else's logo; declaring it as data means a fork ships its own or none.
|
|
72
|
+
*
|
|
73
|
+
* Lines rather than one string because the art contains a backtick and
|
|
74
|
+
* backslashes: a template literal would need every one of them escaped, which is
|
|
75
|
+
* how a character gets lost the next time someone edits it.
|
|
76
|
+
*/
|
|
77
|
+
// Read through the DECLARED type, not the literal's inferred one. The
|
|
78
|
+
// distribution config is `satisfies RawConfig`, which narrows to exactly the
|
|
79
|
+
// keys that file writes — so `identity.logo` does not typecheck in a fork that
|
|
80
|
+
// omits the field, which is precisely the fork this feature promises a bare
|
|
81
|
+
// header. The assignment (not a cast) is what `satisfies` already guarantees,
|
|
82
|
+
// and it makes every OPTIONAL field readable here. The other constants keep
|
|
83
|
+
// reading `identity` directly, so their literal types are untouched.
|
|
84
|
+
const declared = identity;
|
|
85
|
+
const PROGRAM_LOGO = declared.logo ?? [];
|
|
86
|
+
export { BIN_NAME, DEFAULT_DETAIL_LEVEL, DETAIL_LEVELS, ISSUES_URL, MCP_SERVER_NAME, OUTPUT_FORMATS, PROGRAM_DESCRIPTION, PROGRAM_LOGO, PROJECT_CONFIG_FILENAME, RECOVERY_CLI_PREFIX, VERSION, };
|
|
87
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACxD,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAoB,MAAM,0BAA0B,CAAC;AAE3E,mDAAmD;AACnD,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC;AAEtC,iEAAiE;AACjE,MAAM,mBAAmB,GAAG,QAAQ,CAAC,IAAI,CAAC;AAE1C,qEAAqE;AACrE,MAAM,UAAU,GAAG,QAAQ,CAAC,SAAS,CAAC;AAEtC,oDAAoD;AACpD,MAAM,OAAO,GAAW,GAAG,CAAC,OAAO,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,uBAAuB,GAAG,GAAG,QAAQ,CAAC,IAAI,YAAY,CAAC;AAE7D;;;;;;;;GAQG;AACH,MAAM,mBAAmB,GAAG,GAAG,QAAQ,CAAC,IAAI,GAAG,CAAC;AAEhD,oFAAoF;AACpF,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAU,CAAC;AASzD,yEAAyE;AACzE,MAAM,oBAAoB,GAAgB,UAAU,CAAC;AAErD;;;;;;;;;;;;;;;;;GAiBG;AACH,sEAAsE;AACtE,6EAA6E;AAC7E,+EAA+E;AAC/E,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,qEAAqE;AACrE,MAAM,QAAQ,GAAc,QAAQ,CAAC;AAErC,MAAM,YAAY,GAAsB,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;AAG5D,OAAO,EACL,QAAQ,EACR,oBAAoB,EACpB,aAAa,EACb,UAAU,EACV,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,YAAY,EACZ,uBAAuB,EACvB,mBAAmB,EACnB,OAAO,GACR,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public, types-only API surface for `@canonical/pragma-cli`.
|
|
3
|
+
*
|
|
4
|
+
* Per the tool-ts convention this barrel exports types only — no runtime
|
|
5
|
+
* values cross the package boundary. Consumers (and the surface emitter's
|
|
6
|
+
* golden) depend on the grammar and cross-cutting shapes, never on internal
|
|
7
|
+
* command builders, projectors, or infrastructure.
|
|
8
|
+
*
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `runComplete` — the `__complete` resolver entry point. THE PROTOCOL:
|
|
3
|
+
*
|
|
4
|
+
* Invocation: `pragma __complete -- <word1> … <current>`
|
|
5
|
+
* - The bin fast-paths `argv[0] === "__complete"` literally, BEFORE
|
|
6
|
+
* global-flag parsing, Commander, config reads, or first-run — the resolver
|
|
7
|
+
* is storeless and config-free by construction. The first `--` after
|
|
8
|
+
* `__complete` is protocol framing and is stripped by the bin (tolerated
|
|
9
|
+
* absent). A later bare `--` belongs to the user's command line and is
|
|
10
|
+
* honoured as end-of-options by the state machine.
|
|
11
|
+
* - Words are the raw argv after the program name, up to and INCLUDING the
|
|
12
|
+
* word being completed — the LAST word is the partial (possibly empty).
|
|
13
|
+
* Words after the cursor are never sent. A leading word equal to the bin
|
|
14
|
+
* name is stripped (some shells include it).
|
|
15
|
+
* - Output: matching candidates, newline-delimited, on stdout. Zero
|
|
16
|
+
* candidates → zero bytes. Nothing else is ever written to stdout.
|
|
17
|
+
* - Exit code: ALWAYS 0. `runComplete` never throws — any internal error
|
|
18
|
+
* degrades to zero candidates so TAB never breaks a shell.
|
|
19
|
+
* - stderr is silent unless `PRAGMA_COMPLETE_DEBUG=1`, which logs the
|
|
20
|
+
* classified context, "nothing" reasons (unknown noun/verb, exhausted
|
|
21
|
+
* positionals, reserved completion kinds), dropped unsafe candidates, and
|
|
22
|
+
* timing.
|
|
23
|
+
* - Shell floors: bash ≥ 4 (mapfile), zsh ≥ 5, fish ≥ 3. bash splits words at
|
|
24
|
+
* `=` (COMP_WORDBREAKS), so the state machine treats `=` tokens around a
|
|
25
|
+
* value-taking flag as transparent.
|
|
26
|
+
*
|
|
27
|
+
* The static scripts (see `emitScripts`) answer structure without exec and
|
|
28
|
+
* invoke `__complete` only for `{kind:"names"}` value contexts; the resolver
|
|
29
|
+
* is nevertheless a complete standalone answer for EVERY context, so the
|
|
30
|
+
* whole grammar is testable through this one function.
|
|
31
|
+
*/
|
|
32
|
+
import { emptyNameSource } from "./entitySource.js";
|
|
33
|
+
import { buildCompletionModel } from "./model.js";
|
|
34
|
+
import { parseWords } from "./parse.js";
|
|
35
|
+
import { completionDebug, resolveRequest } from "./resolve.js";
|
|
36
|
+
/** The default environment: no name sources (callers wire `indexCompletionEnv`). */
|
|
37
|
+
const DEFAULT_ENV = { names: emptyNameSource };
|
|
38
|
+
/**
|
|
39
|
+
* Resolve completions for the given words against the capability modules.
|
|
40
|
+
*
|
|
41
|
+
* Builds the model, parses the words, resolves the request — wrapped in a
|
|
42
|
+
* never-throw guard: on ANY internal error the answer is zero candidates and
|
|
43
|
+
* (under `PRAGMA_COMPLETE_DEBUG=1`) a stderr note, never an exception.
|
|
44
|
+
*
|
|
45
|
+
* @param words - The command words after the program name; the last is the
|
|
46
|
+
* partial being completed (possibly empty).
|
|
47
|
+
* @param modules - The capability modules to derive the model from.
|
|
48
|
+
* @param env - The completion environment; defaults to the empty entity seam.
|
|
49
|
+
* @returns The matching candidates, in offer order.
|
|
50
|
+
*/
|
|
51
|
+
export async function runComplete(words, modules, env = DEFAULT_ENV) {
|
|
52
|
+
const started = performance.now();
|
|
53
|
+
try {
|
|
54
|
+
const model = buildCompletionModel(modules);
|
|
55
|
+
const request = parseWords(words, model);
|
|
56
|
+
const candidates = await resolveRequest(request, model, env);
|
|
57
|
+
completionDebug(`context=${request.context.kind} partial=${JSON.stringify(request.partial)} ` +
|
|
58
|
+
`candidates=${candidates.length} in ${(performance.now() - started).toFixed(1)}ms`);
|
|
59
|
+
return candidates;
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
completionDebug(`error: ${error instanceof Error ? error.message : String(error)}`);
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=complete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"complete.js","sourceRoot":"","sources":["../../../../src/kernel/completion/complete.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG/D,oFAAoF;AACpF,MAAM,WAAW,GAAkB,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;AAE9D;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,KAAwB,EACxB,OAAoC,EACpC,MAAqB,WAAW;IAEhC,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;IAClC,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACzC,MAAM,UAAU,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;QAC7D,eAAe,CACb,WAAW,OAAO,CAAC,OAAO,CAAC,IAAI,YAAY,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG;YAC3E,cAAc,UAAU,CAAC,MAAM,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CACrF,CAAC;QACF,OAAO,UAAU,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,eAAe,CACb,UAAU,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACnE,CAAC;QACF,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|