@unbrained/pm-cli 2026.8.23 → 2026.8.24
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/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +14 -1
- package/dist/cli/description-stdin.js +5 -4
- package/dist/cli/extension-command-help.d.ts +5 -0
- package/dist/cli/extension-command-help.js +6 -2
- package/dist/cli/help-content.d.ts +5 -0
- package/dist/cli/help-content.js +56 -3
- package/dist/cli/help-json-payload.d.ts +5 -2
- package/dist/cli/help-json-payload.js +57 -17
- package/dist/cli/main.d.ts +3 -0
- package/dist/cli/main.js +28 -3
- package/dist/cli/register-annotations.js +5 -5
- package/dist/cli/register-mutation.js +73 -27
- package/dist/cli-bundle/bundle-manifest.json +152 -152
- package/dist/cli-bundle/chunks/{chunk-JB4KZWBF.js → chunk-AGUL3HUT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-EG6CLDZT.js → chunk-DJNJBWAQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-F3AI2JFL.js → chunk-I5Q7QSZX.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-IW72J5FW.js +2 -0
- package/dist/cli-bundle/chunks/{chunk-KXPMB2YL.js → chunk-L22NP5MA.js} +55 -55
- package/dist/cli-bundle/chunks/chunk-MKE6MD2K.js +36 -0
- package/dist/cli-bundle/chunks/{chunk-QDVHNHAQ.js → chunk-NXBFO63A.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-TEQDR5KI.js +202 -0
- package/dist/cli-bundle/chunks/{chunk-KPH73XXJ.js → chunk-X7WWQDYQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TFI5V5N2.js → chunk-YOLLRCLY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HWZ6CELB.js → chunk-ZAVCS2GH.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-UJB5FMV2.js → register-list-query-37A4P6O4.js} +2 -2
- package/dist/cli-bundle/chunks/register-mutation-TBJDHYIT.js +20 -0
- package/dist/cli-bundle/chunks/{register-operations-RXIJIYXC.js → register-operations-WRZNEBUM.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-GFUZEKRE.js → register-setup-H4PDLACD.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-AUFH5H35.js → chunk-4WP7LNE3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-LYVSW5VM.js → chunk-6MUTDXMP.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-6Z24ZMU3.js +2 -0
- package/dist/cli-bundle/focused-chunks/{chunk-OGLQBL46.js → chunk-BFA6KKCI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-QGFNI65N.js → chunk-CWCN5RLO.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UYRFYCDQ.js → chunk-FCTT4CZU.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-IFLWKY2R.js → chunk-GJR6YEMR.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-37Z4OEAP.js → chunk-IMWTYKII.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-R27IDGHD.js → chunk-IZNRRCU3.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-JOWDB2MH.js → chunk-MNPECIRL.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-OFVUGTLJ.js → chunk-O4ZXNJMT.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-Q63PSLO4.js +2 -0
- package/dist/cli-bundle/focused-chunks/chunk-QBP5FSBX.js +4 -0
- package/dist/cli-bundle/focused-chunks/{chunk-OY7QAV4Y.js → chunk-QV5UP27O.js} +46 -46
- package/dist/cli-bundle/focused-chunks/{chunk-3UPTYG44.js → chunk-RASVBJX5.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-5S7E72FY.js → chunk-RPRLENVA.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-TOFVXBWA.js +19 -0
- package/dist/cli-bundle/focused-chunks/{chunk-FZS4H32O.js → chunk-WZLSSGEU.js} +2 -2
- package/dist/cli-bundle/main.js +18 -17
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +41 -41
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +33 -33
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +6 -5
- package/dist/core/extensions/command-metadata-contract.d.ts +10 -0
- package/dist/core/extensions/command-metadata-contract.js +23 -0
- package/dist/core/extensions/command-visibility-tier.js +12 -2
- package/dist/core/extensions/extension-types.d.ts +6 -0
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/loader.js +4 -3
- package/dist/core/io/body-file.js +7 -2
- package/dist/core/io/bulk-ids-input.d.ts +24 -0
- package/dist/core/io/bulk-ids-input.js +113 -0
- package/dist/core/item/parse.d.ts +22 -2
- package/dist/core/item/parse.js +97 -4
- package/dist/mcp/server.d.ts +3 -2
- package/dist/mcp/server.js +16 -9
- package/dist/sdk/agent/refusal-closure-census.d.ts +66 -0
- package/dist/sdk/agent/refusal-closure-census.js +144 -0
- package/dist/sdk/agent-capability-contracts.d.ts +34 -1
- package/dist/sdk/agent-capability-contracts.js +104 -6
- package/dist/sdk/annotations.d.ts +2 -0
- package/dist/sdk/annotations.js +25 -7
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +38 -2
- package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +4 -1
- package/dist/sdk/cli-contracts/typed-action-inputs.js +2 -2
- package/dist/sdk/comments.js +15 -7
- package/dist/sdk/flag-invocation-contracts.d.ts +2 -0
- package/dist/sdk/flag-invocation-contracts.js +28 -3
- package/dist/sdk/generated/generated-error-code-catalog-part-1.js +71 -38
- package/dist/sdk/generated/generated-error-code-catalog-part-2.js +38 -2
- package/dist/sdk/guide-topics.d.ts +0 -5
- package/dist/sdk/guide-topics.js +28 -2
- package/dist/sdk/history-compact.d.ts +2 -1
- package/dist/sdk/history-compact.js +24 -5
- package/dist/sdk/history-mcp.js +11 -10
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/index.js +3 -2
- package/dist/sdk/item-transaction.js +19 -12
- package/dist/sdk/lifecycle/append.js +4 -4
- package/dist/sdk/lifecycle/close-many.js +16 -7
- package/dist/sdk/lifecycle/create.js +29 -21
- package/dist/sdk/lifecycle/plan.js +24 -6
- package/dist/sdk/lifecycle/update-many.js +15 -8
- package/dist/sdk/lifecycle/update.d.ts +2 -0
- package/dist/sdk/lifecycle/update.js +34 -24
- package/dist/sdk/runtime-extended-actions.js +5 -3
- package/dist/sdk/runtime-input.d.ts +4 -0
- package/dist/sdk/runtime-input.js +98 -23
- package/dist/sdk/runtime-primitives.d.ts +2 -1
- package/dist/sdk/runtime-primitives.js +4 -3
- package/dist/sdk/runtime.js +7 -20
- package/dist/sdk/scheduling-shortcuts.js +5 -3
- package/dist/sdk/structured-mutations.js +10 -3
- package/dist/sdk/workspace-contracts.d.ts +3 -0
- package/dist/sdk/workspace-contracts.js +3 -2
- package/docs/README.md +2 -0
- package/docs/RELEASING.md +40 -21
- package/docs/SCRIPTING.md +62 -3
- package/docs/SDK.md +8 -0
- package/docs/generated/AGENT_CAPABILITY_ROUTING.md +17 -0
- package/docs/generated/AGENT_COMMAND_SURFACE.md +1 -1
- package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +355 -0
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/README.md +9 -11
- package/packages/pm-command-kit/extensions/command-kit/index.ts +3 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +10 -0
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/scripts/generate-agent-capability-surfaces.mjs +27 -1
- package/sdk/public-surface.json +215 -11
- package/dist/cli-bundle/chunks/chunk-3ENVHX6C.js +0 -36
- package/dist/cli-bundle/chunks/chunk-DW2CGEMU.js +0 -2
- package/dist/cli-bundle/chunks/chunk-HZBMLSZI.js +0 -201
- package/dist/cli-bundle/chunks/register-mutation-NX5XE4VX.js +0 -20
- package/dist/cli-bundle/focused-chunks/chunk-E7X25GC3.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-FQCSTBWE.js +0 -4
- package/dist/cli-bundle/focused-chunks/chunk-MRCNF3U6.js +0 -2
- package/dist/cli-bundle/focused-chunks/chunk-ZHVA42R5.js +0 -18
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Official marketplace for pm CLI — native git-based project management for Claude Code and AI coding agents.",
|
|
9
|
-
"version": "2026.8.
|
|
9
|
+
"version": "2026.8.24"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "pm-claude",
|
|
14
14
|
"source": "./plugins/pm-claude",
|
|
15
15
|
"description": "Native pm CLI integration for Claude Code — 28 MCP tools, 5 workflow skills, 14 slash commands, 4 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.",
|
|
16
|
-
"version": "2026.8.
|
|
16
|
+
"version": "2026.8.24",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "unbrained",
|
|
19
19
|
"url": "https://github.com/unbraind/pm-cli"
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026.8.24 - 2026-08-24
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Structured release-failure causes are preserved in blocked-release alerts ([pm-x63izf](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-x63izf.toon))
|
|
8
|
+
- Bulk writes accept newline/comma IDs from argv, stdin, and @path with effect-aware exits ([pm-3oq022](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-3oq022.toon))
|
|
9
|
+
- update-many --dry-run allows filter-only preview for review and bulk-selection workflows ([pm-kexu](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-kexu.toon))
|
|
10
|
+
- Releases from the default branch are supported with analyzer evidence ([pm-u1baah](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-u1baah.toon))
|
|
11
|
+
|
|
12
|
+
### Other
|
|
13
|
+
|
|
14
|
+
- Uniform stdin convention: body-file and annotation --file flags accept '-' for stdin ([pm-iktj](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-iktj.toon))
|
|
15
|
+
- Single source of surface tiering: one contract-declared tier per command drives CLI help, MCP tool profiles, completions, and docs together ([pm-kxci8x](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/tasks/pm-kxci8x.toon))
|
|
16
|
+
|
|
3
17
|
## 2026.8.23 - 2026-08-23
|
|
4
18
|
|
|
5
19
|
### Added
|
|
@@ -109,7 +123,6 @@
|
|
|
109
123
|
|
|
110
124
|
### Fixed
|
|
111
125
|
|
|
112
|
-
- A commit pushed directly to the default branch can never be released: both analyzer-evidence fallbacks presuppose a pull request, and nothing declares that precondition ([pm-u1baah](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-u1baah.toon))
|
|
113
126
|
- GH-1052: typed fail-closed whole-list SDK primitive ([pm-y4aaol](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-y4aaol.toon))
|
|
114
127
|
- Packed Bun SDK import fails on node:module stripTypeScriptTypes ([pm-ikj8ve](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-ikj8ve.toon))
|
|
115
128
|
- GH-1051: package catalog rejects universal output-budget controls ([pm-2firut](https://github.com/unbraind/pm-cli/blob/main/.agents/pm/issues/pm-2firut.toon))
|
|
@@ -4,14 +4,15 @@
|
|
|
4
4
|
* Resolves the shared create/update description stdin sentinel.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c55461f3-15d7-51f4-9e41-f71ce693b7b8")}catch(e){}}();
|
|
8
8
|
import { createStdinTokenResolver } from "../sdk/runtime-primitives.js";
|
|
9
9
|
/** Replace a description stdin sentinel with the complete standard-input payload. */
|
|
10
10
|
export async function resolveDescriptionStdin(options) {
|
|
11
|
-
if (options.description === "
|
|
11
|
+
if (typeof options.description === "string" &&
|
|
12
|
+
options.description.trim() === "-") {
|
|
12
13
|
options.description =
|
|
13
|
-
(await createStdinTokenResolver().resolveValue(
|
|
14
|
+
(await createStdinTokenResolver().resolveValue(options.description, "--description")) ?? "";
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
//# sourceMappingURL=description-stdin.js.map
|
|
17
|
-
//# debugId=
|
|
18
|
+
//# debugId=c55461f3-15d7-51f4-9e41-f71ce693b7b8
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Command } from "commander";
|
|
7
7
|
import { type FlagDefinition, type RegisteredExtensionCommandDefinition, type RegisteredExtensionFlagDefinitions } from "../sdk/runtime-primitives.js";
|
|
8
|
+
import type { PmCommandCapabilityFamily, PmCommandVisibilityTier } from "../sdk/agent-capability-contracts.js";
|
|
8
9
|
/** Documents the extension command argument help descriptor payload exchanged by command, SDK, and package integrations. */
|
|
9
10
|
export interface ExtensionCommandArgumentHelpDescriptor {
|
|
10
11
|
/** Value that configures or reports name for this contract. */
|
|
@@ -34,6 +35,10 @@ export interface ExtensionCommandHelpDescriptor {
|
|
|
34
35
|
arguments: ExtensionCommandArgumentHelpDescriptor[];
|
|
35
36
|
/** Value that configures or reports flags for this contract. */
|
|
36
37
|
flags: FlagDefinition[];
|
|
38
|
+
/** Minimum agent surface tier declared by the package. */
|
|
39
|
+
tier: PmCommandVisibilityTier;
|
|
40
|
+
/** Capability family declared by the package. */
|
|
41
|
+
family: PmCommandCapabilityFamily;
|
|
37
42
|
/** Value that configures or reports source for this contract. */
|
|
38
43
|
source?: {
|
|
39
44
|
layer: "global" | "project";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Provides CLI runtime support for Extension Command Help.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="99d39b7c-ec26-5c95-85c0-ac28112a6fe6")}catch(e){}}();
|
|
8
8
|
import { Option } from "commander";
|
|
9
9
|
/** Implements normalize extension command path for the public runtime surface of this module. */
|
|
10
10
|
export function normalizeExtensionCommandPath(commandPath) {
|
|
@@ -227,6 +227,8 @@ function collectExtensionDefinitionsByCommand(commandDefinitions) {
|
|
|
227
227
|
failure_hints: normalizeExtensionCommandStringList(definition.failure_hints),
|
|
228
228
|
arguments: normalizeExtensionCommandArguments(definition.arguments),
|
|
229
229
|
flags: [],
|
|
230
|
+
tier: definition.tier ?? "standard",
|
|
231
|
+
family: definition.family ?? "extensions",
|
|
230
232
|
source: {
|
|
231
233
|
layer: definition.layer,
|
|
232
234
|
name: definition.name,
|
|
@@ -300,6 +302,8 @@ export function collectExtensionCommandHelpDescriptors(commandHandlers, commandD
|
|
|
300
302
|
failure_hints: [],
|
|
301
303
|
arguments: [],
|
|
302
304
|
flags,
|
|
305
|
+
tier: "standard",
|
|
306
|
+
family: "extensions",
|
|
303
307
|
});
|
|
304
308
|
}
|
|
305
309
|
return descriptors;
|
|
@@ -630,4 +634,4 @@ export function reportExtensionCommandCollision(activationWarnings, report, warn
|
|
|
630
634
|
report(`[pm] warning: ${warning}; core command preserved. Rename or namespace the extension command alias.`);
|
|
631
635
|
}
|
|
632
636
|
//# sourceMappingURL=extension-command-help.js.map
|
|
633
|
-
//# debugId=
|
|
637
|
+
//# debugId=99d39b7c-ec26-5c95-85c0-ac28112a6fe6
|
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
* Provides CLI runtime support for Help Content.
|
|
5
5
|
*/
|
|
6
6
|
import { Command } from "commander";
|
|
7
|
+
import { type PmCommandVisibilityTier } from "../sdk/agent-capability-contracts.js";
|
|
8
|
+
/** Attach a package command's declared tier to its Commander presentation node. */
|
|
9
|
+
export declare function setPmCommandHelpVisibilityTier(command: Command, tier: PmCommandVisibilityTier): void;
|
|
10
|
+
/** Read presentation metadata attached to a package-created Commander node. */
|
|
11
|
+
export declare function getPmCommandHelpVisibilityTier(command: Command): PmCommandVisibilityTier | undefined;
|
|
7
12
|
/** Documents the help bundle payload exchanged by command, SDK, and package integrations. */
|
|
8
13
|
export interface HelpBundle {
|
|
9
14
|
/** Value that configures or reports why for this contract. */
|
package/dist/cli/help-content.js
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5ea35d21-cfe6-5138-9fdb-413083719924")}catch(e){}}();
|
|
3
3
|
import { parseBootstrapHelpRequest } from "./bootstrap-args.js";
|
|
4
4
|
import { formatPmPositionalActionFlagTip, PM_POSITIONAL_ACTION_CONTRACTS, resolvePmPositionalActionContract, } from "../sdk/cli-contracts/grammar-contracts.js";
|
|
5
|
+
import { listPmCommandsForTier, measurePmCoreHelp, PM_CORE_HELP_OPTION_FLAGS, } from "../sdk/agent-capability-contracts.js";
|
|
6
|
+
const COMMAND_HELP_VISIBILITY_TIERS = new WeakMap();
|
|
7
|
+
/** Attach a package command's declared tier to its Commander presentation node. */
|
|
8
|
+
export function setPmCommandHelpVisibilityTier(command, tier) {
|
|
9
|
+
COMMAND_HELP_VISIBILITY_TIERS.set(command, tier);
|
|
10
|
+
}
|
|
11
|
+
/** Read presentation metadata attached to a package-created Commander node. */
|
|
12
|
+
export function getPmCommandHelpVisibilityTier(command) {
|
|
13
|
+
return COMMAND_HELP_VISIBILITY_TIERS.get(command);
|
|
14
|
+
}
|
|
5
15
|
// Compact help/narrative surfaces show at most the first example. Centralizing this
|
|
6
16
|
// keeps the empty-examples guard in one place for renderCompactHelpBundle and
|
|
7
17
|
// resolveHelpNarrative (both must degrade to an empty list rather than [undefined]).
|
|
@@ -875,8 +885,51 @@ export function resolveHelpNarrative(commandPath, detailMode) {
|
|
|
875
885
|
}
|
|
876
886
|
/** Implements attach rich help text for the public runtime surface of this module. */
|
|
877
887
|
export function attachRichHelpText(program, argv = process.argv.slice(2)) {
|
|
888
|
+
const baselineHelp = program.createHelp();
|
|
889
|
+
const coreCommands = new Set(listPmCommandsForTier("core"));
|
|
890
|
+
const coreOptions = new Set(PM_CORE_HELP_OPTION_FLAGS);
|
|
891
|
+
const selectedRootCommands = new Set();
|
|
892
|
+
program.configureHelp({
|
|
893
|
+
visibleCommands(command) {
|
|
894
|
+
const visible = baselineHelp.visibleCommands(command);
|
|
895
|
+
if (command !== program) {
|
|
896
|
+
return visible;
|
|
897
|
+
}
|
|
898
|
+
return visible.filter((candidate) => selectedRootCommands.has(candidate));
|
|
899
|
+
},
|
|
900
|
+
visibleOptions(command) {
|
|
901
|
+
const visible = baselineHelp.visibleOptions(command);
|
|
902
|
+
return command === program
|
|
903
|
+
? visible.filter((option) => coreOptions.has(option.flags))
|
|
904
|
+
: visible;
|
|
905
|
+
},
|
|
906
|
+
});
|
|
878
907
|
const detailMode = resolveHelpDetailMode(argv);
|
|
879
|
-
|
|
908
|
+
const rootHelpText = renderHelpBundle(ROOT_HELP_BUNDLE, detailMode);
|
|
909
|
+
program.addHelpText("after", rootHelpText);
|
|
910
|
+
const budgetHelp = program.createHelp();
|
|
911
|
+
budgetHelp.prepareContext({
|
|
912
|
+
error: false,
|
|
913
|
+
helpWidth: 80,
|
|
914
|
+
outputHasColors: false,
|
|
915
|
+
});
|
|
916
|
+
const renderBudgetHelp = () => `${budgetHelp.formatHelp(program, budgetHelp)}${rootHelpText}\n`;
|
|
917
|
+
const rootCandidates = baselineHelp.visibleCommands(program);
|
|
918
|
+
for (const candidate of rootCandidates) {
|
|
919
|
+
const declaredTier = getPmCommandHelpVisibilityTier(candidate);
|
|
920
|
+
if (declaredTier === undefined &&
|
|
921
|
+
(candidate.name() === "help" || coreCommands.has(candidate.name()))) {
|
|
922
|
+
selectedRootCommands.add(candidate);
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
for (const candidate of rootCandidates) {
|
|
926
|
+
if (getPmCommandHelpVisibilityTier(candidate) !== "core")
|
|
927
|
+
continue;
|
|
928
|
+
selectedRootCommands.add(candidate);
|
|
929
|
+
if (!measurePmCoreHelp(renderBudgetHelp()).within_budget) {
|
|
930
|
+
selectedRootCommands.delete(candidate);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
880
933
|
for (const [commandPath, bundle] of Object.entries(HELP_BY_COMMAND_PATH)) {
|
|
881
934
|
attachBundleByPath(program, commandPath, bundle, detailMode);
|
|
882
935
|
}
|
|
@@ -910,4 +963,4 @@ export const _testOnly = {
|
|
|
910
963
|
renderDetailedHelpBundle,
|
|
911
964
|
};
|
|
912
965
|
//# sourceMappingURL=help-content.js.map
|
|
913
|
-
//# debugId=
|
|
966
|
+
//# debugId=5ea35d21-cfe6-5138-9fdb-413083719924
|
|
@@ -32,13 +32,15 @@ export interface HelpSubcommandSummary {
|
|
|
32
32
|
/** Shared command capability family. */
|
|
33
33
|
family: PmCommandCapabilityFamily;
|
|
34
34
|
}
|
|
35
|
+
type ExtensionCommandSurface = Pick<ExtensionCommandHelpDescriptor, "tier" | "family">;
|
|
36
|
+
declare function resolveExtensionCommandSurface(commandPath: string, descriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>, allowDescendants?: boolean): ExtensionCommandSurface | undefined;
|
|
35
37
|
declare function resolveCommandFromPathTokens(root: Command, pathTokens: string[]): Command | null;
|
|
36
38
|
declare function readOptionAttributeName(option: unknown): string | null;
|
|
37
39
|
declare function buildOptionAliasMap(options: unknown[]): Map<string, string[]>;
|
|
38
40
|
declare function buildHelpOptionSummaries(command: Command): HelpOptionSummary[];
|
|
39
41
|
declare function compactHelpOptionAliases(options: HelpOptionSummary[]): HelpOptionSummary[];
|
|
40
42
|
declare function buildHelpArgumentSummaries(command: Command): HelpArgumentSummary[];
|
|
41
|
-
declare function buildHelpSubcommandSummaries(command: Command): HelpSubcommandSummary[];
|
|
43
|
+
declare function buildHelpSubcommandSummaries(command: Command, extensionDescriptors?: ReadonlyMap<string, ExtensionCommandHelpDescriptor>): HelpSubcommandSummary[];
|
|
42
44
|
interface PositionalActionHelpProjection {
|
|
43
45
|
arguments: HelpArgumentSummary[];
|
|
44
46
|
options: HelpOptionSummary[];
|
|
@@ -46,7 +48,7 @@ interface PositionalActionHelpProjection {
|
|
|
46
48
|
usage: string;
|
|
47
49
|
}
|
|
48
50
|
/** Build the command/action structural view shared by every JSON help field. */
|
|
49
|
-
declare function buildPositionalActionHelpProjection(action: PmPositionalActionContract | undefined, targetCommand: Command, resolvedPath: string, allOptions: HelpOptionSummary[]): PositionalActionHelpProjection;
|
|
51
|
+
declare function buildPositionalActionHelpProjection(action: PmPositionalActionContract | undefined, targetCommand: Command, resolvedPath: string, allOptions: HelpOptionSummary[], extensionDescriptors?: ReadonlyMap<string, ExtensionCommandHelpDescriptor>): PositionalActionHelpProjection;
|
|
50
52
|
declare function buildJsonHelpPayload(rootProgram: Command, targetCommand: Command, argv: string[], requestedPath: string[], extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>): Record<string, unknown>;
|
|
51
53
|
/** Implements maybe render bootstrap json help for the public runtime surface of this module. */
|
|
52
54
|
export declare function maybeRenderBootstrapJsonHelp(rootProgram: Command, argv: string[], extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>): Promise<boolean>;
|
|
@@ -66,5 +68,6 @@ export declare const _testOnly: {
|
|
|
66
68
|
compactHelpOptionAliases: typeof compactHelpOptionAliases;
|
|
67
69
|
readOptionAttributeName: typeof readOptionAttributeName;
|
|
68
70
|
resolveCommandFromPathTokens: typeof resolveCommandFromPathTokens;
|
|
71
|
+
resolveExtensionCommandSurface: typeof resolveExtensionCommandSurface;
|
|
69
72
|
};
|
|
70
73
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="26c3efa6-b820-5370-b0ab-65b08bc007ec")}catch(e){}}();
|
|
3
3
|
import { hasSubcommandFlagContractsForCommand, PM_CORE_COMMAND_NAMES, } from "../sdk/cli-contracts.js";
|
|
4
4
|
import { commandOptionFlagLabel, resolveCommandOptionPolicyState, resolveTypeDefinition, EXIT_CODE, printError, writeStdout, } from "../sdk/runtime-primitives.js";
|
|
5
5
|
import { buildDynamicExtensionHelpOptionSummaries, mergeHelpOptionSummaries, findCommandByPath, findDirectChildCommand, commandAliases, } from "./extension-command-help.js";
|
|
6
|
-
import { normalizeHelpCommandPath, resolveHelpDetailMode, resolveHelpNarrative, } from "./help-content.js";
|
|
6
|
+
import { getPmCommandHelpVisibilityTier, normalizeHelpCommandPath, resolveHelpDetailMode, resolveHelpNarrative, } from "./help-content.js";
|
|
7
7
|
import { getCommandPath } from "./registration-helpers.js";
|
|
8
8
|
import { parseBootstrapGlobalOptions, parseBootstrapHelpRequest, parseBootstrapCommandName, parseBootstrapTypeValue, } from "./bootstrap-args.js";
|
|
9
9
|
import { extractProvidedOptionFlags, renderPmCommand } from "./argv-utils.js";
|
|
@@ -12,6 +12,32 @@ import { BUILTIN_TYPE_HELP_VALUES, buildUnknownCommandGuidanceFromRuntime, } fro
|
|
|
12
12
|
import { resolveCreateExplicitEmptyFlag } from "../sdk/agent/create-option-policy.js";
|
|
13
13
|
import { formatPmPositionalActionFlagTip, PM_POSITIONAL_ACTION_CONTRACTS, resolvePmPositionalActionContract, } from "../sdk/cli-contracts/grammar-contracts.js";
|
|
14
14
|
import { resolvePmCommandCapabilityFamily, resolvePmCommandVisibilityTier, } from "../sdk/agent-capability-contracts.js";
|
|
15
|
+
const EXTENSION_TIER_ORDER = {
|
|
16
|
+
core: 0,
|
|
17
|
+
standard: 1,
|
|
18
|
+
full: 2,
|
|
19
|
+
internal: 3,
|
|
20
|
+
};
|
|
21
|
+
function resolveExtensionCommandSurface(commandPath, descriptors, allowDescendants = true) {
|
|
22
|
+
const exact = descriptors.get(commandPath);
|
|
23
|
+
if (exact)
|
|
24
|
+
return exact;
|
|
25
|
+
if (!allowDescendants)
|
|
26
|
+
return undefined;
|
|
27
|
+
const descendants = [...descriptors.entries()]
|
|
28
|
+
.filter(([path]) => path.startsWith(`${commandPath} `))
|
|
29
|
+
.map(([, descriptor]) => descriptor);
|
|
30
|
+
if (descendants.length === 0)
|
|
31
|
+
return undefined;
|
|
32
|
+
const tier = descendants.reduce((selected, descriptor) => EXTENSION_TIER_ORDER[descriptor.tier] < EXTENSION_TIER_ORDER[selected]
|
|
33
|
+
? descriptor.tier
|
|
34
|
+
: selected, "internal");
|
|
35
|
+
const families = new Set(descendants.map(({ family }) => family));
|
|
36
|
+
return {
|
|
37
|
+
tier,
|
|
38
|
+
family: families.size === 1 ? descendants[0].family : "extensions",
|
|
39
|
+
};
|
|
40
|
+
}
|
|
15
41
|
function resolveCommandFromPathTokens(root, pathTokens) {
|
|
16
42
|
if (pathTokens.length === 0) {
|
|
17
43
|
return root;
|
|
@@ -180,20 +206,23 @@ function buildHelpArgumentSummaries(command) {
|
|
|
180
206
|
};
|
|
181
207
|
});
|
|
182
208
|
}
|
|
183
|
-
function buildHelpSubcommandSummaries(command) {
|
|
209
|
+
function buildHelpSubcommandSummaries(command, extensionDescriptors = new Map()) {
|
|
184
210
|
return command
|
|
185
211
|
.createHelp()
|
|
186
212
|
.visibleCommands(command)
|
|
187
213
|
.filter((entry) => entry.name() !== "help" || command.parent === null)
|
|
188
214
|
.map((entry) => {
|
|
189
|
-
const
|
|
190
|
-
|
|
215
|
+
const commandPath = normalizeHelpCommandPath(getCommandPath(entry));
|
|
216
|
+
const rootCommand = commandPath.split(" ")[0];
|
|
217
|
+
const extensionDescriptor = resolveExtensionCommandSurface(commandPath, extensionDescriptors, getPmCommandHelpVisibilityTier(entry) !== undefined);
|
|
191
218
|
return {
|
|
192
219
|
name: entry.name().trim(),
|
|
193
220
|
aliases: commandAliases(entry),
|
|
194
221
|
description: entry.description().trim(),
|
|
195
|
-
tier:
|
|
196
|
-
|
|
222
|
+
tier: extensionDescriptor?.tier ??
|
|
223
|
+
resolvePmCommandVisibilityTier(rootCommand),
|
|
224
|
+
family: extensionDescriptor?.family ??
|
|
225
|
+
resolvePmCommandCapabilityFamily(rootCommand),
|
|
197
226
|
};
|
|
198
227
|
})
|
|
199
228
|
.sort((left, right) => left.name.localeCompare(right.name));
|
|
@@ -223,11 +252,22 @@ function buildJsonHelpNarrative(detailMode, fallbackNarrative, extensionDescript
|
|
|
223
252
|
detail_mode: detailMode,
|
|
224
253
|
};
|
|
225
254
|
}
|
|
255
|
+
function resolveJsonHelpVisibilityTier(rootCommandPath, extensionDescriptor) {
|
|
256
|
+
if (rootCommandPath === undefined)
|
|
257
|
+
return null;
|
|
258
|
+
return (extensionDescriptor?.tier ?? resolvePmCommandVisibilityTier(rootCommandPath));
|
|
259
|
+
}
|
|
260
|
+
function resolveJsonHelpCapabilityFamily(rootCommandPath, extensionDescriptor) {
|
|
261
|
+
if (rootCommandPath === undefined)
|
|
262
|
+
return null;
|
|
263
|
+
return (extensionDescriptor?.family ??
|
|
264
|
+
resolvePmCommandCapabilityFamily(rootCommandPath));
|
|
265
|
+
}
|
|
226
266
|
/** Build the command/action structural view shared by every JSON help field. */
|
|
227
|
-
function buildPositionalActionHelpProjection(action, targetCommand, resolvedPath, allOptions) {
|
|
267
|
+
function buildPositionalActionHelpProjection(action, targetCommand, resolvedPath, allOptions, extensionDescriptors = new Map()) {
|
|
228
268
|
if (!action) {
|
|
229
269
|
const argumentsList = buildHelpArgumentSummaries(targetCommand);
|
|
230
|
-
const registeredSubcommands = buildHelpSubcommandSummaries(targetCommand);
|
|
270
|
+
const registeredSubcommands = buildHelpSubcommandSummaries(targetCommand, extensionDescriptors);
|
|
231
271
|
const registeredSubcommandNames = new Set(registeredSubcommands.map(({ name }) => name));
|
|
232
272
|
return {
|
|
233
273
|
arguments: argumentsList,
|
|
@@ -289,21 +329,20 @@ function buildJsonHelpPayload(rootProgram, targetCommand, argv, requestedPath, e
|
|
|
289
329
|
const extensionDescriptor = commandPath
|
|
290
330
|
? extensionDescriptors.get(commandPath)
|
|
291
331
|
: undefined;
|
|
332
|
+
const extensionSurface = commandPath
|
|
333
|
+
? resolveExtensionCommandSurface(commandPath, extensionDescriptors, getPmCommandHelpVisibilityTier(targetCommand) !== undefined)
|
|
334
|
+
: undefined;
|
|
292
335
|
const narrative = buildJsonHelpNarrative(detailMode, fallbackNarrative, extensionDescriptor);
|
|
293
336
|
const allOptionSummaries = compactHelpOptionAliases(mergeHelpOptionSummaries(buildHelpOptionSummaries(targetCommand), buildDynamicExtensionHelpOptionSummaries(extensionDescriptor)));
|
|
294
|
-
const projection = buildPositionalActionHelpProjection(positionalAction, targetCommand, projectedPath, allOptionSummaries);
|
|
337
|
+
const projection = buildPositionalActionHelpProjection(positionalAction, targetCommand, projectedPath, allOptionSummaries, extensionDescriptors);
|
|
295
338
|
return {
|
|
296
339
|
format: "pm_help_v1",
|
|
297
340
|
detail_mode: detailMode,
|
|
298
341
|
root_command: rootProgram.name(),
|
|
299
342
|
requested_path: requestedPath,
|
|
300
343
|
resolved_path: projectedPath.length > 0 ? projectedPath : rootProgram.name(),
|
|
301
|
-
visibility_tier: rootCommandPath
|
|
302
|
-
|
|
303
|
-
: resolvePmCommandVisibilityTier(rootCommandPath),
|
|
304
|
-
capability_family: rootCommandPath === undefined
|
|
305
|
-
? null
|
|
306
|
-
: resolvePmCommandCapabilityFamily(rootCommandPath),
|
|
344
|
+
visibility_tier: resolveJsonHelpVisibilityTier(rootCommandPath, extensionSurface),
|
|
345
|
+
capability_family: resolveJsonHelpCapabilityFamily(rootCommandPath, extensionSurface),
|
|
307
346
|
description: positionalAction?.description ?? targetCommand.description(),
|
|
308
347
|
usage: projection.usage,
|
|
309
348
|
intent: positionalAction?.description ?? narrative.intent,
|
|
@@ -487,6 +526,7 @@ export const _testOnly = {
|
|
|
487
526
|
compactHelpOptionAliases,
|
|
488
527
|
readOptionAttributeName,
|
|
489
528
|
resolveCommandFromPathTokens,
|
|
529
|
+
resolveExtensionCommandSurface,
|
|
490
530
|
};
|
|
491
531
|
//# sourceMappingURL=help-json-payload.js.map
|
|
492
|
-
//# debugId=
|
|
532
|
+
//# debugId=26c3efa6-b820-5370-b0ab-65b08bc007ec
|
package/dist/cli/main.d.ts
CHANGED
|
@@ -157,6 +157,8 @@ declare function loadRuntimeExtensionCommandDescriptorsForRecovery(pmRoot: strin
|
|
|
157
157
|
declare function executeRegisteredRuntimeMigrations(migrations: RegisteredExtensionSchemaMigrationDefinition[], pmRoot: string): Promise<string[]>;
|
|
158
158
|
declare function runRequiredExtensionCommand(command: Command, options: Record<string, unknown>, globalOptions: GlobalOptions, extensionFlagDefinitions?: LooseCommandFlagDefinition[]): Promise<unknown>;
|
|
159
159
|
declare function wrapProgramActionsForExtensionHandlers(rootProgram: Command): void;
|
|
160
|
+
/** Apply descendant-derived visibility to every generated extension namespace. */
|
|
161
|
+
declare function applyDynamicExtensionRootHelpVisibility(rootProgram: Command, preexistingTopLevelCommands: ReadonlySet<string>, descriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>): void;
|
|
160
162
|
declare function registerDynamicExtensionCommandPaths(rootProgram: Command, invocationArgv: string[]): Promise<void>;
|
|
161
163
|
interface CoreCommandRegistrationSelection {
|
|
162
164
|
setup: boolean;
|
|
@@ -230,6 +232,7 @@ export declare function runPmCli(rawArgv?: string[]): Promise<void>;
|
|
|
230
232
|
/** Public contract for test only, shared by SDK and presentation-layer consumers. */
|
|
231
233
|
export declare const _testOnly: {
|
|
232
234
|
activationCommandMatchesProbe: typeof activationCommandMatchesProbe;
|
|
235
|
+
applyDynamicExtensionRootHelpVisibility: typeof applyDynamicExtensionRootHelpVisibility;
|
|
233
236
|
bootstrapProfileEnabled: typeof bootstrapProfileEnabled;
|
|
234
237
|
buildBootstrapActivationProbe: typeof buildBootstrapActivationProbe;
|
|
235
238
|
buildPostActionTelemetryOutcome: typeof buildPostActionTelemetryOutcome;
|
package/dist/cli/main.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @module cli/main
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
6
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ffd55bde-cc30-529f-a6f9-ec43abe4efba")}catch(e){}}();
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
import { activateExtensions, clearActiveExtensionHooks, createCoreCommandHookContext, resetActiveExtensionRuntimeState, createEmptyExtensionRegistrationRegistry, discoverExtensions, getActiveCommandResult, getActiveExtensionRegistrations, loadExtensions, consumeAfterCommandAffectedItems, runActiveCommandHandler, runActiveParserOverride, runActivePreflightOverride, runAfterCommandHooks, runBeforeCommandHooks, setActiveCommandResult, setActiveCommandContext, setActiveExtensionCommands, setActiveExtensionHooks, setActiveExtensionParsers, setActiveExtensionPreflight, setActiveExtensionRegistrations, setActiveExtensionRenderers, setActiveExtensionServices, pathExists, resolvePmCliVersion, resolvePmPackageRootFromModule, resolveItemTypeRegistry, resolveRuntimeFieldRegistry, EXIT_CODE, resolveTelemetryErrorCategory, PmCliError, asRecordOrNull, printError, printResult, maybeRunFirstUseTelemetryPrompt, emitTelemetryErrorEvent, startTelemetryCommand, deriveTelemetryCommandResolution, sentryCaptureCliError, sentryFinishCommandSpan, sentryFlush, sentryLogCliUsageError, sentrySetCommandContext, sentryStartCommandSpan, ensureSentryInit, getSettingsPath, resolvePmRoot, readSettings, readSettingsWithMetadata, runWithWorkspaceHarnessSignalDescriptors, createLazyModule, } from "../sdk/runtime-primitives.js";
|
|
9
9
|
import { runWithReproducibleProcessEnvironment } from "../sdk/reproducibility/process.js";
|
|
@@ -11,7 +11,7 @@ import { resolveSubcommandFlagContractsForCommand } from "../sdk/cli-contracts.j
|
|
|
11
11
|
import { createExtensionCommandSdk } from "../sdk/extension-command-context.js";
|
|
12
12
|
import { PmClient } from "../sdk/runtime.js";
|
|
13
13
|
import { coerceLooseCommandOptionsWithFlagDefinitions, collectLooseCommandOptionKeysForDefinitions, collectLoosePositionalArgs, parseLooseCommandOptions, stripLooseCommandOptionTokens, validateLooseCommandOptionsWithFlagDefinitions, } from "./extension-command-options.js";
|
|
14
|
-
import { attachRichHelpText } from "./help-content.js";
|
|
14
|
+
import { attachRichHelpText, setPmCommandHelpVisibilityTier, } from "./help-content.js";
|
|
15
15
|
import { finishActiveTelemetryCommand, recordAfterCommandContextUsage } from "./after-command-context-usage.js";
|
|
16
16
|
import { extractProvidedOptionFlags, normalizeLongOptionFlag, redactSensitiveCommandArgs, renderPmCommand, } from "./argv-utils.js";
|
|
17
17
|
import { classifyCommanderError, classifyPmCliError, classifyUnknownError, formatPmCliErrorForDisplay, formatPmCliErrorForJson, formatUnknownErrorForJson, projectLeanErrorEnvelope, } from "./error-guidance.js";
|
|
@@ -1508,6 +1508,28 @@ function attachDynamicExtensionHelp(command, descriptor, flagHelp, metadataHelp)
|
|
|
1508
1508
|
}
|
|
1509
1509
|
/* v8 ignore stop */
|
|
1510
1510
|
/* c8 ignore start */
|
|
1511
|
+
/** Apply descendant-derived visibility to every generated extension namespace. */
|
|
1512
|
+
function applyDynamicExtensionRootHelpVisibility(rootProgram, preexistingTopLevelCommands, descriptors) {
|
|
1513
|
+
const tierRank = { core: 0, standard: 1, full: 2, internal: 3 };
|
|
1514
|
+
const applyVisibility = (command, pathParts) => {
|
|
1515
|
+
const commandPath = pathParts.join(" ");
|
|
1516
|
+
const matchingDescriptors = [...descriptors.entries()]
|
|
1517
|
+
.filter(([path]) => path === commandPath || path.startsWith(`${commandPath} `))
|
|
1518
|
+
.map(([, descriptor]) => descriptor);
|
|
1519
|
+
const tier = matchingDescriptors.length === 0
|
|
1520
|
+
? "standard"
|
|
1521
|
+
: matchingDescriptors.reduce((selected, descriptor) => tierRank[descriptor.tier] < tierRank[selected] ? descriptor.tier : selected, "internal");
|
|
1522
|
+
setPmCommandHelpVisibilityTier(command, tier);
|
|
1523
|
+
for (const child of command.commands) {
|
|
1524
|
+
applyVisibility(child, [...pathParts, child.name()]);
|
|
1525
|
+
}
|
|
1526
|
+
};
|
|
1527
|
+
for (const command of rootProgram.commands) {
|
|
1528
|
+
if (!preexistingTopLevelCommands.has(command.name())) {
|
|
1529
|
+
applyVisibility(command, [command.name()]);
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1511
1533
|
async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv) {
|
|
1512
1534
|
const bootstrapGlobalOptions = parseBootstrapGlobalOptions(invocationArgv);
|
|
1513
1535
|
const pmRoot = resolvePmRoot(process.cwd(), bootstrapGlobalOptions.path);
|
|
@@ -1552,6 +1574,7 @@ async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv)
|
|
|
1552
1574
|
activeRuntimeExtensionCommandDescriptors = new Map(snapshot.commandDescriptors);
|
|
1553
1575
|
await maybeAttachCreateUpdatePolicyHelpText(rootProgram, pmRoot, invocationArgv, snapshot.registrations, snapshot.settings);
|
|
1554
1576
|
const commandPaths = collectSafeExtensionCommandPaths(rootProgram, snapshot.commandHandlers, snapshot.commandDescriptors, snapshot.commandAliases, (warning) => reportExtensionCommandCollision(snapshot.activationWarnings, printError, warning));
|
|
1577
|
+
const preexistingTopLevelCommands = new Set(rootProgram.commands.map((command) => command.name()));
|
|
1555
1578
|
const registerCommandPath = (commandPath) => {
|
|
1556
1579
|
const pathParts = commandPath.split(" ").filter((part) => part.length > 0);
|
|
1557
1580
|
const descriptor = snapshot.commandDescriptors.get(commandPath);
|
|
@@ -1609,6 +1632,7 @@ async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv)
|
|
|
1609
1632
|
for (const commandPath of commandPaths) {
|
|
1610
1633
|
registerCommandPath(commandPath);
|
|
1611
1634
|
}
|
|
1635
|
+
applyDynamicExtensionRootHelpVisibility(rootProgram, preexistingTopLevelCommands, snapshot.commandDescriptors);
|
|
1612
1636
|
}
|
|
1613
1637
|
/* c8 ignore stop */
|
|
1614
1638
|
/* c8 ignore start */
|
|
@@ -2470,6 +2494,7 @@ export async function runPmCli(rawArgv = process.argv.slice(2)) {
|
|
|
2470
2494
|
/** Public contract for test only, shared by SDK and presentation-layer consumers. */
|
|
2471
2495
|
export const _testOnly = {
|
|
2472
2496
|
activationCommandMatchesProbe,
|
|
2497
|
+
applyDynamicExtensionRootHelpVisibility,
|
|
2473
2498
|
bootstrapProfileEnabled,
|
|
2474
2499
|
buildBootstrapActivationProbe,
|
|
2475
2500
|
buildPostActionTelemetryOutcome,
|
|
@@ -2558,4 +2583,4 @@ export const _testOnly = {
|
|
|
2558
2583
|
wrapThrownErrorForSentry,
|
|
2559
2584
|
};
|
|
2560
2585
|
//# sourceMappingURL=main.js.map
|
|
2561
|
-
//# debugId=
|
|
2586
|
+
//# debugId=ffd55bde-cc30-529f-a6f9-ec43abe4efba
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="79bf0b3f-ad63-5d9f-9911-d5a142214ac1")}catch(e){}}();
|
|
3
3
|
import { EXIT_CODE, PmCliError, } from "../sdk/runtime-primitives.js";
|
|
4
4
|
import { renderPmCommand } from "../sdk/command-line.js";
|
|
5
5
|
import { runComments } from "./commands/comments.js";
|
|
@@ -194,7 +194,7 @@ export function registerAnnotationCommands(program, parsePositiveInteger) {
|
|
|
194
194
|
.argument("[text]", "Optional comment text shorthand (equivalent to --add)")
|
|
195
195
|
.option("--add <text>", "Add one comment entry (plain text fallback, text=<value>, markdown pairs, or - for stdin; CSV-like key fragments are preserved as plain text unless text is explicit)")
|
|
196
196
|
.option("--stdin", "Read comment text from stdin (supports multiline markdown)")
|
|
197
|
-
.option("--file <path>", "Read comment text from file
|
|
197
|
+
.option("--file <path>", "Read comment text from a file or stdin (-)")
|
|
198
198
|
.option("--edit <index>", "Replace the comment at 1-based <index> (replacement text from positional [text], --add, --stdin, or --file)", parsePositiveInteger("--edit"))
|
|
199
199
|
.option("--delete <index>", "Delete the comment at 1-based <index>", parsePositiveInteger("--delete"))
|
|
200
200
|
.option("--limit <n>", "Return only latest n comments")
|
|
@@ -214,7 +214,7 @@ export function registerAnnotationCommands(program, parsePositiveInteger) {
|
|
|
214
214
|
.option("--note <text>", "Alias for --add")
|
|
215
215
|
.option("--add-json <json>", "Append a merge-safe JSON event")
|
|
216
216
|
.option("--stdin", "Read note text from stdin")
|
|
217
|
-
.option("--file <path>", "Read note
|
|
217
|
+
.option("--file <path>", "Read note from file or stdin (-)")
|
|
218
218
|
.option("--edit <index>", "Replace a 1-based note using the selected text input", parsePositiveInteger("--edit"))
|
|
219
219
|
.option("--delete <index>", "Delete the note at 1-based <index>", parsePositiveInteger("--delete"))
|
|
220
220
|
.option("--limit <n>", "Return only latest n notes")
|
|
@@ -233,7 +233,7 @@ export function registerAnnotationCommands(program, parsePositiveInteger) {
|
|
|
233
233
|
.argument("[text]", "Optional learning text shorthand (equivalent to --add; use - for stdin)")
|
|
234
234
|
.option("--add <text>", "Add one learning entry (plain text fallback, text=<value>, markdown pairs, or - for stdin; CSV-like key fragments are preserved as plain text unless text is explicit)")
|
|
235
235
|
.option("--stdin", "Read learning text from stdin (supports multiline markdown)")
|
|
236
|
-
.option("--file <path>", "Read learning text from file
|
|
236
|
+
.option("--file <path>", "Read learning text from a file or stdin (-)")
|
|
237
237
|
.option("--edit <index>", "Replace the learning at 1-based <index> (replacement text from positional [text], --add, --stdin, or --file)", parsePositiveInteger("--edit"))
|
|
238
238
|
.option("--delete <index>", "Delete the learning at 1-based <index>", parsePositiveInteger("--delete"))
|
|
239
239
|
.option("--limit <n>", "Return only latest n learnings")
|
|
@@ -245,4 +245,4 @@ export function registerAnnotationCommands(program, parsePositiveInteger) {
|
|
|
245
245
|
.action(runLearningsAction);
|
|
246
246
|
}
|
|
247
247
|
//# sourceMappingURL=register-annotations.js.map
|
|
248
|
-
//# debugId=
|
|
248
|
+
//# debugId=79bf0b3f-ad63-5d9f-9911-d5a142214ac1
|