@canonical/prism-cli 0.0.0-stage → 0.51.0-experimental.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 +43 -2
- package/dist/.build-ok +0 -0
- package/dist/package.json +124 -0
- package/dist/prism.conf.js +42 -0
- package/dist/prism.conf.js.map +1 -0
- package/dist/src/bin.js +11 -0
- package/dist/src/bin.js.map +1 -0
- package/dist/src/build/generatorSurface.js +117 -0
- package/dist/src/build/generatorSurface.js.map +1 -0
- package/dist/src/build/index.js +24 -0
- package/dist/src/build/index.js.map +1 -0
- package/dist/src/capabilities/capabilities/capabilities.render.js +74 -0
- package/dist/src/capabilities/capabilities/capabilities.render.js.map +1 -0
- package/dist/src/capabilities/capabilities/capabilities.verb.js +62 -0
- package/dist/src/capabilities/capabilities/capabilities.verb.js.map +1 -0
- package/dist/src/capabilities/capabilities/catalog.js +140 -0
- package/dist/src/capabilities/capabilities/catalog.js.map +1 -0
- package/dist/src/capabilities/capabilities/index.js +13 -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 +62 -0
- package/dist/src/capabilities/colophon/colophon.render.js.map +1 -0
- package/dist/src/capabilities/colophon/colophon.verb.js +44 -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 +63 -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 +69 -0
- package/dist/src/capabilities/config/set.verb.js.map +1 -0
- package/dist/src/capabilities/config/show.render.js +123 -0
- package/dist/src/capabilities/config/show.render.js.map +1 -0
- package/dist/src/capabilities/config/show.verb.js +45 -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 +51 -0
- package/dist/src/capabilities/config/unset.verb.js.map +1 -0
- package/dist/src/capabilities/create/cliProjection.js +203 -0
- package/dist/src/capabilities/create/cliProjection.js.map +1 -0
- package/dist/src/capabilities/create/constants.js +51 -0
- package/dist/src/capabilities/create/constants.js.map +1 -0
- package/dist/src/capabilities/create/create.render.js +105 -0
- package/dist/src/capabilities/create/create.render.js.map +1 -0
- package/dist/src/capabilities/create/create.verb.js +413 -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/generatorToVerbSpec.js +106 -0
- package/dist/src/capabilities/create/generatorToVerbSpec.js.map +1 -0
- package/dist/src/capabilities/create/index.js +43 -0
- package/dist/src/capabilities/create/index.js.map +1 -0
- package/dist/src/capabilities/create/moduleNotFound.js +23 -0
- package/dist/src/capabilities/create/moduleNotFound.js.map +1 -0
- package/dist/src/capabilities/create/mount.js +302 -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 +48 -0
- package/dist/src/capabilities/create/pickGenerator.js.map +1 -0
- package/dist/src/capabilities/distribution.js +82 -0
- package/dist/src/capabilities/distribution.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkKeStore.js +41 -0
- package/dist/src/capabilities/doctor/checks/checkKeStore.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkNodeVersion.js +26 -0
- package/dist/src/capabilities/doctor/checks/checkNodeVersion.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkPackageRefs.js +156 -0
- package/dist/src/capabilities/doctor/checks/checkPackageRefs.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkPaths.js +62 -0
- package/dist/src/capabilities/doctor/checks/checkPaths.js.map +1 -0
- package/dist/src/capabilities/doctor/checks/checkPragmaVersion.js +32 -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/isSupportedNodeVersion.js +32 -0
- package/dist/src/capabilities/doctor/checks/isSupportedNodeVersion.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 +459 -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 +51 -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 +88 -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/connect.render.js +101 -0
- package/dist/src/capabilities/graph/connect.render.js.map +1 -0
- package/dist/src/capabilities/graph/connect.types.js +21 -0
- package/dist/src/capabilities/graph/connect.types.js.map +1 -0
- package/dist/src/capabilities/graph/connect.verb.js +150 -0
- package/dist/src/capabilities/graph/connect.verb.js.map +1 -0
- package/dist/src/capabilities/graph/index.js +21 -0
- package/dist/src/capabilities/graph/index.js.map +1 -0
- package/dist/src/capabilities/graph/inspect.render.js +82 -0
- package/dist/src/capabilities/graph/inspect.render.js.map +1 -0
- package/dist/src/capabilities/graph/inspect.verb.js +55 -0
- package/dist/src/capabilities/graph/inspect.verb.js.map +1 -0
- package/dist/src/capabilities/graph/query.render.js +105 -0
- package/dist/src/capabilities/graph/query.render.js.map +1 -0
- package/dist/src/capabilities/graph/query.verb.js +51 -0
- package/dist/src/capabilities/graph/query.verb.js.map +1 -0
- package/dist/src/capabilities/graph/queryText.js +234 -0
- package/dist/src/capabilities/graph/queryText.js.map +1 -0
- package/dist/src/capabilities/graph/relationIndex.js +302 -0
- package/dist/src/capabilities/graph/relationIndex.js.map +1 -0
- package/dist/src/capabilities/graph/runConnect.js +456 -0
- package/dist/src/capabilities/graph/runConnect.js.map +1 -0
- package/dist/src/capabilities/graph/runQuery.js +60 -0
- package/dist/src/capabilities/graph/runQuery.js.map +1 -0
- package/dist/src/capabilities/index.js +64 -0
- package/dist/src/capabilities/index.js.map +1 -0
- package/dist/src/capabilities/info/collectInfo.js +74 -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 +68 -0
- package/dist/src/capabilities/info/info.render.js.map +1 -0
- package/dist/src/capabilities/info/info.verb.js +44 -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 +35 -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 +190 -0
- package/dist/src/capabilities/ontology/verbs.js.map +1 -0
- package/dist/src/capabilities/packages/add.verb.js +67 -0
- package/dist/src/capabilities/packages/add.verb.js.map +1 -0
- package/dist/src/capabilities/packages/dependencies.js +103 -0
- package/dist/src/capabilities/packages/dependencies.js.map +1 -0
- package/dist/src/capabilities/packages/files.js +190 -0
- package/dist/src/capabilities/packages/files.js.map +1 -0
- package/dist/src/capabilities/packages/git.js +178 -0
- package/dist/src/capabilities/packages/git.js.map +1 -0
- package/dist/src/capabilities/packages/index.js +30 -0
- package/dist/src/capabilities/packages/index.js.map +1 -0
- package/dist/src/capabilities/packages/init.verb.js +40 -0
- package/dist/src/capabilities/packages/init.verb.js.map +1 -0
- package/dist/src/capabilities/packages/install.js +338 -0
- package/dist/src/capabilities/packages/install.js.map +1 -0
- package/dist/src/capabilities/packages/lockfile.js +378 -0
- package/dist/src/capabilities/packages/lockfile.js.map +1 -0
- package/dist/src/capabilities/packages/manifest.js +181 -0
- package/dist/src/capabilities/packages/manifest.js.map +1 -0
- package/dist/src/capabilities/packages/npm.js +216 -0
- package/dist/src/capabilities/packages/npm.js.map +1 -0
- package/dist/src/capabilities/packages/packages.render.js +59 -0
- package/dist/src/capabilities/packages/packages.render.js.map +1 -0
- package/dist/src/capabilities/packages/range.js +134 -0
- package/dist/src/capabilities/packages/range.js.map +1 -0
- package/dist/src/capabilities/packages/remove.verb.js +38 -0
- package/dist/src/capabilities/packages/remove.verb.js.map +1 -0
- package/dist/src/capabilities/packages/runLock.js +316 -0
- package/dist/src/capabilities/packages/runLock.js.map +1 -0
- package/dist/src/capabilities/packages/runVerbs.js +86 -0
- package/dist/src/capabilities/packages/runVerbs.js.map +1 -0
- package/dist/src/capabilities/packages/skills.js +233 -0
- package/dist/src/capabilities/packages/skills.js.map +1 -0
- package/dist/src/capabilities/packages/source.js +251 -0
- package/dist/src/capabilities/packages/source.js.map +1 -0
- package/dist/src/capabilities/packages/tar.js +200 -0
- package/dist/src/capabilities/packages/tar.js.map +1 -0
- package/dist/src/capabilities/packages/types.js +5 -0
- package/dist/src/capabilities/packages/types.js.map +1 -0
- package/dist/src/capabilities/packages/update.verb.js +46 -0
- package/dist/src/capabilities/packages/update.verb.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 +104 -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 +433 -0
- package/dist/src/capabilities/resources/provider.js.map +1 -0
- package/dist/src/capabilities/setup/buildPlan.js +194 -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 +44 -0
- package/dist/src/capabilities/setup/operations/index.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupCompletions.js +164 -0
- package/dist/src/capabilities/setup/operations/setupCompletions.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupConfig.js +103 -0
- package/dist/src/capabilities/setup/operations/setupConfig.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupGenerator.js +461 -0
- package/dist/src/capabilities/setup/operations/setupGenerator.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupLsp.js +646 -0
- package/dist/src/capabilities/setup/operations/setupLsp.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupMcp.js +399 -0
- package/dist/src/capabilities/setup/operations/setupMcp.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupSkills.js +820 -0
- package/dist/src/capabilities/setup/operations/setupSkills.js.map +1 -0
- package/dist/src/capabilities/setup/operations/writability.js +114 -0
- package/dist/src/capabilities/setup/operations/writability.js.map +1 -0
- package/dist/src/capabilities/setup/plan.js +177 -0
- package/dist/src/capabilities/setup/plan.js.map +1 -0
- package/dist/src/capabilities/setup/plan.render.js +295 -0
- package/dist/src/capabilities/setup/plan.render.js.map +1 -0
- package/dist/src/capabilities/setup/setup.render.js +60 -0
- package/dist/src/capabilities/setup/setup.render.js.map +1 -0
- package/dist/src/capabilities/setup/setup.verb.js +452 -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 +524 -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 +142 -0
- package/dist/src/capabilities/shared/assertExecOk.js.map +1 -0
- package/dist/src/capabilities/shared/calls.js +16 -0
- package/dist/src/capabilities/shared/calls.js.map +1 -0
- package/dist/src/capabilities/shared/index.js +28 -0
- package/dist/src/capabilities/shared/index.js.map +1 -0
- package/dist/src/capabilities/shared/packageManager.js +350 -0
- package/dist/src/capabilities/shared/packageManager.js.map +1 -0
- package/dist/src/capabilities/shared/registry.js +49 -0
- package/dist/src/capabilities/shared/registry.js.map +1 -0
- package/dist/src/capabilities/shared/releaseState.js +177 -0
- package/dist/src/capabilities/shared/releaseState.js.map +1 -0
- package/dist/src/capabilities/shared/semver.js +77 -0
- package/dist/src/capabilities/shared/semver.js.map +1 -0
- package/dist/src/capabilities/skill/discover.js +265 -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 +52 -0
- package/dist/src/capabilities/skill/render.js.map +1 -0
- package/dist/src/capabilities/skill/verbs.js +84 -0
- package/dist/src/capabilities/skill/verbs.js.map +1 -0
- package/dist/src/capabilities/sources/collectStatus.js +108 -0
- package/dist/src/capabilities/sources/collectStatus.js.map +1 -0
- package/dist/src/capabilities/sources/index.js +14 -0
- package/dist/src/capabilities/sources/index.js.map +1 -0
- package/dist/src/capabilities/sources/installSkills.js +308 -0
- package/dist/src/capabilities/sources/installSkills.js.map +1 -0
- package/dist/src/capabilities/sources/reset.render.js +37 -0
- package/dist/src/capabilities/sources/reset.render.js.map +1 -0
- package/dist/src/capabilities/sources/reset.verb.js +60 -0
- package/dist/src/capabilities/sources/reset.verb.js.map +1 -0
- package/dist/src/capabilities/sources/runReset.js +59 -0
- package/dist/src/capabilities/sources/runReset.js.map +1 -0
- package/dist/src/capabilities/sources/runUpdate.js +491 -0
- package/dist/src/capabilities/sources/runUpdate.js.map +1 -0
- package/dist/src/capabilities/sources/status.render.js +80 -0
- package/dist/src/capabilities/sources/status.render.js.map +1 -0
- package/dist/src/capabilities/sources/status.verb.js +41 -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 +57 -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 +138 -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 +54 -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 +37 -0
- package/dist/src/capabilities/version/version.verb.js.map +1 -0
- package/dist/src/constants.js +105 -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/baseDirs.js +58 -0
- package/dist/src/kernel/baseDirs.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 +286 -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 +101 -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 +20 -0
- package/dist/src/kernel/config/defaults.js.map +1 -0
- package/dist/src/kernel/config/evaluateProjectConfig.js +206 -0
- package/dist/src/kernel/config/evaluateProjectConfig.js.map +1 -0
- package/dist/src/kernel/config/findProjectConfig.js +8 -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 +32 -0
- package/dist/src/kernel/config/paths.js.map +1 -0
- package/dist/src/kernel/config/readConfig.js +79 -0
- package/dist/src/kernel/config/readConfig.js.map +1 -0
- package/dist/src/kernel/config/schema.js +129 -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/distribution/index.js +6 -0
- package/dist/src/kernel/distribution/index.js.map +1 -0
- package/dist/src/kernel/distribution/packageRoot.js +58 -0
- package/dist/src/kernel/distribution/packageRoot.js.map +1 -0
- package/dist/src/kernel/distribution/registry.js +77 -0
- package/dist/src/kernel/distribution/registry.js.map +1 -0
- package/dist/src/kernel/distribution/types.js +16 -0
- package/dist/src/kernel/distribution/types.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 +34 -0
- package/dist/src/kernel/error/recovery.js.map +1 -0
- package/dist/src/kernel/error/renderError.js +125 -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/error/validOptions.js +41 -0
- package/dist/src/kernel/error/validOptions.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 +340 -0
- package/dist/src/kernel/packs/collect.js.map +1 -0
- package/dist/src/kernel/packs/compile.js +451 -0
- package/dist/src/kernel/packs/compile.js.map +1 -0
- package/dist/src/kernel/packs/cursor.js +135 -0
- package/dist/src/kernel/packs/cursor.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 +265 -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 +108 -0
- package/dist/src/kernel/packs/iri.js.map +1 -0
- package/dist/src/kernel/packs/paging.js +108 -0
- package/dist/src/kernel/packs/paging.js.map +1 -0
- package/dist/src/kernel/packs/projectNouns.js +212 -0
- package/dist/src/kernel/packs/projectNouns.js.map +1 -0
- package/dist/src/kernel/packs/renderPack.js +328 -0
- package/dist/src/kernel/packs/renderPack.js.map +1 -0
- package/dist/src/kernel/packs/resolveEntity.js +485 -0
- package/dist/src/kernel/packs/resolveEntity.js.map +1 -0
- package/dist/src/kernel/packs/runBodies.js +337 -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 +623 -0
- package/dist/src/kernel/packs/schema.js.map +1 -0
- package/dist/src/kernel/packs/sparql/authorQuery.js +227 -0
- package/dist/src/kernel/packs/sparql/authorQuery.js.map +1 -0
- package/dist/src/kernel/packs/sparql/buildListQuery.js +318 -0
- package/dist/src/kernel/packs/sparql/buildListQuery.js.map +1 -0
- package/dist/src/kernel/packs/sparql/buildLookupQuery.js +611 -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/filterValues.js +154 -0
- package/dist/src/kernel/packs/sparql/filterValues.js.map +1 -0
- package/dist/src/kernel/packs/sparql/index.js +41 -0
- package/dist/src/kernel/packs/sparql/index.js.map +1 -0
- package/dist/src/kernel/packs/sparql/runSelect.js +105 -0
- package/dist/src/kernel/packs/sparql/runSelect.js.map +1 -0
- package/dist/src/kernel/packs/sparql/searchTerm.js +25 -0
- package/dist/src/kernel/packs/sparql/searchTerm.js.map +1 -0
- package/dist/src/kernel/packs/storyRules.js +178 -0
- package/dist/src/kernel/packs/storyRules.js.map +1 -0
- package/dist/src/kernel/packs/tierScope.js +310 -0
- package/dist/src/kernel/packs/tierScope.js.map +1 -0
- package/dist/src/kernel/packs/types.js +114 -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 +276 -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 +552 -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 +266 -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 +163 -0
- package/dist/src/kernel/project/cli/suggestNames.js.map +1 -0
- package/dist/src/kernel/project/cli/verbHelp.js +130 -0
- package/dist/src/kernel/project/cli/verbHelp.js.map +1 -0
- package/dist/src/kernel/project/mcp/buildServer.js +74 -0
- package/dist/src/kernel/project/mcp/buildServer.js.map +1 -0
- package/dist/src/kernel/project/mcp/envelope.js +38 -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 +114 -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 +163 -0
- package/dist/src/kernel/project/mcp/prompts/source.js.map +1 -0
- package/dist/src/kernel/project/mcp/registerVerb.js +378 -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/displaySafe.js +72 -0
- package/dist/src/kernel/render/displaySafe.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 +500 -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 +211 -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/findProjectConfig.js +58 -0
- package/dist/src/kernel/runtime/findProjectConfig.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/build.js +182 -0
- package/dist/src/kernel/runtime/graphpack/build.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/buildIndex.js +320 -0
- package/dist/src/kernel/runtime/graphpack/buildIndex.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded.js +114 -0
- package/dist/src/kernel/runtime/graphpack/embedded.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/hash.js +43 -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 +159 -0
- package/dist/src/kernel/runtime/graphpack/manifest.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/read.js +143 -0
- package/dist/src/kernel/runtime/graphpack/read.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/schemas.js +88 -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 +69 -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 +43 -0
- package/dist/src/kernel/runtime/loadSession.js.map +1 -0
- package/dist/src/kernel/runtime/lockState.js +151 -0
- package/dist/src/kernel/runtime/lockState.js.map +1 -0
- package/dist/src/kernel/runtime/packVersion.js +75 -0
- package/dist/src/kernel/runtime/packVersion.js.map +1 -0
- package/dist/src/kernel/runtime/paths.js +160 -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 +417 -0
- package/dist/src/kernel/runtime/readEntity.js.map +1 -0
- package/dist/src/kernel/runtime/refs/gitOps.js +347 -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 +86 -0
- package/dist/src/kernel/runtime/refs/parseRef.js.map +1 -0
- package/dist/src/kernel/runtime/refs/resolve.js +397 -0
- package/dist/src/kernel/runtime/refs/resolve.js.map +1 -0
- package/dist/src/kernel/runtime/resolveSources.js +179 -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 +52 -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/call.js +167 -0
- package/dist/src/kernel/spec/call.js.map +1 -0
- package/dist/src/kernel/spec/emitReference.js +576 -0
- package/dist/src/kernel/spec/emitReference.js.map +1 -0
- package/dist/src/kernel/spec/emitSurface.js +214 -0
- package/dist/src/kernel/spec/emitSurface.js.map +1 -0
- package/dist/src/kernel/spec/guidance.js +63 -0
- package/dist/src/kernel/spec/guidance.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/spec/wireType.js +36 -0
- package/dist/src/kernel/spec/wireType.js.map +1 -0
- package/dist/src/kernel/vocabulary.js +92 -0
- package/dist/src/kernel/vocabulary.js.map +1 -0
- package/dist/src/main.js +453 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/run.js +22 -0
- package/dist/src/run.js.map +1 -0
- package/dist/src/testing/behavioral/liveReadSurface.js +68 -0
- package/dist/src/testing/behavioral/liveReadSurface.js.map +1 -0
- package/dist/src/testing/build.globalSetup.js +569 -0
- package/dist/src/testing/build.globalSetup.js.map +1 -0
- package/dist/src/testing/eval/cases/stable.js +144 -0
- package/dist/src/testing/eval/cases/stable.js.map +1 -0
- package/dist/src/testing/eval/harness.js +44 -0
- package/dist/src/testing/eval/harness.js.map +1 -0
- package/dist/src/testing/helpers/callSchema.js +36 -0
- package/dist/src/testing/helpers/callSchema.js.map +1 -0
- package/dist/src/testing/helpers/fixtureGraph.js +118 -0
- package/dist/src/testing/helpers/fixtureGraph.js.map +1 -0
- package/dist/src/testing/helpers/packRuntime.js +79 -0
- package/dist/src/testing/helpers/packRuntime.js.map +1 -0
- package/dist/src/testing/helpers/parity.js +82 -0
- package/dist/src/testing/helpers/parity.js.map +1 -0
- package/dist/src/testing/helpers/projectCli.js +28 -0
- package/dist/src/testing/helpers/projectCli.js.map +1 -0
- package/dist/src/testing/helpers/projectMcp.js +104 -0
- package/dist/src/testing/helpers/projectMcp.js.map +1 -0
- package/dist/src/testing/helpers/runCli.js +155 -0
- package/dist/src/testing/helpers/runCli.js.map +1 -0
- package/dist/src/testing/index.js +79 -0
- package/dist/src/testing/index.js.map +1 -0
- package/dist/src/testing/prismRoot.js +13 -0
- package/dist/src/testing/prismRoot.js.map +1 -0
- package/dist/src/testing/setup/build.js +6 -0
- package/dist/src/testing/setup/build.js.map +1 -0
- package/dist/src/testing/setup/calls.js +3 -0
- package/dist/src/testing/setup/calls.js.map +1 -0
- package/dist/src/testing/setup/offline-registry.js +3 -0
- package/dist/src/testing/setup/offline-registry.js.map +1 -0
- package/dist/src/testing/setup/temp-root.js +3 -0
- package/dist/src/testing/setup/temp-root.js.map +1 -0
- package/dist/src/testing/setup/xdg.js +3 -0
- package/dist/src/testing/setup/xdg.js.map +1 -0
- package/dist/src/testing/setupCallChecking.js +29 -0
- package/dist/src/testing/setupCallChecking.js.map +1 -0
- package/dist/src/testing/setupOfflineRegistry.js +19 -0
- package/dist/src/testing/setupOfflineRegistry.js.map +1 -0
- package/dist/src/testing/setupXdgIsolation.js +84 -0
- package/dist/src/testing/setupXdgIsolation.js.map +1 -0
- package/dist/src/testing/tempRoot.globalSetup.js +115 -0
- package/dist/src/testing/tempRoot.globalSetup.js.map +1 -0
- package/dist/src/types.js +11 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +122 -4
- package/prism.conf.ts +50 -0
- package/src/bin.ts +12 -0
- package/src/build/generatorSurface.ts +151 -0
- package/src/build/index.ts +42 -0
- package/src/capabilities/capabilities/capabilities.render.ts +94 -0
- package/src/capabilities/capabilities/capabilities.verb.ts +69 -0
- package/src/capabilities/capabilities/catalog.ts +174 -0
- package/src/capabilities/capabilities/index.ts +15 -0
- package/src/capabilities/capabilities/types.ts +58 -0
- package/src/capabilities/colophon/collectColophon.ts +94 -0
- package/src/capabilities/colophon/colophon.render.ts +74 -0
- package/src/capabilities/colophon/colophon.verb.ts +49 -0
- package/src/capabilities/colophon/index.ts +6 -0
- package/src/capabilities/colophon/markdownTerminal.ts +104 -0
- package/src/capabilities/colophon/types.ts +37 -0
- package/src/capabilities/config/collectConfigShow.ts +69 -0
- package/src/capabilities/config/field.render.ts +27 -0
- package/src/capabilities/config/fields.ts +61 -0
- package/src/capabilities/config/get.verb.ts +72 -0
- package/src/capabilities/config/index.ts +10 -0
- package/src/capabilities/config/runField.ts +77 -0
- package/src/capabilities/config/runGet.ts +34 -0
- package/src/capabilities/config/runSet.ts +64 -0
- package/src/capabilities/config/set.verb.ts +80 -0
- package/src/capabilities/config/show.render.ts +142 -0
- package/src/capabilities/config/show.verb.ts +51 -0
- package/src/capabilities/config/types.ts +49 -0
- package/src/capabilities/config/unset.verb.ts +60 -0
- package/src/capabilities/create/cliProjection.ts +244 -0
- package/src/capabilities/create/constants.ts +67 -0
- package/src/capabilities/create/create.render.ts +121 -0
- package/src/capabilities/create/create.verb.ts +492 -0
- package/src/capabilities/create/createHelp.ts +71 -0
- package/src/capabilities/create/generatorToVerbSpec.ts +113 -0
- package/src/capabilities/create/index.ts +49 -0
- package/src/capabilities/create/moduleNotFound.ts +28 -0
- package/src/capabilities/create/mount.ts +403 -0
- package/src/capabilities/create/pathJail.ts +76 -0
- package/src/capabilities/create/pickGenerator.ts +51 -0
- package/src/capabilities/distribution.ts +109 -0
- package/src/capabilities/doctor/checks/checkKeStore.ts +42 -0
- package/src/capabilities/doctor/checks/checkNodeVersion.ts +29 -0
- package/src/capabilities/doctor/checks/checkPackageRefs.ts +186 -0
- package/src/capabilities/doctor/checks/checkPaths.ts +81 -0
- package/src/capabilities/doctor/checks/checkPragmaVersion.ts +36 -0
- package/src/capabilities/doctor/checks/checkShellCompletions.ts +217 -0
- package/src/capabilities/doctor/checks/harnessInventory.ts +302 -0
- package/src/capabilities/doctor/checks/index.ts +27 -0
- package/src/capabilities/doctor/checks/isSupportedNodeVersion.ts +31 -0
- package/src/capabilities/doctor/checks/mcpCommand.ts +69 -0
- package/src/capabilities/doctor/checks/targetHealth.ts +576 -0
- package/src/capabilities/doctor/doctor.render.ts +199 -0
- package/src/capabilities/doctor/doctor.verb.ts +57 -0
- package/src/capabilities/doctor/index.ts +6 -0
- package/src/capabilities/doctor/runChecks.ts +104 -0
- package/src/capabilities/doctor/types.ts +63 -0
- package/src/capabilities/graph/connect.render.ts +141 -0
- package/src/capabilities/graph/connect.types.ts +136 -0
- package/src/capabilities/graph/connect.verb.ts +168 -0
- package/src/capabilities/graph/index.ts +23 -0
- package/src/capabilities/graph/inspect.render.ts +94 -0
- package/src/capabilities/graph/inspect.verb.ts +66 -0
- package/src/capabilities/graph/query.render.ts +127 -0
- package/src/capabilities/graph/query.verb.ts +61 -0
- package/src/capabilities/graph/queryText.ts +287 -0
- package/src/capabilities/graph/relationIndex.ts +372 -0
- package/src/capabilities/graph/runConnect.ts +576 -0
- package/src/capabilities/graph/runQuery.ts +80 -0
- package/src/capabilities/index.ts +73 -0
- package/src/capabilities/info/collectInfo.ts +90 -0
- package/src/capabilities/info/index.ts +6 -0
- package/src/capabilities/info/info.render.ts +89 -0
- package/src/capabilities/info/info.verb.ts +49 -0
- package/src/capabilities/info/types.ts +50 -0
- package/src/capabilities/meta/complete.verb.ts +52 -0
- package/src/capabilities/meta/index.ts +15 -0
- package/src/capabilities/meta/mcp.verb.ts +39 -0
- package/src/capabilities/ontology/index.ts +23 -0
- package/src/capabilities/ontology/queries.ts +197 -0
- package/src/capabilities/ontology/render.ts +86 -0
- package/src/capabilities/ontology/verbs.ts +242 -0
- package/src/capabilities/packages/add.verb.ts +86 -0
- package/src/capabilities/packages/dependencies.ts +122 -0
- package/src/capabilities/packages/files.ts +260 -0
- package/src/capabilities/packages/git.ts +218 -0
- package/src/capabilities/packages/index.ts +32 -0
- package/src/capabilities/packages/init.verb.ts +48 -0
- package/src/capabilities/packages/install.ts +480 -0
- package/src/capabilities/packages/lockfile.ts +493 -0
- package/src/capabilities/packages/manifest.ts +222 -0
- package/src/capabilities/packages/npm.ts +271 -0
- package/src/capabilities/packages/packages.render.ts +62 -0
- package/src/capabilities/packages/range.ts +149 -0
- package/src/capabilities/packages/remove.verb.ts +48 -0
- package/src/capabilities/packages/runLock.ts +430 -0
- package/src/capabilities/packages/runVerbs.ts +122 -0
- package/src/capabilities/packages/skills.ts +290 -0
- package/src/capabilities/packages/source.ts +338 -0
- package/src/capabilities/packages/tar.ts +217 -0
- package/src/capabilities/packages/types.ts +32 -0
- package/src/capabilities/packages/update.verb.ts +58 -0
- package/src/capabilities/prompt/index.ts +18 -0
- package/src/capabilities/prompt/prompt.render.ts +91 -0
- package/src/capabilities/prompt/types.ts +30 -0
- package/src/capabilities/prompt/verbs.ts +122 -0
- package/src/capabilities/resources/index.ts +15 -0
- package/src/capabilities/resources/provider.ts +535 -0
- package/src/capabilities/setup/buildPlan.ts +267 -0
- package/src/capabilities/setup/index.ts +12 -0
- package/src/capabilities/setup/mode.ts +74 -0
- package/src/capabilities/setup/operations/index.ts +94 -0
- package/src/capabilities/setup/operations/setupCompletions.ts +221 -0
- package/src/capabilities/setup/operations/setupConfig.ts +129 -0
- package/src/capabilities/setup/operations/setupGenerator.ts +651 -0
- package/src/capabilities/setup/operations/setupLsp.ts +934 -0
- package/src/capabilities/setup/operations/setupMcp.ts +583 -0
- package/src/capabilities/setup/operations/setupSkills.ts +1057 -0
- package/src/capabilities/setup/operations/writability.ts +135 -0
- package/src/capabilities/setup/plan.render.ts +371 -0
- package/src/capabilities/setup/plan.ts +320 -0
- package/src/capabilities/setup/setup.render.ts +70 -0
- package/src/capabilities/setup/setup.verb.ts +555 -0
- package/src/capabilities/setup/shell.ts +237 -0
- package/src/capabilities/setup/targets.ts +685 -0
- package/src/capabilities/setup/types.ts +88 -0
- package/src/capabilities/shared/assertExecOk.ts +169 -0
- package/src/capabilities/shared/calls.ts +20 -0
- package/src/capabilities/shared/index.ts +45 -0
- package/src/capabilities/shared/packageManager.ts +457 -0
- package/src/capabilities/shared/registry.ts +63 -0
- package/src/capabilities/shared/releaseState.ts +221 -0
- package/src/capabilities/shared/semver.ts +74 -0
- package/src/capabilities/skill/discover.ts +288 -0
- package/src/capabilities/skill/index.ts +12 -0
- package/src/capabilities/skill/render.ts +64 -0
- package/src/capabilities/skill/verbs.ts +103 -0
- package/src/capabilities/sources/collectStatus.ts +117 -0
- package/src/capabilities/sources/index.ts +16 -0
- package/src/capabilities/sources/installSkills.ts +380 -0
- package/src/capabilities/sources/reset.render.ts +43 -0
- package/src/capabilities/sources/reset.verb.ts +70 -0
- package/src/capabilities/sources/runReset.ts +65 -0
- package/src/capabilities/sources/runUpdate.ts +619 -0
- package/src/capabilities/sources/status.render.ts +95 -0
- package/src/capabilities/sources/status.verb.ts +51 -0
- package/src/capabilities/sources/types.ts +70 -0
- package/src/capabilities/sources/update.render.ts +42 -0
- package/src/capabilities/sources/update.verb.ts +68 -0
- package/src/capabilities/upgrade/index.ts +6 -0
- package/src/capabilities/upgrade/runUpgrade.ts +161 -0
- package/src/capabilities/upgrade/types.ts +29 -0
- package/src/capabilities/upgrade/upgrade.render.ts +61 -0
- package/src/capabilities/upgrade/upgrade.verb.ts +62 -0
- package/src/capabilities/version/index.ts +12 -0
- package/src/capabilities/version/version.verb.ts +40 -0
- package/src/constants.ts +145 -0
- package/src/index.ts +50 -0
- package/src/kernel/baseDirs.ts +73 -0
- package/src/kernel/completion/complete.ts +77 -0
- package/src/kernel/completion/emitScripts.ts +124 -0
- package/src/kernel/completion/entitySource.ts +303 -0
- package/src/kernel/completion/index.ts +42 -0
- package/src/kernel/completion/model.ts +349 -0
- package/src/kernel/completion/parse.ts +309 -0
- package/src/kernel/completion/rank.ts +118 -0
- package/src/kernel/completion/resolve.ts +134 -0
- package/src/kernel/completion/templates/bash.ts +254 -0
- package/src/kernel/completion/templates/fish.ts +267 -0
- package/src/kernel/completion/templates/index.ts +23 -0
- package/src/kernel/completion/templates/shared.ts +134 -0
- package/src/kernel/completion/templates/zsh.ts +246 -0
- package/src/kernel/completion/types.ts +160 -0
- package/src/kernel/config/defaults.ts +23 -0
- package/src/kernel/config/evaluateProjectConfig.ts +240 -0
- package/src/kernel/config/findProjectConfig.ts +8 -0
- package/src/kernel/config/firstRun.ts +34 -0
- package/src/kernel/config/globalConfig.ts +94 -0
- package/src/kernel/config/index.ts +34 -0
- package/src/kernel/config/paths.ts +36 -0
- package/src/kernel/config/readConfig.ts +95 -0
- package/src/kernel/config/schema.ts +144 -0
- package/src/kernel/config/types.ts +162 -0
- package/src/kernel/config/writeConfigField.ts +82 -0
- package/src/kernel/copy.ts +54 -0
- package/src/kernel/distribution/index.ts +27 -0
- package/src/kernel/distribution/packageRoot.ts +58 -0
- package/src/kernel/distribution/registry.ts +99 -0
- package/src/kernel/distribution/types.ts +330 -0
- package/src/kernel/error/PragmaError.ts +184 -0
- package/src/kernel/error/constants.ts +41 -0
- package/src/kernel/error/fromTaskError.ts +102 -0
- package/src/kernel/error/index.ts +23 -0
- package/src/kernel/error/recovery.ts +37 -0
- package/src/kernel/error/renderError.ts +154 -0
- package/src/kernel/error/serialize.ts +28 -0
- package/src/kernel/error/types.ts +83 -0
- package/src/kernel/error/validOptions.ts +45 -0
- package/src/kernel/index.ts +35 -0
- package/src/kernel/interactivity.ts +69 -0
- package/src/kernel/packs/collect.ts +445 -0
- package/src/kernel/packs/compile.ts +596 -0
- package/src/kernel/packs/cursor.ts +135 -0
- package/src/kernel/packs/disclosure.ts +98 -0
- package/src/kernel/packs/glob.ts +39 -0
- package/src/kernel/packs/graphql/buildLookupDocument.ts +404 -0
- package/src/kernel/packs/graphql/fetchGraphqlLookup.ts +216 -0
- package/src/kernel/packs/graphql/index.ts +20 -0
- package/src/kernel/packs/graphql/nameMap.ts +67 -0
- package/src/kernel/packs/index.ts +40 -0
- package/src/kernel/packs/iri.ts +129 -0
- package/src/kernel/packs/paging.ts +110 -0
- package/src/kernel/packs/projectNouns.ts +251 -0
- package/src/kernel/packs/renderPack.ts +478 -0
- package/src/kernel/packs/resolveEntity.ts +734 -0
- package/src/kernel/packs/runBodies.ts +494 -0
- package/src/kernel/packs/sample.ts +60 -0
- package/src/kernel/packs/schema.ts +719 -0
- package/src/kernel/packs/sparql/authorQuery.ts +257 -0
- package/src/kernel/packs/sparql/buildListQuery.ts +434 -0
- package/src/kernel/packs/sparql/buildLookupQuery.ts +681 -0
- package/src/kernel/packs/sparql/escape.ts +22 -0
- package/src/kernel/packs/sparql/filterValues.ts +201 -0
- package/src/kernel/packs/sparql/index.ts +53 -0
- package/src/kernel/packs/sparql/runSelect.ts +160 -0
- package/src/kernel/packs/sparql/searchTerm.ts +29 -0
- package/src/kernel/packs/storyRules.ts +213 -0
- package/src/kernel/packs/tierScope.ts +407 -0
- package/src/kernel/packs/types.ts +893 -0
- package/src/kernel/packs/uniqueness.ts +35 -0
- package/src/kernel/project/cli/buildProgram.ts +380 -0
- package/src/kernel/project/cli/constants.ts +34 -0
- package/src/kernel/project/cli/dispatch.ts +680 -0
- package/src/kernel/project/cli/exitCodes.ts +68 -0
- package/src/kernel/project/cli/globalFlags.ts +256 -0
- package/src/kernel/project/cli/helpFormat.ts +70 -0
- package/src/kernel/project/cli/index.ts +21 -0
- package/src/kernel/project/cli/rootHelp.ts +338 -0
- package/src/kernel/project/cli/suggest.ts +91 -0
- package/src/kernel/project/cli/suggestNames.ts +195 -0
- package/src/kernel/project/cli/verbHelp.ts +157 -0
- package/src/kernel/project/mcp/buildServer.ts +89 -0
- package/src/kernel/project/mcp/envelope.ts +45 -0
- package/src/kernel/project/mcp/index.ts +8 -0
- package/src/kernel/project/mcp/instructions.ts +141 -0
- package/src/kernel/project/mcp/mcpError.ts +52 -0
- package/src/kernel/project/mcp/prompts/index.ts +37 -0
- package/src/kernel/project/mcp/prompts/provider.ts +120 -0
- package/src/kernel/project/mcp/prompts/source.ts +209 -0
- package/src/kernel/project/mcp/registerVerb.ts +426 -0
- package/src/kernel/project/mcp/serve.ts +42 -0
- package/src/kernel/render/compactUri.ts +25 -0
- package/src/kernel/render/contracts.ts +101 -0
- package/src/kernel/render/disclosure.ts +46 -0
- package/src/kernel/render/displaySafe.ts +80 -0
- package/src/kernel/render/envelope.ts +49 -0
- package/src/kernel/render/formatters.ts +31 -0
- package/src/kernel/render/index.ts +30 -0
- package/src/kernel/render/prefixes.ts +48 -0
- package/src/kernel/render/renderers.ts +682 -0
- package/src/kernel/render/style.ts +127 -0
- package/src/kernel/render/turtle.ts +242 -0
- package/src/kernel/render/vocabulary.ts +276 -0
- package/src/kernel/render/writeStdout.ts +49 -0
- package/src/kernel/runtime/boot.ts +59 -0
- package/src/kernel/runtime/facade.ts +47 -0
- package/src/kernel/runtime/findProjectConfig.ts +62 -0
- package/src/kernel/runtime/graphpack/build.ts +260 -0
- package/src/kernel/runtime/graphpack/buildIndex.ts +371 -0
- package/src/kernel/runtime/graphpack/embedded.ts +136 -0
- package/src/kernel/runtime/graphpack/hash.ts +56 -0
- package/src/kernel/runtime/graphpack/index.ts +21 -0
- package/src/kernel/runtime/graphpack/manifest.ts +172 -0
- package/src/kernel/runtime/graphpack/read.ts +170 -0
- package/src/kernel/runtime/graphpack/schemas.ts +97 -0
- package/src/kernel/runtime/graphpack/stories.ts +84 -0
- package/src/kernel/runtime/graphpack/types.ts +187 -0
- package/src/kernel/runtime/index.ts +15 -0
- package/src/kernel/runtime/loadSession.ts +57 -0
- package/src/kernel/runtime/lockState.ts +196 -0
- package/src/kernel/runtime/packVersion.ts +84 -0
- package/src/kernel/runtime/paths.ts +176 -0
- package/src/kernel/runtime/probe.ts +39 -0
- package/src/kernel/runtime/readEntity.ts +598 -0
- package/src/kernel/runtime/refs/gitOps.ts +426 -0
- package/src/kernel/runtime/refs/index.ts +39 -0
- package/src/kernel/runtime/refs/parseRef.ts +127 -0
- package/src/kernel/runtime/refs/resolve.ts +475 -0
- package/src/kernel/runtime/resolveSources.ts +235 -0
- package/src/kernel/runtime/store.ts +90 -0
- package/src/kernel/runtime/storeReadiness.ts +61 -0
- package/src/kernel/runtime/types.ts +266 -0
- package/src/kernel/spec/asVerb.ts +23 -0
- package/src/kernel/spec/call.ts +186 -0
- package/src/kernel/spec/emitReference.ts +701 -0
- package/src/kernel/spec/emitSurface.ts +285 -0
- package/src/kernel/spec/guidance.ts +68 -0
- package/src/kernel/spec/index.ts +41 -0
- package/src/kernel/spec/surfaceConformance.ts +143 -0
- package/src/kernel/spec/types.ts +636 -0
- package/src/kernel/spec/validate.ts +126 -0
- package/src/kernel/spec/wireType.ts +53 -0
- package/src/kernel/vocabulary.ts +121 -0
- package/src/main.ts +615 -0
- package/src/run.ts +26 -0
- package/src/testing/behavioral/liveReadSurface.ts +112 -0
- package/src/testing/build.globalSetup.ts +641 -0
- package/src/testing/eval/cases/stable.ts +165 -0
- package/src/testing/eval/harness.ts +91 -0
- package/src/testing/helpers/callSchema.ts +40 -0
- package/src/testing/helpers/fixtureGraph.ts +165 -0
- package/src/testing/helpers/packRuntime.ts +117 -0
- package/src/testing/helpers/parity.ts +119 -0
- package/src/testing/helpers/projectCli.ts +36 -0
- package/src/testing/helpers/projectMcp.ts +178 -0
- package/src/testing/helpers/runCli.ts +209 -0
- package/src/testing/index.ts +218 -0
- package/src/testing/prismRoot.ts +14 -0
- package/src/testing/setup/build.ts +5 -0
- package/src/testing/setup/calls.ts +2 -0
- package/src/testing/setup/offline-registry.ts +2 -0
- package/src/testing/setup/temp-root.ts +2 -0
- package/src/testing/setup/xdg.ts +2 -0
- package/src/testing/setupCallChecking.ts +30 -0
- package/src/testing/setupOfflineRegistry.ts +20 -0
- package/src/testing/setupXdgIsolation.ts +87 -0
- package/src/testing/tempRoot.globalSetup.ts +122 -0
- package/src/types.ts +61 -0
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { BIN_NAME } from "../../../constants.js";
|
|
5
|
+
import {
|
|
6
|
+
emitScripts,
|
|
7
|
+
indexCompletionEnv,
|
|
8
|
+
runComplete,
|
|
9
|
+
} from "../../../kernel/completion/index.js";
|
|
10
|
+
import { capabilities } from "../../index.js";
|
|
11
|
+
import type { CompletionsDetection } from "../../setup/operations/index.js";
|
|
12
|
+
import { activationHint, type ShellId } from "../../setup/shell.js";
|
|
13
|
+
import type { CheckResult } from "../types.js";
|
|
14
|
+
|
|
15
|
+
const NAME = "Shell completions";
|
|
16
|
+
|
|
17
|
+
/** The one remedy for an absent or out-of-date script. */
|
|
18
|
+
const INSTALL_REMEDY = `${BIN_NAME} setup completions`;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Whether the installed script is the config-free emit — the body
|
|
22
|
+
* `setup completions` writes when no `completion` config tunes it.
|
|
23
|
+
*
|
|
24
|
+
* The completion script is ONE file per user, but the `completion` config it is
|
|
25
|
+
* rendered from is layered per project. So `detectCompletions(cwd)`'s `stale`
|
|
26
|
+
* means only "not what THIS directory would write", and on its own it would let
|
|
27
|
+
* any project that tunes `minChars` call a globally-correct script out of date
|
|
28
|
+
* from every other directory — a `doctor` verdict that flips with `cd`, and a
|
|
29
|
+
* remedy that just moves the failure to the project you came from. A script
|
|
30
|
+
* that matches neither this project's body nor the untuned one is the one that
|
|
31
|
+
* is genuinely stale.
|
|
32
|
+
*
|
|
33
|
+
* @param path - The install path.
|
|
34
|
+
* @param shell - The detected shell.
|
|
35
|
+
* @returns Whether the file there is byte-identical to the untuned emit.
|
|
36
|
+
* @note Impure — reads the install path. An unreadable file counts as `false`.
|
|
37
|
+
*/
|
|
38
|
+
function isUntunedScript(path: string, shell: ShellId): boolean {
|
|
39
|
+
try {
|
|
40
|
+
return readFileSync(path, "utf-8") === emitScripts(capabilities)[shell];
|
|
41
|
+
} catch {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Whether the user's `.zshrc` puts `~/.zfunc` on `$fpath` — the activation step
|
|
48
|
+
* `setup completions` cannot perform for the user. zsh loads nothing from
|
|
49
|
+
* `~/.zfunc` unless it is on `fpath` before `compinit`, so an installed script
|
|
50
|
+
* with no fpath wiring is silently dead. A permissive check: any `fpath` line
|
|
51
|
+
* mentioning `.zfunc` counts (we can't parse ordering statically).
|
|
52
|
+
*/
|
|
53
|
+
function zfuncOnFpath(): boolean {
|
|
54
|
+
try {
|
|
55
|
+
const rc = readFileSync(join(homedir(), ".zshrc"), "utf-8");
|
|
56
|
+
return rc
|
|
57
|
+
.split("\n")
|
|
58
|
+
.some((line) => line.includes("fpath") && line.includes(".zfunc"));
|
|
59
|
+
} catch {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Drive the storeless `__complete` resolver and observe that it answers — the
|
|
66
|
+
* completion effect the installed script delegates every name context to. Uses
|
|
67
|
+
* the noun context (`pragma <TAB>`), which is grammar-derived and never empty,
|
|
68
|
+
* so a zero here means the resolver itself is broken, independent of any pack.
|
|
69
|
+
*
|
|
70
|
+
* @param cwd - The project directory (wires the entity seam, though the noun
|
|
71
|
+
* context does not read it).
|
|
72
|
+
* @returns The number of candidates the resolver returned for a bare `pragma `.
|
|
73
|
+
*/
|
|
74
|
+
async function completeProbe(cwd: string): Promise<number> {
|
|
75
|
+
const matches = await runComplete(
|
|
76
|
+
[""],
|
|
77
|
+
capabilities,
|
|
78
|
+
await indexCompletionEnv(cwd),
|
|
79
|
+
);
|
|
80
|
+
return matches.length;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Check that shell completions are installed AND up to date AND functional.
|
|
85
|
+
*
|
|
86
|
+
* Three gates, in order:
|
|
87
|
+
* 1. The resolver answers (`completeProbe` drives `runComplete` end to end) —
|
|
88
|
+
* the effect every installed script depends on. A failure here is a real
|
|
89
|
+
* regression, so it fails even when nothing is installed.
|
|
90
|
+
* 2. The installed script is present AND is a script `setup completions` would
|
|
91
|
+
* write. Bytes, not existence: a file that merely exists proves nothing — a
|
|
92
|
+
* user upgrading across a grammar change keeps the old script, loses the
|
|
93
|
+
* moved nouns from TAB, and used to be told everything was fine. The path
|
|
94
|
+
* and this project's body come from `detectCompletions`, the ONE owner of
|
|
95
|
+
* that decision; {@link isUntunedScript} is what keeps a per-project
|
|
96
|
+
* `completion` config from condemning a global file (see its docblock).
|
|
97
|
+
* 3. For zsh, `~/.zfunc` is on `$fpath` — the activation step setup can only
|
|
98
|
+
* hint. Installed-but-unwired reports a distinct remedy.
|
|
99
|
+
*
|
|
100
|
+
* Fault tiers: a broken resolver, a stale installed script, or an unwired zsh
|
|
101
|
+
* install are `fail` — something that exists does not work. A script that was
|
|
102
|
+
* never installed is `available`: completions are opt-in and a fresh install
|
|
103
|
+
* is healthy without them.
|
|
104
|
+
*
|
|
105
|
+
* The detection is passed IN rather than re-read: the `completions` target
|
|
106
|
+
* detects once per invocation and both the setup plan and this row read that
|
|
107
|
+
* one answer, so the two surfaces cannot describe different files.
|
|
108
|
+
*
|
|
109
|
+
* @param cwd - The project directory (the resolver's entity seam).
|
|
110
|
+
* @param d - The `completions` target's detection for this invocation.
|
|
111
|
+
* @returns A CheckResult: pass (up to date + wired + answering), available
|
|
112
|
+
* (never installed, with the setup remedy), fail (with the attributable
|
|
113
|
+
* remedy), or skip (shell undetected).
|
|
114
|
+
* @note Impure — reads the install path, `.zshrc`, and drives the resolver.
|
|
115
|
+
*/
|
|
116
|
+
export async function checkShellCompletions(
|
|
117
|
+
cwd: string,
|
|
118
|
+
d: CompletionsDetection,
|
|
119
|
+
): Promise<CheckResult> {
|
|
120
|
+
// 1. Effect test: the resolver the scripts delegate to must actually answer.
|
|
121
|
+
let candidates: number;
|
|
122
|
+
try {
|
|
123
|
+
candidates = await completeProbe(cwd);
|
|
124
|
+
} catch (error) {
|
|
125
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
126
|
+
return {
|
|
127
|
+
name: NAME,
|
|
128
|
+
status: "fail",
|
|
129
|
+
detail: `${BIN_NAME} cannot answer \`<TAB>\`: ${reason}`,
|
|
130
|
+
remedy: `Report this as a bug — \`${BIN_NAME} __complete\` should never throw.`,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
if (candidates === 0) {
|
|
134
|
+
return {
|
|
135
|
+
name: NAME,
|
|
136
|
+
status: "fail",
|
|
137
|
+
detail: `${BIN_NAME} answered \`<TAB>\` with nothing to complete`,
|
|
138
|
+
remedy: "Report this as a bug — the noun context is always non-empty.",
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// 2. The check is about the shell the user is IN. Reporting on the login
|
|
143
|
+
// shell instead is what let this row print a green check for a shell the
|
|
144
|
+
// user never opens while the one they live in had nothing installed.
|
|
145
|
+
const { shell, path, state } = d;
|
|
146
|
+
if (d.detection.kind === "ambiguous") {
|
|
147
|
+
return {
|
|
148
|
+
name: NAME,
|
|
149
|
+
status: "skip",
|
|
150
|
+
detail: `${BIN_NAME} answers \`<TAB>\`, but the running shell cannot be identified — SHELL names ${d.detection.login}, which is your login shell`,
|
|
151
|
+
remedy: `Run \`${INSTALL_REMEDY}\` from the shell you want completions in.`,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (shell === null || path === null) {
|
|
155
|
+
return {
|
|
156
|
+
name: NAME,
|
|
157
|
+
status: "skip",
|
|
158
|
+
detail: `${BIN_NAME} answers \`<TAB>\`, but no bash, zsh, or fish was found in this process tree`,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
// The installed script delegates every name context to the binary. A script
|
|
162
|
+
// that cannot reach it is inert, and reporting it as current is the same
|
|
163
|
+
// false green this row already told once.
|
|
164
|
+
//
|
|
165
|
+
// This gate runs BEFORE the install probe, so it says only what it has
|
|
166
|
+
// verified: that the binary does not resolve. Claiming "script installed" here
|
|
167
|
+
// told a user running this CLI by absolute path that a script they had never
|
|
168
|
+
// installed was broken — an invented file, in the row whose whole job is to
|
|
169
|
+
// report the real one. Nothing installed is still the opt-in `available` tier.
|
|
170
|
+
if (!d.binOnPath) {
|
|
171
|
+
const installed = state !== "absent";
|
|
172
|
+
return {
|
|
173
|
+
name: NAME,
|
|
174
|
+
status: installed ? "fail" : "available",
|
|
175
|
+
detail: installed
|
|
176
|
+
? `${shell} script installed, but \`${BIN_NAME}\` is not on PATH — the script cannot run it`
|
|
177
|
+
: `${BIN_NAME} answers \`<TAB>\`, but is not on PATH — an installed script cannot run it`,
|
|
178
|
+
remedy: `Put \`${BIN_NAME}\` on your PATH.`,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
if (state === "absent") {
|
|
182
|
+
// Never installed is `available`, not a fault: completions are opt-in and
|
|
183
|
+
// a fresh install is healthy without them. An INSTALLED script that is
|
|
184
|
+
// out of date or unwired (below) is the real failure — something the user
|
|
185
|
+
// set up no longer works.
|
|
186
|
+
return {
|
|
187
|
+
name: NAME,
|
|
188
|
+
status: "available",
|
|
189
|
+
detail: `${BIN_NAME} answers \`<TAB>\`; the ${shell} script is not installed`,
|
|
190
|
+
remedy: INSTALL_REMEDY,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
if (state === "stale" && !isUntunedScript(path, shell)) {
|
|
194
|
+
return {
|
|
195
|
+
name: NAME,
|
|
196
|
+
status: "fail",
|
|
197
|
+
detail: `${BIN_NAME} answers \`<TAB>\`; the ${shell} script at ${path} is out of date`,
|
|
198
|
+
remedy: INSTALL_REMEDY,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// 3. zsh only: the script is dead unless ~/.zfunc is on $fpath.
|
|
203
|
+
if (shell === "zsh" && !zfuncOnFpath()) {
|
|
204
|
+
return {
|
|
205
|
+
name: NAME,
|
|
206
|
+
status: "fail",
|
|
207
|
+
detail: `installed at ${path}, but ~/.zfunc is not on your fpath`,
|
|
208
|
+
remedy: activationHint("zsh"),
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return {
|
|
213
|
+
name: NAME,
|
|
214
|
+
status: "pass",
|
|
215
|
+
detail: `${shell} (the shell you are in) — installed, up to date, and completing ${candidates} commands`,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The harness inventory: one row per harness per scope, saying what was detected
|
|
3
|
+
* and whether pragma is registered in it.
|
|
4
|
+
*
|
|
5
|
+
* Every fact this needs was ALREADY COMPUTED and thrown away.
|
|
6
|
+
* `TargetGroup.harnessNames` carries every harness sharing a config file and
|
|
7
|
+
* both consumers reduced it to `shortenPath(group.path)`; `McpDetection`
|
|
8
|
+
* carries the `absent`/`registered`/`drifted` classification of every WRITE in
|
|
9
|
+
* that file. The only thing detection could NOT answer is the negative —
|
|
10
|
+
* `detectHarnesses` filters to hits, so a harness the machine does not have was
|
|
11
|
+
* unrepresentable — which is why the roll-up takes the REGISTRY alongside the
|
|
12
|
+
* groups: the registry supplies the universe, the groups supply the state.
|
|
13
|
+
*
|
|
14
|
+
* The state arrives PER HARNESS, never per file. A shared `.vscode/mcp.json`
|
|
15
|
+
* holds VS Code's `servers` and Cline's `mcpServers` as two independent
|
|
16
|
+
* entries, so the file's aggregate — `drifted`, when one key is current and the
|
|
17
|
+
* other absent — is the standing of NEITHER harness. Pairing each name with
|
|
18
|
+
* the write it owns is the caller's job (it holds the registry's `mcpKey`s and
|
|
19
|
+
* the group's writes); by the time a group reaches this module the association
|
|
20
|
+
* is resolved and every name carries its own state.
|
|
21
|
+
*
|
|
22
|
+
* Three deliberate constraints:
|
|
23
|
+
*
|
|
24
|
+
* 1. **No `@canonical/harnesses` import, of any kind.** `capabilities/lazy.test`
|
|
25
|
+
* forbids one from any file statically reachable from `capabilities/index`,
|
|
26
|
+
* and its regex has no `import type` exemption. This module is reached only
|
|
27
|
+
* through `runChecks`'s dynamic import today, but it is written so that
|
|
28
|
+
* staying legal never depends on that: the inputs are declared here as
|
|
29
|
+
* narrow structural records.
|
|
30
|
+
*
|
|
31
|
+
* 2. **Narrowed to DATA, so `mutates: false` is enforced rather than asserted.**
|
|
32
|
+
* `McpDetection` is write-capable — it carries `writeMcpConfigTargets` and
|
|
33
|
+
* `removeMcpConfigFrom` as live function references. Projecting it down to
|
|
34
|
+
* {@link InventoryGroup} before it reaches this file means a read-only
|
|
35
|
+
* report literally cannot reach a writer.
|
|
36
|
+
*
|
|
37
|
+
* 3. **It never invents a failure.** The states an inventory can report map onto
|
|
38
|
+
* `pass`/`available`/`skip` and NEVER `fail` (see `../types.ts`): a machine
|
|
39
|
+
* that simply does not have Windsurf is not a broken machine, and the `mcp`
|
|
40
|
+
* row already owns the actionable finding for the harnesses it does have.
|
|
41
|
+
* Reporting it twice is how a failure count becomes noise.
|
|
42
|
+
*
|
|
43
|
+
* Placement: this is a doctor helper because doctor is its only consumer today,
|
|
44
|
+
* and `shared/` is explicitly not a utility drawer (see `shared/index.ts`). It
|
|
45
|
+
* is written to MOVE there unchanged — pure, no capability imports beyond the
|
|
46
|
+
* scope type — the moment `setup`'s detection summary becomes the second caller.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
import type { CheckItem, CheckStatus, Scope } from "../types.js";
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* What the inventory says about one harness in one scope.
|
|
53
|
+
*
|
|
54
|
+
* The vocabulary is deliberately NOT "installed". Two different claims used
|
|
55
|
+
* to share that word — `DetectedHarness.configExists` ("the harness's own
|
|
56
|
+
* config file exists", a harnesses-package field this module never surfaces)
|
|
57
|
+
* and the pragma-entry state (`McpTargetState`, which now says `registered`
|
|
58
|
+
* for exactly this reason). Every state here names the PRAGMA-ENTRY meaning.
|
|
59
|
+
* One name per claim, held across the reports: "installed" is reserved for
|
|
60
|
+
* artifacts the CLI itself places (the completion script, the LSP extension),
|
|
61
|
+
* "registered" for pragma's entry in someone else's config, "linked" for
|
|
62
|
+
* skill symlinks.
|
|
63
|
+
*
|
|
64
|
+
* - `registered` — detected, and pragma's MCP entry in this scope is current.
|
|
65
|
+
* - `drifted` — detected, and a pragma entry exists but differs from what a
|
|
66
|
+
* write would emit. Actionable, but the `mcp` row is where it is actionED;
|
|
67
|
+
* here it is reported without inflating the failure count.
|
|
68
|
+
* - `detected` — the harness is on this machine; pragma is not registered.
|
|
69
|
+
* - `undetected` — in the registry, has a location in this scope, not found.
|
|
70
|
+
* - `unscoped` — in the registry, but has NO config location in this scope at
|
|
71
|
+
* all. Roo Code and Cline are `scope: "project"`, so neither can ever hold a
|
|
72
|
+
* global entry: Cline is a VS Code EXTENSION whose config is the workspace
|
|
73
|
+
* `.vscode/mcp.json`, and Roo Code's is `.roo/mcp.json` — neither keeps a
|
|
74
|
+
* per-user file of its own. (VS Code itself used to be the example here, and
|
|
75
|
+
* stopped being one when its per-user `mcp.json` was added: it is
|
|
76
|
+
* `scope: "both"` now.) Stated rather than omitted: a verbose listing that
|
|
77
|
+
* silently dropped a row reads as a bug in the listing.
|
|
78
|
+
*/
|
|
79
|
+
export type InventoryState =
|
|
80
|
+
| "registered"
|
|
81
|
+
| "drifted"
|
|
82
|
+
| "detected"
|
|
83
|
+
| "undetected"
|
|
84
|
+
| "unscoped";
|
|
85
|
+
|
|
86
|
+
/** One harness's standing in one scope. */
|
|
87
|
+
export interface InventoryRow {
|
|
88
|
+
readonly harnessId: string;
|
|
89
|
+
readonly harnessName: string;
|
|
90
|
+
readonly scope: Scope;
|
|
91
|
+
readonly state: InventoryState;
|
|
92
|
+
/** The config paths in this scope that carry (or would carry) the entry. */
|
|
93
|
+
readonly locations: readonly string[];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** A registry entry, narrowed to what the roll-up reads. */
|
|
97
|
+
export interface InventoryHarness {
|
|
98
|
+
readonly id: string;
|
|
99
|
+
readonly name: string;
|
|
100
|
+
/** Whether this harness has a config location in the scope being rolled up. */
|
|
101
|
+
readonly inScope: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** The prior state of one harness's own write, as detection classified it. */
|
|
105
|
+
export type WriteState = "absent" | "registered" | "drifted";
|
|
106
|
+
|
|
107
|
+
/** One harness's share of a config file: the state of the write IT owns. */
|
|
108
|
+
export interface InventoryMember {
|
|
109
|
+
readonly name: string;
|
|
110
|
+
readonly state: WriteState;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* One detected config file, narrowed off {@link McpDetection}: the group's
|
|
115
|
+
* already-shortened path, and every harness sharing it WITH ITS OWN state.
|
|
116
|
+
*
|
|
117
|
+
* Per harness, not per file — see the module docblock. A file-level state here
|
|
118
|
+
* would report both harnesses sharing `.vscode/mcp.json` as drifted the moment
|
|
119
|
+
* either one of them is registered alone.
|
|
120
|
+
*/
|
|
121
|
+
export interface InventoryGroup {
|
|
122
|
+
readonly path: string;
|
|
123
|
+
readonly harnesses: readonly InventoryMember[];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** Whether a state means "this harness is on the machine". */
|
|
127
|
+
export const isDetectedState = (state: InventoryState): boolean =>
|
|
128
|
+
state === "registered" || state === "drifted" || state === "detected";
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Roll one scope's detected config groups up against the registry into one row
|
|
132
|
+
* per harness.
|
|
133
|
+
*
|
|
134
|
+
* Groups are keyed by harness NAME because that is the only identity
|
|
135
|
+
* `TargetGroup` records; the registry is the map back to an id, which is why it
|
|
136
|
+
* is a parameter rather than a lookup. A harness naming no registry row is
|
|
137
|
+
* ignored rather than invented — the inventory reports on the registry, not on
|
|
138
|
+
* whatever a group happened to say.
|
|
139
|
+
*
|
|
140
|
+
* @param registry - Every known harness, each flagged for scope membership.
|
|
141
|
+
* @param groups - This scope's detected config files (narrowed, path-shortened),
|
|
142
|
+
* each naming the harnesses that share it with their own per-write state.
|
|
143
|
+
* @param scope - The scope being rolled up.
|
|
144
|
+
* @returns One row per registry harness, in registry order.
|
|
145
|
+
* @note Pure — it reads no filesystem and holds no live effect.
|
|
146
|
+
*/
|
|
147
|
+
export function harnessInventory(
|
|
148
|
+
registry: readonly InventoryHarness[],
|
|
149
|
+
groups: readonly InventoryGroup[],
|
|
150
|
+
scope: Scope,
|
|
151
|
+
): InventoryRow[] {
|
|
152
|
+
const states = new Map<string, WriteState>();
|
|
153
|
+
const locations = new Map<string, string[]>();
|
|
154
|
+
for (const group of groups) {
|
|
155
|
+
for (const member of group.harnesses) {
|
|
156
|
+
const paths = locations.get(member.name) ?? [];
|
|
157
|
+
paths.push(group.path);
|
|
158
|
+
locations.set(member.name, paths);
|
|
159
|
+
// A harness sharing two files is registered only where EVERY one of them
|
|
160
|
+
// carries the current entry — the same "all or nothing" rule
|
|
161
|
+
// `aggregateMcpStates` applies across the writes within a single file.
|
|
162
|
+
const prior = states.get(member.name);
|
|
163
|
+
states.set(
|
|
164
|
+
member.name,
|
|
165
|
+
prior === undefined || prior === member.state
|
|
166
|
+
? member.state
|
|
167
|
+
: "drifted",
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
return registry.map((harness): InventoryRow => {
|
|
173
|
+
const detected = states.get(harness.name);
|
|
174
|
+
const paths = locations.get(harness.name) ?? [];
|
|
175
|
+
const state: InventoryState =
|
|
176
|
+
detected === undefined
|
|
177
|
+
? harness.inScope
|
|
178
|
+
? "undetected"
|
|
179
|
+
: "unscoped"
|
|
180
|
+
: detected === "registered"
|
|
181
|
+
? "registered"
|
|
182
|
+
: detected === "drifted"
|
|
183
|
+
? "drifted"
|
|
184
|
+
: "detected";
|
|
185
|
+
return {
|
|
186
|
+
harnessId: harness.id,
|
|
187
|
+
harnessName: harness.name,
|
|
188
|
+
scope,
|
|
189
|
+
state,
|
|
190
|
+
locations: paths,
|
|
191
|
+
};
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** The per-item status each state renders as. Never `fail` — see the docblock. */
|
|
196
|
+
const STATE_STATUS: Record<InventoryState, CheckStatus> = {
|
|
197
|
+
registered: "pass",
|
|
198
|
+
drifted: "available",
|
|
199
|
+
detected: "available",
|
|
200
|
+
undetected: "skip",
|
|
201
|
+
unscoped: "skip",
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* The phrase each state reads as, scope-aware for the unscoped case.
|
|
206
|
+
*
|
|
207
|
+
* The unscoped line says WHERE the harness keeps its config rather than naming
|
|
208
|
+
* an internal partition. `no Global band` told the reader nothing: "band" was
|
|
209
|
+
* this repository's word, and the fact underneath it — Roo Code stores its MCP
|
|
210
|
+
* config per project, so there is no global file for pragma to be in — is the
|
|
211
|
+
* thing that explains the row.
|
|
212
|
+
*/
|
|
213
|
+
const stateDetail = (row: InventoryRow): string => {
|
|
214
|
+
switch (row.state) {
|
|
215
|
+
case "registered":
|
|
216
|
+
return "registered";
|
|
217
|
+
case "drifted":
|
|
218
|
+
return "registered, entry differs from current";
|
|
219
|
+
case "detected":
|
|
220
|
+
return "detected, not registered";
|
|
221
|
+
case "undetected":
|
|
222
|
+
return "not detected";
|
|
223
|
+
case "unscoped":
|
|
224
|
+
return row.scope === "global"
|
|
225
|
+
? "keeps no global config — it is per-project only"
|
|
226
|
+
: "keeps no per-project config — it is global only";
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Project inventory rows into doctor sub-items.
|
|
232
|
+
*
|
|
233
|
+
* The default listing is DETECTED HARNESSES ONLY — a report that names every
|
|
234
|
+
* tool the user does not have buries the ones they do. `--verbose` widens it to
|
|
235
|
+
* the whole registry, which is the only view in which `undetected`/`unscoped`
|
|
236
|
+
* rows appear at all.
|
|
237
|
+
*
|
|
238
|
+
* @param rows - This scope's inventory rows.
|
|
239
|
+
* @param verbose - Whether to list the whole registry rather than the hits.
|
|
240
|
+
* @returns The sub-items, harness name in the left column.
|
|
241
|
+
*/
|
|
242
|
+
export function inventoryItems(
|
|
243
|
+
rows: readonly InventoryRow[],
|
|
244
|
+
verbose: boolean,
|
|
245
|
+
): CheckItem[] {
|
|
246
|
+
const shown = verbose
|
|
247
|
+
? rows
|
|
248
|
+
: rows.filter((row) => isDetectedState(row.state));
|
|
249
|
+
return shown.map((row): CheckItem => {
|
|
250
|
+
const where = row.locations.join(", ");
|
|
251
|
+
return {
|
|
252
|
+
label: row.harnessName,
|
|
253
|
+
status: STATE_STATUS[row.state],
|
|
254
|
+
detail: where ? `${stateDetail(row)} — ${where}` : stateDetail(row),
|
|
255
|
+
};
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** The inventory check's headline, and whether it has anything to show. */
|
|
260
|
+
export interface InventoryHealth {
|
|
261
|
+
readonly status: CheckStatus;
|
|
262
|
+
readonly detail: string;
|
|
263
|
+
readonly items: readonly CheckItem[];
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* The whole inventory row for one scope: a listing, not a verdict.
|
|
268
|
+
*
|
|
269
|
+
* Its status is only ever `pass` (this scope has harnesses) or `skip` (it has
|
|
270
|
+
* none). It is the one scoped row that is not a setup target, so it derives no
|
|
271
|
+
* `fix:` line — the `mcp` and `skills` rows beside it own every action a
|
|
272
|
+
* harness can need, and a second row proposing the same command would be the
|
|
273
|
+
* "same finding seen twice" the report is built to avoid.
|
|
274
|
+
*
|
|
275
|
+
* @param rows - This scope's inventory rows.
|
|
276
|
+
* @param verbose - Whether the listing widens to the whole registry.
|
|
277
|
+
* @returns The status, headline and sub-items for the scope's inventory check.
|
|
278
|
+
*/
|
|
279
|
+
export function inventoryHealth(
|
|
280
|
+
rows: readonly InventoryRow[],
|
|
281
|
+
verbose: boolean,
|
|
282
|
+
): InventoryHealth {
|
|
283
|
+
const detected = rows.filter((row) => isDetectedState(row.state));
|
|
284
|
+
const registered = rows.filter((row) => row.state === "registered");
|
|
285
|
+
const items = inventoryItems(rows, verbose);
|
|
286
|
+
if (detected.length === 0) {
|
|
287
|
+
return {
|
|
288
|
+
status: "skip",
|
|
289
|
+
detail: verbose
|
|
290
|
+
? `none of ${rows.length} known harnesses detected`
|
|
291
|
+
: "no harnesses detected",
|
|
292
|
+
items,
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
return {
|
|
296
|
+
status: "pass",
|
|
297
|
+
detail: `${detected.length} detected · ${registered.length} registered${
|
|
298
|
+
verbose ? ` · ${rows.length} known` : ""
|
|
299
|
+
}`,
|
|
300
|
+
items,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The doctor check catalogue — the diagnoses `doctor` composes into a report.
|
|
3
|
+
*
|
|
4
|
+
* A check is the whole shape of this domain: it inspects ONE thing, decides
|
|
5
|
+
* pass or fail, and hands back a `CheckResult` carrying the remedy. Keeping
|
|
6
|
+
* them apart from the report body is what lets `runChecks` stay a composition
|
|
7
|
+
* — it orders and awaits, and knows nothing about what any check looks at.
|
|
8
|
+
*
|
|
9
|
+
* Two kinds live here, and the barrel exposes them differently. The UNSCOPED
|
|
10
|
+
* checks diagnose what `setup` cannot install — the Node floor, the CLI's own
|
|
11
|
+
* version and install source, the pack answering this project's reads, and the
|
|
12
|
+
* store — so each is its own named entry point. The SCOPED rows are derived
|
|
13
|
+
* per target, per scope, from the setup target table rather than authored here,
|
|
14
|
+
* so they surface as the one generator that derives them, never as a list of
|
|
15
|
+
* row names this file would then have to keep in step with `setup`.
|
|
16
|
+
*
|
|
17
|
+
* The per-target probes (the completions script check, the MCP command
|
|
18
|
+
* resolution helpers) stay internal on purpose: `scopedChecks` is the only way
|
|
19
|
+
* they are meant to be reached, and a row reachable past its scope is a row
|
|
20
|
+
* `doctor` can report and `setup` cannot fix.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export { checkKeStore } from "./checkKeStore.js";
|
|
24
|
+
export { checkNodeVersion } from "./checkNodeVersion.js";
|
|
25
|
+
export { checkPackageRefs } from "./checkPackageRefs.js";
|
|
26
|
+
export { checkPragmaVersion } from "./checkPragmaVersion.js";
|
|
27
|
+
export { scopedChecks } from "./targetHealth.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a Node.js version satisfies the range this package declares in its
|
|
3
|
+
* own `engines.node`, surfaced as `SUPPORTED_NODE_RANGE` in `constants.ts`.
|
|
4
|
+
*
|
|
5
|
+
* The range is expressed here as a comparison rather than parsed: the CLI
|
|
6
|
+
* carries no semver dependency, and one range does not justify a range parser.
|
|
7
|
+
* What keeps the two honest is `isSupportedNodeVersion.test.ts`, which builds an
|
|
8
|
+
* independent predicate straight from the declared range string and requires
|
|
9
|
+
* the two to agree across a version grid — so a change to `engines.node` that
|
|
10
|
+
* is not mirrored here fails the suite rather than shipping.
|
|
11
|
+
*
|
|
12
|
+
* The range is every release from Node 24 on, the lines the CI tests, so a
|
|
13
|
+
* comparison of the major version expresses it.
|
|
14
|
+
*
|
|
15
|
+
* @param version - A Node version string, e.g. `process.versions.node`.
|
|
16
|
+
* @returns Whether the version falls inside the declared range.
|
|
17
|
+
*/
|
|
18
|
+
export function isSupportedNodeVersion(version: string): boolean {
|
|
19
|
+
// A semver range excludes prereleases unless a comparator opts into them, and
|
|
20
|
+
// `engines.node` opts into none. So `24.0.0-rc.1` is outside the declared
|
|
21
|
+
// range even though its numeric part is inside it, and reporting it as
|
|
22
|
+
// supported would be doctor passing a runtime the install contract rejects.
|
|
23
|
+
if (version.includes("-")) return false;
|
|
24
|
+
|
|
25
|
+
const [rawMajor, rawMinor] = version.split(".");
|
|
26
|
+
const major = Number(rawMajor);
|
|
27
|
+
const minor = Number(rawMinor);
|
|
28
|
+
|
|
29
|
+
if (!Number.isInteger(major) || !Number.isInteger(minor)) return false;
|
|
30
|
+
return major >= 24;
|
|
31
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Command resolution for MCP server entries.
|
|
3
|
+
*
|
|
4
|
+
* A dead `command` makes every agent session try and fail to boot the server,
|
|
5
|
+
* so the `mcp` doctor row reports whether the entry it owns resolves. The row
|
|
6
|
+
* judges ONLY the entry this CLI writes: an aggregate check over every server
|
|
7
|
+
* in the file failed the row whenever some FOREIGN server had a dead command,
|
|
8
|
+
* which is a fact about someone else's tool reported as this one's fault.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { existsSync } from "node:fs";
|
|
12
|
+
import { isAbsolute, join } from "node:path";
|
|
13
|
+
import type { PlatformEnv } from "@canonical/harnesses";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Extract the stdio command from an MCP server config entry, if any. HTTP/SSE
|
|
17
|
+
* entries (`{ type: "http", url }`) have no command and are not checked.
|
|
18
|
+
*
|
|
19
|
+
* Both entry shapes resolve to the same executable. A harness whose schema
|
|
20
|
+
* requires `command` to be an argv array (OpenCode) carries the executable in
|
|
21
|
+
* its first element; a string-valued `command` IS the executable. Reading only
|
|
22
|
+
* the string form made this check skip an entry `setup` had just written
|
|
23
|
+
* correctly, and report no command-based servers on a configured machine.
|
|
24
|
+
*/
|
|
25
|
+
export function commandOf(entry: unknown): string | undefined {
|
|
26
|
+
if (typeof entry !== "object" || entry === null) return undefined;
|
|
27
|
+
const command = (entry as { command?: unknown }).command;
|
|
28
|
+
if (typeof command === "string") {
|
|
29
|
+
return command.length > 0 ? command : undefined;
|
|
30
|
+
}
|
|
31
|
+
if (Array.isArray(command)) {
|
|
32
|
+
return command.find(
|
|
33
|
+
(part): part is string => typeof part === "string" && part.length > 0,
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Resolve a command the way the host would: a path-bearing entry is checked as
|
|
41
|
+
* a file (relative to the project root), a bare name is searched across `PATH`
|
|
42
|
+
* through `@canonical/harnesses`' `executableCandidates`, which owns the PATH
|
|
43
|
+
* split and the win32 `PATHEXT` rules in one place.
|
|
44
|
+
*
|
|
45
|
+
* The bare-name arm used to join the name onto each PATH directory, which
|
|
46
|
+
* cannot see the `.cmd` shim npm installs on Windows: a registration this CLI
|
|
47
|
+
* had just written correctly was reported as a dead command.
|
|
48
|
+
*
|
|
49
|
+
* @param command - The executable the entry names.
|
|
50
|
+
* @param cwd - The project root a relative command is resolved against.
|
|
51
|
+
* @param platform - The captured host to use instead of this one (tests).
|
|
52
|
+
* @returns Whether the command resolves on this machine.
|
|
53
|
+
* @note Impure — tests candidate paths on the filesystem.
|
|
54
|
+
*/
|
|
55
|
+
export async function commandResolves(
|
|
56
|
+
command: string,
|
|
57
|
+
cwd: string,
|
|
58
|
+
platform?: PlatformEnv,
|
|
59
|
+
): Promise<boolean> {
|
|
60
|
+
if (command.includes("/") || command.includes("\\")) {
|
|
61
|
+
return existsSync(isAbsolute(command) ? command : join(cwd, command));
|
|
62
|
+
}
|
|
63
|
+
const { executableCandidates, readPlatformEnv } = await import(
|
|
64
|
+
"@canonical/harnesses"
|
|
65
|
+
);
|
|
66
|
+
return executableCandidates(command, platform ?? readPlatformEnv()).some(
|
|
67
|
+
(candidate) => existsSync(candidate),
|
|
68
|
+
);
|
|
69
|
+
}
|