@canonical/pragma-cli 0.31.0 → 0.32.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/dist/pragma +0 -0
- package/package.json +27 -42
- package/src/bin.ts +292 -11
- package/src/capabilities/block/blockList.verb.ts +150 -0
- package/src/capabilities/block/index.ts +25 -0
- package/src/capabilities/block/pack.ts +155 -0
- package/src/capabilities/block/parity.test.ts +180 -0
- package/src/capabilities/block/tierChain.ts +78 -0
- package/src/capabilities/capabilities/capabilities.render.ts +89 -0
- package/src/capabilities/capabilities/capabilities.test.ts +131 -0
- package/src/capabilities/capabilities/capabilities.verb.ts +48 -0
- package/src/capabilities/capabilities/catalog.ts +144 -0
- package/src/capabilities/capabilities/hints.ts +221 -0
- package/src/capabilities/capabilities/index.ts +13 -0
- package/src/capabilities/capabilities/types.ts +58 -0
- package/src/capabilities/colophon/collectColophon.ts +68 -0
- package/src/capabilities/colophon/colophon.render.test.ts +87 -0
- package/src/capabilities/colophon/colophon.render.ts +38 -0
- package/src/capabilities/colophon/colophon.test.ts +241 -0
- package/src/capabilities/colophon/colophon.verb.ts +41 -0
- package/src/capabilities/colophon/index.ts +6 -0
- package/src/capabilities/colophon/markdownTerminal.test.ts +50 -0
- package/src/capabilities/colophon/markdownTerminal.ts +85 -0
- package/src/capabilities/colophon/pragmaColophon.ts +66 -0
- package/src/capabilities/colophon/types.ts +29 -0
- package/src/capabilities/config/collectConfigShow.ts +32 -0
- package/src/capabilities/config/field.render.ts +28 -0
- package/src/capabilities/config/field.test.ts +188 -0
- package/src/capabilities/config/fields.ts +152 -0
- package/src/capabilities/config/index.ts +6 -0
- package/src/capabilities/config/runField.ts +59 -0
- package/src/capabilities/config/runSet.ts +38 -0
- package/src/capabilities/config/set.test.ts +207 -0
- package/src/capabilities/config/set.verb.ts +70 -0
- package/src/capabilities/config/show.render.ts +61 -0
- package/src/capabilities/config/show.verb.ts +45 -0
- package/src/capabilities/config/types.ts +27 -0
- package/src/capabilities/create/byteEquality.subprocess.test.ts +88 -0
- package/src/capabilities/create/byteEquality.test.ts +222 -0
- package/src/capabilities/create/compiledCreate.subprocess.test.ts +152 -0
- package/src/capabilities/create/create.mcp.test.ts +139 -0
- package/src/capabilities/create/create.render.ts +50 -0
- package/src/capabilities/create/create.test.ts +403 -0
- package/src/capabilities/create/create.verb.ts +435 -0
- package/src/capabilities/create/cwdJail.test.ts +129 -0
- package/src/capabilities/create/generatorToVerbSpec.ts +111 -0
- package/src/capabilities/create/index.ts +25 -0
- package/src/capabilities/create/pathJail.ts +73 -0
- package/src/capabilities/create/pickGenerator.ts +63 -0
- package/src/capabilities/create/templates.embedded.generated.ts +53 -0
- package/src/capabilities/create/types.ts +8 -0
- package/src/capabilities/doctor/checks/checkConfigFile.ts +41 -0
- package/src/capabilities/doctor/checks/checkKeStore.ts +39 -0
- package/src/capabilities/doctor/checks/checkMcpCommands.ts +108 -0
- package/src/capabilities/doctor/checks/checkMcpConfigured.ts +61 -0
- package/src/capabilities/doctor/checks/checkNodeVersion.ts +25 -0
- package/src/capabilities/doctor/checks/checkPackageRefs.ts +73 -0
- package/src/capabilities/doctor/checks/checkPragmaVersion.ts +22 -0
- package/src/capabilities/doctor/checks/checkShellCompletions.test.ts +111 -0
- package/src/capabilities/doctor/checks/checkShellCompletions.ts +131 -0
- package/src/capabilities/doctor/checks/checkSkillsSymlinked.ts +60 -0
- package/src/capabilities/doctor/doctor.render.ts +116 -0
- package/src/capabilities/doctor/doctor.test.ts +179 -0
- package/src/capabilities/doctor/doctor.verb.ts +46 -0
- package/src/capabilities/doctor/index.ts +6 -0
- package/src/capabilities/doctor/runChecks.ts +76 -0
- package/src/capabilities/doctor/types.ts +41 -0
- package/src/capabilities/emptyRecovery.test.ts +112 -0
- package/src/capabilities/graph/index.ts +21 -0
- package/src/capabilities/graph/inspect.render.ts +38 -0
- package/src/capabilities/graph/inspect.test.ts +80 -0
- package/src/capabilities/graph/inspect.verb.ts +51 -0
- package/src/capabilities/graph/query.render.ts +77 -0
- package/src/capabilities/graph/query.test.ts +156 -0
- package/src/capabilities/graph/query.verb.ts +58 -0
- package/src/capabilities/graph/runQuery.ts +49 -0
- package/src/capabilities/index.ts +54 -0
- package/src/capabilities/info/collectInfo.ts +76 -0
- package/src/capabilities/info/index.ts +6 -0
- package/src/capabilities/info/info.render.ts +72 -0
- package/src/capabilities/info/info.test.ts +127 -0
- package/src/capabilities/info/info.verb.ts +46 -0
- package/src/capabilities/info/types.ts +42 -0
- package/src/capabilities/lazy.test.ts +89 -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 +35 -0
- package/src/capabilities/modifier/index.ts +15 -0
- package/src/capabilities/modifier/pack.ts +64 -0
- package/src/capabilities/ontology/index.ts +12 -0
- package/src/capabilities/ontology/ontology.test.ts +94 -0
- package/src/capabilities/ontology/queries.ts +197 -0
- package/src/capabilities/ontology/render.ts +87 -0
- package/src/capabilities/ontology/verbs.ts +170 -0
- package/src/capabilities/prompt/index.ts +18 -0
- package/src/capabilities/prompt/prompt.render.ts +70 -0
- package/src/capabilities/prompt/prompt.test.ts +119 -0
- package/src/capabilities/prompt/types.ts +30 -0
- package/src/capabilities/prompt/verbs.ts +93 -0
- package/src/capabilities/resources/index.ts +15 -0
- package/src/capabilities/resources/provider.ts +231 -0
- package/src/capabilities/resources/resources.test.ts +114 -0
- package/src/capabilities/roundtrip.test.ts +107 -0
- package/src/capabilities/setup/index.ts +6 -0
- package/src/capabilities/setup/operations/setupCompletions.ts +108 -0
- package/src/capabilities/setup/operations/setupGenerator.ts +307 -0
- package/src/capabilities/setup/operations/setupLsp.ts +61 -0
- package/src/capabilities/setup/operations/setupMcp.ts +85 -0
- package/src/capabilities/setup/operations/setupSkills.ts +199 -0
- package/src/capabilities/setup/setup.render.ts +49 -0
- package/src/capabilities/setup/setup.test.ts +351 -0
- package/src/capabilities/setup/setup.verb.ts +209 -0
- package/src/capabilities/setup/shell.ts +85 -0
- package/src/capabilities/setup/types.ts +42 -0
- package/src/capabilities/shared/assertExecOk.ts +106 -0
- package/src/capabilities/shared/packageManager.ts +62 -0
- package/src/capabilities/shared/registry.ts +70 -0
- package/src/capabilities/skill/discover.ts +178 -0
- package/src/capabilities/skill/index.ts +12 -0
- package/src/capabilities/skill/render.ts +60 -0
- package/src/capabilities/skill/skill.test.ts +142 -0
- package/src/capabilities/skill/verbs.ts +100 -0
- package/src/capabilities/sources/collectStatus.ts +87 -0
- package/src/capabilities/sources/index.ts +15 -0
- package/src/capabilities/sources/installSkills.ts +124 -0
- package/src/capabilities/sources/runUpdate.ts +407 -0
- package/src/capabilities/sources/sources.test.ts +642 -0
- package/src/capabilities/sources/status.render.ts +56 -0
- package/src/capabilities/sources/status.verb.ts +42 -0
- package/src/capabilities/sources/types.ts +51 -0
- package/src/capabilities/sources/update.render.ts +35 -0
- package/src/capabilities/sources/update.verb.ts +76 -0
- package/src/capabilities/standard/index.ts +18 -0
- package/src/capabilities/standard/pack.ts +128 -0
- package/src/capabilities/standard/parity.test.ts +208 -0
- package/src/capabilities/surface.test.ts +208 -0
- package/src/capabilities/tier/index.ts +19 -0
- package/src/capabilities/tier/lookup.render.ts +34 -0
- package/src/capabilities/tier/lookup.test.ts +68 -0
- package/src/capabilities/tier/lookup.verb.ts +44 -0
- package/src/capabilities/tier/pack.ts +28 -0
- package/src/capabilities/tier/runLookup.ts +59 -0
- package/src/capabilities/token/addConfig.render.ts +27 -0
- package/src/capabilities/token/addConfig.test.ts +62 -0
- package/src/capabilities/token/addConfig.verb.ts +40 -0
- package/src/capabilities/token/index.ts +19 -0
- package/src/capabilities/token/pack.ts +58 -0
- package/src/capabilities/token/runAddConfig.ts +95 -0
- package/src/capabilities/upgrade/index.ts +6 -0
- package/src/capabilities/upgrade/runUpgrade.ts +119 -0
- package/src/capabilities/upgrade/types.ts +21 -0
- package/src/capabilities/upgrade/upgrade.render.ts +55 -0
- package/src/capabilities/upgrade/upgrade.test.ts +372 -0
- package/src/capabilities/upgrade/upgrade.verb.ts +56 -0
- package/src/constants.test.ts +33 -0
- package/src/constants.ts +38 -70
- package/src/index.ts +27 -122
- package/src/kernel/completion/__snapshots__/emitScripts.test.ts.snap +340 -0
- package/src/kernel/completion/bashDrive.test.ts +73 -0
- package/src/kernel/completion/complete.test.ts +101 -0
- package/src/kernel/completion/complete.ts +77 -0
- package/src/kernel/completion/emitScripts.test.ts +173 -0
- package/src/kernel/completion/emitScripts.ts +122 -0
- package/src/kernel/completion/entitySource.test.ts +198 -0
- package/src/kernel/completion/entitySource.ts +269 -0
- package/src/kernel/completion/index.ts +42 -0
- package/src/kernel/completion/model.test.ts +405 -0
- package/src/kernel/completion/model.ts +259 -0
- package/src/kernel/completion/parse.test.ts +338 -0
- package/src/kernel/completion/parse.ts +294 -0
- package/src/kernel/completion/rank.test.ts +100 -0
- package/src/kernel/completion/rank.ts +118 -0
- package/src/kernel/completion/resolve.test.ts +204 -0
- package/src/kernel/completion/resolve.ts +133 -0
- package/src/kernel/completion/safety.test.ts +374 -0
- package/src/kernel/completion/templates/bash.ts +249 -0
- package/src/kernel/completion/templates/fish.ts +245 -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 +153 -0
- package/src/kernel/config/__snapshots__/firstRun.test.ts.snap +11 -0
- package/src/kernel/config/defaults.ts +28 -0
- package/src/kernel/config/evaluateProjectConfig.ts +119 -0
- package/src/kernel/config/findProjectConfig.ts +45 -0
- package/src/kernel/config/firstRun.test.ts +60 -0
- package/src/kernel/config/firstRun.ts +91 -0
- package/src/kernel/config/globalConfig.ts +94 -0
- package/src/kernel/config/index.ts +35 -0
- package/src/kernel/config/paths.ts +39 -0
- package/src/kernel/config/readConfig.test.ts +245 -0
- package/src/kernel/config/readConfig.ts +94 -0
- package/src/kernel/config/schema.ts +56 -0
- package/src/kernel/config/types.ts +106 -0
- package/src/kernel/config/writeConfigField.ts +82 -0
- package/src/kernel/error/PragmaError.test.ts +119 -0
- package/src/kernel/error/PragmaError.ts +182 -0
- package/src/kernel/error/constants.ts +38 -0
- package/src/kernel/error/fromTaskError.test.ts +83 -0
- package/src/kernel/error/fromTaskError.ts +80 -0
- package/src/kernel/error/index.ts +23 -0
- package/src/kernel/error/recovery.test.ts +60 -0
- package/src/kernel/error/recovery.ts +49 -0
- package/src/kernel/error/renderError.ts +101 -0
- package/src/kernel/error/serialize.ts +28 -0
- package/src/kernel/error/types.ts +62 -0
- package/src/kernel/packs/collect.test.ts +138 -0
- package/src/kernel/packs/collect.ts +108 -0
- package/src/kernel/packs/compile.test.ts +229 -0
- package/src/kernel/packs/compile.ts +315 -0
- package/src/kernel/packs/disclosure.test.ts +200 -0
- package/src/kernel/packs/disclosure.ts +98 -0
- package/src/kernel/packs/glob.ts +39 -0
- package/src/kernel/packs/graphql/buildLookupDocument.ts +397 -0
- package/src/kernel/packs/graphql/fetchGraphqlLookup.ts +217 -0
- package/src/kernel/packs/graphql/nameMap.ts +67 -0
- package/src/kernel/packs/graphqlSource.test.ts +383 -0
- package/src/kernel/packs/iri.ts +78 -0
- package/src/kernel/packs/renderPack.ts +196 -0
- package/src/kernel/packs/resolveEntity.ts +232 -0
- package/src/kernel/packs/runBodies.ts +157 -0
- package/src/kernel/packs/sample.ts +60 -0
- package/src/kernel/packs/schema.ts +328 -0
- package/src/kernel/packs/sparql/applyFilters.ts +83 -0
- package/src/kernel/packs/sparql/applySearch.ts +33 -0
- package/src/kernel/packs/sparql/buildLookupQuery.ts +180 -0
- package/src/kernel/packs/sparql/escape.ts +22 -0
- package/src/kernel/packs/sparql/runSelect.test.ts +80 -0
- package/src/kernel/packs/sparql/runSelect.ts +84 -0
- package/src/kernel/packs/toolDescription.test.ts +81 -0
- package/src/kernel/packs/types.ts +337 -0
- package/src/kernel/packs/uniqueness.ts +35 -0
- package/src/kernel/project/cli/buildProgram.test.ts +387 -0
- package/src/kernel/project/cli/buildProgram.ts +280 -0
- package/src/kernel/project/cli/dispatch.test.ts +288 -0
- package/src/kernel/project/cli/dispatch.ts +334 -0
- package/src/kernel/project/cli/exitCodes.test.ts +59 -0
- package/src/kernel/project/cli/exitCodes.ts +68 -0
- package/src/kernel/project/cli/globalFlags.test.ts +99 -0
- package/src/kernel/project/cli/globalFlags.ts +149 -0
- package/src/kernel/project/cli/helpFormat.ts +58 -0
- package/src/kernel/project/cli/index.ts +21 -0
- package/src/kernel/project/cli/interactionSeam.test.ts +99 -0
- package/src/kernel/project/cli/rootHelp.ts +218 -0
- package/src/kernel/project/cli/suggest.test.ts +54 -0
- package/src/kernel/project/cli/suggest.ts +67 -0
- package/src/kernel/project/cli/suggestNames.ts +122 -0
- package/src/kernel/project/cli/verbHelp.test.ts +138 -0
- package/src/kernel/project/cli/verbHelp.ts +144 -0
- package/src/kernel/project/mcp/buildServer.ts +70 -0
- package/src/kernel/project/mcp/envelope.ts +44 -0
- package/src/kernel/project/mcp/index.ts +8 -0
- package/src/kernel/project/mcp/instructions.ts +48 -0
- package/src/kernel/project/mcp/parity.test.ts +72 -0
- package/src/kernel/project/mcp/prompts/prompts.test.ts +96 -0
- package/src/kernel/project/mcp/prompts/provider.ts +74 -0
- package/src/kernel/project/mcp/prompts/source.ts +194 -0
- package/src/kernel/project/mcp/registerVerb.test.ts +238 -0
- package/src/kernel/project/mcp/registerVerb.ts +296 -0
- package/src/kernel/project/mcp/serve.ts +34 -0
- package/src/kernel/project/mcp/toolDescriptions.test.ts +80 -0
- package/src/kernel/render/__snapshots__/renderers.test.ts.snap +127 -0
- package/src/kernel/render/compactUri.ts +25 -0
- package/src/kernel/render/contracts.ts +72 -0
- package/src/kernel/render/disclosure.ts +44 -0
- package/src/kernel/render/envelope.ts +50 -0
- package/src/kernel/render/formatters.ts +30 -0
- package/src/kernel/render/index.ts +30 -0
- package/src/kernel/render/prefixes.ts +21 -0
- package/src/kernel/render/renderers.test.ts +171 -0
- package/src/kernel/render/renderers.ts +429 -0
- package/src/kernel/render/writeStdout.test.ts +43 -0
- package/src/kernel/render/writeStdout.ts +49 -0
- package/src/kernel/runtime/boot.test.ts +69 -0
- package/src/kernel/runtime/boot.ts +59 -0
- package/src/kernel/runtime/facade.test.ts +125 -0
- package/src/kernel/runtime/facade.ts +47 -0
- package/src/kernel/runtime/graphpack/build.ts +148 -0
- package/src/kernel/runtime/graphpack/buildIndex.ts +229 -0
- package/src/kernel/runtime/graphpack/embedded/pack.generated.ts +8 -0
- package/src/kernel/runtime/graphpack/embedded/pack.index.generated.ts +4 -0
- package/src/kernel/runtime/graphpack/embedded/sample.ttl +39 -0
- package/src/kernel/runtime/graphpack/embedded.ts +70 -0
- package/src/kernel/runtime/graphpack/graphpack.test.ts +153 -0
- package/src/kernel/runtime/graphpack/hash.ts +46 -0
- package/src/kernel/runtime/graphpack/index.ts +21 -0
- package/src/kernel/runtime/graphpack/manifest.ts +55 -0
- package/src/kernel/runtime/graphpack/read.ts +102 -0
- package/src/kernel/runtime/graphpack/types.ts +111 -0
- package/src/kernel/runtime/index.ts +15 -0
- package/src/kernel/runtime/loadSession.ts +56 -0
- package/src/kernel/runtime/lock.ts +90 -0
- package/src/kernel/runtime/paths.ts +37 -0
- package/src/kernel/runtime/probe.test.ts +16 -0
- package/src/kernel/runtime/probe.ts +39 -0
- package/src/kernel/runtime/readEntity.ts +83 -0
- package/src/kernel/runtime/refs/gitOps.ts +88 -0
- package/src/kernel/runtime/refs/parseRef.test.ts +34 -0
- package/src/kernel/runtime/refs/parseRef.ts +103 -0
- package/src/kernel/runtime/refs/resolve.ts +320 -0
- package/src/kernel/runtime/resolveSources.test.ts +154 -0
- package/src/kernel/runtime/resolveSources.ts +66 -0
- package/src/kernel/runtime/store.test.ts +94 -0
- package/src/kernel/runtime/store.ts +90 -0
- package/src/kernel/runtime/storeless.test.ts +86 -0
- package/src/kernel/runtime/types.ts +210 -0
- package/src/kernel/runtime/wasmEmbed.test.ts +142 -0
- package/src/kernel/spec/asVerb.ts +23 -0
- package/src/kernel/spec/emitSurface.test.ts +65 -0
- package/src/kernel/spec/emitSurface.ts +223 -0
- package/src/kernel/spec/index.ts +34 -0
- package/src/kernel/spec/surfaceConformance.test.ts +94 -0
- package/src/kernel/spec/surfaceConformance.ts +135 -0
- package/src/kernel/spec/types.ts +233 -0
- package/src/kernel/spec/validate.test.ts +81 -0
- package/src/kernel/spec/validate.ts +125 -0
- package/src/testing/PARITY_GAPS.test.ts +32 -0
- package/src/testing/PARITY_GAPS.ts +179 -0
- package/src/testing/behavioral/README.md +164 -0
- package/src/testing/behavioral/agentSession.mcp.test.ts +160 -0
- package/src/testing/behavioral/autoLlm.e2e.test.ts +44 -0
- package/src/testing/behavioral/completion.test.ts +132 -0
- package/src/testing/behavioral/disclosure.test.ts +103 -0
- package/src/testing/behavioral/errorMatrix.mcp.test.ts +120 -0
- package/src/testing/behavioral/errorMatrix.storeless.test.ts +123 -0
- package/src/testing/behavioral/exitCodes.e2e.test.ts +53 -0
- package/src/testing/behavioral/firstRun.e2e.test.ts +40 -0
- package/src/testing/behavioral/harness.foundation.test.ts +136 -0
- package/src/testing/behavioral/journeys.cli.test.ts +129 -0
- package/src/testing/behavioral/liveReadSurface.ts +80 -0
- package/src/testing/behavioral/mcpServe.e2e.test.ts +21 -0
- package/src/testing/behavioral/mcpSurface.test.ts +139 -0
- package/src/testing/behavioral/parity.test.ts +224 -0
- package/src/testing/behavioral/rootCli.e2e.test.ts +62 -0
- package/src/testing/eval/__snapshots__/eval.test.ts.snap +201 -0
- package/src/testing/eval/cases/assembly.ts +195 -0
- package/src/testing/eval/cases/effectful.ts +245 -0
- package/src/testing/eval/cases/readNouns.ts +232 -0
- package/src/testing/eval/cases/stable.ts +163 -0
- package/src/testing/eval/eval.test.ts +74 -0
- package/src/testing/eval/harness.ts +91 -0
- package/src/testing/eval/report.ts +58 -0
- package/src/testing/fixtures/blockGraph.ts +112 -0
- package/src/testing/fixtures/completionFixture.ts +239 -0
- package/src/testing/fixtures/fixtureCapability.ts +175 -0
- package/src/testing/fixtures/graph/canonical.ts +184 -0
- package/src/testing/fixtures/packs/recipe.ts +78 -0
- package/src/testing/helpers/fixtureGraph.ts +148 -0
- package/src/testing/helpers/golden.ts +45 -0
- package/src/testing/helpers/packRuntime.ts +118 -0
- package/src/testing/helpers/parity.ts +86 -0
- package/src/testing/helpers/projectCli.ts +35 -0
- package/src/testing/helpers/projectMcp.ts +145 -0
- package/src/testing/helpers/runCli.ts +128 -0
- package/src/testing/perf/budgets.test.ts +164 -0
- package/src/testing/perf/budgets.ts +37 -0
- package/src/testing/perf/globalSetup.ts +30 -0
- package/src/testing/perf/measure.ts +97 -0
- package/src/testing/setupXdgIsolation.ts +13 -12
- package/src/types.ts +42 -0
- package/README.md +0 -458
- package/src/bin.test.ts +0 -54
- package/src/compile-validation.runner.ts +0 -137
- package/src/compile-validation.ts +0 -191
- package/src/completions/computeSocketPath.test.ts +0 -26
- package/src/completions/computeSocketPath.ts +0 -16
- package/src/completions/constants.ts +0 -25
- package/src/completions/handleQuery.test.ts +0 -125
- package/src/completions/handleQuery.ts +0 -49
- package/src/completions/index.ts +0 -14
- package/src/completions/queryCompletions.test.ts +0 -105
- package/src/completions/queryCompletions.ts +0 -75
- package/src/completions/querySocket.test.ts +0 -101
- package/src/completions/querySocket.ts +0 -71
- package/src/completions/startCompletionsServer.test.ts +0 -74
- package/src/completions/startCompletionsServer.ts +0 -75
- package/src/completions/startCompletionsServer.unit.test.ts +0 -131
- package/src/completions/waitForSocket.test.ts +0 -27
- package/src/completions/waitForSocket.ts +0 -27
- package/src/config/configExists.ts +0 -14
- package/src/config/defaultConfig.test.ts +0 -33
- package/src/config/defaultConfig.ts +0 -59
- package/src/config/defaults.json +0 -17
- package/src/config/findProjectConfigPath.test.ts +0 -53
- package/src/config/findProjectConfigPath.ts +0 -36
- package/src/config/index.ts +0 -21
- package/src/config/mergeConfigFileUpdate.ts +0 -58
- package/src/config/parseConfigValues.ts +0 -217
- package/src/config/readConfig.test.ts +0 -395
- package/src/config/readConfig.ts +0 -21
- package/src/config/readConfigLayers.test.ts +0 -109
- package/src/config/readConfigLayers.ts +0 -118
- package/src/config/resolveConfigPath.test.ts +0 -20
- package/src/config/resolveConfigPath.ts +0 -11
- package/src/config/resolveGlobalConfigPath.ts +0 -13
- package/src/config/resolveWriteConfigPath.test.ts +0 -53
- package/src/config/resolveWriteConfigPath.ts +0 -31
- package/src/config/types.ts +0 -128
- package/src/config/writeConfig.ts +0 -37
- package/src/domains/block/blockConfig.ts +0 -97
- package/src/domains/block/commands/index.ts +0 -5
- package/src/domains/block/commands/list.test.ts +0 -111
- package/src/domains/block/commands/list.ts +0 -11
- package/src/domains/block/commands/lookup.test.ts +0 -187
- package/src/domains/block/commands/lookup.ts +0 -14
- package/src/domains/block/commands/sample.ts +0 -56
- package/src/domains/block/formatters/index.ts +0 -5
- package/src/domains/block/formatters/list.test.ts +0 -107
- package/src/domains/block/formatters/list.ts +0 -50
- package/src/domains/block/formatters/lookup.test.ts +0 -318
- package/src/domains/block/formatters/lookup.ts +0 -149
- package/src/domains/block/formatters/sample.ts +0 -21
- package/src/domains/block/formatters/types.ts +0 -16
- package/src/domains/block/helpers/index.ts +0 -4
- package/src/domains/block/helpers/resolveAspects.test.ts +0 -64
- package/src/domains/block/helpers/resolveAspects.ts +0 -35
- package/src/domains/block/index.ts +0 -25
- package/src/domains/block/mcp/index.ts +0 -2
- package/src/domains/block/mcp/specs.ts +0 -67
- package/src/domains/block/operations/index.ts +0 -5
- package/src/domains/block/operations/list.test.ts +0 -80
- package/src/domains/block/operations/list.ts +0 -72
- package/src/domains/block/operations/lookup.test.ts +0 -129
- package/src/domains/block/operations/lookup.ts +0 -446
- package/src/domains/block/operations/sample.ts +0 -41
- package/src/domains/block/orchestration/blockEmptyError.test.ts +0 -26
- package/src/domains/block/orchestration/blockEmptyError.ts +0 -19
- package/src/domains/block/orchestration/buildBlockFilters.ts +0 -12
- package/src/domains/block/orchestration/enrichBlocks.ts +0 -44
- package/src/domains/block/orchestration/index.ts +0 -5
- package/src/domains/block/orchestration/resolveBlockList.ts +0 -39
- package/src/domains/block/orchestration/resolveBlockLookup.ts +0 -35
- package/src/domains/block/stories.test.ts +0 -28
- package/src/domains/block/stories.ts +0 -260
- package/src/domains/block/types.ts +0 -30
- package/src/domains/config/commands/channel.test.ts +0 -128
- package/src/domains/config/commands/channel.ts +0 -99
- package/src/domains/config/commands/configScope.ts +0 -46
- package/src/domains/config/commands/framework.test.ts +0 -119
- package/src/domains/config/commands/framework.ts +0 -103
- package/src/domains/config/commands/index.ts +0 -6
- package/src/domains/config/commands/show.test.ts +0 -61
- package/src/domains/config/commands/show.ts +0 -11
- package/src/domains/config/commands/tier.test.ts +0 -102
- package/src/domains/config/commands/tier.ts +0 -97
- package/src/domains/config/commands/trace.test.ts +0 -165
- package/src/domains/config/commands/trace.ts +0 -83
- package/src/domains/config/formatters/channel.test.ts +0 -70
- package/src/domains/config/formatters/channel.ts +0 -37
- package/src/domains/config/formatters/framework.ts +0 -37
- package/src/domains/config/formatters/index.ts +0 -6
- package/src/domains/config/formatters/show.test.ts +0 -153
- package/src/domains/config/formatters/show.ts +0 -89
- package/src/domains/config/formatters/tier.test.ts +0 -86
- package/src/domains/config/formatters/tier.ts +0 -48
- package/src/domains/config/formatters/trace.ts +0 -28
- package/src/domains/config/index.ts +0 -36
- package/src/domains/config/mcp/index.ts +0 -2
- package/src/domains/config/mcp/specs.ts +0 -100
- package/src/domains/config/operations/index.ts +0 -6
- package/src/domains/config/operations/show.test.ts +0 -78
- package/src/domains/config/operations/show.ts +0 -48
- package/src/domains/config/operations/types.ts +0 -20
- package/src/domains/config/operations/validateChannel.test.ts +0 -36
- package/src/domains/config/operations/validateChannel.ts +0 -24
- package/src/domains/config/operations/validateFramework.ts +0 -24
- package/src/domains/config/operations/validateTier.test.ts +0 -65
- package/src/domains/config/operations/validateTier.ts +0 -43
- package/src/domains/config/stories.ts +0 -42
- package/src/domains/config/tasks/index.ts +0 -6
- package/src/domains/config/tasks/setChannel.ts +0 -21
- package/src/domains/config/tasks/setFramework.ts +0 -21
- package/src/domains/config/tasks/setTier.ts +0 -20
- package/src/domains/config/tasks/setTrace.ts +0 -20
- package/src/domains/config/tasks/writeConfigField.ts +0 -41
- package/src/domains/create/generatorPack/bundled.ts +0 -49
- package/src/domains/create/generatorPack/compileGeneratorPack.test.ts +0 -159
- package/src/domains/create/generatorPack/compileGeneratorPack.ts +0 -312
- package/src/domains/create/index.ts +0 -21
- package/src/domains/create/mcp/index.ts +0 -2
- package/src/domains/create/mcp/specs.ts +0 -13
- package/src/domains/create/renderGeneratorUi.test.ts +0 -103
- package/src/domains/create/renderGeneratorUi.ts +0 -65
- package/src/domains/doctor/commands/doctor.test.ts +0 -75
- package/src/domains/doctor/commands/doctor.ts +0 -43
- package/src/domains/doctor/commands/index.ts +0 -2
- package/src/domains/doctor/formatters/doctor.test.ts +0 -165
- package/src/domains/doctor/formatters/doctor.ts +0 -136
- package/src/domains/doctor/formatters/index.ts +0 -2
- package/src/domains/doctor/index.ts +0 -9
- package/src/domains/doctor/mcp/index.ts +0 -2
- package/src/domains/doctor/mcp/specs.ts +0 -41
- package/src/domains/doctor/operations/checks/checkConfigFile.ts +0 -42
- package/src/domains/doctor/operations/checks/checkKeStore.ts +0 -38
- package/src/domains/doctor/operations/checks/checkMcpCommands.ts +0 -133
- package/src/domains/doctor/operations/checks/checkMcpConfigured.ts +0 -65
- package/src/domains/doctor/operations/checks/checkNodeVersion.ts +0 -25
- package/src/domains/doctor/operations/checks/checkPackageRefs.ts +0 -76
- package/src/domains/doctor/operations/checks/checkPragmaVersion.ts +0 -20
- package/src/domains/doctor/operations/checks/checkShellCompletions.ts +0 -42
- package/src/domains/doctor/operations/checks/checkSkillsSymlinked.ts +0 -64
- package/src/domains/doctor/operations/checks/index.ts +0 -10
- package/src/domains/doctor/operations/checks.test.ts +0 -307
- package/src/domains/doctor/operations/index.ts +0 -3
- package/src/domains/doctor/operations/runChecks.test.ts +0 -176
- package/src/domains/doctor/operations/runChecks.ts +0 -78
- package/src/domains/doctor/operations/types.ts +0 -42
- package/src/domains/graph/commands/index.ts +0 -4
- package/src/domains/graph/commands/inspect.test.ts +0 -94
- package/src/domains/graph/commands/inspect.ts +0 -63
- package/src/domains/graph/commands/query.test.ts +0 -94
- package/src/domains/graph/commands/query.ts +0 -60
- package/src/domains/graph/formatters/index.ts +0 -4
- package/src/domains/graph/formatters/inspect.ts +0 -50
- package/src/domains/graph/formatters/query.test.ts +0 -87
- package/src/domains/graph/formatters/query.ts +0 -74
- package/src/domains/graph/helpers/index.ts +0 -3
- package/src/domains/graph/helpers/resolveUri.test.ts +0 -50
- package/src/domains/graph/helpers/resolveUri.ts +0 -77
- package/src/domains/graph/index.ts +0 -22
- package/src/domains/graph/mcp/index.ts +0 -2
- package/src/domains/graph/mcp/specs.ts +0 -82
- package/src/domains/graph/operations/executeQuery.test.ts +0 -68
- package/src/domains/graph/operations/executeQuery.ts +0 -32
- package/src/domains/graph/operations/index.ts +0 -4
- package/src/domains/graph/operations/inspectUri.test.ts +0 -101
- package/src/domains/graph/operations/inspectUri.ts +0 -64
- package/src/domains/graphql/commands/build.test.ts +0 -196
- package/src/domains/graphql/commands/build.ts +0 -117
- package/src/domains/graphql/commands/check.test.ts +0 -141
- package/src/domains/graphql/commands/check.ts +0 -81
- package/src/domains/graphql/commands/index.ts +0 -5
- package/src/domains/graphql/commands/serve.test.ts +0 -46
- package/src/domains/graphql/commands/serve.ts +0 -141
- package/src/domains/graphql/constants.ts +0 -10
- package/src/domains/graphql/formatters/index.ts +0 -3
- package/src/domains/graphql/formatters/report.ts +0 -78
- package/src/domains/graphql/helpers/gatherSources.test.ts +0 -92
- package/src/domains/graphql/helpers/gatherSources.ts +0 -58
- package/src/domains/graphql/helpers/index.ts +0 -6
- package/src/domains/graphql/helpers/parsePrefixes.test.ts +0 -44
- package/src/domains/graphql/helpers/parsePrefixes.ts +0 -38
- package/src/domains/graphql/helpers/resolveSourceFiles.test.ts +0 -65
- package/src/domains/graphql/helpers/resolveSourceFiles.ts +0 -66
- package/src/domains/graphql/helpers/routeGraphql.test.ts +0 -43
- package/src/domains/graphql/helpers/routeGraphql.ts +0 -28
- package/src/domains/graphql/index.ts +0 -24
- package/src/domains/graphql/operations/compileSchema.test.ts +0 -95
- package/src/domains/graphql/operations/compileSchema.ts +0 -107
- package/src/domains/graphql/operations/createSchemaServer.test.ts +0 -50
- package/src/domains/graphql/operations/createSchemaServer.ts +0 -75
- package/src/domains/graphql/operations/ensureSchemaArtifact.test.ts +0 -167
- package/src/domains/graphql/operations/ensureSchemaArtifact.ts +0 -178
- package/src/domains/graphql/operations/index.ts +0 -17
- package/src/domains/graphql/types.ts +0 -29
- package/src/domains/info/commands/index.ts +0 -4
- package/src/domains/info/commands/info.test.ts +0 -88
- package/src/domains/info/commands/info.ts +0 -47
- package/src/domains/info/commands/upgrade.test.ts +0 -183
- package/src/domains/info/commands/upgrade.ts +0 -153
- package/src/domains/info/constants.test.ts +0 -22
- package/src/domains/info/constants.ts +0 -15
- package/src/domains/info/formatters/index.ts +0 -8
- package/src/domains/info/formatters/info.test.ts +0 -207
- package/src/domains/info/formatters/info.ts +0 -131
- package/src/domains/info/formatters/upgrade.test.ts +0 -136
- package/src/domains/info/formatters/upgrade.ts +0 -70
- package/src/domains/info/index.ts +0 -9
- package/src/domains/info/mcp/index.ts +0 -2
- package/src/domains/info/mcp/specs.ts +0 -65
- package/src/domains/info/operations/checkRegistryVersion.test.ts +0 -124
- package/src/domains/info/operations/checkRegistryVersion.ts +0 -45
- package/src/domains/info/operations/collectEntityCounts.test.ts +0 -156
- package/src/domains/info/operations/collectEntityCounts.ts +0 -123
- package/src/domains/info/operations/collectInfo.test.ts +0 -122
- package/src/domains/info/operations/collectInfo.ts +0 -94
- package/src/domains/info/operations/collectStoreSummary.test.ts +0 -61
- package/src/domains/info/operations/collectStoreSummary.ts +0 -42
- package/src/domains/info/operations/index.ts +0 -6
- package/src/domains/info/types.test-d.ts +0 -35
- package/src/domains/info/types.ts +0 -67
- package/src/domains/llm/capabilities.test.ts +0 -111
- package/src/domains/llm/commands/capabilities.ts +0 -37
- package/src/domains/llm/commands/index.ts +0 -4
- package/src/domains/llm/commands/llm.ts +0 -41
- package/src/domains/llm/data/commandReference.ts +0 -106
- package/src/domains/llm/data/decisionTrees.ts +0 -55
- package/src/domains/llm/data/index.ts +0 -6
- package/src/domains/llm/data/toolCatalog.ts +0 -221
- package/src/domains/llm/formatters/capabilities.ts +0 -50
- package/src/domains/llm/formatters/index.ts +0 -4
- package/src/domains/llm/formatters/orientation.ts +0 -57
- package/src/domains/llm/index.ts +0 -9
- package/src/domains/llm/llmCommand.test.ts +0 -101
- package/src/domains/llm/mcp/index.ts +0 -2
- package/src/domains/llm/mcp/specs.ts +0 -93
- package/src/domains/llm/operations/collectContext.test.ts +0 -64
- package/src/domains/llm/operations/collectContext.ts +0 -37
- package/src/domains/llm/operations/index.ts +0 -3
- package/src/domains/llm/types.ts +0 -72
- package/src/domains/modifier/commands/index.ts +0 -5
- package/src/domains/modifier/commands/list.test.ts +0 -57
- package/src/domains/modifier/commands/list.ts +0 -9
- package/src/domains/modifier/commands/lookup.test.ts +0 -91
- package/src/domains/modifier/commands/lookup.ts +0 -14
- package/src/domains/modifier/commands/sample.ts +0 -54
- package/src/domains/modifier/formatters/index.ts +0 -8
- package/src/domains/modifier/formatters/list.test.ts +0 -38
- package/src/domains/modifier/formatters/list.ts +0 -22
- package/src/domains/modifier/formatters/lookup.test.ts +0 -33
- package/src/domains/modifier/formatters/lookup.ts +0 -50
- package/src/domains/modifier/formatters/sample.ts +0 -15
- package/src/domains/modifier/index.ts +0 -27
- package/src/domains/modifier/mcp/index.ts +0 -2
- package/src/domains/modifier/mcp/specs.ts +0 -65
- package/src/domains/modifier/modifierConfig.ts +0 -36
- package/src/domains/modifier/operations/index.ts +0 -5
- package/src/domains/modifier/operations/list.test.ts +0 -39
- package/src/domains/modifier/operations/list.ts +0 -41
- package/src/domains/modifier/operations/lookup.test.ts +0 -37
- package/src/domains/modifier/operations/lookup.ts +0 -69
- package/src/domains/modifier/operations/sample.ts +0 -32
- package/src/domains/modifier/orchestration/index.ts +0 -3
- package/src/domains/modifier/orchestration/modifierEmptyError.test.ts +0 -26
- package/src/domains/modifier/orchestration/modifierEmptyError.ts +0 -15
- package/src/domains/modifier/orchestration/resolveModifierList.ts +0 -16
- package/src/domains/modifier/orchestration/resolveModifierLookup.ts +0 -33
- package/src/domains/modifier/stories.test.ts +0 -20
- package/src/domains/modifier/stories.ts +0 -86
- package/src/domains/modifier/types.ts +0 -5
- package/src/domains/ontology/commands/index.ts +0 -4
- package/src/domains/ontology/commands/list.test.ts +0 -84
- package/src/domains/ontology/commands/list.ts +0 -11
- package/src/domains/ontology/commands/show.test.ts +0 -179
- package/src/domains/ontology/commands/show.ts +0 -14
- package/src/domains/ontology/formatters/index.ts +0 -5
- package/src/domains/ontology/formatters/list.ts +0 -64
- package/src/domains/ontology/formatters/show.ts +0 -396
- package/src/domains/ontology/helpers/buildClassTree.ts +0 -89
- package/src/domains/ontology/helpers/completeClassNames.ts +0 -43
- package/src/domains/ontology/helpers/expandOntologyIris.ts +0 -79
- package/src/domains/ontology/helpers/findNamespace.ts +0 -23
- package/src/domains/ontology/helpers/index.ts +0 -21
- package/src/domains/ontology/helpers/queryClasses.ts +0 -66
- package/src/domains/ontology/helpers/queryProperties.ts +0 -90
- package/src/domains/ontology/helpers/queryTboxFacts.ts +0 -160
- package/src/domains/ontology/helpers/resolvePrefix.ts +0 -45
- package/src/domains/ontology/index.ts +0 -26
- package/src/domains/ontology/mcp/index.ts +0 -2
- package/src/domains/ontology/mcp/specs.ts +0 -16
- package/src/domains/ontology/operations/index.ts +0 -5
- package/src/domains/ontology/operations/listOntologies.test.ts +0 -122
- package/src/domains/ontology/operations/listOntologies.ts +0 -197
- package/src/domains/ontology/operations/showOntology.test.ts +0 -184
- package/src/domains/ontology/operations/showOntology.ts +0 -323
- package/src/domains/ontology/operations/showOntologyRaw.test.ts +0 -41
- package/src/domains/ontology/operations/showOntologyRaw.ts +0 -50
- package/src/domains/ontology/stories.test.ts +0 -36
- package/src/domains/ontology/stories.ts +0 -153
- package/src/domains/refs/commands/updateRefs.ts +0 -52
- package/src/domains/refs/formatters/updateRefs.ts +0 -27
- package/src/domains/refs/index.ts +0 -27
- package/src/domains/refs/operations/gitOps.test.ts +0 -155
- package/src/domains/refs/operations/gitOps.ts +0 -92
- package/src/domains/refs/operations/index.ts +0 -10
- package/src/domains/refs/operations/parseRef.test.ts +0 -157
- package/src/domains/refs/operations/parseRef.ts +0 -114
- package/src/domains/refs/operations/paths.test.ts +0 -98
- package/src/domains/refs/operations/paths.ts +0 -91
- package/src/domains/refs/operations/readGlobalRefs.test.ts +0 -63
- package/src/domains/refs/operations/readGlobalRefs.ts +0 -37
- package/src/domains/refs/operations/updateRefs.test.ts +0 -167
- package/src/domains/refs/operations/updateRefs.ts +0 -180
- package/src/domains/setup/commands/all.ts +0 -58
- package/src/domains/setup/commands/completions.ts +0 -85
- package/src/domains/setup/commands/entrypoints.test.ts +0 -170
- package/src/domains/setup/commands/index.ts +0 -7
- package/src/domains/setup/commands/lsp.ts +0 -49
- package/src/domains/setup/commands/mcp.ts +0 -119
- package/src/domains/setup/commands/setup.ts +0 -70
- package/src/domains/setup/commands/skills.test.ts +0 -68
- package/src/domains/setup/commands/skills.ts +0 -110
- package/src/domains/setup/formatters/index.ts +0 -2
- package/src/domains/setup/formatters/skills.test.ts +0 -103
- package/src/domains/setup/formatters/skills.ts +0 -112
- package/src/domains/setup/formatters/types.ts +0 -7
- package/src/domains/setup/helpers/completionScripts.test.ts +0 -58
- package/src/domains/setup/helpers/completionScripts.ts +0 -92
- package/src/domains/setup/helpers/constants.ts +0 -2
- package/src/domains/setup/helpers/detectShell.test.ts +0 -48
- package/src/domains/setup/helpers/detectShell.ts +0 -20
- package/src/domains/setup/helpers/index.ts +0 -12
- package/src/domains/setup/helpers/runSetupTask.test.ts +0 -277
- package/src/domains/setup/helpers/runSetupTask.ts +0 -221
- package/src/domains/setup/index.ts +0 -37
- package/src/domains/setup/operations/index.ts +0 -6
- package/src/domains/setup/operations/setupAll.test.ts +0 -48
- package/src/domains/setup/operations/setupAll.ts +0 -41
- package/src/domains/setup/operations/setupCompletions.test.ts +0 -94
- package/src/domains/setup/operations/setupCompletions.ts +0 -54
- package/src/domains/setup/operations/setupLsp.test.ts +0 -30
- package/src/domains/setup/operations/setupLsp.ts +0 -22
- package/src/domains/setup/operations/setupMcp.test.ts +0 -120
- package/src/domains/setup/operations/setupMcp.ts +0 -108
- package/src/domains/setup/operations/setupSkills.test.ts +0 -191
- package/src/domains/setup/operations/setupSkills.ts +0 -160
- package/src/domains/setup/types.ts +0 -18
- package/src/domains/shared/ToolSpec.ts +0 -49
- package/src/domains/shared/bootStore.bareCore.test.ts +0 -63
- package/src/domains/shared/bootStore.test.ts +0 -82
- package/src/domains/shared/bootStore.ts +0 -171
- package/src/domains/shared/buildQuery.ts +0 -18
- package/src/domains/shared/compactUri.test.ts +0 -32
- package/src/domains/shared/compactUri.ts +0 -21
- package/src/domains/shared/context.ts +0 -16
- package/src/domains/shared/contracts.ts +0 -164
- package/src/domains/shared/createInteractivePromptSession.test.ts +0 -439
- package/src/domains/shared/createInteractivePromptSession.ts +0 -236
- package/src/domains/shared/emptyErrorRecovery.test.ts +0 -106
- package/src/domains/shared/extractLocalName.test.ts +0 -21
- package/src/domains/shared/extractLocalName.ts +0 -14
- package/src/domains/shared/filters/buildChannelFilter.test.ts +0 -52
- package/src/domains/shared/filters/buildChannelFilter.ts +0 -41
- package/src/domains/shared/filters/buildFilterConfig.ts +0 -15
- package/src/domains/shared/filters/buildFilters.test.ts +0 -33
- package/src/domains/shared/filters/buildFilters.ts +0 -30
- package/src/domains/shared/filters/buildTierFilter.test.ts +0 -78
- package/src/domains/shared/filters/buildTierFilter.ts +0 -69
- package/src/domains/shared/filters/describeFilters.ts +0 -14
- package/src/domains/shared/filters/index.ts +0 -10
- package/src/domains/shared/formatters.ts +0 -103
- package/src/domains/shared/listTiers.ts +0 -40
- package/src/domains/shared/loaders/bundledLoader.test.ts +0 -248
- package/src/domains/shared/loaders/bundledLoader.ts +0 -254
- package/src/domains/shared/loaders/gitLoader.ts +0 -30
- package/src/domains/shared/loaders/index.ts +0 -9
- package/src/domains/shared/loaders/localLoader.ts +0 -71
- package/src/domains/shared/loaders/readPackageDir.test.ts +0 -58
- package/src/domains/shared/loaders/readPackageDir.ts +0 -185
- package/src/domains/shared/loaders/storyAssetsPlugin.test.ts +0 -84
- package/src/domains/shared/loaders/storyAssetsPlugin.ts +0 -46
- package/src/domains/shared/lookupMany.test.ts +0 -135
- package/src/domains/shared/lookupMany.ts +0 -101
- package/src/domains/shared/mergeAndParseRefs.test.ts +0 -89
- package/src/domains/shared/mergeAndParseRefs.ts +0 -44
- package/src/domains/shared/namespaces.ts +0 -26
- package/src/domains/shared/packages.ts +0 -20
- package/src/domains/shared/parseSampleCount.test.ts +0 -47
- package/src/domains/shared/parseSampleCount.ts +0 -45
- package/src/domains/shared/pickRandom.ts +0 -22
- package/src/domains/shared/prefixes.test.ts +0 -211
- package/src/domains/shared/prefixes.ts +0 -204
- package/src/domains/shared/renderers.ts +0 -410
- package/src/domains/shared/resolveConfiguredGraphs.test.ts +0 -27
- package/src/domains/shared/resolveConfiguredGraphs.ts +0 -41
- package/src/domains/shared/resolveLookupExitCode.test.ts +0 -48
- package/src/domains/shared/resolveLookupExitCode.ts +0 -42
- package/src/domains/shared/runtime.ts +0 -61
- package/src/domains/shared/sampleFormatters.ts +0 -47
- package/src/domains/shared/semanticPackage.test.ts +0 -89
- package/src/domains/shared/semanticPackage.ts +0 -127
- package/src/domains/shared/stories/compileLookupCommand.test.ts +0 -145
- package/src/domains/shared/stories/compileLookupCommand.ts +0 -102
- package/src/domains/shared/stories/compileLookupTool.test.ts +0 -105
- package/src/domains/shared/stories/compileLookupTool.ts +0 -96
- package/src/domains/shared/stories/compileReadCommand.test.ts +0 -121
- package/src/domains/shared/stories/compileReadCommand.ts +0 -48
- package/src/domains/shared/stories/compileReadTool.test.ts +0 -64
- package/src/domains/shared/stories/compileReadTool.ts +0 -38
- package/src/domains/shared/stories/condense.test.ts +0 -18
- package/src/domains/shared/stories/condense.ts +0 -15
- package/src/domains/shared/stories/index.ts +0 -20
- package/src/domains/shared/stories/normalizeNames.test.ts +0 -20
- package/src/domains/shared/stories/normalizeNames.ts +0 -22
- package/src/domains/shared/stories/pack/applyPackFilters.test.ts +0 -151
- package/src/domains/shared/stories/pack/applyPackFilters.ts +0 -111
- package/src/domains/shared/stories/pack/applyPackSearch.test.ts +0 -57
- package/src/domains/shared/stories/pack/applyPackSearch.ts +0 -41
- package/src/domains/shared/stories/pack/buildLookupQuery.test.ts +0 -81
- package/src/domains/shared/stories/pack/buildLookupQuery.ts +0 -154
- package/src/domains/shared/stories/pack/bundled/index.ts +0 -23
- package/src/domains/shared/stories/pack/bundled/standardPack.ts +0 -164
- package/src/domains/shared/stories/pack/bundled/tierPack.ts +0 -50
- package/src/domains/shared/stories/pack/collectPackStories.test.ts +0 -406
- package/src/domains/shared/stories/pack/collectPackStories.ts +0 -158
- package/src/domains/shared/stories/pack/compilePackCommands.ts +0 -50
- package/src/domains/shared/stories/pack/compilePackStories.test.ts +0 -751
- package/src/domains/shared/stories/pack/compilePackStories.ts +0 -724
- package/src/domains/shared/stories/pack/compilePackToolSpecs.ts +0 -55
- package/src/domains/shared/stories/pack/index.ts +0 -42
- package/src/domains/shared/stories/pack/reservedVerbs.test.ts +0 -213
- package/src/domains/shared/stories/pack/reservedVerbs.ts +0 -170
- package/src/domains/shared/stories/pack/runSelectQuery.ts +0 -31
- package/src/domains/shared/stories/pack/standardParity.test.ts +0 -381
- package/src/domains/shared/stories/pack/types.ts +0 -224
- package/src/domains/shared/stories/pack/validateStoryPackDefinition.test.ts +0 -742
- package/src/domains/shared/stories/pack/validateStoryPackDefinition.ts +0 -859
- package/src/domains/shared/stories/projectCliParameters.test.ts +0 -59
- package/src/domains/shared/stories/projectCliParameters.ts +0 -57
- package/src/domains/shared/stories/projectToolParams.test.ts +0 -50
- package/src/domains/shared/stories/projectToolParams.ts +0 -32
- package/src/domains/shared/stories/requirePragmaContext.test.ts +0 -23
- package/src/domains/shared/stories/requirePragmaContext.ts +0 -23
- package/src/domains/shared/stories/resolveLookupDetailed.test.ts +0 -57
- package/src/domains/shared/stories/resolveLookupDetailed.ts +0 -27
- package/src/domains/shared/stories/types.ts +0 -179
- package/src/domains/shared/suggestions/detectCrossDomain.test.ts +0 -43
- package/src/domains/shared/suggestions/detectCrossDomain.ts +0 -116
- package/src/domains/shared/suggestions/expandGlob.test.ts +0 -92
- package/src/domains/shared/suggestions/expandGlob.ts +0 -52
- package/src/domains/shared/suggestions/expandLookupQueries.ts +0 -57
- package/src/domains/shared/suggestions/index.ts +0 -7
- package/src/domains/shared/suggestions/listDomainNames.ts +0 -61
- package/src/domains/shared/suggestions/suggestNames.test.ts +0 -70
- package/src/domains/shared/suggestions/suggestNames.ts +0 -130
- package/src/domains/shared/types/block.ts +0 -107
- package/src/domains/shared/types/common.ts +0 -33
- package/src/domains/shared/types/graph.ts +0 -17
- package/src/domains/shared/types/index.ts +0 -46
- package/src/domains/shared/types/modifier.ts +0 -22
- package/src/domains/shared/types/ontology.ts +0 -145
- package/src/domains/shared/types/runtime.ts +0 -24
- package/src/domains/shared/types/sample.ts +0 -17
- package/src/domains/shared/types/standard.ts +0 -21
- package/src/domains/shared/types/tier.ts +0 -15
- package/src/domains/shared/types/token.ts +0 -30
- package/src/domains/skill/commands/index.ts +0 -4
- package/src/domains/skill/commands/list.test.ts +0 -115
- package/src/domains/skill/commands/list.ts +0 -11
- package/src/domains/skill/commands/lookup.test.ts +0 -118
- package/src/domains/skill/commands/lookup.ts +0 -14
- package/src/domains/skill/formatters/index.ts +0 -3
- package/src/domains/skill/formatters/list.test.ts +0 -140
- package/src/domains/skill/formatters/list.ts +0 -119
- package/src/domains/skill/formatters/lookup.test.ts +0 -46
- package/src/domains/skill/formatters/lookup.ts +0 -57
- package/src/domains/skill/formatters/types.ts +0 -8
- package/src/domains/skill/helpers/index.ts +0 -6
- package/src/domains/skill/helpers/parseFrontmatter.test.ts +0 -122
- package/src/domains/skill/helpers/parseFrontmatter.ts +0 -112
- package/src/domains/skill/helpers/resolveSkillSources.ts +0 -70
- package/src/domains/skill/index.ts +0 -23
- package/src/domains/skill/mcp/index.ts +0 -2
- package/src/domains/skill/mcp/specs.ts +0 -19
- package/src/domains/skill/operations/discover.test.ts +0 -176
- package/src/domains/skill/operations/discover.ts +0 -59
- package/src/domains/skill/operations/index.ts +0 -5
- package/src/domains/skill/operations/list.test.ts +0 -76
- package/src/domains/skill/operations/list.ts +0 -47
- package/src/domains/skill/operations/lookup.test.ts +0 -91
- package/src/domains/skill/operations/lookup.ts +0 -70
- package/src/domains/skill/stories.test.ts +0 -43
- package/src/domains/skill/stories.ts +0 -103
- package/src/domains/skill/types.ts +0 -33
- package/src/domains/token/commands/add-config.test.ts +0 -68
- package/src/domains/token/commands/add-config.ts +0 -62
- package/src/domains/token/commands/index.ts +0 -6
- package/src/domains/token/commands/list.test.ts +0 -82
- package/src/domains/token/commands/list.ts +0 -54
- package/src/domains/token/commands/lookup.test.ts +0 -133
- package/src/domains/token/commands/lookup.ts +0 -107
- package/src/domains/token/commands/sample.ts +0 -54
- package/src/domains/token/featureFlag.ts +0 -17
- package/src/domains/token/formatters/index.ts +0 -8
- package/src/domains/token/formatters/list.test.ts +0 -37
- package/src/domains/token/formatters/list.ts +0 -24
- package/src/domains/token/formatters/lookup.test.ts +0 -61
- package/src/domains/token/formatters/lookup.ts +0 -107
- package/src/domains/token/formatters/sample.ts +0 -16
- package/src/domains/token/index.ts +0 -45
- package/src/domains/token/mcp/index.ts +0 -2
- package/src/domains/token/mcp/specs.ts +0 -207
- package/src/domains/token/operations/add-config.test.ts +0 -68
- package/src/domains/token/operations/add-config.ts +0 -61
- package/src/domains/token/operations/index.ts +0 -8
- package/src/domains/token/operations/list.test.ts +0 -50
- package/src/domains/token/operations/list.ts +0 -52
- package/src/domains/token/operations/lookup.test.ts +0 -42
- package/src/domains/token/operations/lookup.ts +0 -75
- package/src/domains/token/operations/sample.ts +0 -32
- package/src/domains/token/orchestration/index.ts +0 -3
- package/src/domains/token/orchestration/resolveTokenList.ts +0 -17
- package/src/domains/token/orchestration/resolveTokenLookup.ts +0 -33
- package/src/domains/token/orchestration/tokenEmptyError.test.ts +0 -33
- package/src/domains/token/orchestration/tokenEmptyError.ts +0 -20
- package/src/domains/token/tokenConfig.ts +0 -38
- package/src/domains/token/types.ts +0 -6
- package/src/domains/trace/commands/clear.ts +0 -71
- package/src/domains/trace/commands/index.ts +0 -5
- package/src/domains/trace/commands/resolveTraceLimit.test.ts +0 -31
- package/src/domains/trace/commands/sessions.ts +0 -32
- package/src/domains/trace/commands/show.ts +0 -171
- package/src/domains/trace/formatters/index.ts +0 -9
- package/src/domains/trace/formatters/sessions.ts +0 -80
- package/src/domains/trace/formatters/show.ts +0 -122
- package/src/domains/trace/index.ts +0 -17
- package/src/domains/trace/operations/index.ts +0 -8
- package/src/domains/trace/operations/listSessions.test.ts +0 -55
- package/src/domains/trace/operations/listSessions.ts +0 -52
- package/src/domains/trace/operations/readTraceLog.test.ts +0 -100
- package/src/domains/trace/operations/readTraceLog.ts +0 -104
- package/src/domains/trace/tracePlugin.test.ts +0 -171
- package/src/domains/trace/tracePlugin.ts +0 -159
- package/src/domains/trace/types.ts +0 -65
- package/src/embedWasm.ts +0 -42
- package/src/error/PragmaError.test.ts +0 -121
- package/src/error/PragmaError.ts +0 -177
- package/src/error/constants.ts +0 -12
- package/src/error/index.ts +0 -4
- package/src/error/types.ts +0 -55
- package/src/mcp/createMcpServer.test.ts +0 -41
- package/src/mcp/createMcpServer.ts +0 -53
- package/src/mcp/error/buildRecovery.test.ts +0 -37
- package/src/mcp/error/buildRecovery.ts +0 -17
- package/src/mcp/error/index.ts +0 -12
- package/src/mcp/error/serializeError.test.ts +0 -121
- package/src/mcp/error/serializeError.ts +0 -31
- package/src/mcp/error/serializeErrorPayload.test.ts +0 -38
- package/src/mcp/error/serializeErrorPayload.ts +0 -34
- package/src/mcp/error/types.ts +0 -59
- package/src/mcp/index.ts +0 -15
- package/src/mcp/registerResources.test.ts +0 -566
- package/src/mcp/registerResources.ts +0 -9
- package/src/mcp/resources/buildGraphIndex.ts +0 -167
- package/src/mcp/resources/buildResourceList.test.ts +0 -97
- package/src/mcp/resources/buildResourceList.ts +0 -176
- package/src/mcp/resources/classifyEntity.test.ts +0 -40
- package/src/mcp/resources/classifyEntity.ts +0 -27
- package/src/mcp/resources/constants.ts +0 -105
- package/src/mcp/resources/displayPredicates.ts +0 -62
- package/src/mcp/resources/pickFirstValue.test.ts +0 -29
- package/src/mcp/resources/pickFirstValue.ts +0 -26
- package/src/mcp/resources/pickPrimaryType.test.ts +0 -41
- package/src/mcp/resources/pickPrimaryType.ts +0 -26
- package/src/mcp/resources/rankUriCompletions.test.ts +0 -52
- package/src/mcp/resources/rankUriCompletions.ts +0 -64
- package/src/mcp/resources/readEntity.ts +0 -169
- package/src/mcp/resources/registerResources.ts +0 -126
- package/src/mcp/resources/types.ts +0 -128
- package/src/mcp/runMcpServer.test.ts +0 -66
- package/src/mcp/runMcpServer.ts +0 -24
- package/src/mcp/tools/index.ts +0 -74
- package/src/mcp/tools/registerFromSpec.ts +0 -97
- package/src/mcp/tools/registerTools.test.ts +0 -1277
- package/src/mcp/types.ts +0 -66
- package/src/mcp/utils/estimateTokens.test.ts +0 -14
- package/src/mcp/utils/estimateTokens.ts +0 -9
- package/src/mcp/utils/index.ts +0 -11
- package/src/mcp/utils/wrapTool.test.ts +0 -109
- package/src/mcp/utils/wrapTool.ts +0 -81
- package/src/package-manager/constants.ts +0 -29
- package/src/package-manager/detectInstallSource.test.ts +0 -23
- package/src/package-manager/detectInstallSource.ts +0 -111
- package/src/package-manager/detectLocalInstall.test.ts +0 -16
- package/src/package-manager/detectLocalInstall.ts +0 -43
- package/src/package-manager/detectPackageManager.test.ts +0 -81
- package/src/package-manager/detectPackageManager.ts +0 -30
- package/src/package-manager/index.ts +0 -6
- package/src/package-manager/types.ts +0 -10
- package/src/pipeline/collectCommands.test.ts +0 -187
- package/src/pipeline/collectCommands.ts +0 -75
- package/src/pipeline/constants.ts +0 -14
- package/src/pipeline/createProgram.test.ts +0 -116
- package/src/pipeline/createProgram.ts +0 -89
- package/src/pipeline/firstRun.test.ts +0 -80
- package/src/pipeline/firstRun.ts +0 -99
- package/src/pipeline/formatTerminal.test.ts +0 -43
- package/src/pipeline/formatTerminal.ts +0 -53
- package/src/pipeline/index.ts +0 -22
- package/src/pipeline/mapExitCode.test.ts +0 -41
- package/src/pipeline/mapExitCode.ts +0 -12
- package/src/pipeline/parseGlobalFlags.test.ts +0 -193
- package/src/pipeline/parseGlobalFlags.ts +0 -135
- package/src/pipeline/renderError.test.ts +0 -151
- package/src/pipeline/renderError.ts +0 -129
- package/src/pipeline/resolveCommandKind.test.ts +0 -80
- package/src/pipeline/resolveCommandKind.ts +0 -82
- package/src/pipeline/rootHelp.test.ts +0 -87
- package/src/pipeline/rootHelp.ts +0 -265
- package/src/pipeline/runCli.orchestration.test.ts +0 -435
- package/src/pipeline/runCli.test.ts +0 -83
- package/src/pipeline/runCli.ts +0 -411
- package/src/pipeline/types.ts +0 -17
- package/src/testing/cli.ts +0 -71
- package/src/testing/createTestMcpClient.ts +0 -68
- package/src/testing/dsFixtures.ts +0 -523
- package/src/testing/fixtures/canonical-config.json +0 -4
- package/src/testing/fixtures/canonical.ttl +0 -437
- package/src/testing/fixtures/filtered-config.json +0 -4
- package/src/testing/fixtures.ts +0 -34
- package/src/testing/graphqlFixtures.ts +0 -72
- package/src/testing/helpers/assertParity.ts +0 -28
- package/src/testing/helpers/createTestMcpClient.ts +0 -40
- package/src/testing/helpers/createTestRuntime.ts +0 -67
- package/src/testing/index.ts +0 -22
- package/src/testing/integration/__snapshots__/executor-golden.test.ts.snap +0 -1207
- package/src/testing/integration/agent-session.test.ts +0 -148
- package/src/testing/integration/boot.test.ts +0 -105
- package/src/testing/integration/cli-user-stories.test.ts +0 -261
- package/src/testing/integration/cross-binary-byte-equality.test.ts +0 -129
- package/src/testing/integration/edge-cases.test.ts +0 -275
- package/src/testing/integration/executor-execution.test.ts +0 -103
- package/src/testing/integration/executor-golden.test.ts +0 -145
- package/src/testing/integration/mcp-surface.test.ts +0 -605
- package/src/testing/integration/parity.test.ts +0 -596
- package/src/testing/regression/0001-skill-discovery-granularity.test.ts +0 -71
- package/src/testing/standardParityFixtures.ts +0 -35
- package/src/testing/store.ts +0 -39
- package/src/testing/storyFixtures.ts +0 -63
- package/src/testing/types.ts +0 -20
- package/src/tui/components/BulletList/BulletList.tsx +0 -46
- package/src/tui/components/BulletList/index.ts +0 -2
- package/src/tui/components/BulletList/types.ts +0 -6
- package/src/tui/components/Card/Card.tsx +0 -73
- package/src/tui/components/Card/index.ts +0 -1
- package/src/tui/components/Card/types.ts +0 -12
- package/src/tui/components/CodeBlock/CodeBlock.tsx +0 -37
- package/src/tui/components/CodeBlock/index.ts +0 -2
- package/src/tui/components/CodeBlock/types.ts +0 -6
- package/src/tui/components/DataRow/DataRow.tsx +0 -80
- package/src/tui/components/DataRow/index.ts +0 -2
- package/src/tui/components/DataRow/types.ts +0 -14
- package/src/tui/components/FieldRow/FieldRow.tsx +0 -24
- package/src/tui/components/FieldRow/index.ts +0 -2
- package/src/tui/components/FieldRow/types.ts +0 -10
- package/src/tui/components/HeaderRow/HeaderRow.tsx +0 -32
- package/src/tui/components/HeaderRow/index.ts +0 -2
- package/src/tui/components/HeaderRow/types.ts +0 -8
- package/src/tui/components/MarkdownText/MarkdownText.tsx +0 -19
- package/src/tui/components/MarkdownText/index.ts +0 -2
- package/src/tui/components/MarkdownText/types.ts +0 -4
- package/src/tui/components/MiniTable/MiniTable.tsx +0 -82
- package/src/tui/components/MiniTable/index.ts +0 -2
- package/src/tui/components/MiniTable/types.ts +0 -6
- package/src/tui/components/SectionRenderer/SectionRenderer.tsx +0 -91
- package/src/tui/components/SectionRenderer/index.ts +0 -2
- package/src/tui/components/SectionRenderer/types.ts +0 -15
- package/src/tui/components/TreeView/TreeView.tsx +0 -84
- package/src/tui/components/TreeView/index.ts +0 -2
- package/src/tui/components/TreeView/types.ts +0 -6
- package/src/tui/components/index.ts +0 -19
- package/src/tui/constants.ts +0 -39
- package/src/tui/createListView.ts +0 -23
- package/src/tui/createLookupView.ts +0 -26
- package/src/tui/helpers/computeWidths.ts +0 -53
- package/src/tui/helpers/fitColumns.ts +0 -33
- package/src/tui/helpers/formatMarkdown.ts +0 -19
- package/src/tui/helpers/getTerminalSize.ts +0 -16
- package/src/tui/helpers/index.ts +0 -6
- package/src/tui/helpers/syntaxColor.ts +0 -67
- package/src/tui/helpers/truncateText.ts +0 -12
- package/src/tui/hooks/index.ts +0 -3
- package/src/tui/hooks/types.ts +0 -7
- package/src/tui/hooks/useAutoExit.ts +0 -17
- package/src/tui/hooks/useTerminalSize.ts +0 -19
- package/src/tui/index.ts +0 -15
- package/src/tui/renderInk.tsx +0 -18
- package/src/tui/types.ts +0 -12
- package/src/tui/views/ListView/ListView.tsx +0 -104
- package/src/tui/views/ListView/index.ts +0 -2
- package/src/tui/views/ListView/types.ts +0 -14
- package/src/tui/views/LookupView/LookupView.tsx +0 -244
- package/src/tui/views/LookupView/index.ts +0 -2
- package/src/tui/views/LookupView/types.ts +0 -16
- package/src/tui/views/index.ts +0 -4
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { CapabilitiesData } from "../types.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Render capabilities data as compact terminal text.
|
|
5
|
-
*
|
|
6
|
-
* @param data - The structured capabilities payload.
|
|
7
|
-
* @returns Plain text for terminal output.
|
|
8
|
-
*/
|
|
9
|
-
export default function renderCapabilities(data: CapabilitiesData): string {
|
|
10
|
-
const lines: string[] = [];
|
|
11
|
-
|
|
12
|
-
lines.push(`pragma v${data.version}`);
|
|
13
|
-
lines.push("");
|
|
14
|
-
|
|
15
|
-
// — Conventions
|
|
16
|
-
lines.push("Conventions");
|
|
17
|
-
lines.push(` ${data.conventions.system}`);
|
|
18
|
-
lines.push(` ${data.conventions.model}`);
|
|
19
|
-
lines.push(` ${data.conventions.querying}`);
|
|
20
|
-
lines.push("");
|
|
21
|
-
|
|
22
|
-
// — Discovery sequence
|
|
23
|
-
lines.push("Discovery Sequence");
|
|
24
|
-
for (const stage of data.discovery_sequence) {
|
|
25
|
-
lines.push(` ${stage.stage}. ${stage.tool} — ${stage.purpose}`);
|
|
26
|
-
}
|
|
27
|
-
lines.push("");
|
|
28
|
-
|
|
29
|
-
// — Tools by category
|
|
30
|
-
const categories = ["read", "write", "orientation", "diagnostic"] as const;
|
|
31
|
-
for (const cat of categories) {
|
|
32
|
-
const tools = data.tools.filter((t) => t.category === cat);
|
|
33
|
-
lines.push(`${cat} (${tools.length})`);
|
|
34
|
-
for (const tool of tools) {
|
|
35
|
-
lines.push(` ${tool.name} — ${tool.use_when}`);
|
|
36
|
-
}
|
|
37
|
-
lines.push("");
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// — Counts + limits
|
|
41
|
-
const { counts } = data;
|
|
42
|
-
lines.push(
|
|
43
|
-
`${counts.total} tools: ${counts.read} read, ${counts.write} write, ${counts.orientation} orientation, ${counts.diagnostic} diagnostic`,
|
|
44
|
-
);
|
|
45
|
-
lines.push(
|
|
46
|
-
`output: ${data.limits.output_modes.join(", ")} | condensed: ${data.limits.condensed_available ? "yes" : "no"}`,
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
return lines.join("\n");
|
|
50
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { TOKEN_READ_SURFACE_ENABLED } from "../../token/featureFlag.js";
|
|
2
|
-
import type { LlmData } from "../types.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Renders the `pragma llm` orientation document.
|
|
6
|
-
*
|
|
7
|
-
* Produces a single condensed Markdown output (budget: <=800 tokens) containing
|
|
8
|
-
* context summary, decision trees, and a command reference table.
|
|
9
|
-
*
|
|
10
|
-
* @param data - The assembled LLM orientation data.
|
|
11
|
-
* @returns A Markdown string for LLM context injection.
|
|
12
|
-
*/
|
|
13
|
-
export default function renderLlmOrientation(data: LlmData): string {
|
|
14
|
-
const lines: string[] = [];
|
|
15
|
-
|
|
16
|
-
// --- Context block ---
|
|
17
|
-
const { context: ctx } = data;
|
|
18
|
-
const tierDisplay = ctx.tier
|
|
19
|
-
? `${ctx.tier} (${ctx.tierChain.join(" → ")})`
|
|
20
|
-
: "(none)";
|
|
21
|
-
|
|
22
|
-
lines.push("# Pragma — Design System CLI");
|
|
23
|
-
lines.push("");
|
|
24
|
-
lines.push("## Context");
|
|
25
|
-
lines.push(`tier: ${tierDisplay} | channel: ${ctx.channel}`);
|
|
26
|
-
const tokenCount = TOKEN_READ_SURFACE_ENABLED
|
|
27
|
-
? `, ${ctx.counts.tokens} tokens`
|
|
28
|
-
: "";
|
|
29
|
-
lines.push(
|
|
30
|
-
`data: ${ctx.counts.blocks} blocks, ${ctx.counts.standards} standards, ${ctx.counts.modifierFamilies} modifier families${tokenCount}`,
|
|
31
|
-
);
|
|
32
|
-
lines.push(`namespaces: ${ctx.namespaces.join(", ")}`);
|
|
33
|
-
lines.push("");
|
|
34
|
-
|
|
35
|
-
// --- Decision trees ---
|
|
36
|
-
lines.push("## Decision Trees");
|
|
37
|
-
lines.push("");
|
|
38
|
-
for (const tree of data.decisionTrees) {
|
|
39
|
-
lines.push(`### ${tree.intent}`);
|
|
40
|
-
lines.push("```");
|
|
41
|
-
lines.push(tree.tree);
|
|
42
|
-
lines.push("```");
|
|
43
|
-
lines.push("");
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// --- Command reference ---
|
|
47
|
-
lines.push("## Commands");
|
|
48
|
-
lines.push("| Command | Tokens |");
|
|
49
|
-
lines.push("|---|---|");
|
|
50
|
-
for (const ref of data.commandReference) {
|
|
51
|
-
lines.push(`| \`${ref.command}\` | ${ref.tokens} |`);
|
|
52
|
-
}
|
|
53
|
-
lines.push("");
|
|
54
|
-
lines.push("Append `--llm` to all commands for token-optimized output.");
|
|
55
|
-
|
|
56
|
-
return lines.join("\n");
|
|
57
|
-
}
|
package/src/domains/llm/index.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module LLM domain barrel.
|
|
3
|
-
*
|
|
4
|
-
* Provides the `pragma capabilities` and `pragma llm` commands
|
|
5
|
-
* for LLM orientation context generation.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
export { buildCapabilitiesCommand, buildLlmCommand } from "./commands/index.js";
|
|
9
|
-
export { specs as mcpSpecs } from "./mcp/index.js";
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import type { CommandDefinition } from "@canonical/cli-core";
|
|
2
|
-
import type { Store } from "@canonical/ke";
|
|
3
|
-
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
4
|
-
import { createTestStore, DS_ALL_TTL } from "#testing";
|
|
5
|
-
import type { PragmaContext } from "../shared/context.js";
|
|
6
|
-
import { TOKEN_READ_SURFACE_ENABLED } from "../token/featureFlag.js";
|
|
7
|
-
import { buildLlmCommand } from "./commands/index.js";
|
|
8
|
-
import type { LlmData } from "./types.js";
|
|
9
|
-
|
|
10
|
-
let store: Store;
|
|
11
|
-
let cleanup: () => void;
|
|
12
|
-
|
|
13
|
-
beforeAll(async () => {
|
|
14
|
-
const result = await createTestStore({ ttl: DS_ALL_TTL });
|
|
15
|
-
store = result.store;
|
|
16
|
-
cleanup = result.cleanup;
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
afterAll(() => cleanup());
|
|
20
|
-
|
|
21
|
-
function makeCtx(overrides: Partial<PragmaContext> = {}): PragmaContext {
|
|
22
|
-
return {
|
|
23
|
-
cwd: "/tmp",
|
|
24
|
-
globalFlags: { llm: false, format: "text" as const, verbose: false },
|
|
25
|
-
store,
|
|
26
|
-
config: { tier: undefined, channel: "prerelease" },
|
|
27
|
-
...overrides,
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
async function executeOutput(
|
|
32
|
-
cmd: CommandDefinition,
|
|
33
|
-
ctx: PragmaContext,
|
|
34
|
-
): Promise<{ value: LlmData; text: string }> {
|
|
35
|
-
const result = await cmd.execute({}, ctx);
|
|
36
|
-
expect(result.tag).toBe("output");
|
|
37
|
-
if (result.tag !== "output") throw new Error("Expected output result");
|
|
38
|
-
const text = result.render.plain(result.value);
|
|
39
|
-
return { value: result.value as LlmData, text };
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
describe("buildLlmCommand", () => {
|
|
43
|
-
it("returns an output result", async () => {
|
|
44
|
-
const ctx = makeCtx();
|
|
45
|
-
const cmd = buildLlmCommand(ctx);
|
|
46
|
-
const result = await cmd.execute({}, ctx);
|
|
47
|
-
expect(result.tag).toBe("output");
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it("output contains all three sections", async () => {
|
|
51
|
-
const ctx = makeCtx();
|
|
52
|
-
const cmd = buildLlmCommand(ctx);
|
|
53
|
-
const { text } = await executeOutput(cmd, ctx);
|
|
54
|
-
expect(text).toContain("## Context");
|
|
55
|
-
expect(text).toContain("## Decision Trees");
|
|
56
|
-
expect(text).toContain("## Commands");
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it("context block reflects store state", async () => {
|
|
60
|
-
const ctx = makeCtx({
|
|
61
|
-
config: { tier: "apps/lxd", channel: "normal" },
|
|
62
|
-
});
|
|
63
|
-
const cmd = buildLlmCommand(ctx);
|
|
64
|
-
const { text, value } = await executeOutput(cmd, ctx);
|
|
65
|
-
|
|
66
|
-
expect(text).toContain("apps/lxd");
|
|
67
|
-
expect(text).toContain("normal");
|
|
68
|
-
expect(value.context.tierChain).toEqual(["global", "apps", "apps/lxd"]);
|
|
69
|
-
expect(value.context.counts.blocks).toBeGreaterThan(0);
|
|
70
|
-
expect(value.context.counts.standards).toBeGreaterThan(0);
|
|
71
|
-
expect(value.context.counts.modifierFamilies).toBeGreaterThan(0);
|
|
72
|
-
expect(value.context.counts.tokens).toBeGreaterThan(0);
|
|
73
|
-
expect(value.context.namespaces.length).toBeGreaterThan(0);
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it("includes all decision trees", async () => {
|
|
77
|
-
const ctx = makeCtx();
|
|
78
|
-
const cmd = buildLlmCommand(ctx);
|
|
79
|
-
const { value, text } = await executeOutput(cmd, ctx);
|
|
80
|
-
// "Find a token" is gated behind the token read-surface feature flag.
|
|
81
|
-
expect(value.decisionTrees).toHaveLength(
|
|
82
|
-
TOKEN_READ_SURFACE_ENABLED ? 5 : 4,
|
|
83
|
-
);
|
|
84
|
-
expect(text).toContain("Build a block");
|
|
85
|
-
expect(text).toContain("Audit standards");
|
|
86
|
-
if (TOKEN_READ_SURFACE_ENABLED) {
|
|
87
|
-
expect(text).toContain("Find a token");
|
|
88
|
-
} else {
|
|
89
|
-
expect(text).not.toContain("Find a token");
|
|
90
|
-
}
|
|
91
|
-
expect(text).toContain("Explore the design system");
|
|
92
|
-
expect(text).toContain("Configure");
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it("output stays within 800-token budget (≤3200 chars)", async () => {
|
|
96
|
-
const ctx = makeCtx();
|
|
97
|
-
const cmd = buildLlmCommand(ctx);
|
|
98
|
-
const { text } = await executeOutput(cmd, ctx);
|
|
99
|
-
expect(text.length).toBeLessThanOrEqual(3200);
|
|
100
|
-
});
|
|
101
|
-
});
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP tool specs for llm domain — capabilities, llm.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { VERSION } from "#constants";
|
|
6
|
-
import { buildFilterConfig } from "../../shared/filters/index.js";
|
|
7
|
-
import type { ToolSpec } from "../../shared/ToolSpec.js";
|
|
8
|
-
import { TOKEN_READ_SURFACE_ENABLED } from "../../token/featureFlag.js";
|
|
9
|
-
import {
|
|
10
|
-
COMMAND_REFERENCE,
|
|
11
|
-
DECISION_TREES,
|
|
12
|
-
TOOL_CATALOG,
|
|
13
|
-
} from "../data/index.js";
|
|
14
|
-
import { collectContext } from "../operations/index.js";
|
|
15
|
-
import type { CapabilitiesData, LlmData } from "../types.js";
|
|
16
|
-
|
|
17
|
-
/** Build the static capabilities response. */
|
|
18
|
-
function buildCapabilitiesData(): CapabilitiesData {
|
|
19
|
-
const counts = {
|
|
20
|
-
total: TOOL_CATALOG.length,
|
|
21
|
-
read: TOOL_CATALOG.filter((t) => t.category === "read").length,
|
|
22
|
-
write: TOOL_CATALOG.filter((t) => t.category === "write").length,
|
|
23
|
-
orientation: TOOL_CATALOG.filter((t) => t.category === "orientation")
|
|
24
|
-
.length,
|
|
25
|
-
diagnostic: TOOL_CATALOG.filter((t) => t.category === "diagnostic").length,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
version: VERSION,
|
|
30
|
-
conventions: {
|
|
31
|
-
system:
|
|
32
|
-
"Pragma is a CLI and MCP server for querying a design system knowledge graph — blocks, tokens, modifiers, standards, and ontologies.",
|
|
33
|
-
model:
|
|
34
|
-
"Data is scoped by tier (hierarchical, e.g. global > apps > apps/lxd) and channel (normal, experimental, prerelease). Set these via config_tier and config_channel.",
|
|
35
|
-
querying:
|
|
36
|
-
"All queries run against an RDF triple store. Prefixed IRIs (e.g. ds:global.component.button) identify entities. Use ontology_list to discover namespaces.",
|
|
37
|
-
},
|
|
38
|
-
discovery_sequence: [
|
|
39
|
-
{
|
|
40
|
-
stage: 1,
|
|
41
|
-
tool: "capabilities",
|
|
42
|
-
purpose: "Understand conventions, available tools, and how to navigate",
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
stage: 2,
|
|
46
|
-
tool: "*_sample",
|
|
47
|
-
purpose: `Call block_sample, standard_sample,${TOKEN_READ_SURFACE_ENABLED ? " token_sample," : ""} or modifier_sample to see real data shapes before querying. Prevents guessing at property names.`,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
stage: 3,
|
|
51
|
-
tool: "domain tools",
|
|
52
|
-
purpose: `Query specific entities — block_list, standard_lookup, ${TOKEN_READ_SURFACE_ENABLED ? "token_list, " : ""}etc. Use the use_when hints above to pick the right tool.`,
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
tools: TOOL_CATALOG,
|
|
56
|
-
counts,
|
|
57
|
-
limits: {
|
|
58
|
-
output_modes: ["text", "json", "llm"],
|
|
59
|
-
condensed_available: true,
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const specs: readonly ToolSpec[] = [
|
|
65
|
-
{
|
|
66
|
-
name: "capabilities",
|
|
67
|
-
description:
|
|
68
|
-
"Discover pragma conventions, available tools with behavioral hints, and discovery sequence. Call this first at session start.",
|
|
69
|
-
readOnly: true,
|
|
70
|
-
async execute() {
|
|
71
|
-
return { data: buildCapabilitiesData() };
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: "llm",
|
|
76
|
-
description:
|
|
77
|
-
"Get live LLM orientation — context snapshot (tier, channel, entity counts), decision trees for common intents, and command reference with token costs. Call after capabilities when starting design system work.",
|
|
78
|
-
readOnly: true,
|
|
79
|
-
async execute(rt) {
|
|
80
|
-
const filters = buildFilterConfig(rt);
|
|
81
|
-
const context = await collectContext(rt.store, filters);
|
|
82
|
-
const data: LlmData = {
|
|
83
|
-
context,
|
|
84
|
-
decisionTrees: DECISION_TREES,
|
|
85
|
-
commandReference: COMMAND_REFERENCE,
|
|
86
|
-
};
|
|
87
|
-
return { data };
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
];
|
|
91
|
-
|
|
92
|
-
export { buildCapabilitiesData };
|
|
93
|
-
export default specs;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { Store } from "@canonical/ke";
|
|
2
|
-
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
3
|
-
import { createTestStore, DS_ALL_TTL } from "#testing";
|
|
4
|
-
import type { FilterConfig } from "../../shared/types/index.js";
|
|
5
|
-
import { TOKEN_READ_SURFACE_ENABLED } from "../../token/featureFlag.js";
|
|
6
|
-
import { renderLlmOrientation } from "../formatters/index.js";
|
|
7
|
-
import type { LlmData } from "../types.js";
|
|
8
|
-
import collectContext from "./collectContext.js";
|
|
9
|
-
|
|
10
|
-
let store: Store;
|
|
11
|
-
let cleanup: () => void;
|
|
12
|
-
|
|
13
|
-
beforeAll(async () => {
|
|
14
|
-
const result = await createTestStore({ ttl: DS_ALL_TTL });
|
|
15
|
-
store = result.store;
|
|
16
|
-
cleanup = result.cleanup;
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
afterAll(() => cleanup());
|
|
20
|
-
|
|
21
|
-
const config: FilterConfig = { tier: undefined, channel: "prerelease" };
|
|
22
|
-
|
|
23
|
-
/** Extract the `## Context` data lines from a rendered orientation doc. */
|
|
24
|
-
function contextBlock(rendered: string): string {
|
|
25
|
-
const lines = rendered.split("\n");
|
|
26
|
-
const start = lines.indexOf("## Context");
|
|
27
|
-
const block: string[] = [];
|
|
28
|
-
for (let i = start + 1; i < lines.length && lines[i] !== ""; i++) {
|
|
29
|
-
block.push(lines[i] ?? "");
|
|
30
|
-
}
|
|
31
|
-
return block.join("\n");
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
describe("collectContext", () => {
|
|
35
|
-
it("assembles counts and namespaces from the store", async () => {
|
|
36
|
-
const ctx = await collectContext(store, config);
|
|
37
|
-
|
|
38
|
-
expect(ctx.tier).toBeUndefined();
|
|
39
|
-
expect(ctx.channel).toBe("prerelease");
|
|
40
|
-
expect(ctx.counts.blocks).toBeGreaterThan(0);
|
|
41
|
-
expect(ctx.counts.standards).toBeGreaterThan(0);
|
|
42
|
-
expect(ctx.counts.modifierFamilies).toBeGreaterThan(0);
|
|
43
|
-
expect(ctx.counts.tokens).toBeGreaterThan(0);
|
|
44
|
-
expect(ctx.namespaces.length).toBeGreaterThan(0);
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("renders a stable `## Context` block", async () => {
|
|
48
|
-
const data: LlmData = {
|
|
49
|
-
context: await collectContext(store, config),
|
|
50
|
-
decisionTrees: [],
|
|
51
|
-
commandReference: [],
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// The token count only renders while the token read surface is enabled.
|
|
55
|
-
const tokenSegment = TOKEN_READ_SURFACE_ENABLED ? ", 2 tokens" : "";
|
|
56
|
-
expect(contextBlock(renderLlmOrientation(data))).toBe(
|
|
57
|
-
[
|
|
58
|
-
"tier: (none) | channel: prerelease",
|
|
59
|
-
`data: 5 blocks, 3 standards, 2 modifier families${tokenSegment}`,
|
|
60
|
-
"namespaces: cs, ds",
|
|
61
|
-
].join("\n"),
|
|
62
|
-
);
|
|
63
|
-
});
|
|
64
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { Store } from "@canonical/ke";
|
|
2
|
-
import { collectEntityCounts } from "../../info/operations/index.js";
|
|
3
|
-
import { listOntologies } from "../../ontology/operations/index.js";
|
|
4
|
-
import { resolveTierChain } from "../../shared/filters/buildTierFilter.js";
|
|
5
|
-
import type { FilterConfig } from "../../shared/types/index.js";
|
|
6
|
-
import type { LlmContext } from "../types.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Collects dynamic context for the `pragma llm` orientation output.
|
|
10
|
-
*
|
|
11
|
-
* Queries the store in parallel for entity counts (via
|
|
12
|
-
* {@link collectEntityCounts}) and ontology namespaces, and combines them
|
|
13
|
-
* with tier/channel config state.
|
|
14
|
-
*
|
|
15
|
-
* @note Queries ke store
|
|
16
|
-
*
|
|
17
|
-
* @param store - The ke store to query.
|
|
18
|
-
* @param config - Filter config providing tier and channel settings.
|
|
19
|
-
* @returns An {@link LlmContext} with entity counts and namespace list.
|
|
20
|
-
*/
|
|
21
|
-
export default async function collectContext(
|
|
22
|
-
store: Store,
|
|
23
|
-
config: FilterConfig,
|
|
24
|
-
): Promise<LlmContext> {
|
|
25
|
-
const [counts, ontologies] = await Promise.all([
|
|
26
|
-
collectEntityCounts(store, config),
|
|
27
|
-
listOntologies(store),
|
|
28
|
-
]);
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
tier: config.tier,
|
|
32
|
-
tierChain: resolveTierChain(config.tier),
|
|
33
|
-
channel: config.channel,
|
|
34
|
-
counts,
|
|
35
|
-
namespaces: ontologies.map((o) => o.prefix),
|
|
36
|
-
};
|
|
37
|
-
}
|
package/src/domains/llm/types.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import type { ToolEntry } from "./data/toolCatalog.js";
|
|
2
|
-
|
|
3
|
-
// — Capabilities ——————————————————————————————————————————————————————————————
|
|
4
|
-
|
|
5
|
-
/** Structured system map returned by `pragma capabilities`. */
|
|
6
|
-
export interface CapabilitiesData {
|
|
7
|
-
readonly version: string;
|
|
8
|
-
readonly conventions: {
|
|
9
|
-
readonly system: string;
|
|
10
|
-
readonly model: string;
|
|
11
|
-
readonly querying: string;
|
|
12
|
-
};
|
|
13
|
-
readonly discovery_sequence: readonly DiscoveryStage[];
|
|
14
|
-
readonly tools: readonly ToolEntry[];
|
|
15
|
-
readonly counts: ToolCounts;
|
|
16
|
-
readonly limits: {
|
|
17
|
-
readonly output_modes: readonly string[];
|
|
18
|
-
readonly condensed_available: boolean;
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/** A single stage in the discovery flow. */
|
|
23
|
-
export interface DiscoveryStage {
|
|
24
|
-
readonly stage: number;
|
|
25
|
-
readonly tool: string;
|
|
26
|
-
readonly purpose: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Tool counts by category. */
|
|
30
|
-
export interface ToolCounts {
|
|
31
|
-
readonly total: number;
|
|
32
|
-
readonly read: number;
|
|
33
|
-
readonly write: number;
|
|
34
|
-
readonly orientation: number;
|
|
35
|
-
readonly diagnostic: number;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// — LLM orientation ———————————————————————————————————————————————————————————
|
|
39
|
-
|
|
40
|
-
/** Dynamic context snapshot: tier, channel, entity counts, and namespaces. */
|
|
41
|
-
export interface LlmContext {
|
|
42
|
-
readonly tier: string | undefined;
|
|
43
|
-
readonly tierChain: readonly string[];
|
|
44
|
-
readonly channel: string;
|
|
45
|
-
readonly counts: {
|
|
46
|
-
readonly blocks: number;
|
|
47
|
-
readonly standards: number;
|
|
48
|
-
readonly modifierFamilies: number;
|
|
49
|
-
readonly tokens: number;
|
|
50
|
-
};
|
|
51
|
-
readonly namespaces: readonly string[];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/** A single intent-to-flowchart mapping used in LLM orientation output. */
|
|
55
|
-
export interface DecisionTree {
|
|
56
|
-
readonly intent: string;
|
|
57
|
-
readonly tree: string;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** A command name paired with its approximate output token cost. */
|
|
61
|
-
export interface CommandRefEntry {
|
|
62
|
-
readonly command: string;
|
|
63
|
-
readonly tokens: string;
|
|
64
|
-
readonly use_when: string;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** Complete payload rendered by `pragma llm`: context, trees, and reference. */
|
|
68
|
-
export interface LlmData {
|
|
69
|
-
readonly context: LlmContext;
|
|
70
|
-
readonly decisionTrees: readonly DecisionTree[];
|
|
71
|
-
readonly commandReference: readonly CommandRefEntry[];
|
|
72
|
-
}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import type { CommandOutputResult } from "@canonical/cli-core";
|
|
2
|
-
import type { Store } from "@canonical/ke";
|
|
3
|
-
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
4
|
-
import { createTestStore, DS_ALL_TTL } from "#testing";
|
|
5
|
-
import type { PragmaContext } from "../../shared/context.js";
|
|
6
|
-
import listCommand from "./list.js";
|
|
7
|
-
|
|
8
|
-
let store: Store;
|
|
9
|
-
let cleanup: () => void;
|
|
10
|
-
|
|
11
|
-
beforeAll(async () => {
|
|
12
|
-
const result = await createTestStore({ ttl: DS_ALL_TTL });
|
|
13
|
-
store = result.store;
|
|
14
|
-
cleanup = result.cleanup;
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
afterAll(() => cleanup());
|
|
18
|
-
|
|
19
|
-
function makeCtx(
|
|
20
|
-
overrides?: Partial<PragmaContext["globalFlags"]>,
|
|
21
|
-
): PragmaContext {
|
|
22
|
-
return {
|
|
23
|
-
cwd: "/tmp",
|
|
24
|
-
store,
|
|
25
|
-
config: { tier: undefined, channel: "normal" },
|
|
26
|
-
globalFlags: {
|
|
27
|
-
llm: false,
|
|
28
|
-
format: "text",
|
|
29
|
-
verbose: false,
|
|
30
|
-
...overrides,
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
describe("modifier list command", () => {
|
|
36
|
-
it("returns output result with all families", async () => {
|
|
37
|
-
const ctx = makeCtx();
|
|
38
|
-
const cmd = listCommand(ctx);
|
|
39
|
-
const result = await cmd.execute({}, ctx);
|
|
40
|
-
expect(result.tag).toBe("output");
|
|
41
|
-
|
|
42
|
-
const output = result as CommandOutputResult;
|
|
43
|
-
const text = output.render.plain(output.value);
|
|
44
|
-
expect(text).toContain("importance");
|
|
45
|
-
expect(text).toContain("density");
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it("renders LLM format with --llm", async () => {
|
|
49
|
-
const ctx = makeCtx({ llm: true });
|
|
50
|
-
const cmd = listCommand(ctx);
|
|
51
|
-
const result = await cmd.execute({}, ctx);
|
|
52
|
-
const output = result as CommandOutputResult;
|
|
53
|
-
const text = output.render.plain(output.value);
|
|
54
|
-
expect(text).toContain("## Modifier Families");
|
|
55
|
-
expect(text).toContain("**importance**");
|
|
56
|
-
});
|
|
57
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CommandDefinition } from "@canonical/cli-core";
|
|
2
|
-
import type { PragmaContext } from "../../shared/context.js";
|
|
3
|
-
import { compileReadCommand } from "../../shared/stories/index.js";
|
|
4
|
-
import { modifierListStory } from "../stories.js";
|
|
5
|
-
|
|
6
|
-
/** Wire the `pragma modifier list` CLI command from the modifier list story. */
|
|
7
|
-
export default function listCommand(ctx: PragmaContext): CommandDefinition {
|
|
8
|
-
return compileReadCommand(ctx, modifierListStory);
|
|
9
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { CommandOutputResult } from "@canonical/cli-core";
|
|
2
|
-
import type { Store } from "@canonical/ke";
|
|
3
|
-
import { afterAll, beforeAll, describe, expect, it } from "vitest";
|
|
4
|
-
import { createTestStore, DS_ALL_TTL } from "#testing";
|
|
5
|
-
import type { PragmaContext } from "../../shared/context.js";
|
|
6
|
-
import lookupCommand from "./lookup.js";
|
|
7
|
-
|
|
8
|
-
let store: Store;
|
|
9
|
-
let cleanup: () => void;
|
|
10
|
-
|
|
11
|
-
beforeAll(async () => {
|
|
12
|
-
const result = await createTestStore({ ttl: DS_ALL_TTL });
|
|
13
|
-
store = result.store;
|
|
14
|
-
cleanup = result.cleanup;
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
afterAll(() => cleanup());
|
|
18
|
-
|
|
19
|
-
function makeCtx(
|
|
20
|
-
overrides?: Partial<PragmaContext["globalFlags"]>,
|
|
21
|
-
): PragmaContext {
|
|
22
|
-
return {
|
|
23
|
-
cwd: "/tmp",
|
|
24
|
-
store,
|
|
25
|
-
config: { tier: undefined, channel: "normal" },
|
|
26
|
-
globalFlags: {
|
|
27
|
-
llm: false,
|
|
28
|
-
format: "text",
|
|
29
|
-
verbose: false,
|
|
30
|
-
...overrides,
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
describe("modifier lookup command", () => {
|
|
36
|
-
it("returns a family with values", async () => {
|
|
37
|
-
const ctx = makeCtx();
|
|
38
|
-
const cmd = lookupCommand(ctx);
|
|
39
|
-
const result = await cmd.execute({ names: ["density"] }, ctx);
|
|
40
|
-
expect(result.tag).toBe("output");
|
|
41
|
-
|
|
42
|
-
const output = result as CommandOutputResult;
|
|
43
|
-
const text = output.render.plain(output.value);
|
|
44
|
-
expect(text).toContain("density");
|
|
45
|
-
expect(text).toContain("default");
|
|
46
|
-
expect(text).toContain("compact");
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it("throws ENTITY_NOT_FOUND for unknown modifier", async () => {
|
|
50
|
-
const ctx = makeCtx();
|
|
51
|
-
const cmd = lookupCommand(ctx);
|
|
52
|
-
const result = await cmd.execute({ names: ["nonexistent"] }, ctx);
|
|
53
|
-
expect(result.tag).toBe("output");
|
|
54
|
-
if (result.tag !== "output") {
|
|
55
|
-
expect.fail("Expected output result");
|
|
56
|
-
}
|
|
57
|
-
expect(result.render.plain(result.value)).toContain("Errors:");
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it("renders LLM format with --llm", async () => {
|
|
61
|
-
const ctx = makeCtx({ llm: true });
|
|
62
|
-
const cmd = lookupCommand(ctx);
|
|
63
|
-
const result = await cmd.execute({ names: ["importance"] }, ctx);
|
|
64
|
-
const output = result as CommandOutputResult;
|
|
65
|
-
const text = output.render.plain(output.value);
|
|
66
|
-
expect(text).toContain("## importance");
|
|
67
|
-
expect(text).toContain("- default");
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it("renders JSON with --format json", async () => {
|
|
71
|
-
const ctx = makeCtx({ format: "json" });
|
|
72
|
-
const cmd = lookupCommand(ctx);
|
|
73
|
-
const result = await cmd.execute({ names: ["importance"] }, ctx);
|
|
74
|
-
const output = result as CommandOutputResult;
|
|
75
|
-
const text = output.render.plain(output.value);
|
|
76
|
-
const parsed = JSON.parse(text);
|
|
77
|
-
expect(parsed.name).toBe("importance");
|
|
78
|
-
expect(parsed.values).toContain("primary");
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it("renders multiple families together", async () => {
|
|
82
|
-
const ctx = makeCtx();
|
|
83
|
-
const cmd = lookupCommand(ctx);
|
|
84
|
-
const result = await cmd.execute({ names: ["importance", "density"] }, ctx);
|
|
85
|
-
expect(result.tag).toBe("output");
|
|
86
|
-
const output = result as CommandOutputResult;
|
|
87
|
-
const text = output.render.plain(output.value);
|
|
88
|
-
expect(text).toContain("importance");
|
|
89
|
-
expect(text).toContain("density");
|
|
90
|
-
});
|
|
91
|
-
});
|