@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,893 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pack grammar (v2) — "reads as data".
|
|
3
|
+
*
|
|
4
|
+
* A pack maps a noun to preferred queries: a SPARQL SELECT for the list story
|
|
5
|
+
* and a generated, injection-safe lookup. One grammar and one compiler
|
|
6
|
+
* ({@link ../compile}) project a pack into {@link ../../spec/types.VerbSpec}s;
|
|
7
|
+
* the CLI and MCP projectors then treat pack verbs like any other. This closes
|
|
8
|
+
* the two old forks — three read-noun styles collapse to one pack shape, and
|
|
9
|
+
* the two pack compilers collapse to one.
|
|
10
|
+
*
|
|
11
|
+
* These types are hand-authored and zod-free so the compiler (reached on the
|
|
12
|
+
* `--help`/`__complete` fast path via `capabilities/index`) never pulls zod;
|
|
13
|
+
* {@link ../schema} validates the same shapes and is imported lazily, only for
|
|
14
|
+
* dynamic (config/package) packs and in tests.
|
|
15
|
+
*
|
|
16
|
+
* Progressive disclosure is CANONICAL: a level tag names one of
|
|
17
|
+
* `constants.DETAIL_LEVELS` (`summary` < `standard` < `detailed`), and gating
|
|
18
|
+
* is by that canonical index — a pack's declared `levels` is any ordered subset
|
|
19
|
+
* of the canonical set.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The parameter names the KERNEL puts on a compiled verb, which a story's own
|
|
24
|
+
* filter may therefore not claim.
|
|
25
|
+
*
|
|
26
|
+
* `search` is a story's declared free-text flag; `detail` the disclosure
|
|
27
|
+
* selector; `name` and `count` a lookup's and a sample's positionals; `limit`
|
|
28
|
+
* and `after` the page every list-shaped verb carries. A filter claiming one
|
|
29
|
+
* would collide with a flag the CLI has already registered — a Commander
|
|
30
|
+
* failure outside every error envelope the CLI owns. Declared here, in the
|
|
31
|
+
* zod-free grammar, so the validator that refuses them and any reader that
|
|
32
|
+
* needs to tell a story's OWN params from the kernel's read one list.
|
|
33
|
+
*/
|
|
34
|
+
export const RESERVED_STORY_PARAMS: readonly string[] = [
|
|
35
|
+
"search",
|
|
36
|
+
"detail",
|
|
37
|
+
"name",
|
|
38
|
+
"count",
|
|
39
|
+
"limit",
|
|
40
|
+
"after",
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The SPARQL VARIABLE prefix the kernel reserves, which a story's own query may
|
|
45
|
+
* therefore not use.
|
|
46
|
+
*
|
|
47
|
+
* The generated filter and search clauses bind a caller's values to variables
|
|
48
|
+
* under this prefix (`?__pragmaFilter0`, `?__pragmaSearch`). A story query using
|
|
49
|
+
* it would have its own variable shadowed, and the symptom would be a filter
|
|
50
|
+
* matching nothing with nothing raised anywhere. Beside the reserved PARAMS for
|
|
51
|
+
* the same reason: the grammar that refuses it and the builder that mints it
|
|
52
|
+
* must read one name, and this file is the zod-free place both can reach — the
|
|
53
|
+
* builder lives behind the dynamically imported run bodies, so nothing on the
|
|
54
|
+
* `--help` fast path may import it.
|
|
55
|
+
*/
|
|
56
|
+
export const RESERVED_VARIABLE_PREFIX = "__pragma";
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The `--tier` value that turns the tier scope OFF — every tier, the way every
|
|
60
|
+
* read answered before the scope existed.
|
|
61
|
+
*
|
|
62
|
+
* A word rather than a second flag (this distribution retired an `--all-tiers`
|
|
63
|
+
* once already): `--tier all` answers the same question the flag already asks,
|
|
64
|
+
* so there is one argument to learn and one to document.
|
|
65
|
+
*
|
|
66
|
+
* Declared HERE, in the zod-free grammar, for the reason
|
|
67
|
+
* {@link RESERVED_VARIABLE_PREFIX} is: the compiler that puts the flag on a
|
|
68
|
+
* verb runs on the storeless `--help` fast path, and the run body that reads it
|
|
69
|
+
* lives behind a dynamic import. Both must read one spelling.
|
|
70
|
+
*/
|
|
71
|
+
export const EVERY_TIER = "all";
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The parameter name the kernel puts on a TIER-SCOPED noun's reads (`--tier`,
|
|
75
|
+
* `tier` over MCP).
|
|
76
|
+
*
|
|
77
|
+
* Not in {@link RESERVED_STORY_PARAMS}, because it is reserved CONDITIONALLY:
|
|
78
|
+
* an unscoped noun may still declare a `tier` filter of its own — over a
|
|
79
|
+
* different predicate, in a different namespace, from the one this scope
|
|
80
|
+
* reads (`ex:region` in the example's menus). The
|
|
81
|
+
* rule that a SCOPED story may not claim it lives in {@link ./storyRules}.
|
|
82
|
+
*/
|
|
83
|
+
export const TIER_PARAM = "tier";
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The SELECT variable a list-shaped story publishes its entity IRI in.
|
|
87
|
+
*
|
|
88
|
+
* A convention this package already depends on twice — the condensed renderer
|
|
89
|
+
* titles a row from `uri`/`name`, and every shipped list's IRI column is `uri`
|
|
90
|
+
* — stated here because the tier scope is compiled in as a constraint on that
|
|
91
|
+
* variable, and because both the storeless declaration rules and the query
|
|
92
|
+
* builder behind the dynamic import must read one spelling of it.
|
|
93
|
+
*/
|
|
94
|
+
export const ENTITY_VARIABLE = "uri";
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* What a cell may say about the values it prints, on a list column, a lookup
|
|
98
|
+
* field or an expand field alike.
|
|
99
|
+
*/
|
|
100
|
+
export interface PackCellLink {
|
|
101
|
+
/**
|
|
102
|
+
* The noun whose entities this cell NAMES: every value it prints is a name
|
|
103
|
+
* that noun's lookup resolves, so a reader can take the cell to
|
|
104
|
+
* `<noun> lookup` verbatim. On a list column it also promises a filter of
|
|
105
|
+
* the same `noun` over that column.
|
|
106
|
+
*/
|
|
107
|
+
readonly noun?: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** A list column: a SELECT variable to display. */
|
|
111
|
+
export interface PackColumn extends PackCellLink {
|
|
112
|
+
/** SELECT variable name (without `?`). */
|
|
113
|
+
readonly field: string;
|
|
114
|
+
/** Column heading (defaults to the field name). */
|
|
115
|
+
readonly label?: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** A looked-up value: an output name bound to a property of the entity. */
|
|
119
|
+
export interface PackField extends PackCellLink {
|
|
120
|
+
/** Output field name on the looked-up entity. */
|
|
121
|
+
readonly name: string;
|
|
122
|
+
/** Property to read — a prefixed name (`ex:region`) or absolute IRI. */
|
|
123
|
+
readonly property: string;
|
|
124
|
+
/** Display label (defaults to the field name). */
|
|
125
|
+
readonly label?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Explicit GraphQL field name for `source: "graphql"` lookups — the escape
|
|
128
|
+
* hatch when the ontology→schema derivation does not match the compiled
|
|
129
|
+
* schema. Ignored on the SPARQL path.
|
|
130
|
+
*/
|
|
131
|
+
readonly graphqlField?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Minimum canonical disclosure level at which this value is fetched and
|
|
134
|
+
* rendered. Omitted means the base level (always included). Below its level
|
|
135
|
+
* the value is excluded from the generated query/document.
|
|
136
|
+
*/
|
|
137
|
+
readonly level?: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** A long-form lookup section (inline field or code block). */
|
|
141
|
+
export interface PackSection extends PackField {
|
|
142
|
+
/** Rendering kind (inline field or fenced code block). */
|
|
143
|
+
readonly kind?: "field" | "code";
|
|
144
|
+
/**
|
|
145
|
+
* One sentence rendered under the section's heading, above its body: how to
|
|
146
|
+
* READ what follows, when the body's own notation does not say.
|
|
147
|
+
*
|
|
148
|
+
* For a section whose body is a document the graph authored, the label is
|
|
149
|
+
* enough. For one whose body is a NOTATION — a block's anatomy is a YAML
|
|
150
|
+
* document in which `background.color: [a, b]` is a fallback chain, first
|
|
151
|
+
* value that resolves winning — the reader has to be told, and the place to
|
|
152
|
+
* tell them is where they are looking.
|
|
153
|
+
*/
|
|
154
|
+
readonly note?: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** A field read from each child node of a {@link PackExpand}. */
|
|
158
|
+
export interface PackExpandField extends PackCellLink {
|
|
159
|
+
/** Output field name on the child record. */
|
|
160
|
+
readonly name: string;
|
|
161
|
+
/** Property to read on the child node — prefixed name, IRI, or path. */
|
|
162
|
+
readonly property: string;
|
|
163
|
+
/** Display label (defaults to the field name). */
|
|
164
|
+
readonly label?: string;
|
|
165
|
+
/** Explicit GraphQL field name (escape hatch). Ignored on the SPARQL path. */
|
|
166
|
+
readonly graphqlField?: string;
|
|
167
|
+
/**
|
|
168
|
+
* Leave the cell BLANK when its value repeats the looked-up entity's own
|
|
169
|
+
* `by` value — for a relation an entity can point back at ITSELF along.
|
|
170
|
+
*
|
|
171
|
+
* The standing case is a block's token bindings: `ex:viaBlock` names the
|
|
172
|
+
* anatomy tree a binding was reached through, and the ontology defines it as
|
|
173
|
+
* present on every record and EQUAL to the block on the block's own tree. So
|
|
174
|
+
* a Button lookup printed "Button" in the via column of all 24 of its rows —
|
|
175
|
+
* a cell that is only ever news when it differs. Blank says "this block's
|
|
176
|
+
* own", which is the reading, and leaves the column carrying only the
|
|
177
|
+
* inherited trees.
|
|
178
|
+
*
|
|
179
|
+
* SPARQL lane only: the generated sub-SELECT can bind the entity's own name
|
|
180
|
+
* and filter against it, and a GraphQL document cannot.
|
|
181
|
+
*/
|
|
182
|
+
readonly blankWhenSelf?: true;
|
|
183
|
+
/**
|
|
184
|
+
* The property reaches SEVERAL values per child, and the cell is all of them:
|
|
185
|
+
* distinct, sorted, space-separated, one row per child. Without it each value is a
|
|
186
|
+
* row of its own, repeating every other cell.
|
|
187
|
+
*
|
|
188
|
+
* SPARQL lane only. Not combinable with {@link blankWhenSelf}, and not a
|
|
189
|
+
* name an expand may order by — a set has no order to sort on.
|
|
190
|
+
*/
|
|
191
|
+
readonly many?: true;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* A second-hop projection inside an expand's `select` — GraphQL source only.
|
|
196
|
+
* One extra level (child → grandchildren); a nested expand's `select` admits
|
|
197
|
+
* only scalar fields, so nesting stops here. Rejected on `source: "sparql"`.
|
|
198
|
+
*/
|
|
199
|
+
export interface PackNestedExpand {
|
|
200
|
+
/** Output field holding the grandchild values on each child record. */
|
|
201
|
+
readonly name: string;
|
|
202
|
+
/** Relation from the child node to each grandchild — prefixed name or IRI. */
|
|
203
|
+
readonly relation: string;
|
|
204
|
+
/** Explicit GraphQL field name (escape hatch over the derived name). */
|
|
205
|
+
readonly graphqlField?: string;
|
|
206
|
+
/** Scalar fields to read from each grandchild. */
|
|
207
|
+
readonly select: readonly PackExpandField[];
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** One entry of an expand's `select`: a child field or a nested expand. */
|
|
211
|
+
export type PackExpandSelect = PackExpandField | PackNestedExpand;
|
|
212
|
+
|
|
213
|
+
/** Whether an expand-select entry is a nested expand (vs a plain field). */
|
|
214
|
+
export function isNestedExpand(
|
|
215
|
+
entry: PackExpandSelect,
|
|
216
|
+
): entry is PackNestedExpand {
|
|
217
|
+
return "relation" in entry;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* A multi-valued nested projection: `entity → relation → child nodes`, each
|
|
222
|
+
* child projected to a small record. Resolved with a generated, injection-safe
|
|
223
|
+
* sub-SELECT bound to the already-resolved entity IRI (never user input) on the
|
|
224
|
+
* SPARQL path, or one document hop on the GraphQL path.
|
|
225
|
+
*/
|
|
226
|
+
export interface PackExpand {
|
|
227
|
+
/** Output field holding the child array on the looked-up entity. */
|
|
228
|
+
readonly name: string;
|
|
229
|
+
/** Section heading (defaults to the field name). */
|
|
230
|
+
readonly heading?: string;
|
|
231
|
+
/** Render kind for the array (`list` or `table`; defaults to `list`). */
|
|
232
|
+
readonly kind?: "list" | "table";
|
|
233
|
+
/** Relation from the entity to each child node — prefixed name, IRI, or path. */
|
|
234
|
+
readonly relation: string;
|
|
235
|
+
/** Explicit GraphQL field name (escape hatch). Ignored on the SPARQL path. */
|
|
236
|
+
readonly graphqlField?: string;
|
|
237
|
+
/**
|
|
238
|
+
* Fields to read from each child node. On `source: "graphql"` lookups an
|
|
239
|
+
* entry may instead be one {@link PackNestedExpand} level.
|
|
240
|
+
*/
|
|
241
|
+
readonly select: readonly PackExpandSelect[];
|
|
242
|
+
/** Render the section even when the array is empty (default: false). */
|
|
243
|
+
readonly showWhenEmpty?: boolean;
|
|
244
|
+
/** Minimum canonical disclosure level at which this expand is fetched. */
|
|
245
|
+
readonly level?: string;
|
|
246
|
+
/**
|
|
247
|
+
* One sentence rendered under the section's heading, above the rows: how to
|
|
248
|
+
* READ them, when the columns do not say it themselves.
|
|
249
|
+
*
|
|
250
|
+
* The same seam a {@link PackSection} carries, for the same reason and
|
|
251
|
+
* through the same renderer field — a section's note was declarable only for
|
|
252
|
+
* a section whose body is one literal, and a TABLE can be the notation that
|
|
253
|
+
* needs reading just as much: a `rank` column is a position in a fallback
|
|
254
|
+
* chain, and nothing in the word "rank" says which chain or that first wins.
|
|
255
|
+
*/
|
|
256
|
+
readonly note?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Child field names to ORDER BY in the generated sub-SELECT, in order.
|
|
259
|
+
*
|
|
260
|
+
* Without one an expand's rows arrive in the store's own scan order, which
|
|
261
|
+
* SPARQL does not define and which no reader can predict. That is tolerable
|
|
262
|
+
* for a short list of names and wrong for a TABLE whose rows differ in one
|
|
263
|
+
* column: Button's 24 token bindings came back with `spacing.internal.inline.start`
|
|
264
|
+
* and `…end` adjacent, in no stated order, and a reader comparing two rows
|
|
265
|
+
* had no way to know whether the pair was two facts or one repeated.
|
|
266
|
+
*
|
|
267
|
+
* Names must be fields the `select` declares (the grammar refuses others),
|
|
268
|
+
* so the clause is composed only from validated identifiers. SPARQL lane
|
|
269
|
+
* only — a GraphQL connection's order is the schema's, not the story's.
|
|
270
|
+
*/
|
|
271
|
+
readonly orderBy?: readonly string[];
|
|
272
|
+
/**
|
|
273
|
+
* Resolve THIS expand through the SPARQL lane even when the lookup is
|
|
274
|
+
* `source: "graphql"`.
|
|
275
|
+
*
|
|
276
|
+
* The lanes are not interchangeable, and a lookup is one or the other: the
|
|
277
|
+
* GraphQL lane can project a grandchild through a MULTI-valued relation
|
|
278
|
+
* (a nested expand), which the single-hop SPARQL sub-SELECT cannot, and the
|
|
279
|
+
* SPARQL lane can read property paths and any property the ontology defines,
|
|
280
|
+
* which the GraphQL lane cannot — a derived field name that the compiled
|
|
281
|
+
* schema does not carry drops out of the document in silence.
|
|
282
|
+
*
|
|
283
|
+
* The block lookup needs both at once, which is why this exists rather than
|
|
284
|
+
* a second lookup. Its modifier families are a nested expand and so must
|
|
285
|
+
* stay on the GraphQL lane; its token bindings must not, because
|
|
286
|
+
* `anatomy:styleKey` and `anatomy:styleState` — two of the six columns that
|
|
287
|
+
* IDENTIFY a binding — carry no `rdfs:domain`, so ke-graphql generates no
|
|
288
|
+
* field for them on `TokenBinding` and the two columns vanished without a
|
|
289
|
+
* word, leaving rows that differed only in a dropped column looking like
|
|
290
|
+
* duplicates.
|
|
291
|
+
*
|
|
292
|
+
* Only `"sparql"` is admissible: the SPARQL lane is every lookup's default,
|
|
293
|
+
* so an expand opting INTO GraphQL would be asking for a document the lookup
|
|
294
|
+
* never builds.
|
|
295
|
+
*/
|
|
296
|
+
readonly source?: "sparql";
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Which lane resolves one expand: its own declared {@link PackExpand.source},
|
|
301
|
+
* else the lookup's, else SPARQL.
|
|
302
|
+
*
|
|
303
|
+
* Read by BOTH lanes — the GraphQL document generator skips what it does not
|
|
304
|
+
* own, and the entity fetcher runs it — so the question is answered in one
|
|
305
|
+
* place rather than asked twice with two spellings.
|
|
306
|
+
*/
|
|
307
|
+
export function expandIsSparql(
|
|
308
|
+
lookup: Pick<PackLookup, "source">,
|
|
309
|
+
expand: Pick<PackExpand, "source">,
|
|
310
|
+
): boolean {
|
|
311
|
+
return (expand.source ?? lookup.source ?? "sparql") === "sparql";
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Progressive-disclosure capability for a lookup. Declares an ordered subset of
|
|
316
|
+
* the canonical levels (the first is the base/default, always shown); the
|
|
317
|
+
* compiler derives a `--detail`/`detail` selector and gates fields/expands by
|
|
318
|
+
* canonical index.
|
|
319
|
+
*/
|
|
320
|
+
export interface PackDisclosure {
|
|
321
|
+
/** Ordered canonical level names (`⊆ constants.DETAIL_LEVELS`). */
|
|
322
|
+
readonly levels: readonly string[];
|
|
323
|
+
/** Default level when none is requested (must be one of `levels`). */
|
|
324
|
+
readonly default?: string;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* A declarative list filter: a CLI/MCP parameter constraining one SELECT
|
|
329
|
+
* variable. Filters compile INTO the generated query, as predicates over the
|
|
330
|
+
* author query read as a sub-select — the author's text is never modified, and
|
|
331
|
+
* a caller's value is bound through a `VALUES` block rather than spliced into
|
|
332
|
+
* query text, so filter input still cannot inject SPARQL. Compiling them in is
|
|
333
|
+
* what puts filtering on the right side of a page: a predicate over returned
|
|
334
|
+
* rows would decide over whatever the page happened to contain.
|
|
335
|
+
*/
|
|
336
|
+
export interface PackFilter {
|
|
337
|
+
/** Parameter name — a single lowercase word (`--param` / MCP key). */
|
|
338
|
+
readonly param: string;
|
|
339
|
+
/** SELECT variable the filter constrains (without `?`). */
|
|
340
|
+
readonly variable: string;
|
|
341
|
+
/**
|
|
342
|
+
* Allowed values; anything else is rejected with INVALID_INPUT and the set
|
|
343
|
+
* projects to an enum. Omitted when the value set is data-driven (a free
|
|
344
|
+
* string matched case-insensitively against the variable).
|
|
345
|
+
*/
|
|
346
|
+
readonly values?: readonly string[];
|
|
347
|
+
/**
|
|
348
|
+
* How a provided value is compared to the row's cell.
|
|
349
|
+
*
|
|
350
|
+
* `"exact"` (the default) compares the whole cell. `"set"` reads the cell as
|
|
351
|
+
* a SPACE-SEPARATED set and matches when ANY member equals the provided
|
|
352
|
+
* value — the shape a `GROUP_CONCAT` produces, for a dimension where one row
|
|
353
|
+
* legitimately belongs to several values at once. The standing case is a
|
|
354
|
+
* hierarchy: a standard filed under `testing-unit` is, by the definition of
|
|
355
|
+
* the hierarchy, also a `testing` standard, and a filter that compared only
|
|
356
|
+
* the leaf answered `--category testing` with 1 of 8 — a silently wrong
|
|
357
|
+
* answer, exit 0.
|
|
358
|
+
*
|
|
359
|
+
* A `"set"` cell is computed by the author's own `GROUP BY`, so its predicate
|
|
360
|
+
* can only run AFTER aggregation. That is why a filtered list wraps the
|
|
361
|
+
* author query in a sub-select rather than appending to it, and why a
|
|
362
|
+
* filterable story must project its variables by name.
|
|
363
|
+
*/
|
|
364
|
+
readonly match?: "exact" | "set";
|
|
365
|
+
/**
|
|
366
|
+
* Where the dimension's VOCABULARY lives in the graph. REQUIRED for a filter
|
|
367
|
+
* with no declared {@link values} — a filter declaring neither is refused.
|
|
368
|
+
*
|
|
369
|
+
* A value-free filter rejects a value the data does not carry. The question is
|
|
370
|
+
* what "the data" means. The rows a list just returned are the wrong answer:
|
|
371
|
+
* they are a POPULATION, and a value can be real while no row carries it — a
|
|
372
|
+
* category the graph declares with zero standards filed under it, a
|
|
373
|
+
* `ex:ConceptType` no concept uses yet. Validating against rows turns those
|
|
374
|
+
* into `INVALID_INPUT`, when the honest answer is a calm empty list.
|
|
375
|
+
*
|
|
376
|
+
* So the vocabulary is read from the graph directly, from the same terms the
|
|
377
|
+
* surface that ENUMERATES it reads (`standard categories` reads `cs:Category`
|
|
378
|
+
* / `cs:slug`; so does the `category` filter's vocabulary query). The ruling
|
|
379
|
+
* this honours is "the graph is the vocabulary, don't hard-code the slugs" —
|
|
380
|
+
* rows were never the graph, just the part of it that answered.
|
|
381
|
+
*
|
|
382
|
+
* A value-free filter USED to fall back to the observed rows — knowingly
|
|
383
|
+
* narrower than the truth, but the only evidence available. Now that a list
|
|
384
|
+
* answers with a PAGE that fallback is not merely narrow, it is wrong: a real
|
|
385
|
+
* value outside the window would be refused as a bad argument, with a
|
|
386
|
+
* truncated list of alternatives. So the fallback is gone and the declaration
|
|
387
|
+
* takes its place — a filter names `values` or a vocabulary, and one that
|
|
388
|
+
* names neither is refused where it is declared.
|
|
389
|
+
*/
|
|
390
|
+
readonly vocabulary?: PackFilterVocabulary;
|
|
391
|
+
/**
|
|
392
|
+
* In place of {@link values} or a {@link vocabulary}: a value is a literal
|
|
393
|
+
* name or IRI of that noun (never a pattern), resolved as `<noun> lookup`
|
|
394
|
+
* resolves one, and rows are kept by the IRIs it reaches, matched against
|
|
395
|
+
* {@link entity}.
|
|
396
|
+
*/
|
|
397
|
+
readonly noun?: string;
|
|
398
|
+
/**
|
|
399
|
+
* The projected SELECT variable holding the IRI a {@link noun} filter
|
|
400
|
+
* constrains. Left out of the rows unless a column displays it.
|
|
401
|
+
*/
|
|
402
|
+
readonly entity?: string;
|
|
403
|
+
/**
|
|
404
|
+
* The path from {@link entity} to the named entity when they are different
|
|
405
|
+
* nodes (`^ex:madeBy` from a row's maker to its widgets); absent, they are one.
|
|
406
|
+
*/
|
|
407
|
+
readonly via?: string;
|
|
408
|
+
/** Help text (defaults to a generated description). */
|
|
409
|
+
readonly description?: string;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/** The authoritative value set for a value-free {@link PackFilter}. */
|
|
413
|
+
export interface PackFilterVocabulary {
|
|
414
|
+
/** SPARQL SELECT producing one row per admissible value. */
|
|
415
|
+
readonly query: string;
|
|
416
|
+
/**
|
|
417
|
+
* SELECT variable carrying the value (without `?`). Defaults to the filter's
|
|
418
|
+
* own {@link PackFilter.variable}.
|
|
419
|
+
*/
|
|
420
|
+
readonly variable?: string;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Free-text search over list rows: a `--search` string keeping a row when ANY
|
|
425
|
+
* named SELECT variable contains the term (case-insensitive substring).
|
|
426
|
+
* Compiled into the generated query alongside the filters, with the term bound
|
|
427
|
+
* through a `VALUES` block rather than spliced into query text.
|
|
428
|
+
*/
|
|
429
|
+
export interface PackSearch {
|
|
430
|
+
/** SELECT variables searched (without `?`). */
|
|
431
|
+
readonly variables: readonly string[];
|
|
432
|
+
/** Help text (defaults to a generated description). */
|
|
433
|
+
readonly description?: string;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/** The shape of a verb path (`sources update`): a noun, optionally a verb — never a command line. */
|
|
437
|
+
export const VERB_PATH_PATTERN = /^[a-z][a-z0-9-]*( [a-z][a-z0-9-]*)?$/;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* A call as a story writes it: a verb path and the params to make it with.
|
|
441
|
+
* Structurally the kernel's `Call` (`spec/types.ts`), restated here because this
|
|
442
|
+
* file is on the distribution config's import graph and may import nothing.
|
|
443
|
+
*/
|
|
444
|
+
export interface PackCall {
|
|
445
|
+
readonly verb: string;
|
|
446
|
+
readonly params?: Readonly<Record<string, unknown>>;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/** Opt-in empty-result recovery for a list story. */
|
|
450
|
+
export interface PackEmptyRecovery {
|
|
451
|
+
/** Human-readable cause + fix (e.g. which packages provide the data). */
|
|
452
|
+
readonly message: string;
|
|
453
|
+
/**
|
|
454
|
+
* The call that fixes the emptiness (`{ verb: "sources update" }`). A verb
|
|
455
|
+
* path, never a binary name: the consuming distribution's renderer spells it
|
|
456
|
+
* for the surface it prints on, so a story stays portable across both.
|
|
457
|
+
*/
|
|
458
|
+
readonly call?: PackCall;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* What a story half tells a caller choosing between tools. Optional in the
|
|
463
|
+
* grammar, because third-party packs predate it; the distribution's own stories
|
|
464
|
+
* are held to declaring both (`callRule.test.ts`).
|
|
465
|
+
*/
|
|
466
|
+
export interface PackGuidance {
|
|
467
|
+
/** The question a person would ask, in their words, as a bare clause ("when asked …"). */
|
|
468
|
+
readonly useWhen?: string;
|
|
469
|
+
/** One real call's params (never empty) — the verb is implied, and both spellings derive. */
|
|
470
|
+
readonly example?: Readonly<Record<string, unknown>>;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
/** The list half of a pack (always SPARQL-sourced). */
|
|
474
|
+
export interface PackList {
|
|
475
|
+
/** SPARQL SELECT producing one row per item. */
|
|
476
|
+
readonly query: string;
|
|
477
|
+
/** Columns to render, referencing SELECT variables. */
|
|
478
|
+
readonly columns: readonly PackColumn[];
|
|
479
|
+
/** Declarative filters projected to CLI flags and MCP parameters. */
|
|
480
|
+
readonly filters?: readonly PackFilter[];
|
|
481
|
+
/** Free-text search projected to a `--search` flag / `search` parameter. */
|
|
482
|
+
readonly search?: PackSearch;
|
|
483
|
+
/** Opt-in empty-result recovery (typed EMPTY_RESULTS instead of an empty list). */
|
|
484
|
+
readonly emptyRecovery?: PackEmptyRecovery;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* An additional list-shaped verb: `<noun> <verb>` compiled through the SAME
|
|
489
|
+
* machinery as `list` (e.g. standard's `categories`). May not collide with the
|
|
490
|
+
* compiled `list`/`lookup`/`sample` verbs.
|
|
491
|
+
*/
|
|
492
|
+
export interface PackVerb extends PackList, PackGuidance {
|
|
493
|
+
/** Verb name (kebab-case), e.g. `"categories"`. */
|
|
494
|
+
readonly verb: string;
|
|
495
|
+
/** CLI description for the command. */
|
|
496
|
+
readonly description?: string;
|
|
497
|
+
/** MCP tool description (defaults to the CLI description). */
|
|
498
|
+
readonly toolDescription?: string;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* The sample capability: `<noun> sample [count]` returns 1–5 randomly selected
|
|
503
|
+
* complete entities (resolved through the lookup path at the HIGHEST level).
|
|
504
|
+
*/
|
|
505
|
+
export interface PackSample extends PackGuidance {
|
|
506
|
+
/** Default sample count when none is requested (1–5; default 2). */
|
|
507
|
+
readonly count?: number;
|
|
508
|
+
/**
|
|
509
|
+
* Omit the `[count]` positional — the sample always returns {@link count}
|
|
510
|
+
* (default 2) entries. Used where the covenant freezes a no-argument sample
|
|
511
|
+
* (`block`/`modifier`/`token`); `standard` keeps the `[count]` positional.
|
|
512
|
+
*/
|
|
513
|
+
readonly fixedCount?: boolean;
|
|
514
|
+
/** CLI description for the command. */
|
|
515
|
+
readonly description?: string;
|
|
516
|
+
/** MCP tool description (defaults to the CLI description). */
|
|
517
|
+
readonly toolDescription?: string;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Per-family autocomplete override for a lookup's `<name>` positional. Name
|
|
522
|
+
* completion is DERIVED-BY-DEFAULT from the family's index type; this tunes or
|
|
523
|
+
* opts out of it. Absent means "completion on, engine defaults".
|
|
524
|
+
*/
|
|
525
|
+
export interface PackCompletion {
|
|
526
|
+
/** `false` opts the family out of name completion (default: on). */
|
|
527
|
+
readonly enabled?: boolean;
|
|
528
|
+
/** Match strategy against the partial (default: substring). */
|
|
529
|
+
readonly match?: "prefix" | "substring" | "fuzzy";
|
|
530
|
+
/** Minimum typed chars before the shell execs completion (default: global). */
|
|
531
|
+
readonly minChars?: number;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* How much an entity's containing SCOPE is worth when a name reaches several
|
|
536
|
+
* entities at once — the ranking factor {@link PackLookup.scopeWeight} declares.
|
|
537
|
+
*
|
|
538
|
+
* DERIVED, never enumerated. The scope's own name is a path (`Global`,
|
|
539
|
+
* `Apps/Launchpad`), so its DEPTH is a fact the graph already states, and a
|
|
540
|
+
* scope nobody has heard of yet inherits its place the day it appears. An
|
|
541
|
+
* enumerated ranking would have to be edited for each new one, and the one
|
|
542
|
+
* nobody edited would silently rank first.
|
|
543
|
+
*
|
|
544
|
+
* The weight falls by {@link falloff} per level below the top, so the top level
|
|
545
|
+
* is worth 1 and each nesting step costs the same again; floored at 0, so a very
|
|
546
|
+
* deep scope can never turn negative and invert the type factor it multiplies.
|
|
547
|
+
*
|
|
548
|
+
* {@link asserted} is the retirement path for the DERIVATION, not for this
|
|
549
|
+
* declaration: an asserted value wins over the derived one
|
|
550
|
+
* (`COALESCE(?asserted, ?derived)`), so the day the ontology states the ranking
|
|
551
|
+
* itself, the depth heuristic stops mattering and `falloff` becomes inert.
|
|
552
|
+
*
|
|
553
|
+
* The declaration itself must stay. Every read of {@link asserted} is reached
|
|
554
|
+
* through this object, so deleting it does not fall back to the ontology's rank
|
|
555
|
+
* — it removes scope ranking from the query altogether and silently returns the
|
|
556
|
+
* lookup to `STR(?uri)` order, which is the defect this exists to fix. What
|
|
557
|
+
* retires is the derivation, and what remains is `via` plus `asserted`.
|
|
558
|
+
*/
|
|
559
|
+
export interface PackScopeWeight {
|
|
560
|
+
/** The entity → scope edge (e.g. `ex:region`). */
|
|
561
|
+
readonly via: string;
|
|
562
|
+
/**
|
|
563
|
+
* The scope property holding its path-shaped name (e.g. `ex:name`), whose
|
|
564
|
+
* `/`-separated depth derives the weight.
|
|
565
|
+
*
|
|
566
|
+
* It must be the NAME, not the IRI: the live tiers spell the same scope
|
|
567
|
+
* `ex:europe_spain` and `"Europe/Spain"`, and only the name carries the
|
|
568
|
+
* separator that makes the hierarchy legible.
|
|
569
|
+
*/
|
|
570
|
+
readonly by: string;
|
|
571
|
+
/** Score cost per level below the top, 0–1 (e.g. 0.2 → 1, 0.8, 0.6, …). */
|
|
572
|
+
readonly falloff: number;
|
|
573
|
+
/** An asserted weight on the scope, which WINS over the derived one. */
|
|
574
|
+
readonly asserted?: string;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* The lookup half of a pack. The query is generated from `by` and `type`/`types`
|
|
579
|
+
* — user-supplied names are escaped by the generator, never interpolated by the
|
|
580
|
+
* author. The `source` selects the field-fetch strategy; the name→URI resolve is
|
|
581
|
+
* ALWAYS generated SPARQL regardless of source (an implementation detail, not a
|
|
582
|
+
* second declared source).
|
|
583
|
+
*/
|
|
584
|
+
export interface PackLookup extends PackGuidance {
|
|
585
|
+
/**
|
|
586
|
+
* Field-fetch strategy (default `"sparql"`). `"graphql"` keeps the SPARQL
|
|
587
|
+
* name→URI resolve, then fetches all fields/sections/expands in ONE generated
|
|
588
|
+
* document executed in-process against the compiled schema. Both sources
|
|
589
|
+
* unwrap to the same flat {@link PackEntity} shape.
|
|
590
|
+
*/
|
|
591
|
+
readonly source?: "sparql" | "graphql";
|
|
592
|
+
/** Property whose value names the entity — prefixed name or IRI. */
|
|
593
|
+
readonly by: string;
|
|
594
|
+
/**
|
|
595
|
+
* What names an entity that carries no {@link by} value. Absent (the default)
|
|
596
|
+
* means NOTHING does: the `by` triple is required, and an entity without one
|
|
597
|
+
* is not addressable by name and never drawn by `sample`.
|
|
598
|
+
*
|
|
599
|
+
* `"iri"` opts the family into an IRI-DERIVED name — the local name after the
|
|
600
|
+
* last `#`/`/`, with dot-separated hierarchy segments published as slashes
|
|
601
|
+
* (`cs:react.component.props` → `react/component/props`).
|
|
602
|
+
*
|
|
603
|
+
* DECLARE IT ONLY WHEN THE STORY'S `list` PUBLISHES THE SAME DERIVED NAME.
|
|
604
|
+
* The option exists to keep the two halves of the two-step grammar over ONE
|
|
605
|
+
* population: `standard list` synthesizes a name for the ~87% of code
|
|
606
|
+
* standards carrying no `cs:name`, so `standard lookup` must answer to it.
|
|
607
|
+
* Turning it on where the list does NOT publish such a name is the mirror
|
|
608
|
+
* defect — `token list` requires `ex:tokenId`, so a `ex:Token` without one
|
|
609
|
+
* would become addressable and sampleable under a name the list never
|
|
610
|
+
* published.
|
|
611
|
+
*
|
|
612
|
+
* Requires a class constraint ({@link type}/{@link types}): the derived name
|
|
613
|
+
* is only as trustworthy as the class that vouches for the entity, and
|
|
614
|
+
* without one there is nothing to bound the scan with either.
|
|
615
|
+
*/
|
|
616
|
+
readonly nameFallback?: "iri";
|
|
617
|
+
/** Optional single class constraint — prefixed name or IRI. */
|
|
618
|
+
readonly type?: string;
|
|
619
|
+
/** CLI description for the lookup command (defaults to a generated one). */
|
|
620
|
+
readonly description?: string;
|
|
621
|
+
/** MCP tool description for the lookup verb (authored one-liner). */
|
|
622
|
+
readonly toolDescription?: string;
|
|
623
|
+
/**
|
|
624
|
+
* Class constraints when entities span several classes — projected as a SPARQL
|
|
625
|
+
* VALUES constraint on the name resolve. Mutually exclusive with `type`.
|
|
626
|
+
*/
|
|
627
|
+
readonly types?: readonly string[];
|
|
628
|
+
/**
|
|
629
|
+
* Relative importance per addressed type, prefixed type → 0–1 (unlisted types
|
|
630
|
+
* default to 1). Editorial judgement about which of a noun's classes matters
|
|
631
|
+
* most, declared as DATA rather than frozen into the kernel — it feeds the MCP
|
|
632
|
+
* listing's `annotations.priority`, breaks ties in URI-completion ranking, AND
|
|
633
|
+
* is one factor of the score a name resolve ORDERS BY, so a `ex:Subcomponent`
|
|
634
|
+
* at 0.6 sinks below every component at equal match.
|
|
635
|
+
*
|
|
636
|
+
* A separate map rather than an entry shape on `types` so `types` keeps its
|
|
637
|
+
* flat `readonly string[]` form and the addition is non-breaking. A key naming
|
|
638
|
+
* a type the lookup does not address is REJECTED, not ignored: a silent no-op
|
|
639
|
+
* is how a weight that never applied survives review.
|
|
640
|
+
*/
|
|
641
|
+
readonly weights?: Readonly<Record<string, number>>;
|
|
642
|
+
/**
|
|
643
|
+
* The OTHER factor of that score: how much an entity's containing scope is
|
|
644
|
+
* worth, derived from how DEEP that scope sits in its own hierarchy.
|
|
645
|
+
*
|
|
646
|
+
* {@link weights} answers "which KIND of thing did they mean"; this answers
|
|
647
|
+
* "whose?". They multiply rather than tiebreak, because neither subsumes the
|
|
648
|
+
* other: a whole component in a narrow scope still beats a mere part of a
|
|
649
|
+
* block in the widest one.
|
|
650
|
+
*/
|
|
651
|
+
readonly scopeWeight?: PackScopeWeight;
|
|
652
|
+
/**
|
|
653
|
+
* GraphQL type or interface the generated document's inline fragment targets
|
|
654
|
+
* (`source: "graphql"` only). Defaults to the local name of `type`; required
|
|
655
|
+
* when `types` is used (an interface covering all of them, e.g. `"UIBlock"`).
|
|
656
|
+
*/
|
|
657
|
+
readonly graphqlType?: string;
|
|
658
|
+
/** Inline fields shown under the entity title. */
|
|
659
|
+
readonly fields?: readonly PackField[];
|
|
660
|
+
/** Long-form sections shown after the fields. */
|
|
661
|
+
readonly sections?: readonly PackSection[];
|
|
662
|
+
/** Multi-valued nested projections (structured sections). */
|
|
663
|
+
readonly expand?: readonly PackExpand[];
|
|
664
|
+
/** Progressive-disclosure levels; enables the derived `--detail` flag. */
|
|
665
|
+
readonly disclosure?: PackDisclosure;
|
|
666
|
+
/** Sample capability: `true` for defaults, or a configured sample. */
|
|
667
|
+
readonly sample?: true | PackSample;
|
|
668
|
+
/** Autocomplete override for the `<name>` positional (derive-by-default). */
|
|
669
|
+
readonly completion?: PackCompletion;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* The lookup another story's noun declares, by noun — how a {@link PackFilter}
|
|
674
|
+
* naming a `noun` reaches that noun's resolver. A story is compiled alone, so
|
|
675
|
+
* whoever compiles it supplies this over the stories it knows. It may throw a
|
|
676
|
+
* CONFIG_ERROR of its own when it knows why a noun has no lookup.
|
|
677
|
+
*/
|
|
678
|
+
export type NounLookups = (noun: string) => PackLookup | undefined;
|
|
679
|
+
|
|
680
|
+
/** A pack list row / flat lookup base: variable name → string value. */
|
|
681
|
+
export type PackRow = Record<string, string>;
|
|
682
|
+
|
|
683
|
+
/**
|
|
684
|
+
* What a list-shaped verb answers with: one page of rows, and whether more
|
|
685
|
+
* follow.
|
|
686
|
+
*
|
|
687
|
+
* The ROWS are still the payload — `formatters.json` projects this to
|
|
688
|
+
* {@link rows} alone, so `--format json` and the MCP tool result stay the bare
|
|
689
|
+
* array they always were and nothing downstream had to learn a new shape. The
|
|
690
|
+
* page's own facts ride the `meta` seam into the envelope's `meta` (the tier
|
|
691
|
+
* scope and the next-page cursor, merged by both projectors), the same channel
|
|
692
|
+
* a calm empty result already uses. That is deliberate: a caller reading the
|
|
693
|
+
* data reads data, and a caller who needs to know there is more is told in the
|
|
694
|
+
* one place this surface already puts things the data cannot say about itself.
|
|
695
|
+
*/
|
|
696
|
+
export interface PackPage {
|
|
697
|
+
/** This page's rows, in the story's own order. */
|
|
698
|
+
readonly rows: readonly PackRow[];
|
|
699
|
+
/**
|
|
700
|
+
* The filters this read was narrowed by, as the caller spelled them — absent
|
|
701
|
+
* when the read was unfiltered.
|
|
702
|
+
*
|
|
703
|
+
* Carried because a zero-row answer has something to say that its rows
|
|
704
|
+
* cannot: which arguments narrowed it. A reader who typed `--kind input` and
|
|
705
|
+
* got nothing has to see that it was applied and came back empty, so the
|
|
706
|
+
* empty-state sentence names the filters in force. The story's
|
|
707
|
+
* `emptyRecovery` — which speaks about the population, and is worded to hold
|
|
708
|
+
* whether or not a filter is in force — prints under that sentence, the same
|
|
709
|
+
* as it prints on its own when nothing narrowed the read. The renderer cannot
|
|
710
|
+
* re-derive this: it sees a page, not the arguments, so the run body records
|
|
711
|
+
* what it narrowed by.
|
|
712
|
+
*/
|
|
713
|
+
readonly filters?: readonly PackAppliedFilter[];
|
|
714
|
+
/**
|
|
715
|
+
* The cursor that asks for the rows after this page, absent when this page is
|
|
716
|
+
* the last. Its presence IS the "more rows exist" answer. The list formatters
|
|
717
|
+
* project it onto the envelope as `meta.nextCursor`.
|
|
718
|
+
*/
|
|
719
|
+
readonly nextAfter?: string;
|
|
720
|
+
/** The limit this page was cut to, for the notice that reports it. */
|
|
721
|
+
readonly limit: number;
|
|
722
|
+
/**
|
|
723
|
+
* The tier scope this read was narrowed to, absent when the story is not
|
|
724
|
+
* tiered or the caller asked for every tier.
|
|
725
|
+
*
|
|
726
|
+
* Carried for the same reason {@link filters} is: the rows cannot say that a
|
|
727
|
+
* whole part of the population was never considered. A reader who sees 175
|
|
728
|
+
* blocks under a heading that says `(175)` reads it as the design system; the
|
|
729
|
+
* scope is how the answer admits it is one tier chain of it.
|
|
730
|
+
*/
|
|
731
|
+
readonly scope?: PageTierScope;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
/** The tier scope a page was read under, as a caller can read it back. */
|
|
735
|
+
export interface PageTierScope {
|
|
736
|
+
/**
|
|
737
|
+
* The in-scope tiers, in the spelling the `--tier` flag and the `Tier` column
|
|
738
|
+
* use (the tier IRI's local name), base first and then shallowest first.
|
|
739
|
+
*/
|
|
740
|
+
readonly tiers: readonly string[];
|
|
741
|
+
/**
|
|
742
|
+
* Rows of the WHOLE filtered answer per tier, keyed by local name: every
|
|
743
|
+
* in-scope tier (0 when empty), the out-of-scope tiers holding some, and
|
|
744
|
+
* {@link UNTIERED_KEY} for rows in no tier. First page only.
|
|
745
|
+
*/
|
|
746
|
+
readonly counts?: Readonly<Record<string, number>>;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/** The `counts` key for rows whose entity is in no tier (no tier is named so). */
|
|
750
|
+
export const UNTIERED_KEY = "no tier";
|
|
751
|
+
|
|
752
|
+
/** One filter a list read was narrowed by, as the caller spelled it. */
|
|
753
|
+
export interface PackAppliedFilter {
|
|
754
|
+
/** The parameter name (its CLI flag is `--<param>`). */
|
|
755
|
+
readonly param: string;
|
|
756
|
+
/** The value(s) supplied, already joined for display. */
|
|
757
|
+
readonly value: string;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
/**
|
|
761
|
+
* A child record under an expand. Scalar values come from child fields; a nested
|
|
762
|
+
* expand contributes either a collapsed string array (single-field select) or
|
|
763
|
+
* one small record per grandchild.
|
|
764
|
+
*/
|
|
765
|
+
export type PackChildRow = Record<
|
|
766
|
+
string,
|
|
767
|
+
string | readonly string[] | readonly PackRow[]
|
|
768
|
+
>;
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* A looked-up pack entity: flat string values plus any expanded child arrays.
|
|
772
|
+
* Both fetch sources resolve to this same shape, so rendering, `--format json`,
|
|
773
|
+
* and the MCP envelope are identical downstream regardless of the fetch layer.
|
|
774
|
+
*/
|
|
775
|
+
export type PackEntity = Record<string, string | readonly PackChildRow[]>;
|
|
776
|
+
|
|
777
|
+
/** One declarative read story: a noun with its preferred queries. */
|
|
778
|
+
export interface PackDefinition extends PackGuidance {
|
|
779
|
+
/** Command noun (kebab-case), e.g. `"standard"` → `pragma standard list`. */
|
|
780
|
+
readonly noun: string;
|
|
781
|
+
/** CLI description for the list command. */
|
|
782
|
+
readonly description?: string;
|
|
783
|
+
/** MCP tool description (defaults to the CLI description). */
|
|
784
|
+
readonly toolDescription?: string;
|
|
785
|
+
/**
|
|
786
|
+
* The list story. Optional so a pack can serve a noun that is addressable but
|
|
787
|
+
* not enumerable — a lookup with no list. At least one of `list`/`lookup`
|
|
788
|
+
* must be declared.
|
|
789
|
+
*/
|
|
790
|
+
readonly list?: PackList;
|
|
791
|
+
/** Additional list-shaped verbs beyond `list` (e.g. `categories`). */
|
|
792
|
+
readonly verbs?: readonly PackVerb[];
|
|
793
|
+
/** The lookup story. */
|
|
794
|
+
readonly lookup?: PackLookup;
|
|
795
|
+
/**
|
|
796
|
+
* Markdown narrating how this pack's domain is made — its ontology/graph
|
|
797
|
+
* story. Data, like the queries. Surfaced storelessly (off the effective
|
|
798
|
+
* modules) by `pragma colophon`, after pragma's own built-in colophon.
|
|
799
|
+
*/
|
|
800
|
+
readonly colophon?: string;
|
|
801
|
+
/**
|
|
802
|
+
* The tier hierarchy this noun's entities carry, which SCOPES every read of
|
|
803
|
+
* them. Absent means unscoped — the read answers from every tier, as every
|
|
804
|
+
* read did before the scope existed.
|
|
805
|
+
*/
|
|
806
|
+
readonly tierScope?: PackTierScope;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
* The tier hierarchy this noun's entities belong to, and the scope every read
|
|
811
|
+
* of them is narrowed by.
|
|
812
|
+
*
|
|
813
|
+
* DECLARED PER NOUN, because being tiered is a property of the entities: in
|
|
814
|
+
* the example, menus carry an `ex:region` and courses carry nothing of the
|
|
815
|
+
* kind. A
|
|
816
|
+
* noun that declares this gets the scope compiled into every list it declares
|
|
817
|
+
* and applied to its lookup; a noun that does not is read exactly as before.
|
|
818
|
+
*
|
|
819
|
+
* WHY THE HIERARCHY IS A NAME AND NOT AN EDGE. The shipped graph asserts no
|
|
820
|
+
* parent predicate on a tier — `ex:europe_spain` is `a ex:Tier` with a
|
|
821
|
+
* `ex:name "Europe/Spain"`, and that slash IS the hierarchy: `Europe/Spain` sits under
|
|
822
|
+
* `Europe`, which sits under nothing. So the parent of a tier is the tier whose
|
|
823
|
+
* name is its own name minus the last `/` segment, exactly the derivation
|
|
824
|
+
* {@link PackScopeWeight} already ranks by ("the depth is the `/` count in the
|
|
825
|
+
* tier's OWN `ex:name`, not in its IRI"). Reading the hierarchy from the same
|
|
826
|
+
* place twice is what keeps the ranking and the scope from disagreeing about
|
|
827
|
+
* which tier is above which. The day a parent edge is asserted upstream, `by`
|
|
828
|
+
* gives way to it and every reader here changes in one place.
|
|
829
|
+
*/
|
|
830
|
+
export interface PackTierScope {
|
|
831
|
+
/** The class whose instances ARE the tiers (e.g. `ex:Tier`). */
|
|
832
|
+
readonly type: string;
|
|
833
|
+
/** The entity → tier edge (e.g. `ex:region`), same term as `scopeWeight.via`. */
|
|
834
|
+
readonly via: string;
|
|
835
|
+
/**
|
|
836
|
+
* The tier property holding its path-shaped name (e.g. `ex:name`), whose
|
|
837
|
+
* `/`-separated segments ARE the hierarchy: `Europe/Spain` is a child of `Apps`,
|
|
838
|
+
* and a name with no `/` is top-level.
|
|
839
|
+
*/
|
|
840
|
+
readonly by: string;
|
|
841
|
+
/**
|
|
842
|
+
* The tier every other tier builds on, in scope whenever a scope is in force
|
|
843
|
+
* (e.g. `ex:global`).
|
|
844
|
+
*
|
|
845
|
+
* DECLARED, not inferred: nothing in the graph says which of the top-level
|
|
846
|
+
* tiers is the base — the design system's own colophon does ("`global` >
|
|
847
|
+
* `apps` > `apps/lxd`: a lower tier inherits and overrides the blocks of its
|
|
848
|
+
* ancestors"), and that is editorial judgement the ontology has not made yet,
|
|
849
|
+
* so it belongs in the declaration layer beside `weights` and `scopeWeight`.
|
|
850
|
+
* Without it a narrowed read would hide the very blocks the narrow tier
|
|
851
|
+
* inherits: `--tier apps_lxd` would answer with LXD's nine and not the 119
|
|
852
|
+
* global ones every LXD screen is actually built from.
|
|
853
|
+
*/
|
|
854
|
+
readonly base?: string;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
/** A validated pack definition paired with where it was declared. */
|
|
858
|
+
export interface PackEntry {
|
|
859
|
+
/** The package story file it came from, e.g. `@acme/recipes/stories/recipe.json`. */
|
|
860
|
+
readonly source: string;
|
|
861
|
+
readonly definition: PackDefinition;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* Which layer declared a story. The label alone cannot answer this — a label is
|
|
866
|
+
* free text for a human — and the difference changes what a failure MEANS.
|
|
867
|
+
*
|
|
868
|
+
* A generated query that names a prefix the graph does not bind is, from a
|
|
869
|
+
* `distribution` story, almost always an unbuilt store: the distribution's own
|
|
870
|
+
* stories and its packs ship together, so the terms exist as soon as anything is
|
|
871
|
+
* built. From a `config` or `package` story it is the opposite: the author named
|
|
872
|
+
* a prefix nothing binds, and no amount of building will conjure it. One is
|
|
873
|
+
* STORE_UNAVAILABLE with a `sources update` recovery, the other a CONFIG_ERROR
|
|
874
|
+
* naming the story — and telling them apart needs this at the failure site.
|
|
875
|
+
*/
|
|
876
|
+
export type StoryOrigin = "distribution" | "config" | "package";
|
|
877
|
+
|
|
878
|
+
/**
|
|
879
|
+
* A story's provenance, threaded from where it was declared down to the query
|
|
880
|
+
* that runs on its behalf.
|
|
881
|
+
*/
|
|
882
|
+
export interface StorySource {
|
|
883
|
+
/** Human-readable location, used verbatim in diagnostics. */
|
|
884
|
+
readonly label: string;
|
|
885
|
+
/** The layer that declared it. */
|
|
886
|
+
readonly origin: StoryOrigin;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/** A story the distribution itself declares (`pragma.conf.ts` and its kin). */
|
|
890
|
+
export const distributionSource = (label: string): StorySource => ({
|
|
891
|
+
label,
|
|
892
|
+
origin: "distribution",
|
|
893
|
+
});
|