@canonical/pragma-cli 0.33.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +153 -30
- package/dist/.build-ok +0 -0
- package/dist/package.json +83 -0
- package/dist/pragma.conf.js +814 -0
- package/dist/pragma.conf.js.map +1 -0
- package/dist/src/bin.js +356 -0
- package/dist/src/bin.js.map +1 -0
- package/dist/src/capabilities/capabilities/capabilities.render.js +70 -0
- package/dist/src/capabilities/capabilities/capabilities.render.js.map +1 -0
- package/dist/src/capabilities/capabilities/capabilities.verb.js +59 -0
- package/dist/src/capabilities/capabilities/capabilities.verb.js.map +1 -0
- package/dist/src/capabilities/capabilities/catalog.js +130 -0
- package/dist/src/capabilities/capabilities/catalog.js.map +1 -0
- package/dist/src/capabilities/capabilities/hints.js +195 -0
- package/dist/src/capabilities/capabilities/hints.js.map +1 -0
- package/dist/src/capabilities/capabilities/index.js +11 -0
- package/dist/src/capabilities/capabilities/index.js.map +1 -0
- package/dist/src/capabilities/capabilities/types.js +11 -0
- package/dist/src/capabilities/capabilities/types.js.map +1 -0
- package/dist/src/capabilities/colophon/collectColophon.js +83 -0
- package/dist/src/capabilities/colophon/collectColophon.js.map +1 -0
- package/dist/src/capabilities/colophon/colophon.render.js +59 -0
- package/dist/src/capabilities/colophon/colophon.render.js.map +1 -0
- package/dist/src/capabilities/colophon/colophon.verb.js +43 -0
- package/dist/src/capabilities/colophon/colophon.verb.js.map +1 -0
- package/dist/src/capabilities/colophon/index.js +5 -0
- package/dist/src/capabilities/colophon/index.js.map +1 -0
- package/dist/src/capabilities/colophon/markdownTerminal.js +90 -0
- package/dist/src/capabilities/colophon/markdownTerminal.js.map +1 -0
- package/dist/src/capabilities/colophon/types.js +10 -0
- package/dist/src/capabilities/colophon/types.js.map +1 -0
- package/dist/src/capabilities/config/collectConfigShow.js +59 -0
- package/dist/src/capabilities/config/collectConfigShow.js.map +1 -0
- package/dist/src/capabilities/config/field.render.js +22 -0
- package/dist/src/capabilities/config/field.render.js.map +1 -0
- package/dist/src/capabilities/config/fields.js +46 -0
- package/dist/src/capabilities/config/fields.js.map +1 -0
- package/dist/src/capabilities/config/get.verb.js +61 -0
- package/dist/src/capabilities/config/get.verb.js.map +1 -0
- package/dist/src/capabilities/config/index.js +5 -0
- package/dist/src/capabilities/config/index.js.map +1 -0
- package/dist/src/capabilities/config/runField.js +59 -0
- package/dist/src/capabilities/config/runField.js.map +1 -0
- package/dist/src/capabilities/config/runGet.js +28 -0
- package/dist/src/capabilities/config/runGet.js.map +1 -0
- package/dist/src/capabilities/config/runSet.js +53 -0
- package/dist/src/capabilities/config/runSet.js.map +1 -0
- package/dist/src/capabilities/config/set.verb.js +66 -0
- package/dist/src/capabilities/config/set.verb.js.map +1 -0
- package/dist/src/capabilities/config/show.render.js +84 -0
- package/dist/src/capabilities/config/show.render.js.map +1 -0
- package/dist/src/capabilities/config/show.verb.js +44 -0
- package/dist/src/capabilities/config/show.verb.js.map +1 -0
- package/dist/src/capabilities/config/types.js +5 -0
- package/dist/src/capabilities/config/types.js.map +1 -0
- package/dist/src/capabilities/config/unset.verb.js +49 -0
- package/dist/src/capabilities/config/unset.verb.js.map +1 -0
- package/dist/src/capabilities/create/cliProjection.js +195 -0
- package/dist/src/capabilities/create/cliProjection.js.map +1 -0
- package/dist/src/capabilities/create/constants.js +47 -0
- package/dist/src/capabilities/create/constants.js.map +1 -0
- package/dist/src/capabilities/create/create.render.js +100 -0
- package/dist/src/capabilities/create/create.render.js.map +1 -0
- package/dist/src/capabilities/create/create.verb.js +438 -0
- package/dist/src/capabilities/create/create.verb.js.map +1 -0
- package/dist/src/capabilities/create/createHelp.js +47 -0
- package/dist/src/capabilities/create/createHelp.js.map +1 -0
- package/dist/src/capabilities/create/createSurface.generated.js +394 -0
- package/dist/src/capabilities/create/createSurface.generated.js.map +1 -0
- package/dist/src/capabilities/create/generatorToVerbSpec.js +106 -0
- package/dist/src/capabilities/create/generatorToVerbSpec.js.map +1 -0
- package/dist/src/capabilities/create/index.js +18 -0
- package/dist/src/capabilities/create/index.js.map +1 -0
- package/dist/src/capabilities/create/messages.js +16 -0
- package/dist/src/capabilities/create/messages.js.map +1 -0
- package/dist/src/capabilities/create/mount.js +293 -0
- package/dist/src/capabilities/create/mount.js.map +1 -0
- package/dist/src/capabilities/create/pathJail.js +65 -0
- package/dist/src/capabilities/create/pathJail.js.map +1 -0
- package/dist/src/capabilities/create/pickGenerator.js +53 -0
- package/dist/src/capabilities/create/pickGenerator.js.map +1 -0
- package/dist/src/capabilities/create/types.js +2 -0
- package/dist/src/capabilities/create/types.js.map +1 -0
- package/dist/src/capabilities/distribution.js +40 -0
- package/dist/src/capabilities/distribution.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkKeStore.js +40 -0
- package/dist/src/capabilities/doctor/checks/checkKeStore.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkNodeVersion.js +21 -0
- package/dist/src/capabilities/doctor/checks/checkNodeVersion.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkPackageRefs.js +92 -0
- package/dist/src/capabilities/doctor/checks/checkPackageRefs.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkPragmaVersion.js +19 -0
- package/dist/src/capabilities/doctor/checks/checkPragmaVersion.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkShellCompletions.js +199 -0
- package/dist/src/capabilities/doctor/checks/checkShellCompletions.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/index.js +27 -0
- package/dist/src/capabilities/doctor/checks/index.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/mcpCommand.js +57 -0
- package/dist/src/capabilities/doctor/checks/mcpCommand.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/targetHealth.js +205 -0
- package/dist/src/capabilities/doctor/checks/targetHealth.js.map +1 -0
- package/dist/src/capabilities/doctor/doctor.render.js +185 -0
- package/dist/src/capabilities/doctor/doctor.render.js.map +1 -0
- package/dist/src/capabilities/doctor/doctor.verb.js +45 -0
- package/dist/src/capabilities/doctor/doctor.verb.js.map +1 -0
- package/dist/src/capabilities/doctor/index.js +5 -0
- package/dist/src/capabilities/doctor/index.js.map +1 -0
- package/dist/src/capabilities/doctor/runChecks.js +83 -0
- package/dist/src/capabilities/doctor/runChecks.js.map +1 -0
- package/dist/src/capabilities/doctor/types.js +5 -0
- package/dist/src/capabilities/doctor/types.js.map +1 -0
- package/dist/src/capabilities/graph/index.js +19 -0
- package/dist/src/capabilities/graph/index.js.map +1 -0
- package/dist/src/capabilities/graph/inspect.render.js +76 -0
- package/dist/src/capabilities/graph/inspect.render.js.map +1 -0
- package/dist/src/capabilities/graph/inspect.verb.js +53 -0
- package/dist/src/capabilities/graph/inspect.verb.js.map +1 -0
- package/dist/src/capabilities/graph/query.render.js +73 -0
- package/dist/src/capabilities/graph/query.render.js.map +1 -0
- package/dist/src/capabilities/graph/query.verb.js +49 -0
- package/dist/src/capabilities/graph/query.verb.js.map +1 -0
- package/dist/src/capabilities/graph/runQuery.js +41 -0
- package/dist/src/capabilities/graph/runQuery.js.map +1 -0
- package/dist/src/capabilities/index.js +56 -0
- package/dist/src/capabilities/index.js.map +1 -0
- package/dist/src/capabilities/info/collectInfo.js +66 -0
- package/dist/src/capabilities/info/collectInfo.js.map +1 -0
- package/dist/src/capabilities/info/index.js +5 -0
- package/dist/src/capabilities/info/index.js.map +1 -0
- package/dist/src/capabilities/info/info.render.js +53 -0
- package/dist/src/capabilities/info/info.render.js.map +1 -0
- package/dist/src/capabilities/info/info.verb.js +42 -0
- package/dist/src/capabilities/info/info.verb.js.map +1 -0
- package/dist/src/capabilities/info/types.js +5 -0
- package/dist/src/capabilities/info/types.js.map +1 -0
- package/dist/src/capabilities/meta/complete.verb.js +43 -0
- package/dist/src/capabilities/meta/complete.verb.js.map +1 -0
- package/dist/src/capabilities/meta/index.js +13 -0
- package/dist/src/capabilities/meta/index.js.map +1 -0
- package/dist/src/capabilities/meta/mcp.verb.js +34 -0
- package/dist/src/capabilities/meta/mcp.verb.js.map +1 -0
- package/dist/src/capabilities/ontology/index.js +21 -0
- package/dist/src/capabilities/ontology/index.js.map +1 -0
- package/dist/src/capabilities/ontology/queries.js +123 -0
- package/dist/src/capabilities/ontology/queries.js.map +1 -0
- package/dist/src/capabilities/ontology/render.js +66 -0
- package/dist/src/capabilities/ontology/render.js.map +1 -0
- package/dist/src/capabilities/ontology/verbs.js +181 -0
- package/dist/src/capabilities/ontology/verbs.js.map +1 -0
- package/dist/src/capabilities/prompt/index.js +16 -0
- package/dist/src/capabilities/prompt/index.js.map +1 -0
- package/dist/src/capabilities/prompt/prompt.render.js +78 -0
- package/dist/src/capabilities/prompt/prompt.render.js.map +1 -0
- package/dist/src/capabilities/prompt/types.js +10 -0
- package/dist/src/capabilities/prompt/types.js.map +1 -0
- package/dist/src/capabilities/prompt/verbs.js +93 -0
- package/dist/src/capabilities/prompt/verbs.js.map +1 -0
- package/dist/src/capabilities/resources/index.js +10 -0
- package/dist/src/capabilities/resources/index.js.map +1 -0
- package/dist/src/capabilities/resources/provider.js +423 -0
- package/dist/src/capabilities/resources/provider.js.map +1 -0
- package/dist/src/capabilities/setup/buildPlan.js +168 -0
- package/dist/src/capabilities/setup/buildPlan.js.map +1 -0
- package/dist/src/capabilities/setup/index.js +5 -0
- package/dist/src/capabilities/setup/index.js.map +1 -0
- package/dist/src/capabilities/setup/mode.js +53 -0
- package/dist/src/capabilities/setup/mode.js.map +1 -0
- package/dist/src/capabilities/setup/operations/index.js +39 -0
- package/dist/src/capabilities/setup/operations/index.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupCompletions.js +160 -0
- package/dist/src/capabilities/setup/operations/setupCompletions.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupConfig.js +101 -0
- package/dist/src/capabilities/setup/operations/setupConfig.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupGenerator.js +343 -0
- package/dist/src/capabilities/setup/operations/setupGenerator.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupLsp.js +277 -0
- package/dist/src/capabilities/setup/operations/setupLsp.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupMcp.js +207 -0
- package/dist/src/capabilities/setup/operations/setupMcp.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupSkills.js +316 -0
- package/dist/src/capabilities/setup/operations/setupSkills.js.map +1 -0
- package/dist/src/capabilities/setup/plan.js +128 -0
- package/dist/src/capabilities/setup/plan.js.map +1 -0
- package/dist/src/capabilities/setup/plan.render.js +193 -0
- package/dist/src/capabilities/setup/plan.render.js.map +1 -0
- package/dist/src/capabilities/setup/setup.render.js +54 -0
- package/dist/src/capabilities/setup/setup.render.js.map +1 -0
- package/dist/src/capabilities/setup/setup.verb.js +334 -0
- package/dist/src/capabilities/setup/setup.verb.js.map +1 -0
- package/dist/src/capabilities/setup/shell.js +196 -0
- package/dist/src/capabilities/setup/shell.js.map +1 -0
- package/dist/src/capabilities/setup/targets.js +263 -0
- package/dist/src/capabilities/setup/targets.js.map +1 -0
- package/dist/src/capabilities/setup/types.js +5 -0
- package/dist/src/capabilities/setup/types.js.map +1 -0
- package/dist/src/capabilities/shared/assertExecOk.js +137 -0
- package/dist/src/capabilities/shared/assertExecOk.js.map +1 -0
- package/dist/src/capabilities/shared/bands.js +16 -0
- package/dist/src/capabilities/shared/bands.js.map +1 -0
- package/dist/src/capabilities/shared/index.js +26 -0
- package/dist/src/capabilities/shared/index.js.map +1 -0
- package/dist/src/capabilities/shared/packageManager.js +103 -0
- package/dist/src/capabilities/shared/packageManager.js.map +1 -0
- package/dist/src/capabilities/shared/registry.js +55 -0
- package/dist/src/capabilities/shared/registry.js.map +1 -0
- package/dist/src/capabilities/skill/discover.js +195 -0
- package/dist/src/capabilities/skill/discover.js.map +1 -0
- package/dist/src/capabilities/skill/index.js +10 -0
- package/dist/src/capabilities/skill/index.js.map +1 -0
- package/dist/src/capabilities/skill/render.js +49 -0
- package/dist/src/capabilities/skill/render.js.map +1 -0
- package/dist/src/capabilities/skill/verbs.js +83 -0
- package/dist/src/capabilities/skill/verbs.js.map +1 -0
- package/dist/src/capabilities/sources/collectStatus.js +103 -0
- package/dist/src/capabilities/sources/collectStatus.js.map +1 -0
- package/dist/src/capabilities/sources/index.js +13 -0
- package/dist/src/capabilities/sources/index.js.map +1 -0
- package/dist/src/capabilities/sources/installSkills.js +167 -0
- package/dist/src/capabilities/sources/installSkills.js.map +1 -0
- package/dist/src/capabilities/sources/runUpdate.js +394 -0
- package/dist/src/capabilities/sources/runUpdate.js.map +1 -0
- package/dist/src/capabilities/sources/status.render.js +64 -0
- package/dist/src/capabilities/sources/status.render.js.map +1 -0
- package/dist/src/capabilities/sources/status.verb.js +40 -0
- package/dist/src/capabilities/sources/status.verb.js.map +1 -0
- package/dist/src/capabilities/sources/types.js +6 -0
- package/dist/src/capabilities/sources/types.js.map +1 -0
- package/dist/src/capabilities/sources/update.render.js +34 -0
- package/dist/src/capabilities/sources/update.render.js.map +1 -0
- package/dist/src/capabilities/sources/update.verb.js +55 -0
- package/dist/src/capabilities/sources/update.verb.js.map +1 -0
- package/dist/src/capabilities/upgrade/index.js +5 -0
- package/dist/src/capabilities/upgrade/index.js.map +1 -0
- package/dist/src/capabilities/upgrade/runUpgrade.js +99 -0
- package/dist/src/capabilities/upgrade/runUpgrade.js.map +1 -0
- package/dist/src/capabilities/upgrade/types.js +5 -0
- package/dist/src/capabilities/upgrade/types.js.map +1 -0
- package/dist/src/capabilities/upgrade/upgrade.render.js +44 -0
- package/dist/src/capabilities/upgrade/upgrade.render.js.map +1 -0
- package/dist/src/capabilities/upgrade/upgrade.verb.js +52 -0
- package/dist/src/capabilities/upgrade/upgrade.verb.js.map +1 -0
- package/dist/src/capabilities/version/index.js +10 -0
- package/dist/src/capabilities/version/index.js.map +1 -0
- package/dist/src/capabilities/version/version.verb.js +36 -0
- package/dist/src/capabilities/version/version.verb.js.map +1 -0
- package/dist/src/constants.js +82 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/index.js +12 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/kernel/completion/complete.js +66 -0
- package/dist/src/kernel/completion/complete.js.map +1 -0
- package/dist/src/kernel/completion/emitScripts.js +92 -0
- package/dist/src/kernel/completion/emitScripts.js.map +1 -0
- package/dist/src/kernel/completion/entitySource.js +285 -0
- package/dist/src/kernel/completion/entitySource.js.map +1 -0
- package/dist/src/kernel/completion/index.js +14 -0
- package/dist/src/kernel/completion/index.js.map +1 -0
- package/dist/src/kernel/completion/model.js +301 -0
- package/dist/src/kernel/completion/model.js.map +1 -0
- package/dist/src/kernel/completion/parse.js +253 -0
- package/dist/src/kernel/completion/parse.js.map +1 -0
- package/dist/src/kernel/completion/rank.js +101 -0
- package/dist/src/kernel/completion/rank.js.map +1 -0
- package/dist/src/kernel/completion/resolve.js +100 -0
- package/dist/src/kernel/completion/resolve.js.map +1 -0
- package/dist/src/kernel/completion/templates/bash.js +209 -0
- package/dist/src/kernel/completion/templates/bash.js.map +1 -0
- package/dist/src/kernel/completion/templates/fish.js +214 -0
- package/dist/src/kernel/completion/templates/fish.js.map +1 -0
- package/dist/src/kernel/completion/templates/index.js +23 -0
- package/dist/src/kernel/completion/templates/index.js.map +1 -0
- package/dist/src/kernel/completion/templates/shared.js +98 -0
- package/dist/src/kernel/completion/templates/shared.js.map +1 -0
- package/dist/src/kernel/completion/templates/zsh.js +201 -0
- package/dist/src/kernel/completion/templates/zsh.js.map +1 -0
- package/dist/src/kernel/completion/types.js +13 -0
- package/dist/src/kernel/completion/types.js.map +1 -0
- package/dist/src/kernel/config/defaults.js +17 -0
- package/dist/src/kernel/config/defaults.js.map +1 -0
- package/dist/src/kernel/config/evaluateProjectConfig.js +126 -0
- package/dist/src/kernel/config/evaluateProjectConfig.js.map +1 -0
- package/dist/src/kernel/config/findProjectConfig.js +43 -0
- package/dist/src/kernel/config/findProjectConfig.js.map +1 -0
- package/dist/src/kernel/config/firstRun.js +34 -0
- package/dist/src/kernel/config/firstRun.js.map +1 -0
- package/dist/src/kernel/config/globalConfig.js +79 -0
- package/dist/src/kernel/config/globalConfig.js.map +1 -0
- package/dist/src/kernel/config/index.js +16 -0
- package/dist/src/kernel/config/index.js.map +1 -0
- package/dist/src/kernel/config/paths.js +35 -0
- package/dist/src/kernel/config/paths.js.map +1 -0
- package/dist/src/kernel/config/readConfig.js +78 -0
- package/dist/src/kernel/config/readConfig.js.map +1 -0
- package/dist/src/kernel/config/schema.js +130 -0
- package/dist/src/kernel/config/schema.js.map +1 -0
- package/dist/src/kernel/config/types.js +19 -0
- package/dist/src/kernel/config/types.js.map +1 -0
- package/dist/src/kernel/config/writeConfigField.js +59 -0
- package/dist/src/kernel/config/writeConfigField.js.map +1 -0
- package/dist/src/kernel/copy.js +43 -0
- package/dist/src/kernel/copy.js.map +1 -0
- package/dist/src/kernel/error/PragmaError.js +149 -0
- package/dist/src/kernel/error/PragmaError.js.map +1 -0
- package/dist/src/kernel/error/constants.js +40 -0
- package/dist/src/kernel/error/constants.js.map +1 -0
- package/dist/src/kernel/error/fromTaskError.js +96 -0
- package/dist/src/kernel/error/fromTaskError.js.map +1 -0
- package/dist/src/kernel/error/index.js +13 -0
- package/dist/src/kernel/error/index.js.map +1 -0
- package/dist/src/kernel/error/recovery.js +52 -0
- package/dist/src/kernel/error/recovery.js.map +1 -0
- package/dist/src/kernel/error/renderError.js +115 -0
- package/dist/src/kernel/error/renderError.js.map +1 -0
- package/dist/src/kernel/error/serialize.js +25 -0
- package/dist/src/kernel/error/serialize.js.map +1 -0
- package/dist/src/kernel/error/types.js +9 -0
- package/dist/src/kernel/error/types.js.map +1 -0
- package/dist/src/kernel/index.js +25 -0
- package/dist/src/kernel/index.js.map +1 -0
- package/dist/src/kernel/packs/collect.js +187 -0
- package/dist/src/kernel/packs/collect.js.map +1 -0
- package/dist/src/kernel/packs/compile.js +304 -0
- package/dist/src/kernel/packs/compile.js.map +1 -0
- package/dist/src/kernel/packs/disclosure.js +76 -0
- package/dist/src/kernel/packs/disclosure.js.map +1 -0
- package/dist/src/kernel/packs/glob.js +38 -0
- package/dist/src/kernel/packs/glob.js.map +1 -0
- package/dist/src/kernel/packs/graphql/buildLookupDocument.js +258 -0
- package/dist/src/kernel/packs/graphql/buildLookupDocument.js.map +1 -0
- package/dist/src/kernel/packs/graphql/fetchGraphqlLookup.js +157 -0
- package/dist/src/kernel/packs/graphql/fetchGraphqlLookup.js.map +1 -0
- package/dist/src/kernel/packs/graphql/index.js +20 -0
- package/dist/src/kernel/packs/graphql/index.js.map +1 -0
- package/dist/src/kernel/packs/graphql/nameMap.js +63 -0
- package/dist/src/kernel/packs/graphql/nameMap.js.map +1 -0
- package/dist/src/kernel/packs/index.js +34 -0
- package/dist/src/kernel/packs/index.js.map +1 -0
- package/dist/src/kernel/packs/iri.js +110 -0
- package/dist/src/kernel/packs/iri.js.map +1 -0
- package/dist/src/kernel/packs/renderPack.js +129 -0
- package/dist/src/kernel/packs/renderPack.js.map +1 -0
- package/dist/src/kernel/packs/resolveEntity.js +223 -0
- package/dist/src/kernel/packs/resolveEntity.js.map +1 -0
- package/dist/src/kernel/packs/runBodies.js +87 -0
- package/dist/src/kernel/packs/runBodies.js.map +1 -0
- package/dist/src/kernel/packs/sample.js +56 -0
- package/dist/src/kernel/packs/sample.js.map +1 -0
- package/dist/src/kernel/packs/schema.js +369 -0
- package/dist/src/kernel/packs/schema.js.map +1 -0
- package/dist/src/kernel/packs/sparql/applyFilters.js +68 -0
- package/dist/src/kernel/packs/sparql/applyFilters.js.map +1 -0
- package/dist/src/kernel/packs/sparql/applySearch.js +25 -0
- package/dist/src/kernel/packs/sparql/applySearch.js.map +1 -0
- package/dist/src/kernel/packs/sparql/buildLookupQuery.js +217 -0
- package/dist/src/kernel/packs/sparql/buildLookupQuery.js.map +1 -0
- package/dist/src/kernel/packs/sparql/escape.js +21 -0
- package/dist/src/kernel/packs/sparql/escape.js.map +1 -0
- package/dist/src/kernel/packs/sparql/index.js +31 -0
- package/dist/src/kernel/packs/sparql/index.js.map +1 -0
- package/dist/src/kernel/packs/sparql/runSelect.js +101 -0
- package/dist/src/kernel/packs/sparql/runSelect.js.map +1 -0
- package/dist/src/kernel/packs/types.js +30 -0
- package/dist/src/kernel/packs/types.js.map +1 -0
- package/dist/src/kernel/packs/uniqueness.js +30 -0
- package/dist/src/kernel/packs/uniqueness.js.map +1 -0
- package/dist/src/kernel/project/cli/buildProgram.js +263 -0
- package/dist/src/kernel/project/cli/buildProgram.js.map +1 -0
- package/dist/src/kernel/project/cli/constants.js +27 -0
- package/dist/src/kernel/project/cli/constants.js.map +1 -0
- package/dist/src/kernel/project/cli/dispatch.js +420 -0
- package/dist/src/kernel/project/cli/dispatch.js.map +1 -0
- package/dist/src/kernel/project/cli/exitCodes.js +66 -0
- package/dist/src/kernel/project/cli/exitCodes.js.map +1 -0
- package/dist/src/kernel/project/cli/globalFlags.js +216 -0
- package/dist/src/kernel/project/cli/globalFlags.js.map +1 -0
- package/dist/src/kernel/project/cli/helpFormat.js +59 -0
- package/dist/src/kernel/project/cli/helpFormat.js.map +1 -0
- package/dist/src/kernel/project/cli/index.js +14 -0
- package/dist/src/kernel/project/cli/index.js.map +1 -0
- package/dist/src/kernel/project/cli/rootHelp.js +197 -0
- package/dist/src/kernel/project/cli/rootHelp.js.map +1 -0
- package/dist/src/kernel/project/cli/suggest.js +75 -0
- package/dist/src/kernel/project/cli/suggest.js.map +1 -0
- package/dist/src/kernel/project/cli/suggestNames.js +96 -0
- package/dist/src/kernel/project/cli/suggestNames.js.map +1 -0
- package/dist/src/kernel/project/cli/verbHelp.js +131 -0
- package/dist/src/kernel/project/cli/verbHelp.js.map +1 -0
- package/dist/src/kernel/project/mcp/buildServer.js +67 -0
- package/dist/src/kernel/project/mcp/buildServer.js.map +1 -0
- package/dist/src/kernel/project/mcp/envelope.js +37 -0
- package/dist/src/kernel/project/mcp/envelope.js.map +1 -0
- package/dist/src/kernel/project/mcp/index.js +8 -0
- package/dist/src/kernel/project/mcp/index.js.map +1 -0
- package/dist/src/kernel/project/mcp/instructions.js +44 -0
- package/dist/src/kernel/project/mcp/instructions.js.map +1 -0
- package/dist/src/kernel/project/mcp/mcpError.js +42 -0
- package/dist/src/kernel/project/mcp/mcpError.js.map +1 -0
- package/dist/src/kernel/project/mcp/prompts/index.js +36 -0
- package/dist/src/kernel/project/mcp/prompts/index.js.map +1 -0
- package/dist/src/kernel/project/mcp/prompts/provider.js +98 -0
- package/dist/src/kernel/project/mcp/prompts/provider.js.map +1 -0
- package/dist/src/kernel/project/mcp/prompts/source.js +154 -0
- package/dist/src/kernel/project/mcp/prompts/source.js.map +1 -0
- package/dist/src/kernel/project/mcp/registerVerb.js +300 -0
- package/dist/src/kernel/project/mcp/registerVerb.js.map +1 -0
- package/dist/src/kernel/project/mcp/serve.js +35 -0
- package/dist/src/kernel/project/mcp/serve.js.map +1 -0
- package/dist/src/kernel/render/compactUri.js +24 -0
- package/dist/src/kernel/render/compactUri.js.map +1 -0
- package/dist/src/kernel/render/contracts.js +10 -0
- package/dist/src/kernel/render/contracts.js.map +1 -0
- package/dist/src/kernel/render/disclosure.js +34 -0
- package/dist/src/kernel/render/disclosure.js.map +1 -0
- package/dist/src/kernel/render/envelope.js +30 -0
- package/dist/src/kernel/render/envelope.js.map +1 -0
- package/dist/src/kernel/render/formatters.js +27 -0
- package/dist/src/kernel/render/formatters.js.map +1 -0
- package/dist/src/kernel/render/index.js +15 -0
- package/dist/src/kernel/render/index.js.map +1 -0
- package/dist/src/kernel/render/prefixes.js +46 -0
- package/dist/src/kernel/render/prefixes.js.map +1 -0
- package/dist/src/kernel/render/renderers.js +468 -0
- package/dist/src/kernel/render/renderers.js.map +1 -0
- package/dist/src/kernel/render/style.js +85 -0
- package/dist/src/kernel/render/style.js.map +1 -0
- package/dist/src/kernel/render/turtle.js +194 -0
- package/dist/src/kernel/render/turtle.js.map +1 -0
- package/dist/src/kernel/render/writeStdout.js +43 -0
- package/dist/src/kernel/render/writeStdout.js.map +1 -0
- package/dist/src/kernel/runtime/boot.js +49 -0
- package/dist/src/kernel/runtime/boot.js.map +1 -0
- package/dist/src/kernel/runtime/facade.js +39 -0
- package/dist/src/kernel/runtime/facade.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/build.js +122 -0
- package/dist/src/kernel/runtime/graphpack/build.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/buildIndex.js +303 -0
- package/dist/src/kernel/runtime/graphpack/buildIndex.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.generated.js +6 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.generated.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.index.generated.js +4 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.index.generated.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.stories.generated.js +4 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.stories.generated.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded.js +82 -0
- package/dist/src/kernel/runtime/graphpack/embedded.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/hash.js +38 -0
- package/dist/src/kernel/runtime/graphpack/hash.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/index.js +11 -0
- package/dist/src/kernel/runtime/graphpack/index.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/manifest.js +145 -0
- package/dist/src/kernel/runtime/graphpack/manifest.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/read.js +92 -0
- package/dist/src/kernel/runtime/graphpack/read.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/schemas.js +70 -0
- package/dist/src/kernel/runtime/graphpack/schemas.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/stories.js +68 -0
- package/dist/src/kernel/runtime/graphpack/stories.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/types.js +55 -0
- package/dist/src/kernel/runtime/graphpack/types.js.map +1 -0
- package/dist/src/kernel/runtime/index.js +8 -0
- package/dist/src/kernel/runtime/index.js.map +1 -0
- package/dist/src/kernel/runtime/loadSession.js +34 -0
- package/dist/src/kernel/runtime/loadSession.js.map +1 -0
- package/dist/src/kernel/runtime/paths.js +78 -0
- package/dist/src/kernel/runtime/paths.js.map +1 -0
- package/dist/src/kernel/runtime/probe.js +37 -0
- package/dist/src/kernel/runtime/probe.js.map +1 -0
- package/dist/src/kernel/runtime/readEntity.js +363 -0
- package/dist/src/kernel/runtime/readEntity.js.map +1 -0
- package/dist/src/kernel/runtime/refs/gitOps.js +65 -0
- package/dist/src/kernel/runtime/refs/gitOps.js.map +1 -0
- package/dist/src/kernel/runtime/refs/index.js +29 -0
- package/dist/src/kernel/runtime/refs/index.js.map +1 -0
- package/dist/src/kernel/runtime/refs/parseRef.js +70 -0
- package/dist/src/kernel/runtime/refs/parseRef.js.map +1 -0
- package/dist/src/kernel/runtime/refs/resolve.js +332 -0
- package/dist/src/kernel/runtime/refs/resolve.js.map +1 -0
- package/dist/src/kernel/runtime/resolveSources.js +62 -0
- package/dist/src/kernel/runtime/resolveSources.js.map +1 -0
- package/dist/src/kernel/runtime/store.js +75 -0
- package/dist/src/kernel/runtime/store.js.map +1 -0
- package/dist/src/kernel/runtime/storeReadiness.js +51 -0
- package/dist/src/kernel/runtime/storeReadiness.js.map +1 -0
- package/dist/src/kernel/runtime/types.js +11 -0
- package/dist/src/kernel/runtime/types.js.map +1 -0
- package/dist/src/kernel/spec/asVerb.js +21 -0
- package/dist/src/kernel/spec/asVerb.js.map +1 -0
- package/dist/src/kernel/spec/emitReference.js +578 -0
- package/dist/src/kernel/spec/emitReference.js.map +1 -0
- package/dist/src/kernel/spec/emitSurface.js +202 -0
- package/dist/src/kernel/spec/emitSurface.js.map +1 -0
- package/dist/src/kernel/spec/index.js +11 -0
- package/dist/src/kernel/spec/index.js.map +1 -0
- package/dist/src/kernel/spec/surfaceConformance.js +103 -0
- package/dist/src/kernel/spec/surfaceConformance.js.map +1 -0
- package/dist/src/kernel/spec/types.js +14 -0
- package/dist/src/kernel/spec/types.js.map +1 -0
- package/dist/src/kernel/spec/validate.js +110 -0
- package/dist/src/kernel/spec/validate.js.map +1 -0
- package/dist/src/kernel/vocabulary.js +97 -0
- package/dist/src/kernel/vocabulary.js.map +1 -0
- package/dist/src/types.js +11 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +25 -24
- package/pragma.conf.ts +853 -0
- package/src/bin.ts +276 -82
- package/src/capabilities/block.parity.test.ts +253 -0
- package/src/capabilities/capabilities/capabilities.render.ts +4 -3
- package/src/capabilities/capabilities/capabilities.verb.ts +32 -14
- package/src/capabilities/capabilities/catalog.ts +20 -12
- package/src/capabilities/capabilities/hints.ts +43 -24
- package/src/capabilities/capabilities/index.ts +1 -1
- package/src/capabilities/colophon/collectColophon.ts +50 -24
- package/src/capabilities/colophon/colophon.render.ts +25 -1
- package/src/capabilities/colophon/colophon.test.ts +42 -21
- package/src/capabilities/colophon/colophon.verb.ts +9 -5
- package/src/capabilities/colophon/types.ts +16 -7
- package/src/capabilities/config/collectConfigShow.test.ts +58 -0
- package/src/capabilities/config/collectConfigShow.ts +43 -6
- package/src/capabilities/config/field.render.ts +4 -5
- package/src/capabilities/config/fields.ts +17 -37
- 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 +14 -9
- package/src/capabilities/config/show.render.test.ts +77 -5
- package/src/capabilities/config/show.render.ts +8 -13
- package/src/capabilities/config/show.verb.ts +13 -9
- package/src/capabilities/config/types.ts +26 -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 +95 -103
- package/src/capabilities/create/cliProjection.ts +227 -0
- package/src/capabilities/create/constants.ts +50 -0
- package/src/capabilities/create/create.mcp.test.ts +91 -7
- package/src/capabilities/create/create.render.ts +71 -7
- package/src/capabilities/create/create.test.ts +523 -162
- package/src/capabilities/create/create.verb.ts +361 -321
- 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 +9 -14
- 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 +40 -46
- package/src/capabilities/create/shippedCreate.subprocess.test.ts +164 -0
- package/src/capabilities/create/types.ts +29 -5
- package/src/capabilities/{standard/parity.test.ts → distribution.parity.test.ts} +24 -14
- package/src/capabilities/distribution.test.ts +122 -0
- package/src/capabilities/distribution.ts +54 -0
- package/src/capabilities/doctor/checks/checkKeStore.ts +9 -7
- package/src/capabilities/doctor/checks/checkPackageRefs.ts +82 -46
- package/src/capabilities/doctor/checks/checkPragmaVersion.ts +5 -4
- package/src/capabilities/doctor/checks/checkShellCompletions.test.ts +125 -30
- package/src/capabilities/doctor/checks/checkShellCompletions.ts +113 -27
- package/src/capabilities/doctor/checks/index.ts +27 -0
- package/src/capabilities/doctor/checks/mcpCommand.test.ts +100 -0
- package/src/capabilities/doctor/checks/mcpCommand.ts +69 -0
- package/src/capabilities/doctor/checks/targetHealth.ts +274 -0
- package/src/capabilities/doctor/doctor.render.test.ts +24 -13
- package/src/capabilities/doctor/doctor.render.ts +45 -20
- package/src/capabilities/doctor/doctor.test.ts +158 -40
- package/src/capabilities/doctor/doctor.verb.ts +9 -5
- package/src/capabilities/doctor/runChecks.ts +65 -66
- package/src/capabilities/doctor/types.ts +21 -5
- package/src/capabilities/emptyRecovery.test.ts +44 -22
- 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 -5
- package/src/capabilities/graph/query.render.ts +15 -3
- package/src/capabilities/graph/query.verb.ts +5 -4
- package/src/capabilities/graph/runQuery.ts +9 -7
- package/src/capabilities/index.ts +25 -19
- package/src/capabilities/info/collectInfo.ts +15 -10
- package/src/capabilities/info/info.render.ts +4 -3
- package/src/capabilities/info/info.verb.ts +4 -3
- package/src/capabilities/lazy.test.ts +125 -2
- 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 +42 -83
- package/src/capabilities/prompt/index.ts +2 -2
- package/src/capabilities/prompt/prompt.render.ts +6 -2
- package/src/capabilities/prompt/prompt.test.ts +12 -6
- package/src/capabilities/prompt/types.ts +1 -1
- package/src/capabilities/prompt/verbs.ts +26 -14
- package/src/capabilities/reference.test.ts +63 -0
- package/src/capabilities/resources/provider.ts +367 -91
- package/src/capabilities/resources/resources.test.ts +411 -59
- package/src/capabilities/setup/buildPlan.ts +236 -0
- package/src/capabilities/setup/index.ts +7 -7
- package/src/capabilities/setup/mode.ts +74 -0
- package/src/capabilities/setup/operations/index.ts +74 -0
- package/src/capabilities/setup/operations/setupCompletions.ts +97 -24
- package/src/capabilities/setup/operations/setupConfig.ts +124 -0
- package/src/capabilities/setup/operations/setupGenerator.ts +397 -320
- package/src/capabilities/setup/operations/setupLsp.ts +329 -68
- package/src/capabilities/setup/operations/setupMcp.ts +137 -97
- package/src/capabilities/setup/operations/setupSkills.ts +336 -108
- package/src/capabilities/setup/plan.render.ts +241 -0
- package/src/capabilities/setup/plan.ts +236 -0
- package/src/capabilities/setup/setup.mcp.correctness.test.ts +432 -0
- package/src/capabilities/setup/setup.render.test.ts +281 -73
- package/src/capabilities/setup/setup.render.ts +45 -77
- package/src/capabilities/setup/setup.test.ts +972 -209
- package/src/capabilities/setup/setup.verb.ts +233 -74
- package/src/capabilities/setup/shell.test.ts +86 -0
- package/src/capabilities/setup/shell.ts +166 -14
- package/src/capabilities/setup/targets.ts +367 -0
- package/src/capabilities/setup/types.ts +18 -57
- package/src/capabilities/shared/assertExecOk.ts +68 -10
- package/src/capabilities/shared/index.ts +32 -0
- package/src/capabilities/shared/packageManager.test.ts +55 -0
- package/src/capabilities/shared/packageManager.ts +62 -6
- package/src/capabilities/skill/discover.ts +47 -9
- package/src/capabilities/skill/index.ts +1 -1
- package/src/capabilities/skill/render.ts +14 -14
- package/src/capabilities/skill/skill.test.ts +7 -5
- package/src/capabilities/skill/verbs.ts +9 -10
- package/src/capabilities/sources/collectStatus.ts +61 -51
- package/src/capabilities/sources/index.ts +2 -2
- package/src/capabilities/sources/installSkills.ts +86 -9
- package/src/capabilities/sources/runUpdate.ts +164 -141
- package/src/capabilities/sources/sources.test.ts +265 -119
- package/src/capabilities/sources/status.render.test.ts +53 -24
- package/src/capabilities/sources/status.render.ts +25 -30
- package/src/capabilities/sources/status.verb.ts +16 -9
- package/src/capabilities/sources/types.ts +18 -25
- package/src/capabilities/sources/update.render.ts +10 -3
- package/src/capabilities/sources/update.verb.ts +13 -24
- package/src/capabilities/surface.test.ts +165 -25
- package/src/capabilities/tier.parity.test.ts +144 -0
- package/src/capabilities/upgrade/runUpgrade.ts +8 -8
- package/src/capabilities/upgrade/upgrade.render.ts +4 -5
- package/src/capabilities/upgrade/upgrade.test.ts +3 -3
- package/src/capabilities/upgrade/upgrade.verb.ts +8 -4
- 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.test.ts +8 -6
- package/src/constants.ts +78 -22
- package/src/identity.test.ts +348 -0
- package/src/index.ts +2 -2
- package/src/kernel/completion/__snapshots__/emitScripts.test.ts.snap +20 -15
- package/src/kernel/completion/complete.test.ts +12 -2
- package/src/kernel/completion/complete.ts +1 -1
- package/src/kernel/completion/emitScripts.test.ts +1 -1
- package/src/kernel/completion/emitScripts.ts +5 -3
- package/src/kernel/completion/entitySource.test.ts +185 -41
- package/src/kernel/completion/entitySource.ts +133 -110
- package/src/kernel/completion/model.test.ts +165 -13
- package/src/kernel/completion/model.ts +105 -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 +104 -50
- package/src/kernel/completion/shellDrive.test.ts +611 -0
- package/src/kernel/completion/templates/bash.ts +7 -2
- package/src/kernel/completion/templates/fish.ts +28 -6
- package/src/kernel/completion/templates/index.ts +23 -0
- package/src/kernel/completion/types.ts +10 -3
- package/src/kernel/config/defaults.test.ts +108 -0
- package/src/kernel/config/defaults.ts +13 -23
- package/src/kernel/config/evaluateProjectConfig.ts +33 -11
- package/src/kernel/config/findProjectConfig.ts +4 -3
- package/src/kernel/config/firstRun.test.ts +44 -38
- package/src/kernel/config/firstRun.ts +24 -81
- package/src/kernel/config/globalConfig.ts +2 -2
- package/src/kernel/config/index.ts +5 -6
- package/src/kernel/config/paths.ts +17 -17
- package/src/kernel/config/readConfig.test.ts +246 -7
- package/src/kernel/config/readConfig.ts +8 -8
- package/src/kernel/config/schema.test.ts +50 -0
- package/src/kernel/config/schema.ts +100 -11
- package/src/kernel/config/types.ts +75 -19
- package/src/kernel/copy.test.ts +483 -0
- package/src/kernel/copy.ts +54 -0
- package/src/kernel/error/PragmaError.test.ts +6 -3
- package/src/kernel/error/PragmaError.ts +4 -2
- package/src/kernel/error/constants.ts +7 -4
- package/src/kernel/error/fromTaskError.ts +28 -6
- package/src/kernel/error/index.ts +1 -1
- package/src/kernel/error/recovery.test.ts +22 -45
- package/src/kernel/error/recovery.ts +36 -27
- package/src/kernel/error/renderError.ts +42 -1
- package/src/kernel/error/types.ts +25 -4
- package/src/kernel/index.ts +26 -0
- package/src/kernel/packs/collect.test.ts +195 -11
- package/src/kernel/packs/collect.ts +212 -61
- package/src/kernel/packs/compile.test.ts +293 -8
- package/src/kernel/packs/compile.ts +108 -15
- package/src/kernel/packs/disclosure.test.ts +5 -2
- package/src/kernel/packs/disclosure.ts +2 -2
- package/src/kernel/packs/graphql/buildLookupDocument.ts +1 -1
- package/src/kernel/packs/graphql/fetchGraphqlLookup.ts +13 -13
- package/src/kernel/packs/graphql/index.ts +20 -0
- package/src/kernel/packs/graphqlSource.test.ts +6 -3
- package/src/kernel/packs/index.ts +40 -0
- package/src/kernel/packs/iri.test.ts +73 -0
- package/src/kernel/packs/iri.ts +70 -20
- package/src/kernel/packs/renderPack.ts +28 -7
- package/src/kernel/packs/resolveEntity.test.ts +213 -0
- package/src/kernel/packs/resolveEntity.ts +132 -34
- package/src/kernel/packs/runBodies.ts +16 -16
- package/src/kernel/packs/sample.ts +1 -1
- package/src/kernel/packs/schema.ts +114 -11
- package/src/kernel/packs/sparql/applyFilters.ts +16 -17
- package/src/kernel/packs/sparql/buildLookupQuery.ts +75 -3
- package/src/kernel/packs/sparql/index.ts +37 -0
- package/src/kernel/packs/sparql/runSelect.test.ts +104 -10
- package/src/kernel/packs/sparql/runSelect.ts +75 -37
- package/src/kernel/packs/toolDescription.test.ts +52 -5
- package/src/kernel/packs/types.ts +52 -4
- package/src/kernel/packs/uniqueness.ts +5 -5
- package/src/kernel/project/cli/buildProgram.test.ts +157 -17
- package/src/kernel/project/cli/buildProgram.ts +77 -18
- package/src/kernel/project/cli/constants.ts +34 -0
- package/src/kernel/project/cli/dispatch.test.ts +227 -3
- package/src/kernel/project/cli/dispatch.ts +250 -48
- package/src/kernel/project/cli/exitCodes.ts +1 -1
- package/src/kernel/project/cli/globalFlags.test.ts +117 -1
- package/src/kernel/project/cli/globalFlags.ts +130 -30
- package/src/kernel/project/cli/helpFormat.ts +14 -1
- package/src/kernel/project/cli/rootHelp.ts +140 -111
- 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 +18 -10
- package/src/kernel/project/mcp/envelope.ts +2 -2
- package/src/kernel/project/mcp/instructions.ts +12 -7
- package/src/kernel/project/mcp/mcpError.ts +1 -1
- package/src/kernel/project/mcp/parity.test.ts +42 -1
- package/src/kernel/project/mcp/prompts/index.ts +37 -0
- package/src/kernel/project/mcp/prompts/prompts.test.ts +120 -5
- package/src/kernel/project/mcp/prompts/provider.ts +22 -8
- package/src/kernel/project/mcp/prompts/source.ts +69 -68
- package/src/kernel/project/mcp/registerVerb.ts +56 -11
- package/src/kernel/project/mcp/serve.ts +13 -5
- package/src/kernel/project/mcp/toolDescriptions.test.ts +6 -2
- package/src/kernel/render/__snapshots__/renderers.test.ts.snap +7 -4
- package/src/kernel/render/contracts.ts +21 -0
- package/src/kernel/render/disclosure.ts +4 -2
- package/src/kernel/render/envelope.ts +2 -3
- package/src/kernel/render/formatters.ts +1 -1
- package/src/kernel/render/prefixes.test.ts +36 -0
- package/src/kernel/render/prefixes.ts +40 -13
- package/src/kernel/render/renderers.test.ts +244 -7
- package/src/kernel/render/renderers.ts +222 -20
- package/src/kernel/render/style.test.ts +75 -24
- package/src/kernel/render/style.ts +31 -1
- package/src/kernel/render/turtle.ts +222 -0
- package/src/kernel/runtime/graphpack/build.ts +29 -3
- package/src/kernel/runtime/graphpack/buildIndex.test.ts +46 -0
- package/src/kernel/runtime/graphpack/buildIndex.ts +53 -18
- package/src/kernel/runtime/graphpack/embedded/pack.generated.ts +5 -5
- package/src/kernel/runtime/graphpack/embedded/pack.index.generated.ts +3 -3
- package/src/kernel/runtime/graphpack/embedded/pack.stories.generated.ts +3 -0
- package/src/kernel/runtime/graphpack/embedded.ts +39 -13
- package/src/kernel/runtime/graphpack/graphpack.test.ts +205 -5
- package/src/kernel/runtime/graphpack/hash.ts +3 -2
- package/src/kernel/runtime/graphpack/index.ts +1 -1
- package/src/kernel/runtime/graphpack/manifest.ts +114 -12
- package/src/kernel/runtime/graphpack/read.ts +5 -11
- package/src/kernel/runtime/graphpack/schemas.ts +74 -0
- package/src/kernel/runtime/graphpack/stories.ts +84 -0
- package/src/kernel/runtime/graphpack/types.ts +61 -48
- package/src/kernel/runtime/loadSession.ts +1 -1
- package/src/kernel/runtime/paths.ts +64 -15
- package/src/kernel/runtime/probe.test.ts +8 -4
- package/src/kernel/runtime/probe.ts +6 -6
- package/src/kernel/runtime/readEntity.ts +477 -32
- package/src/kernel/runtime/refs/gitOps.ts +1 -19
- package/src/kernel/runtime/refs/index.ts +39 -0
- package/src/kernel/runtime/refs/parseRef.ts +8 -8
- package/src/kernel/runtime/refs/resolve.ts +82 -66
- package/src/kernel/runtime/resolveSources.test.ts +63 -24
- package/src/kernel/runtime/resolveSources.ts +36 -25
- package/src/kernel/runtime/storeReadiness.ts +10 -10
- package/src/kernel/runtime/storeless.test.ts +1 -1
- package/src/kernel/runtime/types.ts +15 -1
- package/src/kernel/runtime/wasmEmbed.test.ts +56 -55
- package/src/kernel/spec/emitReference.test.ts +3 -3
- package/src/kernel/spec/emitReference.ts +242 -34
- package/src/kernel/spec/emitSurface.ts +57 -11
- package/src/kernel/spec/surfaceConformance.test.ts +4 -2
- package/src/kernel/spec/surfaceConformance.ts +8 -0
- package/src/kernel/spec/types.ts +277 -13
- package/src/kernel/spec/validate.ts +2 -1
- package/src/kernel/vocabulary.test.ts +164 -0
- package/src/kernel/vocabulary.ts +146 -0
- package/src/testing/PARITY_GAPS.ts +8 -2
- package/src/testing/behavioral/README.md +3 -3
- package/src/testing/behavioral/completion.test.ts +19 -6
- package/src/testing/behavioral/docExamples.test.ts +14 -0
- package/src/testing/behavioral/errorMatrix.mcp.test.ts +6 -5
- package/src/testing/behavioral/errorMatrix.storeless.test.ts +1 -1
- package/src/testing/behavioral/exitCodes.e2e.test.ts +6 -5
- package/src/testing/behavioral/firstRun.e2e.test.ts +24 -24
- package/src/testing/behavioral/harness.foundation.test.ts +14 -5
- package/src/testing/behavioral/journeys.cli.test.ts +117 -76
- package/src/testing/behavioral/journeys.defaultPack.test.ts +88 -182
- package/src/testing/behavioral/journeys.firstInstall.test.ts +167 -0
- 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.mcpLifecycle.mcp.test.ts +9 -6
- package/src/testing/behavioral/journeys.packageStories.test.ts +188 -0
- package/src/testing/behavioral/liveReadSurface.ts +4 -3
- package/src/testing/behavioral/mcpServe.e2e.test.ts +57 -2
- package/src/testing/behavioral/mcpSurface.test.ts +10 -5
- package/src/testing/behavioral/rootCli.e2e.test.ts +26 -2
- package/src/testing/behavioral/staleCommands.test.ts +10 -0
- package/src/testing/eval/__snapshots__/eval.test.ts.snap +7 -7
- package/src/testing/eval/cases/assembly.ts +13 -6
- package/src/testing/eval/cases/effectful.ts +28 -15
- package/src/testing/eval/cases/readNouns.ts +22 -20
- package/src/testing/eval/cases/stable.ts +5 -1
- package/src/testing/eval/eval.test.ts +7 -1
- package/src/testing/fixtures/blockGraph.ts +79 -0
- package/src/testing/fixtures/fixtureCapability.ts +45 -1
- package/src/testing/fixtures/graph/canonical.ts +94 -5
- package/src/testing/fixtures/graph/defaultPack.ts +7 -6
- package/src/testing/fixtures/graph/owlExport.ts +7 -5
- package/src/testing/helpers/blankCanonicalRanges.ts +36 -0
- package/src/testing/helpers/fixtureGraph.ts +33 -16
- package/src/testing/helpers/packRuntime.ts +2 -3
- package/src/testing/helpers/projectCli.ts +2 -1
- package/src/testing/helpers/projectMcp.ts +38 -6
- package/src/testing/helpers/runCli.ts +35 -18
- package/src/testing/perf/budgets.test.ts +24 -9
- package/src/testing/perf/budgets.ts +76 -12
- package/src/testing/perf/codegen.test.ts +126 -0
- package/src/testing/perf/globalSetup.test.ts +286 -0
- package/src/testing/perf/globalSetup.ts +611 -14
- 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/src/types.ts +2 -2
- package/dist/pragma +0 -0
- package/src/capabilities/block/blockList.test.ts +0 -79
- package/src/capabilities/block/blockList.verb.ts +0 -163
- package/src/capabilities/block/index.ts +0 -25
- package/src/capabilities/block/pack.ts +0 -166
- package/src/capabilities/block/parity.test.ts +0 -187
- package/src/capabilities/block/tierChain.ts +0 -78
- package/src/capabilities/colophon/pragmaColophon.ts +0 -66
- package/src/capabilities/create/compiledCreate.subprocess.test.ts +0 -152
- package/src/capabilities/create/templates.embedded.generated.ts +0 -53
- package/src/capabilities/doctor/checks/checkConfigFile.ts +0 -41
- package/src/capabilities/doctor/checks/checkMcpCommands.ts +0 -114
- package/src/capabilities/doctor/checks/checkMcpConfigured.ts +0 -67
- package/src/capabilities/doctor/checks/checkSkillsSymlinked.ts +0 -60
- package/src/capabilities/doctor/checks/deriveBand.test.ts +0 -42
- package/src/capabilities/doctor/checks/deriveBand.ts +0 -28
- package/src/capabilities/modifier/index.ts +0 -15
- package/src/capabilities/modifier/pack.ts +0 -64
- package/src/capabilities/standard/index.ts +0 -18
- package/src/capabilities/standard/pack.ts +0 -128
- package/src/capabilities/tier/index.ts +0 -19
- package/src/capabilities/tier/lookup.render.test.ts +0 -72
- package/src/capabilities/tier/lookup.render.ts +0 -59
- package/src/capabilities/tier/lookup.test.ts +0 -83
- package/src/capabilities/tier/lookup.verb.ts +0 -44
- package/src/capabilities/tier/pack.ts +0 -28
- package/src/capabilities/tier/runLookup.ts +0 -87
- package/src/capabilities/token/addConfig.render.ts +0 -27
- package/src/capabilities/token/addConfig.test.ts +0 -62
- package/src/capabilities/token/addConfig.verb.ts +0 -40
- package/src/capabilities/token/index.ts +0 -19
- package/src/capabilities/token/pack.ts +0 -58
- package/src/capabilities/token/runAddConfig.ts +0 -95
- package/src/kernel/completion/bashDrive.test.ts +0 -73
- package/src/kernel/config/__snapshots__/firstRun.test.ts.snap +0 -11
- package/src/kernel/runtime/graphpack/embedded/sample.ttl +0 -39
- package/src/kernel/runtime/lock.ts +0 -90
|
@@ -4,10 +4,16 @@
|
|
|
4
4
|
* list/autocomplete are storeless over the enriched pack index; a read is
|
|
5
5
|
* store-backed and shares `graph inspect`'s entity reader (the mirror). Resources
|
|
6
6
|
* never enter the emitted tool surface. On a missing/legacy index the listing
|
|
7
|
-
* degrades to a `pragma sources update` hint (never a live re-index)
|
|
7
|
+
* degrades to a `pragma sources update` hint (never a live re-index) — and that
|
|
8
|
+
* hint is itself readable.
|
|
9
|
+
*
|
|
10
|
+
* The listing is CURATED, not paged: the SDK's `McpServer` list handler ignores
|
|
11
|
+
* `cursor` and never returns `nextCursor`, so everything listed is sent on every
|
|
12
|
+
* connect. A module declares the SLICES of the index it contributes and the
|
|
13
|
+
* listing is their union — collections and schema, not 712 individuals.
|
|
8
14
|
*/
|
|
9
15
|
|
|
10
|
-
import { mkdtempSync } from "node:fs";
|
|
16
|
+
import { mkdtempSync, writeFileSync } from "node:fs";
|
|
11
17
|
import { tmpdir } from "node:os";
|
|
12
18
|
import { join } from "node:path";
|
|
13
19
|
import { ErrorCode } from "@modelcontextprotocol/sdk/types.js";
|
|
@@ -16,37 +22,136 @@ import { readPackIndex } from "../../kernel/completion/entitySource.js";
|
|
|
16
22
|
import { verbKey } from "../../kernel/packs/uniqueness.js";
|
|
17
23
|
import { bootRuntime } from "../../kernel/runtime/boot.js";
|
|
18
24
|
import type { PackIndex } from "../../kernel/runtime/graphpack/types.js";
|
|
19
|
-
import { writeLock } from "../../kernel/runtime/lock.js";
|
|
20
25
|
import type { InspectResult } from "../../kernel/runtime/readEntity.js";
|
|
21
|
-
import type { VerbSpec } from "../../kernel/spec/types.js";
|
|
26
|
+
import type { McpListable, VerbSpec } from "../../kernel/spec/types.js";
|
|
22
27
|
import { TEST_FLAGS } from "../../testing/helpers/projectCli.js";
|
|
23
28
|
import { projectMcp } from "../../testing/helpers/projectMcp.js";
|
|
24
29
|
import { graphModule } from "../graph/index.js";
|
|
25
|
-
import {
|
|
30
|
+
import { capabilities } from "../index.js";
|
|
31
|
+
import { ontologyModule } from "../ontology/index.js";
|
|
32
|
+
import {
|
|
33
|
+
buildResourceList,
|
|
34
|
+
collectListable,
|
|
35
|
+
completionWeights,
|
|
36
|
+
rankUriCompletions,
|
|
37
|
+
resourceProvider,
|
|
38
|
+
} from "./provider.js";
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Two entities of the committed embedded pack, chosen for what they PROVE: an
|
|
42
|
+
* abox individual and the tbox class it instantiates, so the collection-vs-
|
|
43
|
+
* individual split has both sides. Named, not counted — the roster moves
|
|
44
|
+
* whenever the design system does.
|
|
45
|
+
*/
|
|
46
|
+
const BUTTON_NAME = "ds:global.component.button";
|
|
47
|
+
const BUTTON_URI = `pragma:${BUTTON_NAME}`;
|
|
48
|
+
const COMPONENT_URI = "pragma:ds:Component";
|
|
49
|
+
|
|
50
|
+
/** The distribution's own declared listing — the union every module contributes. */
|
|
51
|
+
const declaredListing = (): McpListable => collectListable(capabilities);
|
|
52
|
+
|
|
53
|
+
/** Every entity in the index, whatever its type — the widest possible slice. */
|
|
54
|
+
const EVERYTHING: McpListable = { sources: [{ as: "entities" }] };
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* The listing budget, in bytes of the `resources/list` payload.
|
|
58
|
+
*
|
|
59
|
+
* `BUDGETS.md` documents an "MCP p95 (warm) < 100 ms" target that no test
|
|
60
|
+
* enforces — the perf pass spawns `dist/src/bin.js` and measures CLI latency
|
|
61
|
+
* only. Payload SIZE is the property that actually regressed (712 entries /
|
|
62
|
+
* ~155 KB on every connect), and it is the one an agent pays for twice: once in
|
|
63
|
+
* transfer, once in the context window it can no longer spend on the task.
|
|
64
|
+
*/
|
|
65
|
+
const LISTING_BUDGET_BYTES = 60_000;
|
|
26
66
|
|
|
27
67
|
describe("resource listing (storeless, over the pack index)", () => {
|
|
28
68
|
it("degrades to a recovery entry on a missing or legacy index", () => {
|
|
29
|
-
expect(buildResourceList(undefined)).toEqual([
|
|
69
|
+
expect(buildResourceList(undefined, declaredListing())).toEqual([
|
|
30
70
|
expect.objectContaining({
|
|
31
71
|
uri: "pragma:sources",
|
|
32
|
-
|
|
72
|
+
title: "Store not indexed",
|
|
33
73
|
}),
|
|
34
74
|
]);
|
|
35
75
|
const legacy = { version: 1, entities: [] } as unknown as PackIndex;
|
|
36
|
-
expect(buildResourceList(legacy)[0]?.uri).toBe(
|
|
76
|
+
expect(buildResourceList(legacy, declaredListing())[0]?.uri).toBe(
|
|
77
|
+
"pragma:sources",
|
|
78
|
+
);
|
|
37
79
|
});
|
|
38
80
|
|
|
39
|
-
it("lists the
|
|
40
|
-
const index = readPackIndex(
|
|
81
|
+
it("lists the declared COLLECTIONS with their counts, not the individuals", () => {
|
|
82
|
+
const index = readPackIndex({ kind: "embedded" });
|
|
41
83
|
expect(index?.version).toBe(2);
|
|
42
|
-
const resources = buildResourceList(index);
|
|
43
|
-
|
|
44
|
-
//
|
|
45
|
-
|
|
46
|
-
|
|
84
|
+
const resources = buildResourceList(index, declaredListing());
|
|
85
|
+
|
|
86
|
+
// The collection entry for `ds:Component` is listed, carrying the count of
|
|
87
|
+
// its individuals — one entry standing in for 110.
|
|
88
|
+
const component = resources.find((r) => r.uri === COMPONENT_URI);
|
|
89
|
+
expect(component?._meta?.["pragma/instanceCount"]).toBe(
|
|
90
|
+
index?.instanceCountByType["https://ds.canonical.com/Component"],
|
|
91
|
+
);
|
|
92
|
+
// The individuals themselves are NOT listed — they stay reachable through
|
|
93
|
+
// the `{+uri}` template and its autocomplete.
|
|
94
|
+
expect(resources.some((r) => r.uri === BUTTON_URI)).toBe(false);
|
|
95
|
+
// ...and the listing is a fraction of the index it summarizes.
|
|
96
|
+
expect(resources.length).toBeLessThan((index?.entities.length ?? 0) / 4);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it("keeps the whole listing inside the payload budget", () => {
|
|
100
|
+
const resources = buildResourceList(
|
|
101
|
+
readPackIndex({ kind: "embedded" }),
|
|
102
|
+
declaredListing(),
|
|
47
103
|
);
|
|
48
|
-
|
|
49
|
-
|
|
104
|
+
// UTF-8 BYTES, not `String.length`'s UTF-16 code units: the budget is about
|
|
105
|
+
// what crosses the wire, and a graph with non-ASCII labels would otherwise
|
|
106
|
+
// blow the ceiling while this assertion still passed.
|
|
107
|
+
const bytes = Buffer.byteLength(JSON.stringify({ resources }), "utf8");
|
|
108
|
+
expect(
|
|
109
|
+
bytes,
|
|
110
|
+
`resources/list payload is ${bytes} bytes — every connect spends it`,
|
|
111
|
+
).toBeLessThan(LISTING_BUDGET_BYTES);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("DERIVES a story's collection from the types its lookup declares", () => {
|
|
115
|
+
// The proof that this is derived, not agreed: the block story is compiled
|
|
116
|
+
// from `pragma.conf.ts` and its module authors NO listing — the four types
|
|
117
|
+
// its lookup constrains its name resolve to are the four collections it
|
|
118
|
+
// contributes. Read from the compiled module, so a hand-written listing
|
|
119
|
+
// that merely happens to match today cannot satisfy it.
|
|
120
|
+
const block = capabilities.find((module) => module.name === "block");
|
|
121
|
+
const declaredTypes = (block?.mcpListable?.sources ?? []).map(
|
|
122
|
+
(source) => source.type,
|
|
123
|
+
);
|
|
124
|
+
expect(declaredTypes).toEqual([
|
|
125
|
+
"ds:Component",
|
|
126
|
+
"ds:Pattern",
|
|
127
|
+
"ds:Layout",
|
|
128
|
+
"ds:Subcomponent",
|
|
129
|
+
]);
|
|
130
|
+
// ...and each of those reaches the listing as a collection entry.
|
|
131
|
+
const resources = buildResourceList(
|
|
132
|
+
readPackIndex({ kind: "embedded" }),
|
|
133
|
+
collectListable([block ?? { name: "none", verbs: [] }]),
|
|
134
|
+
);
|
|
135
|
+
expect(resources.map((r) => r.name).sort()).toEqual([
|
|
136
|
+
"ds:Component",
|
|
137
|
+
"ds:Layout",
|
|
138
|
+
"ds:Pattern",
|
|
139
|
+
"ds:Subcomponent",
|
|
140
|
+
]);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it("contributes NOTHING for a declared type the index does not know", () => {
|
|
144
|
+
// `ds:Token` is declared by the token read story but SPARQL-served, never
|
|
145
|
+
// indexed. An empty collection would advertise a browse with nothing to
|
|
146
|
+
// show, so the slice yields no entry at all.
|
|
147
|
+
const index = readPackIndex({ kind: "embedded" });
|
|
148
|
+
expect(
|
|
149
|
+
index?.entities.some((e) => (e.prefixed ?? e.name) === "ds:Token"),
|
|
150
|
+
).toBe(false);
|
|
151
|
+
const listed = buildResourceList(index, {
|
|
152
|
+
sources: [{ type: "ds:Token", as: "collection" }],
|
|
153
|
+
});
|
|
154
|
+
expect(listed).toEqual([]);
|
|
50
155
|
});
|
|
51
156
|
|
|
52
157
|
it("emits ONE resource per URI for an OWL-punned subject (A8)", () => {
|
|
@@ -83,7 +188,7 @@ describe("resource listing (storeless, over the pack index)", () => {
|
|
|
83
188
|
],
|
|
84
189
|
instanceCountByType: {},
|
|
85
190
|
};
|
|
86
|
-
const slider = buildResourceList(punned).filter(
|
|
191
|
+
const slider = buildResourceList(punned, EVERYTHING).filter(
|
|
87
192
|
(r) => r.uri === "pragma:ex:Slider",
|
|
88
193
|
);
|
|
89
194
|
expect(slider).toHaveLength(1);
|
|
@@ -91,80 +196,226 @@ describe("resource listing (storeless, over the pack index)", () => {
|
|
|
91
196
|
expect(slider.at(0)?._meta?.["pragma/box"]).toBe("tbox");
|
|
92
197
|
});
|
|
93
198
|
|
|
94
|
-
it("enriches each entry with the _meta taxonomy (
|
|
95
|
-
const resources = buildResourceList(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
199
|
+
it("enriches each entry with the _meta taxonomy (box + type + count)", () => {
|
|
200
|
+
const resources = buildResourceList(
|
|
201
|
+
readPackIndex({ kind: "embedded" }),
|
|
202
|
+
declaredListing(),
|
|
203
|
+
);
|
|
204
|
+
const component = resources.find((r) => r.uri === COMPONENT_URI);
|
|
99
205
|
expect(component?._meta?.["pragma/box"]).toBe("tbox");
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
expect(component?._meta?.["pragma/
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
206
|
+
// `pragma/type` is the ADDITION: an agent can narrow the listing to a
|
|
207
|
+
// family without spending a read to discover what each entry is.
|
|
208
|
+
expect(component?._meta?.["pragma/type"]).toBe("owl:Class");
|
|
209
|
+
expect(resources.every((r) => r._meta?.["pragma/type"])).toBe(true);
|
|
210
|
+
// Both audiences: `["assistant"]` hides every resource from the human
|
|
211
|
+
// picker in a client that honours the field, and browsing a design system
|
|
212
|
+
// in a picker is exactly a human use case.
|
|
213
|
+
expect(component?.annotations?.audience).toEqual(["user", "assistant"]);
|
|
107
214
|
});
|
|
108
215
|
|
|
216
|
+
it("names an entry by its URI and TITLES it from the index's human name", () => {
|
|
217
|
+
// 383 of the 714 indexed entities carry an `altNames[0]` ("Button",
|
|
218
|
+
// "FileTree") and no `rdfs:label`; before this the listing showed them as a
|
|
219
|
+
// bare URI while the readable name sat unused one field away. `name` stays
|
|
220
|
+
// the stable identifier, `title` is what a human reads.
|
|
221
|
+
const index: PackIndex = {
|
|
222
|
+
version: 2,
|
|
223
|
+
contentHash: "test",
|
|
224
|
+
prefixes: {},
|
|
225
|
+
entities: [
|
|
226
|
+
{
|
|
227
|
+
name: "ex:file_tree",
|
|
228
|
+
type: "ex:Widget",
|
|
229
|
+
uri: "https://ex.test/#file_tree",
|
|
230
|
+
prefixed: "ex:file_tree",
|
|
231
|
+
label: null,
|
|
232
|
+
altNames: ["FileTree"],
|
|
233
|
+
box: "abox",
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
instanceCountByType: {},
|
|
237
|
+
};
|
|
238
|
+
const [entry] = buildResourceList(index, EVERYTHING);
|
|
239
|
+
expect(entry?.name).toBe("ex:file_tree");
|
|
240
|
+
expect(entry?.title).toBe("FileTree");
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
it("mints every URI in the scheme the declared template routes", () => {
|
|
244
|
+
// Two writings of one decision: the template `register` installs (and the
|
|
245
|
+
// covenant publishes as `mcpSurface.resources`) and the scheme every listed
|
|
246
|
+
// URI carries. Nothing compared them, and a half-derivation left a fork
|
|
247
|
+
// advertising `recipes:{+uri}` over a list of `pragma:` URIs — every
|
|
248
|
+
// resource offered was unreadable and the readable form was unadvertised.
|
|
249
|
+
// DERIVED from the declared surface, so this cannot be satisfied by two
|
|
250
|
+
// literals that agree today.
|
|
251
|
+
const declared = resourceProvider.surface?.templates?.[0];
|
|
252
|
+
const scheme = `${declared?.split(":")[0]}:`;
|
|
253
|
+
const listed = [
|
|
254
|
+
...buildResourceList(readPackIndex({ kind: "embedded" }), EVERYTHING),
|
|
255
|
+
...buildResourceList(undefined, EVERYTHING),
|
|
256
|
+
];
|
|
257
|
+
expect(listed.length).toBeGreaterThan(1);
|
|
258
|
+
expect(listed.filter((r) => !r.uri.startsWith(scheme))).toEqual([]);
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
describe("URI completion ranking", () => {
|
|
109
263
|
it("ranks autocomplete over prefixed URI and label", () => {
|
|
110
|
-
const index = readPackIndex(
|
|
111
|
-
const hits = rankUriCompletions(
|
|
112
|
-
|
|
264
|
+
const index = readPackIndex({ kind: "embedded" });
|
|
265
|
+
const hits = rankUriCompletions(
|
|
266
|
+
index?.entities ?? [],
|
|
267
|
+
"global.component.button",
|
|
268
|
+
);
|
|
269
|
+
expect(hits).toContain(BUTTON_NAME);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it("sinks a lightly weighted type below every heavier one at equal match", () => {
|
|
273
|
+
// The declared `weights: { "ds:Subcomponent": 0.6 }` on the block story does
|
|
274
|
+
// TWO jobs, and this is the second: with ties broken alphabetically alone,
|
|
275
|
+
// `ds:apps_launchpad.subcomponent.modal-content-header-close_button` and its
|
|
276
|
+
// kin outranked `ds:global.component.button` for the query "button" on the
|
|
277
|
+
// strength of their spelling. Read from the compiled story, not restated.
|
|
278
|
+
const index = readPackIndex({ kind: "embedded" });
|
|
279
|
+
const entities = index?.entities ?? [];
|
|
280
|
+
const weights = completionWeights(declaredListing());
|
|
281
|
+
expect(weights["ds:Subcomponent"]).toBe(0.6);
|
|
282
|
+
expect(weights["ds:Component"]).toBe(1);
|
|
283
|
+
|
|
284
|
+
const typeOf = (prefixed: string) =>
|
|
285
|
+
entities.find((e) => (e.prefixed ?? e.name) === prefixed)?.type;
|
|
286
|
+
const weighted = rankUriCompletions(entities, "button", weights);
|
|
287
|
+
const lastComponent = weighted.findLastIndex(
|
|
288
|
+
(uri) => typeOf(uri) === "ds:Component",
|
|
289
|
+
);
|
|
290
|
+
const firstSubcomponent = weighted.findIndex(
|
|
291
|
+
(uri) => typeOf(uri) === "ds:Subcomponent",
|
|
292
|
+
);
|
|
293
|
+
expect(firstSubcomponent).toBeGreaterThan(lastComponent);
|
|
294
|
+
|
|
295
|
+
// ...and the weight is what moved it: unweighted, the answer ranks lower.
|
|
296
|
+
const unweighted = rankUriCompletions(entities, "button");
|
|
297
|
+
expect(weighted.indexOf(BUTTON_NAME)).toBeLessThan(
|
|
298
|
+
unweighted.indexOf(BUTTON_NAME),
|
|
299
|
+
);
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
it("returns EVERY match so the SDK's total/hasMore can be honest", () => {
|
|
303
|
+
// The SDK derives the wire's `total`/`hasMore` from this array
|
|
304
|
+
// (`values.slice(0, 100)`, `total: length`, `hasMore: length > 100`), so a
|
|
305
|
+
// cap here made a truncated answer describe itself as complete.
|
|
306
|
+
const index = readPackIndex({ kind: "embedded" });
|
|
307
|
+
const entities = index?.entities ?? [];
|
|
308
|
+
const hits = rankUriCompletions(entities, "ds:");
|
|
309
|
+
// Distinct prefixed URIs: a punned subject is two index entities sharing
|
|
310
|
+
// one URI, and the ranker dedups them.
|
|
311
|
+
const matching = new Set(
|
|
312
|
+
entities
|
|
313
|
+
.map((e) => e.prefixed ?? e.name)
|
|
314
|
+
.filter((uri) => uri.startsWith("ds:")),
|
|
315
|
+
);
|
|
316
|
+
expect(hits.length).toBe(matching.size);
|
|
317
|
+
expect(hits.length).toBeGreaterThan(100);
|
|
113
318
|
});
|
|
114
319
|
});
|
|
115
320
|
|
|
116
321
|
describe("resource surface over the server (embedded pack)", () => {
|
|
117
322
|
let harness: Awaited<ReturnType<typeof projectMcp>>;
|
|
118
323
|
beforeAll(async () => {
|
|
119
|
-
harness = await projectMcp(
|
|
324
|
+
harness = await projectMcp(capabilities);
|
|
120
325
|
});
|
|
121
326
|
afterAll(async () => {
|
|
122
327
|
await harness.cleanup();
|
|
123
328
|
});
|
|
124
329
|
|
|
125
|
-
it("registers the {+uri} template and lists
|
|
330
|
+
it("registers the {+uri} template and lists collections (not tools)", async () => {
|
|
126
331
|
const resources = await harness.listResources();
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
332
|
+
const component = resources.find((r) => r.uri === COMPONENT_URI);
|
|
333
|
+
expect(component?._meta?.["pragma/instanceCount"]).toBeGreaterThan(0);
|
|
334
|
+
expect(component?.title).toBe("Component");
|
|
335
|
+
// The individuals are not enumerated — autocomplete is their discovery path.
|
|
336
|
+
expect(resources.some((r) => r.uri === BUTTON_URI)).toBe(false);
|
|
337
|
+
// Resources are NOT tools — the graph module's tools appear in the tool
|
|
338
|
+
// surface, and the resource entries never do.
|
|
130
339
|
const tools = await harness.listTools();
|
|
131
|
-
expect(tools.map((t) => t.name).
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
340
|
+
expect(tools.map((t) => t.name)).toContain("graph_inspect");
|
|
341
|
+
expect(tools.map((t) => t.name)).not.toContain(COMPONENT_URI);
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
it("keeps what crosses the wire inside the payload budget", async () => {
|
|
345
|
+
const resources = await harness.listResources();
|
|
346
|
+
const bytes = Buffer.byteLength(JSON.stringify({ resources }), "utf8");
|
|
347
|
+
expect(bytes).toBeLessThan(LISTING_BUDGET_BYTES);
|
|
135
348
|
});
|
|
136
349
|
|
|
137
350
|
it("autocompletes a partial URI through the template", async () => {
|
|
138
|
-
const values = await harness.completeResource("
|
|
139
|
-
expect(values).toContain(
|
|
351
|
+
const { values } = await harness.completeResource("global.component.butt");
|
|
352
|
+
expect(values).toContain(BUTTON_NAME);
|
|
140
353
|
});
|
|
141
354
|
|
|
142
|
-
it("
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
355
|
+
it("reports total/hasMore truthfully for a query with >100 matches", async () => {
|
|
356
|
+
const result = await harness.completeResource("ds:");
|
|
357
|
+
// The SDK caps the wire at 100 values; `total` must be the real match count
|
|
358
|
+
// and `hasMore` must admit the truncation.
|
|
359
|
+
expect(result.values.length).toBe(100);
|
|
360
|
+
expect(result.total ?? 0).toBeGreaterThan(100);
|
|
361
|
+
expect(result.hasMore).toBe(true);
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
it("serves Turtle, mirroring `graph inspect --format llm` byte for byte", async () => {
|
|
365
|
+
// The mirror survives the encoding change: both surfaces serialize the SAME
|
|
366
|
+
// reader through the SAME serializer, so this still fails the moment one of
|
|
367
|
+
// them grows a projection the other does not have.
|
|
368
|
+
const read = await harness.readResource(BUTTON_URI);
|
|
369
|
+
expect(read.mimeType).toBe("text/turtle");
|
|
146
370
|
|
|
147
|
-
// The CLI twin over the same (embedded) pack must return identical content.
|
|
148
371
|
const rt = bootRuntime(TEST_FLAGS);
|
|
149
372
|
const inspect = graphModule.verbs.find(
|
|
150
373
|
(v) => verbKey(v.path) === "graph inspect",
|
|
151
374
|
) as VerbSpec;
|
|
152
375
|
const fromCli = (await inspect.run(
|
|
153
|
-
{ uri:
|
|
376
|
+
{ uri: BUTTON_NAME },
|
|
154
377
|
rt,
|
|
155
378
|
)) as InspectResult;
|
|
156
379
|
(await rt.store.get()).store.dispose();
|
|
157
380
|
|
|
158
|
-
|
|
159
|
-
expect(
|
|
381
|
+
const llm = inspect.output?.formatters?.llm;
|
|
382
|
+
expect(llm).toBeDefined();
|
|
383
|
+
expect(read.text).toBe(llm?.(fromCli, TEST_FLAGS));
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
it("emits Turtle an RDF parser accepts", async () => {
|
|
387
|
+
// The point of serving `text/turtle` is that it IS Turtle. Asserted by
|
|
388
|
+
// PARSING it with the same engine the store uses, not by matching shapes —
|
|
389
|
+
// a document that only looks right is how a reader gets a syntax error
|
|
390
|
+
// instead of an entity.
|
|
391
|
+
const read = await harness.readResource(BUTTON_URI);
|
|
392
|
+
const dir = mkdtempSync(join(tmpdir(), "pragma-resource-ttl-"));
|
|
393
|
+
const file = join(dir, "entity.ttl");
|
|
394
|
+
writeFileSync(file, read.text);
|
|
395
|
+
|
|
396
|
+
const ke = await import("@canonical/ke");
|
|
397
|
+
const store = await ke.createStore({ sources: [file] });
|
|
398
|
+
const result = await store.query(
|
|
399
|
+
"SELECT (COUNT(*) AS ?n) WHERE { ?s ?p ?o }",
|
|
400
|
+
);
|
|
401
|
+
store.dispose();
|
|
402
|
+
expect(Number(result.bindings[0]?.n ?? 0)).toBeGreaterThan(0);
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
it("previews a long literal rather than spending the whole body", async () => {
|
|
406
|
+
// Measured: one button carried 8,572 of its 9,734 literal characters in two
|
|
407
|
+
// prose fields. Serving those in full at the DEFAULT level makes every read
|
|
408
|
+
// pay for documentation the reader may not have asked for.
|
|
409
|
+
const read = await harness.readResource(BUTTON_URI);
|
|
410
|
+
expect(read.text).toMatch(/# ds:guidelines — [\d,]+ chars, showing \d+/);
|
|
160
411
|
});
|
|
161
412
|
|
|
162
413
|
it("rejects a read of an absent entity as InvalidParams carrying ENTITY_NOT_FOUND", async () => {
|
|
163
|
-
// The warm embedded pack resolves the `
|
|
414
|
+
// The warm embedded pack resolves the `ds:` prefix but holds no `Nonexistent`
|
|
164
415
|
// subject, so the read fails ENTITY_NOT_FOUND — the caller's fault, which
|
|
165
416
|
// `mcpErrorFrom` maps to JSON-RPC InvalidParams, NOT the InternalError a cold
|
|
166
417
|
// store (STORE_UNAVAILABLE) earns.
|
|
167
|
-
const error = await harness.readResource("pragma:
|
|
418
|
+
const error = await harness.readResource("pragma:ds:Nonexistent").then(
|
|
168
419
|
() => undefined,
|
|
169
420
|
(caught: unknown) => caught,
|
|
170
421
|
);
|
|
@@ -181,22 +432,27 @@ describe("resource surface over the server (embedded pack)", () => {
|
|
|
181
432
|
* D3 — a resource-read failure surfaces as a JSON-RPC error (the read analogue of
|
|
182
433
|
* a tool result's `isError`) carrying the recovery, NOT swallowed into a
|
|
183
434
|
* `text/plain` "success" body that drops the recovery and reads as though the
|
|
184
|
-
* entity itself were malformed. A
|
|
185
|
-
*
|
|
435
|
+
* entity itself were malformed. A project that declares its own packs and has
|
|
436
|
+
* never built them is the cold store — it must NOT be served the distribution's
|
|
437
|
+
* embedded graph; the read boots the store, so it refuses with
|
|
438
|
+
* STORE_UNAVAILABLE.
|
|
186
439
|
*/
|
|
187
440
|
describe("resource read — cold-store failure surfaces isError + recovery (D3)", () => {
|
|
188
441
|
let harness: Awaited<ReturnType<typeof projectMcp>>;
|
|
189
442
|
beforeAll(async () => {
|
|
190
443
|
const cwd = mkdtempSync(join(tmpdir(), "pragma-resource-cold-"));
|
|
191
|
-
|
|
192
|
-
|
|
444
|
+
writeFileSync(
|
|
445
|
+
join(cwd, "pragma.config.ts"),
|
|
446
|
+
`export default { packs: [{ name: "unbuilt", source: "file:///pragma-never-built" }] };\n`,
|
|
447
|
+
);
|
|
448
|
+
harness = await projectMcp([graphModule, ontologyModule], cwd);
|
|
193
449
|
});
|
|
194
450
|
afterAll(async () => {
|
|
195
451
|
await harness.cleanup();
|
|
196
452
|
});
|
|
197
453
|
|
|
198
454
|
it("rejects (does not return text/plain content) with the STORE_UNAVAILABLE recovery", async () => {
|
|
199
|
-
const error = await harness.readResource(
|
|
455
|
+
const error = await harness.readResource(BUTTON_URI).then(
|
|
200
456
|
() => undefined,
|
|
201
457
|
(caught: unknown) => caught,
|
|
202
458
|
);
|
|
@@ -210,4 +466,100 @@ describe("resource read — cold-store failure surfaces isError + recovery (D3)"
|
|
|
210
466
|
expect(data?.code).toBe("STORE_UNAVAILABLE");
|
|
211
467
|
expect(data?.recovery?.mcp?.tool).toBe("sources_update");
|
|
212
468
|
});
|
|
469
|
+
|
|
470
|
+
it("SERVES the one resource it advertises — `pragma:sources` reads", async () => {
|
|
471
|
+
// On a cold store the recovery hint is the entire listing. It used to fail
|
|
472
|
+
// `INVALID_INPUT — Invalid uri "sources"`: the only resource offered
|
|
473
|
+
// refused to be read, so the explanation of the cold store was unreachable
|
|
474
|
+
// from the surface that showed it.
|
|
475
|
+
const listed = await harness.listResources();
|
|
476
|
+
expect(listed.map((r) => r.uri)).toEqual(["pragma:sources"]);
|
|
477
|
+
const read = await harness.readResource("pragma:sources");
|
|
478
|
+
expect(read.text).toMatch(/sources update/);
|
|
479
|
+
});
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
describe("a percent-encoded resource URI reads (PROTECTED)", () => {
|
|
483
|
+
let harness: Awaited<ReturnType<typeof projectMcp>>;
|
|
484
|
+
beforeAll(async () => {
|
|
485
|
+
harness = await projectMcp([graphModule]);
|
|
486
|
+
});
|
|
487
|
+
afterAll(async () => {
|
|
488
|
+
await harness.cleanup();
|
|
489
|
+
});
|
|
490
|
+
|
|
491
|
+
it("resolves the encoded form to the same entity as the plain one", async () => {
|
|
492
|
+
// A client that percent-encodes the URI it puts in a `pragma:{+uri}` read is
|
|
493
|
+
// not doing anything wrong, and the surface was rejecting its own advertised
|
|
494
|
+
// identifiers. Asserted THROUGH the server, since that is where a client
|
|
495
|
+
// meets it — the unit test on `resolveUri` cannot see the template.
|
|
496
|
+
const plain = await harness.readResource("pragma:ds:Component");
|
|
497
|
+
const encoded = await harness.readResource("pragma:ds%3AComponent");
|
|
498
|
+
expect(encoded.text).toBe(plain.text);
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
it("still refuses a malformed escape as InvalidParams", async () => {
|
|
502
|
+
const error = await harness.readResource("pragma:%E0%A4%A").then(
|
|
503
|
+
() => undefined,
|
|
504
|
+
(caught: unknown) => caught,
|
|
505
|
+
);
|
|
506
|
+
expect(error, "a malformed escape must not read as success").toBeDefined();
|
|
507
|
+
expect((error as { data?: { code?: string } }).data?.code).toBe(
|
|
508
|
+
"INVALID_INPUT",
|
|
509
|
+
);
|
|
510
|
+
});
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
describe("listing + ranking edge cases the review surfaced", () => {
|
|
514
|
+
it("states zero for a declared collection whose class has no instances", () => {
|
|
515
|
+
// Without a default, an empty collection carries NO `pragma/instanceCount`
|
|
516
|
+
// and is indistinguishable from an entry that is not a collection at all.
|
|
517
|
+
const index: PackIndex = {
|
|
518
|
+
version: 2,
|
|
519
|
+
contentHash: "test",
|
|
520
|
+
prefixes: {},
|
|
521
|
+
entities: [
|
|
522
|
+
{
|
|
523
|
+
name: "ex:Empty",
|
|
524
|
+
type: "owl:Class",
|
|
525
|
+
uri: "https://ex.test/#Empty",
|
|
526
|
+
prefixed: "ex:Empty",
|
|
527
|
+
types: ["owl:Class"],
|
|
528
|
+
label: "Empty",
|
|
529
|
+
box: "tbox",
|
|
530
|
+
description: null,
|
|
531
|
+
},
|
|
532
|
+
],
|
|
533
|
+
instanceCountByType: {},
|
|
534
|
+
};
|
|
535
|
+
const listed = buildResourceList(index, {
|
|
536
|
+
sources: [{ type: "ex:Empty", as: "collection" }],
|
|
537
|
+
});
|
|
538
|
+
expect(listed).toHaveLength(1);
|
|
539
|
+
expect(listed[0]?._meta?.["pragma/instanceCount"]).toBe(0);
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
it("weighs an entity by every type it is declared under, not the primary one", () => {
|
|
543
|
+
// `type` is one lexically chosen primary among `types`. Weighing only that
|
|
544
|
+
// ignored a weight declared for a secondary type, and let ranking move when
|
|
545
|
+
// an unrelated, lexically earlier type was added.
|
|
546
|
+
const entity = {
|
|
547
|
+
name: "ex:thing",
|
|
548
|
+
type: "ex:Alpha",
|
|
549
|
+
prefixed: "ex:thing",
|
|
550
|
+
types: ["ex:Alpha", "ex:Demoted"],
|
|
551
|
+
} as PackIndex["entities"][number];
|
|
552
|
+
const rival = {
|
|
553
|
+
name: "ex:thing_other",
|
|
554
|
+
type: "ex:Alpha",
|
|
555
|
+
prefixed: "ex:thing_other",
|
|
556
|
+
types: ["ex:Alpha"],
|
|
557
|
+
} as PackIndex["entities"][number];
|
|
558
|
+
|
|
559
|
+
// Equal match quality; only the SECONDARY type's weight separates them.
|
|
560
|
+
const ranked = rankUriCompletions([entity, rival], "thing", {
|
|
561
|
+
"ex:Demoted": 0.2,
|
|
562
|
+
});
|
|
563
|
+
expect(ranked).toEqual(["ex:thing_other", "ex:thing"]);
|
|
564
|
+
});
|
|
213
565
|
});
|