@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,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `doctor` verb spec (noun `doctor`, self-verb).
|
|
3
|
+
*
|
|
4
|
+
* A read (`mutates: false`) that declares `needsStore: false` — the covenant has
|
|
5
|
+
* neither flag — so the dispatcher never pre-boots the store. The one store
|
|
6
|
+
* check boots it lazily inside a try/catch, keeping doctor storeless-by-default
|
|
7
|
+
* while still reporting store health. `run` lazily imports the orchestrator, so
|
|
8
|
+
* building the tree pulls neither the checks nor `@canonical/harnesses`.
|
|
9
|
+
*
|
|
10
|
+
* Exit-code decision: doctor always exits 0 — failures live in the `{ failed }`
|
|
11
|
+
* envelope (agents read the data; CI greps it). See PARITY_GAP
|
|
12
|
+
* `doctor-exit-zero-with-failures`.
|
|
13
|
+
*/
|
|
14
|
+
import { BIN_NAME } from "../../constants.js";
|
|
15
|
+
import { asVerb } from "../../kernel/spec/asVerb.js";
|
|
16
|
+
import { doctorFormatters } from "./doctor.render.js";
|
|
17
|
+
const doctorVerb = {
|
|
18
|
+
path: ["doctor"],
|
|
19
|
+
summary: "Check your environment and every setup target, globally and in this project.",
|
|
20
|
+
// Two house rules constrain this string and both are PROTECTED: it may not
|
|
21
|
+
// name the distribution (`identity.test.ts`) and it may not spell a CLI flag
|
|
22
|
+
// (`toolDescriptions.test.ts`), so the inventory's widening is described as
|
|
23
|
+
// "the verbose global flag" rather than by its spelling.
|
|
24
|
+
doc: "Reports the environment checks first, then one row per setup target — once for your home directory, once for this project. Each row is pass, fail, available (an optional integration you have not set up yet), or skip (nothing to do here, and the row says why), with the next step printed inline. Every row is named after the setup target that repairs it, except `harnesses`: a listing, per scope, of the AI harnesses found on this machine and whether this CLI's MCP server is registered in each — the ones actually found, or every harness it knows about under the verbose global flag. Needs no store; the store check boots lazily and never fails the run.",
|
|
25
|
+
useWhen: "when something is not working, to find out what",
|
|
26
|
+
category: "diagnostic",
|
|
27
|
+
params: [],
|
|
28
|
+
output: { formatters: doctorFormatters },
|
|
29
|
+
examples: [
|
|
30
|
+
{ cmd: `${BIN_NAME} doctor` },
|
|
31
|
+
{
|
|
32
|
+
cmd: `${BIN_NAME} doctor --format json`,
|
|
33
|
+
note: "machine-readable checks",
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
capability: {
|
|
37
|
+
needsStore: false,
|
|
38
|
+
mutates: false,
|
|
39
|
+
mcp: {
|
|
40
|
+
expose: true,
|
|
41
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
run: (_params, runtime) => import("./runChecks.js").then((m) => m.runChecks(runtime)),
|
|
45
|
+
};
|
|
46
|
+
/** The `doctor` capability module. */
|
|
47
|
+
export const doctorModule = {
|
|
48
|
+
name: "doctor",
|
|
49
|
+
verbs: [asVerb(doctorVerb)],
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=doctor.verb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.verb.js","sourceRoot":"","sources":["../../../../src/capabilities/doctor/doctor.verb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,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kB,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `doctor` run body: the unscoped environment checks plus the scoped rows
|
|
3
|
+
* the setup target table derives.
|
|
4
|
+
*
|
|
5
|
+
* Two kinds of finding live in one report and they are not the same kind. The
|
|
6
|
+
* ENVIRONMENT checks — the Node version, this CLI's own version, pack refs, the
|
|
7
|
+
* store — diagnose things `setup` cannot install; they carry no scope and stay
|
|
8
|
+
* their own section. The SCOPED rows are the setup targets, in both scopes,
|
|
9
|
+
* named with the target ids verbatim and repaired by the target's own command
|
|
10
|
+
* — plus, per scope, the `harnesses` inventory row: a listing of what this
|
|
11
|
+
* machine holds and where pragma stands in it, which is the thing the targets
|
|
12
|
+
* are measured against rather than a target itself. Adding a target adds its
|
|
13
|
+
* rows here for free.
|
|
14
|
+
*
|
|
15
|
+
* Checks are started eagerly (they run concurrently) and collected in
|
|
16
|
+
* declaration order for a deterministic report. Each is guarded so a thrown
|
|
17
|
+
* check becomes an attributable `fail` rather than aborting the whole run.
|
|
18
|
+
* Lazily imported by `doctor.verb.ts`, so neither the checks nor
|
|
19
|
+
* `@canonical/harnesses` land on the fast path.
|
|
20
|
+
*/
|
|
21
|
+
import { BIN_NAME } from "../../constants.js";
|
|
22
|
+
import { checkKeStore } from "./checks/checkKeStore.js";
|
|
23
|
+
import { checkNodeVersion } from "./checks/checkNodeVersion.js";
|
|
24
|
+
import { checkPackageRefs } from "./checks/checkPackageRefs.js";
|
|
25
|
+
import { checkPaths } from "./checks/checkPaths.js";
|
|
26
|
+
import { checkPragmaVersion } from "./checks/checkPragmaVersion.js";
|
|
27
|
+
import { scopedChecks } from "./checks/targetHealth.js";
|
|
28
|
+
/**
|
|
29
|
+
* The unscoped environment checks, each paired with the display name used if it
|
|
30
|
+
* rejects. The fallback name matches the `name` each check returns on success,
|
|
31
|
+
* so a thrown check reports the same label and stays correlatable.
|
|
32
|
+
*/
|
|
33
|
+
function buildEnvironmentChecks(rt) {
|
|
34
|
+
return [
|
|
35
|
+
["Node version", checkNodeVersion()],
|
|
36
|
+
[`${BIN_NAME} version`, checkPragmaVersion(rt)],
|
|
37
|
+
["pack refs", checkPackageRefs(rt)],
|
|
38
|
+
["store", checkKeStore(rt)],
|
|
39
|
+
["paths", checkPaths(rt)],
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
/** Turn a rejected check into an attributable failure rather than a crash. */
|
|
43
|
+
async function guarded(name, promise) {
|
|
44
|
+
try {
|
|
45
|
+
return await promise;
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
const reason = error instanceof Error ? error.message : String(error);
|
|
49
|
+
return {
|
|
50
|
+
name,
|
|
51
|
+
status: "fail",
|
|
52
|
+
detail: `Check threw an unexpected error: ${reason}`,
|
|
53
|
+
remedy: `Re-run \`${BIN_NAME} doctor\`; if it persists, report this as a bug.`,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Run every health check and aggregate the results.
|
|
59
|
+
*
|
|
60
|
+
* @param rt - The per-invocation runtime.
|
|
61
|
+
* @returns The `{ checks, passed, failed, available, skipped }` summary.
|
|
62
|
+
* @note Impure — the checks read the fs, boot the store, and detect harnesses.
|
|
63
|
+
*/
|
|
64
|
+
export async function runChecks(rt) {
|
|
65
|
+
// The scoped rows come back as a batch (one detection pass over the table),
|
|
66
|
+
// so they are guarded as a batch: a detection that throws becomes one
|
|
67
|
+
// attributable failure instead of taking the environment section with it.
|
|
68
|
+
const [environmentResults, scopedResults] = await Promise.all([
|
|
69
|
+
Promise.all(buildEnvironmentChecks(rt).map(([name, promise]) => guarded(name, promise))),
|
|
70
|
+
scopedChecks(rt, BIN_NAME).catch((error) => [
|
|
71
|
+
{
|
|
72
|
+
name: "setup targets",
|
|
73
|
+
status: "fail",
|
|
74
|
+
detail: `Detection threw an unexpected error: ${error instanceof Error ? error.message : String(error)}`,
|
|
75
|
+
remedy: `Re-run \`${BIN_NAME} doctor\`; if it persists, report this as a bug.`,
|
|
76
|
+
},
|
|
77
|
+
]),
|
|
78
|
+
]);
|
|
79
|
+
const checks = [...environmentResults, ...scopedResults];
|
|
80
|
+
return {
|
|
81
|
+
checks,
|
|
82
|
+
passed: checks.filter((c) => c.status === "pass").length,
|
|
83
|
+
failed: checks.filter((c) => c.status === "fail").length,
|
|
84
|
+
available: checks.filter((c) => c.status === "available").length,
|
|
85
|
+
skipped: checks.filter((c) => c.status === "skip").length,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=runChecks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runChecks.js","sourceRoot":"","sources":["../../../../src/capabilities/doctor/runChecks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGxD;;;;GAIG;AACH,SAAS,sBAAsB,CAC7B,EAAiB;IAEjB,OAAO;QACL,CAAC,cAAc,EAAE,gBAAgB,EAAE,CAAC;QACpC,CAAC,GAAG,QAAQ,UAAU,EAAE,kBAAkB,CAAC,EAAE,CAAC,CAAC;QAC/C,CAAC,WAAW,EAAE,gBAAgB,CAAC,EAAE,CAAC,CAAC;QACnC,CAAC,OAAO,EAAE,YAAY,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE,CAAC,CAAC;KAC1B,CAAC;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AAC,CAAC;IACxE,OAAO;QACL,MAAM;QACN,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM;QACxD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM;QACxD,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,MAAM;QAChE,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,MAAM;KAC1D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/capabilities/doctor/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatters for `graph connect` — the same answer in two registers.
|
|
3
|
+
*
|
|
4
|
+
* A person gets one ROW PER STEP grouped by path, with each node's human name
|
|
5
|
+
* from the pack index, because what a reader wants from "how do these two
|
|
6
|
+
* connect" is the chain, read left to right, with the direction of every edge
|
|
7
|
+
* visible.
|
|
8
|
+
*
|
|
9
|
+
* An agent gets ONE OBJECT. Not Markdown: the answer is structured data — two
|
|
10
|
+
* endpoints, a verdict, the paths, and the policy the walk ran under — and
|
|
11
|
+
* flattening it into prose would make a caller parse back out what it already
|
|
12
|
+
* had (Constitution XI). This is also why neither format ever explains WHY two
|
|
13
|
+
* things relate: the predicates on the path are the explanation, and a sentence
|
|
14
|
+
* synthesised from them would be pragma asserting a meaning the graph does not
|
|
15
|
+
* carry.
|
|
16
|
+
*
|
|
17
|
+
* Terms arrive already compacted and named by the relation index, against the
|
|
18
|
+
* store's own merged prefix map — so these formatters carry no prefix map and
|
|
19
|
+
* re-derive nothing.
|
|
20
|
+
*/
|
|
21
|
+
/** The short form of a term: prefixed when there is one, else the raw value. */
|
|
22
|
+
const short = (term) => term.prefixed ?? term.value;
|
|
23
|
+
/** A term as a reader should see it — short form, with its name when known. */
|
|
24
|
+
const named = (term) => term.title ? `${short(term)} (${term.title})` : short(term);
|
|
25
|
+
/** A blank node has no address, and saying so beats printing a dead handle. */
|
|
26
|
+
const node = (term) => term.addressable === false ? `[record ${term.value}]` : named(term);
|
|
27
|
+
/** `1 hop` / `2 hops` — a count a reader does not have to forgive. */
|
|
28
|
+
const count = (n, noun) => `${n} ${noun}${n === 1 ? "" : "s"}`;
|
|
29
|
+
/** The sentence for each way of being unconnected — one per case, never shared. */
|
|
30
|
+
const REFUSALS = {
|
|
31
|
+
"endpoint-carries-no-relation": "Not connectable: one endpoint carries no relation the model uses — it is only classified.",
|
|
32
|
+
"shares-only-rosters": "Not connected in the model. The two share membership, which is not a relation.",
|
|
33
|
+
"no-path-within-hop-limit": "Not connected: no relation path between them within the hop limit.",
|
|
34
|
+
};
|
|
35
|
+
/** One roster group, as a line a reader can act on. */
|
|
36
|
+
function rosterLine(roster) {
|
|
37
|
+
const shape = roster.side === "subjects"
|
|
38
|
+
? `${short(roster.predicate)} -> ${node(roster.node)}`
|
|
39
|
+
: `${node(roster.node)} -> ${short(roster.predicate)}`;
|
|
40
|
+
return ` ${shape} (${roster.members} members)`;
|
|
41
|
+
}
|
|
42
|
+
/** One path, as a header plus one row per step. */
|
|
43
|
+
function pathLines(path, ordinal) {
|
|
44
|
+
const lines = [` Path ${ordinal} (${count(path.steps.length, "hop")})`];
|
|
45
|
+
for (const step of path.steps) {
|
|
46
|
+
const arrow = step.direction === "forward"
|
|
47
|
+
? `--${short(step.predicate)}->`
|
|
48
|
+
: `<-${short(step.predicate)}--`;
|
|
49
|
+
lines.push(` ${node(step.from)} ${arrow} ${node(step.to)}`);
|
|
50
|
+
}
|
|
51
|
+
return lines;
|
|
52
|
+
}
|
|
53
|
+
/** The policy block every answer carries, positive or negative. */
|
|
54
|
+
function policyLines(data) {
|
|
55
|
+
return [
|
|
56
|
+
"",
|
|
57
|
+
` Hop limit ${data.hopLimit}; edges whose fan-in exceeds ${data.rosterThreshold} are rosters, not relations.`,
|
|
58
|
+
` Packs searched: ${data.packs.length > 0 ? data.packs.join(", ") : "none recorded"}`,
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
export const connectFormatters = {
|
|
62
|
+
plain(data) {
|
|
63
|
+
const title = `${node(data.a.term)} <-> ${node(data.b.term)}`;
|
|
64
|
+
const lines = [title, "=".repeat(Math.min(Math.max(title.length, 24), 96))];
|
|
65
|
+
if (data.connected) {
|
|
66
|
+
lines.push(` Connected in ${count(data.hops ?? 0, "relation hop")}, by ${count(data.pathCount, "shortest path")}.`, "");
|
|
67
|
+
for (const [index, path] of data.paths.entries()) {
|
|
68
|
+
lines.push(...pathLines(path, index + 1));
|
|
69
|
+
lines.push("");
|
|
70
|
+
}
|
|
71
|
+
if (data.truncated) {
|
|
72
|
+
lines.push(` Showing ${data.paths.length} of ${data.pathCount} shortest paths — raise --paths for the rest.`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
lines.push(` ${REFUSALS[data.unconnectedBecause ?? "no-path-within-hop-limit"]}`);
|
|
77
|
+
for (const endpoint of [data.a, data.b]) {
|
|
78
|
+
if (endpoint.relatable)
|
|
79
|
+
continue;
|
|
80
|
+
lines.push("", ` ${node(endpoint.term)} carries no relation. It is classified by:`, ...(endpoint.classifiedBy ?? []).map(rosterLine));
|
|
81
|
+
}
|
|
82
|
+
if (data.sharedRosters.length > 0) {
|
|
83
|
+
lines.push("", " Rosters they both belong to:");
|
|
84
|
+
lines.push(...data.sharedRosters.map(rosterLine));
|
|
85
|
+
lines.push("", " A roster is answered by the noun's own list verb, not by a path.");
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
lines.push(...policyLines(data));
|
|
89
|
+
return lines.join("\n").trimEnd();
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* The agent-facing format IS the object — one JSON value on one line.
|
|
93
|
+
*
|
|
94
|
+
* `json` pretty-prints the same payload for a human reading a pipe; the two
|
|
95
|
+
* are the same data by construction, so an agent and a reader never see
|
|
96
|
+
* different answers to the same question.
|
|
97
|
+
*/
|
|
98
|
+
llm: (data) => JSON.stringify(data),
|
|
99
|
+
json: (data) => JSON.stringify(data, null, 2),
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=connect.render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.render.js","sourceRoot":"","sources":["../../../../src/capabilities/graph/connect.render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAWH,gFAAgF;AAChF,MAAM,KAAK,GAAG,CAAC,IAAiB,EAAU,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC;AAEzE,+EAA+E;AAC/E,MAAM,KAAK,GAAG,CAAC,IAAiB,EAAU,EAAE,CAC1C,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAE9D,+EAA+E;AAC/E,MAAM,IAAI,GAAG,CAAC,IAAiB,EAAU,EAAE,CACzC,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,WAAW,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAEtE,sEAAsE;AACtE,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,IAAY,EAAU,EAAE,CAChD,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,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AAC,CAAC;CAC9C,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shape of a `graph connect` answer — the ONE contract its run body writes
|
|
3
|
+
* and its three formatters read.
|
|
4
|
+
*
|
|
5
|
+
* Type-only, and deliberately its own module: the formatters hang off the verb
|
|
6
|
+
* spec, so they are on the static import graph the lazy-dispatch probe walks
|
|
7
|
+
* (`capabilities/lazy.test.ts`), while the walk itself must stay behind a
|
|
8
|
+
* dynamic import. A shared type module lets both sides name the same answer
|
|
9
|
+
* without dragging the traversal onto the storeless fast path.
|
|
10
|
+
*
|
|
11
|
+
* Every answer carries the POLICY it was produced under — the hop limit, the
|
|
12
|
+
* roster threshold, and the packs searched. That is Constitution VI applied to
|
|
13
|
+
* the answer rather than only to the source: the commonest answer this verb
|
|
14
|
+
* gives is "these two are not connected", and that sentence means nothing
|
|
15
|
+
* without knowing how far it looked, what it was willing to walk, and what it
|
|
16
|
+
* was looking in. A missing pack is what makes an honest "no path" and a
|
|
17
|
+
* dishonest one byte-identical, so `packs` is present whether the answer is
|
|
18
|
+
* positive or negative.
|
|
19
|
+
*/
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=connect.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.types.js","sourceRoot":"","sources":["../../../../src/capabilities/graph/connect.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `graph connect <a> <b>` — what connects two entities, and what "unlinked"
|
|
3
|
+
* means when nothing does.
|
|
4
|
+
*
|
|
5
|
+
* The third verb on the `graph` noun, beside `inspect` (one entity's
|
|
6
|
+
* neighbourhood) and `query` (the raw SPARQL escape hatch). It belongs here for
|
|
7
|
+
* the same reason those two do: it reads ACROSS the whole store rather than
|
|
8
|
+
* within one population, so it hangs off the noun for a store-wide read and
|
|
9
|
+
* adds no noun of its own.
|
|
10
|
+
*
|
|
11
|
+
* It is hand-written rather than a declared pack story because the pack grammar
|
|
12
|
+
* cannot express it. A list story's parameters are exactly its declared filters
|
|
13
|
+
* plus its declared search, every filter is projected as an OPTIONAL NAMED
|
|
14
|
+
* flag, and the only positional-and-required parameter the compiler ever mints
|
|
15
|
+
* is a lookup's single name — so there is nowhere in the grammar to put two
|
|
16
|
+
* required entity arguments. And a filter is a row predicate over an author's
|
|
17
|
+
* query, so a declared form would have to enumerate the walk space and let a
|
|
18
|
+
* filter pick one pair out of it: at four hops that space is 71 million walks,
|
|
19
|
+
* against the largest declared story's 1,698 rows.
|
|
20
|
+
*
|
|
21
|
+
* Both arguments accept exactly what `graph inspect` accepts — a prefixed name
|
|
22
|
+
* or an absolute IRI — and complete from the pack index through the same
|
|
23
|
+
* `names`/`index` source a compiled lookup's `<name>` uses, so the two
|
|
24
|
+
* positionals behave like every other entity argument in the CLI.
|
|
25
|
+
*
|
|
26
|
+
* Store-backed and read-only, like both its siblings. The traversal lives in a
|
|
27
|
+
* dynamically-imported run body: the relation index it needs is built by one
|
|
28
|
+
* scan of the store, and a process that never asks a connect question must
|
|
29
|
+
* never pay for it — which is the same guarantee `needsStore` and the lazy
|
|
30
|
+
* store already give every other read.
|
|
31
|
+
*/
|
|
32
|
+
import { BIN_NAME } from "../../constants.js";
|
|
33
|
+
import { distributionScopesTiers } from "../../kernel/distribution/registry.js";
|
|
34
|
+
import { PragmaError } from "../../kernel/error/index.js";
|
|
35
|
+
import { asVerb } from "../../kernel/spec/asVerb.js";
|
|
36
|
+
import { connectFormatters } from "./connect.render.js";
|
|
37
|
+
/**
|
|
38
|
+
* The hop limit in force unless `--hops` says otherwise.
|
|
39
|
+
*
|
|
40
|
+
* Four, from the measured connectivity ladder on the shipped pack: it is the
|
|
41
|
+
* smallest limit that spans the longest genuine bridge in this store — the walk
|
|
42
|
+
* from a platform variable through its declaration and its references to the
|
|
43
|
+
* symbol behind it — and the largest that keeps the answer set honest. At three
|
|
44
|
+
* that walk is refused; at six the connected fraction jumps and the paths stop
|
|
45
|
+
* being something a person can hold in mind.
|
|
46
|
+
*/
|
|
47
|
+
export const DEFAULT_HOPS = 4;
|
|
48
|
+
/** The ceiling `--hops` may be raised to; above it the verb refuses. */
|
|
49
|
+
export const MAX_HOPS = 6;
|
|
50
|
+
/** How many shortest paths are shown unless `--paths` says otherwise. */
|
|
51
|
+
export const DEFAULT_PATHS = 10;
|
|
52
|
+
/**
|
|
53
|
+
* Hold a numeric param to a whole number within its stated range.
|
|
54
|
+
*
|
|
55
|
+
* REFUSES rather than clamps. A clamped `--hops 40` would answer a question
|
|
56
|
+
* nobody asked and report a limit the caller did not set, which is precisely
|
|
57
|
+
* the hidden policy every answer's policy block exists to rule out.
|
|
58
|
+
*
|
|
59
|
+
* The kernel already coerces a `number` param and rejects what is not a number
|
|
60
|
+
* at all (`project/cli/dispatch.ts#coerceParam`, and `z.number()` over MCP), so
|
|
61
|
+
* what is left to check is RANGE and wholeness — `--hops 2.5` is a number, and
|
|
62
|
+
* it is not a hop count.
|
|
63
|
+
*
|
|
64
|
+
* @param value - The coerced param value.
|
|
65
|
+
* @param name - The flag's name, for the diagnostic.
|
|
66
|
+
* @param fallback - The value when the flag was not given.
|
|
67
|
+
* @param min - The smallest accepted value.
|
|
68
|
+
* @param max - The largest accepted value, if there is one.
|
|
69
|
+
* @returns The validated integer.
|
|
70
|
+
* @throws PragmaError INVALID_INPUT when the value is not an integer in range.
|
|
71
|
+
*/
|
|
72
|
+
function bounded(value, name, fallback, min, max) {
|
|
73
|
+
if (value === undefined || value === null)
|
|
74
|
+
return fallback;
|
|
75
|
+
const parsed = typeof value === "number" ? value : Number(value);
|
|
76
|
+
const ceiling = max === undefined ? "" : ` and at most ${max}`;
|
|
77
|
+
if (!Number.isInteger(parsed) ||
|
|
78
|
+
parsed < min ||
|
|
79
|
+
(max !== undefined && parsed > max)) {
|
|
80
|
+
throw PragmaError.invalidInput(name, String(value), {
|
|
81
|
+
recovery: {
|
|
82
|
+
message: `--${name} must be a whole number of at least ${min}${ceiling}.`,
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return parsed;
|
|
87
|
+
}
|
|
88
|
+
const connectVerb = {
|
|
89
|
+
path: ["graph", "connect"],
|
|
90
|
+
summary: "Show the shortest relation paths between two entities.",
|
|
91
|
+
doc: `Finds every shortest path of RELATION edges between two entities, and says which kind of nothing it found when there is no path. An edge counts as a relation only where it does not fan out into a roster — membership of ${distributionScopesTiers() ? "a class, a tier or a family" : "a class or a family"} is answered by that noun's list verb, not by a path — so most pairs are correctly reported as unconnected. Address each endpoint by prefixed name (owl:Class) or absolute IRI. Every answer states the hop limit, the fan-in threshold, and the packs searched.`,
|
|
92
|
+
useWhen: "when asked whether and how two things are related",
|
|
93
|
+
example: { a: "owl:Class", b: "rdfs:Class" },
|
|
94
|
+
params: [
|
|
95
|
+
{
|
|
96
|
+
kind: "string",
|
|
97
|
+
name: "a",
|
|
98
|
+
doc: "The first endpoint — a prefixed name or absolute IRI.",
|
|
99
|
+
positional: true,
|
|
100
|
+
required: true,
|
|
101
|
+
complete: { kind: "names", source: { from: "index", type: "" } },
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
kind: "string",
|
|
105
|
+
name: "b",
|
|
106
|
+
doc: "The second endpoint — a prefixed name or absolute IRI.",
|
|
107
|
+
positional: true,
|
|
108
|
+
required: true,
|
|
109
|
+
complete: { kind: "names", source: { from: "index", type: "" } },
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
kind: "number",
|
|
113
|
+
name: "hops",
|
|
114
|
+
doc: `Largest path length to return (default ${DEFAULT_HOPS}, ceiling ${MAX_HOPS}).`,
|
|
115
|
+
default: DEFAULT_HOPS,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
kind: "number",
|
|
119
|
+
name: "paths",
|
|
120
|
+
doc: `Most shortest paths to show (default ${DEFAULT_PATHS}); the answer always reports the true total.`,
|
|
121
|
+
default: DEFAULT_PATHS,
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
output: { formatters: connectFormatters },
|
|
125
|
+
examples: [
|
|
126
|
+
{
|
|
127
|
+
cmd: `${BIN_NAME} graph connect owl:Class rdfs:Class`,
|
|
128
|
+
note: "two classes",
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
cmd: `${BIN_NAME} graph connect owl:Class rdfs:Class --format json`,
|
|
132
|
+
note: "the answer with the policy it was found under",
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
capability: {
|
|
136
|
+
needsStore: true,
|
|
137
|
+
mutates: false,
|
|
138
|
+
mcp: {
|
|
139
|
+
expose: true,
|
|
140
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
run: (params, rt) => import("./runConnect.js").then((m) => m.runConnect(rt, String(params.a), String(params.b), {
|
|
144
|
+
hops: bounded(params.hops, "hops", DEFAULT_HOPS, 1, MAX_HOPS),
|
|
145
|
+
paths: bounded(params.paths, "paths", DEFAULT_PATHS, 1),
|
|
146
|
+
})),
|
|
147
|
+
};
|
|
148
|
+
/** The `graph connect` verb. */
|
|
149
|
+
export const graphConnectVerb = asVerb(connectVerb);
|
|
150
|
+
//# sourceMappingURL=connect.verb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.verb.js","sourceRoot":"","sources":["../../../../src/capabilities/graph/connect.verb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM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EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;SAC1D;KACF;IACD,GAAG,EAAE,CAAC,MAA+B,EAAE,EAAE,EAAE,EAAE,CAC3C,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CACnC,CAAC,CAAC,UAAU,CAAC,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE;QACnD,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,EAAE,QAAQ,CAAC;QAC7D,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC;KACxD,CAAC,CACH;CACJ,CAAC;AAEF,gCAAgC;AAChC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `graph` capability module — `inspect` (single-entity read), `query` (the
|
|
3
|
+
* raw SPARQL escape hatch, PR6) and `connect` (relation paths between two
|
|
4
|
+
* entities). The covenant blesses all three.
|
|
5
|
+
*/
|
|
6
|
+
import { resourceProvider } from "../resources/index.js";
|
|
7
|
+
import { graphConnectVerb } from "./connect.verb.js";
|
|
8
|
+
import { graphInspectVerb } from "./inspect.verb.js";
|
|
9
|
+
import { graphQueryVerb } from "./query.verb.js";
|
|
10
|
+
/**
|
|
11
|
+
* The `graph` capability module. Carries the MCP resource browser: `graph
|
|
12
|
+
* inspect` (CLI) and the resource read (MCP) share one entity reader, so the
|
|
13
|
+
* two projections stay in lockstep. Resources are NOT tools — the emitted tool
|
|
14
|
+
* surface (and the golden) is unaffected.
|
|
15
|
+
*/
|
|
16
|
+
export const graphModule = {
|
|
17
|
+
name: "graph",
|
|
18
|
+
verbs: [graphConnectVerb, graphInspectVerb, graphQueryVerb],
|
|
19
|
+
mcpResources: resourceProvider,
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/capabilities/graph/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAqB;IAC3C,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,cAAc,CAAC;IAC3D,YAAY,EAAE,gBAAgB;CAC/B,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatters for `graph inspect` — the entity's neighbourhood in three shapes.
|
|
3
|
+
*
|
|
4
|
+
* Terms arrive ALREADY compacted and named: the reader does it against the
|
|
5
|
+
* store's own merged prefix map, which is the map the graph was actually built
|
|
6
|
+
* with, so these formatters neither carry a prefix map nor re-derive one. They
|
|
7
|
+
* choose between the forms the reader supplies and nothing more.
|
|
8
|
+
*/
|
|
9
|
+
import { toTurtle } from "../../kernel/render/turtle.js";
|
|
10
|
+
/** The short form of a term: prefixed when there is one, else the raw value. */
|
|
11
|
+
const short = (term) => term.prefixed ?? term.value;
|
|
12
|
+
/** A term as a reader should see it — short form, with its name when known. */
|
|
13
|
+
const named = (term) => term.title ? `${short(term)} (${term.title})` : short(term);
|
|
14
|
+
/**
|
|
15
|
+
* `predicate (330, sample of 5)` — the count is the truth, the list is not.
|
|
16
|
+
*
|
|
17
|
+
* A roster and a truncated relation read differently on purpose: "sample of"
|
|
18
|
+
* tells a reader that paging will not produce the rest and the noun's list verb
|
|
19
|
+
* is where the full set lives, where "showing" invites them to ask for more.
|
|
20
|
+
*/
|
|
21
|
+
function inboundHeading(group) {
|
|
22
|
+
if (group.sampled) {
|
|
23
|
+
return `${short(group.predicate)} (${group.count}, sample of ${group.subjects.length})`;
|
|
24
|
+
}
|
|
25
|
+
const suffix = group.truncated
|
|
26
|
+
? `${group.count}, showing ${group.subjects.length}`
|
|
27
|
+
: `${group.count}`;
|
|
28
|
+
return `${short(group.predicate)} (${suffix})`;
|
|
29
|
+
}
|
|
30
|
+
/** `predicate (24 objects, showing 10)` — a cut group says what it was cut from. */
|
|
31
|
+
function outboundHeading(group) {
|
|
32
|
+
return group.truncated
|
|
33
|
+
? `${short(group.predicate)} (${group.count} objects, showing ${group.objects.length})`
|
|
34
|
+
: short(group.predicate);
|
|
35
|
+
}
|
|
36
|
+
export const inspectFormatters = {
|
|
37
|
+
plain(data) {
|
|
38
|
+
const title = data.label
|
|
39
|
+
? `${short({ termType: "NamedNode", value: data.uri, ...(data.prefixed ? { prefixed: data.prefixed } : {}) })} — ${data.label}`
|
|
40
|
+
: (data.prefixed ?? data.uri);
|
|
41
|
+
const lines = [title, "═".repeat(Math.max(title.length, 24)), ""];
|
|
42
|
+
for (const group of data.groups) {
|
|
43
|
+
lines.push(` ${outboundHeading(group)}:`);
|
|
44
|
+
for (const object of group.objects)
|
|
45
|
+
lines.push(` ${named(object)}`);
|
|
46
|
+
}
|
|
47
|
+
for (const [via, rows] of Object.entries(data.nested)) {
|
|
48
|
+
lines.push("", ` ${via}:`);
|
|
49
|
+
for (const row of rows) {
|
|
50
|
+
// Values are TERMS; `String(term)` rendered every nested field as
|
|
51
|
+
// `[object Object]`, which made the whole plain-format record unreadable.
|
|
52
|
+
const fields = Object.entries(row)
|
|
53
|
+
.map(([key, value]) => `${key}=${named(value)}`)
|
|
54
|
+
.join(" ");
|
|
55
|
+
lines.push(` ${fields}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (data.inbound.length > 0) {
|
|
59
|
+
lines.push("", " Referenced by:");
|
|
60
|
+
for (const group of data.inbound) {
|
|
61
|
+
lines.push(` ${inboundHeading(group)}`);
|
|
62
|
+
for (const subject of group.subjects) {
|
|
63
|
+
lines.push(` ${named(subject)}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return lines.join("\n").trimEnd();
|
|
68
|
+
},
|
|
69
|
+
/**
|
|
70
|
+
* The agent-facing format IS Turtle — same bytes the `pragma:{+uri}` resource
|
|
71
|
+
* read serves, which is what keeps the mirror contract meaningful now that the
|
|
72
|
+
* two are no longer both JSON. Measured on one button: 15.8 KB of JSON against
|
|
73
|
+
* 4.5 KB of Turtle for the same neighbourhood.
|
|
74
|
+
*
|
|
75
|
+
* `prefixes` comes from the reader, not from this formatter: it compacted the
|
|
76
|
+
* terms against the store's own merged map, so re-deriving a map here could
|
|
77
|
+
* only disagree with the names already in the payload.
|
|
78
|
+
*/
|
|
79
|
+
llm: (data) => toTurtle(data, data.prefixes),
|
|
80
|
+
json: (data) => JSON.stringify(data, null, 2),
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=inspect.render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.render.js","sourceRoot":"","sources":["../../../../src/capabilities/graph/inspect.render.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AASzD,gFAAgF;AAChF,MAAM,KAAK,GAAG,CAAC,IAAc,EAAU,EAAE,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC;AAEtE,+EAA+E;AAC/E,MAAM,KAAK,GAAG,CAAC,IAAc,EAAU,EAAE,CACvC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,GA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AAI,CAAC,OAAO,EAAE,CAAC;gBACjC,KAAK,CAAC,IAAI,CAAC,OAAO,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBAC3C,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;oBACrC,KAAK,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;gBACxC,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC;IACD;;;;;;;;;OASG;IACH,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC;IAC5C,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;CAC9C,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `graph inspect <uri>` — every triple where the URI is the subject, grouped by
|
|
3
|
+
* predicate. The CLI twin of the MCP resource read (both share {@link readEntity}
|
|
4
|
+
* in PR3's resources browser); `graph query` (arbitrary SPARQL) lands in PR6.
|
|
5
|
+
*
|
|
6
|
+
* Store-backed: the URI is resolved through the store's merged prefix map and
|
|
7
|
+
* validated to the embeddable shape before it is interpolated, so a prefixed
|
|
8
|
+
* name or absolute IRI addresses the subject exactly.
|
|
9
|
+
*/
|
|
10
|
+
import { BIN_NAME, DEFAULT_DETAIL_LEVEL, DETAIL_LEVELS, } from "../../constants.js";
|
|
11
|
+
import { readEntity } from "../../kernel/runtime/readEntity.js";
|
|
12
|
+
import { asVerb } from "../../kernel/spec/asVerb.js";
|
|
13
|
+
import { inspectFormatters } from "./inspect.render.js";
|
|
14
|
+
const inspectVerb = {
|
|
15
|
+
path: ["graph", "inspect"],
|
|
16
|
+
summary: "Show every triple where a URI is the subject, grouped by predicate.",
|
|
17
|
+
doc: "Inspect one entity: all predicate/object pairs asserted on the subject. Address it by prefixed name (owl:Class) or absolute IRI.",
|
|
18
|
+
useWhen: "when asked for everything recorded about one identifier",
|
|
19
|
+
example: { uri: "owl:Class" },
|
|
20
|
+
params: [
|
|
21
|
+
{
|
|
22
|
+
kind: "string",
|
|
23
|
+
name: "uri",
|
|
24
|
+
doc: "The subject URI — a prefixed name or absolute IRI.",
|
|
25
|
+
positional: true,
|
|
26
|
+
required: true,
|
|
27
|
+
complete: { kind: "names", source: { from: "index", type: "" } },
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
output: { formatters: inspectFormatters },
|
|
31
|
+
// The read is BOUNDED by disclosure — inbound exemplars and literal previews
|
|
32
|
+
// both widen with the level — so the verb must declare the ladder it honours.
|
|
33
|
+
// Without this the CLI `--detail` flag has nothing to validate against and the
|
|
34
|
+
// MCP projector injects no `detail` argument at all, so the documented knob
|
|
35
|
+
// was one an agent could not actually reach.
|
|
36
|
+
disclosure: { levels: [...DETAIL_LEVELS], default: DEFAULT_DETAIL_LEVEL },
|
|
37
|
+
examples: [
|
|
38
|
+
{ cmd: `${BIN_NAME} graph inspect owl:Class` },
|
|
39
|
+
{
|
|
40
|
+
cmd: `${BIN_NAME} graph inspect http://www.w3.org/2002/07/owl#Class`,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
capability: {
|
|
44
|
+
needsStore: true,
|
|
45
|
+
mutates: false,
|
|
46
|
+
mcp: {
|
|
47
|
+
expose: true,
|
|
48
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
run: (params, rt) => readEntity(rt, String(params.uri)),
|
|
52
|
+
};
|
|
53
|
+
/** The `graph inspect` verb. */
|
|
54
|
+
export const graphInspectVerb = asVerb(inspectVerb);
|
|
55
|
+
//# sourceMappingURL=inspect.verb.js.map
|