@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,136 @@
|
|
|
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
|
+
|
|
21
|
+
/** A node or predicate as the answer names it: full IRI, short form, human name. */
|
|
22
|
+
export interface ConnectTerm {
|
|
23
|
+
/** The full IRI, or a blank node's session-local label. */
|
|
24
|
+
readonly value: string;
|
|
25
|
+
/** Prefixed form, when a loaded namespace matches. */
|
|
26
|
+
readonly prefixed?: string;
|
|
27
|
+
/** Human name from the pack index, when it says more than the local name. */
|
|
28
|
+
readonly title?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Marks a term no `pragma:{+uri}` read can resolve. Only blank nodes carry
|
|
31
|
+
* it: their labels re-mint on every load, so the record is real but its
|
|
32
|
+
* handle is not addressable. Blank nodes ARE walked — 6,942 of them carry the
|
|
33
|
+
* token graph's declarations and resolved values — so a path may name one.
|
|
34
|
+
*/
|
|
35
|
+
readonly addressable?: false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* One step of a path: the triple that was traversed, and which way.
|
|
40
|
+
*
|
|
41
|
+
* `direction` is not decoration. `forward` says the triple `(from, predicate,
|
|
42
|
+
* to)` is asserted; `reverse` says `(to, predicate, from)` is. Concatenating a
|
|
43
|
+
* path's steps walks from one endpoint to the other only if each step's
|
|
44
|
+
* direction is respected, and an answer that dropped it would claim edges the
|
|
45
|
+
* graph does not assert.
|
|
46
|
+
*/
|
|
47
|
+
export interface ConnectStep {
|
|
48
|
+
readonly from: ConnectTerm;
|
|
49
|
+
readonly predicate: ConnectTerm;
|
|
50
|
+
readonly direction: "forward" | "reverse";
|
|
51
|
+
readonly to: ConnectTerm;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** One path: an ordered walk of steps from `a` to `b`. */
|
|
55
|
+
export interface ConnectPath {
|
|
56
|
+
readonly steps: readonly ConnectStep[];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A group both endpoints belong to that is a ROSTER rather than a relation —
|
|
61
|
+
* membership, which is what the noun's own list verb answers properly.
|
|
62
|
+
*
|
|
63
|
+
* Two shapes, because a group has two directions: `subjects` means both
|
|
64
|
+
* endpoints are subjects of `predicate` pointing at `node` (both are
|
|
65
|
+
* `ds:Component`s, both in the `ds:global` tier); `objects` means both are
|
|
66
|
+
* objects of `node` asserting `predicate` (both covered by one modifier
|
|
67
|
+
* family's 359 `dt:covers` edges). Reporting these is what separates "unrelated
|
|
68
|
+
* in the model, though they do share membership" from "unrelated, full stop".
|
|
69
|
+
*/
|
|
70
|
+
export interface SharedRoster {
|
|
71
|
+
/** Which side of the group the two endpoints sit on. */
|
|
72
|
+
readonly side: "subjects" | "objects";
|
|
73
|
+
readonly predicate: ConnectTerm;
|
|
74
|
+
/** The group's other end: the shared object, or the shared subject. */
|
|
75
|
+
readonly node: ConnectTerm;
|
|
76
|
+
/** The TRUE size of the group — why it is a roster and not a relation. */
|
|
77
|
+
readonly members: number;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** One endpoint of the question, as the store resolved it. */
|
|
81
|
+
export interface ConnectEndpoint {
|
|
82
|
+
/** The value the caller supplied, verbatim. */
|
|
83
|
+
readonly input: string;
|
|
84
|
+
readonly term: ConnectTerm;
|
|
85
|
+
/**
|
|
86
|
+
* False when this endpoint carries no walkable relation edge in either
|
|
87
|
+
* direction — it is in the graph, but only classified. Nothing can be
|
|
88
|
+
* connected to it, which is a different answer from "nothing is".
|
|
89
|
+
*/
|
|
90
|
+
readonly relatable: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* The roster groups that classify an endpoint, present only when
|
|
93
|
+
* {@link relatable} is false — the answer to "then what IS it?", which is
|
|
94
|
+
* the only useful thing to say about a node with no relations.
|
|
95
|
+
*/
|
|
96
|
+
readonly classifiedBy?: readonly SharedRoster[];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Why an unconnected pair is unconnected. Three of `CN.07`'s five cases; the
|
|
101
|
+
* other two are refusals rather than answers (an absent name throws
|
|
102
|
+
* `ENTITY_NOT_FOUND` naming which argument, an unbound namespace throws
|
|
103
|
+
* `STORE_UNAVAILABLE`), because neither may make a connectivity claim at all.
|
|
104
|
+
*/
|
|
105
|
+
export type ConnectRefusal =
|
|
106
|
+
/** An endpoint carries no relation edge — see {@link ConnectEndpoint.relatable}. */
|
|
107
|
+
| "endpoint-carries-no-relation"
|
|
108
|
+
/** The walk exhausted, but the two share membership — {@link ConnectResult.sharedRosters}. */
|
|
109
|
+
| "shares-only-rosters"
|
|
110
|
+
/** The walk exhausted with nothing in common at all. */
|
|
111
|
+
| "no-path-within-hop-limit";
|
|
112
|
+
|
|
113
|
+
/** The answer to one `graph connect` question. */
|
|
114
|
+
export interface ConnectResult {
|
|
115
|
+
readonly a: ConnectEndpoint;
|
|
116
|
+
readonly b: ConnectEndpoint;
|
|
117
|
+
readonly connected: boolean;
|
|
118
|
+
/** Which negative answer this is; absent when {@link connected}. */
|
|
119
|
+
readonly unconnectedBecause?: ConnectRefusal;
|
|
120
|
+
/** The shortest-path length, or null when there is no path. */
|
|
121
|
+
readonly hops: number | null;
|
|
122
|
+
/** How many distinct shortest paths there are — the truth behind `paths`. */
|
|
123
|
+
readonly pathCount: number;
|
|
124
|
+
/** The shortest paths, ranked and capped by `--paths`. */
|
|
125
|
+
readonly paths: readonly ConnectPath[];
|
|
126
|
+
/** Set when `paths` is shorter than {@link pathCount}. */
|
|
127
|
+
readonly truncated?: true;
|
|
128
|
+
/** Roster groups both endpoints belong to (see {@link SharedRoster}). */
|
|
129
|
+
readonly sharedRosters: readonly SharedRoster[];
|
|
130
|
+
/** The hop limit actually applied to this walk. */
|
|
131
|
+
readonly hopLimit: number;
|
|
132
|
+
/** The fan-in above which an edge was refused as a roster. */
|
|
133
|
+
readonly rosterThreshold: number;
|
|
134
|
+
/** The packs the answering store was built from, as it records them. */
|
|
135
|
+
readonly packs: readonly string[];
|
|
136
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
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
|
+
|
|
33
|
+
import { BIN_NAME } from "../../constants.js";
|
|
34
|
+
import { distributionScopesTiers } from "../../kernel/distribution/registry.js";
|
|
35
|
+
import { PragmaError } from "../../kernel/error/index.js";
|
|
36
|
+
import { asVerb } from "../../kernel/spec/asVerb.js";
|
|
37
|
+
import type { VerbSpec } from "../../kernel/spec/index.js";
|
|
38
|
+
import { connectFormatters } from "./connect.render.js";
|
|
39
|
+
import type { ConnectResult } from "./connect.types.js";
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The hop limit in force unless `--hops` says otherwise.
|
|
43
|
+
*
|
|
44
|
+
* Four, from the measured connectivity ladder on the shipped pack: it is the
|
|
45
|
+
* smallest limit that spans the longest genuine bridge in this store — the walk
|
|
46
|
+
* from a platform variable through its declaration and its references to the
|
|
47
|
+
* symbol behind it — and the largest that keeps the answer set honest. At three
|
|
48
|
+
* that walk is refused; at six the connected fraction jumps and the paths stop
|
|
49
|
+
* being something a person can hold in mind.
|
|
50
|
+
*/
|
|
51
|
+
export const DEFAULT_HOPS = 4;
|
|
52
|
+
|
|
53
|
+
/** The ceiling `--hops` may be raised to; above it the verb refuses. */
|
|
54
|
+
export const MAX_HOPS = 6;
|
|
55
|
+
|
|
56
|
+
/** How many shortest paths are shown unless `--paths` says otherwise. */
|
|
57
|
+
export const DEFAULT_PATHS = 10;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Hold a numeric param to a whole number within its stated range.
|
|
61
|
+
*
|
|
62
|
+
* REFUSES rather than clamps. A clamped `--hops 40` would answer a question
|
|
63
|
+
* nobody asked and report a limit the caller did not set, which is precisely
|
|
64
|
+
* the hidden policy every answer's policy block exists to rule out.
|
|
65
|
+
*
|
|
66
|
+
* The kernel already coerces a `number` param and rejects what is not a number
|
|
67
|
+
* at all (`project/cli/dispatch.ts#coerceParam`, and `z.number()` over MCP), so
|
|
68
|
+
* what is left to check is RANGE and wholeness — `--hops 2.5` is a number, and
|
|
69
|
+
* it is not a hop count.
|
|
70
|
+
*
|
|
71
|
+
* @param value - The coerced param value.
|
|
72
|
+
* @param name - The flag's name, for the diagnostic.
|
|
73
|
+
* @param fallback - The value when the flag was not given.
|
|
74
|
+
* @param min - The smallest accepted value.
|
|
75
|
+
* @param max - The largest accepted value, if there is one.
|
|
76
|
+
* @returns The validated integer.
|
|
77
|
+
* @throws PragmaError INVALID_INPUT when the value is not an integer in range.
|
|
78
|
+
*/
|
|
79
|
+
function bounded(
|
|
80
|
+
value: unknown,
|
|
81
|
+
name: string,
|
|
82
|
+
fallback: number,
|
|
83
|
+
min: number,
|
|
84
|
+
max?: number,
|
|
85
|
+
): number {
|
|
86
|
+
if (value === undefined || value === null) return fallback;
|
|
87
|
+
const parsed = typeof value === "number" ? value : Number(value);
|
|
88
|
+
const ceiling = max === undefined ? "" : ` and at most ${max}`;
|
|
89
|
+
if (
|
|
90
|
+
!Number.isInteger(parsed) ||
|
|
91
|
+
parsed < min ||
|
|
92
|
+
(max !== undefined && parsed > max)
|
|
93
|
+
) {
|
|
94
|
+
throw PragmaError.invalidInput(name, String(value), {
|
|
95
|
+
recovery: {
|
|
96
|
+
message: `--${name} must be a whole number of at least ${min}${ceiling}.`,
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
return parsed;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const connectVerb: VerbSpec<Record<string, unknown>, ConnectResult> = {
|
|
104
|
+
path: ["graph", "connect"],
|
|
105
|
+
summary: "Show the shortest relation paths between two entities.",
|
|
106
|
+
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.`,
|
|
107
|
+
useWhen: "when asked whether and how two things are related",
|
|
108
|
+
example: { a: "owl:Class", b: "rdfs:Class" },
|
|
109
|
+
params: [
|
|
110
|
+
{
|
|
111
|
+
kind: "string",
|
|
112
|
+
name: "a",
|
|
113
|
+
doc: "The first endpoint — a prefixed name or absolute IRI.",
|
|
114
|
+
positional: true,
|
|
115
|
+
required: true,
|
|
116
|
+
complete: { kind: "names", source: { from: "index", type: "" } },
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
kind: "string",
|
|
120
|
+
name: "b",
|
|
121
|
+
doc: "The second endpoint — a prefixed name or absolute IRI.",
|
|
122
|
+
positional: true,
|
|
123
|
+
required: true,
|
|
124
|
+
complete: { kind: "names", source: { from: "index", type: "" } },
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
kind: "number",
|
|
128
|
+
name: "hops",
|
|
129
|
+
doc: `Largest path length to return (default ${DEFAULT_HOPS}, ceiling ${MAX_HOPS}).`,
|
|
130
|
+
default: DEFAULT_HOPS,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
kind: "number",
|
|
134
|
+
name: "paths",
|
|
135
|
+
doc: `Most shortest paths to show (default ${DEFAULT_PATHS}); the answer always reports the true total.`,
|
|
136
|
+
default: DEFAULT_PATHS,
|
|
137
|
+
},
|
|
138
|
+
],
|
|
139
|
+
output: { formatters: connectFormatters },
|
|
140
|
+
examples: [
|
|
141
|
+
{
|
|
142
|
+
cmd: `${BIN_NAME} graph connect owl:Class rdfs:Class`,
|
|
143
|
+
note: "two classes",
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
cmd: `${BIN_NAME} graph connect owl:Class rdfs:Class --format json`,
|
|
147
|
+
note: "the answer with the policy it was found under",
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
capability: {
|
|
151
|
+
needsStore: true,
|
|
152
|
+
mutates: false,
|
|
153
|
+
mcp: {
|
|
154
|
+
expose: true,
|
|
155
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
run: (params: Record<string, unknown>, rt) =>
|
|
159
|
+
import("./runConnect.js").then((m) =>
|
|
160
|
+
m.runConnect(rt, String(params.a), String(params.b), {
|
|
161
|
+
hops: bounded(params.hops, "hops", DEFAULT_HOPS, 1, MAX_HOPS),
|
|
162
|
+
paths: bounded(params.paths, "paths", DEFAULT_PATHS, 1),
|
|
163
|
+
}),
|
|
164
|
+
),
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/** The `graph connect` verb. */
|
|
168
|
+
export const graphConnectVerb = asVerb(connectVerb);
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
|
|
7
|
+
import type { CapabilityModule } from "../../kernel/spec/index.js";
|
|
8
|
+
import { resourceProvider } from "../resources/index.js";
|
|
9
|
+
import { graphConnectVerb } from "./connect.verb.js";
|
|
10
|
+
import { graphInspectVerb } from "./inspect.verb.js";
|
|
11
|
+
import { graphQueryVerb } from "./query.verb.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The `graph` capability module. Carries the MCP resource browser: `graph
|
|
15
|
+
* inspect` (CLI) and the resource read (MCP) share one entity reader, so the
|
|
16
|
+
* two projections stay in lockstep. Resources are NOT tools — the emitted tool
|
|
17
|
+
* surface (and the golden) is unaffected.
|
|
18
|
+
*/
|
|
19
|
+
export const graphModule: CapabilityModule = {
|
|
20
|
+
name: "graph",
|
|
21
|
+
verbs: [graphConnectVerb, graphInspectVerb, graphQueryVerb],
|
|
22
|
+
mcpResources: resourceProvider,
|
|
23
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
|
|
10
|
+
import { toTurtle } from "../../kernel/render/turtle.js";
|
|
11
|
+
import type {
|
|
12
|
+
InboundGroup,
|
|
13
|
+
InspectResult,
|
|
14
|
+
PredicateGroup,
|
|
15
|
+
ReadTerm,
|
|
16
|
+
} from "../../kernel/runtime/readEntity.js";
|
|
17
|
+
import type { Formatters } from "../../kernel/spec/index.js";
|
|
18
|
+
|
|
19
|
+
/** The short form of a term: prefixed when there is one, else the raw value. */
|
|
20
|
+
const short = (term: ReadTerm): string => term.prefixed ?? term.value;
|
|
21
|
+
|
|
22
|
+
/** A term as a reader should see it — short form, with its name when known. */
|
|
23
|
+
const named = (term: ReadTerm): string =>
|
|
24
|
+
term.title ? `${short(term)} (${term.title})` : short(term);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* `predicate (330, sample of 5)` — the count is the truth, the list is not.
|
|
28
|
+
*
|
|
29
|
+
* A roster and a truncated relation read differently on purpose: "sample of"
|
|
30
|
+
* tells a reader that paging will not produce the rest and the noun's list verb
|
|
31
|
+
* is where the full set lives, where "showing" invites them to ask for more.
|
|
32
|
+
*/
|
|
33
|
+
function inboundHeading(group: InboundGroup): string {
|
|
34
|
+
if (group.sampled) {
|
|
35
|
+
return `${short(group.predicate)} (${group.count}, sample of ${group.subjects.length})`;
|
|
36
|
+
}
|
|
37
|
+
const suffix = group.truncated
|
|
38
|
+
? `${group.count}, showing ${group.subjects.length}`
|
|
39
|
+
: `${group.count}`;
|
|
40
|
+
return `${short(group.predicate)} (${suffix})`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** `predicate (24 objects, showing 10)` — a cut group says what it was cut from. */
|
|
44
|
+
function outboundHeading(group: PredicateGroup): string {
|
|
45
|
+
return group.truncated
|
|
46
|
+
? `${short(group.predicate)} (${group.count} objects, showing ${group.objects.length})`
|
|
47
|
+
: short(group.predicate);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export const inspectFormatters: Formatters<InspectResult> = {
|
|
51
|
+
plain(data) {
|
|
52
|
+
const title = data.label
|
|
53
|
+
? `${short({ termType: "NamedNode", value: data.uri, ...(data.prefixed ? { prefixed: data.prefixed } : {}) })} — ${data.label}`
|
|
54
|
+
: (data.prefixed ?? data.uri);
|
|
55
|
+
const lines = [title, "═".repeat(Math.max(title.length, 24)), ""];
|
|
56
|
+
for (const group of data.groups) {
|
|
57
|
+
lines.push(` ${outboundHeading(group)}:`);
|
|
58
|
+
for (const object of group.objects) lines.push(` ${named(object)}`);
|
|
59
|
+
}
|
|
60
|
+
for (const [via, rows] of Object.entries(data.nested)) {
|
|
61
|
+
lines.push("", ` ${via}:`);
|
|
62
|
+
for (const row of rows) {
|
|
63
|
+
// Values are TERMS; `String(term)` rendered every nested field as
|
|
64
|
+
// `[object Object]`, which made the whole plain-format record unreadable.
|
|
65
|
+
const fields = Object.entries(row)
|
|
66
|
+
.map(([key, value]) => `${key}=${named(value)}`)
|
|
67
|
+
.join(" ");
|
|
68
|
+
lines.push(` ${fields}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (data.inbound.length > 0) {
|
|
72
|
+
lines.push("", " Referenced by:");
|
|
73
|
+
for (const group of data.inbound) {
|
|
74
|
+
lines.push(` ${inboundHeading(group)}`);
|
|
75
|
+
for (const subject of group.subjects) {
|
|
76
|
+
lines.push(` ${named(subject)}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return lines.join("\n").trimEnd();
|
|
81
|
+
},
|
|
82
|
+
/**
|
|
83
|
+
* The agent-facing format IS Turtle — same bytes the `pragma:{+uri}` resource
|
|
84
|
+
* read serves, which is what keeps the mirror contract meaningful now that the
|
|
85
|
+
* two are no longer both JSON. Measured on one button: 15.8 KB of JSON against
|
|
86
|
+
* 4.5 KB of Turtle for the same neighbourhood.
|
|
87
|
+
*
|
|
88
|
+
* `prefixes` comes from the reader, not from this formatter: it compacted the
|
|
89
|
+
* terms against the store's own merged map, so re-deriving a map here could
|
|
90
|
+
* only disagree with the names already in the payload.
|
|
91
|
+
*/
|
|
92
|
+
llm: (data) => toTurtle(data, data.prefixes),
|
|
93
|
+
json: (data) => JSON.stringify(data, null, 2),
|
|
94
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
|
|
11
|
+
import {
|
|
12
|
+
BIN_NAME,
|
|
13
|
+
DEFAULT_DETAIL_LEVEL,
|
|
14
|
+
DETAIL_LEVELS,
|
|
15
|
+
} from "../../constants.js";
|
|
16
|
+
import type { PragmaRuntime } from "../../kernel/runtime/index.js";
|
|
17
|
+
import type { InspectResult } from "../../kernel/runtime/readEntity.js";
|
|
18
|
+
import { readEntity } from "../../kernel/runtime/readEntity.js";
|
|
19
|
+
import { asVerb } from "../../kernel/spec/asVerb.js";
|
|
20
|
+
import type { VerbSpec } from "../../kernel/spec/index.js";
|
|
21
|
+
import { inspectFormatters } from "./inspect.render.js";
|
|
22
|
+
|
|
23
|
+
const inspectVerb: VerbSpec<Record<string, unknown>, InspectResult> = {
|
|
24
|
+
path: ["graph", "inspect"],
|
|
25
|
+
summary:
|
|
26
|
+
"Show every triple where a URI is the subject, grouped by predicate.",
|
|
27
|
+
doc: "Inspect one entity: all predicate/object pairs asserted on the subject. Address it by prefixed name (owl:Class) or absolute IRI.",
|
|
28
|
+
useWhen: "when asked for everything recorded about one identifier",
|
|
29
|
+
example: { uri: "owl:Class" },
|
|
30
|
+
params: [
|
|
31
|
+
{
|
|
32
|
+
kind: "string",
|
|
33
|
+
name: "uri",
|
|
34
|
+
doc: "The subject URI — a prefixed name or absolute IRI.",
|
|
35
|
+
positional: true,
|
|
36
|
+
required: true,
|
|
37
|
+
complete: { kind: "names", source: { from: "index", type: "" } },
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
output: { formatters: inspectFormatters },
|
|
41
|
+
// The read is BOUNDED by disclosure — inbound exemplars and literal previews
|
|
42
|
+
// both widen with the level — so the verb must declare the ladder it honours.
|
|
43
|
+
// Without this the CLI `--detail` flag has nothing to validate against and the
|
|
44
|
+
// MCP projector injects no `detail` argument at all, so the documented knob
|
|
45
|
+
// was one an agent could not actually reach.
|
|
46
|
+
disclosure: { levels: [...DETAIL_LEVELS], default: DEFAULT_DETAIL_LEVEL },
|
|
47
|
+
examples: [
|
|
48
|
+
{ cmd: `${BIN_NAME} graph inspect owl:Class` },
|
|
49
|
+
{
|
|
50
|
+
cmd: `${BIN_NAME} graph inspect http://www.w3.org/2002/07/owl#Class`,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
capability: {
|
|
54
|
+
needsStore: true,
|
|
55
|
+
mutates: false,
|
|
56
|
+
mcp: {
|
|
57
|
+
expose: true,
|
|
58
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
run: (params: Record<string, unknown>, rt: PragmaRuntime) =>
|
|
62
|
+
readEntity(rt, String(params.uri)),
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/** The `graph inspect` verb. */
|
|
66
|
+
export const graphInspectVerb = asVerb(inspectVerb);
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatters for `pragma graph query` — plain, llm, json (no ink).
|
|
3
|
+
*
|
|
4
|
+
* Ported verbatim from the old shell's `graph/formatters/query.ts`:
|
|
5
|
+
* - plain: a tab-separated table for SELECT, `ASK: true/false`, readable triple
|
|
6
|
+
* lines for CONSTRUCT.
|
|
7
|
+
* - llm: condensed Markdown (a table for SELECT, one line for ASK, a triple list
|
|
8
|
+
* for CONSTRUCT).
|
|
9
|
+
* - json: the serialized {@link QueryResult}.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { quoteCall } from "../../kernel/spec/call.js";
|
|
13
|
+
import type { Call, Formatters, Surface } from "../../kernel/spec/index.js";
|
|
14
|
+
|
|
15
|
+
// Inline `import("…")` type (no `from`) — keeps the ke types off the static
|
|
16
|
+
// import graph the lazy-dispatch probe walks (see query.verb.ts).
|
|
17
|
+
type QueryAnswer = import("./runQuery.js").QueryAnswer;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Render CONSTRUCT triples as readable `subject\tpredicate\tobject` lines,
|
|
21
|
+
* collapsing any newlines in literal objects so each triple stays on one line.
|
|
22
|
+
*/
|
|
23
|
+
function formatTriples(
|
|
24
|
+
triples: ReadonlyArray<{
|
|
25
|
+
subject: string;
|
|
26
|
+
predicate: string;
|
|
27
|
+
object: string;
|
|
28
|
+
}>,
|
|
29
|
+
): string {
|
|
30
|
+
if (triples.length === 0) return "No triples.";
|
|
31
|
+
return triples
|
|
32
|
+
.map((t) => {
|
|
33
|
+
const object = t.object.replace(/\s*\n\s*/g, " ").trim();
|
|
34
|
+
return `${t.subject}\t${t.predicate}\t${object}`;
|
|
35
|
+
})
|
|
36
|
+
.join("\n");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Where an empty SELECT points. Deliberately no domain tool: which one answers
|
|
41
|
+
* the caller's question is the catalogue's to say, so the pointer is to the
|
|
42
|
+
* catalogue — and to the namespaces that exist, since an invented prefix parses
|
|
43
|
+
* and matches nothing.
|
|
44
|
+
*/
|
|
45
|
+
export const EMPTY_QUERY_CALLS = {
|
|
46
|
+
catalogue: { verb: "capabilities" },
|
|
47
|
+
namespaces: { verb: "ontology list" },
|
|
48
|
+
} as const satisfies Record<string, Call>;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* What zero rows says for itself. "No results." read as a failed tool to an
|
|
52
|
+
* agent with nowhere to go next. The query RAN; when its own text declares a
|
|
53
|
+
* prefix this graph does not have, that is the reason and it is said exactly.
|
|
54
|
+
*/
|
|
55
|
+
function describeEmptySelect(result: QueryAnswer, surface: Surface): string {
|
|
56
|
+
const { catalogue, namespaces } = EMPTY_QUERY_CALLS;
|
|
57
|
+
const invented = (result.unknownPrefixes ?? [])
|
|
58
|
+
.map(
|
|
59
|
+
({ prefix, iri }) =>
|
|
60
|
+
`Prefix \`${prefix}:\` <${iri}> is not a namespace of this graph, so nothing under it can match.`,
|
|
61
|
+
)
|
|
62
|
+
.join(" ");
|
|
63
|
+
return [
|
|
64
|
+
"No results: the query ran and matched nothing.",
|
|
65
|
+
invented,
|
|
66
|
+
`The namespaces that exist are listed by ${quoteCall(namespaces, surface)} (an invented prefix matches nothing). A domain tool may answer this without SPARQL: ${quoteCall(catalogue, surface)} lists the tools by the question each answers.`,
|
|
67
|
+
]
|
|
68
|
+
.filter(Boolean)
|
|
69
|
+
.join(" ");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const queryFormatters: Formatters<QueryAnswer> = {
|
|
73
|
+
// Zero rows/triples: plain stdout stays empty — the notice is
|
|
74
|
+
// `notice`, routed to stderr (exit 0) by the dispatcher so a pipe
|
|
75
|
+
// reads no prose. ASK always has a result and never goes empty.
|
|
76
|
+
notice(result, surface = "cli") {
|
|
77
|
+
if (result.type === "select" && result.bindings.length === 0) {
|
|
78
|
+
return describeEmptySelect(result, surface);
|
|
79
|
+
}
|
|
80
|
+
if (result.type === "construct" && result.triples.length === 0) {
|
|
81
|
+
return "No triples.";
|
|
82
|
+
}
|
|
83
|
+
return undefined;
|
|
84
|
+
},
|
|
85
|
+
plain(result) {
|
|
86
|
+
if (result.type === "select") {
|
|
87
|
+
if (result.bindings.length === 0) return "";
|
|
88
|
+
const cols = Object.keys(result.bindings[0] ?? {});
|
|
89
|
+
const rows = result.bindings.map((b) =>
|
|
90
|
+
cols.map((c) => b[c] ?? "").join("\t"),
|
|
91
|
+
);
|
|
92
|
+
return [cols.join("\t"), ...rows].join("\n");
|
|
93
|
+
}
|
|
94
|
+
if (result.type === "ask") {
|
|
95
|
+
return `ASK: ${String(result.result)}`;
|
|
96
|
+
}
|
|
97
|
+
return result.triples.length === 0 ? "" : formatTriples(result.triples);
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
llm(result) {
|
|
101
|
+
if (result.type === "select") {
|
|
102
|
+
if (result.bindings.length === 0) {
|
|
103
|
+
return describeEmptySelect(result, "cli");
|
|
104
|
+
}
|
|
105
|
+
const cols = Object.keys(result.bindings[0] ?? {});
|
|
106
|
+
const header = `| ${cols.join(" | ")} |`;
|
|
107
|
+
const divider = `| ${cols.map(() => "---").join(" | ")} |`;
|
|
108
|
+
const rows = result.bindings.map(
|
|
109
|
+
(b) => `| ${cols.map((c) => b[c] ?? "").join(" | ")} |`,
|
|
110
|
+
);
|
|
111
|
+
return [header, divider, ...rows].join("\n");
|
|
112
|
+
}
|
|
113
|
+
if (result.type === "ask") {
|
|
114
|
+
return `**ASK** → ${String(result.result)}`;
|
|
115
|
+
}
|
|
116
|
+
return formatTriples(result.triples)
|
|
117
|
+
.split("\n")
|
|
118
|
+
.map((line) => (line.includes("\t") ? `- ${line}` : line))
|
|
119
|
+
.join("\n");
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
json(result) {
|
|
123
|
+
// The payload is the engine's own shape; the prefix finding is the notice's.
|
|
124
|
+
const { unknownPrefixes: _unknownPrefixes, ...data } = result;
|
|
125
|
+
return JSON.stringify(data);
|
|
126
|
+
},
|
|
127
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `graph query <sparql>` — the raw SPARQL escape hatch (the twin of `graph
|
|
3
|
+
* inspect`'s single-entity read). Store-backed and read-only: the dispatcher
|
|
4
|
+
* boots the store before `run`, and `rt.query.sparql` auto-prefixes the query
|
|
5
|
+
* from the pack's prefix map, so `ds:Component` resolves without a PREFIX line.
|
|
6
|
+
*
|
|
7
|
+
* Injection-safe by construction: the whole query IS the user's text — there is
|
|
8
|
+
* no interpolation into a template — so there is nothing to escape. A malformed
|
|
9
|
+
* query surfaces as INVALID_INPUT with a recovery pointer to `ontology list`.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { BIN_NAME } from "../../constants.js";
|
|
13
|
+
import type { PragmaRuntime } from "../../kernel/runtime/index.js";
|
|
14
|
+
import { asVerb } from "../../kernel/spec/asVerb.js";
|
|
15
|
+
import type { VerbSpec } from "../../kernel/spec/index.js";
|
|
16
|
+
import { queryFormatters } from "./query.render.js";
|
|
17
|
+
|
|
18
|
+
// Inline `import("…")` type (no `from`) so the ke types stay OFF the static
|
|
19
|
+
// graph — the lazy-dispatch probe forbids a static ke import on any file
|
|
20
|
+
// reachable from capabilities/index, keeping the WASM runtime off the fast path.
|
|
21
|
+
type QueryResult = import("@canonical/ke").QueryResult;
|
|
22
|
+
|
|
23
|
+
const queryVerb: VerbSpec<Record<string, unknown>, QueryResult> = {
|
|
24
|
+
path: ["graph", "query"],
|
|
25
|
+
summary: "Run a raw SPARQL query against the loaded graph.",
|
|
26
|
+
doc: "Executes an arbitrary SPARQL query (SELECT / ASK / CONSTRUCT) against the store. Prefixes are applied automatically from the pack's namespace map; list the ontology namespaces to discover the available prefixes.",
|
|
27
|
+
useWhen: "only when no other tool answers: SPARQL joins or counts",
|
|
28
|
+
example: { sparql: "SELECT ?s WHERE { ?s a owl:Class } LIMIT 5" },
|
|
29
|
+
params: [
|
|
30
|
+
{
|
|
31
|
+
kind: "string",
|
|
32
|
+
name: "sparql",
|
|
33
|
+
doc: "The SPARQL query text (SELECT, ASK, or CONSTRUCT).",
|
|
34
|
+
positional: true,
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
output: { formatters: queryFormatters },
|
|
39
|
+
examples: [
|
|
40
|
+
{
|
|
41
|
+
cmd: `${BIN_NAME} graph query "SELECT ?s WHERE { ?s a owl:Class }"`,
|
|
42
|
+
note: "list every class",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
cmd: `${BIN_NAME} graph query "ASK { ?s a owl:Class }" --format json`,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
capability: {
|
|
49
|
+
needsStore: true,
|
|
50
|
+
mutates: false,
|
|
51
|
+
mcp: {
|
|
52
|
+
expose: true,
|
|
53
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
run: (params: Record<string, unknown>, rt: PragmaRuntime) =>
|
|
57
|
+
import("./runQuery.js").then((m) => m.runQuery(rt, String(params.sparql))),
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** The `graph query` verb. */
|
|
61
|
+
export const graphQueryVerb = asVerb(queryVerb);
|