@canonical/pragma-cli 0.34.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +153 -30
- package/bundled-skills/add-standard/SKILL.md +338 -0
- package/bundled-skills/adoption-a1-styles/SKILL.md +269 -0
- package/bundled-skills/adoption-a2-components/SKILL.md +291 -0
- package/bundled-skills/adoption-a3-forms/SKILL.md +260 -0
- package/bundled-skills/anatomy-author/ANATOMY_DSL_SPEC.md +406 -0
- package/bundled-skills/anatomy-author/SKILL.md +1226 -0
- package/bundled-skills/design-auditor/SKILL.md +455 -0
- package/bundled-skills/implement-component/SKILL.md +333 -0
- package/bundled-skills/specify-component/SKILL.md +331 -0
- package/bundled-skills/specify-pattern/SKILL.md +292 -0
- package/dist/.build-ok +0 -0
- package/dist/package.json +84 -0
- package/dist/pragma.conf.js +1016 -0
- package/dist/pragma.conf.js.map +1 -0
- package/dist/src/bin.js +356 -0
- package/dist/src/bin.js.map +1 -0
- package/dist/src/capabilities/capabilities/capabilities.render.js +70 -0
- package/dist/src/capabilities/capabilities/capabilities.render.js.map +1 -0
- package/dist/src/capabilities/capabilities/capabilities.verb.js +59 -0
- package/dist/src/capabilities/capabilities/capabilities.verb.js.map +1 -0
- package/dist/src/capabilities/capabilities/catalog.js +130 -0
- package/dist/src/capabilities/capabilities/catalog.js.map +1 -0
- package/dist/src/capabilities/capabilities/hints.js +195 -0
- package/dist/src/capabilities/capabilities/hints.js.map +1 -0
- package/dist/src/capabilities/capabilities/index.js +11 -0
- package/dist/src/capabilities/capabilities/index.js.map +1 -0
- package/dist/src/capabilities/capabilities/types.js +11 -0
- package/dist/src/capabilities/capabilities/types.js.map +1 -0
- package/dist/src/capabilities/colophon/collectColophon.js +83 -0
- package/dist/src/capabilities/colophon/collectColophon.js.map +1 -0
- package/dist/src/capabilities/colophon/colophon.render.js +59 -0
- package/dist/src/capabilities/colophon/colophon.render.js.map +1 -0
- package/dist/src/capabilities/colophon/colophon.verb.js +43 -0
- package/dist/src/capabilities/colophon/colophon.verb.js.map +1 -0
- package/dist/src/capabilities/colophon/index.js +5 -0
- package/dist/src/capabilities/colophon/index.js.map +1 -0
- package/dist/src/capabilities/colophon/markdownTerminal.js +90 -0
- package/dist/src/capabilities/colophon/markdownTerminal.js.map +1 -0
- package/dist/src/capabilities/colophon/types.js +10 -0
- package/dist/src/capabilities/colophon/types.js.map +1 -0
- package/dist/src/capabilities/config/collectConfigShow.js +59 -0
- package/dist/src/capabilities/config/collectConfigShow.js.map +1 -0
- package/dist/src/capabilities/config/field.render.js +22 -0
- package/dist/src/capabilities/config/field.render.js.map +1 -0
- package/dist/src/capabilities/config/fields.js +46 -0
- package/dist/src/capabilities/config/fields.js.map +1 -0
- package/dist/src/capabilities/config/get.verb.js +61 -0
- package/dist/src/capabilities/config/get.verb.js.map +1 -0
- package/dist/src/capabilities/config/index.js +5 -0
- package/dist/src/capabilities/config/index.js.map +1 -0
- package/dist/src/capabilities/config/runField.js +59 -0
- package/dist/src/capabilities/config/runField.js.map +1 -0
- package/dist/src/capabilities/config/runGet.js +28 -0
- package/dist/src/capabilities/config/runGet.js.map +1 -0
- package/dist/src/capabilities/config/runSet.js +53 -0
- package/dist/src/capabilities/config/runSet.js.map +1 -0
- package/dist/src/capabilities/config/set.verb.js +66 -0
- package/dist/src/capabilities/config/set.verb.js.map +1 -0
- package/dist/src/capabilities/config/show.render.js +84 -0
- package/dist/src/capabilities/config/show.render.js.map +1 -0
- package/dist/src/capabilities/config/show.verb.js +44 -0
- package/dist/src/capabilities/config/show.verb.js.map +1 -0
- package/dist/src/capabilities/config/types.js +5 -0
- package/dist/src/capabilities/config/types.js.map +1 -0
- package/dist/src/capabilities/config/unset.verb.js +49 -0
- package/dist/src/capabilities/config/unset.verb.js.map +1 -0
- package/dist/src/capabilities/create/cliProjection.js +195 -0
- package/dist/src/capabilities/create/cliProjection.js.map +1 -0
- package/dist/src/capabilities/create/constants.js +47 -0
- package/dist/src/capabilities/create/constants.js.map +1 -0
- package/dist/src/capabilities/create/create.render.js +100 -0
- package/dist/src/capabilities/create/create.render.js.map +1 -0
- package/dist/src/capabilities/create/create.verb.js +438 -0
- package/dist/src/capabilities/create/create.verb.js.map +1 -0
- package/dist/src/capabilities/create/createHelp.js +47 -0
- package/dist/src/capabilities/create/createHelp.js.map +1 -0
- package/dist/src/capabilities/create/createSurface.generated.js +394 -0
- package/dist/src/capabilities/create/createSurface.generated.js.map +1 -0
- package/dist/src/capabilities/create/generatorToVerbSpec.js +106 -0
- package/dist/src/capabilities/create/generatorToVerbSpec.js.map +1 -0
- package/dist/src/capabilities/create/index.js +18 -0
- package/dist/src/capabilities/create/index.js.map +1 -0
- package/dist/src/capabilities/create/messages.js +16 -0
- package/dist/src/capabilities/create/messages.js.map +1 -0
- package/dist/src/capabilities/create/mount.js +294 -0
- package/dist/src/capabilities/create/mount.js.map +1 -0
- package/dist/src/capabilities/create/pathJail.js +65 -0
- package/dist/src/capabilities/create/pathJail.js.map +1 -0
- package/dist/src/capabilities/create/pickGenerator.js +53 -0
- package/dist/src/capabilities/create/pickGenerator.js.map +1 -0
- package/dist/src/capabilities/create/types.js +2 -0
- package/dist/src/capabilities/create/types.js.map +1 -0
- package/dist/src/capabilities/distribution.js +40 -0
- package/dist/src/capabilities/distribution.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkKeStore.js +40 -0
- package/dist/src/capabilities/doctor/checks/checkKeStore.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkNodeVersion.js +21 -0
- package/dist/src/capabilities/doctor/checks/checkNodeVersion.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkPackageRefs.js +148 -0
- package/dist/src/capabilities/doctor/checks/checkPackageRefs.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkPragmaVersion.js +19 -0
- package/dist/src/capabilities/doctor/checks/checkPragmaVersion.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkShellCompletions.js +199 -0
- package/dist/src/capabilities/doctor/checks/checkShellCompletions.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/harnessInventory.js +195 -0
- package/dist/src/capabilities/doctor/checks/harnessInventory.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/index.js +27 -0
- package/dist/src/capabilities/doctor/checks/index.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/mcpCommand.js +57 -0
- package/dist/src/capabilities/doctor/checks/mcpCommand.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/targetHealth.js +349 -0
- package/dist/src/capabilities/doctor/checks/targetHealth.js.map +1 -0
- package/dist/src/capabilities/doctor/doctor.render.js +164 -0
- package/dist/src/capabilities/doctor/doctor.render.js.map +1 -0
- package/dist/src/capabilities/doctor/doctor.verb.js +49 -0
- package/dist/src/capabilities/doctor/doctor.verb.js.map +1 -0
- package/dist/src/capabilities/doctor/index.js +5 -0
- package/dist/src/capabilities/doctor/index.js.map +1 -0
- package/dist/src/capabilities/doctor/runChecks.js +86 -0
- package/dist/src/capabilities/doctor/runChecks.js.map +1 -0
- package/dist/src/capabilities/doctor/types.js +5 -0
- package/dist/src/capabilities/doctor/types.js.map +1 -0
- package/dist/src/capabilities/graph/index.js +19 -0
- package/dist/src/capabilities/graph/index.js.map +1 -0
- package/dist/src/capabilities/graph/inspect.render.js +76 -0
- package/dist/src/capabilities/graph/inspect.render.js.map +1 -0
- package/dist/src/capabilities/graph/inspect.verb.js +53 -0
- package/dist/src/capabilities/graph/inspect.verb.js.map +1 -0
- package/dist/src/capabilities/graph/query.render.js +73 -0
- package/dist/src/capabilities/graph/query.render.js.map +1 -0
- package/dist/src/capabilities/graph/query.verb.js +49 -0
- package/dist/src/capabilities/graph/query.verb.js.map +1 -0
- package/dist/src/capabilities/graph/runQuery.js +41 -0
- package/dist/src/capabilities/graph/runQuery.js.map +1 -0
- package/dist/src/capabilities/index.js +56 -0
- package/dist/src/capabilities/index.js.map +1 -0
- package/dist/src/capabilities/info/collectInfo.js +72 -0
- package/dist/src/capabilities/info/collectInfo.js.map +1 -0
- package/dist/src/capabilities/info/index.js +5 -0
- package/dist/src/capabilities/info/index.js.map +1 -0
- package/dist/src/capabilities/info/info.render.js +57 -0
- package/dist/src/capabilities/info/info.render.js.map +1 -0
- package/dist/src/capabilities/info/info.verb.js +42 -0
- package/dist/src/capabilities/info/info.verb.js.map +1 -0
- package/dist/src/capabilities/info/types.js +5 -0
- package/dist/src/capabilities/info/types.js.map +1 -0
- package/dist/src/capabilities/meta/complete.verb.js +43 -0
- package/dist/src/capabilities/meta/complete.verb.js.map +1 -0
- package/dist/src/capabilities/meta/index.js +13 -0
- package/dist/src/capabilities/meta/index.js.map +1 -0
- package/dist/src/capabilities/meta/mcp.verb.js +34 -0
- package/dist/src/capabilities/meta/mcp.verb.js.map +1 -0
- package/dist/src/capabilities/ontology/index.js +21 -0
- package/dist/src/capabilities/ontology/index.js.map +1 -0
- package/dist/src/capabilities/ontology/queries.js +123 -0
- package/dist/src/capabilities/ontology/queries.js.map +1 -0
- package/dist/src/capabilities/ontology/render.js +66 -0
- package/dist/src/capabilities/ontology/render.js.map +1 -0
- package/dist/src/capabilities/ontology/verbs.js +181 -0
- package/dist/src/capabilities/ontology/verbs.js.map +1 -0
- package/dist/src/capabilities/prompt/index.js +16 -0
- package/dist/src/capabilities/prompt/index.js.map +1 -0
- package/dist/src/capabilities/prompt/prompt.render.js +78 -0
- package/dist/src/capabilities/prompt/prompt.render.js.map +1 -0
- package/dist/src/capabilities/prompt/types.js +10 -0
- package/dist/src/capabilities/prompt/types.js.map +1 -0
- package/dist/src/capabilities/prompt/verbs.js +93 -0
- package/dist/src/capabilities/prompt/verbs.js.map +1 -0
- package/dist/src/capabilities/resources/index.js +10 -0
- package/dist/src/capabilities/resources/index.js.map +1 -0
- package/dist/src/capabilities/resources/provider.js +423 -0
- package/dist/src/capabilities/resources/provider.js.map +1 -0
- package/dist/src/capabilities/setup/buildPlan.js +172 -0
- package/dist/src/capabilities/setup/buildPlan.js.map +1 -0
- package/dist/src/capabilities/setup/index.js +5 -0
- package/dist/src/capabilities/setup/index.js.map +1 -0
- package/dist/src/capabilities/setup/mode.js +53 -0
- package/dist/src/capabilities/setup/mode.js.map +1 -0
- package/dist/src/capabilities/setup/operations/index.js +39 -0
- package/dist/src/capabilities/setup/operations/index.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupCompletions.js +160 -0
- package/dist/src/capabilities/setup/operations/setupCompletions.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupConfig.js +101 -0
- package/dist/src/capabilities/setup/operations/setupConfig.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupGenerator.js +390 -0
- package/dist/src/capabilities/setup/operations/setupGenerator.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupLsp.js +329 -0
- package/dist/src/capabilities/setup/operations/setupLsp.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupMcp.js +253 -0
- package/dist/src/capabilities/setup/operations/setupMcp.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupSkills.js +594 -0
- package/dist/src/capabilities/setup/operations/setupSkills.js.map +1 -0
- package/dist/src/capabilities/setup/plan.js +128 -0
- package/dist/src/capabilities/setup/plan.js.map +1 -0
- package/dist/src/capabilities/setup/plan.render.js +271 -0
- package/dist/src/capabilities/setup/plan.render.js.map +1 -0
- package/dist/src/capabilities/setup/setup.render.js +54 -0
- package/dist/src/capabilities/setup/setup.render.js.map +1 -0
- package/dist/src/capabilities/setup/setup.verb.js +387 -0
- package/dist/src/capabilities/setup/setup.verb.js.map +1 -0
- package/dist/src/capabilities/setup/shell.js +196 -0
- package/dist/src/capabilities/setup/shell.js.map +1 -0
- package/dist/src/capabilities/setup/targets.js +328 -0
- package/dist/src/capabilities/setup/targets.js.map +1 -0
- package/dist/src/capabilities/setup/types.js +5 -0
- package/dist/src/capabilities/setup/types.js.map +1 -0
- package/dist/src/capabilities/shared/assertExecOk.js +137 -0
- package/dist/src/capabilities/shared/assertExecOk.js.map +1 -0
- package/dist/src/capabilities/shared/index.js +27 -0
- package/dist/src/capabilities/shared/index.js.map +1 -0
- package/dist/src/capabilities/shared/packageManager.js +349 -0
- package/dist/src/capabilities/shared/packageManager.js.map +1 -0
- package/dist/src/capabilities/shared/registry.js +55 -0
- package/dist/src/capabilities/shared/registry.js.map +1 -0
- package/dist/src/capabilities/skill/discover.js +281 -0
- package/dist/src/capabilities/skill/discover.js.map +1 -0
- package/dist/src/capabilities/skill/index.js +10 -0
- package/dist/src/capabilities/skill/index.js.map +1 -0
- package/dist/src/capabilities/skill/render.js +49 -0
- package/dist/src/capabilities/skill/render.js.map +1 -0
- package/dist/src/capabilities/skill/verbs.js +83 -0
- package/dist/src/capabilities/skill/verbs.js.map +1 -0
- package/dist/src/capabilities/sources/collectStatus.js +103 -0
- package/dist/src/capabilities/sources/collectStatus.js.map +1 -0
- package/dist/src/capabilities/sources/index.js +13 -0
- package/dist/src/capabilities/sources/index.js.map +1 -0
- package/dist/src/capabilities/sources/installSkills.js +309 -0
- package/dist/src/capabilities/sources/installSkills.js.map +1 -0
- package/dist/src/capabilities/sources/runUpdate.js +460 -0
- package/dist/src/capabilities/sources/runUpdate.js.map +1 -0
- package/dist/src/capabilities/sources/status.render.js +64 -0
- package/dist/src/capabilities/sources/status.render.js.map +1 -0
- package/dist/src/capabilities/sources/status.verb.js +40 -0
- package/dist/src/capabilities/sources/status.verb.js.map +1 -0
- package/dist/src/capabilities/sources/types.js +6 -0
- package/dist/src/capabilities/sources/types.js.map +1 -0
- package/dist/src/capabilities/sources/update.render.js +34 -0
- package/dist/src/capabilities/sources/update.render.js.map +1 -0
- package/dist/src/capabilities/sources/update.verb.js +55 -0
- package/dist/src/capabilities/sources/update.verb.js.map +1 -0
- package/dist/src/capabilities/upgrade/index.js +5 -0
- package/dist/src/capabilities/upgrade/index.js.map +1 -0
- package/dist/src/capabilities/upgrade/runUpgrade.js +135 -0
- package/dist/src/capabilities/upgrade/runUpgrade.js.map +1 -0
- package/dist/src/capabilities/upgrade/types.js +5 -0
- package/dist/src/capabilities/upgrade/types.js.map +1 -0
- package/dist/src/capabilities/upgrade/upgrade.render.js +52 -0
- package/dist/src/capabilities/upgrade/upgrade.render.js.map +1 -0
- package/dist/src/capabilities/upgrade/upgrade.verb.js +52 -0
- package/dist/src/capabilities/upgrade/upgrade.verb.js.map +1 -0
- package/dist/src/capabilities/version/index.js +10 -0
- package/dist/src/capabilities/version/index.js.map +1 -0
- package/dist/src/capabilities/version/version.verb.js +36 -0
- package/dist/src/capabilities/version/version.verb.js.map +1 -0
- package/dist/src/constants.js +87 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/index.js +12 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/kernel/completion/complete.js +66 -0
- package/dist/src/kernel/completion/complete.js.map +1 -0
- package/dist/src/kernel/completion/emitScripts.js +92 -0
- package/dist/src/kernel/completion/emitScripts.js.map +1 -0
- package/dist/src/kernel/completion/entitySource.js +285 -0
- package/dist/src/kernel/completion/entitySource.js.map +1 -0
- package/dist/src/kernel/completion/index.js +14 -0
- package/dist/src/kernel/completion/index.js.map +1 -0
- package/dist/src/kernel/completion/model.js +301 -0
- package/dist/src/kernel/completion/model.js.map +1 -0
- package/dist/src/kernel/completion/parse.js +253 -0
- package/dist/src/kernel/completion/parse.js.map +1 -0
- package/dist/src/kernel/completion/rank.js +101 -0
- package/dist/src/kernel/completion/rank.js.map +1 -0
- package/dist/src/kernel/completion/resolve.js +100 -0
- package/dist/src/kernel/completion/resolve.js.map +1 -0
- package/dist/src/kernel/completion/templates/bash.js +209 -0
- package/dist/src/kernel/completion/templates/bash.js.map +1 -0
- package/dist/src/kernel/completion/templates/fish.js +214 -0
- package/dist/src/kernel/completion/templates/fish.js.map +1 -0
- package/dist/src/kernel/completion/templates/index.js +23 -0
- package/dist/src/kernel/completion/templates/index.js.map +1 -0
- package/dist/src/kernel/completion/templates/shared.js +98 -0
- package/dist/src/kernel/completion/templates/shared.js.map +1 -0
- package/dist/src/kernel/completion/templates/zsh.js +201 -0
- package/dist/src/kernel/completion/templates/zsh.js.map +1 -0
- package/dist/src/kernel/completion/types.js +13 -0
- package/dist/src/kernel/completion/types.js.map +1 -0
- package/dist/src/kernel/config/defaults.js +17 -0
- package/dist/src/kernel/config/defaults.js.map +1 -0
- package/dist/src/kernel/config/evaluateProjectConfig.js +126 -0
- package/dist/src/kernel/config/evaluateProjectConfig.js.map +1 -0
- package/dist/src/kernel/config/findProjectConfig.js +43 -0
- package/dist/src/kernel/config/findProjectConfig.js.map +1 -0
- package/dist/src/kernel/config/firstRun.js +34 -0
- package/dist/src/kernel/config/firstRun.js.map +1 -0
- package/dist/src/kernel/config/globalConfig.js +79 -0
- package/dist/src/kernel/config/globalConfig.js.map +1 -0
- package/dist/src/kernel/config/index.js +16 -0
- package/dist/src/kernel/config/index.js.map +1 -0
- package/dist/src/kernel/config/paths.js +35 -0
- package/dist/src/kernel/config/paths.js.map +1 -0
- package/dist/src/kernel/config/readConfig.js +78 -0
- package/dist/src/kernel/config/readConfig.js.map +1 -0
- package/dist/src/kernel/config/schema.js +130 -0
- package/dist/src/kernel/config/schema.js.map +1 -0
- package/dist/src/kernel/config/types.js +19 -0
- package/dist/src/kernel/config/types.js.map +1 -0
- package/dist/src/kernel/config/writeConfigField.js +59 -0
- package/dist/src/kernel/config/writeConfigField.js.map +1 -0
- package/dist/src/kernel/copy.js +43 -0
- package/dist/src/kernel/copy.js.map +1 -0
- package/dist/src/kernel/error/PragmaError.js +149 -0
- package/dist/src/kernel/error/PragmaError.js.map +1 -0
- package/dist/src/kernel/error/constants.js +40 -0
- package/dist/src/kernel/error/constants.js.map +1 -0
- package/dist/src/kernel/error/fromTaskError.js +96 -0
- package/dist/src/kernel/error/fromTaskError.js.map +1 -0
- package/dist/src/kernel/error/index.js +13 -0
- package/dist/src/kernel/error/index.js.map +1 -0
- package/dist/src/kernel/error/recovery.js +52 -0
- package/dist/src/kernel/error/recovery.js.map +1 -0
- package/dist/src/kernel/error/renderError.js +115 -0
- package/dist/src/kernel/error/renderError.js.map +1 -0
- package/dist/src/kernel/error/serialize.js +25 -0
- package/dist/src/kernel/error/serialize.js.map +1 -0
- package/dist/src/kernel/error/types.js +9 -0
- package/dist/src/kernel/error/types.js.map +1 -0
- package/dist/src/kernel/index.js +34 -0
- package/dist/src/kernel/index.js.map +1 -0
- package/dist/src/kernel/interactivity.js +68 -0
- package/dist/src/kernel/interactivity.js.map +1 -0
- package/dist/src/kernel/packs/collect.js +187 -0
- package/dist/src/kernel/packs/collect.js.map +1 -0
- package/dist/src/kernel/packs/compile.js +304 -0
- package/dist/src/kernel/packs/compile.js.map +1 -0
- package/dist/src/kernel/packs/disclosure.js +76 -0
- package/dist/src/kernel/packs/disclosure.js.map +1 -0
- package/dist/src/kernel/packs/glob.js +38 -0
- package/dist/src/kernel/packs/glob.js.map +1 -0
- package/dist/src/kernel/packs/graphql/buildLookupDocument.js +258 -0
- package/dist/src/kernel/packs/graphql/buildLookupDocument.js.map +1 -0
- package/dist/src/kernel/packs/graphql/fetchGraphqlLookup.js +157 -0
- package/dist/src/kernel/packs/graphql/fetchGraphqlLookup.js.map +1 -0
- package/dist/src/kernel/packs/graphql/index.js +20 -0
- package/dist/src/kernel/packs/graphql/index.js.map +1 -0
- package/dist/src/kernel/packs/graphql/nameMap.js +63 -0
- package/dist/src/kernel/packs/graphql/nameMap.js.map +1 -0
- package/dist/src/kernel/packs/index.js +34 -0
- package/dist/src/kernel/packs/index.js.map +1 -0
- package/dist/src/kernel/packs/iri.js +110 -0
- package/dist/src/kernel/packs/iri.js.map +1 -0
- package/dist/src/kernel/packs/renderPack.js +129 -0
- package/dist/src/kernel/packs/renderPack.js.map +1 -0
- package/dist/src/kernel/packs/resolveEntity.js +274 -0
- package/dist/src/kernel/packs/resolveEntity.js.map +1 -0
- package/dist/src/kernel/packs/runBodies.js +140 -0
- package/dist/src/kernel/packs/runBodies.js.map +1 -0
- package/dist/src/kernel/packs/sample.js +56 -0
- package/dist/src/kernel/packs/sample.js.map +1 -0
- package/dist/src/kernel/packs/schema.js +421 -0
- package/dist/src/kernel/packs/schema.js.map +1 -0
- package/dist/src/kernel/packs/sparql/applyFilters.js +167 -0
- package/dist/src/kernel/packs/sparql/applyFilters.js.map +1 -0
- package/dist/src/kernel/packs/sparql/applySearch.js +25 -0
- package/dist/src/kernel/packs/sparql/applySearch.js.map +1 -0
- package/dist/src/kernel/packs/sparql/buildLookupQuery.js +480 -0
- package/dist/src/kernel/packs/sparql/buildLookupQuery.js.map +1 -0
- package/dist/src/kernel/packs/sparql/escape.js +21 -0
- package/dist/src/kernel/packs/sparql/escape.js.map +1 -0
- package/dist/src/kernel/packs/sparql/index.js +31 -0
- package/dist/src/kernel/packs/sparql/index.js.map +1 -0
- package/dist/src/kernel/packs/sparql/runSelect.js +101 -0
- package/dist/src/kernel/packs/sparql/runSelect.js.map +1 -0
- package/dist/src/kernel/packs/types.js +30 -0
- package/dist/src/kernel/packs/types.js.map +1 -0
- package/dist/src/kernel/packs/uniqueness.js +30 -0
- package/dist/src/kernel/packs/uniqueness.js.map +1 -0
- package/dist/src/kernel/project/cli/buildProgram.js +263 -0
- package/dist/src/kernel/project/cli/buildProgram.js.map +1 -0
- package/dist/src/kernel/project/cli/constants.js +27 -0
- package/dist/src/kernel/project/cli/constants.js.map +1 -0
- package/dist/src/kernel/project/cli/dispatch.js +420 -0
- package/dist/src/kernel/project/cli/dispatch.js.map +1 -0
- package/dist/src/kernel/project/cli/exitCodes.js +66 -0
- package/dist/src/kernel/project/cli/exitCodes.js.map +1 -0
- package/dist/src/kernel/project/cli/globalFlags.js +219 -0
- package/dist/src/kernel/project/cli/globalFlags.js.map +1 -0
- package/dist/src/kernel/project/cli/helpFormat.js +58 -0
- package/dist/src/kernel/project/cli/helpFormat.js.map +1 -0
- package/dist/src/kernel/project/cli/index.js +14 -0
- package/dist/src/kernel/project/cli/index.js.map +1 -0
- package/dist/src/kernel/project/cli/rootHelp.js +227 -0
- package/dist/src/kernel/project/cli/rootHelp.js.map +1 -0
- package/dist/src/kernel/project/cli/suggest.js +75 -0
- package/dist/src/kernel/project/cli/suggest.js.map +1 -0
- package/dist/src/kernel/project/cli/suggestNames.js +96 -0
- package/dist/src/kernel/project/cli/suggestNames.js.map +1 -0
- package/dist/src/kernel/project/cli/verbHelp.js +131 -0
- package/dist/src/kernel/project/cli/verbHelp.js.map +1 -0
- package/dist/src/kernel/project/mcp/buildServer.js +67 -0
- package/dist/src/kernel/project/mcp/buildServer.js.map +1 -0
- package/dist/src/kernel/project/mcp/envelope.js +37 -0
- package/dist/src/kernel/project/mcp/envelope.js.map +1 -0
- package/dist/src/kernel/project/mcp/index.js +8 -0
- package/dist/src/kernel/project/mcp/index.js.map +1 -0
- package/dist/src/kernel/project/mcp/instructions.js +44 -0
- package/dist/src/kernel/project/mcp/instructions.js.map +1 -0
- package/dist/src/kernel/project/mcp/mcpError.js +42 -0
- package/dist/src/kernel/project/mcp/mcpError.js.map +1 -0
- package/dist/src/kernel/project/mcp/prompts/index.js +36 -0
- package/dist/src/kernel/project/mcp/prompts/index.js.map +1 -0
- package/dist/src/kernel/project/mcp/prompts/provider.js +98 -0
- package/dist/src/kernel/project/mcp/prompts/provider.js.map +1 -0
- package/dist/src/kernel/project/mcp/prompts/source.js +154 -0
- package/dist/src/kernel/project/mcp/prompts/source.js.map +1 -0
- package/dist/src/kernel/project/mcp/registerVerb.js +315 -0
- package/dist/src/kernel/project/mcp/registerVerb.js.map +1 -0
- package/dist/src/kernel/project/mcp/serve.js +35 -0
- package/dist/src/kernel/project/mcp/serve.js.map +1 -0
- package/dist/src/kernel/render/compactUri.js +24 -0
- package/dist/src/kernel/render/compactUri.js.map +1 -0
- package/dist/src/kernel/render/contracts.js +10 -0
- package/dist/src/kernel/render/contracts.js.map +1 -0
- package/dist/src/kernel/render/disclosure.js +34 -0
- package/dist/src/kernel/render/disclosure.js.map +1 -0
- package/dist/src/kernel/render/envelope.js +30 -0
- package/dist/src/kernel/render/envelope.js.map +1 -0
- package/dist/src/kernel/render/formatters.js +27 -0
- package/dist/src/kernel/render/formatters.js.map +1 -0
- package/dist/src/kernel/render/index.js +15 -0
- package/dist/src/kernel/render/index.js.map +1 -0
- package/dist/src/kernel/render/prefixes.js +46 -0
- package/dist/src/kernel/render/prefixes.js.map +1 -0
- package/dist/src/kernel/render/renderers.js +468 -0
- package/dist/src/kernel/render/renderers.js.map +1 -0
- package/dist/src/kernel/render/style.js +105 -0
- package/dist/src/kernel/render/style.js.map +1 -0
- package/dist/src/kernel/render/turtle.js +194 -0
- package/dist/src/kernel/render/turtle.js.map +1 -0
- package/dist/src/kernel/render/vocabulary.js +174 -0
- package/dist/src/kernel/render/vocabulary.js.map +1 -0
- package/dist/src/kernel/render/writeStdout.js +43 -0
- package/dist/src/kernel/render/writeStdout.js.map +1 -0
- package/dist/src/kernel/runtime/boot.js +49 -0
- package/dist/src/kernel/runtime/boot.js.map +1 -0
- package/dist/src/kernel/runtime/facade.js +39 -0
- package/dist/src/kernel/runtime/facade.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/build.js +122 -0
- package/dist/src/kernel/runtime/graphpack/build.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/buildIndex.js +303 -0
- package/dist/src/kernel/runtime/graphpack/buildIndex.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.generated.js +6 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.generated.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.index.generated.js +4 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.index.generated.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.stories.generated.js +4 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.stories.generated.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded.js +82 -0
- package/dist/src/kernel/runtime/graphpack/embedded.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/hash.js +38 -0
- package/dist/src/kernel/runtime/graphpack/hash.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/index.js +11 -0
- package/dist/src/kernel/runtime/graphpack/index.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/manifest.js +145 -0
- package/dist/src/kernel/runtime/graphpack/manifest.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/read.js +92 -0
- package/dist/src/kernel/runtime/graphpack/read.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/schemas.js +70 -0
- package/dist/src/kernel/runtime/graphpack/schemas.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/stories.js +68 -0
- package/dist/src/kernel/runtime/graphpack/stories.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/types.js +55 -0
- package/dist/src/kernel/runtime/graphpack/types.js.map +1 -0
- package/dist/src/kernel/runtime/index.js +8 -0
- package/dist/src/kernel/runtime/index.js.map +1 -0
- package/dist/src/kernel/runtime/loadSession.js +34 -0
- package/dist/src/kernel/runtime/loadSession.js.map +1 -0
- package/dist/src/kernel/runtime/paths.js +78 -0
- package/dist/src/kernel/runtime/paths.js.map +1 -0
- package/dist/src/kernel/runtime/probe.js +37 -0
- package/dist/src/kernel/runtime/probe.js.map +1 -0
- package/dist/src/kernel/runtime/readEntity.js +363 -0
- package/dist/src/kernel/runtime/readEntity.js.map +1 -0
- package/dist/src/kernel/runtime/refs/gitOps.js +65 -0
- package/dist/src/kernel/runtime/refs/gitOps.js.map +1 -0
- package/dist/src/kernel/runtime/refs/index.js +29 -0
- package/dist/src/kernel/runtime/refs/index.js.map +1 -0
- package/dist/src/kernel/runtime/refs/parseRef.js +70 -0
- package/dist/src/kernel/runtime/refs/parseRef.js.map +1 -0
- package/dist/src/kernel/runtime/refs/resolve.js +332 -0
- package/dist/src/kernel/runtime/refs/resolve.js.map +1 -0
- package/dist/src/kernel/runtime/resolveSources.js +62 -0
- package/dist/src/kernel/runtime/resolveSources.js.map +1 -0
- package/dist/src/kernel/runtime/store.js +75 -0
- package/dist/src/kernel/runtime/store.js.map +1 -0
- package/dist/src/kernel/runtime/storeReadiness.js +51 -0
- package/dist/src/kernel/runtime/storeReadiness.js.map +1 -0
- package/dist/src/kernel/runtime/types.js +11 -0
- package/dist/src/kernel/runtime/types.js.map +1 -0
- package/dist/src/kernel/spec/asVerb.js +21 -0
- package/dist/src/kernel/spec/asVerb.js.map +1 -0
- package/dist/src/kernel/spec/emitReference.js +578 -0
- package/dist/src/kernel/spec/emitReference.js.map +1 -0
- package/dist/src/kernel/spec/emitSurface.js +202 -0
- package/dist/src/kernel/spec/emitSurface.js.map +1 -0
- package/dist/src/kernel/spec/index.js +11 -0
- package/dist/src/kernel/spec/index.js.map +1 -0
- package/dist/src/kernel/spec/surfaceConformance.js +103 -0
- package/dist/src/kernel/spec/surfaceConformance.js.map +1 -0
- package/dist/src/kernel/spec/types.js +14 -0
- package/dist/src/kernel/spec/types.js.map +1 -0
- package/dist/src/kernel/spec/validate.js +110 -0
- package/dist/src/kernel/spec/validate.js.map +1 -0
- package/dist/src/kernel/vocabulary.js +97 -0
- package/dist/src/kernel/vocabulary.js.map +1 -0
- package/dist/src/types.js +11 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +22 -23
- package/pragma.conf.ts +486 -90
- package/src/bin.ts +274 -82
- package/src/capabilities/block.parity.test.ts +29 -12
- package/src/capabilities/block.shipped.exec.test.ts +282 -0
- package/src/capabilities/block.tierRank.exec.test.ts +300 -0
- package/src/capabilities/capabilities/capabilities.render.ts +1 -1
- package/src/capabilities/capabilities/capabilities.verb.ts +1 -1
- package/src/capabilities/capabilities/catalog.ts +3 -3
- package/src/capabilities/capabilities/hints.ts +32 -7
- package/src/capabilities/capabilities/index.ts +1 -1
- package/src/capabilities/colophon/collectColophon.ts +35 -24
- package/src/capabilities/colophon/colophon.render.ts +24 -1
- package/src/capabilities/colophon/colophon.test.ts +42 -21
- package/src/capabilities/colophon/colophon.verb.ts +4 -4
- package/src/capabilities/config/collectConfigShow.test.ts +1 -0
- package/src/capabilities/config/collectConfigShow.ts +3 -3
- package/src/capabilities/config/field.render.ts +4 -5
- package/src/capabilities/config/fields.ts +17 -10
- package/src/capabilities/config/get.verb.ts +70 -0
- package/src/capabilities/config/getUnset.test.ts +264 -0
- package/src/capabilities/config/index.ts +5 -1
- package/src/capabilities/config/runField.ts +40 -22
- package/src/capabilities/config/runGet.ts +34 -0
- package/src/capabilities/config/runSet.ts +35 -9
- package/src/capabilities/config/set.test.ts +48 -14
- package/src/capabilities/config/set.verb.ts +8 -7
- package/src/capabilities/config/show.render.ts +1 -1
- package/src/capabilities/config/show.verb.ts +9 -6
- package/src/capabilities/config/types.ts +18 -4
- package/src/capabilities/config/unset.verb.ts +58 -0
- package/src/capabilities/create/byteEquality.subprocess.test.ts +2 -3
- package/src/capabilities/create/byteEquality.test.ts +25 -11
- package/src/capabilities/create/cliProjection.ts +227 -0
- package/src/capabilities/create/constants.ts +36 -61
- package/src/capabilities/create/create.mcp.test.ts +89 -5
- package/src/capabilities/create/create.render.ts +71 -7
- package/src/capabilities/create/create.test.ts +433 -219
- package/src/capabilities/create/create.verb.ts +297 -328
- package/src/capabilities/create/createGrammar.test.ts +865 -0
- package/src/capabilities/create/createHelp.ts +71 -0
- package/src/capabilities/create/createSurface.generated.ts +400 -0
- package/src/capabilities/create/crossCli.subprocess.test.ts +745 -0
- package/src/capabilities/create/cwdJail.test.ts +24 -5
- package/src/capabilities/create/generatorToVerbSpec.test.ts +186 -0
- package/src/capabilities/create/generatorToVerbSpec.ts +13 -11
- package/src/capabilities/create/index.ts +7 -4
- package/src/capabilities/create/messages.ts +18 -0
- package/src/capabilities/create/mount.ts +391 -0
- package/src/capabilities/create/pathJail.test.ts +90 -0
- package/src/capabilities/create/pathJail.ts +8 -5
- package/src/capabilities/create/pickGenerator.ts +23 -35
- package/src/capabilities/create/shippedCreate.subprocess.test.ts +164 -0
- package/src/capabilities/create/types.ts +20 -0
- package/src/capabilities/distribution.parity.test.ts +4 -0
- package/src/capabilities/distribution.test.ts +3 -1
- package/src/capabilities/distribution.ts +10 -15
- package/src/capabilities/doctor/checks/checkKeStore.ts +7 -5
- package/src/capabilities/doctor/checks/checkPackageRefs.ts +75 -8
- package/src/capabilities/doctor/checks/checkPragmaVersion.ts +2 -2
- package/src/capabilities/doctor/checks/checkShellCompletions.test.ts +76 -29
- package/src/capabilities/doctor/checks/checkShellCompletions.ts +63 -17
- package/src/capabilities/doctor/checks/harnessInventory.test.ts +219 -0
- package/src/capabilities/doctor/checks/harnessInventory.ts +298 -0
- package/src/capabilities/doctor/checks/index.ts +27 -0
- package/src/capabilities/doctor/checks/mcpCommand.test.ts +100 -0
- package/src/capabilities/doctor/checks/mcpCommand.ts +69 -0
- package/src/capabilities/doctor/checks/targetHealth.ts +444 -0
- package/src/capabilities/doctor/doctor.render.test.ts +125 -38
- package/src/capabilities/doctor/doctor.render.ts +74 -74
- package/src/capabilities/doctor/doctor.test.ts +338 -37
- package/src/capabilities/doctor/doctor.verb.ts +8 -3
- package/src/capabilities/doctor/runChecks.ts +65 -63
- package/src/capabilities/doctor/types.ts +22 -15
- package/src/capabilities/emptyRecovery.test.ts +21 -8
- package/src/capabilities/graph/examples.exec.test.ts +107 -0
- package/src/capabilities/graph/index.ts +1 -1
- package/src/capabilities/graph/inspect.render.ts +70 -22
- package/src/capabilities/graph/inspect.test.ts +260 -5
- package/src/capabilities/graph/inspect.verb.ts +18 -6
- package/src/capabilities/graph/query.render.ts +15 -3
- package/src/capabilities/graph/query.verb.ts +3 -3
- package/src/capabilities/graph/runQuery.ts +2 -3
- package/src/capabilities/index.ts +3 -1
- package/src/capabilities/info/collectInfo.ts +13 -5
- package/src/capabilities/info/info.render.ts +7 -3
- package/src/capabilities/info/info.test.ts +37 -1
- package/src/capabilities/info/info.verb.ts +1 -1
- package/src/capabilities/info/types.ts +10 -2
- package/src/capabilities/lazy.test.ts +32 -0
- package/src/capabilities/meta/complete.verb.ts +1 -1
- package/src/capabilities/meta/index.ts +1 -1
- package/src/capabilities/meta/mcp.verb.ts +10 -8
- package/src/capabilities/ontology/index.ts +15 -11
- package/src/capabilities/ontology/ontology.test.ts +6 -55
- package/src/capabilities/ontology/queries.ts +2 -2
- package/src/capabilities/ontology/render.ts +3 -4
- package/src/capabilities/ontology/verbs.ts +27 -68
- package/src/capabilities/prompt/index.ts +2 -2
- package/src/capabilities/prompt/prompt.render.ts +6 -2
- package/src/capabilities/prompt/types.ts +1 -1
- package/src/capabilities/prompt/verbs.ts +4 -5
- package/src/capabilities/reference.test.ts +63 -0
- package/src/capabilities/renderVocabularySync.test.ts +82 -0
- package/src/capabilities/resources/provider.ts +342 -85
- package/src/capabilities/resources/resources.test.ts +355 -59
- package/src/capabilities/scopeTypeSync.test.ts +29 -15
- package/src/capabilities/setup/buildPlan.ts +240 -0
- package/src/capabilities/setup/index.ts +7 -7
- package/src/capabilities/setup/mode.ts +74 -0
- package/src/capabilities/setup/operations/index.ts +79 -0
- package/src/capabilities/setup/operations/setupCompletions.ts +97 -24
- package/src/capabilities/setup/operations/setupConfig.ts +124 -0
- package/src/capabilities/setup/operations/setupGenerator.ts +478 -334
- package/src/capabilities/setup/operations/setupLsp.ts +420 -67
- package/src/capabilities/setup/operations/setupMcp.ts +238 -127
- package/src/capabilities/setup/operations/setupSkills.ts +667 -105
- package/src/capabilities/setup/plan.render.ts +336 -0
- package/src/capabilities/setup/plan.ts +241 -0
- package/src/capabilities/setup/setup.mcp.correctness.test.ts +432 -0
- package/src/capabilities/setup/setup.render.test.ts +297 -75
- package/src/capabilities/setup/setup.render.ts +45 -77
- package/src/capabilities/setup/setup.test.ts +1819 -225
- package/src/capabilities/setup/setup.verb.ts +288 -78
- package/src/capabilities/setup/shell.test.ts +86 -0
- package/src/capabilities/setup/shell.ts +137 -11
- package/src/capabilities/setup/targets.ts +435 -0
- package/src/capabilities/setup/types.ts +23 -70
- package/src/capabilities/shared/assertExecOk.ts +68 -10
- package/src/capabilities/shared/index.ts +43 -0
- package/src/capabilities/shared/packageManager.test.ts +470 -0
- package/src/capabilities/shared/packageManager.ts +425 -34
- package/src/capabilities/skill/bundledSkills.test.ts +347 -0
- package/src/capabilities/skill/discover.ts +131 -10
- package/src/capabilities/skill/index.ts +1 -1
- package/src/capabilities/skill/render.ts +10 -9
- package/src/capabilities/skill/skill.test.ts +22 -7
- package/src/capabilities/skill/verbs.ts +3 -4
- package/src/capabilities/sources/collectStatus.ts +7 -2
- package/src/capabilities/sources/index.ts +1 -1
- package/src/capabilities/sources/installSkills.ts +265 -10
- package/src/capabilities/sources/runUpdate.ts +131 -23
- package/src/capabilities/sources/sources.test.ts +382 -2
- package/src/capabilities/sources/status.render.ts +1 -1
- package/src/capabilities/sources/status.verb.ts +1 -1
- package/src/capabilities/sources/update.render.ts +1 -1
- package/src/capabilities/sources/update.verb.ts +4 -4
- package/src/capabilities/surface.test.ts +136 -19
- package/src/capabilities/upgrade/runUpgrade.ts +53 -14
- package/src/capabilities/upgrade/types.ts +10 -2
- package/src/capabilities/upgrade/upgrade.render.ts +13 -7
- package/src/capabilities/upgrade/upgrade.test.ts +75 -3
- package/src/capabilities/upgrade/upgrade.verb.ts +1 -1
- package/src/capabilities/version/index.ts +12 -0
- package/src/capabilities/version/version.test.ts +66 -0
- package/src/capabilities/version/version.verb.ts +39 -0
- package/src/constants.ts +36 -1
- package/src/identity.test.ts +57 -29
- package/src/kernel/completion/__snapshots__/emitScripts.test.ts.snap +15 -13
- package/src/kernel/completion/complete.test.ts +12 -2
- package/src/kernel/completion/complete.ts +1 -1
- package/src/kernel/completion/emitScripts.ts +1 -1
- package/src/kernel/completion/entitySource.test.ts +16 -3
- package/src/kernel/completion/entitySource.ts +21 -8
- package/src/kernel/completion/model.test.ts +164 -12
- package/src/kernel/completion/model.ts +94 -14
- package/src/kernel/completion/parse.test.ts +4 -7
- package/src/kernel/completion/parse.ts +15 -0
- package/src/kernel/completion/resolve.test.ts +0 -1
- package/src/kernel/completion/safety.test.ts +50 -35
- package/src/kernel/completion/shellDrive.test.ts +28 -9
- package/src/kernel/completion/templates/bash.ts +7 -2
- package/src/kernel/completion/templates/index.ts +23 -0
- package/src/kernel/completion/types.ts +7 -0
- package/src/kernel/config/defaults.test.ts +27 -3
- package/src/kernel/config/defaults.ts +4 -3
- package/src/kernel/config/evaluateProjectConfig.ts +31 -8
- package/src/kernel/config/firstRun.test.ts +44 -38
- package/src/kernel/config/firstRun.ts +24 -88
- package/src/kernel/config/index.ts +1 -1
- package/src/kernel/config/readConfig.test.ts +6 -3
- package/src/kernel/config/readConfig.ts +1 -1
- package/src/kernel/config/schema.ts +3 -1
- package/src/kernel/config/types.ts +3 -1
- package/src/kernel/copy.test.ts +34 -4
- package/src/kernel/copy.ts +54 -0
- package/src/kernel/error/PragmaError.test.ts +5 -2
- package/src/kernel/error/PragmaError.ts +4 -2
- package/src/kernel/error/constants.ts +7 -5
- package/src/kernel/error/fromTaskError.ts +28 -6
- package/src/kernel/error/recovery.ts +14 -0
- package/src/kernel/error/renderError.ts +42 -1
- package/src/kernel/error/types.ts +21 -1
- package/src/kernel/index.ts +35 -0
- package/src/kernel/interactivity.test.ts +76 -0
- package/src/kernel/interactivity.ts +69 -0
- package/src/kernel/packs/collect.ts +12 -16
- package/src/kernel/packs/compile.test.ts +222 -1
- package/src/kernel/packs/compile.ts +93 -3
- package/src/kernel/packs/disclosure.ts +2 -2
- package/src/kernel/packs/graphql/buildLookupDocument.ts +1 -1
- package/src/kernel/packs/graphql/fetchGraphqlLookup.ts +3 -4
- package/src/kernel/packs/graphql/index.ts +20 -0
- package/src/kernel/packs/index.ts +40 -0
- package/src/kernel/packs/iri.test.ts +73 -0
- package/src/kernel/packs/iri.ts +66 -14
- package/src/kernel/packs/renderPack.ts +25 -6
- package/src/kernel/packs/resolveEntity.test.ts +274 -0
- package/src/kernel/packs/resolveEntity.ts +200 -42
- package/src/kernel/packs/runBodies.ts +86 -22
- package/src/kernel/packs/sample.ts +1 -1
- package/src/kernel/packs/schema.ts +78 -5
- package/src/kernel/packs/sparql/applyFilters.ts +136 -16
- package/src/kernel/packs/sparql/buildLookupQuery.test.ts +290 -0
- package/src/kernel/packs/sparql/buildLookupQuery.ts +367 -17
- package/src/kernel/packs/sparql/index.ts +37 -0
- package/src/kernel/packs/sparql/runSelect.test.ts +1 -1
- package/src/kernel/packs/sparql/runSelect.ts +3 -4
- package/src/kernel/packs/toolDescription.test.ts +77 -4
- package/src/kernel/packs/types.ts +136 -0
- package/src/kernel/packs/uniqueness.ts +1 -1
- package/src/kernel/project/cli/buildProgram.test.ts +218 -12
- package/src/kernel/project/cli/buildProgram.ts +84 -18
- package/src/kernel/project/cli/constants.ts +34 -0
- package/src/kernel/project/cli/dispatch.test.ts +160 -2
- package/src/kernel/project/cli/dispatch.ts +226 -45
- package/src/kernel/project/cli/exitCodes.ts +1 -1
- package/src/kernel/project/cli/globalFlags.test.ts +117 -1
- package/src/kernel/project/cli/globalFlags.ts +134 -31
- package/src/kernel/project/cli/helpFormat.ts +14 -2
- package/src/kernel/project/cli/rootHelp.ts +74 -12
- package/src/kernel/project/cli/suggest.test.ts +33 -1
- package/src/kernel/project/cli/suggest.ts +25 -1
- package/src/kernel/project/cli/verbHelp.test.ts +30 -0
- package/src/kernel/project/cli/verbHelp.ts +23 -7
- package/src/kernel/project/mcp/buildServer.ts +7 -4
- package/src/kernel/project/mcp/envelope.ts +2 -2
- package/src/kernel/project/mcp/instructions.ts +2 -2
- package/src/kernel/project/mcp/mcpError.ts +1 -1
- package/src/kernel/project/mcp/parity.test.ts +5 -2
- package/src/kernel/project/mcp/prompts/index.ts +37 -0
- package/src/kernel/project/mcp/prompts/source.ts +2 -2
- package/src/kernel/project/mcp/registerVerb.ts +55 -10
- package/src/kernel/project/mcp/serve.ts +2 -2
- package/src/kernel/render/__snapshots__/renderers.test.ts.snap +7 -4
- package/src/kernel/render/contracts.ts +21 -0
- package/src/kernel/render/envelope.ts +2 -3
- package/src/kernel/render/formatters.ts +1 -1
- package/src/kernel/render/renderers.test.ts +243 -6
- package/src/kernel/render/renderers.ts +222 -20
- package/src/kernel/render/style.test.ts +75 -24
- package/src/kernel/render/style.ts +59 -6
- package/src/kernel/render/turtle.ts +222 -0
- package/src/kernel/render/vocabulary.ts +276 -0
- package/src/kernel/runtime/graphpack/buildIndex.ts +1 -1
- package/src/kernel/runtime/graphpack/embedded/pack.generated.ts +3 -3
- package/src/kernel/runtime/graphpack/embedded/pack.index.generated.ts +1 -1
- package/src/kernel/runtime/graphpack/embedded.ts +3 -3
- package/src/kernel/runtime/graphpack/manifest.ts +1 -1
- package/src/kernel/runtime/graphpack/read.ts +1 -2
- package/src/kernel/runtime/loadSession.ts +1 -1
- package/src/kernel/runtime/probe.ts +6 -6
- package/src/kernel/runtime/readEntity.ts +472 -28
- package/src/kernel/runtime/refs/index.ts +39 -0
- package/src/kernel/runtime/refs/parseRef.ts +2 -2
- package/src/kernel/runtime/refs/resolve.ts +4 -4
- package/src/kernel/runtime/storeReadiness.ts +1 -2
- package/src/kernel/runtime/types.ts +15 -1
- package/src/kernel/runtime/wasmEmbed.test.ts +37 -39
- package/src/kernel/spec/emitReference.ts +105 -30
- package/src/kernel/spec/emitSurface.ts +48 -6
- package/src/kernel/spec/surfaceConformance.test.ts +4 -2
- package/src/kernel/spec/types.ts +277 -4
- package/src/testing/PARITY_GAPS.ts +9 -3
- package/src/testing/behavioral/docExamples.test.ts +16 -0
- package/src/testing/behavioral/errorMatrix.mcp.test.ts +112 -9
- package/src/testing/behavioral/firstRun.e2e.test.ts +24 -24
- package/src/testing/behavioral/journeys.cli.test.ts +1 -1
- package/src/testing/behavioral/journeys.defaultPack.test.ts +7 -7
- package/src/testing/behavioral/journeys.firstInstall.test.ts +7 -2
- package/src/testing/behavioral/journeys.implementation.test.ts +206 -0
- package/src/testing/behavioral/journeys.interactiveTty.e2e.test.ts +2 -2
- package/src/testing/behavioral/journeys.packageStories.test.ts +10 -7
- package/src/testing/behavioral/mcpServe.e2e.test.ts +57 -2
- package/src/testing/behavioral/mcpSurface.test.ts +1 -1
- package/src/testing/behavioral/rootCli.e2e.test.ts +26 -2
- package/src/testing/eval/__snapshots__/eval.test.ts.snap +26 -1
- package/src/testing/eval/cases/effectful.ts +3 -2
- package/src/testing/eval/cases/readNouns.ts +245 -9
- package/src/testing/fixtures/blockGraph.ts +104 -10
- package/src/testing/fixtures/graph/canonical.ts +182 -13
- package/src/testing/fixtures/graph/defaultPack.ts +1 -1
- package/src/testing/helpers/blankCanonicalRanges.ts +36 -0
- package/src/testing/helpers/projectMcp.ts +32 -6
- package/src/testing/helpers/runCli.ts +35 -18
- package/src/testing/perf/budgets.test.ts +20 -9
- package/src/testing/perf/budgets.ts +58 -9
- package/src/testing/perf/codegen.test.ts +126 -0
- package/src/testing/perf/globalSetup.test.ts +286 -0
- package/src/testing/perf/globalSetup.ts +505 -23
- package/src/testing/perf/measure.test.ts +38 -0
- package/src/testing/perf/measure.ts +23 -4
- package/src/testing/setupXdgIsolation.ts +81 -21
- package/src/testing/tempRoot.globalSetup.ts +122 -0
- package/dist/pragma +0 -0
- package/src/capabilities/create/compiledCreate.subprocess.test.ts +0 -189
- package/src/capabilities/create/templates.embedded.generated.ts +0 -28
- package/src/capabilities/doctor/checks/checkConfigFile.ts +0 -42
- package/src/capabilities/doctor/checks/checkMcpCommands.ts +0 -114
- package/src/capabilities/doctor/checks/checkMcpConfigured.ts +0 -68
- package/src/capabilities/doctor/checks/checkSkillsSymlinked.ts +0 -61
- package/src/capabilities/doctor/checks/deriveBand.test.ts +0 -42
- package/src/capabilities/doctor/checks/deriveBand.ts +0 -28
- package/src/capabilities/shared/bands.ts +0 -16
- package/src/kernel/config/__snapshots__/firstRun.test.ts.snap +0 -11
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build the `sources update` Task.
|
|
3
|
+
*
|
|
4
|
+
* Two modes, chosen by `runtime.mutation.preview`:
|
|
5
|
+
*
|
|
6
|
+
* - Preview (CLI `--dry-run`, or MCP without `confirm`): NETWORK-FREE. It reads
|
|
7
|
+
* only the config, then hands back a plan-only Task listing the refs it would
|
|
8
|
+
* resolve+build and the pointer it would write — no git fetch, no compile, no
|
|
9
|
+
* cache write. This is what a dry-run / agent "preview" must be: side-effect
|
|
10
|
+
* free and offline-safe.
|
|
11
|
+
* - Real execution: the heavy work — resolve every configured pack (git
|
|
12
|
+
* clone/fetch, file verify, npm resolve), then build the ONE combined
|
|
13
|
+
* content-addressed pack — runs eagerly (it is not expressible as a task
|
|
14
|
+
* effect: the effect set is fs + exec, and the in-process compile is not an
|
|
15
|
+
* effect at all). The returned Task models the mutations: the active-pack
|
|
16
|
+
* pointer write (undo restores or removes the prior pointer) and the package
|
|
17
|
+
* skill symlinks.
|
|
18
|
+
*
|
|
19
|
+
* Pinning a revision is the ref's job, not a flag's: put a SHA in the source
|
|
20
|
+
* (`git+https://…#<sha>`) and every update resolves to exactly that commit.
|
|
21
|
+
*/
|
|
22
|
+
import { $, deleteFile, gen, info, mkdir, symlink, writeFile, } from "@canonical/task";
|
|
23
|
+
import { VERSION } from "../../constants.js";
|
|
24
|
+
import { cliRecovery, PragmaError } from "../../kernel/error/index.js";
|
|
25
|
+
// DIRECT LEAF IMPORT, not `graphpack/index.js`. The barrel re-exports
|
|
26
|
+
// `embedded.ts`, which statically imports the ~1.9 MB generated pack — and
|
|
27
|
+
// with per-file `tsc` output ESM evaluates that re-export when this module
|
|
28
|
+
// loads. `sources update` builds a USER pack; it must not pay the embedded
|
|
29
|
+
// pack's cost to do it.
|
|
30
|
+
import { buildPack } from "../../kernel/runtime/graphpack/build.js";
|
|
31
|
+
import { activePackPath, readActivePack } from "../../kernel/runtime/paths.js";
|
|
32
|
+
import { detectPrefixClashes, harvestPrefixes, parsePackDeclaration, redactUrl, resolvePackage, } from "../../kernel/runtime/refs/index.js";
|
|
33
|
+
// The global scope's EXISTING link directories, from the module that owns the
|
|
34
|
+
// scope covenant — so `sources update` cannot drift away from what
|
|
35
|
+
// `setup skills --global` links, or widen the scope on its own.
|
|
36
|
+
import { existingGlobalSkillDirs } from "../setup/operations/setupSkills.js";
|
|
37
|
+
import { globalSkillRoots, installedSkillsDir } from "../skill/discover.js";
|
|
38
|
+
import { planHarnessSkillLinks, planSkillInstall } from "./installSkills.js";
|
|
39
|
+
/** Generic-core prefixes; config `prefixes` merge over them (config wins). */
|
|
40
|
+
const CORE_PREFIXES = {
|
|
41
|
+
rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
|
42
|
+
rdfs: "http://www.w3.org/2000/01/rdf-schema#",
|
|
43
|
+
owl: "http://www.w3.org/2002/07/owl#",
|
|
44
|
+
xsd: "http://www.w3.org/2001/XMLSchema#",
|
|
45
|
+
skos: "http://www.w3.org/2004/02/skos/core#",
|
|
46
|
+
sh: "http://www.w3.org/ns/shacl#",
|
|
47
|
+
dcterms: "http://purl.org/dc/terms/",
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* The prefix map a pack is built with: core < the packs' own `@prefix` < config.
|
|
51
|
+
*
|
|
52
|
+
* A resolved package's own declarations are harvested from its TTL (ke does not
|
|
53
|
+
* fold parsed-Turtle prefixes into `store.prefixes`) and merged beneath config
|
|
54
|
+
* so the index compacts pack URIs to `pfx:Local` — the FROZEN `{name,type}`
|
|
55
|
+
* token contract — while config still wins any clash. The merged map is
|
|
56
|
+
* persisted in the manifest, so boot reads the same names.
|
|
57
|
+
*
|
|
58
|
+
* Exported because the bundler (`scripts/bundle.ts`) compiles the embedded pack
|
|
59
|
+
* through this exact precedence. If the two pipelines computed prefixes
|
|
60
|
+
* separately, the embed could compact entities differently from what the SAME
|
|
61
|
+
* config produces on a user's machine — a silent divergence in entity names.
|
|
62
|
+
*
|
|
63
|
+
* @param inputs - The resolved packages' labelled RDF sources.
|
|
64
|
+
* @param configPrefixes - The config layer's `prefixes`, if any.
|
|
65
|
+
* @returns The merged prefix map to build with.
|
|
66
|
+
*/
|
|
67
|
+
export function buildPackPrefixes(inputs, configPrefixes) {
|
|
68
|
+
return {
|
|
69
|
+
...CORE_PREFIXES,
|
|
70
|
+
...harvestPrefixes(inputs),
|
|
71
|
+
...(configPrefixes ?? {}),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Build the NETWORK-FREE preview plan for `sources update`.
|
|
76
|
+
*
|
|
77
|
+
* A plan-only Task: it reads the config to list the refs a real update would
|
|
78
|
+
* resolve and build, then models the project mutation (the active-pack pointer
|
|
79
|
+
* write) as effects the dry-run interpreter can describe WITHOUT running them.
|
|
80
|
+
* No git, no compile, no cache write — so `--dry-run` and an MCP plan-first call
|
|
81
|
+
* are offline-safe. Config refs are parsed (a cheap, offline validity check) but
|
|
82
|
+
* never resolved.
|
|
83
|
+
*
|
|
84
|
+
* @param runtime - The per-invocation runtime.
|
|
85
|
+
* @returns A plan-only Task describing the intended effects.
|
|
86
|
+
*/
|
|
87
|
+
async function buildUpdatePlan(runtime) {
|
|
88
|
+
const layers = await runtime.loadConfig();
|
|
89
|
+
const entries = layers.config.packs ?? [];
|
|
90
|
+
const refs = entries.map(parsePackDeclaration);
|
|
91
|
+
const data = {
|
|
92
|
+
contentHash: "",
|
|
93
|
+
reused: false,
|
|
94
|
+
packs: refs.map((ref) => ({
|
|
95
|
+
name: ref.pkg,
|
|
96
|
+
resolved: "",
|
|
97
|
+
sourceCount: 0,
|
|
98
|
+
storyCount: 0,
|
|
99
|
+
})),
|
|
100
|
+
};
|
|
101
|
+
return gen(function* () {
|
|
102
|
+
yield* $(info(refs.length > 0
|
|
103
|
+
? `Resolve and build ${refs.length} pack(s): ${refs.map((ref) => ref.source).join(", ")}`
|
|
104
|
+
: "No packs configured — the embedded pack answers store reads"));
|
|
105
|
+
// The project mutation, previewed (dry-run never executes it). The content
|
|
106
|
+
// is a placeholder: the real hash only exists once the build has run.
|
|
107
|
+
yield* $(writeFile(activePackPath(runtime.cwd), "(the pack hash, on execute)"));
|
|
108
|
+
return data;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Resolve, build, and produce the pointer-writing Task — or, for a preview, the
|
|
113
|
+
* network-free plan.
|
|
114
|
+
*
|
|
115
|
+
* @param runtime - The per-invocation runtime.
|
|
116
|
+
* @param skipInvalid - Drop sources that fail to parse (warning about each)
|
|
117
|
+
* rather than failing the whole update.
|
|
118
|
+
* @returns A Task that points the project at the built pack and returns the
|
|
119
|
+
* update result.
|
|
120
|
+
* @note Impure — resolves packages (may hit git) and builds the pack eagerly,
|
|
121
|
+
* UNLESS `runtime.mutation.preview` is set, in which case it stays offline.
|
|
122
|
+
*/
|
|
123
|
+
export async function buildUpdateTask(runtime, skipInvalid = false) {
|
|
124
|
+
if (runtime.mutation?.preview)
|
|
125
|
+
return buildUpdatePlan(runtime);
|
|
126
|
+
// Progress seam (U7/U11): stream stage lines while the heavy EAGER work — the
|
|
127
|
+
// clone/parse/build below — runs, so the long op is never silent. Unset over
|
|
128
|
+
// MCP (a no-op there); `--verbose` adds a line per source (U11).
|
|
129
|
+
const report = runtime.report;
|
|
130
|
+
const verbose = runtime.globalFlags.verbose;
|
|
131
|
+
const layers = await runtime.loadConfig();
|
|
132
|
+
const entries = layers.config.packs ?? [];
|
|
133
|
+
const priorHash = readActivePack(runtime.cwd);
|
|
134
|
+
const resolved = [];
|
|
135
|
+
for (const entry of entries) {
|
|
136
|
+
const ref = parsePackDeclaration(entry);
|
|
137
|
+
report?.(resolveProgress(ref));
|
|
138
|
+
resolved.push({
|
|
139
|
+
kind: ref.kind,
|
|
140
|
+
...(await resolvePackage(ref, { cwd: runtime.cwd })),
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
const inputs = resolved.flatMap((pkg) => pkg.sources);
|
|
144
|
+
// The packages' own `stories/*.json`, carried into the pack verbatim (see
|
|
145
|
+
// graphpack/types.STORIES_FILE). Raw text: nothing interprets them here.
|
|
146
|
+
const stories = resolved.flatMap((pkg) => pkg.stories);
|
|
147
|
+
// Refuse to build an empty store (A4). A package that ships no `.ttl` (or no
|
|
148
|
+
// configured packs at all) would build a 0-triple pack whose empty
|
|
149
|
+
// `data.nq` fails the completeness gate — so the "successful" update boots to
|
|
150
|
+
// a PERMANENT `STORE_UNAVAILABLE` loop. Fail loudly here, leaving the embedded
|
|
151
|
+
// pack (or the prior build) answering reads, instead of pointing at that one.
|
|
152
|
+
if (inputs.length === 0) {
|
|
153
|
+
throw PragmaError.configError(entries.length === 0
|
|
154
|
+
? "No packs are configured, so there are no sources to build a store from. The embedded pack answers reads until you add a pack."
|
|
155
|
+
: `The ${entries.length} configured pack(s) resolved 0 RDF sources (no definitions/**.ttl or data/**.ttl). Refusing to build an empty store.`, {
|
|
156
|
+
recovery: cliRecovery("sources update --verbose", "Add a pack that ships `.ttl` under definitions/ or data/, then re-run."),
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
const prefixes = buildPackPrefixes(inputs, layers.config.prefixes);
|
|
160
|
+
// Warn on conflicting `@prefix` declarations across packages (A5): last-wins
|
|
161
|
+
// is silent otherwise, compacting the losing package's URIs to the wrong
|
|
162
|
+
// prefix. Display-only, so a warning (not a hard failure) is the right call.
|
|
163
|
+
for (const clash of detectPrefixClashes(inputs)) {
|
|
164
|
+
report?.(`Prefix "${clash.label}:" is declared with conflicting IRIs across packs (${clash.iris.join(" vs ")}); last wins, so some entities may compact to the wrong prefix.`);
|
|
165
|
+
}
|
|
166
|
+
report?.(`Building store from ${inputs.length} source(s)`);
|
|
167
|
+
if (verbose)
|
|
168
|
+
for (const input of inputs)
|
|
169
|
+
report?.(` parse ${input.path}`);
|
|
170
|
+
if (stories.length > 0)
|
|
171
|
+
report?.(`Carrying ${stories.length} pack read story file(s)`);
|
|
172
|
+
// Build the pack. On a parse/build failure, classify it as a NAMED data error
|
|
173
|
+
// (U6) — not INTERNAL_ERROR's "report this issue" — identifying the
|
|
174
|
+
// offending package source, since ke's parser error carries only line/column.
|
|
175
|
+
// With `--skip-invalid`, drop the unparseable sources (warning LOUDLY about
|
|
176
|
+
// each — never a silent partial graph) and build from the rest instead of
|
|
177
|
+
// failing the whole update.
|
|
178
|
+
// `<name>@<kind>:<resolved>` — the SAME provenance label the bundler writes
|
|
179
|
+
// for the embed, so the manifest field means one thing whoever built the pack,
|
|
180
|
+
// and `sources status` / `doctor` can still answer "which revision is my store
|
|
181
|
+
// built from?" now that no lock records it. A `file:` pack resolves to a local
|
|
182
|
+
// PATH rather than a revision, so it contributes its name alone: a machine
|
|
183
|
+
// path is not provenance, and `sources status` already lists the ref.
|
|
184
|
+
const sourceRef = resolved
|
|
185
|
+
.map((pkg) => pkg.kind === "file"
|
|
186
|
+
? pkg.name
|
|
187
|
+
: `${pkg.name}@${pkg.kind}:${pkg.resolved}`)
|
|
188
|
+
.join(", ") || "embedded";
|
|
189
|
+
let built;
|
|
190
|
+
try {
|
|
191
|
+
built = await buildPack(inputs, {
|
|
192
|
+
name: "pragma",
|
|
193
|
+
version: VERSION,
|
|
194
|
+
sourceRef,
|
|
195
|
+
prefixes,
|
|
196
|
+
stories,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
if (!skipInvalid)
|
|
201
|
+
throw await classifySourceBuildError(error, inputs);
|
|
202
|
+
const bad = await collectBadSources(inputs);
|
|
203
|
+
// A build failure not attributable to a single unparseable source (e.g. a
|
|
204
|
+
// cross-file conflict) can't be skipped away — surface the named error.
|
|
205
|
+
if (bad.length === 0)
|
|
206
|
+
throw await classifySourceBuildError(error, inputs);
|
|
207
|
+
const badPaths = new Set(bad.map((entry) => entry.path));
|
|
208
|
+
const usableInputs = inputs.filter((input) => !badPaths.has(input.path));
|
|
209
|
+
for (const entry of bad)
|
|
210
|
+
report?.(` skipped invalid source ${entry.path}: ${entry.message}`);
|
|
211
|
+
report?.(`Skipped ${bad.length} invalid source(s); building from ${usableInputs.length} of ${inputs.length}`);
|
|
212
|
+
if (usableInputs.length === 0)
|
|
213
|
+
throw PragmaError.configError(`None of the ${inputs.length} configured source(s) can be parsed — nothing to build.`, {
|
|
214
|
+
recovery: cliRecovery("sources update --verbose", "Fix the reported sources, then re-run."),
|
|
215
|
+
});
|
|
216
|
+
try {
|
|
217
|
+
built = await buildPack(usableInputs, {
|
|
218
|
+
name: "pragma",
|
|
219
|
+
version: VERSION,
|
|
220
|
+
sourceRef,
|
|
221
|
+
// Re-harvest prefixes from only the sources that survived, so a dropped
|
|
222
|
+
// file's declarations don't skew compaction.
|
|
223
|
+
prefixes: buildPackPrefixes(usableInputs, layers.config.prefixes),
|
|
224
|
+
stories,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
catch (rebuildError) {
|
|
228
|
+
throw await classifySourceBuildError(rebuildError, usableInputs);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
report?.(`${built.reused ? "Reused" : "Built"} store ${built.contentHash.slice(0, 12)}`);
|
|
232
|
+
// Refuse a 0-triple build (A4): non-empty sources can still parse to no
|
|
233
|
+
// triples (e.g. comment-only TTL, or a file of only `@prefix` lines). Pointing
|
|
234
|
+
// the project at an empty pack boots to the same `STORE_UNAVAILABLE` loop, so
|
|
235
|
+
// treat it as a data error rather than a silent "success". (A manifest
|
|
236
|
+
// predating the triple count is left alone — `undefined` never trips this.)
|
|
237
|
+
if (built.manifest.tripleCount === 0) {
|
|
238
|
+
throw PragmaError.configError(`The configured sources parsed to 0 RDF triples, so the store would be empty. Refusing to build an empty store.`, {
|
|
239
|
+
recovery: cliRecovery("sources update --verbose", "Check that the pack sources actually contain RDF triples, then re-run."),
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
const path = activePackPath(runtime.cwd);
|
|
243
|
+
const data = {
|
|
244
|
+
contentHash: built.contentHash,
|
|
245
|
+
reused: built.reused,
|
|
246
|
+
packs: resolved.map((pkg) => ({
|
|
247
|
+
name: pkg.name,
|
|
248
|
+
resolved: pkg.resolved,
|
|
249
|
+
sourceCount: pkg.sources.length,
|
|
250
|
+
storyCount: pkg.stories.length,
|
|
251
|
+
})),
|
|
252
|
+
};
|
|
253
|
+
const undo = priorHash !== undefined ? writeFile(path, priorHash) : deleteFile(path);
|
|
254
|
+
// Install package-provided skills (U10): symlink each resolved package's
|
|
255
|
+
// `skills/*` into the installed-skills root, so `skill list` / `setup skills`
|
|
256
|
+
// see them after an update — and RETIRE the links of skills those packages
|
|
257
|
+
// have since dropped, which the same plan reports as `pruned`. Kept in this
|
|
258
|
+
// Task (reversible: a created link carries an unlink undo, a pruned one a
|
|
259
|
+
// re-link undo) so `sources update --undo` restores the root as it was.
|
|
260
|
+
//
|
|
261
|
+
// The two are split, not counted together: a prune is a deletion, so folding
|
|
262
|
+
// it into "Installing N skill(s)" would report a removal as an install.
|
|
263
|
+
const skillPlan = planSkillInstall(resolved);
|
|
264
|
+
const skillLinks = skillPlan.filter((link) => link.action === "created" || link.action === "replaced");
|
|
265
|
+
const staleLinks = skillPlan.filter((link) => link.action === "pruned");
|
|
266
|
+
if (skillLinks.length > 0)
|
|
267
|
+
report?.(`Installing ${skillLinks.length} skill(s)`);
|
|
268
|
+
if (staleLinks.length > 0)
|
|
269
|
+
report?.(`Removing ${staleLinks.length} skill link(s) no longer provided by any package`);
|
|
270
|
+
// Converge the GLOBAL scope (layer 2). Layer 1 above is the installed root;
|
|
271
|
+
// the harness directories link AT it, and until now nothing here touched
|
|
272
|
+
// them — a new pack skill reached no harness directory until the user
|
|
273
|
+
// separately ran `setup skills`, and a dropped one left a dangling link that
|
|
274
|
+
// nothing would ever clear. That two-step was the reported bug.
|
|
275
|
+
//
|
|
276
|
+
// CONVERGE-ONLY, and this is a policy line, not an optimisation:
|
|
277
|
+
// `existingGlobalSkillDirs` returns only directories that ALREADY EXIST, and
|
|
278
|
+
// nothing below composes a `mkdir`. `sources update` is `mcp: {expose:true}`
|
|
279
|
+
// with `mutates: true` and `needsNetwork: true`, so creating directories here
|
|
280
|
+
// would mean an agent, over MCP, after a network fetch, conjuring
|
|
281
|
+
// `~/.claude/skills` into being and opting the user into linking they never
|
|
282
|
+
// asked for. Refresh what is there; never bring a directory into existence.
|
|
283
|
+
//
|
|
284
|
+
// Ownership is the SAME `withinAnyRoot` test `setup skills` applies, over the
|
|
285
|
+
// SAME root set (`globalSkillRoots`), so a real directory, a still-resolving
|
|
286
|
+
// link into the user's own checkout, and a `<root>-backup/foo` sibling are all
|
|
287
|
+
// left exactly as found — while a link still pointing at the BUNDLED snapshot
|
|
288
|
+
// for a skill this update just installed is ours, and is moved onto it.
|
|
289
|
+
const harnessPlan = planHarnessSkillLinks(await existingGlobalSkillDirs(runtime.cwd), globalSkillRoots(), skillPlan
|
|
290
|
+
.filter((link) => link.action !== "pruned")
|
|
291
|
+
.map((link) => link.folderName), staleLinks.map((link) => link.folderName));
|
|
292
|
+
const harnessLinks = harnessPlan.filter((link) => link.action !== "pruned");
|
|
293
|
+
const harnessStale = harnessPlan.filter((link) => link.action === "pruned");
|
|
294
|
+
if (harnessLinks.length > 0)
|
|
295
|
+
report?.(`Linking ${harnessLinks.length} skill(s) into your harness folders`);
|
|
296
|
+
if (harnessStale.length > 0)
|
|
297
|
+
report?.(`Removing ${harnessStale.length} stale harness skill link(s)`);
|
|
298
|
+
if (verbose)
|
|
299
|
+
for (const link of harnessPlan)
|
|
300
|
+
report?.(` ${link.action} ${link.folderName} in ${link.dirName}`);
|
|
301
|
+
report?.(`Pointing ${runtime.cwd} at pack ${built.contentHash.slice(0, 12)}`);
|
|
302
|
+
return gen(function* () {
|
|
303
|
+
yield* $(writeFile(path, built.contentHash, { undo }));
|
|
304
|
+
if (skillLinks.length > 0) {
|
|
305
|
+
yield* $(mkdir(installedSkillsDir(), true));
|
|
306
|
+
for (const link of skillLinks) {
|
|
307
|
+
if (link.action === "replaced")
|
|
308
|
+
yield* $(deleteFile(link.linkPath));
|
|
309
|
+
yield* $(symlink(link.target, link.linkPath, {
|
|
310
|
+
undo: deleteFile(link.linkPath),
|
|
311
|
+
}));
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
// No `mkdir` guard here: a stale link can only have been enumerated FROM
|
|
315
|
+
// the installed root, so the root necessarily exists.
|
|
316
|
+
//
|
|
317
|
+
// The undo re-creates the link exactly as found — dangling target and all —
|
|
318
|
+
// because undo's job is to restore the prior state, not to improve on it. It
|
|
319
|
+
// clears the path first because the undo interpreter MOCKS forward effects
|
|
320
|
+
// when collecting: the delete above may never have run, and `fs.symlink`
|
|
321
|
+
// refuses a path that already exists. Same delete-then-link shape the
|
|
322
|
+
// `replaced` branch above uses, for the same reason.
|
|
323
|
+
for (const stale of staleLinks) {
|
|
324
|
+
yield* $(deleteFile(stale.linkPath, {
|
|
325
|
+
undo: gen(function* () {
|
|
326
|
+
yield* $(deleteFile(stale.linkPath));
|
|
327
|
+
yield* $(symlink(stale.target, stale.linkPath));
|
|
328
|
+
}),
|
|
329
|
+
}));
|
|
330
|
+
}
|
|
331
|
+
// Layer 2, in the same Task and so under the same `--undo`. Still no
|
|
332
|
+
// `mkdir`: every directory here was proven to exist at plan time, and
|
|
333
|
+
// creating one is the thing converge-only exists to forbid.
|
|
334
|
+
for (const link of harnessLinks) {
|
|
335
|
+
// A `created` link undoes by deletion — absent IS the state it replaced.
|
|
336
|
+
// A `replaced` one does not: the path held a link, and the delete above
|
|
337
|
+
// carries no undo of its own, so deleting what the symlink created would
|
|
338
|
+
// leave the path ABSENT rather than pointing where it pointed before.
|
|
339
|
+
// Its undo is therefore the same delete-then-relink shape the prunes
|
|
340
|
+
// below use, against the target detection recorded — and it clears the
|
|
341
|
+
// path first because undo collection MOCKS forward effects, so the link
|
|
342
|
+
// may still be there and `fs.symlink` refuses an existing path.
|
|
343
|
+
const previous = link.previousTarget;
|
|
344
|
+
const undoLink = link.action === "replaced" && previous !== undefined
|
|
345
|
+
? gen(function* () {
|
|
346
|
+
yield* $(deleteFile(link.linkPath));
|
|
347
|
+
yield* $(symlink(previous, link.linkPath));
|
|
348
|
+
})
|
|
349
|
+
: deleteFile(link.linkPath);
|
|
350
|
+
if (link.action === "replaced")
|
|
351
|
+
yield* $(deleteFile(link.linkPath));
|
|
352
|
+
yield* $(symlink(link.target, link.linkPath, { undo: undoLink }));
|
|
353
|
+
}
|
|
354
|
+
for (const stale of harnessStale) {
|
|
355
|
+
yield* $(deleteFile(stale.linkPath, {
|
|
356
|
+
undo: gen(function* () {
|
|
357
|
+
yield* $(deleteFile(stale.linkPath));
|
|
358
|
+
yield* $(symlink(stale.target, stale.linkPath));
|
|
359
|
+
}),
|
|
360
|
+
}));
|
|
361
|
+
}
|
|
362
|
+
return data;
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
/** Progress line for a package about to be resolved, phrased by ref kind. */
|
|
366
|
+
function resolveProgress(ref) {
|
|
367
|
+
switch (ref.kind) {
|
|
368
|
+
case "git":
|
|
369
|
+
return `Cloning ${ref.pkg} from ${redactUrl(ref.url)}`;
|
|
370
|
+
case "file":
|
|
371
|
+
return `Reading ${ref.pkg} from ${ref.path}`;
|
|
372
|
+
case "npm":
|
|
373
|
+
return `Resolving ${ref.pkg}`;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Classify a pack-build failure as a NAMED data error (U6).
|
|
378
|
+
*
|
|
379
|
+
* ke/Oxigraph parses each source's Turtle, but its thrown parser error carries
|
|
380
|
+
* only the line/column — NOT which source produced it (it sees a content string,
|
|
381
|
+
* not a path). So on failure we re-parse each source in ISOLATION to find the
|
|
382
|
+
* first that throws — the culprit — and raise a `CONFIG_ERROR` naming its
|
|
383
|
+
* `pkg/relative-path` with the parser's own message and an actionable recovery.
|
|
384
|
+
* This runs only on the error path, so the per-source re-parse cost is paid once.
|
|
385
|
+
* A `PragmaError` from resolution (e.g. a missing file) is already classified and
|
|
386
|
+
* passes through untouched.
|
|
387
|
+
*
|
|
388
|
+
* @param error - The value thrown by `buildPack`.
|
|
389
|
+
* @param inputs - The labelled sources handed to the build.
|
|
390
|
+
* @returns A classified {@link PragmaError} (never INTERNAL_ERROR for bad data).
|
|
391
|
+
*/
|
|
392
|
+
export async function classifySourceBuildError(error, inputs) {
|
|
393
|
+
if (error instanceof PragmaError)
|
|
394
|
+
return error;
|
|
395
|
+
const parserMessage = error instanceof Error ? error.message : String(error);
|
|
396
|
+
const culprit = await isolateBadSource(inputs);
|
|
397
|
+
const detail = culprit?.message ?? parserMessage;
|
|
398
|
+
const where = culprit
|
|
399
|
+
? `Pack source "${culprit.path}" cannot be parsed`
|
|
400
|
+
: "The configured packs cannot be built into a store";
|
|
401
|
+
return PragmaError.configError(`${where}: ${detail}`, {
|
|
402
|
+
recovery: cliRecovery("sources update --verbose", "Re-run with --verbose to see each file as it parses. If a pack ships malformed RDF, report it to that pack's maintainer."),
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Re-parse each source alone to find the first that fails to parse.
|
|
407
|
+
*
|
|
408
|
+
* @param inputs - The labelled sources.
|
|
409
|
+
* @returns The offending source's path + parser message, or `undefined` if none
|
|
410
|
+
* fails in isolation (a build failure unrelated to a single bad source).
|
|
411
|
+
* @note Impure — boots a throwaway ke store per source; error path only.
|
|
412
|
+
*/
|
|
413
|
+
async function isolateBadSource(inputs) {
|
|
414
|
+
const { createStore } = await import("@canonical/ke");
|
|
415
|
+
for (const input of inputs) {
|
|
416
|
+
try {
|
|
417
|
+
const store = await createStore({
|
|
418
|
+
sources: [{ content: input.content, path: input.path }],
|
|
419
|
+
});
|
|
420
|
+
store.dispose();
|
|
421
|
+
}
|
|
422
|
+
catch (error) {
|
|
423
|
+
return {
|
|
424
|
+
path: input.path,
|
|
425
|
+
message: error instanceof Error ? error.message : String(error),
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
return undefined;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Re-parse each source in isolation and collect EVERY one that fails to parse.
|
|
433
|
+
*
|
|
434
|
+
* Backs `--skip-invalid`: {@link isolateBadSource} returns just the first
|
|
435
|
+
* culprit (for the error message), whereas the skip path needs the full set to
|
|
436
|
+
* drop before rebuilding. Error path only — one throwaway ke store per source.
|
|
437
|
+
*
|
|
438
|
+
* @param inputs - The labelled sources.
|
|
439
|
+
* @returns Every source that fails to parse alone, with its parser message.
|
|
440
|
+
*/
|
|
441
|
+
async function collectBadSources(inputs) {
|
|
442
|
+
const { createStore } = await import("@canonical/ke");
|
|
443
|
+
const bad = [];
|
|
444
|
+
for (const input of inputs) {
|
|
445
|
+
try {
|
|
446
|
+
const store = await createStore({
|
|
447
|
+
sources: [{ content: input.content, path: input.path }],
|
|
448
|
+
});
|
|
449
|
+
store.dispose();
|
|
450
|
+
}
|
|
451
|
+
catch (error) {
|
|
452
|
+
bad.push({
|
|
453
|
+
path: input.path,
|
|
454
|
+
message: error instanceof Error ? error.message : String(error),
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return bad;
|
|
459
|
+
}
|
|
460
|
+
//# sourceMappingURL=runUpdate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runUpdate.js","sourceRoot":"","sources":["../../../../src/capabilities/sources/runUpdate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EACL,CAAC,EACD,UAAU,EACV,GAAG,EACH,IAAI,EACJ,KAAK,EACL,OAAO,EAEP,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACvE,sEAAsE;AACtE,2EAA2E;AAC3E,2EAA2E;AAC3E,2EAA2E;AAC3E,wBAAwB;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/E,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,oBAAoB,EAEpB,SAAS,EACT,cAAc,GACf,MAAM,oCAAoC,CAAC;AAC5C,8EAA8E;AAC9E,mEAAmE;AACnE,gEAAgE;AAChE,OAAO,EAA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;AACnB,CAAC;AAED;;;;;;;;;GASG;AACH,KAAK,UAAU,iBAAiB,CAC9B,MAAsE;IAEtE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;IACtD,MAAM,GAAG,GAAwC,EAAE,CAAC;IACpD,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,WAAW,CAAC;gBAC9B,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;aACxD,CAAC,CAAC;YACH,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,IAAI,CAAC;gBACP,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;aAChE,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatters for `pragma sources status` — plain, llm, json.
|
|
3
|
+
*/
|
|
4
|
+
import { BIN_NAME } from "../../constants.js";
|
|
5
|
+
import { defaultStyle } from "../../kernel/render/style.js";
|
|
6
|
+
/**
|
|
7
|
+
* The headline for each boot decision. The `embedded` case names the update
|
|
8
|
+
* explicitly: the distribution's snapshot answers reads, but it is a snapshot,
|
|
9
|
+
* so reporting it as "up to date" would be a lie.
|
|
10
|
+
*/
|
|
11
|
+
const STORE_HEADLINE = {
|
|
12
|
+
built: "ready",
|
|
13
|
+
embedded: `embedded snapshot (run \`${BIN_NAME} sources update\` to build from the configured packs)`,
|
|
14
|
+
unavailable: `not built (run \`${BIN_NAME} sources update\`)`,
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Render `sources status` as plain text.
|
|
18
|
+
*
|
|
19
|
+
* @param data - The resolved sources-status payload.
|
|
20
|
+
* @param style - TTY styling; defaults to the process style. On a color-capable
|
|
21
|
+
* terminal the `Sources:` heading is bold, source names align into a column,
|
|
22
|
+
* and each configured ref is dimmed; off a TTY the styler is inert, so the
|
|
23
|
+
* output is byte-identical to the plain form.
|
|
24
|
+
* @returns The formatted status block.
|
|
25
|
+
*/
|
|
26
|
+
export function renderSourcesStatusPlain(data, style = defaultStyle()) {
|
|
27
|
+
const lines = [`Store: ${STORE_HEADLINE[data.store]}`];
|
|
28
|
+
if (data.contentHash !== null) {
|
|
29
|
+
lines.push(` pack: ${data.contentHash.slice(0, 12)} — ${data.entityCount ?? "?"} entities, built ${data.builtAt ?? "?"}`, ` from: ${data.sourceRef ?? "?"}`);
|
|
30
|
+
}
|
|
31
|
+
lines.push("", style.enabled ? style.bold("Sources:") : "Sources:");
|
|
32
|
+
if (data.sources.length === 0) {
|
|
33
|
+
lines.push(" (none configured)");
|
|
34
|
+
}
|
|
35
|
+
const nameWidth = style.enabled
|
|
36
|
+
? Math.max(0, ...data.sources.map((source) => source.name.length))
|
|
37
|
+
: 0;
|
|
38
|
+
for (const source of data.sources) {
|
|
39
|
+
lines.push(style.enabled
|
|
40
|
+
? ` ${source.name.padEnd(nameWidth)} ${style.dim(source.ref)}`
|
|
41
|
+
: ` ${source.name} ${source.ref}`);
|
|
42
|
+
}
|
|
43
|
+
return lines.join("\n");
|
|
44
|
+
}
|
|
45
|
+
export const statusFormatters = {
|
|
46
|
+
plain(data) {
|
|
47
|
+
return renderSourcesStatusPlain(data);
|
|
48
|
+
},
|
|
49
|
+
llm(data) {
|
|
50
|
+
const lines = [`# sources`, `- Store: ${data.store}`];
|
|
51
|
+
if (data.sourceRef !== null)
|
|
52
|
+
lines.push(`- From: ${data.sourceRef}`);
|
|
53
|
+
if (data.entityCount !== null)
|
|
54
|
+
lines.push(`- Entities: ${data.entityCount}`);
|
|
55
|
+
for (const source of data.sources) {
|
|
56
|
+
lines.push(`- ${source.name}: ${source.ref}`);
|
|
57
|
+
}
|
|
58
|
+
return lines.join("\n");
|
|
59
|
+
},
|
|
60
|
+
json(data) {
|
|
61
|
+
return JSON.stringify(data);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=status.render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.render.js","sourceRoot":"","sources":["../../../../src/capabilities/sources/status.render.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAoB,MAAM,8BAA8B,CAAC;AAI9E;;;;GAIG;AACH,MAAM,cAAc,GAA+C;IACjE,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,4BAA4B,QAAQ,uDAAuD;IACrG,WAAW,EAAE,oBAAoB,QAAQ,oBAAoB;CAC9D,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAAuB,EACvB,QAAqB,YAAY,EAAE;IAEnC,MAAM,KAAK,GAAG,CAAC,UAAU,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvD,IAAI,IAAI,CAAC,WAAW,KAAK,IAAI,EAAE,CAAC;QAC9B,KAAK,CAAC,IAAI,CACR,WAAW,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,IAAI,CAAC,WAAW,IAAI,GAAG,oBAAoB,IAAI,CAAC,OAAO,IAAI,GAAG,EAAE,EAC9G,WAAW,IAAI,CAAC,SAAS,IAAI,GAAG,EAAE,CACnC,CAAC;IACJ,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI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CAAC,eAAe,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAChD,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAClC,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;QAChD,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,IAAI,CAAC,IAAI;QACP,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `sources status` verb — a storeless read.
|
|
3
|
+
*
|
|
4
|
+
* `needsStore: false` is load-bearing: status must report even a cold or
|
|
5
|
+
* unbuilt store (`store: "unavailable"`), so it must NOT boot the store —
|
|
6
|
+
* booting a cold store would throw STORE_UNAVAILABLE before status could say
|
|
7
|
+
* so. Its `run` is a lazy thunk (the collector is dynamic-imported), keeping
|
|
8
|
+
* the config reader off the fast path, exactly like `info`.
|
|
9
|
+
*/
|
|
10
|
+
import { BIN_NAME } from "../../constants.js";
|
|
11
|
+
import { statusFormatters } from "./status.render.js";
|
|
12
|
+
/** The `sources status` verb spec. */
|
|
13
|
+
export const statusVerb = {
|
|
14
|
+
path: ["sources", "status"],
|
|
15
|
+
summary: "Report which pack answers reads, and the packs it was built from.",
|
|
16
|
+
doc: "Storeless — reads config and the pack cache without booting the store, so it works even when the store is cold. Reports whether reads are answered by a locally built pack, by the embedded snapshot, or not at all.",
|
|
17
|
+
params: [],
|
|
18
|
+
output: { formatters: statusFormatters },
|
|
19
|
+
examples: [
|
|
20
|
+
{
|
|
21
|
+
cmd: `${BIN_NAME} sources status`,
|
|
22
|
+
note: "human-readable readiness summary",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
cmd: `${BIN_NAME} sources status --format json`,
|
|
26
|
+
note: "the full envelope",
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
capability: {
|
|
30
|
+
needsStore: false,
|
|
31
|
+
mutates: false,
|
|
32
|
+
needsNetwork: false,
|
|
33
|
+
mcp: {
|
|
34
|
+
expose: true,
|
|
35
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
run: (_params, runtime) => import("./collectStatus.js").then((module) => module.collectStatus(runtime)),
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=status.verb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.verb.js","sourceRoot":"","sources":["../../../../src/capabilities/sources/status.verb.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,sCAAsC;AACtC,MAAM,CAAC,MAAM,UAAU,GAGnB;IACF,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;IAC3B,OAAO,EAAE,mEAAmE;IAC5E,GAAG,EAAE,sNAAsN;IAC3N,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE,UAAU,EAAE,gBAAgB,EAAE;IACxC,QAAQ,EAAE;QACR;YACE,GAAG,EAAE,GAAG,QAAQ,iBAAiB;YACjC,IAAI,EAAE,kCAAkC;SACzC;QACD;YACE,GAAG,EAAE,GAAG,QAAQ,+BAA+B;YAC/C,IAAI,EAAE,mBAAmB;SAC1B;KACF;IACD,UAAU,EAAE;QACV,UAAU,EAAE,KAAK;QACjB,OAAO,EAAE,KAAK;QACd,YAAY,EAAE,KAAK;QACnB,GAAG,EAAE;YACH,MAAM,EAAE,IAAI;YACZ,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;SAC1D;KACF;IACD,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CACxB,MAAM,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAC3C,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAC9B;CACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/capabilities/sources/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatters for `pragma sources update` — plain, llm, json.
|
|
3
|
+
*/
|
|
4
|
+
export const updateFormatters = {
|
|
5
|
+
plain(data) {
|
|
6
|
+
const lines = [
|
|
7
|
+
data.reused
|
|
8
|
+
? `Store up to date (pack ${data.contentHash.slice(0, 12)}).`
|
|
9
|
+
: `Built pack ${data.contentHash.slice(0, 12)}.`,
|
|
10
|
+
];
|
|
11
|
+
for (const pack of data.packs) {
|
|
12
|
+
// FILES, not usable stories: `sources update` carries them verbatim and
|
|
13
|
+
// never validates them (zod would have to run per record, in the build).
|
|
14
|
+
// `doctor` is where "2 stories ignored" comes from — saying "stories"
|
|
15
|
+
// here would put a green count next to a broken file.
|
|
16
|
+
const stories = pack.storyCount > 0
|
|
17
|
+
? `, ${pack.storyCount} story file${pack.storyCount === 1 ? "" : "s"}`
|
|
18
|
+
: "";
|
|
19
|
+
lines.push(` ${pack.name} @ ${pack.resolved.slice(0, 12)} (${pack.sourceCount} source${pack.sourceCount === 1 ? "" : "s"}${stories})`);
|
|
20
|
+
}
|
|
21
|
+
return lines.join("\n");
|
|
22
|
+
},
|
|
23
|
+
llm(data) {
|
|
24
|
+
return [
|
|
25
|
+
`# sources update`,
|
|
26
|
+
`- Pack: ${data.contentHash.slice(0, 12)}${data.reused ? " (reused)" : ""}`,
|
|
27
|
+
...data.packs.map((pack) => `- ${pack.name}: ${pack.resolved}`),
|
|
28
|
+
].join("\n");
|
|
29
|
+
},
|
|
30
|
+
json(data) {
|
|
31
|
+
return JSON.stringify(data);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=update.render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.render.js","sourceRoot":"","sources":["../../../../src/capabilities/sources/update.render.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,MAAM,CAAC,MAAM,gBAAgB,GAAkC;IAC7D,KAAK,CAAC,IAAI;QACR,MAAM,KAAK,GAAG;YACZ,IAAI,CAAC,MAAM;gBACT,CAAC,CAAC,0BAA0B,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI;gBAC7D,CAAC,CAAC,cAAc,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG;SACnD,CAAC;QACF,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC9B,wEAAwE;YACxE,yEAAyE;YACzE,sEAAsE;YACtE,sDAAsD;YACtD,MAAM,OAAO,GACX,IAAI,CAAC,UAAU,GAAG,CAAC;gBACjB,CAAC,CAAC,KAAK,IAAI,CAAC,UAAU,cAAc,IAAI,CAAC,UAAU,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE;gBACtE,CAAC,CAAC,EAAE,CAAC;YACT,KAAK,CAAC,IAAI,CACR,KAAK,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,WAAW,UAAU,IAAI,CAAC,WAAW,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,GAAG,CAC5H,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IAED,GAAG,CAAC,I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