@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 @@
|
|
|
1
|
+
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../../../src/capabilities/packages/skills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAEL,UAAU,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,YAAY,EACZ,UAAU,EACV,MAAM,EACN,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAkB9B;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,QAAyB;IACrD,MAAM,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,CAAC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C7C,CAAC;IACF,IAAI,CAAC;QACH,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YAC3B,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;gBAC/B,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC1D,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBAChD,aAAa,CAAC,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;oBACjD,IAAI,EAAE,KAAK;oBACX,IAAI,EAAE,IAAI;iBACX,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,aAAa,CAAC,IAAI,CAAC,OAAO,EAAE,kBAAkB,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE;YACzE,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;QACH,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAClD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,MAAM,KAAK,CAAC;IACpC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a package comes from — a local path, a git repository, or npm — as the
|
|
3
|
+
* plain data the lock file records, parsed from what `add` is given.
|
|
4
|
+
*
|
|
5
|
+
* The kind is read from the argument's spelling, by one fixed rule and no
|
|
6
|
+
* guessing:
|
|
7
|
+
*
|
|
8
|
+
* - `npm:<name>` or `npm:<name>@<version or range>` is an npm package;
|
|
9
|
+
* - anything holding `://` is a git repository (`https://`, `ssh://` or
|
|
10
|
+
* `file://`, optionally written `git+https://` and so on, as in a
|
|
11
|
+
* configuration's `packs`);
|
|
12
|
+
* - everything else is a path to a folder.
|
|
13
|
+
*/
|
|
14
|
+
import { existsSync, realpathSync } from "node:fs";
|
|
15
|
+
import { isAbsolute, posix, relative, resolve, sep } from "node:path";
|
|
16
|
+
import { fileURLToPath } from "node:url";
|
|
17
|
+
import { PragmaError } from "../../kernel/error/index.js";
|
|
18
|
+
import { ALLOWED_GIT_PROTOCOLS } from "../../kernel/runtime/refs/gitOps.js";
|
|
19
|
+
import { redactUrl } from "../../kernel/runtime/refs/index.js";
|
|
20
|
+
import { isPackageName } from "./manifest.js";
|
|
21
|
+
import { parseRange } from "./range.js";
|
|
22
|
+
/**
|
|
23
|
+
* A git ref name a user may pass: no leading `-` or `/`, no `..`, no
|
|
24
|
+
* whitespace or the characters git forbids in ref names.
|
|
25
|
+
*/
|
|
26
|
+
const REF_NAME = /^(?![-/])(?!.*\.\.)(?!.*\/\/)(?!.*\/$)(?!.*\.lock$)[A-Za-z0-9._/+-]+$/;
|
|
27
|
+
/** A full commit SHA (SHA-1 or SHA-256 repositories). */
|
|
28
|
+
const FULL_SHA = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/;
|
|
29
|
+
/** Throw the input error every malformed source raises. */
|
|
30
|
+
function refuse(message) {
|
|
31
|
+
throw new PragmaError({
|
|
32
|
+
code: "INVALID_INPUT",
|
|
33
|
+
message: `Invalid source: ${message}.`,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Check a folder inside a repository: relative, forward slashes, staying in.
|
|
38
|
+
*
|
|
39
|
+
* @param subpath - The folder as given.
|
|
40
|
+
* @returns It normalised.
|
|
41
|
+
*/
|
|
42
|
+
export function checkSubpath(subpath) {
|
|
43
|
+
const segments = subpath.replace(/\/+$/, "").split("/");
|
|
44
|
+
if (subpath.length === 0 ||
|
|
45
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: the check IS for control characters.
|
|
46
|
+
/[\u0000-\u001f\u007f\\*?[\]!{}]/.test(subpath) ||
|
|
47
|
+
subpath.startsWith(":") ||
|
|
48
|
+
subpath.startsWith("-") ||
|
|
49
|
+
subpath.startsWith("/") ||
|
|
50
|
+
segments.some((segment) => segment === "" || segment === "." || segment === "..")) {
|
|
51
|
+
refuse(`--subpath "${subpath}" must be a folder inside the repository, written relative to its root: plain segments, no ".", "..", glob characters (* ? [ ] ! { }), leading ":" or "-", or control characters`);
|
|
52
|
+
}
|
|
53
|
+
return segments.join("/");
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Check a git URL: an allowed transport, no option-looking text, and no
|
|
57
|
+
* credential that would be written into a committed lock.
|
|
58
|
+
*
|
|
59
|
+
* @param url - The URL, without a `git+` prefix.
|
|
60
|
+
* @returns The URL, its scheme lowercased.
|
|
61
|
+
*/
|
|
62
|
+
export function checkGitUrl(url) {
|
|
63
|
+
if (url.startsWith("-"))
|
|
64
|
+
refuse(`the git URL "${url}" begins with "-"`);
|
|
65
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: the check IS for control characters.
|
|
66
|
+
if (/[\u0000- \u007f]/.test(url)) {
|
|
67
|
+
refuse("the git URL holds whitespace or a control character");
|
|
68
|
+
}
|
|
69
|
+
const scheme = /^([a-z][a-z0-9+.-]*):\/\//i.exec(url)?.[1]?.toLowerCase();
|
|
70
|
+
if (scheme === undefined ||
|
|
71
|
+
!ALLOWED_GIT_PROTOCOLS.includes(scheme)) {
|
|
72
|
+
refuse(`the git URL "${redactUrl(url)}" must use ${ALLOWED_GIT_PROTOCOLS.map((p) => `${p}://`).join(", ")}`);
|
|
73
|
+
}
|
|
74
|
+
const authority = url.slice(scheme.length + 3).split("/")[0] ?? "";
|
|
75
|
+
if (authority.includes("@") &&
|
|
76
|
+
(scheme === "https" || authority.split("@")[0]?.includes(":"))) {
|
|
77
|
+
refuse(`the git URL "${redactUrl(url)}" carries a credential, which the lock file would record; let your git credential helper or ssh key supply it`);
|
|
78
|
+
}
|
|
79
|
+
// The scheme is case-insensitive; written lowercase so every later check
|
|
80
|
+
// (the transport allowlist, the file:// scope rule) reads one spelling.
|
|
81
|
+
return `${scheme}${url.slice(scheme.length)}`;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Parse an npm spec: `<name>` or `<name>@<version or range>`.
|
|
85
|
+
*
|
|
86
|
+
* @param spec - The text after `npm:`.
|
|
87
|
+
*/
|
|
88
|
+
function parseNpm(spec) {
|
|
89
|
+
const at = spec.indexOf("@", spec.startsWith("@") ? 1 : 0);
|
|
90
|
+
const name = at === -1 ? spec : spec.slice(0, at);
|
|
91
|
+
const range = at === -1 ? undefined : spec.slice(at + 1);
|
|
92
|
+
if (!isPackageName(name))
|
|
93
|
+
refuse(`"${name}" is not an npm package name`);
|
|
94
|
+
if (range !== undefined && parseRange(range) === undefined) {
|
|
95
|
+
refuse(`"${range}" is not a version or range (1.2.0, ^1.2.0, ~1.2.0, >=1.2.0 or *)`);
|
|
96
|
+
}
|
|
97
|
+
return { kind: "npm", name, ...(range === undefined ? {} : { range }) };
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Parse what `add` is given into a source.
|
|
101
|
+
*
|
|
102
|
+
* @param spec - The source argument.
|
|
103
|
+
* @param git - The git options, which only a git source takes.
|
|
104
|
+
* @param root - The folder a project lock records paths against, or
|
|
105
|
+
* `undefined` for the global set (paths stay absolute).
|
|
106
|
+
* @param cwd - The directory a relative path is read from.
|
|
107
|
+
* @returns The source, as the lock records it.
|
|
108
|
+
* @throws PragmaError INVALID_INPUT on anything malformed.
|
|
109
|
+
*/
|
|
110
|
+
export function parseSource(spec, git, root, cwd) {
|
|
111
|
+
if (spec.length === 0)
|
|
112
|
+
refuse("the source is empty");
|
|
113
|
+
const isGit = spec.includes("://");
|
|
114
|
+
const gitFlags = Object.entries(git).filter(([, value]) => value !== undefined);
|
|
115
|
+
if (!isGit && gitFlags.length > 0) {
|
|
116
|
+
refuse(`${gitFlags.map(([key]) => `--${key}`).join(", ")} only apply to a git source`);
|
|
117
|
+
}
|
|
118
|
+
if (spec.startsWith("npm:"))
|
|
119
|
+
return parseNpm(spec.slice("npm:".length));
|
|
120
|
+
if (isGit) {
|
|
121
|
+
const checked = checkGitUrl(spec.startsWith("git+") ? spec.slice(4) : spec);
|
|
122
|
+
// A local repository in a project is recorded relative to the lock's
|
|
123
|
+
// folder (`file:<path>`), like a path source, so the lock means the same
|
|
124
|
+
// on every machine that checks the project out.
|
|
125
|
+
const url = root !== undefined && checked.startsWith("file://")
|
|
126
|
+
? relativeFileUrl(checked, root)
|
|
127
|
+
: checked;
|
|
128
|
+
const refs = ["tag", "branch", "rev"].filter((key) => git[key] !== undefined);
|
|
129
|
+
if (refs.length > 1)
|
|
130
|
+
refuse("give at most one of --tag, --branch and --rev");
|
|
131
|
+
for (const key of ["tag", "branch"]) {
|
|
132
|
+
const value = git[key];
|
|
133
|
+
if (value !== undefined && !REF_NAME.test(value)) {
|
|
134
|
+
refuse(`--${key} "${value}" is not a git ref name`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (git.rev !== undefined && !FULL_SHA.test(git.rev)) {
|
|
138
|
+
refuse(`--rev "${git.rev}" must be a full commit SHA`);
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
kind: "git",
|
|
142
|
+
url,
|
|
143
|
+
...(git.tag === undefined ? {} : { tag: git.tag }),
|
|
144
|
+
...(git.branch === undefined ? {} : { branch: git.branch }),
|
|
145
|
+
...(git.rev === undefined ? {} : { rev: git.rev }),
|
|
146
|
+
...(git.subpath === undefined
|
|
147
|
+
? {}
|
|
148
|
+
: { subpath: checkSubpath(git.subpath) }),
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
if (spec.startsWith("-"))
|
|
152
|
+
refuse(`the path "${spec}" begins with "-"`);
|
|
153
|
+
const absolute = resolve(cwd, spec);
|
|
154
|
+
if (root === undefined)
|
|
155
|
+
return { kind: "path", path: absolute };
|
|
156
|
+
const rel = relative(root, absolute);
|
|
157
|
+
return { kind: "path", path: rel === "" ? "." : rel.split(sep).join("/") };
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* A `file://` URL as the project records it: `file:` and the path relative to
|
|
161
|
+
* the lock's folder, which must contain it.
|
|
162
|
+
*
|
|
163
|
+
* @param url - A `file://` URL.
|
|
164
|
+
* @param root - The lock's folder.
|
|
165
|
+
*/
|
|
166
|
+
function relativeFileUrl(url, root) {
|
|
167
|
+
const absolute = fileURLToPath(url);
|
|
168
|
+
const real = (path) => existsSync(path) ? realpathSync(path) : resolve(path);
|
|
169
|
+
const rel = relative(real(root), real(absolute));
|
|
170
|
+
if (rel === "" ||
|
|
171
|
+
rel === ".." ||
|
|
172
|
+
rel.startsWith(`..${sep}`) ||
|
|
173
|
+
isAbsolute(rel)) {
|
|
174
|
+
refuse(`the repository ${url} lies outside the project at ${root}, and a lock cannot name it on another machine; add it from its https:// or ssh:// URL, or vendor it into the project`);
|
|
175
|
+
}
|
|
176
|
+
return `file:${rel.split(sep).join("/")}`;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Whether a git URL is a project-relative local repository (`file:<path>`).
|
|
180
|
+
*
|
|
181
|
+
* @param url - The recorded URL.
|
|
182
|
+
*/
|
|
183
|
+
export function isRelativeFileUrl(url) {
|
|
184
|
+
return url.startsWith("file:") && !url.startsWith("file://");
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Check a project-relative repository URL read from a lock.
|
|
188
|
+
*
|
|
189
|
+
* @param url - `file:<path>`.
|
|
190
|
+
* @returns It unchanged.
|
|
191
|
+
*/
|
|
192
|
+
export function checkRelativeFileUrl(url) {
|
|
193
|
+
const path = url.slice("file:".length);
|
|
194
|
+
const normal = posix.normalize(path);
|
|
195
|
+
if (path.length === 0 ||
|
|
196
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: the check IS for control characters.
|
|
197
|
+
/[\u0000-\u001f\u007f\\]/.test(path) ||
|
|
198
|
+
posix.isAbsolute(path) ||
|
|
199
|
+
normal === ".." ||
|
|
200
|
+
normal.startsWith("../") ||
|
|
201
|
+
path.startsWith("-")) {
|
|
202
|
+
refuse(`the repository ${url} must be a folder inside the project`);
|
|
203
|
+
}
|
|
204
|
+
return url;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* The URL git is given for a source: a project-relative local repository
|
|
208
|
+
* resolved against the lock's folder; any other URL as recorded.
|
|
209
|
+
*
|
|
210
|
+
* @param source - A git source.
|
|
211
|
+
* @param root - The lock's folder.
|
|
212
|
+
*/
|
|
213
|
+
export function remoteUrl(source, root) {
|
|
214
|
+
return isRelativeFileUrl(source.url)
|
|
215
|
+
? `file://${resolve(root, source.url.slice("file:".length))}`
|
|
216
|
+
: source.url;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* The absolute folder a path source names.
|
|
220
|
+
*
|
|
221
|
+
* @param source - The path source.
|
|
222
|
+
* @param root - The folder the lock records paths against.
|
|
223
|
+
*/
|
|
224
|
+
export function pathSourceDir(source, root) {
|
|
225
|
+
return isAbsolute(source.path) ? source.path : resolve(root, source.path);
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* The source in one line, credentials redacted.
|
|
229
|
+
*
|
|
230
|
+
* @param source - The source.
|
|
231
|
+
*/
|
|
232
|
+
export function describeSource(source) {
|
|
233
|
+
switch (source.kind) {
|
|
234
|
+
case "path":
|
|
235
|
+
return source.path;
|
|
236
|
+
case "npm":
|
|
237
|
+
return `npm:${source.name}${source.range === undefined ? "" : `@${source.range}`}`;
|
|
238
|
+
case "git": {
|
|
239
|
+
const at = source.tag !== undefined
|
|
240
|
+
? ` tag ${source.tag}`
|
|
241
|
+
: source.branch !== undefined
|
|
242
|
+
? ` branch ${source.branch}`
|
|
243
|
+
: source.rev !== undefined
|
|
244
|
+
? ` rev ${source.rev.slice(0, 12)}`
|
|
245
|
+
: "";
|
|
246
|
+
const sub = source.subpath === undefined ? "" : ` subpath ${source.subpath}`;
|
|
247
|
+
return `${redactUrl(source.url)}${at}${sub}`;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../../src/capabilities/packages/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAsCxC;;;GAGG;AACH,MAAM,QAAQ,GACZ,uEAAuE,CAAC;AAE1E,yDAAyD;AACzD,MAAM,QAAQ,GAAG,iCAAiC,CAAC;AAEnD,2DAA2D;AAC3D,SAAS,MAAM,CAAC,OAAe;IAC7B,MAAM,IAAI,WAAW,CAAC;QACpB,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,mBAAmB,OAAO,GAAG;KACvC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACxD,IACE,OAA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,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;QAC/C,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unpack an npm tarball (a gzipped tar) into a folder, safely.
|
|
3
|
+
*
|
|
4
|
+
* Written here rather than handed to a tar program, so that what an archive
|
|
5
|
+
* may do is exactly what this file allows:
|
|
6
|
+
*
|
|
7
|
+
* - only plain files and folders are written; a symbolic link, a hard link, a
|
|
8
|
+
* device or a FIFO refuses the whole archive;
|
|
9
|
+
* - every path is checked before anything is written: no absolute path, no
|
|
10
|
+
* `..` segment, no backslash or NUL, and the joined path must stay inside
|
|
11
|
+
* the destination;
|
|
12
|
+
* - the first path segment (npm's `package/`) is dropped;
|
|
13
|
+
* - sizes are bounded: the compressed archive, the unpacked bytes (enforced
|
|
14
|
+
* while gunzipping), each entry, and the number of entries;
|
|
15
|
+
* - files are written with mode 0644 and folders 0755 whatever the archive
|
|
16
|
+
* says, so nothing unpacked is executable.
|
|
17
|
+
*
|
|
18
|
+
* It reads ustar headers, PAX extended headers (`path`, `size`) and GNU long
|
|
19
|
+
* names, which together are what npm and its peers emit.
|
|
20
|
+
*/
|
|
21
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
22
|
+
import { dirname, posix, resolve, sep } from "node:path";
|
|
23
|
+
import { gunzipSync } from "node:zlib";
|
|
24
|
+
import { PragmaError } from "../../kernel/error/index.js";
|
|
25
|
+
/** The bounds every npm tarball is unpacked under. */
|
|
26
|
+
export const TAR_LIMITS = {
|
|
27
|
+
maxCompressedBytes: 64 * 1024 * 1024,
|
|
28
|
+
maxUnpackedBytes: 256 * 1024 * 1024,
|
|
29
|
+
maxEntryBytes: 32 * 1024 * 1024,
|
|
30
|
+
maxEntries: 20_000,
|
|
31
|
+
};
|
|
32
|
+
const BLOCK = 512;
|
|
33
|
+
/** Throw the error a refused archive raises. */
|
|
34
|
+
function refuse(message) {
|
|
35
|
+
throw PragmaError.configError(`The package archive is refused: ${message}.`);
|
|
36
|
+
}
|
|
37
|
+
/** Read a NUL-terminated string field. */
|
|
38
|
+
function field(header, offset, length) {
|
|
39
|
+
const raw = header.subarray(offset, offset + length);
|
|
40
|
+
const end = raw.indexOf(0);
|
|
41
|
+
return raw.subarray(0, end === -1 ? length : end).toString("utf-8");
|
|
42
|
+
}
|
|
43
|
+
/** Read a numeric field: octal text, or base-256 when the high bit is set. */
|
|
44
|
+
function numeric(header, offset, length) {
|
|
45
|
+
const raw = header.subarray(offset, offset + length);
|
|
46
|
+
if (((raw[0] ?? 0) & 0x80) !== 0) {
|
|
47
|
+
let value = (raw[0] ?? 0) & 0x7f;
|
|
48
|
+
for (let i = 1; i < raw.length; i++)
|
|
49
|
+
value = value * 256 + (raw[i] ?? 0);
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
const text = field(header, offset, length).trim();
|
|
53
|
+
if (text === "")
|
|
54
|
+
return 0;
|
|
55
|
+
if (!/^[0-7]+$/.test(text))
|
|
56
|
+
refuse("a header holds a malformed number");
|
|
57
|
+
return Number.parseInt(text, 8);
|
|
58
|
+
}
|
|
59
|
+
/** Parse PAX extended-header records (`<len> <key>=<value>\n`). */
|
|
60
|
+
function paxRecords(body) {
|
|
61
|
+
const records = new Map();
|
|
62
|
+
let at = 0;
|
|
63
|
+
while (at < body.length) {
|
|
64
|
+
const space = body.indexOf(0x20, at);
|
|
65
|
+
if (space === -1)
|
|
66
|
+
break;
|
|
67
|
+
const length = Number.parseInt(body.subarray(at, space).toString(), 10);
|
|
68
|
+
if (!Number.isInteger(length) || length <= 0 || at + length > body.length) {
|
|
69
|
+
refuse("a PAX header is malformed");
|
|
70
|
+
}
|
|
71
|
+
const record = body.subarray(space + 1, at + length - 1).toString("utf-8");
|
|
72
|
+
const eq = record.indexOf("=");
|
|
73
|
+
if (eq !== -1)
|
|
74
|
+
records.set(record.slice(0, eq), record.slice(eq + 1));
|
|
75
|
+
at += length;
|
|
76
|
+
}
|
|
77
|
+
return records;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The checked, relative path an entry is written to, or `undefined` for the
|
|
81
|
+
* top-level folder itself.
|
|
82
|
+
*/
|
|
83
|
+
function entryPath(name) {
|
|
84
|
+
if (name.includes("\0") || name.includes("\\")) {
|
|
85
|
+
refuse(`the entry "${name}" holds a NUL or a backslash`);
|
|
86
|
+
}
|
|
87
|
+
if (posix.isAbsolute(name))
|
|
88
|
+
refuse(`the entry "${name}" is an absolute path`);
|
|
89
|
+
const segments = name.split("/").filter((s) => s !== "" && s !== ".");
|
|
90
|
+
if (segments.includes(".."))
|
|
91
|
+
refuse(`the entry "${name}" climbs out with ".."`);
|
|
92
|
+
const rest = segments.slice(1);
|
|
93
|
+
return rest.length === 0 ? undefined : rest.join("/");
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Unpack a gzipped tarball into `dest`, which must exist and be empty.
|
|
97
|
+
*
|
|
98
|
+
* @param gzipped - The archive's bytes.
|
|
99
|
+
* @param dest - The destination folder.
|
|
100
|
+
* @param limits - The size bounds.
|
|
101
|
+
* @returns How many files were written.
|
|
102
|
+
* @throws PragmaError CONFIG_ERROR on anything the rules refuse.
|
|
103
|
+
* @note Impure — writes under `dest`.
|
|
104
|
+
*/
|
|
105
|
+
export function unpackTarball(gzipped, dest, limits = TAR_LIMITS) {
|
|
106
|
+
if (gzipped.length > limits.maxCompressedBytes) {
|
|
107
|
+
refuse(`it is over ${limits.maxCompressedBytes} bytes`);
|
|
108
|
+
}
|
|
109
|
+
let tar;
|
|
110
|
+
try {
|
|
111
|
+
tar = gunzipSync(gzipped, { maxOutputLength: limits.maxUnpackedBytes });
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
refuse(error instanceof RangeError
|
|
115
|
+
? `it unpacks to more than ${limits.maxUnpackedBytes} bytes`
|
|
116
|
+
: "it is not a gzip archive");
|
|
117
|
+
}
|
|
118
|
+
const root = resolve(dest);
|
|
119
|
+
let at = 0;
|
|
120
|
+
let entries = 0;
|
|
121
|
+
let files = 0;
|
|
122
|
+
let pax = new Map();
|
|
123
|
+
let longName;
|
|
124
|
+
while (at + BLOCK <= tar.length) {
|
|
125
|
+
const header = tar.subarray(at, at + BLOCK);
|
|
126
|
+
if (header.every((byte) => byte === 0))
|
|
127
|
+
break;
|
|
128
|
+
entries += 1;
|
|
129
|
+
if (entries > limits.maxEntries)
|
|
130
|
+
refuse(`it holds more than ${limits.maxEntries} entries`);
|
|
131
|
+
const type = String.fromCharCode(header[156] ?? 0);
|
|
132
|
+
const paxSize = pax.get("size");
|
|
133
|
+
if (paxSize !== undefined && !/^\d+$/.test(paxSize)) {
|
|
134
|
+
refuse("a PAX header holds a malformed size");
|
|
135
|
+
}
|
|
136
|
+
const size = paxSize === undefined ? numeric(header, 124, 12) : Number(paxSize);
|
|
137
|
+
if (!Number.isSafeInteger(size) || size < 0)
|
|
138
|
+
refuse("an entry has an invalid size");
|
|
139
|
+
if (size > limits.maxEntryBytes) {
|
|
140
|
+
refuse(`an entry is ${size} bytes, over the ${limits.maxEntryBytes}-byte limit`);
|
|
141
|
+
}
|
|
142
|
+
const bodyStart = at + BLOCK;
|
|
143
|
+
const bodyEnd = bodyStart + size;
|
|
144
|
+
if (bodyEnd > tar.length)
|
|
145
|
+
refuse("it ends in the middle of an entry");
|
|
146
|
+
const body = tar.subarray(bodyStart, bodyEnd);
|
|
147
|
+
at = bodyStart + Math.ceil(size / BLOCK) * BLOCK;
|
|
148
|
+
if (type === "x") {
|
|
149
|
+
pax = paxRecords(body);
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
if (type === "g")
|
|
153
|
+
continue;
|
|
154
|
+
if (type === "L") {
|
|
155
|
+
longName = field(body, 0, body.length);
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
const prefix = field(header, 345, 155);
|
|
159
|
+
const plain = field(header, 0, 100);
|
|
160
|
+
const name = pax.get("path") ??
|
|
161
|
+
longName ??
|
|
162
|
+
(prefix === "" ? plain : `${prefix}/${plain}`);
|
|
163
|
+
pax = new Map();
|
|
164
|
+
longName = undefined;
|
|
165
|
+
if (type === "1" || type === "2") {
|
|
166
|
+
refuse(`the entry "${name}" is a ${type === "1" ? "hard" : "symbolic"} link`);
|
|
167
|
+
}
|
|
168
|
+
if (type !== "0" && type !== "\0" && type !== "5" && type !== "7") {
|
|
169
|
+
refuse(`the entry "${name}" is not a plain file or folder`);
|
|
170
|
+
}
|
|
171
|
+
const relative = entryPath(name);
|
|
172
|
+
if (relative === undefined)
|
|
173
|
+
continue;
|
|
174
|
+
const target = resolve(root, relative);
|
|
175
|
+
if (!target.startsWith(`${root}${sep}`)) {
|
|
176
|
+
refuse(`the entry "${name}" lands outside the package`);
|
|
177
|
+
}
|
|
178
|
+
if (type === "5") {
|
|
179
|
+
try {
|
|
180
|
+
mkdirSync(target, { recursive: true, mode: 0o755 });
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
refuse(`the folder "${name}" collides with another entry`);
|
|
184
|
+
}
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
try {
|
|
188
|
+
mkdirSync(dirname(target), { recursive: true, mode: 0o755 });
|
|
189
|
+
// `wx` never writes through an existing path, so a name repeated in the
|
|
190
|
+
// archive cannot overwrite (or write through) what an earlier entry made.
|
|
191
|
+
writeFileSync(target, body, { mode: 0o644, flag: "wx" });
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
refuse(`the entry "${name}" collides with another entry`);
|
|
195
|
+
}
|
|
196
|
+
files += 1;
|
|
197
|
+
}
|
|
198
|
+
return files;
|
|
199
|
+
}
|
|
200
|
+
//# sourceMappingURL=tar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tar.js","sourceRoot":"","sources":["../../../../src/capabilities/packages/tar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,SAAS,EA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G,IAAI,GAAG,GAAG,EAAE,CAAC,EAAE,CAAC;YACxC,MAAM,CAAC,cAAc,IAAI,6BAA6B,CAAC,CAAC;QAC1D,CAAC;QACD,IAAI,IAAI,KAAK,GAAG,EAAE,CAAC;YACjB,IAAI,CAAC;gBACH,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YACtD,CAAC;YAAC,MAAM,CAAC;gBACP,MAAM,CAAC,eAAe,IAAI,+BAA+B,CAAC,CAAC;YAC7D,CAAC;YACD,SAAS;QACX,CAAC;QACD,IAAI,CAAC;YACH,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YAC7D,wEAAwE;YACxE,0EAA0E;YAC1E,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,CAAC,cAAc,IAAI,+BAA+B,CAAC,CAAC;QAC5D,CAAC;QACD,KAAK,IAAI,CAAC,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/capabilities/packages/types.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `update` verb — move pins: one package's, or, with `--all`, every
|
|
3
|
+
* package's and every configured pack's. The only command that moves a pin.
|
|
4
|
+
* Without a name it moves nothing unless `--all` says so, so a bare `update`
|
|
5
|
+
* cannot overwrite the pins a teammate committed.
|
|
6
|
+
*/
|
|
7
|
+
import { BIN_NAME } from "../../constants.js";
|
|
8
|
+
import { GLOBAL_PARAM } from "./add.verb.js";
|
|
9
|
+
import { packagesFormatters } from "./packages.render.js";
|
|
10
|
+
/** The `update` verb spec. */
|
|
11
|
+
export const updateVerb = {
|
|
12
|
+
path: ["update"],
|
|
13
|
+
summary: "Move a package's pin, or every pin with --all, to what its source gives now.",
|
|
14
|
+
doc: "The only command that moves a pin. When a build says the lock changed, run `sources update` instead: it builds from the lock and moves nothing.",
|
|
15
|
+
useWhen: "when asked to move a package to its newest revision",
|
|
16
|
+
params: [
|
|
17
|
+
{
|
|
18
|
+
kind: "string",
|
|
19
|
+
name: "name",
|
|
20
|
+
doc: "The package or configured pack whose pin moves.",
|
|
21
|
+
positional: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
kind: "boolean",
|
|
25
|
+
name: "all",
|
|
26
|
+
doc: "Move every pin; required when no name is given.",
|
|
27
|
+
},
|
|
28
|
+
GLOBAL_PARAM,
|
|
29
|
+
],
|
|
30
|
+
output: { formatters: packagesFormatters("update") },
|
|
31
|
+
examples: [
|
|
32
|
+
{ cmd: `${BIN_NAME} update my-terms`, note: "move one pin" },
|
|
33
|
+
{ cmd: `${BIN_NAME} update --all`, note: "move every pin" },
|
|
34
|
+
],
|
|
35
|
+
capability: {
|
|
36
|
+
needsStore: false,
|
|
37
|
+
mutates: true,
|
|
38
|
+
needsNetwork: true,
|
|
39
|
+
mcp: {
|
|
40
|
+
expose: false,
|
|
41
|
+
reason: "It fetches new revisions of packages; an agent must not fetch untrusted packages on a prompt.",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
run: (params, runtime) => import("./runVerbs.js").then((module) => module.runUpdatePins(params, runtime)),
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=update.verb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.verb.js","sourceRoot":"","sources":["../../../../src/capabilities/packages/update.verb.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,C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native MCP `prompts/*` surface, both
|
|
4
|
+
* projecting the ONE `ds:Prompt` source. The `mcpPrompts` hook is the same
|
|
5
|
+
* `promptProvider` the kernel defines; this module is where it attaches, so the
|
|
6
|
+
* default MCP server advertises prompts sourced from the active graph.
|
|
7
|
+
*/
|
|
8
|
+
import { promptProvider } from "../../kernel/project/mcp/prompts/index.js";
|
|
9
|
+
import { promptListVerb, promptLookupVerb } from "./verbs.js";
|
|
10
|
+
/** The `prompt` capability module (content tools + native prompt surface). */
|
|
11
|
+
export const promptModule = {
|
|
12
|
+
name: "prompt",
|
|
13
|
+
verbs: [promptListVerb, promptLookupVerb],
|
|
14
|
+
mcpPrompts: promptProvider,
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/capabilities/prompt/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9D,8EAA8E;AAC9E,MAAM,CAAC,MAAM,YAAY,GAAqB;IAC5C,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,CAAC,cAAc,EAAE,gBAAgB,CAAC;IACzC,UAAU,EAAE,cAAc;CAC3B,CAAC"}
|