@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,413 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `create` verbs — `component` / `package` / `playground` / `desk` /
|
|
3
|
+
* `application` / `page`, the SIX binding-level VerbSpecs (the MCP/covenant/reference grammar). Their params
|
|
4
|
+
* DERIVE mechanically from the generators' own prompts, projected at build
|
|
5
|
+
* time into `createSurface.generated.ts` — no hand mirrors, no flag aliases:
|
|
6
|
+
* the prompt names ARE the param/MCP-arg names, the FLAG tokens are
|
|
7
|
+
* `buildOptionInfo`'s registered forms (a default-true confirm registers
|
|
8
|
+
* ONLY `--no-<kebab>` — the covenant and the doc gate speak that vocabulary
|
|
9
|
+
* through the mount's registered-syntax seam, L-CIS-2), and `component`'s
|
|
10
|
+
* params are the FRAMEWORK UNION of its three declared leaves plus a
|
|
11
|
+
* required, positional `framework` enum derived from the tree segments
|
|
12
|
+
* (L-CIS). The CLI mounts the
|
|
13
|
+
* generator TREE itself (`create component react [component-path]` — see
|
|
14
|
+
* `mount.ts`); these specs are what MCP tools and the emitted surface read.
|
|
15
|
+
*
|
|
16
|
+
* LAZY DISPATCH (R9 + lazy-React): NOTHING of summon-core is imported
|
|
17
|
+
* statically — not even the UI-free projection subpath: this module sits on
|
|
18
|
+
* the capabilities barrel, so `--help` and `__complete` pay its import cost
|
|
19
|
+
* on every spawn, and the projection helpers it needs (`decideInteraction`,
|
|
20
|
+
* `refusalMessage`, `toKebabCase`, …) are only ever called inside `run`.
|
|
21
|
+
* `run` lazily `import()`s `pickGenerator` + summon-core + the projection, so
|
|
22
|
+
* `buildProgram` / `--help` / `__complete` / reads never load summon-core or
|
|
23
|
+
* the generators — and `create --yes` never loads React. The lazy-graph
|
|
24
|
+
* guard in `lazy.test.ts` pins the boundary.
|
|
25
|
+
*/
|
|
26
|
+
import { isAbsolute } from "node:path";
|
|
27
|
+
import { BIN_NAME } from "../../constants.js";
|
|
28
|
+
import { PragmaError } from "../../kernel/error/index.js";
|
|
29
|
+
import { bindingFor, CREATE_BINDINGS, CREATE_SURFACE, choiceValues, } from "./constants.js";
|
|
30
|
+
import { createFormatters, formatCreatePlan } from "./create.render.js";
|
|
31
|
+
import { generatorToParams, promptToParam } from "./generatorToVerbSpec.js";
|
|
32
|
+
import { isModuleNotFound } from "./moduleNotFound.js";
|
|
33
|
+
import { assertInsideWorkspace } from "./pathJail.js";
|
|
34
|
+
export { isModuleNotFound };
|
|
35
|
+
// =============================================================================
|
|
36
|
+
// Params, derived from the projected surface (createSurface.generated.ts)
|
|
37
|
+
// =============================================================================
|
|
38
|
+
/**
|
|
39
|
+
* A binding's choice — its paths' second segments as a positional enum
|
|
40
|
+
* (`create component <framework>`). REQUIRED unless the binding declares a
|
|
41
|
+
* default: summon has no default framework, and neither does the projection
|
|
42
|
+
* of it.
|
|
43
|
+
*/
|
|
44
|
+
function choiceParam(binding) {
|
|
45
|
+
const choice = binding.choice;
|
|
46
|
+
return {
|
|
47
|
+
kind: "enum",
|
|
48
|
+
name: choice.name,
|
|
49
|
+
doc: choice.doc,
|
|
50
|
+
values: choiceValues(binding),
|
|
51
|
+
...(choice.default === undefined
|
|
52
|
+
? { required: true }
|
|
53
|
+
: { default: choice.default }),
|
|
54
|
+
positional: true,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The UNION of a binding's leaves' prompts (A4): first-seen order over the
|
|
59
|
+
* declared path order; a prompt identical across all declaring leaves keeps
|
|
60
|
+
* its default; a prompt whose default DIFFERS across leaves omits it
|
|
61
|
+
* (`required: false` — the selected leaf's own prompt default applies at run
|
|
62
|
+
* time); a prompt not present on every leaf gets its doc suffixed with the
|
|
63
|
+
* declaring leaves.
|
|
64
|
+
*/
|
|
65
|
+
function unionChoiceParams(binding) {
|
|
66
|
+
const paths = binding.paths;
|
|
67
|
+
const byName = new Map();
|
|
68
|
+
const order = [];
|
|
69
|
+
for (const commandPath of paths) {
|
|
70
|
+
const leaf = commandPath.split("/")[1];
|
|
71
|
+
for (const prompt of surfaceFor(commandPath).prompts) {
|
|
72
|
+
let entry = byName.get(prompt.name);
|
|
73
|
+
if (!entry) {
|
|
74
|
+
entry = { prompt, leaves: [], defaults: [] };
|
|
75
|
+
byName.set(prompt.name, entry);
|
|
76
|
+
order.push(prompt.name);
|
|
77
|
+
}
|
|
78
|
+
entry.leaves.push(leaf);
|
|
79
|
+
entry.defaults.push(prompt.default);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const choiceName = binding.choice?.name ?? "";
|
|
83
|
+
return order.map((name) => {
|
|
84
|
+
const entry = byName.get(name);
|
|
85
|
+
const universal = entry.leaves.length === paths.length;
|
|
86
|
+
const agreed = entry.defaults.every((value) => Object.is(value, entry.defaults[0]));
|
|
87
|
+
const param = promptToParam(agreed ? entry.prompt : { ...entry.prompt, default: undefined });
|
|
88
|
+
return {
|
|
89
|
+
...param,
|
|
90
|
+
...(universal
|
|
91
|
+
? {}
|
|
92
|
+
: { doc: `${param.doc} (${choiceName}s: ${entry.leaves.join(", ")})` }),
|
|
93
|
+
...(agreed ? {} : { required: false }),
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/** The projected surface for a declared path (fails loud on a stale build). */
|
|
98
|
+
function surfaceFor(commandPath) {
|
|
99
|
+
const surface = CREATE_SURFACE[commandPath];
|
|
100
|
+
if (!surface) {
|
|
101
|
+
throw new Error(`the generator surface carries no entry for declared path "${commandPath}" — rerun the distribution's build`);
|
|
102
|
+
}
|
|
103
|
+
return surface;
|
|
104
|
+
}
|
|
105
|
+
/** A binding's params: its choice and the union of its leaves', or its one leaf's. */
|
|
106
|
+
function paramsOf(binding) {
|
|
107
|
+
return binding.choice === undefined
|
|
108
|
+
? generatorToParams(surfaceFor(binding.paths[0]).prompts)
|
|
109
|
+
: [choiceParam(binding), ...unionChoiceParams(binding)];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The two value classes the shared prompt validators reject as workspace
|
|
113
|
+
* ESCAPES — absolute, and any `..` segment: exactly the jail's own
|
|
114
|
+
* non-symlink classes, which the round-9 reorder moved onto the validator
|
|
115
|
+
* tier. Used to keep the jail-tier `recovery` hint on those rejections.
|
|
116
|
+
*/
|
|
117
|
+
const isEscapeValue = (value) => typeof value === "string" &&
|
|
118
|
+
(isAbsolute(value) || value.split(/[/\\]/).includes(".."));
|
|
119
|
+
// =============================================================================
|
|
120
|
+
// The lazy run — the one-line summon↔pragma seam per invocation
|
|
121
|
+
// =============================================================================
|
|
122
|
+
/**
|
|
123
|
+
* Load the create runtime — the generator selector and summon-core.
|
|
124
|
+
*
|
|
125
|
+
* Lazy, and the specifiers stay STATIC so they remain analysable: importing
|
|
126
|
+
* these pulls summon-core and with it React, which must stay off `--help`,
|
|
127
|
+
* completion and every read. The generators load their own templates from their
|
|
128
|
+
* own packages on first `generate()`.
|
|
129
|
+
*
|
|
130
|
+
* A resolution failure means a broken or pruned install, and
|
|
131
|
+
* {@link isModuleNotFound} turns it into a clean refusal rather than an
|
|
132
|
+
* internal-bug report.
|
|
133
|
+
*/
|
|
134
|
+
async function loadCreateRuntime() {
|
|
135
|
+
try {
|
|
136
|
+
const [summon, projection, pick] = await Promise.all([
|
|
137
|
+
import("@canonical/summon-core"),
|
|
138
|
+
import("@canonical/summon-core/projection"),
|
|
139
|
+
import("./pickGenerator.js"),
|
|
140
|
+
]);
|
|
141
|
+
return { pickGenerator: pick.pickGenerator, summon, projection };
|
|
142
|
+
}
|
|
143
|
+
catch (cause) {
|
|
144
|
+
if (isModuleNotFound(cause)) {
|
|
145
|
+
throw new PragmaError({
|
|
146
|
+
code: "UNSUPPORTED",
|
|
147
|
+
message: "`create` cannot load its generator runtime — the `@canonical/summon-*` packages it depends on are missing from this install.",
|
|
148
|
+
recovery: {
|
|
149
|
+
message: `Reinstall ${BIN_NAME} to restore its generator dependencies.`,
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
throw cause;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Build the `create` Task for one invocation of a declared COMMAND PATH: pick
|
|
158
|
+
* the generator, pre-validate the provided answers (the shared validator
|
|
159
|
+
* tier), jail its output path (the host backstop, after validation),
|
|
160
|
+
* decide the interaction mode (the ONE shared decision — same function, same
|
|
161
|
+
* inputs as the summon bin), and return `execute` wired to the strategy the
|
|
162
|
+
* mode names.
|
|
163
|
+
*
|
|
164
|
+
* `params` are the EXPLICIT answers only (CLI flags/positional; MCP args
|
|
165
|
+
* carry schema defaults, which is that transport's contract). MCP keeps its
|
|
166
|
+
* plan-first/confirm path untouched — `decideInteraction` is CLI-only.
|
|
167
|
+
*
|
|
168
|
+
* @param commandPath - The declared command path (`component/react`, …).
|
|
169
|
+
* @param params - The provided answers for this invocation.
|
|
170
|
+
* @param rt - The pragma runtime.
|
|
171
|
+
* @returns A `Promise<Task<GeneratorResult>>` (the union's third arm) the
|
|
172
|
+
* dispatcher/MCP handler awaits into a Task before interpreting.
|
|
173
|
+
*/
|
|
174
|
+
export async function runCreate(commandPath, params, rt) {
|
|
175
|
+
// Lazy: importing these pulls summon-core (and with it React) — kept off every
|
|
176
|
+
// non-create path. The specifiers stay static so they remain analysable; the
|
|
177
|
+
// embedded `.ejs` manifest is injected here as the disk read's fallback.
|
|
178
|
+
const { pickGenerator, summon, projection } = await loadCreateRuntime();
|
|
179
|
+
const generator = await pickGenerator(commandPath);
|
|
180
|
+
const binding = bindingFor(commandPath);
|
|
181
|
+
// For a binding with a choice, the tree segment is not an answer: drop a
|
|
182
|
+
// stray choice key so the generator (whose prompts never include it) sees
|
|
183
|
+
// only its own answers. A binding without a choice may carry the same name
|
|
184
|
+
// as a real prompt — `package` is where a library chooses none|react|svelte
|
|
185
|
+
// — so it must survive.
|
|
186
|
+
const answers = { ...params };
|
|
187
|
+
if (binding.choice !== undefined)
|
|
188
|
+
delete answers[binding.choice.name];
|
|
189
|
+
// An answer this path refuses — one its siblings take and it cannot (the
|
|
190
|
+
// union schema offers it): refused when set, and never passed on.
|
|
191
|
+
for (const refusal of binding.refuse ?? []) {
|
|
192
|
+
if (refusal.path !== commandPath)
|
|
193
|
+
continue;
|
|
194
|
+
if (answers[refusal.param] === true) {
|
|
195
|
+
throw new PragmaError({ code: "UNSUPPORTED", message: refusal.message });
|
|
196
|
+
}
|
|
197
|
+
delete answers[refusal.param];
|
|
198
|
+
}
|
|
199
|
+
// Reject a flag/arg-provided answer that fails its prompt's own constraint,
|
|
200
|
+
// with a clean INVALID_INPUT (execute re-validates as a backstop). Runs
|
|
201
|
+
// BEFORE the jail: the path prompts' own validators reject absolute/`..`
|
|
202
|
+
// escapes, so an escaping output path fails the SHARED validator line in
|
|
203
|
+
// both hosts (the cross-CLI matrix) and the jail below stays the backstop
|
|
204
|
+
// its docblock claims.
|
|
205
|
+
const output = binding.output;
|
|
206
|
+
const pathParam = output?.under === undefined ? output?.param : undefined;
|
|
207
|
+
const invalid = summon.validateAnswers(generator.prompts, answers);
|
|
208
|
+
if (invalid !== null) {
|
|
209
|
+
// A rejection of the JAILED path param's escape classes (absolute /
|
|
210
|
+
// `..` — the two the round-9 reorder moved off the jail) attaches ONE
|
|
211
|
+
// workspace hint to BOTH classes — the jail's `..`-branch message —
|
|
212
|
+
// deliberately NOT reproducing the jail's per-branch hints (its
|
|
213
|
+
// absolute branch says "Use a path relative to the current
|
|
214
|
+
// directory."; those stay the jail's own, pinned in pathJail.test.ts).
|
|
215
|
+
// The message stays the validator's — the shared cross-host line. A
|
|
216
|
+
// non-escape rejection of the same param (e.g. casing) never carried
|
|
217
|
+
// recovery and still does not.
|
|
218
|
+
const escaped = pathParam !== undefined &&
|
|
219
|
+
invalid.startsWith(`Invalid --${projection.toKebabCase(pathParam)} `) &&
|
|
220
|
+
isEscapeValue(answers[pathParam]);
|
|
221
|
+
throw new PragmaError({
|
|
222
|
+
code: "INVALID_INPUT",
|
|
223
|
+
message: invalid,
|
|
224
|
+
...(escaped
|
|
225
|
+
? { recovery: { message: "The path must stay inside the workspace." } }
|
|
226
|
+
: {}),
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
// SEC-2: reject a path escaping the workspace BEFORE any effect runs — the
|
|
230
|
+
// host-level backstop behind the validators, and the only tier that catches
|
|
231
|
+
// a symlink RESOLVING outside the workspace.
|
|
232
|
+
if (pathParam)
|
|
233
|
+
assertInsideWorkspace(pathParam, answers[pathParam], rt.cwd);
|
|
234
|
+
if (output?.under !== undefined &&
|
|
235
|
+
typeof answers[output.param] === "string") {
|
|
236
|
+
const { under } = output;
|
|
237
|
+
const root = under.roots[String(answers[under.param])] ?? under.otherwise;
|
|
238
|
+
assertInsideWorkspace(output.param, `${root}/${answers[output.param]}`, rt.cwd);
|
|
239
|
+
}
|
|
240
|
+
// An ABSENT interaction context defaults to `yes: false` — nothing may
|
|
241
|
+
// silently auto-apply just because a caller forgot to say how it is driven.
|
|
242
|
+
const { isTTY, transport, yes, signal, abort } = rt.interaction ?? {
|
|
243
|
+
isTTY: false,
|
|
244
|
+
transport: "cli",
|
|
245
|
+
yes: false,
|
|
246
|
+
};
|
|
247
|
+
const stamp = summon.createGeneratorStamp(generator);
|
|
248
|
+
// MCP: params-or-error, plan-first/confirm — untouched by the decision
|
|
249
|
+
// table (an MCP call is never a terminal session).
|
|
250
|
+
if (transport === "mcp") {
|
|
251
|
+
const prompt = summon.mcpPrompt(answers);
|
|
252
|
+
rt.exec = {
|
|
253
|
+
cwd: rt.cwd,
|
|
254
|
+
promptHandler: prompt,
|
|
255
|
+
onEffectStart: summon.createStampOnEffectStart(stamp),
|
|
256
|
+
onLog: (_level, message) => process.stderr.write(`${message}\n`),
|
|
257
|
+
signal,
|
|
258
|
+
};
|
|
259
|
+
return summon.execute(generator, { prompt, params: answers, signal });
|
|
260
|
+
}
|
|
261
|
+
// The ONE interaction decision (R2) — the same function, over the same five
|
|
262
|
+
// inputs, as the summon bin. The mount refuses before ever loading this
|
|
263
|
+
// runtime; re-deriving here keeps direct kernel callers honest too.
|
|
264
|
+
const { mode } = projection.decideInteraction({
|
|
265
|
+
dryRun: rt.mutation?.preview === true,
|
|
266
|
+
undo: rt.mutation?.undo === true,
|
|
267
|
+
yes: yes === true,
|
|
268
|
+
isTTY: isTTY === true,
|
|
269
|
+
explicitComplete: projection.explicitAnswersComplete(generator.prompts, answers),
|
|
270
|
+
});
|
|
271
|
+
if (mode === "refuse") {
|
|
272
|
+
throw new PragmaError({
|
|
273
|
+
code: "INVALID_INPUT",
|
|
274
|
+
message: projection.refusalMessage(projection.missingExplicitFlags(generator.prompts, answers)),
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
// Wizard: ask exactly the pending prompts — the provided answers are
|
|
278
|
+
// explicit and pre-seeded; `collectAnswers` skips them and evaluates each
|
|
279
|
+
// conditional against the answers as they land (wizard-script parity).
|
|
280
|
+
if (mode === "wizard") {
|
|
281
|
+
// `onCancel` (H2): an in-Ink Ctrl-C during execution aborts the run so the
|
|
282
|
+
// interpreter stops writing — raw mode swallows the SIGINT, so the wizard
|
|
283
|
+
// drives the abort. Shared with setup by construction.
|
|
284
|
+
// `cwd` also reaches the wizard: its confirm-gate preview reads the same
|
|
285
|
+
// jail-checked write root the interpreter resolves effect paths against.
|
|
286
|
+
const session = summon.inkPrompt(generator, {
|
|
287
|
+
signal,
|
|
288
|
+
onCancel: abort,
|
|
289
|
+
cwd: rt.cwd,
|
|
290
|
+
// Flag-provided answers reach the wizard too: without the seed the
|
|
291
|
+
// confirm gate previews with them missing (undefined paths, wrong plan).
|
|
292
|
+
initialAnswers: answers,
|
|
293
|
+
});
|
|
294
|
+
// Thread the per-call write root: the interpreter resolves the generator's
|
|
295
|
+
// relative output paths against `rt.cwd` — the SAME dir the SEC-2 jail
|
|
296
|
+
// validated above — so the write can never escape the checked directory.
|
|
297
|
+
rt.exec = {
|
|
298
|
+
cwd: rt.cwd,
|
|
299
|
+
promptHandler: session.promptHandler,
|
|
300
|
+
onEffectStart: summon.createStampOnEffectStart(stamp, session.onEffectStart),
|
|
301
|
+
onEffectComplete: session.onEffectComplete,
|
|
302
|
+
onLog: session.onLog,
|
|
303
|
+
dispose: session.dispose,
|
|
304
|
+
signal,
|
|
305
|
+
};
|
|
306
|
+
return summon.execute(generator, {
|
|
307
|
+
prompt: session.promptHandler,
|
|
308
|
+
params: answers,
|
|
309
|
+
signal,
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
// run / batch-dry-run / batch-undo: flags + defaults, never a wizard —
|
|
313
|
+
// `autoPrompt` resolves each unprovided prompt to its default or fails
|
|
314
|
+
// loudly on a missing required answer. Same per-call write root as the
|
|
315
|
+
// wizard branch: `rt.cwd` feeds both the SEC-2 jail and the interpreter's
|
|
316
|
+
// effect-path base, atomically.
|
|
317
|
+
const prompt = summon.autoPrompt(answers);
|
|
318
|
+
rt.exec = {
|
|
319
|
+
cwd: rt.cwd,
|
|
320
|
+
promptHandler: prompt,
|
|
321
|
+
onEffectStart: summon.createStampOnEffectStart(stamp),
|
|
322
|
+
onLog: (_level, message) => process.stderr.write(`${message}\n`),
|
|
323
|
+
signal,
|
|
324
|
+
};
|
|
325
|
+
return summon.execute(generator, { prompt, params: answers, signal });
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* The shared capability: storeless, mutating, interactive, MCP-exposed.
|
|
329
|
+
*
|
|
330
|
+
* `destructive: false` is load-bearing (D4): create only WRITES NEW files, so it
|
|
331
|
+
* is explicitly non-destructive. Without it `annotationsFor` emits no
|
|
332
|
+
* `destructiveHint`, and MCP clients default an unset hint on a non-read-only
|
|
333
|
+
* tool to `true` — advertising create as destructive, the opposite of intent.
|
|
334
|
+
*/
|
|
335
|
+
export const CREATE_CAPABILITY = {
|
|
336
|
+
needsStore: false,
|
|
337
|
+
mutates: true,
|
|
338
|
+
destructive: false,
|
|
339
|
+
interactive: true,
|
|
340
|
+
mcp: {
|
|
341
|
+
expose: true,
|
|
342
|
+
annotations: { readOnlyHint: false, openWorldHint: false },
|
|
343
|
+
},
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* The shared output spec: the outcome formatters plus the dry-run seam.
|
|
347
|
+
*
|
|
348
|
+
* ONE constant because there are TWO specs per leaf — the binding-level verbs
|
|
349
|
+
* below (what MCP and the emitted surface read) and the per-leaf spec the
|
|
350
|
+
* mount synthesizes for `create component react …` (what a user actually
|
|
351
|
+
* runs). They describe the same generation, so a preview that reached only one
|
|
352
|
+
* of them would be a preview the CLI never showed.
|
|
353
|
+
*
|
|
354
|
+
* `formatPlan` renders through summon's own effect formatter instead of the
|
|
355
|
+
* kernel's raw dump, so the two bins describe the identical tree they write
|
|
356
|
+
* identically. `planData` stays unset — the effects the preview records ARE
|
|
357
|
+
* the plan — which is what leaves the `--format json` dry-run body exactly as
|
|
358
|
+
* it was.
|
|
359
|
+
*
|
|
360
|
+
* It resolves a PROMISE because {@link formatCreatePlan} loads that formatter
|
|
361
|
+
* behind a dynamic `import()`: this constant is reachable from the
|
|
362
|
+
* capabilities barrel, and the whole point of the lazy-dispatch boundary above
|
|
363
|
+
* is that nothing on that graph pays for summon-core on a `--help` spawn.
|
|
364
|
+
*/
|
|
365
|
+
export const CREATE_OUTPUT = {
|
|
366
|
+
formatters: createFormatters,
|
|
367
|
+
formatPlan: (_planData, effects, verbose) => formatCreatePlan(effects, verbose),
|
|
368
|
+
};
|
|
369
|
+
/**
|
|
370
|
+
* Build the create verb for one binding. `run` presents `Promise<Task<R>>`
|
|
371
|
+
* through the `Task<R>` arm by an honest cast at this one site (mirroring
|
|
372
|
+
* `sources update`): a literal `Promise<Task<R>>` arm in the union would poison
|
|
373
|
+
* async read-verb inference.
|
|
374
|
+
*
|
|
375
|
+
* The binding-level `run` maps its noun (+ its choice) onto the declared
|
|
376
|
+
* command path — the MCP transport's view of the tree.
|
|
377
|
+
*/
|
|
378
|
+
function createVerb(binding) {
|
|
379
|
+
return {
|
|
380
|
+
path: ["create", binding.noun],
|
|
381
|
+
summary: binding.summary,
|
|
382
|
+
useWhen: binding.useWhen,
|
|
383
|
+
example: binding.example,
|
|
384
|
+
params: paramsOf(binding),
|
|
385
|
+
output: CREATE_OUTPUT,
|
|
386
|
+
examples: (binding.examples ?? []).map(({ args, note }) => ({
|
|
387
|
+
cmd: `${BIN_NAME} ${args}`,
|
|
388
|
+
...(note === undefined ? {} : { note }),
|
|
389
|
+
})),
|
|
390
|
+
capability: CREATE_CAPABILITY,
|
|
391
|
+
run: (params_, rt) => {
|
|
392
|
+
let commandPath = binding.paths[0];
|
|
393
|
+
if (binding.choice !== undefined) {
|
|
394
|
+
const values = choiceValues(binding);
|
|
395
|
+
const value = String(params_[binding.choice.name] ?? binding.choice.default ?? "");
|
|
396
|
+
if (!values.includes(value)) {
|
|
397
|
+
throw PragmaError.invalidInput(binding.choice.name, value, {
|
|
398
|
+
validOptions: [...values],
|
|
399
|
+
});
|
|
400
|
+
}
|
|
401
|
+
commandPath = `${binding.noun}/${value}`;
|
|
402
|
+
}
|
|
403
|
+
return runCreate(commandPath, params_, rt);
|
|
404
|
+
},
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* The `create` verbs, one per declared binding, by noun. Key order is the
|
|
409
|
+
* distribution's order, which `index.ts` preserves into the command tree,
|
|
410
|
+
* `--help` and the emitted surface.
|
|
411
|
+
*/
|
|
412
|
+
export const createVerbs = Object.fromEntries(CREATE_BINDINGS.map((binding) => [binding.noun, createVerb(binding)]));
|
|
413
|
+
//# sourceMappingURL=create.verb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.verb.js","sourceRoot":"","sources":["../../../../src/capabilities/create/create.verb.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAIvC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,OAAO,EACL,UAAU,EACV,eAAe,EACf,cAAc,EACd,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,gFAAgF;AAChF,0EAA0E;AAC1E,gFAAgF;AAEhF;;;;;GAKG;AACH,SAAS,WAAW,CAAC,OAAyB;IAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAiD,CAAC;IACzE,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC;QAC7B,GAAG,CAAC,MAAM,CAAC,OAAO,KAAK,SAAS;YAC9B,CAAC,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;YACpB,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EA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1
|
+
/**
|
|
2
|
+
* Pragma's presentation of a `create` leaf's grouped help — the host half of
|
|
3
|
+
* the summon-core help seam (`CommanderHost.renderHelp`): the projection
|
|
4
|
+
* decides the STRUCTURE (usage, description, the option groups, the host's
|
|
5
|
+
* flag rows), this module effects pragma's house style over it, composed from
|
|
6
|
+
* the same kernel primitives every other help page uses
|
|
7
|
+
* (`kernel/project/cli/helpFormat.ts`) — a dim `Usage:` label, bold headings,
|
|
8
|
+
* cyan-term/dim-description columns. Colour therefore rides the kernel's one
|
|
9
|
+
* gate (chalk's TTY detection plus the style seam's `NO_COLOR` zeroing), so
|
|
10
|
+
* piped output — the cross-CLI structural-parity surface — stays plain bytes.
|
|
11
|
+
*/
|
|
12
|
+
import { helpColumns, helpHeading, helpUsage, } from "../../kernel/project/cli/helpFormat.js";
|
|
13
|
+
/**
|
|
14
|
+
* A row's description with the shared renderer's default-value suffix — the
|
|
15
|
+
* same bytes `renderGroupedHelp` appends, so the structural-parity cells
|
|
16
|
+
* compare the fact, not two spellings of it.
|
|
17
|
+
*/
|
|
18
|
+
function describeOption(description, defaultValue) {
|
|
19
|
+
return defaultValue
|
|
20
|
+
? `${description} (default: ${JSON.stringify(defaultValue)})`
|
|
21
|
+
: description;
|
|
22
|
+
}
|
|
23
|
+
/** Render a `create` leaf's grouped help in pragma's house style. */
|
|
24
|
+
export const renderCreateHelp = (usage, description, groups, hostFlags) => {
|
|
25
|
+
const sections = [
|
|
26
|
+
["Global Options", hostFlags.map((flag) => [flag.flags, flag.description])],
|
|
27
|
+
...[...groups].map(([groupName, options]) => [
|
|
28
|
+
groupName,
|
|
29
|
+
options.map((opt) => [
|
|
30
|
+
opt.flags,
|
|
31
|
+
describeOption(opt.description, opt.defaultValue),
|
|
32
|
+
]),
|
|
33
|
+
]),
|
|
34
|
+
];
|
|
35
|
+
// One column width across ALL sections so the flag column aligns section to
|
|
36
|
+
// section (the root help does the same for its noun column).
|
|
37
|
+
const width = Math.max(...sections.flatMap(([, rows]) => rows.map(([term]) => term.length)), 0);
|
|
38
|
+
const lines = [helpUsage(usage)];
|
|
39
|
+
if (description)
|
|
40
|
+
lines.push("", description);
|
|
41
|
+
for (const [heading, rows] of sections) {
|
|
42
|
+
lines.push("", helpHeading(heading), ...helpColumns(rows, width));
|
|
43
|
+
}
|
|
44
|
+
// Commander prints `formatHelp`'s return verbatim — terminate the page.
|
|
45
|
+
return `${lines.join("\n")}\n`;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=createHelp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createHelp.js","sourceRoot":"","sources":["../../../../src/capabilities/create/createHelp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,GACV,MAAM,wCAAwC,CAAC;AAQhD;;;;GAIG;AACH,SAAS,cAAc,CAAC,WAAmB,EAAE,YAAqB;IAChE,OAAO,YAAY;QACjB,CAAC,CAAC,GAAG,WAAW,cAAc,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,GAAG;QAC7D,CAAC,CAAC,WAAW,CAAC;AAClB,CAAC;AAED,qEAAqE;AACrE,MAAM,CAAC,MAAM,gBAAgB,GAA6B,CACxD,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,EAAE;IACF,MAAM,QAAQ,GAAkB;QAC9B,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAC3E,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAChB,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,EAAe,EAAE,CAAC;YACrC,SAAS;YACT,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC;gBACnB,GAAG,CAAC,KAAK;gBACT,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,YAAY,CAAC;aAClD,CAAC;SACH,CACF;KACF,CAAC;IAEF,4EAA4E;IAC5E,6DAA6D;IAC7D,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CACpB,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EACpE,CAAC,CACF,CAAC;IAEF,MAAM,KAAK,GAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3C,IAAI,WAAW;QAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;IAC7C,KAAK,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC;QACvC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;IACpE,CAAC;IACD,wEAAwE;IACxE,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACjC,CAAC,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The generator→grammar adapter: map a summon {@link PromptDefinition} onto the
|
|
3
|
+
* one grammar's {@link ParamSpec}, mirroring the v1 cli-core
|
|
4
|
+
* `convertGenerator.promptToParameter`.
|
|
5
|
+
*
|
|
6
|
+
* text → { kind: "string" } (+ positional; `complete: files` for paths)
|
|
7
|
+
* confirm → { kind: "boolean" }
|
|
8
|
+
* select → { kind: "enum", values: choices.map(value) }
|
|
9
|
+
* multiselect → { kind: "string[]", complete: values }
|
|
10
|
+
*
|
|
11
|
+
* `name→name`, `message→doc`, `default→default`, `positional→positional`;
|
|
12
|
+
* `required = default === undefined && !when`. A prompt's `validate` and a
|
|
13
|
+
* `select`'s choice set have NO ParamSpec slot: they are enforced by summon's
|
|
14
|
+
* `validateAnswers` inside `execute`, so a flag/MCP-arg run rejects the same bad
|
|
15
|
+
* input a wizard would. A `when` condition is honoured by `collectAnswers` at
|
|
16
|
+
* prompt time. `generate` is reached through the verb's `run` → `execute`.
|
|
17
|
+
*
|
|
18
|
+
* This adapter runs over the build-time PROJECTION of the generators'
|
|
19
|
+
* prompts (`createSurface.generated.ts`), never the live generators —
|
|
20
|
+
* importing a generator pulls summon-core, which must stay behind `create`'s
|
|
21
|
+
* lazy dispatch (R9). The projection-fidelity test loads the real generators
|
|
22
|
+
* and asserts the committed projection matches. It accepts a live
|
|
23
|
+
* `PromptDefinition` equally (the shapes are compatible): a projected
|
|
24
|
+
* prompt's `when` survives as `conditional: true`.
|
|
25
|
+
*/
|
|
26
|
+
/** A path-like text prompt gets file completion. */
|
|
27
|
+
const looksLikePath = (name) => /(path|dir)$/i.test(name);
|
|
28
|
+
/**
|
|
29
|
+
* Derive a declarative param `doc` from a generator prompt's `message`.
|
|
30
|
+
*
|
|
31
|
+
* A prompt `message` is a wizard QUESTION (`Include styles?`, `Package name:`),
|
|
32
|
+
* but a {@link ParamSpec.doc} is help text shown in CLI `--help` and the MCP
|
|
33
|
+
* arg schema, where every other param reads as a declarative statement. We
|
|
34
|
+
* DERIVE the doc rather than editing the mirrors' `message` — the generator
|
|
35
|
+
* parity test couples `message` to the live generators, so the question must
|
|
36
|
+
* stay verbatim for the interactive wizard while the flag/MCP doc reads well.
|
|
37
|
+
* Strip the trailing `?`/`:` and end with a period.
|
|
38
|
+
*/
|
|
39
|
+
export function declarativeDoc(message) {
|
|
40
|
+
const trimmed = message
|
|
41
|
+
.trim()
|
|
42
|
+
.replace(/\s*[?:]+$/, "")
|
|
43
|
+
.trim();
|
|
44
|
+
if (trimmed === "")
|
|
45
|
+
return trimmed;
|
|
46
|
+
return /[.!]$/.test(trimmed) ? trimmed : `${trimmed}.`;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Convert one generator prompt to a grammar param.
|
|
50
|
+
*
|
|
51
|
+
* @param prompt - The generator's prompt definition.
|
|
52
|
+
* @returns The equivalent {@link ParamSpec}.
|
|
53
|
+
*/
|
|
54
|
+
export function promptToParam(prompt) {
|
|
55
|
+
const required = prompt.default === undefined && !prompt.when && prompt.conditional !== true;
|
|
56
|
+
const positional = prompt.positional === true;
|
|
57
|
+
switch (prompt.type) {
|
|
58
|
+
case "confirm":
|
|
59
|
+
return {
|
|
60
|
+
kind: "boolean",
|
|
61
|
+
name: prompt.name,
|
|
62
|
+
doc: declarativeDoc(prompt.message),
|
|
63
|
+
required,
|
|
64
|
+
positional,
|
|
65
|
+
...(prompt.default !== undefined
|
|
66
|
+
? { default: prompt.default }
|
|
67
|
+
: {}),
|
|
68
|
+
};
|
|
69
|
+
case "select":
|
|
70
|
+
return {
|
|
71
|
+
kind: "enum",
|
|
72
|
+
name: prompt.name,
|
|
73
|
+
doc: declarativeDoc(prompt.message),
|
|
74
|
+
values: (prompt.choices ?? []).map((choice) => choice.value),
|
|
75
|
+
required,
|
|
76
|
+
positional,
|
|
77
|
+
...(prompt.default !== undefined
|
|
78
|
+
? { default: String(prompt.default) }
|
|
79
|
+
: {}),
|
|
80
|
+
};
|
|
81
|
+
case "multiselect":
|
|
82
|
+
return {
|
|
83
|
+
kind: "string[]",
|
|
84
|
+
name: prompt.name,
|
|
85
|
+
doc: declarativeDoc(prompt.message),
|
|
86
|
+
required,
|
|
87
|
+
positional,
|
|
88
|
+
complete: { kind: "values" },
|
|
89
|
+
};
|
|
90
|
+
default:
|
|
91
|
+
return {
|
|
92
|
+
kind: "string",
|
|
93
|
+
name: prompt.name,
|
|
94
|
+
doc: declarativeDoc(prompt.message),
|
|
95
|
+
required,
|
|
96
|
+
positional,
|
|
97
|
+
...(prompt.default !== undefined ? { default: prompt.default } : {}),
|
|
98
|
+
...(looksLikePath(prompt.name) ? { complete: { kind: "files" } } : {}),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/** Map a generator's whole prompt list to grammar params, in order. */
|
|
103
|
+
export function generatorToParams(prompts) {
|
|
104
|
+
return prompts.map(promptToParam);
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=generatorToVerbSpec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generatorToVerbSpec.js","sourceRoot":"","sources":["../../../../src/capabilities/create/generatorToVerbSpec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAKH,oDAAoD;AACpD,MAAM,aAAa,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAE3E;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe;IAC5C,MAAM,OAAO,GAAG,OAAO;SACpB,IAAI,EAAE;SACN,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;SACxB,IAAI,EAAE,CAAC;IACV,IAAI,OAAO,KAAK,EAAE;QAAE,OAAO,OAAO,CAAC;IACnC,OAAO,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,GAAG,CAAC;AACzD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,MAAkB;IAC9C,MAAM,QAAQ,GACZ,MAAM,CAAC,OAAO,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,WAAW,KAAK,IAAI,CAAC;IAC9E,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,KAAK,IAAI,CAAC;IAE9C,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,SAAS;YACZ,OAAO;gBACL,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,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AAE,CAAC;gBACpE,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACvE,CAAC;IACN,CAAC;AACH,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,iBAAiB,CAAC,OAA8B;IAC9D,OAAO,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `create` capability barrel — scaffolds from the summon generators the
|
|
3
|
+
* distribution declares (`DistributionConfig.generators`).
|
|
4
|
+
*
|
|
5
|
+
* Importing this pulls only the verb specs (params derived from the
|
|
6
|
+
* distribution's build-time projection), the mount, and the formatters; every
|
|
7
|
+
* generator load and the summon-core runtime stay behind the lazy `run`
|
|
8
|
+
* dispatch, so the command tree builds without touching summon-core.
|
|
9
|
+
*/
|
|
10
|
+
import { BIN_NAME } from "../../constants.js";
|
|
11
|
+
import { installedDistribution } from "../../kernel/distribution/registry.js";
|
|
12
|
+
import { asVerb } from "../../kernel/spec/asVerb.js";
|
|
13
|
+
import { createCliProjection } from "./cliProjection.js";
|
|
14
|
+
import { createVerbs } from "./create.verb.js";
|
|
15
|
+
const declared = installedDistribution().config.generators;
|
|
16
|
+
/**
|
|
17
|
+
* The `create` capability module, or `undefined` when the distribution
|
|
18
|
+
* declares no generators.
|
|
19
|
+
*/
|
|
20
|
+
export const createModule = declared === undefined
|
|
21
|
+
? undefined
|
|
22
|
+
: {
|
|
23
|
+
name: "create",
|
|
24
|
+
verbs: Object.values(createVerbs).map(asVerb),
|
|
25
|
+
cliProjection: createCliProjection(),
|
|
26
|
+
help: { group: "Generate code", summary: declared.summary },
|
|
27
|
+
// A flag a binding once took and retired gets the message naming its
|
|
28
|
+
// replacement — scoped to the ONE binding that ever had the flag, so
|
|
29
|
+
// a sibling keeps its honest unknown-option error instead of a
|
|
30
|
+
// migration message about a grammar it never spoke, and to the
|
|
31
|
+
// pre-terminator span: after `--` the spelling is an operand, not
|
|
32
|
+
// the retired flag, so the real parse error stands.
|
|
33
|
+
retiredSyntax: (positionals, scanned) => {
|
|
34
|
+
if (positionals[0] !== "create")
|
|
35
|
+
return undefined;
|
|
36
|
+
const retired = (declared.retired ?? []).find(({ noun, flag }) => positionals[1] === noun &&
|
|
37
|
+
scanned.some((arg) => arg === flag || arg.startsWith(`${flag}=`)));
|
|
38
|
+
return retired === undefined
|
|
39
|
+
? undefined
|
|
40
|
+
: `error: unknown option '${retired.flag}' — ${retired.reason}: \`${BIN_NAME} ${retired.replacement}\` (create mirrors summon).`;
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/capabilities/create/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,QAAQ,GAAG,qBAAqB,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC;AAE3D;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GACvB,QAAQ,KAAK,SAAS;IACpB,CAAC,CAAC,SAAS;IACX,CAAC,CAAC;QACE,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;QAC7C,aAAa,EAAE,mBAAmB,EAAE;QACpC,I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