@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,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatters for the `prompt` content noun — plain, llm, json.
|
|
3
|
+
*/
|
|
4
|
+
import { defaultStyle } from "../../kernel/render/style.js";
|
|
5
|
+
/** Render an argument list as `name (required)` / `name` tokens. */
|
|
6
|
+
function argTokens(args) {
|
|
7
|
+
if (args.length === 0)
|
|
8
|
+
return "(none)";
|
|
9
|
+
return args
|
|
10
|
+
.map((arg) => (arg.required ? `${arg.name} (required)` : arg.name))
|
|
11
|
+
.join(", ");
|
|
12
|
+
}
|
|
13
|
+
export const promptListFormatters = {
|
|
14
|
+
// Zero prompts: plain stdout stays empty — the notice is `notice`,
|
|
15
|
+
// routed to stderr (exit 0) by the dispatcher so a pipe reads no prose.
|
|
16
|
+
notice: (data) => data.prompts.length === 0 ? "No prompts in the store." : undefined,
|
|
17
|
+
plain(data) {
|
|
18
|
+
if (data.prompts.length === 0)
|
|
19
|
+
return "";
|
|
20
|
+
const lines = ["Prompts"];
|
|
21
|
+
for (const prompt of data.prompts) {
|
|
22
|
+
lines.push(` ${prompt.name} — ${prompt.description ?? ""}`.trimEnd());
|
|
23
|
+
lines.push(` args: ${argTokens(prompt.arguments)}`);
|
|
24
|
+
}
|
|
25
|
+
return lines.join("\n");
|
|
26
|
+
},
|
|
27
|
+
llm(data) {
|
|
28
|
+
if (data.prompts.length === 0)
|
|
29
|
+
return "_No prompts in the store._";
|
|
30
|
+
// H2 for a content read — consistent with the shared list renderer (B2).
|
|
31
|
+
const lines = ["## Prompts"];
|
|
32
|
+
for (const prompt of data.prompts) {
|
|
33
|
+
lines.push(`- \`${prompt.name}\` — ${prompt.description ?? ""}`.trimEnd());
|
|
34
|
+
lines.push(` - args: ${argTokens(prompt.arguments)}`);
|
|
35
|
+
}
|
|
36
|
+
return lines.join("\n");
|
|
37
|
+
},
|
|
38
|
+
json(data) {
|
|
39
|
+
return JSON.stringify(data);
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
export const promptLookupFormatters = {
|
|
43
|
+
plain(data) {
|
|
44
|
+
// Full delegation to `renderLookupPlain` is infeasible: the description line
|
|
45
|
+
// carries no field label and the template body is appended raw, whereas the
|
|
46
|
+
// shared renderer only emits `label: value` fields + indented sections. So
|
|
47
|
+
// route the TITLE + rule + field label through the SAME style seam it uses
|
|
48
|
+
// (bold title, dim rule, cyan label) — closing the TTY drift where a prompt
|
|
49
|
+
// title stayed unstyled — and keep the bespoke body inline. Off a TTY the
|
|
50
|
+
// styler is inert, so piped output stays byte-stable (B7).
|
|
51
|
+
const style = defaultStyle();
|
|
52
|
+
const rule = "═".repeat(Math.max(data.name.length, 24));
|
|
53
|
+
const lines = [style.bold(data.name), style.dim(rule), ""];
|
|
54
|
+
if (data.description)
|
|
55
|
+
lines.push(` ${data.description}`);
|
|
56
|
+
lines.push(` ${style.cyan("args")}: ${argTokens(data.arguments)}`, "", data.body);
|
|
57
|
+
return lines.join("\n");
|
|
58
|
+
},
|
|
59
|
+
llm(data) {
|
|
60
|
+
// H2 entity title with H3 sub-sections — the hierarchy the shared
|
|
61
|
+
// `renderLookupLlm` uses (`## title` / `### section`) (B2).
|
|
62
|
+
const lines = [`## ${data.name}`];
|
|
63
|
+
if (data.description)
|
|
64
|
+
lines.push(data.description);
|
|
65
|
+
if (data.arguments.length > 0) {
|
|
66
|
+
lines.push("", "### Arguments");
|
|
67
|
+
for (const arg of data.arguments) {
|
|
68
|
+
lines.push(`- \`${arg.name}\`${arg.required ? " (required)" : ""}${arg.description ? ` — ${arg.description}` : ""}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
lines.push("", "### Template", data.body);
|
|
72
|
+
return lines.join("\n");
|
|
73
|
+
},
|
|
74
|
+
json(data) {
|
|
75
|
+
return JSON.stringify(data);
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=prompt.render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.render.js","sourceRoot":"","sources":["../../../../src/capabilities/prompt/prompt.render.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data shapes for the `prompt` content noun (`prompt_list`/`prompt_lookup`).
|
|
3
|
+
*
|
|
4
|
+
* Both project the SAME `ds:Prompt` entities the native MCP `prompts/*` surface
|
|
5
|
+
* reads (via the shared `kernel/project/mcp/prompts/source.ts`), so the tool and
|
|
6
|
+
* the native prompt can never disagree. `list` returns summaries (no body);
|
|
7
|
+
* `lookup` returns the full entry (body + arguments).
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/capabilities/prompt/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `prompt list` and `prompt lookup <name>` — the covenant `prompt` content noun.
|
|
3
|
+
*
|
|
4
|
+
* Bespoke (not compilePack): the covenant freezes `prompt_lookup` with a SINGLE
|
|
5
|
+
* `<name>` positional, whereas a pack lookup always emits the variadic
|
|
6
|
+
* `<name...>`. Both are `needsStore` (per covenant) and read the SAME
|
|
7
|
+
* `ds:Prompt` source the native `prompts/*` provider uses, so the tool surface
|
|
8
|
+
* and the native prompt surface are ONE data source, two projections.
|
|
9
|
+
*
|
|
10
|
+
* Run bodies dynamic-import the store-backed source, keeping the store code off
|
|
11
|
+
* the `--help`/`__complete` fast path (the module barrel loads only specs +
|
|
12
|
+
* formatters).
|
|
13
|
+
*/
|
|
14
|
+
import { BIN_NAME } from "../../constants.js";
|
|
15
|
+
import { callRecovery, PragmaError } from "../../kernel/error/index.js";
|
|
16
|
+
import { VOCABULARY } from "../../kernel/index.js";
|
|
17
|
+
import { asVerb } from "../../kernel/spec/asVerb.js";
|
|
18
|
+
import { promptListFormatters, promptLookupFormatters, } from "./prompt.render.js";
|
|
19
|
+
const READ_CAPABILITY = {
|
|
20
|
+
needsStore: true,
|
|
21
|
+
mutates: false,
|
|
22
|
+
mcp: {
|
|
23
|
+
expose: true,
|
|
24
|
+
annotations: { readOnlyHint: true, openWorldHint: false },
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
const listVerb = {
|
|
28
|
+
path: ["prompt", "list"],
|
|
29
|
+
summary: "List the workflow prompt templates the graph offers.",
|
|
30
|
+
doc: `Browse the prompt entities the active graph declares${VOCABULARY === undefined
|
|
31
|
+
? ""
|
|
32
|
+
: ` (${VOCABULARY.prompt.type} in this distribution)`} — name, description, and argument names. The same prompts are offered natively over MCP prompts/list; use prompt_lookup for the full template body.`,
|
|
33
|
+
useWhen: "when asked which ready-made workflow prompts the graph offers",
|
|
34
|
+
params: [],
|
|
35
|
+
output: { formatters: promptListFormatters },
|
|
36
|
+
examples: [{ cmd: `${BIN_NAME} prompt list` }],
|
|
37
|
+
capability: READ_CAPABILITY,
|
|
38
|
+
run: (_params, rt) => import("../../kernel/project/mcp/prompts/source.js").then(async (m) => {
|
|
39
|
+
const prompts = await m.readPrompts(rt);
|
|
40
|
+
return {
|
|
41
|
+
prompts: prompts.map((prompt) => ({
|
|
42
|
+
name: prompt.name,
|
|
43
|
+
...(prompt.description ? { description: prompt.description } : {}),
|
|
44
|
+
arguments: prompt.arguments,
|
|
45
|
+
})),
|
|
46
|
+
};
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
const lookupVerb = {
|
|
50
|
+
path: ["prompt", "lookup"],
|
|
51
|
+
summary: "Show one workflow prompt template's body and arguments by name.",
|
|
52
|
+
doc: "Fetch a single prompt entity's full template body (with {{arg}} placeholders) and its declared arguments. A prompt is addressed by its label; prompt_list names the ones the active graph carries.",
|
|
53
|
+
useWhen: "when asked to read or run one workflow prompt by the name prompt_list gave",
|
|
54
|
+
example: { name: "onboarding" },
|
|
55
|
+
params: [
|
|
56
|
+
{
|
|
57
|
+
kind: "string",
|
|
58
|
+
name: "name",
|
|
59
|
+
doc: "The prompt name, as `prompt list` reports it.",
|
|
60
|
+
positional: true,
|
|
61
|
+
required: true,
|
|
62
|
+
// A prompt is addressed by its `rdfs:label`, which the index carries as
|
|
63
|
+
// `label`, and the index reader offers no substitute for a prompt that
|
|
64
|
+
// carries none. Not a total guarantee: `label` is the first of several
|
|
65
|
+
// label predicates the index accepts, so an entity labelled ONLY by
|
|
66
|
+
// `skos:prefLabel` would still complete without resolving. That gap is
|
|
67
|
+
// the index's label preference order, not this ref.
|
|
68
|
+
...(VOCABULARY === undefined
|
|
69
|
+
? {}
|
|
70
|
+
: {
|
|
71
|
+
complete: {
|
|
72
|
+
kind: "names",
|
|
73
|
+
source: {
|
|
74
|
+
from: "index",
|
|
75
|
+
type: VOCABULARY.prompt.type,
|
|
76
|
+
field: "label",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
}),
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
output: { formatters: promptLookupFormatters },
|
|
83
|
+
// No example command: this distribution's graph declares no prompt, so any
|
|
84
|
+
// name quoted here exits 1 with ENTITY_NOT_FOUND — and this is the GENERATED
|
|
85
|
+
// reference, published as machine-derived truth.
|
|
86
|
+
examples: [],
|
|
87
|
+
capability: READ_CAPABILITY,
|
|
88
|
+
run: (params, rt) => import("../../kernel/project/mcp/prompts/source.js").then(async (m) => {
|
|
89
|
+
const name = String(params.name);
|
|
90
|
+
const entry = await m.readPrompt(rt, name);
|
|
91
|
+
if (!entry) {
|
|
92
|
+
const available = await m.readPrompts(rt);
|
|
93
|
+
throw PragmaError.notFound("prompt", name, {
|
|
94
|
+
suggestions: available.map((prompt) => prompt.name),
|
|
95
|
+
recovery: callRecovery({ verb: "prompt list" }, "List available prompts."),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return entry;
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
/** The `prompt` content verbs (`list`, `lookup`). */
|
|
102
|
+
export const promptListVerb = asVerb(listVerb);
|
|
103
|
+
export const promptLookupVerb = asVerb(lookupVerb);
|
|
104
|
+
//# sourceMappingURL=verbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verbs.js","sourceRoot":"","sources":["../../../../src/capabilities/prompt/verbs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC;AAG5B,MAAM,eAAe,GAAG;IACtB,UAAU,EAAE,IAAI;IAChB,OAAO,EAAE,KAAK;IACd,GAAG,EAAE;QACH,MAAM,EAAE,IAAa;QACrB,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;KAC1D;CACF,CAAC;AAEF,MAAM,QAAQ,GAAsD;IAClE,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,sDAAsD;IAC/D,GAAG,EAAE,uDACH,UAAU,KAAK,SAAS;QACtB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,KAAK,UAAU,CAAC,MAAM,CAAC,IAAI,wBACjC,sJAAsJ;IACtJ,OAAO,EAAE,+DAA+D;IACxE,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE,UAAU,EAAE,oBAAoB,EAAE;IAC5C,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,QAAQ,cAAc,EAAE,CAAC;IAC9C,UAAU,EAAE,eAAe;IAC3B,GAAG,EAAE,CAAC,OAAgC,EAAE,EAAiB,EAAE,EAAE,CAC3D,MAAM,CAAC,4CAA4C,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QACpE,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACxC,OAAO;YACL,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBAChC,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAClE,SAAS,EAAE,MAAM,CAAC,SAAS;aAC5B,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC,CAAC;CACL,CAAC;AAEF,MAAM,UAAU,GAAwD;IACtE,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC1B,OAAO,EAAE,iEAAiE;IAC1E,GAAG,EAAE,oMAAoM;IACzM,OAAO,EACL,4EAA4E;IAC9E,OAAO,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;IAC/B,MAAM,EAAE;QACN;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM;YACZ,GAAG,EAAE,+CAA+C;YACpD,UAAU,EAAE,IAAI;YAChB,QAAQ,EAAE,IAAI;YACd,wEAAwE;YACxE,uEAAuE;YACvE,uEAAuE;YACvE,oEAAoE;YACpE,uEAAuE;YACvE,oDAAoD;YACpD,GAAG,CAAC,UAAU,KAAK,SAAS;gBAC1B,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC;oBACE,QAAQ,EAAE;wBACR,IAAI,EAAE,OAAgB;wBACtB,MAAM,EAAE;4BACN,IAAI,EAAE,OAAgB;4BACtB,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;4BAC5B,KAAK,EAAE,OAAO;yBACf;qBACF;iBACF,CAAC;SACP;KACF;IACD,MAAM,EAAE,EAAE,UAAU,EAAE,sBAAsB,EAAE;IAC9C,2EAA2E;IAC3E,6EAA6E;IAC7E,iDAAiD;IACjD,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,eAAe;IAC3B,GAAG,EAAE,CAAC,MAA+B,EAAE,EAAiB,EAAE,EAAE,CAC1D,MAAM,CAAC,4CAA4C,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;QACpE,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAC1C,MAAM,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE;gBACzC,WAAW,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;gBACnD,QAAQ,EAAE,YAAY,CACpB,EAAE,IAAI,EAAE,aAAa,EAAE,EACvB,yBAAyB,CAC1B;aACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;CACL,CAAC;AAEF,qDAAqD;AACrD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The MCP resource browser barrel.
|
|
3
|
+
*
|
|
4
|
+
* The `graph-entity` resource surface is a MODULE hook (not a tool), attached to
|
|
5
|
+
* the `graph` capability — `graph inspect` (CLI) and the resource read (MCP)
|
|
6
|
+
* share one entity reader. Exposed here so `graph/index` can hang it off its
|
|
7
|
+
* module and the resources suite can exercise list/complete/read directly.
|
|
8
|
+
*/
|
|
9
|
+
export { buildResourceList, rankUriCompletions, resourceProvider, } from "./provider.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/capabilities/resources/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,iBAAiB,EAEjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The MCP resource browser — a `<name>:{+uri}` template over the pack index,
|
|
3
|
+
* under the distribution's own name (`pragma:{+uri}` for pragma).
|
|
4
|
+
*
|
|
5
|
+
* Listing and autocomplete are STORELESS: they read the enriched `index.json`
|
|
6
|
+
* (readPackIndex) off disk, so the resource surface costs nothing until an agent
|
|
7
|
+
* reads one. They read it for the pack the BOOT DECISION names, so the listing
|
|
8
|
+
* can never advertise entities whose reads then fail STORE_UNAVAILABLE. A read
|
|
9
|
+
* is STORE-BACKED through the SHARED {@link readEntity} — the same reader
|
|
10
|
+
* `graph inspect` uses — so a resource read and a `graph inspect` of the same
|
|
11
|
+
* URI return identical content (the mirror contract).
|
|
12
|
+
*
|
|
13
|
+
* The listing is CURATED, not paged. MCP has a `cursor`/`nextCursor` contract
|
|
14
|
+
* for `resources/list`, but the SDK's high-level `McpServer` list handler
|
|
15
|
+
* ignores `request.params.cursor` and never returns a `nextCursor` (verified on
|
|
16
|
+
* the wire against 1.27.1), so "list everything, the client will page it" means
|
|
17
|
+
* "send everything, every connect". Listing all 712 indexed entities cost an
|
|
18
|
+
* agent ~155 KB of context before it had asked a single question. So a module
|
|
19
|
+
* DECLARES the slices of the index it contributes ({@link McpListable}) and the
|
|
20
|
+
* listing is their union: the collections, plus the schema that describes them.
|
|
21
|
+
* The individuals stay fully reachable — by the `{+uri}` template, whose
|
|
22
|
+
* autocomplete still offers every one of them.
|
|
23
|
+
*
|
|
24
|
+
* Degradation (Risk4): on a missing or legacy (pre-v2) index the listing returns
|
|
25
|
+
* a single "run `pragma sources update`" hint — never a live re-index of the
|
|
26
|
+
* store on the resource path. That hint is itself READABLE (it is the only
|
|
27
|
+
* resource a cold server advertises, and an advertised resource that refuses to
|
|
28
|
+
* be read is worse than no resource at all).
|
|
29
|
+
*
|
|
30
|
+
* The MCP SDK's `ResourceTemplate` is dynamic-imported inside `register` so this
|
|
31
|
+
* module — reachable on the capabilities import graph — never pulls the SDK onto
|
|
32
|
+
* the `--help`/`__complete` fast path.
|
|
33
|
+
*/
|
|
34
|
+
import { BIN_NAME } from "../../constants.js";
|
|
35
|
+
import { matchesType, readPackIndex, } from "../../kernel/completion/entitySource.js";
|
|
36
|
+
import { installedDistribution } from "../../kernel/distribution/registry.js";
|
|
37
|
+
import { asPragmaError } from "../../kernel/error/fromTaskError.js";
|
|
38
|
+
import { PragmaError } from "../../kernel/error/index.js";
|
|
39
|
+
import { mcpErrorFrom } from "../../kernel/project/mcp/mcpError.js";
|
|
40
|
+
import { toTurtle } from "../../kernel/render/turtle.js";
|
|
41
|
+
import { readEntity } from "../../kernel/runtime/readEntity.js";
|
|
42
|
+
import { resolveSources } from "../../kernel/runtime/resolveSources.js";
|
|
43
|
+
import { renderNextStep } from "../../kernel/spec/call.js";
|
|
44
|
+
import { BUILD_STORE_CALL } from "../shared/calls.js";
|
|
45
|
+
/**
|
|
46
|
+
* The weight an unweighted slice carries — "as important as any other".
|
|
47
|
+
*
|
|
48
|
+
* The ONLY editorial number left in this module. The judgements that used to
|
|
49
|
+
* live here as `CLASS_PRIORITY = 0.9` / `INDIVIDUAL_PRIORITY = 0.3` are now
|
|
50
|
+
* declared data (`McpListableRef.weight`, derived from `PackLookup.weights`):
|
|
51
|
+
* which of a distribution's classes deserves an agent's attention first is a
|
|
52
|
+
* fact about that distribution's graph, not about the kernel that serves it.
|
|
53
|
+
*/
|
|
54
|
+
const DEFAULT_WEIGHT = 1;
|
|
55
|
+
/**
|
|
56
|
+
* The URI scheme every resource is addressed under: the distribution's name.
|
|
57
|
+
*
|
|
58
|
+
* ONE value for the template, every URI the listing mints, the reserved
|
|
59
|
+
* sources entry and the `_meta` keys, so they can never disagree — deriving
|
|
60
|
+
* only the template once made a fork advertise `recipes:{+uri}` over a list of
|
|
61
|
+
* `pragma:` URIs it could not read. Clients persist resource URIs, so a
|
|
62
|
+
* distribution keeps its name to keep them readable.
|
|
63
|
+
*/
|
|
64
|
+
const SCHEME = BIN_NAME;
|
|
65
|
+
/** The reserved listing entry that explains an unusable store. */
|
|
66
|
+
const SOURCES_URI = `${SCHEME}:sources`;
|
|
67
|
+
/** The `{+uri}` variable value that addresses {@link SOURCES_URI}. */
|
|
68
|
+
const SOURCES_VARIABLE = "sources";
|
|
69
|
+
/**
|
|
70
|
+
* The media type an entity read RETURNS — and therefore the one the listing
|
|
71
|
+
* ADVERTISES for every entry it mints.
|
|
72
|
+
*
|
|
73
|
+
* One constant, three readers (the template registration, the read body, and
|
|
74
|
+
* each listed entry). The listing promising `application/json` while the read
|
|
75
|
+
* answers Turtle is the same shape of failure as a template over URIs it does
|
|
76
|
+
* not serve: a surface describing content it does not serve.
|
|
77
|
+
*/
|
|
78
|
+
const ENTITY_MIME_TYPE = "text/turtle";
|
|
79
|
+
/** The recovery hint is prose about a broken store, not graph content. */
|
|
80
|
+
const RECOVERY_MIME_TYPE = "text/plain";
|
|
81
|
+
/**
|
|
82
|
+
* The {@link SCHEME} + the single reserved-expansion template variable.
|
|
83
|
+
* `resources.test.ts` pins the template against what the listing mints;
|
|
84
|
+
* `identity.test.ts` reads a fork's surface under the fork's own name.
|
|
85
|
+
*/
|
|
86
|
+
const URI_TEMPLATE = `${SCHEME}:{+uri}`;
|
|
87
|
+
const TEMPLATE_DESCRIPTION = "Knowledge-graph entities from the local pack, as Turtle. Read any entry by " +
|
|
88
|
+
`its prefixed URI (e.g. ${SCHEME}:${installedDistribution().config.orientation?.exampleEntity ?? "owl:Class"}); autocomplete ` +
|
|
89
|
+
"matches URI or label substrings. A read returns the entity's neighbourhood — " +
|
|
90
|
+
"its own triples, the edges pointing AT it, and its blank nodes inlined. " +
|
|
91
|
+
`Content mirrors \`${BIN_NAME} graph inspect <uri> --format llm\`.`;
|
|
92
|
+
/**
|
|
93
|
+
* The audience every listed resource carries.
|
|
94
|
+
*
|
|
95
|
+
* BOTH roles. `["assistant"]` tells a client that honours the field to hide the
|
|
96
|
+
* resource from its human picker, and browsing a design system in a picker is
|
|
97
|
+
* exactly a human use case — the same entries serve an agent orienting itself
|
|
98
|
+
* and a person looking for the button spec.
|
|
99
|
+
*/
|
|
100
|
+
const LISTING_AUDIENCE = ["user", "assistant"];
|
|
101
|
+
/**
|
|
102
|
+
* The human name for an entity, best-available-first.
|
|
103
|
+
*
|
|
104
|
+
* `altNames` is the distribution's declared alternative-name property — the
|
|
105
|
+
* name a bespoke lookup MATCHES on ("Button", "FileTree"). 383 of the embedded
|
|
106
|
+
* pack's 714 entities carry one and no `rdfs:label`, so before this the listing
|
|
107
|
+
* showed them as a bare URI with no description while the readable name sat
|
|
108
|
+
* unused in the index one field away.
|
|
109
|
+
*/
|
|
110
|
+
function humanName(entity) {
|
|
111
|
+
return entity.label ?? entity.altNames?.[0] ?? undefined;
|
|
112
|
+
}
|
|
113
|
+
/** Render one index entity as a listed resource at a given weight. */
|
|
114
|
+
function listEntity(entity, weight, instanceCount) {
|
|
115
|
+
const title = humanName(entity);
|
|
116
|
+
// `<scheme>/box` + `<scheme>/instanceCount` travel with the scheme (see
|
|
117
|
+
// docs/mcp-integration.md). `<scheme>/type` is an ADDITION: all 714 entities carry a type, and publishing it lets an agent
|
|
118
|
+
// narrow the listing to a family without spending a read to find out what
|
|
119
|
+
// each entry is.
|
|
120
|
+
const meta = {
|
|
121
|
+
[`${SCHEME}/box`]: entity.box ?? "abox",
|
|
122
|
+
[`${SCHEME}/type`]: entity.type,
|
|
123
|
+
};
|
|
124
|
+
if (typeof instanceCount === "number") {
|
|
125
|
+
meta[`${SCHEME}/instanceCount`] = instanceCount;
|
|
126
|
+
}
|
|
127
|
+
return {
|
|
128
|
+
uri: `${SCHEME}:${entity.prefixed ?? entity.name}`,
|
|
129
|
+
name: entity.prefixed ?? entity.name,
|
|
130
|
+
...(title ? { title } : {}),
|
|
131
|
+
...(entity.description ? { description: entity.description } : {}),
|
|
132
|
+
mimeType: ENTITY_MIME_TYPE,
|
|
133
|
+
annotations: { audience: LISTING_AUDIENCE, priority: weight },
|
|
134
|
+
_meta: meta,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/** The recovery entry a missing/legacy index degrades to (and its read body). */
|
|
138
|
+
// This surface is MCP-only, so the next step is always spelled as a tool call.
|
|
139
|
+
const describeNoIndex = () => `No enriched entity index: the store needs building. ${renderNextStep(BUILD_STORE_CALL, "mcp")}`;
|
|
140
|
+
/** The single entry a server with no usable index advertises. */
|
|
141
|
+
function sourcesEntry() {
|
|
142
|
+
return {
|
|
143
|
+
uri: SOURCES_URI,
|
|
144
|
+
name: SOURCES_VARIABLE,
|
|
145
|
+
title: "Store not indexed",
|
|
146
|
+
description: describeNoIndex(),
|
|
147
|
+
mimeType: RECOVERY_MIME_TYPE,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Resolve one declared slice into listed resources.
|
|
152
|
+
*
|
|
153
|
+
* `as: "collection"` yields at most ONE entry — the class entry for the slice's
|
|
154
|
+
* type, carrying `pragma/instanceCount`. A type the index does not know
|
|
155
|
+
* contributes NOTHING rather than an empty collection: `ds:Token` is declared by
|
|
156
|
+
* a read story but SPARQL-served, never indexed, and advertising an empty
|
|
157
|
+
* collection for it would promise a browse that has nothing to show.
|
|
158
|
+
*/
|
|
159
|
+
function listSlice(index, byPrefixed, ref) {
|
|
160
|
+
const weight = ref.weight ?? DEFAULT_WEIGHT;
|
|
161
|
+
if (ref.as === "collection") {
|
|
162
|
+
const type = ref.type;
|
|
163
|
+
if (!type)
|
|
164
|
+
return [];
|
|
165
|
+
const entity = byPrefixed.get(type);
|
|
166
|
+
if (!entity)
|
|
167
|
+
return [];
|
|
168
|
+
// A class with no instances has NO key in `instanceCountByType`, so reading
|
|
169
|
+
// it straight through reports `undefined` — and an empty collection then
|
|
170
|
+
// looks identical to an entry that is not a collection at all. A declared
|
|
171
|
+
// collection whose class the index knows always states a count, and for an
|
|
172
|
+
// empty one that count is zero.
|
|
173
|
+
const count = entity.uri ? (index.instanceCountByType[entity.uri] ?? 0) : 0;
|
|
174
|
+
return [listEntity(entity, weight, count)];
|
|
175
|
+
}
|
|
176
|
+
const listed = [];
|
|
177
|
+
for (const entity of index.entities) {
|
|
178
|
+
if (ref.box && (entity.box ?? "abox") !== ref.box)
|
|
179
|
+
continue;
|
|
180
|
+
if (!matchesType(entity, ref.type ?? ""))
|
|
181
|
+
continue;
|
|
182
|
+
const count = entity.box === "tbox" && entity.uri
|
|
183
|
+
? index.instanceCountByType[entity.uri]
|
|
184
|
+
: undefined;
|
|
185
|
+
listed.push(listEntity(entity, weight, count));
|
|
186
|
+
}
|
|
187
|
+
return listed;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Build the resource listing from the storeless pack index.
|
|
191
|
+
*
|
|
192
|
+
* @param index - The active pack index, or `undefined` when none is reachable.
|
|
193
|
+
* @param listing - The union of the modules' declared slices.
|
|
194
|
+
* @returns One resource per contributed entry, heaviest slice first; a single
|
|
195
|
+
* recovery entry when the index is missing or pre-v2 (no enrichment).
|
|
196
|
+
*/
|
|
197
|
+
export function buildResourceList(index, listing) {
|
|
198
|
+
// readPackIndex returns raw JSON.parse output (no zod), so guard structurally:
|
|
199
|
+
// a malformed index missing `version` must degrade to the recovery hint, not
|
|
200
|
+
// fall through to `[...index.entities]` (a TypeError inside the MCP handler).
|
|
201
|
+
// A v2 index (an existing cache from before the anonymous counts) carries
|
|
202
|
+
// every field THIS listing reads, so it stays servable alongside v3.
|
|
203
|
+
if (!index ||
|
|
204
|
+
(index.version !== 2 && index.version !== 3) ||
|
|
205
|
+
!Array.isArray(index.entities)) {
|
|
206
|
+
return [sourcesEntry()];
|
|
207
|
+
}
|
|
208
|
+
const byPrefixed = new Map();
|
|
209
|
+
for (const entity of index.entities) {
|
|
210
|
+
const key = entity.prefixed ?? entity.name;
|
|
211
|
+
// A punned subject is indexed as two facets sharing one key; the schema
|
|
212
|
+
// facet is the one a collection entry means.
|
|
213
|
+
if (!byPrefixed.has(key) || entity.box === "tbox")
|
|
214
|
+
byPrefixed.set(key, entity);
|
|
215
|
+
}
|
|
216
|
+
const candidates = listing.sources.flatMap((ref) => listSlice(index, byPrefixed, ref));
|
|
217
|
+
candidates.sort((a, b) => {
|
|
218
|
+
const priority = (r) => r.annotations?.priority ?? 0;
|
|
219
|
+
const boxRank = (r) => r._meta?.[`${SCHEME}/box`] === "tbox" ? 0 : 1;
|
|
220
|
+
return (priority(b) - priority(a) ||
|
|
221
|
+
boxRank(a) - boxRank(b) ||
|
|
222
|
+
a.uri.localeCompare(b.uri));
|
|
223
|
+
});
|
|
224
|
+
// Dedup by resource URI. Two slices may contribute the same entry (a story's
|
|
225
|
+
// collection IS one of the ontology's schema entries), and an OWL-punned
|
|
226
|
+
// subject (a class/property IRI ALSO asserted as a domain individual) is
|
|
227
|
+
// indexed as TWO entities — a tbox and an abox facet — that compact to the
|
|
228
|
+
// SAME `<scheme>:<uri>` (A8). The sort above puts the heavier slice, then the
|
|
229
|
+
// tbox facet, first, so keeping the first occurrence per URI surfaces the
|
|
230
|
+
// richer entry (its instance count and higher priority) and drops the rest.
|
|
231
|
+
const seen = new Set();
|
|
232
|
+
const resources = [];
|
|
233
|
+
for (const candidate of candidates) {
|
|
234
|
+
if (seen.has(candidate.uri))
|
|
235
|
+
continue;
|
|
236
|
+
seen.add(candidate.uri);
|
|
237
|
+
resources.push(candidate);
|
|
238
|
+
}
|
|
239
|
+
return resources;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* The per-type ranking weights a declared listing implies.
|
|
243
|
+
*
|
|
244
|
+
* A slice that names a `type` is an opinion about that type's importance, and
|
|
245
|
+
* the SAME opinion should decide both what the listing surfaces first and what
|
|
246
|
+
* autocomplete offers first — one declaration, two readers. A slice that names
|
|
247
|
+
* only a `box` carries no opinion about a candidate URI, so it contributes none.
|
|
248
|
+
*
|
|
249
|
+
* @param listing - The union of the modules' declared slices.
|
|
250
|
+
* @returns Prefixed type → weight (heaviest declaration wins on a repeat).
|
|
251
|
+
*/
|
|
252
|
+
export function completionWeights(listing) {
|
|
253
|
+
const weights = {};
|
|
254
|
+
for (const ref of listing.sources) {
|
|
255
|
+
if (!ref.type)
|
|
256
|
+
continue;
|
|
257
|
+
const weight = ref.weight ?? DEFAULT_WEIGHT;
|
|
258
|
+
weights[ref.type] = Math.max(weights[ref.type] ?? 0, weight);
|
|
259
|
+
}
|
|
260
|
+
return weights;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Rank URI autocomplete candidates against a partial query (case-insensitive
|
|
264
|
+
* over both the prefixed URI and the label; exact > prefix > substring).
|
|
265
|
+
*
|
|
266
|
+
* UNCAPPED on purpose. The SDK derives the wire's `total`/`hasMore` from the
|
|
267
|
+
* array this returns — it slices to 100, reports `total: values.length` and
|
|
268
|
+
* `hasMore: values.length > 100` — so pre-truncating here made a truncated
|
|
269
|
+
* result describe itself as complete: `ds:` answered
|
|
270
|
+
* `{ values: 50, total: 50, hasMore: false }` while 499 entities matched.
|
|
271
|
+
* Completion keeps offering EVERY entity: it is the discovery path for the
|
|
272
|
+
* individuals the curated listing no longer enumerates.
|
|
273
|
+
*
|
|
274
|
+
* @param entities - The index entities to rank.
|
|
275
|
+
* @param query - The partial the agent typed.
|
|
276
|
+
* @param weights - Prefixed type → weight, breaking ties between equal matches.
|
|
277
|
+
* @returns Every matching prefixed URI, best first.
|
|
278
|
+
*/
|
|
279
|
+
/**
|
|
280
|
+
* The weight of an entity across EVERY type it is declared under.
|
|
281
|
+
*
|
|
282
|
+
* `PackIndexEntity.type` is one lexically chosen primary among `types`, and the
|
|
283
|
+
* listing's own `matchesType` already honours both. Weighing only the primary
|
|
284
|
+
* therefore ignored a weight declared for a secondary type, and let ranking
|
|
285
|
+
* shift when an unrelated, lexically earlier type was added to an entity.
|
|
286
|
+
*
|
|
287
|
+
* The LOWEST declared weight wins: a weight below the default is a demotion, and
|
|
288
|
+
* a demotion that any membership asks for should not be cancelled by another
|
|
289
|
+
* membership that simply never asked for anything. Types with no declared weight
|
|
290
|
+
* do not vote, so an entity nobody weighted keeps the default.
|
|
291
|
+
*/
|
|
292
|
+
function effectiveWeight(entity, weights) {
|
|
293
|
+
const memberships = entity.types ?? [entity.type];
|
|
294
|
+
const declared = memberships
|
|
295
|
+
.map((type) => weights[type])
|
|
296
|
+
.filter((weight) => weight !== undefined);
|
|
297
|
+
return declared.length > 0 ? Math.min(...declared) : DEFAULT_WEIGHT;
|
|
298
|
+
}
|
|
299
|
+
export function rankUriCompletions(entities, query, weights = {}) {
|
|
300
|
+
const needle = query.toLowerCase();
|
|
301
|
+
const score = (field) => field === needle
|
|
302
|
+
? 3
|
|
303
|
+
: field.startsWith(needle)
|
|
304
|
+
? 2
|
|
305
|
+
: field.includes(needle)
|
|
306
|
+
? 1
|
|
307
|
+
: 0;
|
|
308
|
+
const scored = [];
|
|
309
|
+
for (const entity of entities) {
|
|
310
|
+
const prefixed = entity.prefixed ?? entity.name;
|
|
311
|
+
const uriScore = score(prefixed.toLowerCase());
|
|
312
|
+
const labelScore = entity.label ? score(entity.label.toLowerCase()) : 0;
|
|
313
|
+
const best = Math.max(uriScore, labelScore);
|
|
314
|
+
if (best > 0) {
|
|
315
|
+
scored.push({
|
|
316
|
+
prefixed,
|
|
317
|
+
score: best,
|
|
318
|
+
weight: effectiveWeight(entity, weights),
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
// Match quality first, then the DECLARED weight, then the alphabet. The
|
|
323
|
+
// weight step is what stops 86 `…-close_button` subcomponents from burying
|
|
324
|
+
// `ds:global.component.button` on the strength of their spelling alone.
|
|
325
|
+
scored.sort((a, b) => b.score - a.score ||
|
|
326
|
+
b.weight - a.weight ||
|
|
327
|
+
a.prefixed.localeCompare(b.prefixed));
|
|
328
|
+
const seen = new Set();
|
|
329
|
+
const ranked = [];
|
|
330
|
+
for (const { prefixed } of scored) {
|
|
331
|
+
if (seen.has(prefixed))
|
|
332
|
+
continue;
|
|
333
|
+
seen.add(prefixed);
|
|
334
|
+
ranked.push(prefixed);
|
|
335
|
+
}
|
|
336
|
+
return ranked;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* The union of every module's declared listing.
|
|
340
|
+
*
|
|
341
|
+
* @param modules - The effective capability modules.
|
|
342
|
+
* @returns One listing holding every declared slice, in module order.
|
|
343
|
+
*/
|
|
344
|
+
export function collectListable(modules) {
|
|
345
|
+
return {
|
|
346
|
+
sources: modules.flatMap((module) => module.mcpListable?.sources ?? []),
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
/** Read the single `uri` template variable, tolerating array expansion. */
|
|
350
|
+
function readUriVariable(value) {
|
|
351
|
+
const uri = Array.isArray(value) ? value.at(0) : value;
|
|
352
|
+
if (uri === undefined) {
|
|
353
|
+
throw PragmaError.invalidInput("uri", String(value), {
|
|
354
|
+
recovery: { message: "Provide a prefixed or full entity URI." },
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
return uri;
|
|
358
|
+
}
|
|
359
|
+
/** The graph-entity resource provider (registered by buildServer). */
|
|
360
|
+
export const resourceProvider = {
|
|
361
|
+
// The single authoring point for the template id — the surface emitter reads
|
|
362
|
+
// this so `mcpSurface.resources` cannot drift from what `register` installs.
|
|
363
|
+
surface: { templates: [URI_TEMPLATE] },
|
|
364
|
+
async register(server, runtime, modules) {
|
|
365
|
+
const { ResourceTemplate } = await import("@modelcontextprotocol/sdk/server/mcp.js");
|
|
366
|
+
const { McpError, ErrorCode } = await import("@modelcontextprotocol/sdk/types.js");
|
|
367
|
+
// The index of the pack the boot decision names — `undefined` when the
|
|
368
|
+
// store is unavailable, which `buildResourceList` renders as the recovery
|
|
369
|
+
// entry rather than a catalogue of unreadable URIs.
|
|
370
|
+
const activeIndex = async () => readPackIndex(resolveSources(await runtime.loadConfig(), runtime.cwd));
|
|
371
|
+
// What the SERVER lists is the union of what its modules declare — not what
|
|
372
|
+
// this one module knows. Collected once, at registration.
|
|
373
|
+
const listing = collectListable(modules);
|
|
374
|
+
const weights = completionWeights(listing);
|
|
375
|
+
const template = new ResourceTemplate(URI_TEMPLATE, {
|
|
376
|
+
list: async () => ({
|
|
377
|
+
resources: buildResourceList(await activeIndex(), listing),
|
|
378
|
+
}),
|
|
379
|
+
complete: {
|
|
380
|
+
// Uncapped: the SDK slices to 100 and derives `total`/`hasMore` from
|
|
381
|
+
// the full array, so returning it is what makes those numbers honest.
|
|
382
|
+
uri: async (value) => rankUriCompletions((await activeIndex())?.entities ?? [], value, weights),
|
|
383
|
+
},
|
|
384
|
+
});
|
|
385
|
+
server.registerResource("graph-entity", template,
|
|
386
|
+
// `text/turtle` because that is what the body IS. The surface used to
|
|
387
|
+
// claim `application/json` for a graph, and paid ~95 bytes of wrapper per
|
|
388
|
+
// named node to do it — one button read carried ~6.1 KB of pure structure.
|
|
389
|
+
// Turtle spends the prefixes once, writes each term as itself, and says
|
|
390
|
+
// IRI-versus-literal in syntax rather than in a `termType` field.
|
|
391
|
+
{ description: TEMPLATE_DESCRIPTION, mimeType: ENTITY_MIME_TYPE }, async (url, variables) => {
|
|
392
|
+
try {
|
|
393
|
+
const uri = readUriVariable(variables.uri);
|
|
394
|
+
// The recovery entry is a real resource, not a label. It is the ONLY
|
|
395
|
+
// thing a server with no usable index advertises, and reading it used
|
|
396
|
+
// to fail `INVALID_INPUT — Invalid uri "sources"`: the one resource on
|
|
397
|
+
// offer refused to be read, so the hint that explains the cold store
|
|
398
|
+
// was unreachable from the surface that showed it.
|
|
399
|
+
if (uri === SOURCES_VARIABLE) {
|
|
400
|
+
return {
|
|
401
|
+
contents: [
|
|
402
|
+
{
|
|
403
|
+
uri: url.href,
|
|
404
|
+
mimeType: RECOVERY_MIME_TYPE,
|
|
405
|
+
text: describeNoIndex(),
|
|
406
|
+
},
|
|
407
|
+
],
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
const entity = await readEntity(runtime, uri);
|
|
411
|
+
const { prefixes } = await runtime.store.get();
|
|
412
|
+
return {
|
|
413
|
+
contents: [
|
|
414
|
+
{
|
|
415
|
+
uri: url.href,
|
|
416
|
+
mimeType: ENTITY_MIME_TYPE,
|
|
417
|
+
text: toTurtle(entity, prefixes),
|
|
418
|
+
},
|
|
419
|
+
],
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
catch (error) {
|
|
423
|
+
// Surface the failure as a JSON-RPC error (the resource-read analogue
|
|
424
|
+
// of a tool result's `isError`), preserving the machine code AND the
|
|
425
|
+
// recovery in `data` — never swallow it into `text/plain` content an
|
|
426
|
+
// agent reads as a successful entity (which dropped the recovery and
|
|
427
|
+
// masked a cold store as though the entity itself were malformed).
|
|
428
|
+
throw mcpErrorFrom(asPragmaError(error), { McpError, ErrorCode });
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
},
|
|
432
|
+
};
|
|
433
|
+
//# sourceMappingURL=provider.js.map
|