@canonical/pragma-cli 0.36.0 → 0.37.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/package.json +22 -19
- package/dist/pragma.conf.js +35 -5
- package/dist/pragma.conf.js.map +1 -1
- package/dist/src/capabilities/capabilities/hints.js +1 -1
- package/dist/src/capabilities/capabilities/hints.js.map +1 -1
- package/dist/src/capabilities/create/create.verb.js +2 -1
- package/dist/src/capabilities/create/create.verb.js.map +1 -1
- package/dist/src/capabilities/create/createSurface.generated.js +23 -1
- package/dist/src/capabilities/create/createSurface.generated.js.map +1 -1
- package/dist/src/capabilities/doctor/checks/checkNodeVersion.js +11 -6
- package/dist/src/capabilities/doctor/checks/checkNodeVersion.js.map +1 -1
- package/dist/src/capabilities/doctor/checks/isSupportedNodeVersion.js +38 -0
- package/dist/src/capabilities/doctor/checks/isSupportedNodeVersion.js.map +1 -0
- package/dist/src/capabilities/setup/operations/setupCompletions.js +6 -2
- package/dist/src/capabilities/setup/operations/setupCompletions.js.map +1 -1
- package/dist/src/capabilities/setup/operations/setupConfig.js +4 -2
- package/dist/src/capabilities/setup/operations/setupConfig.js.map +1 -1
- package/dist/src/capabilities/setup/operations/setupGenerator.js +64 -13
- package/dist/src/capabilities/setup/operations/setupGenerator.js.map +1 -1
- package/dist/src/capabilities/setup/operations/setupLsp.js +59 -13
- package/dist/src/capabilities/setup/operations/setupLsp.js.map +1 -1
- package/dist/src/capabilities/setup/operations/setupMcp.js +4 -1
- package/dist/src/capabilities/setup/operations/setupMcp.js.map +1 -1
- package/dist/src/capabilities/setup/operations/setupSkills.js +4 -2
- package/dist/src/capabilities/setup/operations/setupSkills.js.map +1 -1
- package/dist/src/capabilities/setup/setup.verb.js +79 -30
- package/dist/src/capabilities/setup/setup.verb.js.map +1 -1
- package/dist/src/capabilities/setup/targets.js +12 -6
- package/dist/src/capabilities/setup/targets.js.map +1 -1
- package/dist/src/capabilities/shared/index.js +1 -1
- package/dist/src/capabilities/shared/index.js.map +1 -1
- package/dist/src/constants.js +7 -1
- package/dist/src/constants.js.map +1 -1
- package/dist/src/kernel/packs/sparql/buildLookupQuery.js +11 -7
- package/dist/src/kernel/packs/sparql/buildLookupQuery.js.map +1 -1
- package/dist/src/kernel/project/cli/dispatch.js +23 -1
- package/dist/src/kernel/project/cli/dispatch.js.map +1 -1
- package/dist/src/kernel/project/cli/rootHelp.js +8 -5
- package/dist/src/kernel/project/cli/rootHelp.js.map +1 -1
- package/dist/src/kernel/runtime/graphpack/embedded/pack.generated.js +2 -3
- package/dist/src/kernel/runtime/graphpack/embedded/pack.generated.js.map +1 -1
- package/dist/src/kernel/runtime/graphpack/embedded/pack.index.generated.js +1 -1
- package/dist/src/kernel/runtime/graphpack/embedded/pack.index.generated.js.map +1 -1
- package/dist/src/kernel/runtime/graphpack/embedded/pack.manifest.generated.js +4 -0
- package/dist/src/kernel/runtime/graphpack/embedded/pack.manifest.generated.js.map +1 -0
- package/dist/src/kernel/runtime/graphpack/embedded.js +13 -6
- package/dist/src/kernel/runtime/graphpack/embedded.js.map +1 -1
- package/dist/src/kernel/runtime/graphpack/read.js +14 -9
- package/dist/src/kernel/runtime/graphpack/read.js.map +1 -1
- package/dist/src/kernel/runtime/loadSession.js +3 -1
- package/dist/src/kernel/runtime/loadSession.js.map +1 -1
- package/dist/src/kernel/runtime/probe.js +1 -1
- package/dist/src/kernel/runtime/probe.js.map +1 -1
- package/dist/src/kernel/runtime/refs/parseRef.js +17 -1
- package/dist/src/kernel/runtime/refs/parseRef.js.map +1 -1
- package/dist/src/kernel/runtime/refs/resolve.js +9 -3
- package/dist/src/kernel/runtime/refs/resolve.js.map +1 -1
- package/package.json +22 -19
- package/pragma.conf.ts +36 -5
- package/src/capabilities/capabilities/hints.ts +1 -1
- package/src/capabilities/config/collectConfigShow.test.ts +1 -0
- package/src/capabilities/create/byteEquality.test.ts +28 -1
- package/src/capabilities/create/create.test.ts +1 -0
- package/src/capabilities/create/create.verb.ts +2 -1
- package/src/capabilities/create/createGrammar.test.ts +4 -1
- package/src/capabilities/create/createSurface.generated.ts +23 -1
- package/src/capabilities/create/crossCli.subprocess.test.ts +10 -3
- package/src/capabilities/doctor/checks/checkNodeVersion.test.ts +49 -0
- package/src/capabilities/doctor/checks/checkNodeVersion.ts +11 -7
- package/src/capabilities/doctor/checks/isSupportedNodeVersion.test.ts +111 -0
- package/src/capabilities/doctor/checks/isSupportedNodeVersion.ts +34 -0
- package/src/capabilities/doctor/checks/mcpCommand.test.ts +7 -1
- package/src/capabilities/lazy.test.ts +26 -2
- package/src/capabilities/listLookup.shipped.exec.test.ts +340 -0
- package/src/capabilities/resources/resources.test.ts +38 -2
- package/src/capabilities/setup/operations/setupCompletions.ts +9 -2
- package/src/capabilities/setup/operations/setupConfig.ts +7 -2
- package/src/capabilities/setup/operations/setupGenerator.ts +83 -14
- package/src/capabilities/setup/operations/setupLsp.ts +95 -22
- package/src/capabilities/setup/operations/setupMcp.ts +7 -1
- package/src/capabilities/setup/operations/setupSkills.ts +7 -2
- package/src/capabilities/setup/setup.test.ts +247 -2
- package/src/capabilities/setup/setup.verb.ts +83 -35
- package/src/capabilities/setup/targets.ts +18 -8
- package/src/capabilities/shared/index.ts +1 -0
- package/src/capabilities/surface.test.ts +12 -4
- package/src/constants.ts +8 -0
- package/src/kernel/config/defaults.test.ts +17 -2
- package/src/kernel/config/readConfig.test.ts +1 -1
- package/src/kernel/packs/sparql/buildLookupQuery.ts +11 -7
- package/src/kernel/project/cli/dispatch.ts +23 -1
- package/src/kernel/project/cli/rootHelp.ts +8 -5
- package/src/kernel/render/prefixes.test.ts +2 -0
- package/src/kernel/runtime/graphpack/embedded/pack.generated.ts +2 -3
- package/src/kernel/runtime/graphpack/embedded/pack.index.generated.ts +1 -1
- package/src/kernel/runtime/graphpack/embedded/pack.manifest.generated.ts +3 -0
- package/src/kernel/runtime/graphpack/embedded.ts +14 -6
- package/src/kernel/runtime/graphpack/graphpack.test.ts +31 -5
- package/src/kernel/runtime/graphpack/read.ts +14 -12
- package/src/kernel/runtime/loadSession.ts +3 -1
- package/src/kernel/runtime/probe.ts +1 -1
- package/src/kernel/runtime/refs/parseRef.test.ts +49 -1
- package/src/kernel/runtime/refs/parseRef.ts +25 -1
- package/src/kernel/runtime/refs/resolve.ts +9 -3
- package/src/kernel/runtime/types.ts +17 -0
- package/src/testing/helpers/runCli.test.ts +44 -0
- package/src/testing/helpers/runCli.ts +27 -3
|
@@ -411,7 +411,29 @@ export async function executeVerb(
|
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
413
|
if (mutation.undo) {
|
|
414
|
-
|
|
414
|
+
// The truth seam. `runUndo`'s collection phase drove the verb's task
|
|
415
|
+
// with every effect mocked, so anything the task body reported was a
|
|
416
|
+
// narration of the mocked walk, not of the reversals — which have only
|
|
417
|
+
// JUST run, each isolated, each with its own outcome. Those outcomes
|
|
418
|
+
// are the one honest record of what the undo did: a verb that reports
|
|
419
|
+
// per-target results sets `undoReport` (like `exec`/`planData`) and
|
|
420
|
+
// projects them onto its own rows; a throw from it renders as the
|
|
421
|
+
// run's error, exactly like a failed real run. Verbs without a
|
|
422
|
+
// projector of their own still may not exit 0 over a failed reversal,
|
|
423
|
+
// so the outcomes are re-checked here as the backstop.
|
|
424
|
+
const { undoCount, outcomes } = await runUndo(task, {
|
|
425
|
+
onLog: logSink(flags),
|
|
426
|
+
});
|
|
427
|
+
await mutationRuntime.undoReport?.(outcomes);
|
|
428
|
+
const failed = outcomes.filter((o) => o.status === "failed");
|
|
429
|
+
if (failed.length > 0) {
|
|
430
|
+
throw new PragmaError({
|
|
431
|
+
code: "UNSUPPORTED",
|
|
432
|
+
message: `${failed.length} of ${outcomes.length} undo step(s) did not complete: ${failed
|
|
433
|
+
.map((o) => o.error.message)
|
|
434
|
+
.join("; ")}`,
|
|
435
|
+
});
|
|
436
|
+
}
|
|
415
437
|
return renderUndo(flags, undoCount);
|
|
416
438
|
}
|
|
417
439
|
// Real execution: spread the verb's runner options into the node
|
|
@@ -83,6 +83,14 @@ function buildKernelGroups(programName: string): readonly HelpGroup[] {
|
|
|
83
83
|
},
|
|
84
84
|
{ noun: "info", summary: "Show version, config, and update status" },
|
|
85
85
|
{ noun: "version", summary: "Print the CLI version" },
|
|
86
|
+
// A colophon is the note at the back of a book: the typeface, the
|
|
87
|
+
// press, the paper. Nothing depends on it, which is the point — so
|
|
88
|
+
// this line does not argue for it. Every other summary in this column
|
|
89
|
+
// promises work done; this one just invites you to look. It sits with
|
|
90
|
+
// the other commands that describe the distribution rather than act on
|
|
91
|
+
// it; "For AI agents" is for surfaces an agent drives, and credits are
|
|
92
|
+
// for a person reading.
|
|
93
|
+
{ noun: "colophon", summary: "Read the credits" },
|
|
86
94
|
{
|
|
87
95
|
noun: "upgrade",
|
|
88
96
|
summary: `Upgrade the ${programName} CLI to the latest version`,
|
|
@@ -96,11 +104,6 @@ function buildKernelGroups(programName: string): readonly HelpGroup[] {
|
|
|
96
104
|
noun: "capabilities",
|
|
97
105
|
summary: "Discover conventions, tools, and the discovery sequence",
|
|
98
106
|
},
|
|
99
|
-
// A colophon is the note at the back of a book: the typeface, the
|
|
100
|
-
// press, the paper. Nothing depends on it, which is the point — so
|
|
101
|
-
// this line does not argue for it. Every other summary in this column
|
|
102
|
-
// promises work done; this one just invites you to look.
|
|
103
|
-
{ noun: "colophon", summary: "Read the credits" },
|
|
104
107
|
{ noun: "skill", summary: "Browse agent skills from the active packs" },
|
|
105
108
|
{ noun: "prompt", summary: "Browse reusable prompt templates" },
|
|
106
109
|
// Curated for PLACEMENT, not for existence: `mcp serve` is an
|
|
@@ -13,6 +13,8 @@ describe("DEFAULT_PREFIX_MAP", () => {
|
|
|
13
13
|
skos: "http://www.w3.org/2004/02/skos/core#",
|
|
14
14
|
ds: "https://ds.canonical.com/",
|
|
15
15
|
cs: "http://pragma.canonical.com/codestandards#",
|
|
16
|
+
dt: "https://dt.canonical.com/",
|
|
17
|
+
"w3c-tokens": "https://dt.canonical.com/w3c-tokens/",
|
|
16
18
|
});
|
|
17
19
|
});
|
|
18
20
|
|