@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
|
@@ -4,7 +4,13 @@
|
|
|
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
16
|
import { mkdtempSync, writeFileSync } from "node:fs";
|
|
@@ -17,61 +23,135 @@ 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
25
|
import type { InspectResult } from "../../kernel/runtime/readEntity.js";
|
|
20
|
-
import type { VerbSpec } from "../../kernel/spec/types.js";
|
|
26
|
+
import type { McpListable, VerbSpec } from "../../kernel/spec/types.js";
|
|
21
27
|
import { TEST_FLAGS } from "../../testing/helpers/projectCli.js";
|
|
22
28
|
import { projectMcp } from "../../testing/helpers/projectMcp.js";
|
|
23
29
|
import { graphModule } from "../graph/index.js";
|
|
30
|
+
import { capabilities } from "../index.js";
|
|
31
|
+
import { ontologyModule } from "../ontology/index.js";
|
|
24
32
|
import {
|
|
25
33
|
buildResourceList,
|
|
34
|
+
collectListable,
|
|
35
|
+
completionWeights,
|
|
26
36
|
rankUriCompletions,
|
|
27
37
|
resourceProvider,
|
|
28
38
|
} from "./provider.js";
|
|
29
39
|
|
|
30
40
|
/**
|
|
31
41
|
* Two entities of the committed embedded pack, chosen for what they PROVE: an
|
|
32
|
-
* abox individual and the tbox class it instantiates, so the
|
|
33
|
-
* individual
|
|
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
|
|
34
44
|
* whenever the design system does.
|
|
35
45
|
*/
|
|
36
46
|
const BUTTON_NAME = "ds:global.component.button";
|
|
37
47
|
const BUTTON_URI = `pragma:${BUTTON_NAME}`;
|
|
38
48
|
const COMPONENT_URI = "pragma:ds:Component";
|
|
39
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
|
+
|
|
40
56
|
/**
|
|
41
|
-
*
|
|
57
|
+
* The listing budget, in bytes of the `resources/list` payload.
|
|
42
58
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* of exposing blank nodes through `graph inspect`; the toy pack this suite used
|
|
49
|
-
* to run against simply had none.)
|
|
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.
|
|
50
64
|
*/
|
|
51
|
-
const
|
|
52
|
-
JSON.parse(JSON.stringify(value).replace(/_:[0-9a-f]+/g, "_:b"));
|
|
65
|
+
const LISTING_BUDGET_BYTES = 60_000;
|
|
53
66
|
|
|
54
67
|
describe("resource listing (storeless, over the pack index)", () => {
|
|
55
68
|
it("degrades to a recovery entry on a missing or legacy index", () => {
|
|
56
|
-
expect(buildResourceList(undefined)).toEqual([
|
|
69
|
+
expect(buildResourceList(undefined, declaredListing())).toEqual([
|
|
57
70
|
expect.objectContaining({
|
|
58
71
|
uri: "pragma:sources",
|
|
59
|
-
|
|
72
|
+
title: "Store not indexed",
|
|
60
73
|
}),
|
|
61
74
|
]);
|
|
62
75
|
const legacy = { version: 1, entities: [] } as unknown as PackIndex;
|
|
63
|
-
expect(buildResourceList(legacy)[0]?.uri).toBe(
|
|
76
|
+
expect(buildResourceList(legacy, declaredListing())[0]?.uri).toBe(
|
|
77
|
+
"pragma:sources",
|
|
78
|
+
);
|
|
64
79
|
});
|
|
65
80
|
|
|
66
|
-
it("lists the
|
|
81
|
+
it("lists the declared COLLECTIONS with their counts, not the individuals", () => {
|
|
67
82
|
const index = readPackIndex({ kind: "embedded" });
|
|
68
83
|
expect(index?.version).toBe(2);
|
|
69
|
-
const resources = buildResourceList(index);
|
|
70
|
-
|
|
71
|
-
//
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
expect(
|
|
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(),
|
|
103
|
+
);
|
|
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([]);
|
|
75
155
|
});
|
|
76
156
|
|
|
77
157
|
it("emits ONE resource per URI for an OWL-punned subject (A8)", () => {
|
|
@@ -108,7 +188,7 @@ describe("resource listing (storeless, over the pack index)", () => {
|
|
|
108
188
|
],
|
|
109
189
|
instanceCountByType: {},
|
|
110
190
|
};
|
|
111
|
-
const slider = buildResourceList(punned).filter(
|
|
191
|
+
const slider = buildResourceList(punned, EVERYTHING).filter(
|
|
112
192
|
(r) => r.uri === "pragma:ex:Slider",
|
|
113
193
|
);
|
|
114
194
|
expect(slider).toHaveLength(1);
|
|
@@ -116,19 +196,48 @@ describe("resource listing (storeless, over the pack index)", () => {
|
|
|
116
196
|
expect(slider.at(0)?._meta?.["pragma/box"]).toBe("tbox");
|
|
117
197
|
});
|
|
118
198
|
|
|
119
|
-
it("enriches each entry with the _meta taxonomy (
|
|
120
|
-
const resources = buildResourceList(
|
|
199
|
+
it("enriches each entry with the _meta taxonomy (box + type + count)", () => {
|
|
200
|
+
const resources = buildResourceList(
|
|
201
|
+
readPackIndex({ kind: "embedded" }),
|
|
202
|
+
declaredListing(),
|
|
203
|
+
);
|
|
121
204
|
const component = resources.find((r) => r.uri === COMPONENT_URI);
|
|
122
|
-
const button = resources.find((r) => r.uri === BUTTON_URI);
|
|
123
|
-
// A schema class: tbox, higher priority, carries its instance count.
|
|
124
205
|
expect(component?._meta?.["pragma/box"]).toBe("tbox");
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
expect(component?._meta?.["pragma/
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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"]);
|
|
214
|
+
});
|
|
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");
|
|
132
241
|
});
|
|
133
242
|
|
|
134
243
|
it("mints every URI in the scheme the declared template routes", () => {
|
|
@@ -142,56 +251,123 @@ describe("resource listing (storeless, over the pack index)", () => {
|
|
|
142
251
|
const declared = resourceProvider.surface?.templates?.[0];
|
|
143
252
|
const scheme = `${declared?.split(":")[0]}:`;
|
|
144
253
|
const listed = [
|
|
145
|
-
...buildResourceList(readPackIndex({ kind: "embedded" })),
|
|
146
|
-
...buildResourceList(undefined),
|
|
254
|
+
...buildResourceList(readPackIndex({ kind: "embedded" }), EVERYTHING),
|
|
255
|
+
...buildResourceList(undefined, EVERYTHING),
|
|
147
256
|
];
|
|
148
257
|
expect(listed.length).toBeGreaterThan(1);
|
|
149
258
|
expect(listed.filter((r) => !r.uri.startsWith(scheme))).toEqual([]);
|
|
150
259
|
});
|
|
260
|
+
});
|
|
151
261
|
|
|
262
|
+
describe("URI completion ranking", () => {
|
|
152
263
|
it("ranks autocomplete over prefixed URI and label", () => {
|
|
153
264
|
const index = readPackIndex({ kind: "embedded" });
|
|
154
265
|
const hits = rankUriCompletions(
|
|
155
266
|
index?.entities ?? [],
|
|
156
267
|
"global.component.button",
|
|
157
|
-
10,
|
|
158
268
|
);
|
|
159
269
|
expect(hits).toContain(BUTTON_NAME);
|
|
160
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);
|
|
318
|
+
});
|
|
161
319
|
});
|
|
162
320
|
|
|
163
321
|
describe("resource surface over the server (embedded pack)", () => {
|
|
164
322
|
let harness: Awaited<ReturnType<typeof projectMcp>>;
|
|
165
323
|
beforeAll(async () => {
|
|
166
|
-
harness = await projectMcp(
|
|
324
|
+
harness = await projectMcp(capabilities);
|
|
167
325
|
});
|
|
168
326
|
afterAll(async () => {
|
|
169
327
|
await harness.cleanup();
|
|
170
328
|
});
|
|
171
329
|
|
|
172
|
-
it("registers the {+uri} template and lists
|
|
330
|
+
it("registers the {+uri} template and lists collections (not tools)", async () => {
|
|
173
331
|
const resources = await harness.listResources();
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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.
|
|
177
339
|
const tools = await harness.listTools();
|
|
178
|
-
expect(tools.map((t) => t.name).
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
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);
|
|
182
348
|
});
|
|
183
349
|
|
|
184
350
|
it("autocompletes a partial URI through the template", async () => {
|
|
185
|
-
const values = await harness.completeResource("global.component.butt");
|
|
351
|
+
const { values } = await harness.completeResource("global.component.butt");
|
|
186
352
|
expect(values).toContain(BUTTON_NAME);
|
|
187
353
|
});
|
|
188
354
|
|
|
189
|
-
it("
|
|
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.
|
|
190
368
|
const read = await harness.readResource(BUTTON_URI);
|
|
191
|
-
expect(read.mimeType).toBe("
|
|
192
|
-
const fromResource = JSON.parse(read.text) as InspectResult;
|
|
369
|
+
expect(read.mimeType).toBe("text/turtle");
|
|
193
370
|
|
|
194
|
-
// The CLI twin over the same (embedded) pack must return identical content.
|
|
195
371
|
const rt = bootRuntime(TEST_FLAGS);
|
|
196
372
|
const inspect = graphModule.verbs.find(
|
|
197
373
|
(v) => verbKey(v.path) === "graph inspect",
|
|
@@ -202,12 +378,36 @@ describe("resource surface over the server (embedded pack)", () => {
|
|
|
202
378
|
)) as InspectResult;
|
|
203
379
|
(await rt.store.get()).store.dispose();
|
|
204
380
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
);
|
|
208
|
-
|
|
209
|
-
|
|
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 }",
|
|
210
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+/);
|
|
211
411
|
});
|
|
212
412
|
|
|
213
413
|
it("rejects a read of an absent entity as InvalidParams carrying ENTITY_NOT_FOUND", async () => {
|
|
@@ -245,7 +445,7 @@ describe("resource read — cold-store failure surfaces isError + recovery (D3)"
|
|
|
245
445
|
join(cwd, "pragma.config.ts"),
|
|
246
446
|
`export default { packs: [{ name: "unbuilt", source: "file:///pragma-never-built" }] };\n`,
|
|
247
447
|
);
|
|
248
|
-
harness = await projectMcp([graphModule], cwd);
|
|
448
|
+
harness = await projectMcp([graphModule, ontologyModule], cwd);
|
|
249
449
|
});
|
|
250
450
|
afterAll(async () => {
|
|
251
451
|
await harness.cleanup();
|
|
@@ -266,4 +466,100 @@ describe("resource read — cold-store failure surfaces isError + recovery (D3)"
|
|
|
266
466
|
expect(data?.code).toBe("STORE_UNAVAILABLE");
|
|
267
467
|
expect(data?.recovery?.mcp?.tool).toBe("sources_update");
|
|
268
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
|
+
});
|
|
269
565
|
});
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Type-sync pin (PROTECTED): the CLI's
|
|
3
|
-
*
|
|
2
|
+
* Type-sync pin (PROTECTED): the CLI's `Scope`/`ScopeSelection` — declared
|
|
3
|
+
* once, in the rendering vocabulary — must stay structurally EQUAL to the
|
|
4
|
+
* `@canonical/harnesses` `ScopeBand`/`ScopeSelection` types.
|
|
4
5
|
*
|
|
5
|
-
* The CLI
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* `expectTypeOf` pin enforces at `tsc` time.
|
|
6
|
+
* The CLI declares these in `kernel/render/vocabulary.ts` on purpose — so the
|
|
7
|
+
* statically-reachable type modules never pull the harnesses runtime onto the
|
|
8
|
+
* fast-path module graph (the lazy-dispatch invariant). That freedom is only
|
|
9
|
+
* safe if the declaration does not DRIFT from the source of truth, which this
|
|
10
|
+
* `expectTypeOf` pin enforces at `tsc` time. The NAMES differ deliberately:
|
|
11
|
+
* "band" is the harnesses package's word (its published API), "scope" is
|
|
12
|
+
* pragma's — the word its `--global`/`--local` flags, its rendered sentences
|
|
13
|
+
* and, since the type-layer rename, its model all use.
|
|
14
|
+
*
|
|
15
|
+
* `doctor/types.ts` and `setup/types.ts` re-export the vocabulary's types, and
|
|
16
|
+
* those re-exports are pinned too, so the one-definition property cannot
|
|
17
|
+
* silently regress into a fresh local redeclaration that then drifts.
|
|
10
18
|
*
|
|
11
19
|
* Every harnesses import here is `import type` (type-only, erased at emit), so
|
|
12
20
|
* this file loads no harnesses runtime — the `lazy.test` no-runtime-import guard
|
|
@@ -19,19 +27,25 @@ import type {
|
|
|
19
27
|
ScopeSelection as HarnessScopeSelection,
|
|
20
28
|
} from "@canonical/harnesses";
|
|
21
29
|
import { describe, expectTypeOf, it } from "vitest";
|
|
22
|
-
import type {
|
|
30
|
+
import type { Scope, ScopeSelection } from "../kernel/render/vocabulary.js";
|
|
31
|
+
import type { Scope as DoctorScope } from "./doctor/types.js";
|
|
23
32
|
import type {
|
|
24
|
-
|
|
33
|
+
Scope as SetupScope,
|
|
25
34
|
ScopeSelection as SetupScopeSelection,
|
|
26
35
|
} from "./setup/types.js";
|
|
27
36
|
|
|
28
|
-
describe("scope type-sync — CLI
|
|
29
|
-
it("
|
|
30
|
-
expectTypeOf<
|
|
31
|
-
|
|
37
|
+
describe("scope type-sync — the CLI vocabulary == @canonical/harnesses", () => {
|
|
38
|
+
it("the vocabulary Scope equals the harnesses ScopeBand", () => {
|
|
39
|
+
expectTypeOf<Scope>().toEqualTypeOf<HarnessScopeBand>();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("the vocabulary ScopeSelection equals the harnesses ScopeSelection", () => {
|
|
43
|
+
expectTypeOf<ScopeSelection>().toEqualTypeOf<HarnessScopeSelection>();
|
|
32
44
|
});
|
|
33
45
|
|
|
34
|
-
it("
|
|
35
|
-
expectTypeOf<
|
|
46
|
+
it("doctor and setup re-export the one vocabulary definition", () => {
|
|
47
|
+
expectTypeOf<DoctorScope>().toEqualTypeOf<Scope>();
|
|
48
|
+
expectTypeOf<SetupScope>().toEqualTypeOf<Scope>();
|
|
49
|
+
expectTypeOf<SetupScopeSelection>().toEqualTypeOf<ScopeSelection>();
|
|
36
50
|
});
|
|
37
51
|
});
|