@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
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
3
|
+
import { PmCliError } from "../core/shared/errors.js";
|
|
4
|
+
import { collect, getGlobalOptions, printError, printResult, } from "./registration-helpers.js";
|
|
5
|
+
let setupCommandsModulePromise = null;
|
|
6
|
+
async function loadSetupCommandsModule() {
|
|
7
|
+
setupCommandsModulePromise ??= import("./commands/index.js");
|
|
8
|
+
return setupCommandsModulePromise;
|
|
9
|
+
}
|
|
10
|
+
function normalizeExtensionOptions(options, forcedAction, vocabulary = "extension") {
|
|
4
11
|
const isForcedAction = (action) => forcedAction === action;
|
|
5
12
|
const readBoolean = (...keys) => keys.some((key) => options[key] === true);
|
|
6
13
|
const readString = (...keys) => {
|
|
@@ -20,6 +27,7 @@ function normalizeExtensionOptions(options, forcedAction) {
|
|
|
20
27
|
manage: isForcedAction("manage") || readBoolean("manage"),
|
|
21
28
|
reload: isForcedAction("reload") || readBoolean("reload"),
|
|
22
29
|
doctor: isForcedAction("doctor") || readBoolean("doctor"),
|
|
30
|
+
catalog: isForcedAction("catalog") || readBoolean("catalog"),
|
|
23
31
|
adopt: isForcedAction("adopt") || readBoolean("adopt"),
|
|
24
32
|
adoptAll: isForcedAction("adopt-all") || readBoolean("adoptAll", "adopt_all", "adopt-all"),
|
|
25
33
|
activate: isForcedAction("activate") || readBoolean("activate"),
|
|
@@ -37,13 +45,37 @@ function normalizeExtensionOptions(options, forcedAction) {
|
|
|
37
45
|
fixManagedState: readBoolean("fixManagedState", "fix_managed_state", "fix-managed-state"),
|
|
38
46
|
strictExit: readBoolean("strictExit", "strict_exit", "strict-exit"),
|
|
39
47
|
failOnWarn: readBoolean("failOnWarn", "fail_on_warn", "fail-on-warn"),
|
|
48
|
+
vocabulary,
|
|
40
49
|
};
|
|
41
50
|
}
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
async function looksLikeShellExpandedWildcard(targets) {
|
|
52
|
+
if (targets.length <= 1) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
const visibleEntries = (await fs.readdir(process.cwd()))
|
|
56
|
+
.filter((entry) => !entry.startsWith("."))
|
|
57
|
+
.sort((left, right) => left.localeCompare(right));
|
|
58
|
+
const normalizedTargets = [...targets].sort((left, right) => left.localeCompare(right));
|
|
59
|
+
return (visibleEntries.length === normalizedTargets.length &&
|
|
60
|
+
visibleEntries.every((entry, index) => entry === normalizedTargets[index]));
|
|
61
|
+
}
|
|
62
|
+
async function normalizeInstallTargets(targets) {
|
|
63
|
+
const normalizedTargets = (Array.isArray(targets) ? targets : typeof targets === "string" ? [targets] : [])
|
|
64
|
+
.map((target) => target.trim())
|
|
65
|
+
.filter((target) => target.length > 0);
|
|
66
|
+
if (normalizedTargets.length <= 1) {
|
|
67
|
+
return normalizedTargets[0];
|
|
68
|
+
}
|
|
69
|
+
if (await looksLikeShellExpandedWildcard(normalizedTargets)) {
|
|
70
|
+
return "*";
|
|
71
|
+
}
|
|
72
|
+
throw new PmCliError(`Install accepts one package source at a time. To install bundled first-party packages, quote the wildcard: pm install '*'`, EXIT_CODE.USAGE);
|
|
73
|
+
}
|
|
74
|
+
async function executeExtensionCommand(target, options, command, forcedAction, vocabulary = "extension") {
|
|
44
75
|
const globalOptions = getGlobalOptions(command);
|
|
45
76
|
const startedAt = Date.now();
|
|
46
|
-
const normalizedOptions = normalizeExtensionOptions(options, forcedAction);
|
|
77
|
+
const normalizedOptions = normalizeExtensionOptions(options, forcedAction, vocabulary);
|
|
78
|
+
const { runExtension } = await loadSetupCommandsModule();
|
|
47
79
|
const result = await runExtension(target, normalizedOptions, globalOptions);
|
|
48
80
|
printResult(result, globalOptions);
|
|
49
81
|
const strictExit = Boolean(normalizedOptions.strictExit) || Boolean(normalizedOptions.failOnWarn);
|
|
@@ -66,6 +98,125 @@ function addExtensionScopeOptions(command) {
|
|
|
66
98
|
.option("--local", "Alias for --project")
|
|
67
99
|
.option("--global", "Use global extension scope");
|
|
68
100
|
}
|
|
101
|
+
function addPackageScopeOptions(command) {
|
|
102
|
+
return command
|
|
103
|
+
.option("--project", "Use project package scope (default)")
|
|
104
|
+
.option("--local", "Alias for --project")
|
|
105
|
+
.option("--global", "Use global package scope");
|
|
106
|
+
}
|
|
107
|
+
function addLifecycleScopeOptions(command, vocabulary) {
|
|
108
|
+
return vocabulary === "package" ? addPackageScopeOptions(command) : addExtensionScopeOptions(command);
|
|
109
|
+
}
|
|
110
|
+
function registerLifecycleCommand(program, vocabulary) {
|
|
111
|
+
const noun = vocabulary === "package" ? "package" : "extension";
|
|
112
|
+
const plural = vocabulary === "package" ? "packages" : "extensions";
|
|
113
|
+
const commandName = vocabulary;
|
|
114
|
+
const lifecycleCommand = program
|
|
115
|
+
.command(commandName)
|
|
116
|
+
.argument("[target]", `${noun[0].toUpperCase()}${noun.slice(1)} source/name or scaffold target path (for --init/--scaffold)`)
|
|
117
|
+
.option("--init", `Generate a starter ${noun} scaffold at target path`)
|
|
118
|
+
.option("--scaffold", "Alias for --init")
|
|
119
|
+
.option("--install", `Install ${noun} from local path or GitHub source`)
|
|
120
|
+
.option("--uninstall", `Uninstall an installed ${noun}`)
|
|
121
|
+
.option("--explore", `List discovered ${plural} in selected scope`)
|
|
122
|
+
.option("--manage", `List managed ${plural} with update-check metadata`)
|
|
123
|
+
.option("--reload", `Reload ${plural} with cache-busted module imports`)
|
|
124
|
+
.option("--watch", "Use watch mode with --reload")
|
|
125
|
+
.option("--doctor", `Run consolidated ${noun} diagnostics (summary/deep modes)`)
|
|
126
|
+
.option("--catalog", `List bundled first-party ${noun} catalog metadata`)
|
|
127
|
+
.option("--adopt", `Adopt an existing unmanaged ${noun} into managed metadata`)
|
|
128
|
+
.option("--adopt-all", `Adopt all unmanaged ${plural} into managed metadata`)
|
|
129
|
+
.option("--activate", `Activate a ${noun} in selected scope settings`)
|
|
130
|
+
.option("--deactivate", `Deactivate a ${noun} in selected scope settings`)
|
|
131
|
+
.option("--project", `Use project ${noun} scope (default)`)
|
|
132
|
+
.option("--local", "Alias for --project")
|
|
133
|
+
.option("--global", `Use global ${noun} scope`)
|
|
134
|
+
.option("--gh <owner/repo[/path]>", "Install from GitHub shorthand source")
|
|
135
|
+
.option("--github <owner/repo[/path]>", "Alias for --gh")
|
|
136
|
+
.option("--ref <ref>", "Git ref/branch/tag for GitHub install sources")
|
|
137
|
+
.option("--detail <mode>", `${noun[0].toUpperCase()}${noun.slice(1)} diagnostics detail mode (summary|deep)`)
|
|
138
|
+
.option("--trace", "Include actionable registration traces in doctor deep diagnostics")
|
|
139
|
+
.option("--runtime-probe", "Opt-in runtime activation probe for manage output parity")
|
|
140
|
+
.option("--fix-managed-state", `Adopt unmanaged ${plural} before diagnostics/update checks`)
|
|
141
|
+
.option("--strict-exit", "Return non-zero exit when doctor warnings are present (ok=false)")
|
|
142
|
+
.option("--fail-on-warn", "Alias for --strict-exit (doctor)")
|
|
143
|
+
.description(vocabulary === "package"
|
|
144
|
+
? "Manage package lifecycle operations for project or global scope. Backward-compatible with extension packages."
|
|
145
|
+
: "Manage extension lifecycle operations for project or global scope.")
|
|
146
|
+
.action(async (target, _options, command) => {
|
|
147
|
+
await executeExtensionCommand(target, command.opts(), command, undefined, vocabulary);
|
|
148
|
+
});
|
|
149
|
+
if (vocabulary === "package") {
|
|
150
|
+
lifecycleCommand.alias("packages");
|
|
151
|
+
}
|
|
152
|
+
addLifecycleScopeOptions(lifecycleCommand
|
|
153
|
+
.command("init")
|
|
154
|
+
.alias("scaffold")
|
|
155
|
+
.argument("<target>", `Scaffold target directory path`)
|
|
156
|
+
.description(`Generate a starter ${noun} scaffold with manifest and entrypoint.`), vocabulary).action(async (target, _options, command) => {
|
|
157
|
+
await executeExtensionCommand(target, command.opts(), command, "init", vocabulary);
|
|
158
|
+
});
|
|
159
|
+
addLifecycleScopeOptions(lifecycleCommand
|
|
160
|
+
.command("install")
|
|
161
|
+
.argument("[targets...]", `${noun[0].toUpperCase()}${noun.slice(1)} source (local path, bundled alias, wildcard, or GitHub source)`)
|
|
162
|
+
.option("--gh <owner/repo[/path]>", "Install from GitHub shorthand source")
|
|
163
|
+
.option("--github <owner/repo[/path]>", "Alias for --gh")
|
|
164
|
+
.option("--ref <ref>", "Git ref/branch/tag for GitHub install sources")
|
|
165
|
+
.description(`Install ${noun} from local path or GitHub source.`), vocabulary).action(async (targets, _options, command) => {
|
|
166
|
+
const target = await normalizeInstallTargets(targets);
|
|
167
|
+
await executeExtensionCommand(target, command.opts(), command, "install", vocabulary);
|
|
168
|
+
});
|
|
169
|
+
addLifecycleScopeOptions(lifecycleCommand.command("uninstall").argument("<target>", `${noun[0].toUpperCase()}${noun.slice(1)} name`).description(`Uninstall an installed ${noun}.`), vocabulary).action(async (target, _options, command) => {
|
|
170
|
+
await executeExtensionCommand(target, command.opts(), command, "uninstall", vocabulary);
|
|
171
|
+
});
|
|
172
|
+
addLifecycleScopeOptions(lifecycleCommand.command("explore").description(`List discovered ${plural} in selected scope.`), vocabulary).action(async (_options, command) => {
|
|
173
|
+
await executeExtensionCommand(undefined, command.opts(), command, "explore", vocabulary);
|
|
174
|
+
});
|
|
175
|
+
addLifecycleScopeOptions(lifecycleCommand
|
|
176
|
+
.command("manage")
|
|
177
|
+
.option("--runtime-probe", "Opt-in runtime activation probe for manage output parity")
|
|
178
|
+
.option("--fix-managed-state", `Adopt unmanaged ${plural} before diagnostics/update checks`)
|
|
179
|
+
.description(`List managed ${plural} with update-check metadata.`), vocabulary).action(async (_options, command) => {
|
|
180
|
+
await executeExtensionCommand(undefined, command.opts(), command, "manage", vocabulary);
|
|
181
|
+
});
|
|
182
|
+
addLifecycleScopeOptions(lifecycleCommand
|
|
183
|
+
.command("reload")
|
|
184
|
+
.option("--watch", "Use watch mode for repeated reload checks")
|
|
185
|
+
.description(`Reload ${plural} with cache-busted module imports.`), vocabulary).action(async (_options, command) => {
|
|
186
|
+
await executeExtensionCommand(undefined, command.opts(), command, "reload", vocabulary);
|
|
187
|
+
});
|
|
188
|
+
addLifecycleScopeOptions(lifecycleCommand
|
|
189
|
+
.command("doctor")
|
|
190
|
+
.option("--detail <mode>", `Detail mode for ${noun} diagnostics (summary|deep)`)
|
|
191
|
+
.option("--trace", "Include actionable registration traces in doctor deep diagnostics")
|
|
192
|
+
.option("--fix-managed-state", `Adopt unmanaged ${plural} before diagnostics/update checks`)
|
|
193
|
+
.option("--strict-exit", "Return non-zero exit when doctor warnings are present (ok=false)")
|
|
194
|
+
.option("--fail-on-warn", "Alias for --strict-exit (doctor)")
|
|
195
|
+
.description(`Run consolidated ${noun} diagnostics (summary/deep modes).`), vocabulary).action(async (_options, command) => {
|
|
196
|
+
await executeExtensionCommand(undefined, command.opts(), command, "doctor", vocabulary);
|
|
197
|
+
});
|
|
198
|
+
addLifecycleScopeOptions(lifecycleCommand.command("catalog").alias("list").description(`List bundled first-party ${noun} catalog metadata.`), vocabulary).action(async (_options, command) => {
|
|
199
|
+
await executeExtensionCommand(undefined, command.opts(), command, "catalog", vocabulary);
|
|
200
|
+
});
|
|
201
|
+
addLifecycleScopeOptions(lifecycleCommand
|
|
202
|
+
.command("adopt")
|
|
203
|
+
.argument("<target>", `${noun[0].toUpperCase()}${noun.slice(1)} name`)
|
|
204
|
+
.option("--gh <owner/repo[/path]>", `GitHub provenance shorthand for adopted ${noun}`)
|
|
205
|
+
.option("--github <owner/repo[/path]>", "Alias for --gh")
|
|
206
|
+
.option("--ref <ref>", "Git ref/branch/tag for GitHub shorthand source")
|
|
207
|
+
.description(`Adopt an existing unmanaged ${noun} into managed metadata.`), vocabulary).action(async (target, _options, command) => {
|
|
208
|
+
await executeExtensionCommand(target, command.opts(), command, "adopt", vocabulary);
|
|
209
|
+
});
|
|
210
|
+
addLifecycleScopeOptions(lifecycleCommand.command("adopt-all").description(`Adopt all unmanaged ${plural} into managed metadata.`), vocabulary).action(async (_options, command) => {
|
|
211
|
+
await executeExtensionCommand(undefined, command.opts(), command, "adopt-all", vocabulary);
|
|
212
|
+
});
|
|
213
|
+
addLifecycleScopeOptions(lifecycleCommand.command("activate").argument("<target>", `${noun[0].toUpperCase()}${noun.slice(1)} name`).description(`Activate a ${noun} in selected scope settings.`), vocabulary).action(async (target, _options, command) => {
|
|
214
|
+
await executeExtensionCommand(target, command.opts(), command, "activate", vocabulary);
|
|
215
|
+
});
|
|
216
|
+
addLifecycleScopeOptions(lifecycleCommand.command("deactivate").argument("<target>", `${noun[0].toUpperCase()}${noun.slice(1)} name`).description(`Deactivate a ${noun} in selected scope settings.`), vocabulary).action(async (target, _options, command) => {
|
|
217
|
+
await executeExtensionCommand(target, command.opts(), command, "deactivate", vocabulary);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
69
220
|
export function registerSetupCommands(program) {
|
|
70
221
|
program
|
|
71
222
|
.command("init")
|
|
@@ -77,6 +228,7 @@ export function registerSetupCommands(program) {
|
|
|
77
228
|
.action(async (prefix, options, command) => {
|
|
78
229
|
const globalOptions = getGlobalOptions(command);
|
|
79
230
|
const startedAt = Date.now();
|
|
231
|
+
const { runInit } = await loadSetupCommandsModule();
|
|
80
232
|
const result = await runInit(prefix, globalOptions, {
|
|
81
233
|
preset: typeof options.preset === "string" ? options.preset : undefined,
|
|
82
234
|
defaults: options.defaults === true,
|
|
@@ -112,6 +264,7 @@ export function registerSetupCommands(program) {
|
|
|
112
264
|
const globalOptions = getGlobalOptions(command);
|
|
113
265
|
const startedAt = Date.now();
|
|
114
266
|
const criteria = Array.isArray(options.criterion) ? options.criterion : [];
|
|
267
|
+
const { runConfig } = await loadSetupCommandsModule();
|
|
115
268
|
const result = await runConfig(scope, action, key, {
|
|
116
269
|
criterion: criteria,
|
|
117
270
|
format: typeof options.format === "string" ? options.format : undefined,
|
|
@@ -134,214 +287,38 @@ export function registerSetupCommands(program) {
|
|
|
134
287
|
printError(`profile:command=config took_ms=${Date.now() - startedAt}`);
|
|
135
288
|
}
|
|
136
289
|
});
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
.option("--init", "Generate a starter extension scaffold at target path")
|
|
141
|
-
.option("--scaffold", "Alias for --init")
|
|
142
|
-
.option("--install", "Install extension from local path or GitHub source")
|
|
143
|
-
.option("--uninstall", "Uninstall an installed extension")
|
|
144
|
-
.option("--explore", "List discovered extensions in selected scope")
|
|
145
|
-
.option("--manage", "List managed extensions with update-check metadata")
|
|
146
|
-
.option("--reload", "Reload extensions with cache-busted module imports")
|
|
147
|
-
.option("--watch", "Use watch mode with --reload")
|
|
148
|
-
.option("--doctor", "Run consolidated extension diagnostics (summary/deep modes)")
|
|
149
|
-
.option("--adopt", "Adopt an existing unmanaged extension into managed metadata")
|
|
150
|
-
.option("--adopt-all", "Adopt all unmanaged extensions into managed metadata")
|
|
151
|
-
.option("--activate", "Activate an extension in selected scope settings")
|
|
152
|
-
.option("--deactivate", "Deactivate an extension in selected scope settings")
|
|
153
|
-
.option("--project", "Use project extension scope (default)")
|
|
154
|
-
.option("--local", "Alias for --project")
|
|
155
|
-
.option("--global", "Use global extension scope")
|
|
156
|
-
.option("--gh <owner/repo[/path]>", "Install from GitHub shorthand source")
|
|
157
|
-
.option("--github <owner/repo[/path]>", "Alias for --gh")
|
|
158
|
-
.option("--ref <ref>", "Git ref/branch/tag for GitHub install sources")
|
|
159
|
-
.option("--detail <mode>", "Detail mode for extension diagnostics (summary|deep)")
|
|
160
|
-
.option("--trace", "Include actionable registration traces in doctor deep diagnostics")
|
|
161
|
-
.option("--runtime-probe", "Opt-in runtime activation probe for manage output parity")
|
|
162
|
-
.option("--fix-managed-state", "Adopt unmanaged extensions before diagnostics/update checks")
|
|
163
|
-
.option("--strict-exit", "Return non-zero exit when doctor warnings are present (ok=false)")
|
|
164
|
-
.option("--fail-on-warn", "Alias for --strict-exit (doctor)")
|
|
165
|
-
.description("Manage extension lifecycle operations for project or global scope.")
|
|
166
|
-
.action(async (target, _options, command) => {
|
|
167
|
-
await executeExtensionCommand(target, command.opts(), command);
|
|
168
|
-
});
|
|
169
|
-
addExtensionScopeOptions(extensionCommand
|
|
170
|
-
.command("init")
|
|
171
|
-
.alias("scaffold")
|
|
172
|
-
.argument("<target>", "Scaffold target directory path")
|
|
173
|
-
.description("Generate a starter extension scaffold with manifest and entrypoint.")).action(async (target, _options, command) => {
|
|
174
|
-
await executeExtensionCommand(target, command.opts(), command, "init");
|
|
175
|
-
});
|
|
176
|
-
addExtensionScopeOptions(extensionCommand
|
|
290
|
+
registerLifecycleCommand(program, "extension");
|
|
291
|
+
registerLifecycleCommand(program, "package");
|
|
292
|
+
addPackageScopeOptions(program
|
|
177
293
|
.command("install")
|
|
178
|
-
.argument("[
|
|
294
|
+
.argument("[targets...]", "Package source (local path, bundled alias, wildcard, or GitHub source)")
|
|
179
295
|
.option("--gh <owner/repo[/path]>", "Install from GitHub shorthand source")
|
|
180
296
|
.option("--github <owner/repo[/path]>", "Alias for --gh")
|
|
181
297
|
.option("--ref <ref>", "Git ref/branch/tag for GitHub install sources")
|
|
182
|
-
.description("Install
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
addExtensionScopeOptions(extensionCommand.command("uninstall").argument("<target>", "Extension name").description("Uninstall an installed extension.")).action(async (target, _options, command) => {
|
|
186
|
-
await executeExtensionCommand(target, command.opts(), command, "uninstall");
|
|
187
|
-
});
|
|
188
|
-
addExtensionScopeOptions(extensionCommand.command("explore").description("List discovered extensions in selected scope.")).action(async (_options, command) => {
|
|
189
|
-
await executeExtensionCommand(undefined, command.opts(), command, "explore");
|
|
190
|
-
});
|
|
191
|
-
addExtensionScopeOptions(extensionCommand
|
|
192
|
-
.command("manage")
|
|
193
|
-
.option("--runtime-probe", "Opt-in runtime activation probe for manage output parity")
|
|
194
|
-
.option("--fix-managed-state", "Adopt unmanaged extensions before diagnostics/update checks")
|
|
195
|
-
.description("List managed extensions with update-check metadata.")).action(async (_options, command) => {
|
|
196
|
-
await executeExtensionCommand(undefined, command.opts(), command, "manage");
|
|
197
|
-
});
|
|
198
|
-
addExtensionScopeOptions(extensionCommand
|
|
199
|
-
.command("reload")
|
|
200
|
-
.option("--watch", "Use watch mode for repeated reload checks")
|
|
201
|
-
.description("Reload extensions with cache-busted module imports.")).action(async (_options, command) => {
|
|
202
|
-
await executeExtensionCommand(undefined, command.opts(), command, "reload");
|
|
298
|
+
.description("Install a pm package into the project package scope by default.")).action(async (targets, _options, command) => {
|
|
299
|
+
const target = await normalizeInstallTargets(targets);
|
|
300
|
+
await executeExtensionCommand(target, command.opts(), command, "install", "package");
|
|
203
301
|
});
|
|
204
|
-
|
|
205
|
-
.command("
|
|
206
|
-
.
|
|
207
|
-
.option("--
|
|
208
|
-
.option("--
|
|
209
|
-
.option("--
|
|
210
|
-
.option("--
|
|
211
|
-
.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
addExtensionScopeOptions(extensionCommand
|
|
215
|
-
.command("adopt")
|
|
216
|
-
.argument("<target>", "Extension name")
|
|
217
|
-
.option("--gh <owner/repo[/path]>", "GitHub provenance shorthand for adopted extension")
|
|
218
|
-
.option("--github <owner/repo[/path]>", "Alias for --gh")
|
|
219
|
-
.option("--ref <ref>", "Git ref/branch/tag for GitHub shorthand source")
|
|
220
|
-
.description("Adopt an existing unmanaged extension into managed metadata.")).action(async (target, _options, command) => {
|
|
221
|
-
await executeExtensionCommand(target, command.opts(), command, "adopt");
|
|
222
|
-
});
|
|
223
|
-
addExtensionScopeOptions(extensionCommand.command("adopt-all").description("Adopt all unmanaged extensions into managed metadata.")).action(async (_options, command) => {
|
|
224
|
-
await executeExtensionCommand(undefined, command.opts(), command, "adopt-all");
|
|
225
|
-
});
|
|
226
|
-
addExtensionScopeOptions(extensionCommand.command("activate").argument("<target>", "Extension name").description("Activate an extension in selected scope settings.")).action(async (target, _options, command) => {
|
|
227
|
-
await executeExtensionCommand(target, command.opts(), command, "activate");
|
|
228
|
-
});
|
|
229
|
-
addExtensionScopeOptions(extensionCommand.command("deactivate").argument("<target>", "Extension name").description("Deactivate an extension in selected scope settings.")).action(async (target, _options, command) => {
|
|
230
|
-
await executeExtensionCommand(target, command.opts(), command, "deactivate");
|
|
231
|
-
});
|
|
232
|
-
const templatesCommand = program
|
|
233
|
-
.command("templates")
|
|
234
|
-
.description("Manage reusable create templates.")
|
|
235
|
-
.action(async () => {
|
|
236
|
-
const globalOptions = program.opts();
|
|
237
|
-
const result = await runTemplatesList(globalOptions);
|
|
238
|
-
printResult(result, globalOptions);
|
|
239
|
-
});
|
|
240
|
-
templatesCommand
|
|
241
|
-
.command("save")
|
|
242
|
-
.argument("<name>", "Template name")
|
|
243
|
-
.option("--title, -t <value>", "Template default item title")
|
|
244
|
-
.option("--description, -d <value>", "Template default item description")
|
|
245
|
-
.option("--type <value>", "Template default item type")
|
|
246
|
-
.option("--status, -s <value>", "Template default item status")
|
|
247
|
-
.option("--priority, -p <value>", "Template default priority 0..4")
|
|
248
|
-
.option("--tags <value>", "Template default comma-separated tags")
|
|
249
|
-
.option("--body, -b <value>", "Template default item markdown body")
|
|
250
|
-
.option("--deadline <value>", "Template default deadline")
|
|
251
|
-
.option("--estimate, --estimated-minutes <value>", "Template default estimated minutes")
|
|
252
|
-
.option("--estimated_minutes <value>", "Alias for --estimated-minutes")
|
|
253
|
-
.option("--acceptance-criteria <value>", "Template default acceptance criteria")
|
|
254
|
-
.option("--acceptance_criteria <value>", "Alias for --acceptance-criteria")
|
|
255
|
-
.option("--ac <value>", "Alias for --acceptance-criteria")
|
|
256
|
-
.option("--definition-of-ready <value>", "Template default definition of ready")
|
|
257
|
-
.option("--definition_of_ready <value>", "Alias for --definition-of-ready")
|
|
258
|
-
.option("--order <value>", "Template default planning order/rank integer")
|
|
259
|
-
.option("--rank <value>", "Alias for --order")
|
|
260
|
-
.option("--goal <value>", "Template default goal identifier")
|
|
261
|
-
.option("--objective <value>", "Template default objective identifier")
|
|
262
|
-
.option("--value <value>", "Template default business value summary")
|
|
263
|
-
.option("--impact <value>", "Template default business impact summary")
|
|
264
|
-
.option("--outcome <value>", "Template default expected outcome summary")
|
|
265
|
-
.option("--why-now <value>", "Template default why-now rationale")
|
|
266
|
-
.option("--why_now <value>", "Alias for --why-now")
|
|
267
|
-
.option("--author <value>", "Template default mutation author")
|
|
268
|
-
.option("--message <value>", "Template default history message")
|
|
269
|
-
.option("--assignee <value>", "Template default assignee")
|
|
270
|
-
.option("--parent <value>", "Template default parent item ID")
|
|
271
|
-
.option("--reviewer <value>", "Template default reviewer")
|
|
272
|
-
.option("--risk <value>", "Template default risk level")
|
|
273
|
-
.option("--confidence <value>", "Template default confidence")
|
|
274
|
-
.option("--sprint <value>", "Template default sprint identifier")
|
|
275
|
-
.option("--release <value>", "Template default release identifier")
|
|
276
|
-
.option("--blocked-by <value>", "Template default blocked-by item ID or reason")
|
|
277
|
-
.option("--blocked_by <value>", "Alias for --blocked-by")
|
|
278
|
-
.option("--blocked-reason <value>", "Template default blocked reason")
|
|
279
|
-
.option("--blocked_reason <value>", "Alias for --blocked-reason")
|
|
280
|
-
.option("--unblock-note <value>", "Template default unblock rationale note")
|
|
281
|
-
.option("--unblock_note <value>", "Alias for --unblock-note")
|
|
282
|
-
.option("--reporter <value>", "Template default issue reporter")
|
|
283
|
-
.option("--severity <value>", "Template default issue severity")
|
|
284
|
-
.option("--environment <value>", "Template default issue environment context")
|
|
285
|
-
.option("--repro-steps <value>", "Template default issue reproduction steps")
|
|
286
|
-
.option("--repro_steps <value>", "Alias for --repro-steps")
|
|
287
|
-
.option("--resolution <value>", "Template default issue resolution summary")
|
|
288
|
-
.option("--expected-result <value>", "Template default issue expected behavior")
|
|
289
|
-
.option("--expected_result <value>", "Alias for --expected-result")
|
|
290
|
-
.option("--actual-result <value>", "Template default issue observed behavior")
|
|
291
|
-
.option("--actual_result <value>", "Alias for --actual-result")
|
|
292
|
-
.option("--affected-version <value>", "Template default affected version identifier")
|
|
293
|
-
.option("--affected_version <value>", "Alias for --affected-version")
|
|
294
|
-
.option("--fixed-version <value>", "Template default fixed version identifier")
|
|
295
|
-
.option("--fixed_version <value>", "Alias for --fixed-version")
|
|
296
|
-
.option("--component <value>", "Template default issue component ownership")
|
|
297
|
-
.option("--regression <value>", "Template default regression marker")
|
|
298
|
-
.option("--customer-impact <value>", "Template default customer impact summary")
|
|
299
|
-
.option("--customer_impact <value>", "Alias for --customer-impact")
|
|
300
|
-
.option("--dep <value>", "Template default dependency entry (repeatable; CSV/markdown pairs or - for stdin)", collect)
|
|
301
|
-
.option("--type-option <value>", "Template default type option entry (repeatable; key=value or markdown pairs; use - for stdin)", collect)
|
|
302
|
-
.option("--type_option <value>", "Alias for --type-option", collect)
|
|
303
|
-
.option("--reminder <value>", "Template default reminder entry (repeatable; at=<iso|relative>,text=<text>)", collect)
|
|
304
|
-
.option("--event <value>", "Template default event entry (repeatable; start/end/title/recur_* fields)", collect)
|
|
305
|
-
.option("--comment <value>", "Template default comment seed entry (repeatable; text=<value> CSV/markdown pairs or - for stdin)", collect)
|
|
306
|
-
.option("--note <value>", "Template default note seed entry (repeatable; text=<value> CSV/markdown pairs or - for stdin)", collect)
|
|
307
|
-
.option("--learning <value>", "Template default learning seed entry (repeatable; text=<value> CSV/markdown pairs or - for stdin)", collect)
|
|
308
|
-
.option("--file <value>", "Template default linked file entry (repeatable; CSV/markdown pairs or - for stdin)", collect)
|
|
309
|
-
.option("--test <value>", "Template default linked test entry (repeatable; CSV/markdown pairs or - for stdin)", collect)
|
|
310
|
-
.option("--doc <value>", "Template default linked doc entry (repeatable; CSV/markdown pairs or - for stdin)", collect)
|
|
311
|
-
.description("Save or update a named create template.")
|
|
312
|
-
.action(async (name, options, command) => {
|
|
313
|
-
const globalOptions = getGlobalOptions(command);
|
|
314
|
-
const startedAt = Date.now();
|
|
315
|
-
const normalized = normalizeCreateOptions(options, { requireType: false });
|
|
316
|
-
const result = await runTemplatesSave(name, normalized, globalOptions);
|
|
317
|
-
printResult(result, globalOptions);
|
|
318
|
-
if (globalOptions.profile) {
|
|
319
|
-
printError(`profile:command=templates save took_ms=${Date.now() - startedAt}`);
|
|
320
|
-
}
|
|
321
|
-
});
|
|
322
|
-
templatesCommand
|
|
323
|
-
.command("list")
|
|
324
|
-
.description("List saved create templates.")
|
|
325
|
-
.action(async (_options, command) => {
|
|
302
|
+
addPackageScopeOptions(program
|
|
303
|
+
.command("upgrade")
|
|
304
|
+
.argument("[target]", "Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages")
|
|
305
|
+
.option("--dry-run", "Plan CLI/package upgrades without running npm or reinstalling packages")
|
|
306
|
+
.option("--cli-only", "Upgrade only the pm CLI/SDK npm package")
|
|
307
|
+
.option("--packages-only", "Upgrade only managed pm packages")
|
|
308
|
+
.option("--repair", "Force npm global reinstall when upgrading the pm CLI/SDK")
|
|
309
|
+
.option("--tag <value>", "npm dist-tag/version for CLI and registry package upgrades")
|
|
310
|
+
.option("--package-name <value>", "Override the CLI package name for self-upgrade testing")
|
|
311
|
+
.description("Upgrade the pm CLI/SDK and refresh managed installable pm packages.")).action(async (target, _options, command) => {
|
|
326
312
|
const globalOptions = getGlobalOptions(command);
|
|
327
313
|
const startedAt = Date.now();
|
|
328
|
-
const
|
|
314
|
+
const { runUpgrade } = await loadSetupCommandsModule();
|
|
315
|
+
const result = await runUpgrade(target, command.opts(), globalOptions);
|
|
329
316
|
printResult(result, globalOptions);
|
|
330
|
-
if (
|
|
331
|
-
|
|
317
|
+
if (!result.ok) {
|
|
318
|
+
process.exitCode = EXIT_CODE.GENERIC_FAILURE;
|
|
332
319
|
}
|
|
333
|
-
});
|
|
334
|
-
templatesCommand
|
|
335
|
-
.command("show")
|
|
336
|
-
.argument("<name>", "Template name")
|
|
337
|
-
.description("Show saved create template details.")
|
|
338
|
-
.action(async (name, _options, command) => {
|
|
339
|
-
const globalOptions = getGlobalOptions(command);
|
|
340
|
-
const startedAt = Date.now();
|
|
341
|
-
const result = await runTemplatesShow(name, globalOptions);
|
|
342
|
-
printResult(result, globalOptions);
|
|
343
320
|
if (globalOptions.profile) {
|
|
344
|
-
printError(`profile:command=
|
|
321
|
+
printError(`profile:command=upgrade took_ms=${Date.now() - startedAt}`);
|
|
345
322
|
}
|
|
346
323
|
});
|
|
347
324
|
}
|