@unbrained/pm-cli 2026.5.11 → 2026.5.14
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/AGENTS.md +3 -116
- package/CHANGELOG.md +18 -0
- package/PRD.md +18 -39
- package/README.md +8 -5
- package/dist/cli/commander-usage.js +27 -0
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.js +19 -4
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/calendar.js +5 -2
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/contracts.js +63 -19
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +58 -3
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +14 -3
- package/dist/cli/commands/extension.js +481 -95
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -8
- package/dist/cli/commands/index.js +1 -8
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/reindex.d.ts +8 -0
- package/dist/cli/commands/reindex.js +96 -23
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.js +51 -25
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.js +14 -6
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/upgrade.d.ts +63 -0
- package/dist/cli/commands/upgrade.js +260 -0
- package/dist/cli/commands/upgrade.js.map +1 -0
- package/dist/cli/guide-topics.js +18 -16
- package/dist/cli/guide-topics.js.map +1 -1
- package/dist/cli/help-content.js +57 -18
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.js +73 -7
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +24 -142
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +49 -257
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +29 -198
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +181 -204
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +2 -2
- package/dist/cli/registration-helpers.js +1 -19
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/core/extensions/loader.js +7 -1
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/packages/manifest.d.ts +38 -0
- package/dist/core/packages/manifest.js +221 -0
- package/dist/core/packages/manifest.js.map +1 -0
- package/dist/core/search/embedding-batches.d.ts +13 -1
- package/dist/core/search/embedding-batches.js +19 -1
- package/dist/core/search/embedding-batches.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +8 -1
- package/dist/core/store/front-matter-cache.js +20 -11
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/mcp/server.d.ts +8 -0
- package/dist/mcp/server.js +100 -43
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.d.ts +7 -0
- package/dist/sdk/cli-contracts/commander-mutation-options.js +477 -0
- package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -0
- package/dist/sdk/cli-contracts/commander-types.d.ts +21 -0
- package/dist/sdk/cli-contracts/commander-types.js +92 -0
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -0
- package/dist/sdk/cli-contracts.d.ts +22 -32
- package/dist/sdk/cli-contracts.js +155 -296
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/index.js +2 -0
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +29 -0
- package/dist/sdk/runtime.js +28 -0
- package/dist/sdk/runtime.js.map +1 -0
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/COMMANDS.md +17 -1
- package/docs/EXTENSIONS.md +169 -61
- package/docs/QUICKSTART.md +11 -2
- package/docs/README.md +4 -6
- package/docs/RELEASING.md +4 -2
- package/docs/SDK.md +79 -438
- package/package.json +6 -23
- package/packages/pm-beads/README.md +10 -0
- package/packages/pm-beads/extensions/beads/index.js +113 -0
- package/{.agents/pm/extensions/beads/index.js → packages/pm-beads/extensions/beads/index.ts} +42 -20
- package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.js +2 -17
- package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.ts +41 -18
- package/packages/pm-beads/package.json +50 -0
- package/packages/pm-calendar/README.md +13 -0
- package/packages/pm-calendar/extensions/calendar/index.js +56 -0
- package/packages/pm-calendar/extensions/calendar/index.ts +62 -0
- package/packages/pm-calendar/extensions/calendar/manifest.json +7 -0
- package/packages/pm-calendar/extensions/calendar/runtime.js +95 -0
- package/packages/pm-calendar/extensions/calendar/runtime.ts +104 -0
- package/packages/pm-calendar/package.json +51 -0
- package/packages/pm-governance-audit/README.md +23 -0
- package/packages/pm-governance-audit/extensions/governance-audit/index.js +117 -0
- package/packages/pm-governance-audit/extensions/governance-audit/index.ts +118 -0
- package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +7 -0
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +159 -0
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +176 -0
- package/packages/pm-governance-audit/package.json +52 -0
- package/packages/pm-guide-shell/README.md +23 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.js +76 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +81 -0
- package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +7 -0
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +263 -0
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +327 -0
- package/packages/pm-guide-shell/package.json +52 -0
- package/packages/pm-linked-test-adapters/README.md +24 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.js +101 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.ts +102 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +7 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +142 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +173 -0
- package/packages/pm-linked-test-adapters/package.json +53 -0
- package/packages/pm-search-advanced/README.md +27 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +93 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +94 -0
- package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +7 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +120 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +144 -0
- package/packages/pm-search-advanced/package.json +54 -0
- package/packages/pm-templates/README.md +20 -0
- package/packages/pm-templates/extensions/templates/index.js +101 -0
- package/packages/pm-templates/extensions/templates/index.ts +109 -0
- package/packages/pm-templates/extensions/templates/manifest.json +7 -0
- package/packages/pm-templates/extensions/templates/runtime.js +226 -0
- package/packages/pm-templates/extensions/templates/runtime.ts +283 -0
- package/packages/pm-templates/package.json +50 -0
- package/packages/pm-todos/README.md +11 -0
- package/packages/pm-todos/extensions/todos/index.js +130 -0
- package/{.agents/pm/extensions/todos/index.js → packages/pm-todos/extensions/todos/index.ts} +47 -23
- package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.js +3 -18
- package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.ts +42 -20
- package/packages/pm-todos/package.json +51 -0
- package/plugins/pm-cli-claude/README.md +1 -2
- package/plugins/pm-cli-claude/hooks/session-start.mjs +4 -55
- package/plugins/pm-cli-claude/scripts/pm-mcp-server.mjs +4 -2
- package/plugins/pm-cli-codex/scripts/pm-mcp-server.mjs +4 -2
- package/.agents/pm/extensions/.managed-extensions.json +0 -42
- package/.agents/skills/HARNESS_COMPATIBILITY.md +0 -45
- package/.agents/skills/README.md +0 -21
- package/.agents/skills/pm-developer/SKILL.md +0 -73
- package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +0 -48
- package/.agents/skills/pm-developer/references/PROMPTS.md +0 -17
- package/.agents/skills/pm-extensions/SKILL.md +0 -57
- package/.agents/skills/pm-extensions/references/LIFECYCLE.md +0 -40
- package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +0 -25
- package/.agents/skills/pm-sdk/SKILL.md +0 -50
- package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +0 -31
- package/.agents/skills/pm-sdk/references/PROMPTS.md +0 -13
- package/.agents/skills/pm-user/SKILL.md +0 -59
- package/.agents/skills/pm-user/references/PROMPTS.md +0 -17
- package/.agents/skills/pm-user/references/WORKFLOWS.md +0 -35
- package/.pi/README.md +0 -35
- package/.pi/agents/pm-triage-agent.md +0 -19
- package/.pi/agents/pm-verification-agent.md +0 -21
- package/.pi/chains/pm-native-delivery.chain.md +0 -11
- package/.pi/extensions/pm-cli/index.js +0 -387
- package/.pi/prompts/pm-workflow.md +0 -5
- package/.pi/skills/pm-native/SKILL.md +0 -44
- package/.pi/skills/pm-release/SKILL.md +0 -35
- package/dist/pi/native.d.ts +0 -5
- package/dist/pi/native.js +0 -236
- package/dist/pi/native.js.map +0 -1
- package/docs/PI_PACKAGE.md +0 -141
- /package/{.agents/pm → packages/pm-beads}/extensions/beads/manifest.json +0 -0
- /package/{.agents/pm → packages/pm-todos}/extensions/todos/manifest.json +0 -0
package/dist/cli/help-content.js
CHANGED
|
@@ -95,28 +95,22 @@ const HELP_BY_COMMAND_PATH = {
|
|
|
95
95
|
],
|
|
96
96
|
},
|
|
97
97
|
extension: {
|
|
98
|
-
why: "
|
|
99
|
-
examples: [
|
|
100
|
-
"pm
|
|
101
|
-
"pm
|
|
102
|
-
"pm
|
|
103
|
-
"pm
|
|
104
|
-
"pm
|
|
105
|
-
"pm
|
|
98
|
+
why: "Compatibility command for package-backed runtime extension lifecycle operations across project or global scope.",
|
|
99
|
+
examples: [
|
|
100
|
+
"pm install ./my-package --project",
|
|
101
|
+
"pm install '*' --project",
|
|
102
|
+
"pm package doctor --project --detail summary",
|
|
103
|
+
"pm package manage --global",
|
|
104
|
+
"pm package activate sample-ext --project",
|
|
105
|
+
"pm package deactivate sample-ext --project",
|
|
106
|
+
"pm package uninstall sample-ext --global",
|
|
106
107
|
"pm extension explore --project",
|
|
107
108
|
"pm extension manage --global",
|
|
108
109
|
"pm extension doctor --detail deep",
|
|
109
|
-
"pm extension adopt sample-ext --project",
|
|
110
|
-
"pm extension adopt-all --project",
|
|
111
|
-
"pm extension adopt sample-ext --project --gh owner/repo/path --ref main",
|
|
112
|
-
"pm extension activate sample-ext --project",
|
|
113
|
-
"pm extension deactivate sample-ext --project",
|
|
114
|
-
"pm extension uninstall sample-ext --global",
|
|
115
|
-
"pm extension --install beads --project",
|
|
116
110
|
],
|
|
117
111
|
tips: [
|
|
118
|
-
"Prefer
|
|
119
|
-
"
|
|
112
|
+
"Prefer pm install and pm package in new user-facing automation.",
|
|
113
|
+
"Use pm extension when maintaining existing extension-specific scripts or debugging the compatibility runtime directly.",
|
|
120
114
|
"Bundled aliases beads and todos resolve to package-shipped extension sources.",
|
|
121
115
|
"Use --gh/--github shorthand for GitHub sources and --ref to pin a branch, tag, or ref.",
|
|
122
116
|
"Install updates settings activation state automatically unless extension allowlist mode is unchanged.",
|
|
@@ -125,6 +119,47 @@ const HELP_BY_COMMAND_PATH = {
|
|
|
125
119
|
"Use --doctor for consolidated diagnostics with warning codes, remediation hints, and optional deep detail payloads.",
|
|
126
120
|
],
|
|
127
121
|
},
|
|
122
|
+
package: {
|
|
123
|
+
why: "Installs, explores, manages, diagnoses, adopts, activates, deactivates, and refreshes package-backed pm runtime extensions.",
|
|
124
|
+
examples: [
|
|
125
|
+
"pm install npm:@scope/pm-package --project",
|
|
126
|
+
"pm package install ./my-package --project",
|
|
127
|
+
"pm package doctor --project --detail deep",
|
|
128
|
+
"pm package manage --project --runtime-probe",
|
|
129
|
+
"pm package activate sample-ext --project",
|
|
130
|
+
"pm upgrade --packages-only --dry-run",
|
|
131
|
+
],
|
|
132
|
+
tips: [
|
|
133
|
+
"Prefer package vocabulary for user-facing workflows; extension vocabulary remains available for compatibility.",
|
|
134
|
+
"Use pm upgrade to refresh the CLI/SDK and managed packages from their recorded sources.",
|
|
135
|
+
"Use --dry-run before upgrade when automation needs a deterministic plan.",
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
install: {
|
|
139
|
+
why: "Installs a pm package into project scope by default, using local, npm, GitHub, or bundled alias sources.",
|
|
140
|
+
examples: [
|
|
141
|
+
"pm install '*' --project",
|
|
142
|
+
"pm install ./packages/pm-todos --project",
|
|
143
|
+
"pm install npm:@scope/pm-package --global",
|
|
144
|
+
"pm install --github org/repo/packages/my-pm-package --ref main",
|
|
145
|
+
],
|
|
146
|
+
tips: ["Installed packages are recorded in managed state and can be inspected with pm package manage."],
|
|
147
|
+
},
|
|
148
|
+
upgrade: {
|
|
149
|
+
why: "Updates the global pm CLI/SDK and refreshes managed pm packages from recorded install sources.",
|
|
150
|
+
examples: [
|
|
151
|
+
"pm upgrade --dry-run",
|
|
152
|
+
"pm upgrade --packages-only --project",
|
|
153
|
+
"pm upgrade todos --dry-run",
|
|
154
|
+
"pm upgrade --cli-only --repair",
|
|
155
|
+
"pm upgrade --tag next --dry-run",
|
|
156
|
+
],
|
|
157
|
+
tips: [
|
|
158
|
+
"Omit target to include the CLI/SDK plus all managed packages in the selected scope.",
|
|
159
|
+
"Pass a target to refresh one managed package by name, directory, package name, or source.",
|
|
160
|
+
"Use --packages-only in repository automation when the global CLI should not be changed.",
|
|
161
|
+
],
|
|
162
|
+
},
|
|
128
163
|
create: {
|
|
129
164
|
why: "Creates a new planning item with deterministic metadata and history.",
|
|
130
165
|
examples: [
|
|
@@ -312,7 +347,11 @@ const HELP_BY_COMMAND_PATH = {
|
|
|
312
347
|
},
|
|
313
348
|
reindex: {
|
|
314
349
|
why: "Rebuilds search artifacts after large changes to item corpus or provider/vector config.",
|
|
315
|
-
examples: ["pm reindex --mode keyword", "pm reindex --mode hybrid"],
|
|
350
|
+
examples: ["pm reindex --mode keyword", "pm reindex --mode hybrid --progress --json"],
|
|
351
|
+
tips: [
|
|
352
|
+
"Use --progress for non-interactive visibility during local embedding runs.",
|
|
353
|
+
"JSON output includes semantic stale/unchanged/embed/upsert counts so agents can gate long reindex work without parsing stderr.",
|
|
354
|
+
],
|
|
316
355
|
},
|
|
317
356
|
get: {
|
|
318
357
|
why: "Shows complete details for one item by ID.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-content.js","sourceRoot":"/","sources":["cli/help-content.ts"],"names":[],"mappings":"AAiBA,SAAS,uBAAuB,CAAC,MAAkB;IACjD,MAAM,KAAK,GAAa;QACtB,EAAE;QACF,SAAS;QACT,KAAK,MAAM,CAAC,GAAG,EAAE;KAClB,CAAC;IACF,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,0CAA0C,CAAC,CAAC;IAC3D,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,wBAAwB,CAAC,MAAkB;IAClD,MAAM,KAAK,GAAa;QACtB,EAAE;QACF,uBAAuB;QACvB,KAAK,MAAM,CAAC,GAAG,EAAE;QACjB,EAAE;QACF,WAAW;QACX,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC;KACpD,CAAC;IACF,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,O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,KAAK,CAAC,CAAC,CAAC;IACzF,MAAM,UAAU,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC7E,KAAK,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;QACzE,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC","sourcesContent":["import { Command } from \"commander\";\n\nexport interface HelpBundle {\n why: string;\n examples: string[];\n tips?: string[];\n}\n\nexport interface HelpNarrative {\n intent: string;\n examples: string[];\n tips: string[];\n detail_mode: HelpDetailMode;\n}\n\nexport type HelpDetailMode = \"compact\" | \"detailed\";\n\nfunction renderCompactHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Intent:\",\n ` ${bundle.why}`,\n ];\n if (bundle.examples.length > 0) {\n lines.push(\"\", \"Example:\");\n lines.push(` ${bundle.examples[0]}`);\n }\n lines.push(\"\", \"Need deeper rationale and more examples?\");\n lines.push(\" Re-run with --explain.\");\n return lines.join(\"\\n\");\n}\n\nfunction renderDetailedHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Why use this command:\",\n ` ${bundle.why}`,\n \"\",\n \"Examples:\",\n ...bundle.examples.map((example) => ` ${example}`),\n ];\n if (bundle.tips && bundle.tips.length > 0) {\n lines.push(\"\", \"Tips:\");\n lines.push(...bundle.tips.map((tip) => ` - ${tip}`));\n }\n return lines.join(\"\\n\");\n}\n\nfunction renderHelpBundle(bundle: HelpBundle, detailMode: HelpDetailMode): string {\n if (detailMode === \"detailed\") {\n return renderDetailedHelpBundle(bundle);\n }\n return renderCompactHelpBundle(bundle);\n}\n\nexport function normalizeHelpCommandPath(commandPath: string): string {\n return commandPath\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nconst HELP_PATH_ALIASES: Record<string, string> = {\n cal: \"calendar\",\n ctx: \"context\",\n};\n\nfunction findDirectChildCommand(parent: Command, name: string): Command | null {\n return parent.commands.find((entry) => entry.name() === name) ?? null;\n}\n\nfunction findCommandByPath(root: Command, pathParts: string[]): Command | null {\n let current: Command = root;\n for (const part of pathParts) {\n const next = findDirectChildCommand(current, part);\n if (!next) {\n return null;\n }\n current = next;\n }\n return current;\n}\n\nfunction attachBundleByPath(root: Command, commandPath: string, bundle: HelpBundle, detailMode: HelpDetailMode): void {\n const command = findCommandByPath(root, commandPath.split(\" \").filter((part) => part.length > 0));\n if (!command) {\n return;\n }\n command.addHelpText(\"after\", renderHelpBundle(bundle, detailMode));\n}\n\nexport function resolveHelpDetailMode(argv: string[]): HelpDetailMode {\n if (argv.includes(\"--explain\")) {\n return \"detailed\";\n }\n return \"compact\";\n}\n\nconst HELP_BY_COMMAND_PATH: Record<string, HelpBundle> = {\n init: {\n why: \"Bootstraps tracker storage and settings so all other commands can run safely.\",\n examples: ['pm init', 'pm init acme', \"pm init --preset minimal\", \"pm init --preset strict\"],\n tips: [\n \"Run this once per repository before create/list/update commands.\",\n \"Use --preset for non-interactive automation; omit it in a TTY to use the setup wizard.\",\n ],\n },\n config: {\n why: \"Reads or updates project/global settings such as definition-of-done, item format, telemetry, and policy toggles.\",\n examples: [\n 'pm config project get definition-of-done',\n 'pm config project set definition-of-done --criterion \"tests pass\"',\n \"pm config project set item-format --format toon\",\n \"pm config project set sprint-release-format-policy --policy strict_error\",\n \"pm config project set governance-preset --policy minimal\",\n \"pm config project set governance-ownership-enforcement --policy none\",\n \"pm config project set test-result-tracking --policy enabled\",\n \"pm config global set telemetry-tracking --policy disabled\",\n ],\n },\n extension: {\n why:\n \"Installs, explores, manages, diagnoses, adopts (single or bulk), and activates/deactivates custom extensions across project or global scope.\",\n examples: [\n \"pm extension init ./my-extension\",\n \"pm extension install beads --project\",\n \"pm extension install todos --global\",\n \"pm extension install .agents/pm/extensions/sample --project\",\n \"pm extension install https://github.com/unbraind/pm-cli/tree/main/.agents/pm/extensions/pi --global\",\n \"pm extension install --gh unbraind/pm-cli/pi --project\",\n \"pm extension explore --project\",\n \"pm extension manage --global\",\n \"pm extension doctor --detail deep\",\n \"pm extension adopt sample-ext --project\",\n \"pm extension adopt-all --project\",\n \"pm extension adopt sample-ext --project --gh owner/repo/path --ref main\",\n \"pm extension activate sample-ext --project\",\n \"pm extension deactivate sample-ext --project\",\n \"pm extension uninstall sample-ext --global\",\n \"pm extension --install beads --project\",\n ],\n tips: [\n \"Prefer explicit subcommands (init/scaffold/install/uninstall/explore/manage/doctor/adopt/adopt-all/activate/deactivate) for discoverability.\",\n \"Legacy lifecycle flags remain supported as backward-compatible aliases.\",\n \"Bundled aliases beads and todos resolve to package-shipped extension sources.\",\n \"Use --gh/--github shorthand for GitHub sources and --ref to pin a branch, tag, or ref.\",\n \"Install updates settings activation state automatically unless extension allowlist mode is unchanged.\",\n \"Use --adopt for single-extension adoption and --adopt-all to bulk-register unmanaged installs as managed without reinstalling.\",\n \"Use --manage for concise triage summaries and remediation-oriented diagnostics alongside full extension details.\",\n \"Use --doctor for consolidated diagnostics with warning codes, remediation hints, and optional deep detail payloads.\",\n ],\n },\n create: {\n why: \"Creates a new planning item with deterministic metadata and history.\",\n examples: [\n 'pm create --title \"Harden lock flow\" --description \"Improve stale lock handling\" --type Task --status open --priority 1 --message \"Create lock hardening task\" --create-mode progressive',\n 'pm create --title \"Weekly planning sync\" --description \"Recurring coordination meeting\" --type Meeting --schedule-preset lightweight',\n 'pm create --title \"Asset: Hero model\" --description \"Track playable model asset\" --type Asset --status open --priority 1 --message \"Create asset item\" --type-option category=Character --dep \"id=pm-epic01,kind=parent,author=codex-agent,created_at=now\" --comment \"author=codex-agent,created_at=now,text=Why this asset item exists.\" --note \"author=codex-agent,created_at=now,text=Initial implementation note.\" --learning \"author=codex-agent,created_at=now,text=Durable lesson placeholder.\" --file \"path=src/assets/hero.glb,scope=project,note=tracked asset\" --test \"command=node scripts/run-tests.mjs test,scope=project,timeout_seconds=240\" --doc \"path=README.md,scope=project,note=asset docs\"',\n ],\n tips: [\n \"Use --schedule-preset lightweight for Reminder/Meeting/Event when you want minimal required create inputs.\",\n \"Use --type <value> to load type-aware policy guidance in --help output.\",\n ],\n },\n update: {\n why: \"Mutates existing item fields while preserving history and lock safety.\",\n examples: [\n 'pm update pm-a1b2 --status in_progress --message \"Start implementation\"',\n 'pm update pm-a1b2 --unset close-reason --message \"Clear stale close reason after reopen\"',\n 'pm update pm-a1b2 --unset assignee --deadline +2d --message \"Replan ownership and deadline\"',\n 'pm update pm-a1b2 --body \"Backfilled body text for legacy item\" --message \"Normalize missing body\"',\n ],\n tips: [\n 'Use \"pm close <ID> <TEXT>\" to close items instead of --status closed.',\n \"When reopening from closed to a non-terminal status, update clears stale close_reason unless explicitly set via --close-reason.\",\n 'Use \"pm append <ID> --body <text>\" for additive notes; use update --body to replace body content.',\n ],\n },\n \"update-many\": {\n why: \"Bulk-updates matched item sets with dry-run previews and rollback checkpoints for safe large-scale metadata changes.\",\n examples: [\n \"pm update-many --filter-status open --status in_progress --dry-run\",\n 'pm update-many --filter-tag wave:7 --replace-tests --test \"command=node scripts/run-tests.mjs test -- tests/core/history.spec.ts,scope=project,timeout_seconds=240\"',\n 'pm update-many --filter-tag governance --reviewer maintainer-review --message \"Normalize reviewer metadata\"',\n \"pm update-many --rollback ckpt-abc123\",\n ],\n tips: [\n \"Use --dry-run first to inspect proposed changes before apply mode.\",\n \"Linked-array mutation flags mirror pm update semantics (for example --replace-tests, --clear-files, and repeatable --doc/--note seeds).\",\n \"Checkpoints are enabled by default for apply mode and can be restored with --rollback.\",\n ],\n },\n normalize: {\n why:\n \"Scans items for low-signal lifecycle metadata drift, emits deterministic per-item plans, and optionally applies normalized metadata updates with update-style safety checks.\",\n examples: [\n \"pm normalize --dry-run\",\n \"pm normalize --filter-status in_progress --dry-run\",\n 'pm normalize --filter-status closed --apply --author \"codex-agent\" --message \"Normalize closure metadata\"',\n ],\n tips: [\n \"Dry-run mode is the default; pass --apply only after reviewing planned changes.\",\n \"Apply mode honors ownership/audit constraints and supports --allow-audit-update with optional --force override.\",\n ],\n },\n templates: {\n why: \"Saves, lists, and inspects reusable create option bundles for repeatable workflows.\",\n examples: [\n 'pm templates save triage-default --title \"Triage item\" --description \"...\" --type Task --status open --priority 2 --message \"Seed triage template\"',\n \"pm templates list\",\n \"pm templates show triage-default\",\n ],\n tips: [\n \"Template names are positional arguments (`pm templates save <name>` and `pm templates show <name>`), not --name flags.\",\n \"Combine templates with explicit create flags; explicit flags always override template defaults.\",\n ],\n },\n deps: {\n why: \"Inspects an item dependency graph as a tree or graph payload to understand blockers and hierarchy links.\",\n examples: [\n \"pm deps pm-a1b2\",\n \"pm deps pm-a1b2 --format graph\",\n \"pm deps pm-a1b2 --max-depth 2 --collapse repeated --summary\",\n ],\n tips: [\"Use --summary for lightweight counts when full graph payloads are unnecessary.\"],\n },\n list: {\n why: \"Lists active items with deterministic filtering and ordering.\",\n examples: [\n \"pm list --limit 20\",\n \"pm list --type Task --priority 0 --tag release --assignee codex-agent\",\n \"pm list --compact --sort deadline --order asc\",\n \"pm list --fields id,title,parent,type --sort parent --order asc\",\n ],\n },\n \"list-all\": {\n why: \"Lists all item states (including terminal states) when you need full visibility.\",\n examples: [\"pm list-all --limit 50\", \"pm list-all --type Issue --include-body\"],\n },\n \"list-open\": {\n why: \"Shows work that is ready to claim and start.\",\n examples: [\"pm list-open --priority 0 --limit 10\"],\n },\n \"list-in-progress\": {\n why: \"Tracks active execution and owner progress.\",\n examples: [\"pm list-in-progress --assignee codex-agent --limit 20\"],\n },\n \"list-blocked\": {\n why: \"Surfaces blocked work that needs intervention.\",\n examples: [\"pm list-blocked --limit 20\"],\n },\n \"list-closed\": {\n why: \"Reviews completed work and closure outcomes.\",\n examples: [\"pm list-closed --limit 20 --type Task\"],\n },\n \"list-canceled\": {\n why: \"Audits intentionally discontinued work.\",\n examples: [\"pm list-canceled --limit 20\"],\n },\n \"list-draft\": {\n why: \"Finds incompletely defined items that need refinement before execution.\",\n examples: [\"pm list-draft --limit 20\"],\n },\n aggregate: {\n why: \"Runs grouped aggregation queries for governance checks such as decomposition by parent/type or triage by status/priority.\",\n examples: [\n \"pm aggregate --group-by parent,type --count\",\n \"pm aggregate --group-by type,status --count\",\n \"pm aggregate --group-by parent,type --count --status open --parent pm-feature01\",\n ],\n tips: [\"Current aggregate mode is grouped counts only, so pass --count explicitly.\"],\n },\n \"dedupe-audit\": {\n why: \"Audits potential duplicate items and emits deterministic merge suggestions before any mutation.\",\n examples: [\n \"pm dedupe-audit --mode title_exact\",\n \"pm dedupe-audit --mode title_fuzzy --threshold 0.8 --limit 20\",\n \"pm dedupe-audit --mode parent_scope --status open\",\n ],\n tips: [\"Use title_exact for strict collisions, title_fuzzy for near-duplicates, and parent_scope for child-level collisions.\"],\n },\n guide: {\n why: \"Routes local progressive-disclosure documentation so agents can fetch only the context they need.\",\n examples: [\n \"pm guide\",\n \"pm guide quickstart\",\n \"pm guide commands --depth standard\",\n \"pm guide skills --depth deep --format markdown\",\n \"pm guide release --json\",\n ],\n tips: [\n \"Use brief depth for minimal token footprint, standard for excerpted docs, and deep for full local document rendering.\",\n \"Use --list to force topic index output even when topic parsing is ambiguous.\",\n ],\n },\n calendar: {\n why: \"Provides deadline/reminder/event scheduling views for planning and coordination.\",\n examples: [\n \"pm calendar\",\n \"pm calendar --view agenda --from +0d --to +7d --assignee codex-agent\",\n \"pm calendar --view week --date 2026-04-06 --full-period --include deadlines,events\",\n \"pm calendar --view month --tag release --format json\",\n ],\n tips: [\n \"Day/week/month views are anchored period windows; default mode clips the start to now unless --past or --full-period is set.\",\n \"--full-period applies only to day/week/month views; use --from/--to to bound agenda windows.\",\n ],\n },\n context: {\n why: \"Builds an agent-optimized snapshot of critical active work plus near-term agenda context with progressive depth levels.\",\n examples: [\n \"pm context\",\n \"pm ctx --depth standard --limit 10\",\n \"pm ctx --depth deep --assignee codex-agent\",\n \"pm ctx --section hierarchy --section progress --section blockers\",\n \"pm context --depth standard --activity-limit 20 --stale-threshold 14d\",\n \"pm context --from +0d --to +7d --format markdown --depth deep\",\n ],\n tips: [\n \"High-level focus contains Epics/Features and low-level focus contains Tasks/Issues/Chores/Event/Reminder/Milestone/Meeting.\",\n \"When no open or in-progress work exists, blocked items are shown as fallback context.\",\n \"--depth brief (default) shows focus+agenda; standard adds hierarchy/activity/progress/workload; deep adds blockers/files/staleness/tests.\",\n \"--section overrides --depth and selects specific sections: hierarchy, activity, progress, blockers, files, workload, staleness, tests.\",\n \"Configure defaults via pm config project set context --default-depth standard --activity-limit 15.\",\n ],\n },\n search: {\n why: \"Finds relevant items by keyword, semantic, or hybrid retrieval modes.\",\n examples: [\n 'pm search \"lock stale retry\" --mode keyword --limit 10',\n 'pm search \"extension migration blockers\" --mode hybrid --type Task --priority 0',\n 'pm search \"Cross-Epic Realism Dependency Council\" --mode keyword --title-exact',\n ],\n tips: [\n \"Use --title-exact to require exact normalized title parity, or --phrase-exact to require full-phrase matches in item text fields.\",\n \"Use --include-linked when linked docs/files/tests should influence scoring.\",\n ],\n },\n reindex: {\n why: \"Rebuilds search artifacts after large changes to item corpus or provider/vector config.\",\n examples: [\"pm reindex --mode keyword\", \"pm reindex --mode hybrid\"],\n },\n get: {\n why: \"Shows complete details for one item by ID.\",\n examples: [\"pm get pm-a1b2\", \"pm get pm-a1b2 --json\"],\n tips: [\"JSON output shape is { item, body, linked, claim_state }; body is top-level (not item.body).\"],\n },\n history: {\n why: \"Inspects item mutation timeline and audit trail.\",\n examples: [\"pm history pm-a1b2 --limit 20\"],\n },\n activity: {\n why: \"Reviews recent tracker-wide activity across items.\",\n examples: [\n \"pm activity --limit 50\",\n \"pm activity --id pm-a1b2 --op update --author codex-agent --from -7d --to now\",\n \"pm activity --json --stream rows --limit 200\",\n ],\n tips: [\"Use --stream with --json for line-delimited automation output; --from is inclusive and --to is exclusive.\"],\n },\n restore: {\n why: \"Restores an item to a prior timestamp/version with history replay safety.\",\n examples: ['pm restore pm-a1b2 2026-04-01T00:00:00.000Z --author \"codex-agent\" --message \"Rollback to known-good state\"'],\n },\n close: {\n why: \"Transitions work to terminal closed state with explicit rationale.\",\n examples: [\n 'pm close pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close after verification\"',\n 'pm close pm-a1b2 \"Done\" --validate-close',\n 'pm close pm-a1b2 \"Done\" --validate-close off',\n 'pm close pm-a1b2 \"Done\" --validate-close strict',\n ],\n },\n delete: {\n why: \"Removes an item while preserving history evidence and lock/ownership checks.\",\n examples: ['pm delete pm-a1b2 --author \"codex-agent\" --message \"Remove duplicate item\"'],\n },\n append: {\n why: \"Adds implementation notes to body without replacing existing content.\",\n examples: ['pm append pm-a1b2 --body \"Implemented retry with bounded backoff.\" --message \"Record implementation detail\"'],\n },\n comments: {\n why: \"Adds or reviews lightweight status updates linked to an item.\",\n examples: [\n 'pm comments pm-a1b2 \"Verified fix on Linux and macOS\"',\n 'pm comments pm-a1b2 --add \"Verified fix on Linux and macOS\"',\n 'printf \"%s\\\\n\" \"## Verification\" \"- linux pass\" \"- mac pass\" | pm comments pm-a1b2 --stdin',\n 'pm comments pm-a1b2 --file docs/release-evidence.md --author \"codex-agent\"',\n 'pm comments pm-a1b2 --add \"text: verification note with commas, key-like words, and parser details\"',\n 'pm comments pm-a1b2 --add \"Follow-up needed after review\" --author \"codex-agent\" --force',\n \"pm comments pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use exactly one comment source at a time: positional [text], --add, --stdin, or --file.\",\n \"Use --force when adding comments to items currently assigned to a different owner.\",\n \"When --add payload resembles CSV-like key fragments (for example text=hello,scope:project), plain-text fallback is intentional; use explicit text=..., markdown text: ..., or stdin token - for structured intent.\",\n ],\n },\n \"comments-audit\": {\n why: \"Audits latest comments or full history rows across filtered item sets.\",\n examples: [\n \"pm comments-audit --status open --latest 1\",\n \"pm comments-audit --status open --latest 0\",\n \"pm comments-audit --parent pm-feature01 --tag governance --sprint sprint-12 --release vnext --priority 0\",\n \"pm comments-audit --full-history --limit 50\",\n ],\n tips: [\n \"Use either --latest or --full-history (not both). --latest 0 returns item summaries without comment rows. --limit is an alias for --limit-items.\",\n ],\n },\n notes: {\n why: \"Adds or reviews durable implementation notes linked to an item.\",\n examples: [\n 'pm notes pm-a1b2 --add \"Investigated parser edge case and documented fallback logic.\"',\n 'pm notes pm-a1b2 --add \"text: parser rationale with commas, colons, and key-like wording\"',\n 'pm notes pm-a1b2 --add \"Audit note\" --author \"reviewer\" --allow-audit-note',\n \"pm notes pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-note for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"CSV-like add payloads with extra key fragments are treated as plain text by design; use explicit text keys (text= or text:) when structured parsing is required.\",\n ],\n },\n learnings: {\n why: \"Adds or reviews post-implementation learnings for future work.\",\n examples: [\n 'pm learnings pm-a1b2 --add \"Avoid direct test-runner commands in linked tests; use sandbox runner.\"',\n 'pm learnings pm-a1b2 --add \"text: lesson with commas, key-like words, and punctuation-safe context\"',\n 'pm learnings pm-a1b2 --add \"Audit learning\" --author \"reviewer\" --allow-audit-learning',\n \"pm learnings pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-learning for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"If you intended structured parsing for a key-like payload, prefer explicit text=..., markdown text: ..., or stdin token -; ambiguous CSV-like forms intentionally remain plain text.\",\n ],\n },\n files: {\n why: \"Associates changed source files with tracker items for reproducibility.\",\n examples: [\n 'pm files pm-a1b2 --add \"path=src/cli/main.ts,scope=project,note=help orchestration\"',\n \"pm files discover pm-a1b2\",\n 'pm files discover pm-a1b2 --apply --note \"discovered from item text\"',\n ],\n },\n docs: {\n why: \"Associates relevant documentation paths with tracker items.\",\n examples: ['pm docs pm-a1b2 --add \"path=README.md,scope=project,note=user-facing command guidance\"'],\n },\n test: {\n why: \"Links test commands/paths and optionally executes them for one item.\",\n examples: [\n 'pm test pm-a1b2 --add \"command=node scripts/run-tests.mjs test -- tests/unit/output.spec.ts,scope=project,timeout_seconds=2400\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,scope=project,assert_stdout_contains=count:,assert_stdout_regex=count:\\\\s+\\\\d+\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,scope=project,pm_context_mode=auto\"',\n \"pm test pm-a1b2 --run --timeout 2400 --env-set PORT=0 --env-clear PLAYWRIGHT_BASE_URL --shared-host-safe --pm-context tracker --fail-on-context-mismatch --fail-on-skipped\",\n \"pm test pm-a1b2 --run --timeout 2400 --pm-context auto\",\n \"pm test pm-a1b2 --run --background --timeout 2400 --progress\",\n ],\n },\n \"test-all\": {\n why: \"Runs linked tests in bulk for release/readiness sweeps.\",\n examples: [\n \"pm test-all --status in_progress --limit 5 --offset 10 --timeout 2400\",\n \"pm test-all --status closed --timeout 3600 --progress --env-set PORT=0 --shared-host-safe --fail-on-skipped\",\n \"pm test-all --status in_progress --pm-context tracker --fail-on-context-mismatch --require-assertions-for-pm\",\n \"pm test-all --status in_progress --pm-context auto --fail-on-context-mismatch\",\n \"pm test-all --status in_progress --background --timeout 3600\",\n ],\n },\n \"test-runs\": {\n why: \"Manages background linked-test runs with lifecycle controls and log/status inspection.\",\n examples: [\n \"pm test-runs list --status running --limit 20\",\n \"pm test-runs status tr-abc123\",\n \"pm test-runs logs tr-abc123 --stream stderr --tail 200\",\n \"pm test-runs stop tr-abc123\",\n \"pm test-runs resume tr-abc123\",\n ],\n },\n stats: {\n why: \"Reports tracker-level totals and distribution by type/status.\",\n examples: [\"pm stats\", \"pm stats --json\"],\n },\n health: {\n why: \"Validates tracker/runtime health including extension triage, migration, and integrity diagnostics.\",\n examples: [\"pm health\", \"pm health --json\", \"pm health --check-only\", \"pm health --no-refresh\", \"pm health --refresh-vectors\"],\n },\n validate: {\n why:\n \"Runs standalone metadata, resolution, lifecycle (including dependency-cycle diagnostics), linked-file, linked-command reference, and history drift checks with default remediation hints for resolution gaps.\",\n examples: [\n \"pm validate\",\n \"pm validate --check-resolution --json\",\n \"pm validate --check-lifecycle --dependency-cycle-severity error\",\n \"pm validate --check-files --scan-mode tracked-all\",\n \"pm validate --check-files --scan-mode tracked-all-strict --include-pm-internals\",\n \"pm validate --check-command-references\",\n \"pm validate --check-resolution --fail-on-warn --json\",\n ],\n tips: [\"Resolution-gap warnings include default `pm update <id> ...` remediation hint templates in check details.\"],\n },\n gc: {\n why: \"Cleans optional cache artifacts to keep local tracker state tidy.\",\n examples: [\"pm gc\"],\n },\n claim: {\n why: \"Claims an item to signal active ownership and reduce conflicts.\",\n examples: [\n 'pm claim pm-a1b2 --author \"codex-agent\" --message \"Claim for implementation\"',\n 'pm claim pm-a1b2 --force --author \"codex-agent\" --message \"Take over terminal item\"',\n ],\n tips: [\"Claim takeover for non-terminal items does not require --force; --force is reserved for terminal/lock overrides.\"],\n },\n release: {\n why: \"Releases an active claim when paused, handed off, or completed.\",\n examples: [\n 'pm release pm-a1b2 --author \"codex-agent\" --message \"Release after closure\"',\n 'pm release pm-a1b2 --allow-audit-release --author \"reviewer\" --message \"Audit handoff release\"',\n ],\n tips: [\"Use --allow-audit-release for non-owner handoffs that only clear assignee metadata.\"],\n },\n \"start-task\": {\n why: \"Lifecycle alias that claims an item and sets status to in_progress.\",\n examples: ['pm start-task pm-a1b2 --author \"codex-agent\" --message \"Start implementation\"'],\n },\n \"pause-task\": {\n why: \"Lifecycle alias that sets status to open and releases active assignment.\",\n examples: ['pm pause-task pm-a1b2 --author \"codex-agent\" --message \"Pause for dependency unblock\"'],\n },\n \"close-task\": {\n why: \"Lifecycle alias that closes with reason text and clears assignment metadata.\",\n examples: ['pm close-task pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close and handoff\"'],\n },\n completion: {\n why: \"Generates shell completion scripts for faster and more reliable command entry.\",\n examples: [\"pm completion bash\", \"pm completion zsh\", \"pm completion fish\", \"pm completion bash --eager-tags\"],\n tips: [\"Default scripts resolve tag suggestions lazily at completion time; use --eager-tags to embed current tags directly.\"],\n },\n contracts: {\n why: \"Exposes machine-readable CLI command and tool schema contracts for agent integrations.\",\n examples: [\n \"pm contracts\",\n \"pm contracts --command list --runtime-only\",\n \"pm contracts --command update --flags-only\",\n \"pm contracts --availability-only --runtime-only\",\n \"pm contracts --action create\",\n \"pm contracts --schema-only\",\n ],\n tips: [\"Use --command to narrow actions/schema to one CLI surface; combine with --flags-only or --availability-only for lighter payloads.\"],\n },\n};\n\nexport const ROOT_HELP_BUNDLE: HelpBundle = {\n why: \"Provides deterministic project management workflows for humans and coding agents.\",\n examples: [\n \"pm init\",\n \"pm guide\",\n \"pm list-open --limit 10\",\n 'pm create --title \"...\" --description \"...\" --type Task --status open --priority 1 --message \"...\" --create-mode progressive',\n ],\n tips: [\n \"Use <command> --help for command-specific guidance and examples.\",\n \"Use pm guide for local docs and skills routing with progressive disclosure.\",\n \"Use --json for machine parsing and integration flows.\",\n \"Use --no-pager to force direct help output in CI and other non-interactive shells.\",\n ],\n};\n\nfunction resolveCanonicalHelpPath(commandPath: string | undefined): string {\n const normalized = normalizeHelpCommandPath(commandPath ?? \"\");\n if (!normalized) {\n return \"\";\n }\n return HELP_PATH_ALIASES[normalized] ?? normalized;\n}\n\nexport function resolveHelpBundleForPath(commandPath: string | undefined): HelpBundle {\n const canonicalPath = resolveCanonicalHelpPath(commandPath);\n if (!canonicalPath) {\n return ROOT_HELP_BUNDLE;\n }\n return HELP_BY_COMMAND_PATH[canonicalPath] ?? ROOT_HELP_BUNDLE;\n}\n\nexport function resolveHelpNarrative(commandPath: string | undefined, detailMode: HelpDetailMode): HelpNarrative {\n const bundle = resolveHelpBundleForPath(commandPath);\n return {\n intent: bundle.why,\n examples: detailMode === \"detailed\" ? [...bundle.examples] : bundle.examples.length > 0 ? [bundle.examples[0]] : [],\n tips: detailMode === \"detailed\" ? [...(bundle.tips ?? [])] : [],\n detail_mode: detailMode,\n };\n}\n\nexport function listDocumentedHelpPaths(): string[] {\n return Object.keys(HELP_BY_COMMAND_PATH).sort((left, right) => left.localeCompare(right));\n}\n\nexport function attachRichHelpText(program: Command, argv: string[] = process.argv.slice(2)): void {\n const detailMode = resolveHelpDetailMode(argv);\n program.addHelpText(\"after\", renderHelpBundle(ROOT_HELP_BUNDLE, detailMode));\n for (const [commandPath, bundle] of Object.entries(HELP_BY_COMMAND_PATH)) {\n attachBundleByPath(program, commandPath, bundle, detailMode);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"help-content.js","sourceRoot":"/","sources":["cli/help-content.ts"],"names":[],"mappings":"AAiBA,SAAS,uBAAuB,CAAC,MAAkB;IACjD,MAAM,KAAK,GAAa;QACtB,EAAE;QACF,SAAS;QACT,KAAK,MAAM,CAAC,GAAG,EAAE;KAClB,CAAC;IACF,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,0CAA0C,CAAC,CAAC;IAC3D,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,wBAAwB,CAAC,MAAkB;IAClD,MAAM,KAAK,GAAa;QACtB,EAAE;QACF,uBAAuB;QACvB,KAAK,MAAM,CAAC,GAAG,EAAE;QACjB,EAAE;QACF,WAAW;QACX,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK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,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,GAAG;QAClB,QAAQ,EAAE,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QACnH,IAAI,EAAE,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QAC/D,WAAW,EAAE,UAAU;KACxB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,OAAO,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAgB,EAAE,OAAiB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACzF,MAAM,UAAU,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC7E,KAAK,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;QACzE,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC","sourcesContent":["import { Command } from \"commander\";\n\nexport interface HelpBundle {\n why: string;\n examples: string[];\n tips?: string[];\n}\n\nexport interface HelpNarrative {\n intent: string;\n examples: string[];\n tips: string[];\n detail_mode: HelpDetailMode;\n}\n\nexport type HelpDetailMode = \"compact\" | \"detailed\";\n\nfunction renderCompactHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Intent:\",\n ` ${bundle.why}`,\n ];\n if (bundle.examples.length > 0) {\n lines.push(\"\", \"Example:\");\n lines.push(` ${bundle.examples[0]}`);\n }\n lines.push(\"\", \"Need deeper rationale and more examples?\");\n lines.push(\" Re-run with --explain.\");\n return lines.join(\"\\n\");\n}\n\nfunction renderDetailedHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Why use this command:\",\n ` ${bundle.why}`,\n \"\",\n \"Examples:\",\n ...bundle.examples.map((example) => ` ${example}`),\n ];\n if (bundle.tips && bundle.tips.length > 0) {\n lines.push(\"\", \"Tips:\");\n lines.push(...bundle.tips.map((tip) => ` - ${tip}`));\n }\n return lines.join(\"\\n\");\n}\n\nfunction renderHelpBundle(bundle: HelpBundle, detailMode: HelpDetailMode): string {\n if (detailMode === \"detailed\") {\n return renderDetailedHelpBundle(bundle);\n }\n return renderCompactHelpBundle(bundle);\n}\n\nexport function normalizeHelpCommandPath(commandPath: string): string {\n return commandPath\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nconst HELP_PATH_ALIASES: Record<string, string> = {\n cal: \"calendar\",\n ctx: \"context\",\n};\n\nfunction findDirectChildCommand(parent: Command, name: string): Command | null {\n return parent.commands.find((entry) => entry.name() === name) ?? null;\n}\n\nfunction findCommandByPath(root: Command, pathParts: string[]): Command | null {\n let current: Command = root;\n for (const part of pathParts) {\n const next = findDirectChildCommand(current, part);\n if (!next) {\n return null;\n }\n current = next;\n }\n return current;\n}\n\nfunction attachBundleByPath(root: Command, commandPath: string, bundle: HelpBundle, detailMode: HelpDetailMode): void {\n const command = findCommandByPath(root, commandPath.split(\" \").filter((part) => part.length > 0));\n if (!command) {\n return;\n }\n command.addHelpText(\"after\", renderHelpBundle(bundle, detailMode));\n}\n\nexport function resolveHelpDetailMode(argv: string[]): HelpDetailMode {\n if (argv.includes(\"--explain\")) {\n return \"detailed\";\n }\n return \"compact\";\n}\n\nconst HELP_BY_COMMAND_PATH: Record<string, HelpBundle> = {\n init: {\n why: \"Bootstraps tracker storage and settings so all other commands can run safely.\",\n examples: ['pm init', 'pm init acme', \"pm init --preset minimal\", \"pm init --preset strict\"],\n tips: [\n \"Run this once per repository before create/list/update commands.\",\n \"Use --preset for non-interactive automation; omit it in a TTY to use the setup wizard.\",\n ],\n },\n config: {\n why: \"Reads or updates project/global settings such as definition-of-done, item format, telemetry, and policy toggles.\",\n examples: [\n 'pm config project get definition-of-done',\n 'pm config project set definition-of-done --criterion \"tests pass\"',\n \"pm config project set item-format --format toon\",\n \"pm config project set sprint-release-format-policy --policy strict_error\",\n \"pm config project set governance-preset --policy minimal\",\n \"pm config project set governance-ownership-enforcement --policy none\",\n \"pm config project set test-result-tracking --policy enabled\",\n \"pm config global set telemetry-tracking --policy disabled\",\n ],\n },\n extension: {\n why:\n \"Compatibility command for package-backed runtime extension lifecycle operations across project or global scope.\",\n examples: [\n \"pm install ./my-package --project\",\n \"pm install '*' --project\",\n \"pm package doctor --project --detail summary\",\n \"pm package manage --global\",\n \"pm package activate sample-ext --project\",\n \"pm package deactivate sample-ext --project\",\n \"pm package uninstall sample-ext --global\",\n \"pm extension explore --project\",\n \"pm extension manage --global\",\n \"pm extension doctor --detail deep\",\n ],\n tips: [\n \"Prefer pm install and pm package in new user-facing automation.\",\n \"Use pm extension when maintaining existing extension-specific scripts or debugging the compatibility runtime directly.\",\n \"Bundled aliases beads and todos resolve to package-shipped extension sources.\",\n \"Use --gh/--github shorthand for GitHub sources and --ref to pin a branch, tag, or ref.\",\n \"Install updates settings activation state automatically unless extension allowlist mode is unchanged.\",\n \"Use --adopt for single-extension adoption and --adopt-all to bulk-register unmanaged installs as managed without reinstalling.\",\n \"Use --manage for concise triage summaries and remediation-oriented diagnostics alongside full extension details.\",\n \"Use --doctor for consolidated diagnostics with warning codes, remediation hints, and optional deep detail payloads.\",\n ],\n },\n package: {\n why:\n \"Installs, explores, manages, diagnoses, adopts, activates, deactivates, and refreshes package-backed pm runtime extensions.\",\n examples: [\n \"pm install npm:@scope/pm-package --project\",\n \"pm package install ./my-package --project\",\n \"pm package doctor --project --detail deep\",\n \"pm package manage --project --runtime-probe\",\n \"pm package activate sample-ext --project\",\n \"pm upgrade --packages-only --dry-run\",\n ],\n tips: [\n \"Prefer package vocabulary for user-facing workflows; extension vocabulary remains available for compatibility.\",\n \"Use pm upgrade to refresh the CLI/SDK and managed packages from their recorded sources.\",\n \"Use --dry-run before upgrade when automation needs a deterministic plan.\",\n ],\n },\n install: {\n why: \"Installs a pm package into project scope by default, using local, npm, GitHub, or bundled alias sources.\",\n examples: [\n \"pm install '*' --project\",\n \"pm install ./packages/pm-todos --project\",\n \"pm install npm:@scope/pm-package --global\",\n \"pm install --github org/repo/packages/my-pm-package --ref main\",\n ],\n tips: [\"Installed packages are recorded in managed state and can be inspected with pm package manage.\"],\n },\n upgrade: {\n why: \"Updates the global pm CLI/SDK and refreshes managed pm packages from recorded install sources.\",\n examples: [\n \"pm upgrade --dry-run\",\n \"pm upgrade --packages-only --project\",\n \"pm upgrade todos --dry-run\",\n \"pm upgrade --cli-only --repair\",\n \"pm upgrade --tag next --dry-run\",\n ],\n tips: [\n \"Omit target to include the CLI/SDK plus all managed packages in the selected scope.\",\n \"Pass a target to refresh one managed package by name, directory, package name, or source.\",\n \"Use --packages-only in repository automation when the global CLI should not be changed.\",\n ],\n },\n create: {\n why: \"Creates a new planning item with deterministic metadata and history.\",\n examples: [\n 'pm create --title \"Harden lock flow\" --description \"Improve stale lock handling\" --type Task --status open --priority 1 --message \"Create lock hardening task\" --create-mode progressive',\n 'pm create --title \"Weekly planning sync\" --description \"Recurring coordination meeting\" --type Meeting --schedule-preset lightweight',\n 'pm create --title \"Asset: Hero model\" --description \"Track playable model asset\" --type Asset --status open --priority 1 --message \"Create asset item\" --type-option category=Character --dep \"id=pm-epic01,kind=parent,author=codex-agent,created_at=now\" --comment \"author=codex-agent,created_at=now,text=Why this asset item exists.\" --note \"author=codex-agent,created_at=now,text=Initial implementation note.\" --learning \"author=codex-agent,created_at=now,text=Durable lesson placeholder.\" --file \"path=src/assets/hero.glb,scope=project,note=tracked asset\" --test \"command=node scripts/run-tests.mjs test,scope=project,timeout_seconds=240\" --doc \"path=README.md,scope=project,note=asset docs\"',\n ],\n tips: [\n \"Use --schedule-preset lightweight for Reminder/Meeting/Event when you want minimal required create inputs.\",\n \"Use --type <value> to load type-aware policy guidance in --help output.\",\n ],\n },\n update: {\n why: \"Mutates existing item fields while preserving history and lock safety.\",\n examples: [\n 'pm update pm-a1b2 --status in_progress --message \"Start implementation\"',\n 'pm update pm-a1b2 --unset close-reason --message \"Clear stale close reason after reopen\"',\n 'pm update pm-a1b2 --unset assignee --deadline +2d --message \"Replan ownership and deadline\"',\n 'pm update pm-a1b2 --body \"Backfilled body text for legacy item\" --message \"Normalize missing body\"',\n ],\n tips: [\n 'Use \"pm close <ID> <TEXT>\" to close items instead of --status closed.',\n \"When reopening from closed to a non-terminal status, update clears stale close_reason unless explicitly set via --close-reason.\",\n 'Use \"pm append <ID> --body <text>\" for additive notes; use update --body to replace body content.',\n ],\n },\n \"update-many\": {\n why: \"Bulk-updates matched item sets with dry-run previews and rollback checkpoints for safe large-scale metadata changes.\",\n examples: [\n \"pm update-many --filter-status open --status in_progress --dry-run\",\n 'pm update-many --filter-tag wave:7 --replace-tests --test \"command=node scripts/run-tests.mjs test -- tests/core/history.spec.ts,scope=project,timeout_seconds=240\"',\n 'pm update-many --filter-tag governance --reviewer maintainer-review --message \"Normalize reviewer metadata\"',\n \"pm update-many --rollback ckpt-abc123\",\n ],\n tips: [\n \"Use --dry-run first to inspect proposed changes before apply mode.\",\n \"Linked-array mutation flags mirror pm update semantics (for example --replace-tests, --clear-files, and repeatable --doc/--note seeds).\",\n \"Checkpoints are enabled by default for apply mode and can be restored with --rollback.\",\n ],\n },\n normalize: {\n why:\n \"Scans items for low-signal lifecycle metadata drift, emits deterministic per-item plans, and optionally applies normalized metadata updates with update-style safety checks.\",\n examples: [\n \"pm normalize --dry-run\",\n \"pm normalize --filter-status in_progress --dry-run\",\n 'pm normalize --filter-status closed --apply --author \"codex-agent\" --message \"Normalize closure metadata\"',\n ],\n tips: [\n \"Dry-run mode is the default; pass --apply only after reviewing planned changes.\",\n \"Apply mode honors ownership/audit constraints and supports --allow-audit-update with optional --force override.\",\n ],\n },\n templates: {\n why: \"Saves, lists, and inspects reusable create option bundles for repeatable workflows.\",\n examples: [\n 'pm templates save triage-default --title \"Triage item\" --description \"...\" --type Task --status open --priority 2 --message \"Seed triage template\"',\n \"pm templates list\",\n \"pm templates show triage-default\",\n ],\n tips: [\n \"Template names are positional arguments (`pm templates save <name>` and `pm templates show <name>`), not --name flags.\",\n \"Combine templates with explicit create flags; explicit flags always override template defaults.\",\n ],\n },\n deps: {\n why: \"Inspects an item dependency graph as a tree or graph payload to understand blockers and hierarchy links.\",\n examples: [\n \"pm deps pm-a1b2\",\n \"pm deps pm-a1b2 --format graph\",\n \"pm deps pm-a1b2 --max-depth 2 --collapse repeated --summary\",\n ],\n tips: [\"Use --summary for lightweight counts when full graph payloads are unnecessary.\"],\n },\n list: {\n why: \"Lists active items with deterministic filtering and ordering.\",\n examples: [\n \"pm list --limit 20\",\n \"pm list --type Task --priority 0 --tag release --assignee codex-agent\",\n \"pm list --compact --sort deadline --order asc\",\n \"pm list --fields id,title,parent,type --sort parent --order asc\",\n ],\n },\n \"list-all\": {\n why: \"Lists all item states (including terminal states) when you need full visibility.\",\n examples: [\"pm list-all --limit 50\", \"pm list-all --type Issue --include-body\"],\n },\n \"list-open\": {\n why: \"Shows work that is ready to claim and start.\",\n examples: [\"pm list-open --priority 0 --limit 10\"],\n },\n \"list-in-progress\": {\n why: \"Tracks active execution and owner progress.\",\n examples: [\"pm list-in-progress --assignee codex-agent --limit 20\"],\n },\n \"list-blocked\": {\n why: \"Surfaces blocked work that needs intervention.\",\n examples: [\"pm list-blocked --limit 20\"],\n },\n \"list-closed\": {\n why: \"Reviews completed work and closure outcomes.\",\n examples: [\"pm list-closed --limit 20 --type Task\"],\n },\n \"list-canceled\": {\n why: \"Audits intentionally discontinued work.\",\n examples: [\"pm list-canceled --limit 20\"],\n },\n \"list-draft\": {\n why: \"Finds incompletely defined items that need refinement before execution.\",\n examples: [\"pm list-draft --limit 20\"],\n },\n aggregate: {\n why: \"Runs grouped aggregation queries for governance checks such as decomposition by parent/type or triage by status/priority.\",\n examples: [\n \"pm aggregate --group-by parent,type --count\",\n \"pm aggregate --group-by type,status --count\",\n \"pm aggregate --group-by parent,type --count --status open --parent pm-feature01\",\n ],\n tips: [\"Current aggregate mode is grouped counts only, so pass --count explicitly.\"],\n },\n \"dedupe-audit\": {\n why: \"Audits potential duplicate items and emits deterministic merge suggestions before any mutation.\",\n examples: [\n \"pm dedupe-audit --mode title_exact\",\n \"pm dedupe-audit --mode title_fuzzy --threshold 0.8 --limit 20\",\n \"pm dedupe-audit --mode parent_scope --status open\",\n ],\n tips: [\"Use title_exact for strict collisions, title_fuzzy for near-duplicates, and parent_scope for child-level collisions.\"],\n },\n guide: {\n why: \"Routes local progressive-disclosure documentation so agents can fetch only the context they need.\",\n examples: [\n \"pm guide\",\n \"pm guide quickstart\",\n \"pm guide commands --depth standard\",\n \"pm guide skills --depth deep --format markdown\",\n \"pm guide release --json\",\n ],\n tips: [\n \"Use brief depth for minimal token footprint, standard for excerpted docs, and deep for full local document rendering.\",\n \"Use --list to force topic index output even when topic parsing is ambiguous.\",\n ],\n },\n calendar: {\n why: \"Provides deadline/reminder/event scheduling views for planning and coordination.\",\n examples: [\n \"pm calendar\",\n \"pm calendar --view agenda --from +0d --to +7d --assignee codex-agent\",\n \"pm calendar --view week --date 2026-04-06 --full-period --include deadlines,events\",\n \"pm calendar --view month --tag release --format json\",\n ],\n tips: [\n \"Day/week/month views are anchored period windows; default mode clips the start to now unless --past or --full-period is set.\",\n \"--full-period applies only to day/week/month views; use --from/--to to bound agenda windows.\",\n ],\n },\n context: {\n why: \"Builds an agent-optimized snapshot of critical active work plus near-term agenda context with progressive depth levels.\",\n examples: [\n \"pm context\",\n \"pm ctx --depth standard --limit 10\",\n \"pm ctx --depth deep --assignee codex-agent\",\n \"pm ctx --section hierarchy --section progress --section blockers\",\n \"pm context --depth standard --activity-limit 20 --stale-threshold 14d\",\n \"pm context --from +0d --to +7d --format markdown --depth deep\",\n ],\n tips: [\n \"High-level focus contains Epics/Features and low-level focus contains Tasks/Issues/Chores/Event/Reminder/Milestone/Meeting.\",\n \"When no open or in-progress work exists, blocked items are shown as fallback context.\",\n \"--depth brief (default) shows focus+agenda; standard adds hierarchy/activity/progress/workload; deep adds blockers/files/staleness/tests.\",\n \"--section overrides --depth and selects specific sections: hierarchy, activity, progress, blockers, files, workload, staleness, tests.\",\n \"Configure defaults via pm config project set context --default-depth standard --activity-limit 15.\",\n ],\n },\n search: {\n why: \"Finds relevant items by keyword, semantic, or hybrid retrieval modes.\",\n examples: [\n 'pm search \"lock stale retry\" --mode keyword --limit 10',\n 'pm search \"extension migration blockers\" --mode hybrid --type Task --priority 0',\n 'pm search \"Cross-Epic Realism Dependency Council\" --mode keyword --title-exact',\n ],\n tips: [\n \"Use --title-exact to require exact normalized title parity, or --phrase-exact to require full-phrase matches in item text fields.\",\n \"Use --include-linked when linked docs/files/tests should influence scoring.\",\n ],\n },\n reindex: {\n why: \"Rebuilds search artifacts after large changes to item corpus or provider/vector config.\",\n examples: [\"pm reindex --mode keyword\", \"pm reindex --mode hybrid --progress --json\"],\n tips: [\n \"Use --progress for non-interactive visibility during local embedding runs.\",\n \"JSON output includes semantic stale/unchanged/embed/upsert counts so agents can gate long reindex work without parsing stderr.\",\n ],\n },\n get: {\n why: \"Shows complete details for one item by ID.\",\n examples: [\"pm get pm-a1b2\", \"pm get pm-a1b2 --json\"],\n tips: [\"JSON output shape is { item, body, linked, claim_state }; body is top-level (not item.body).\"],\n },\n history: {\n why: \"Inspects item mutation timeline and audit trail.\",\n examples: [\"pm history pm-a1b2 --limit 20\"],\n },\n activity: {\n why: \"Reviews recent tracker-wide activity across items.\",\n examples: [\n \"pm activity --limit 50\",\n \"pm activity --id pm-a1b2 --op update --author codex-agent --from -7d --to now\",\n \"pm activity --json --stream rows --limit 200\",\n ],\n tips: [\"Use --stream with --json for line-delimited automation output; --from is inclusive and --to is exclusive.\"],\n },\n restore: {\n why: \"Restores an item to a prior timestamp/version with history replay safety.\",\n examples: ['pm restore pm-a1b2 2026-04-01T00:00:00.000Z --author \"codex-agent\" --message \"Rollback to known-good state\"'],\n },\n close: {\n why: \"Transitions work to terminal closed state with explicit rationale.\",\n examples: [\n 'pm close pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close after verification\"',\n 'pm close pm-a1b2 \"Done\" --validate-close',\n 'pm close pm-a1b2 \"Done\" --validate-close off',\n 'pm close pm-a1b2 \"Done\" --validate-close strict',\n ],\n },\n delete: {\n why: \"Removes an item while preserving history evidence and lock/ownership checks.\",\n examples: ['pm delete pm-a1b2 --author \"codex-agent\" --message \"Remove duplicate item\"'],\n },\n append: {\n why: \"Adds implementation notes to body without replacing existing content.\",\n examples: ['pm append pm-a1b2 --body \"Implemented retry with bounded backoff.\" --message \"Record implementation detail\"'],\n },\n comments: {\n why: \"Adds or reviews lightweight status updates linked to an item.\",\n examples: [\n 'pm comments pm-a1b2 \"Verified fix on Linux and macOS\"',\n 'pm comments pm-a1b2 --add \"Verified fix on Linux and macOS\"',\n 'printf \"%s\\\\n\" \"## Verification\" \"- linux pass\" \"- mac pass\" | pm comments pm-a1b2 --stdin',\n 'pm comments pm-a1b2 --file docs/release-evidence.md --author \"codex-agent\"',\n 'pm comments pm-a1b2 --add \"text: verification note with commas, key-like words, and parser details\"',\n 'pm comments pm-a1b2 --add \"Follow-up needed after review\" --author \"codex-agent\" --force',\n \"pm comments pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use exactly one comment source at a time: positional [text], --add, --stdin, or --file.\",\n \"Use --force when adding comments to items currently assigned to a different owner.\",\n \"When --add payload resembles CSV-like key fragments (for example text=hello,scope:project), plain-text fallback is intentional; use explicit text=..., markdown text: ..., or stdin token - for structured intent.\",\n ],\n },\n \"comments-audit\": {\n why: \"Audits latest comments or full history rows across filtered item sets.\",\n examples: [\n \"pm comments-audit --status open --latest 1\",\n \"pm comments-audit --status open --latest 0\",\n \"pm comments-audit --parent pm-feature01 --tag governance --sprint sprint-12 --release vnext --priority 0\",\n \"pm comments-audit --full-history --limit 50\",\n ],\n tips: [\n \"Use either --latest or --full-history (not both). --latest 0 returns item summaries without comment rows. --limit is an alias for --limit-items.\",\n ],\n },\n notes: {\n why: \"Adds or reviews durable implementation notes linked to an item.\",\n examples: [\n 'pm notes pm-a1b2 --add \"Investigated parser edge case and documented fallback logic.\"',\n 'pm notes pm-a1b2 --add \"text: parser rationale with commas, colons, and key-like wording\"',\n 'pm notes pm-a1b2 --add \"Audit note\" --author \"reviewer\" --allow-audit-note',\n \"pm notes pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-note for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"CSV-like add payloads with extra key fragments are treated as plain text by design; use explicit text keys (text= or text:) when structured parsing is required.\",\n ],\n },\n learnings: {\n why: \"Adds or reviews post-implementation learnings for future work.\",\n examples: [\n 'pm learnings pm-a1b2 --add \"Avoid direct test-runner commands in linked tests; use sandbox runner.\"',\n 'pm learnings pm-a1b2 --add \"text: lesson with commas, key-like words, and punctuation-safe context\"',\n 'pm learnings pm-a1b2 --add \"Audit learning\" --author \"reviewer\" --allow-audit-learning',\n \"pm learnings pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-learning for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"If you intended structured parsing for a key-like payload, prefer explicit text=..., markdown text: ..., or stdin token -; ambiguous CSV-like forms intentionally remain plain text.\",\n ],\n },\n files: {\n why: \"Associates changed source files with tracker items for reproducibility.\",\n examples: [\n 'pm files pm-a1b2 --add \"path=src/cli/main.ts,scope=project,note=help orchestration\"',\n \"pm files discover pm-a1b2\",\n 'pm files discover pm-a1b2 --apply --note \"discovered from item text\"',\n ],\n },\n docs: {\n why: \"Associates relevant documentation paths with tracker items.\",\n examples: ['pm docs pm-a1b2 --add \"path=README.md,scope=project,note=user-facing command guidance\"'],\n },\n test: {\n why: \"Links test commands/paths and optionally executes them for one item.\",\n examples: [\n 'pm test pm-a1b2 --add \"command=node scripts/run-tests.mjs test -- tests/unit/output.spec.ts,scope=project,timeout_seconds=2400\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,scope=project,assert_stdout_contains=count:,assert_stdout_regex=count:\\\\s+\\\\d+\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,scope=project,pm_context_mode=auto\"',\n \"pm test pm-a1b2 --run --timeout 2400 --env-set PORT=0 --env-clear PLAYWRIGHT_BASE_URL --shared-host-safe --pm-context tracker --fail-on-context-mismatch --fail-on-skipped\",\n \"pm test pm-a1b2 --run --timeout 2400 --pm-context auto\",\n \"pm test pm-a1b2 --run --background --timeout 2400 --progress\",\n ],\n },\n \"test-all\": {\n why: \"Runs linked tests in bulk for release/readiness sweeps.\",\n examples: [\n \"pm test-all --status in_progress --limit 5 --offset 10 --timeout 2400\",\n \"pm test-all --status closed --timeout 3600 --progress --env-set PORT=0 --shared-host-safe --fail-on-skipped\",\n \"pm test-all --status in_progress --pm-context tracker --fail-on-context-mismatch --require-assertions-for-pm\",\n \"pm test-all --status in_progress --pm-context auto --fail-on-context-mismatch\",\n \"pm test-all --status in_progress --background --timeout 3600\",\n ],\n },\n \"test-runs\": {\n why: \"Manages background linked-test runs with lifecycle controls and log/status inspection.\",\n examples: [\n \"pm test-runs list --status running --limit 20\",\n \"pm test-runs status tr-abc123\",\n \"pm test-runs logs tr-abc123 --stream stderr --tail 200\",\n \"pm test-runs stop tr-abc123\",\n \"pm test-runs resume tr-abc123\",\n ],\n },\n stats: {\n why: \"Reports tracker-level totals and distribution by type/status.\",\n examples: [\"pm stats\", \"pm stats --json\"],\n },\n health: {\n why: \"Validates tracker/runtime health including extension triage, migration, and integrity diagnostics.\",\n examples: [\"pm health\", \"pm health --json\", \"pm health --check-only\", \"pm health --no-refresh\", \"pm health --refresh-vectors\"],\n },\n validate: {\n why:\n \"Runs standalone metadata, resolution, lifecycle (including dependency-cycle diagnostics), linked-file, linked-command reference, and history drift checks with default remediation hints for resolution gaps.\",\n examples: [\n \"pm validate\",\n \"pm validate --check-resolution --json\",\n \"pm validate --check-lifecycle --dependency-cycle-severity error\",\n \"pm validate --check-files --scan-mode tracked-all\",\n \"pm validate --check-files --scan-mode tracked-all-strict --include-pm-internals\",\n \"pm validate --check-command-references\",\n \"pm validate --check-resolution --fail-on-warn --json\",\n ],\n tips: [\"Resolution-gap warnings include default `pm update <id> ...` remediation hint templates in check details.\"],\n },\n gc: {\n why: \"Cleans optional cache artifacts to keep local tracker state tidy.\",\n examples: [\"pm gc\"],\n },\n claim: {\n why: \"Claims an item to signal active ownership and reduce conflicts.\",\n examples: [\n 'pm claim pm-a1b2 --author \"codex-agent\" --message \"Claim for implementation\"',\n 'pm claim pm-a1b2 --force --author \"codex-agent\" --message \"Take over terminal item\"',\n ],\n tips: [\"Claim takeover for non-terminal items does not require --force; --force is reserved for terminal/lock overrides.\"],\n },\n release: {\n why: \"Releases an active claim when paused, handed off, or completed.\",\n examples: [\n 'pm release pm-a1b2 --author \"codex-agent\" --message \"Release after closure\"',\n 'pm release pm-a1b2 --allow-audit-release --author \"reviewer\" --message \"Audit handoff release\"',\n ],\n tips: [\"Use --allow-audit-release for non-owner handoffs that only clear assignee metadata.\"],\n },\n \"start-task\": {\n why: \"Lifecycle alias that claims an item and sets status to in_progress.\",\n examples: ['pm start-task pm-a1b2 --author \"codex-agent\" --message \"Start implementation\"'],\n },\n \"pause-task\": {\n why: \"Lifecycle alias that sets status to open and releases active assignment.\",\n examples: ['pm pause-task pm-a1b2 --author \"codex-agent\" --message \"Pause for dependency unblock\"'],\n },\n \"close-task\": {\n why: \"Lifecycle alias that closes with reason text and clears assignment metadata.\",\n examples: ['pm close-task pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close and handoff\"'],\n },\n completion: {\n why: \"Generates shell completion scripts for faster and more reliable command entry.\",\n examples: [\"pm completion bash\", \"pm completion zsh\", \"pm completion fish\", \"pm completion bash --eager-tags\"],\n tips: [\"Default scripts resolve tag suggestions lazily at completion time; use --eager-tags to embed current tags directly.\"],\n },\n contracts: {\n why: \"Exposes machine-readable CLI command and tool schema contracts for agent integrations.\",\n examples: [\n \"pm contracts\",\n \"pm contracts --command list --runtime-only\",\n \"pm contracts --command update --flags-only\",\n \"pm contracts --availability-only --runtime-only\",\n \"pm contracts --action create\",\n \"pm contracts --schema-only\",\n ],\n tips: [\"Use --command to narrow actions/schema to one CLI surface; combine with --flags-only or --availability-only for lighter payloads.\"],\n },\n};\n\nexport const ROOT_HELP_BUNDLE: HelpBundle = {\n why: \"Provides deterministic project management workflows for humans and coding agents.\",\n examples: [\n \"pm init\",\n \"pm guide\",\n \"pm list-open --limit 10\",\n 'pm create --title \"...\" --description \"...\" --type Task --status open --priority 1 --message \"...\" --create-mode progressive',\n ],\n tips: [\n \"Use <command> --help for command-specific guidance and examples.\",\n \"Use pm guide for local docs and skills routing with progressive disclosure.\",\n \"Use --json for machine parsing and integration flows.\",\n \"Use --no-pager to force direct help output in CI and other non-interactive shells.\",\n ],\n};\n\nfunction resolveCanonicalHelpPath(commandPath: string | undefined): string {\n const normalized = normalizeHelpCommandPath(commandPath ?? \"\");\n if (!normalized) {\n return \"\";\n }\n return HELP_PATH_ALIASES[normalized] ?? normalized;\n}\n\nexport function resolveHelpBundleForPath(commandPath: string | undefined): HelpBundle {\n const canonicalPath = resolveCanonicalHelpPath(commandPath);\n if (!canonicalPath) {\n return ROOT_HELP_BUNDLE;\n }\n return HELP_BY_COMMAND_PATH[canonicalPath] ?? ROOT_HELP_BUNDLE;\n}\n\nexport function resolveHelpNarrative(commandPath: string | undefined, detailMode: HelpDetailMode): HelpNarrative {\n const bundle = resolveHelpBundleForPath(commandPath);\n return {\n intent: bundle.why,\n examples: detailMode === \"detailed\" ? [...bundle.examples] : bundle.examples.length > 0 ? [bundle.examples[0]] : [],\n tips: detailMode === \"detailed\" ? [...(bundle.tips ?? [])] : [],\n detail_mode: detailMode,\n };\n}\n\nexport function listDocumentedHelpPaths(): string[] {\n return Object.keys(HELP_BY_COMMAND_PATH).sort((left, right) => left.localeCompare(right));\n}\n\nexport function attachRichHelpText(program: Command, argv: string[] = process.argv.slice(2)): void {\n const detailMode = resolveHelpDetailMode(argv);\n program.addHelpText(\"after\", renderHelpBundle(ROOT_HELP_BUNDLE, detailMode));\n for (const [commandPath, bundle] of Object.entries(HELP_BY_COMMAND_PATH)) {\n attachBundleByPath(program, commandPath, bundle, detailMode);\n }\n}\n"]}
|
package/dist/cli/main.js
CHANGED
|
@@ -419,8 +419,8 @@ async function collectRuntimeFieldLooseFlagDefinitionsForCommand(commandPath, pm
|
|
|
419
419
|
runtimeFieldLooseFlagDefinitionCache.set(cacheKey, definitions);
|
|
420
420
|
return definitions;
|
|
421
421
|
}
|
|
422
|
-
async function registerRuntimeSchemaFieldFlags(rootProgram) {
|
|
423
|
-
const bootstrapGlobalOptions = parseBootstrapGlobalOptions(
|
|
422
|
+
async function registerRuntimeSchemaFieldFlags(rootProgram, invocationArgv) {
|
|
423
|
+
const bootstrapGlobalOptions = parseBootstrapGlobalOptions(invocationArgv);
|
|
424
424
|
const pmRoot = resolvePmRoot(process.cwd(), bootstrapGlobalOptions.path);
|
|
425
425
|
if (!(await pathExists(getSettingsPath(pmRoot)))) {
|
|
426
426
|
return;
|
|
@@ -731,8 +731,8 @@ function wrapProgramActionsForExtensionHandlers(rootProgram) {
|
|
|
731
731
|
};
|
|
732
732
|
visit(rootProgram);
|
|
733
733
|
}
|
|
734
|
-
async function registerDynamicExtensionCommandPaths(rootProgram) {
|
|
735
|
-
const bootstrapGlobalOptions = parseBootstrapGlobalOptions(
|
|
734
|
+
async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv) {
|
|
735
|
+
const bootstrapGlobalOptions = parseBootstrapGlobalOptions(invocationArgv);
|
|
736
736
|
if (bootstrapGlobalOptions.noExtensions) {
|
|
737
737
|
activeRuntimeExtensionCommandDescriptors = new Map();
|
|
738
738
|
setActiveExtensionServices({ overrides: [] });
|
|
@@ -750,7 +750,7 @@ async function registerDynamicExtensionCommandPaths(rootProgram) {
|
|
|
750
750
|
setActiveExtensionServices(snapshot.services);
|
|
751
751
|
activeRuntimeExtensionCommandDescriptors = new Map(snapshot.commandDescriptors);
|
|
752
752
|
const typeRegistry = resolveItemTypeRegistry(snapshot.settings, snapshot.registrations);
|
|
753
|
-
attachCreateUpdatePolicyHelpText(rootProgram, typeRegistry,
|
|
753
|
+
attachCreateUpdatePolicyHelpText(rootProgram, typeRegistry, invocationArgv);
|
|
754
754
|
const commandPaths = [...new Set([...snapshot.commandHandlers, ...snapshot.commandDescriptors.keys()])].sort((left, right) => left.localeCompare(right));
|
|
755
755
|
for (const commandPath of commandPaths) {
|
|
756
756
|
const pathParts = commandPath.split(" ").filter((part) => part.length > 0);
|
|
@@ -974,6 +974,63 @@ registerSetupCommands(program);
|
|
|
974
974
|
registerListQueryCommands(program);
|
|
975
975
|
registerMutationCommands(program);
|
|
976
976
|
registerOperationCommands(program);
|
|
977
|
+
const VERSION_FLAG_TOKENS = new Set(["--version", "-V"]);
|
|
978
|
+
const RUNTIME_SCHEMA_FLAG_BOOTSTRAP_COMMANDS = new Set([
|
|
979
|
+
"create",
|
|
980
|
+
"update",
|
|
981
|
+
"update-many",
|
|
982
|
+
"list",
|
|
983
|
+
"list-all",
|
|
984
|
+
"list-draft",
|
|
985
|
+
"list-open",
|
|
986
|
+
"list-in-progress",
|
|
987
|
+
"list-blocked",
|
|
988
|
+
"list-closed",
|
|
989
|
+
"list-canceled",
|
|
990
|
+
"search",
|
|
991
|
+
"calendar",
|
|
992
|
+
"context",
|
|
993
|
+
"templates",
|
|
994
|
+
]);
|
|
995
|
+
function invocationRequestsVersion(invocationArgv) {
|
|
996
|
+
return invocationArgv.some((token) => VERSION_FLAG_TOKENS.has(token));
|
|
997
|
+
}
|
|
998
|
+
function isKnownTopLevelCommandOrAlias(rootProgram, commandName) {
|
|
999
|
+
const normalized = commandName.trim().toLowerCase();
|
|
1000
|
+
for (const command of rootProgram.commands) {
|
|
1001
|
+
if (command.name().trim().toLowerCase() === normalized) {
|
|
1002
|
+
return true;
|
|
1003
|
+
}
|
|
1004
|
+
if (command.aliases().some((alias) => alias.trim().toLowerCase() === normalized)) {
|
|
1005
|
+
return true;
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
return false;
|
|
1009
|
+
}
|
|
1010
|
+
function shouldRegisterDynamicExtensionPaths(rootProgram, invocationArgv) {
|
|
1011
|
+
if (invocationRequestsVersion(invocationArgv)) {
|
|
1012
|
+
return false;
|
|
1013
|
+
}
|
|
1014
|
+
const helpRequest = parseBootstrapHelpRequest(invocationArgv);
|
|
1015
|
+
if (helpRequest.requested) {
|
|
1016
|
+
return true;
|
|
1017
|
+
}
|
|
1018
|
+
const commandName = parseBootstrapCommandName(invocationArgv);
|
|
1019
|
+
if (!commandName) {
|
|
1020
|
+
return false;
|
|
1021
|
+
}
|
|
1022
|
+
return !isKnownTopLevelCommandOrAlias(rootProgram, commandName);
|
|
1023
|
+
}
|
|
1024
|
+
function shouldRegisterRuntimeSchemaFlags(invocationArgv) {
|
|
1025
|
+
if (invocationRequestsVersion(invocationArgv)) {
|
|
1026
|
+
return false;
|
|
1027
|
+
}
|
|
1028
|
+
const commandName = parseBootstrapCommandName(invocationArgv);
|
|
1029
|
+
if (!commandName) {
|
|
1030
|
+
return false;
|
|
1031
|
+
}
|
|
1032
|
+
return RUNTIME_SCHEMA_FLAG_BOOTSTRAP_COMMANDS.has(commandName);
|
|
1033
|
+
}
|
|
977
1034
|
const bootstrapInvocation = normalizeBootstrapInvocation(process.argv.slice(2));
|
|
978
1035
|
attachRichHelpText(program, bootstrapInvocation.argv);
|
|
979
1036
|
async function main() {
|
|
@@ -981,8 +1038,17 @@ async function main() {
|
|
|
981
1038
|
const invocationProcessArgv = [process.argv[0], process.argv[1], ...invocationArgv];
|
|
982
1039
|
try {
|
|
983
1040
|
applyBootstrapPagerPolicy(invocationArgv);
|
|
984
|
-
|
|
985
|
-
|
|
1041
|
+
const registerDynamicCommands = shouldRegisterDynamicExtensionPaths(program, invocationArgv);
|
|
1042
|
+
if (registerDynamicCommands) {
|
|
1043
|
+
await registerDynamicExtensionCommandPaths(program, invocationArgv);
|
|
1044
|
+
}
|
|
1045
|
+
else {
|
|
1046
|
+
activeRuntimeExtensionCommandDescriptors = new Map();
|
|
1047
|
+
setActiveExtensionServices({ overrides: [] });
|
|
1048
|
+
}
|
|
1049
|
+
if (shouldRegisterRuntimeSchemaFlags(invocationArgv)) {
|
|
1050
|
+
await registerRuntimeSchemaFieldFlags(program, invocationArgv);
|
|
1051
|
+
}
|
|
986
1052
|
wrapProgramActionsForExtensionHandlers(program);
|
|
987
1053
|
const renderedBootstrapJsonHelp = await maybeRenderBootstrapJsonHelp(program, invocationArgv, activeRuntimeExtensionCommandDescriptors);
|
|
988
1054
|
if (renderedBootstrapJsonHelp) {
|