@unbrained/pm-cli 2026.8.25 → 2026.8.27

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.
Files changed (206) hide show
  1. package/.agents/skills/HARNESS_COMPATIBILITY.md +32 -0
  2. package/.agents/skills/README.md +47 -0
  3. package/.agents/skills/pm-developer/SKILL.md +117 -0
  4. package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +49 -0
  5. package/.agents/skills/pm-developer/references/GRAPH_AND_RELATIONSHIPS.md +91 -0
  6. package/.agents/skills/pm-developer/references/MULTI_AGENT_MERGE.md +72 -0
  7. package/.agents/skills/pm-developer/references/PROMPTS.md +17 -0
  8. package/.agents/skills/pm-developer/references/SCRIPTING_COMPOSITION.md +82 -0
  9. package/.agents/skills/pm-developer/references/TOKEN_BUDGETS.md +85 -0
  10. package/.agents/skills/pm-extensions/SKILL.md +106 -0
  11. package/.agents/skills/pm-extensions/references/AUTHORING.md +95 -0
  12. package/.agents/skills/pm-extensions/references/LIFECYCLE.md +40 -0
  13. package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +25 -0
  14. package/.agents/skills/pm-sdk/SKILL.md +107 -0
  15. package/.agents/skills/pm-sdk/references/DOMAIN_MODELING.md +78 -0
  16. package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +31 -0
  17. package/.agents/skills/pm-sdk/references/PROMPTS.md +13 -0
  18. package/.agents/skills/pm-sdk/references/SURFACE_MAP.md +82 -0
  19. package/.agents/skills/pm-user/SKILL.md +111 -0
  20. package/.agents/skills/pm-user/references/BACKLOG_SHAPING.md +105 -0
  21. package/.agents/skills/pm-user/references/PROMPTS.md +17 -0
  22. package/.agents/skills/pm-user/references/WORKFLOWS.md +35 -0
  23. package/.claude-plugin/marketplace.json +2 -2
  24. package/CHANGELOG.md +58 -3
  25. package/README.md +8 -5
  26. package/dist/cli/commander-usage.js +11 -7
  27. package/dist/cli/error-guidance.js +3 -3
  28. package/dist/cli/help-content.d.ts +2 -0
  29. package/dist/cli/help-content.js +53 -17
  30. package/dist/cli/help-json-payload.d.ts +8 -2
  31. package/dist/cli/help-json-payload.js +46 -12
  32. package/dist/cli/main.js +52 -74
  33. package/dist/cli/register-annotations.js +27 -21
  34. package/dist/cli/register-setup.js +98 -57
  35. package/dist/cli-bundle/bundle-manifest.json +156 -156
  36. package/dist/cli-bundle/chunks/chunk-3OO3W6FW.js +202 -0
  37. package/dist/cli-bundle/chunks/chunk-52EKTW6V.js +3 -0
  38. package/dist/cli-bundle/chunks/{chunk-QLUORNIB.js → chunk-CVBBGWW5.js} +62 -44
  39. package/dist/cli-bundle/chunks/chunk-MFNTKMTI.js +13 -0
  40. package/dist/cli-bundle/chunks/chunk-OS27HHBN.js +35 -0
  41. package/dist/cli-bundle/chunks/chunk-QTO7USTH.js +2 -0
  42. package/dist/cli-bundle/chunks/{chunk-5I5RWIJC.js → chunk-R4ETAOJC.js} +2 -2
  43. package/dist/cli-bundle/chunks/{chunk-OWHNAR2B.js → chunk-SH6P7FXI.js} +2 -2
  44. package/dist/cli-bundle/chunks/chunk-SHMDY36D.js +8 -0
  45. package/dist/cli-bundle/chunks/{chunk-244MI4GS.js → chunk-SKXLJIEK.js} +60 -60
  46. package/dist/cli-bundle/chunks/chunk-TNX6HC54.js +3 -0
  47. package/dist/cli-bundle/chunks/{register-list-query-XVN2ZLI7.js → register-list-query-EUWM6VII.js} +2 -2
  48. package/dist/cli-bundle/chunks/{register-mutation-QCKAEGIJ.js → register-mutation-FD4HSAVU.js} +4 -4
  49. package/dist/cli-bundle/chunks/{register-operations-SDEAXE7E.js → register-operations-HRMNFEC3.js} +2 -2
  50. package/dist/cli-bundle/chunks/register-setup-33GNICLX.js +2 -0
  51. package/dist/cli-bundle/focused-chunks/{chunk-IBZZZGK3.js → chunk-2AGZ5BRT.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/chunk-4BR5UU52.js +50 -0
  53. package/dist/cli-bundle/focused-chunks/{chunk-OHIHZ7HS.js → chunk-6GCRSLPG.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-OVJL6NZE.js → chunk-AD6ULRAF.js} +4 -4
  55. package/dist/cli-bundle/focused-chunks/{chunk-7YCDTCBC.js → chunk-AQ5IYEZZ.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-YO3ZF3FI.js → chunk-EKX37ZHA.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/{chunk-N7W67YIG.js → chunk-FC2AXLB5.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-H5JZEIQV.js → chunk-HC7ODMH3.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{chunk-NOOZGIXP.js → chunk-HVQ22RC4.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-A644DUFQ.js → chunk-MEASX544.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{chunk-RAFKLNZX.js → chunk-MXTYGECH.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-2UIWOP3O.js → chunk-SUBSWYW3.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{chunk-VXWATRFL.js → chunk-XDPYBQCF.js} +9 -9
  64. package/dist/cli-bundle/focused-chunks/{chunk-XUQPEKRN.js → chunk-Y3JJXRVK.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-GQR3WH3F.js → chunk-Y5A7SJJ7.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/chunk-YHWHX6YY.js +2 -0
  67. package/dist/cli-bundle/focused-chunks/{chunk-ONYQCALA.js → chunk-YVVZ3LQ6.js} +6 -6
  68. package/dist/cli-bundle/focused-chunks/chunk-Z2USIBR2.js +5 -0
  69. package/dist/cli-bundle/main.js +15 -14
  70. package/dist/cli-bundle/sdk-authoring.js +1 -1
  71. package/dist/cli-bundle/sdk-contracts.js +2 -2
  72. package/dist/cli-bundle/sdk-core.js +31 -31
  73. package/dist/cli-bundle/sdk-governance.js +1 -1
  74. package/dist/cli-bundle/sdk-graph.js +1 -1
  75. package/dist/cli-bundle/sdk-merge.js +31 -31
  76. package/dist/cli-bundle/sdk-query.js +1 -1
  77. package/dist/cli-bundle/sdk-runtime.js +1 -1
  78. package/dist/cli-bundle/sdk-testing.js +1 -1
  79. package/dist/cli-bundle/sdk.js +32 -6
  80. package/dist/core/extensions/manifest-schema.d.ts +20 -0
  81. package/dist/core/extensions/manifest-schema.js +28 -10
  82. package/dist/core/governance/issue-codes.d.ts +11 -2
  83. package/dist/core/governance/issue-codes.js +29 -10
  84. package/dist/core/item/item-format.js +3 -3
  85. package/dist/core/store/item-store.js +12 -5
  86. package/dist/mcp/http-server.d.ts +60 -0
  87. package/dist/mcp/http-server.js +451 -0
  88. package/dist/mcp/legacy-adapter.d.ts +50 -0
  89. package/dist/mcp/legacy-adapter.js +64 -0
  90. package/dist/mcp/server.d.ts +42 -9
  91. package/dist/mcp/server.js +572 -59
  92. package/dist/mcp/tool-definitions.d.ts +2 -0
  93. package/dist/mcp/tool-definitions.js +2 -2
  94. package/dist/sdk/agent/closed-domain-contracts.d.ts +1 -1
  95. package/dist/sdk/agent/closed-domain-contracts.js +24 -2
  96. package/dist/sdk/agent/refusal-closure-census.d.ts +6 -2
  97. package/dist/sdk/agent/refusal-closure-census.js +16 -8
  98. package/dist/sdk/agent-capability-contracts.js +6 -2
  99. package/dist/sdk/cli-bootstrap.js +3 -2
  100. package/dist/sdk/cli-contracts/command-aliases.js +15 -2
  101. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -1
  102. package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
  103. package/dist/sdk/cli-contracts/flag-contracts.js +9 -5
  104. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +3 -3
  105. package/dist/sdk/cli-contracts/grammar-contracts.js +24 -17
  106. package/dist/sdk/cli-contracts/runtime-contracts.js +13 -11
  107. package/dist/sdk/cli-contracts/tool-schema.js +18 -15
  108. package/dist/sdk/cli-contracts.d.ts +1 -1
  109. package/dist/sdk/cli-contracts.js +3 -3
  110. package/dist/sdk/cli-program.js +3 -2
  111. package/dist/sdk/completion.js +40 -13
  112. package/dist/sdk/compose.d.ts +4 -1
  113. package/dist/sdk/compose.js +23 -36
  114. package/dist/sdk/extension/author-manifest.d.ts +22 -0
  115. package/dist/sdk/extension/author-manifest.js +93 -0
  116. package/dist/sdk/extension.js +6 -3
  117. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +20 -5
  118. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +18 -3
  119. package/dist/sdk/governance/health.js +7 -2
  120. package/dist/sdk/governance/upgrade.d.ts +2 -0
  121. package/dist/sdk/governance/upgrade.js +30 -8
  122. package/dist/sdk/governance/validate.js +8 -6
  123. package/dist/sdk/guide-topics.js +6 -6
  124. package/dist/sdk/index.d.ts +10 -2
  125. package/dist/sdk/index.js +11 -3
  126. package/dist/sdk/mcp/apps.d.ts +70 -0
  127. package/dist/sdk/mcp/apps.js +154 -0
  128. package/dist/sdk/mcp/authorization.d.ts +134 -0
  129. package/dist/sdk/mcp/authorization.js +405 -0
  130. package/dist/sdk/mcp/interactions.d.ts +118 -0
  131. package/dist/sdk/mcp/interactions.js +337 -0
  132. package/dist/sdk/mcp/protocol.d.ts +142 -0
  133. package/dist/sdk/mcp/protocol.js +174 -0
  134. package/dist/sdk/mcp/skills.d.ts +127 -0
  135. package/dist/sdk/mcp/skills.js +390 -0
  136. package/dist/sdk/mcp/subscriptions.d.ts +65 -0
  137. package/dist/sdk/mcp/subscriptions.js +212 -0
  138. package/dist/sdk/mcp/tasks.d.ts +107 -0
  139. package/dist/sdk/mcp/tasks.js +431 -0
  140. package/dist/sdk/mcp/transport.d.ts +30 -0
  141. package/dist/sdk/mcp/transport.js +261 -0
  142. package/dist/sdk/merge/receipts.d.ts +16 -0
  143. package/dist/sdk/merge/receipts.js +9 -8
  144. package/dist/sdk/read-output-contracts.js +16 -3
  145. package/dist/sdk/runtime-action-aliases.js +7 -3
  146. package/dist/sdk/runtime-input.js +12 -4
  147. package/dist/sdk/runtime-primitives.d.ts +2 -2
  148. package/dist/sdk/runtime-primitives.js +4 -4
  149. package/dist/sdk/test/execution.d.ts +6 -0
  150. package/dist/sdk/test/execution.js +32 -3
  151. package/docs/AGENT_PROVENANCE_ADR.md +6 -4
  152. package/docs/AGENT_RUNTIME_PRIMITIVES.md +6 -5
  153. package/docs/CLAUDE_CODE_PLUGIN.md +12 -5
  154. package/docs/CLI_GRAMMAR.md +7 -1
  155. package/docs/COMMANDS.md +2 -2
  156. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +8 -0
  157. package/docs/EXTENSIONS.md +36 -36
  158. package/docs/MCP_2026_07_28.md +160 -0
  159. package/docs/MCP_2026_07_28_CONFORMANCE.md +30 -0
  160. package/docs/MCP_REMOTE_TRANSPORT_SECURITY.md +180 -0
  161. package/docs/MCP_SKILLS_AND_APPS.md +107 -0
  162. package/docs/QUICKSTART.md +15 -15
  163. package/docs/README.md +5 -0
  164. package/docs/RELEASING.md +12 -3
  165. package/docs/SDK.md +22 -1
  166. package/docs/SDK_AGENT_SESSION_CONTEXT.md +18 -13
  167. package/docs/SDK_CONTEXT_INTEGRITY.md +6 -0
  168. package/docs/SDK_EVIDENCE_TRACEABILITY.md +9 -1
  169. package/docs/SDK_MCP_INTERACTIONS.md +227 -0
  170. package/docs/TESTING.md +4 -0
  171. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +1 -1
  172. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +13 -11
  173. package/marketplace.json +2 -2
  174. package/package.json +15 -11
  175. package/packages/pm-beads/README.md +12 -6
  176. package/packages/pm-beads/docs/MIGRATION.md +53 -0
  177. package/packages/pm-beads/extensions/beads/index.ts +8 -0
  178. package/packages/pm-beads/extensions/beads/runtime.ts +671 -112
  179. package/packages/pm-beads/package.json +1 -1
  180. package/packages/pm-calendar/package.json +1 -1
  181. package/packages/pm-command-kit/package.json +1 -1
  182. package/packages/pm-digital-twin/package.json +1 -1
  183. package/packages/pm-governance-audit/package.json +1 -1
  184. package/packages/pm-guide-shell/package.json +1 -1
  185. package/packages/pm-kanban/package.json +1 -1
  186. package/packages/pm-lifecycle-hooks/package.json +1 -1
  187. package/packages/pm-linked-test-adapters/package.json +1 -1
  188. package/packages/pm-search-advanced/package.json +1 -1
  189. package/packages/pm-templates/package.json +1 -1
  190. package/packages/pm-todos/package.json +1 -1
  191. package/packages/pm-vcs/package.json +1 -1
  192. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  193. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  194. package/scripts/finalize-build.mjs +1 -0
  195. package/sdk/public-surface.json +902 -54
  196. package/dist/cli-bundle/chunks/chunk-2F3LUFMW.js +0 -8
  197. package/dist/cli-bundle/chunks/chunk-65MHLHAA.js +0 -2
  198. package/dist/cli-bundle/chunks/chunk-6C7GIMIL.js +0 -13
  199. package/dist/cli-bundle/chunks/chunk-QKGMHGEI.js +0 -202
  200. package/dist/cli-bundle/chunks/chunk-T2ENPRXF.js +0 -3
  201. package/dist/cli-bundle/chunks/chunk-TPQIBSL2.js +0 -3
  202. package/dist/cli-bundle/chunks/chunk-YQMYF3YD.js +0 -35
  203. package/dist/cli-bundle/chunks/register-setup-LXVBRCJ3.js +0 -2
  204. package/dist/cli-bundle/focused-chunks/chunk-42S3GGZ7.js +0 -50
  205. package/dist/cli-bundle/focused-chunks/chunk-7I23XGWO.js +0 -2
  206. package/dist/cli-bundle/focused-chunks/chunk-LMKG3DFE.js +0 -5
@@ -1,8 +1,9 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2a7939ad-52a6-5d9c-b7cf-2bc59a6b3d32")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="feb682f9-344c-569e-bbab-861fe20f08f1")}catch(e){}}();
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
5
- import { EXIT_CODE, PmCliError, } from "../sdk/runtime-primitives.js";
5
+ import { EXIT_CODE, PmCliError, readSettings, resolvePmRoot, } from "../sdk/runtime-primitives.js";
6
+ import { renderPmCommandAliasMigrationHint, resolvePmCommandAlias, } from "../sdk/cli-contracts.js";
6
7
  import { collect, getGlobalOptions, printError, printResult, writeStdout, } from "./registration-helpers.js";
7
8
  import { runExtension, } from "./commands/extension.js";
8
9
  import { SCAFFOLD_CAPABILITIES } from "./commands/extension/scaffold.js";
@@ -10,6 +11,20 @@ import { renderExtensionDescribeMarkdown, } from "./commands/extension/describe.
10
11
  import { runConfig } from "./commands/config.js";
11
12
  import { runInit, summarizeInitResult } from "./commands/init.js";
12
13
  import { runUpgrade } from "./commands/upgrade.js";
14
+ const LIFECYCLE_DEPRECATION_ALIASES = {
15
+ extension: "extension",
16
+ package: undefined,
17
+ };
18
+ async function emitDeprecatedAliasHint(alias, command) {
19
+ if (!alias)
20
+ return;
21
+ const aliasContract = resolvePmCommandAlias(alias);
22
+ const globalOptions = getGlobalOptions(command);
23
+ const deprecationHints = await readSettings(resolvePmRoot(process.cwd(), globalOptions.path)).then((settings) => settings.ux.deprecation_hints);
24
+ if (deprecationHints) {
25
+ printError(renderPmCommandAliasMigrationHint(aliasContract));
26
+ }
27
+ }
13
28
  const EXTENSION_ACTION_OPTION_KEYS = {
14
29
  init: "init",
15
30
  install: "install",
@@ -181,7 +196,9 @@ function applyExtensionDoctorStrictExit(result, normalizedOptions) {
181
196
  async function executeExtensionCommand(target, options, command, forcedAction, vocabulary = "extension") {
182
197
  const globalOptions = getGlobalOptions(command);
183
198
  const startedAt = Date.now();
184
- const normalizedOptions = normalizeExtensionOptions(options, forcedAction, vocabulary);
199
+ const effectiveVocabulary = vocabulary === "extension" ? "package" : vocabulary;
200
+ await emitDeprecatedAliasHint(LIFECYCLE_DEPRECATION_ALIASES[vocabulary], command);
201
+ const normalizedOptions = normalizeExtensionOptions(options, forcedAction, effectiveVocabulary);
185
202
  const outputOption = typeof normalizedOptions.output === "string"
186
203
  ? normalizedOptions.output
187
204
  : undefined;
@@ -191,7 +208,7 @@ async function executeExtensionCommand(target, options, command, forcedAction, v
191
208
  if (normalizedOptions.markdown === true) {
192
209
  await emitExtensionMarkdownResult({
193
210
  result,
194
- vocabulary,
211
+ vocabulary: effectiveVocabulary,
195
212
  outputPath,
196
213
  globalOptions,
197
214
  });
@@ -225,36 +242,13 @@ function serializeExtensionInstallError(error) {
225
242
  exit_code: EXIT_CODE.GENERIC_FAILURE,
226
243
  };
227
244
  }
228
- async function executeExtensionInstallCommand(targets, options, command, vocabulary) {
229
- const normalizedTargets = await normalizeInstallTargets(targets);
230
- if (normalizedTargets === undefined || normalizedTargets.length <= 1) {
231
- await executeExtensionCommand(normalizedTargets?.[0], options, command, "install", vocabulary);
232
- return;
233
- }
234
- const globalOptions = getGlobalOptions(command);
235
- const startedAt = Date.now();
236
- const normalizedOptions = normalizeExtensionOptions(options, "install", vocabulary);
237
- validateExtensionMarkdownOptions(normalizedOptions, globalOptions, undefined);
238
- const hasForcedGithubSource = [
239
- normalizedOptions.gh,
240
- normalizedOptions.github,
241
- ].some((value) => typeof value === "string" && value.trim().length > 0);
242
- if (hasForcedGithubSource) {
243
- throw new PmCliError("Multiple install targets cannot be combined with --gh/--github. Install one GitHub source per command, or pass multiple explicit local, bundled, or npm: targets.", EXIT_CODE.USAGE, {
244
- code: "multi_target_github_install_ambiguous",
245
- required: "Use exactly one positional target with --gh/--github, or omit --gh/--github when installing multiple targets.",
246
- examples: [
247
- "pm install --gh owner/repo",
248
- "pm install npm:pm-guide-shell pm-todos",
249
- ],
250
- });
251
- }
245
+ async function runMultiTargetExtensionInstalls(targets, options, globalOptions) {
252
246
  const rows = [];
253
247
  const warnings = [];
254
248
  let failureExitCode = EXIT_CODE.GENERIC_FAILURE;
255
- for (const target of normalizedTargets) {
249
+ for (const target of targets) {
256
250
  try {
257
- const result = await runExtension(target, normalizedOptions, globalOptions);
251
+ const result = await runExtension(target, options, globalOptions);
258
252
  const details = extractExtensionInstallDetails(result);
259
253
  const targetWarnings = Array.isArray(result.warnings)
260
254
  ? result.warnings
@@ -302,6 +296,35 @@ async function executeExtensionInstallCommand(targets, options, command, vocabul
302
296
  });
303
297
  }
304
298
  }
299
+ return { rows, warnings, failureExitCode };
300
+ }
301
+ async function executeExtensionInstallCommand(targets, options, command, vocabulary) {
302
+ const effectiveVocabulary = vocabulary === "extension" ? "package" : vocabulary;
303
+ await emitDeprecatedAliasHint(LIFECYCLE_DEPRECATION_ALIASES[vocabulary], command);
304
+ const normalizedTargets = await normalizeInstallTargets(targets);
305
+ if (normalizedTargets === undefined || normalizedTargets.length <= 1) {
306
+ await executeExtensionCommand(normalizedTargets?.[0], options, command, "install", effectiveVocabulary);
307
+ return;
308
+ }
309
+ const globalOptions = getGlobalOptions(command);
310
+ const startedAt = Date.now();
311
+ const normalizedOptions = normalizeExtensionOptions(options, "install", effectiveVocabulary);
312
+ validateExtensionMarkdownOptions(normalizedOptions, globalOptions, undefined);
313
+ const hasForcedGithubSource = [
314
+ normalizedOptions.gh,
315
+ normalizedOptions.github,
316
+ ].some((value) => typeof value === "string" && value.trim().length > 0);
317
+ if (hasForcedGithubSource) {
318
+ throw new PmCliError("Multiple install targets cannot be combined with --gh/--github. Install one GitHub source per command, or pass multiple explicit local, bundled, or npm: targets.", EXIT_CODE.USAGE, {
319
+ code: "multi_target_github_install_ambiguous",
320
+ required: "Use exactly one positional target with --gh/--github, or omit --gh/--github when installing multiple targets.",
321
+ examples: [
322
+ "pm install --gh owner/repo",
323
+ "pm install npm:pm-guide-shell pm-todos",
324
+ ],
325
+ });
326
+ }
327
+ const { rows, warnings, failureExitCode } = await runMultiTargetExtensionInstalls(normalizedTargets, normalizedOptions, globalOptions);
305
328
  const failedCount = rows.filter((row) => row.ok !== true).length;
306
329
  const result = {
307
330
  ok: failedCount === 0,
@@ -337,17 +360,41 @@ function addLifecycleScopeOptions(command, vocabulary) {
337
360
  ? addPackageScopeOptions(command)
338
361
  : addExtensionScopeOptions(command);
339
362
  }
363
+ function addUpgradeOptions(command) {
364
+ return command
365
+ .option("--dry-run", "Plan CLI/package upgrades without running npm or reinstalling packages")
366
+ .option("--cli-only", "Upgrade only the pm CLI/SDK npm package")
367
+ .option("--packages-only", "Upgrade only managed pm packages")
368
+ .option("--repair", "Force npm global reinstall when upgrading the pm CLI/SDK")
369
+ .option("--tag <value>", "npm dist-tag/version for CLI and registry package upgrades")
370
+ .option("--package-name <value>", "Override the CLI package name for self-upgrade testing");
371
+ }
372
+ async function executeUpgradeCommand(target, command, legacyAlias) {
373
+ const globalOptions = getGlobalOptions(command);
374
+ const startedAt = Date.now();
375
+ if (legacyAlias) {
376
+ await emitDeprecatedAliasHint("upgrade", command);
377
+ }
378
+ const result = await runUpgrade(target, command.opts(), globalOptions);
379
+ printResult(result, globalOptions);
380
+ if (!result.ok) {
381
+ process.exitCode = EXIT_CODE.GENERIC_FAILURE;
382
+ }
383
+ if (globalOptions.profile) {
384
+ printError(`profile:command=package-upgrade took_ms=${Date.now() - startedAt}`);
385
+ }
386
+ }
340
387
  function registerLifecycleCommand(program, vocabulary) {
341
388
  const noun = vocabulary === "package" ? "package" : "extension";
342
389
  const plural = vocabulary === "package" ? "packages" : "extensions";
343
390
  const commandName = vocabulary;
344
391
  const lifecycleCommand = program
345
- .command(commandName)
346
- .argument("[target]", `${noun[0].toUpperCase()}${noun.slice(1)} source/name or scaffold target path (for --init/--scaffold)`)
392
+ .command(commandName, { hidden: vocabulary === "extension" })
393
+ .argument("[target]", `${noun[0].toUpperCase()}${noun.slice(1)} source, name, or scaffold path`)
347
394
  .option("--init", `Generate a starter ${noun} scaffold at target path`)
348
395
  .option("--scaffold", "Alias for --init")
349
- .option("--capability <kind>", `Capability the --init starter targets (${SCAFFOLD_CAPABILITIES.join("|")}; default commands)`, collect)
350
- .option("--install", `Install ${noun} from local path, bundled alias, npm: source, wildcard, or GitHub source`)
396
+ .option("--capability <kind>", "Starter capability for --init (default: commands)", collect)
397
+ .option("--install", `Install a ${noun} source`)
351
398
  .option("--uninstall", `Uninstall an installed ${noun}`)
352
399
  .option("--explore", `List discovered ${plural} in selected scope`)
353
400
  .option("--list", "Alias for --explore")
@@ -378,8 +425,8 @@ function registerLifecycleCommand(program, vocabulary) {
378
425
  .option("--strict-exit", "Return non-zero exit when doctor warnings are present (ok=false)")
379
426
  .option("--fail-on-warn", "Alias for --strict-exit (doctor)")
380
427
  .description(vocabulary === "package"
381
- ? "Manage package lifecycle operations for project or global scope. Backward-compatible with extension packages."
382
- : "Manage extension lifecycle operations for project or global scope.")
428
+ ? "Manage package lifecycle in project or global scope."
429
+ : "Manage extension lifecycle in project or global scope.")
383
430
  .action(async (target, _options, command) => {
384
431
  await executeExtensionCommand(target, command.optsWithGlobals(), command, undefined, vocabulary);
385
432
  });
@@ -499,6 +546,14 @@ function registerLifecycleCommand(program, vocabulary) {
499
546
  .description(`Deactivate a ${noun} in selected scope settings.`), vocabulary).action(async (target, _options, command) => {
500
547
  await executeExtensionCommand(target, command.optsWithGlobals(), command, "deactivate", vocabulary);
501
548
  });
549
+ if (vocabulary === "package") {
550
+ addUpgradeOptions(addPackageScopeOptions(lifecycleCommand
551
+ .command("upgrade")
552
+ .argument("[target]", "Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages")
553
+ .description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async (target, _options, command) => {
554
+ await executeUpgradeCommand(target, command, false);
555
+ });
556
+ }
502
557
  }
503
558
  async function runInitCommandAction(prefix, options, command) {
504
559
  const globalOptions = getGlobalOptions(command);
@@ -642,35 +697,21 @@ export function registerSetupCommands(program) {
642
697
  registerLifecycleCommand(program, "extension");
643
698
  registerLifecycleCommand(program, "package");
644
699
  addPackageScopeOptions(program
645
- .command("install")
700
+ .command("install", { hidden: true })
646
701
  .argument("[targets...]", "Package source (local path, bundled alias, npm: source, wildcard, or GitHub source)")
647
702
  .option("--gh <github-source>", "Install from GitHub shorthand source (owner/repo[/path])")
648
703
  .option("--github <github-source>", "Alias for --gh")
649
704
  .option("--ref <ref>", "Git ref/branch/tag for GitHub install sources")
650
705
  .description("Install a pm package into the project package scope by default.")).action(async (targets, _options, command) => {
706
+ await emitDeprecatedAliasHint("install", command);
651
707
  await executeExtensionInstallCommand(targets, command.optsWithGlobals(), command, "package");
652
708
  });
653
- addPackageScopeOptions(program
654
- .command("upgrade")
709
+ addUpgradeOptions(addPackageScopeOptions(program
710
+ .command("upgrade", { hidden: true })
655
711
  .argument("[target]", "Optional managed package name/source to upgrade; omit to upgrade pm CLI and all managed packages")
656
- .option("--dry-run", "Plan CLI/package upgrades without running npm or reinstalling packages")
657
- .option("--cli-only", "Upgrade only the pm CLI/SDK npm package")
658
- .option("--packages-only", "Upgrade only managed pm packages")
659
- .option("--repair", "Force npm global reinstall when upgrading the pm CLI/SDK")
660
- .option("--tag <value>", "npm dist-tag/version for CLI and registry package upgrades")
661
- .option("--package-name <value>", "Override the CLI package name for self-upgrade testing")
662
- .description("Upgrade the pm CLI/SDK and refresh managed installable pm packages.")).action(async (target, _options, command) => {
663
- const globalOptions = getGlobalOptions(command);
664
- const startedAt = Date.now();
665
- const result = await runUpgrade(target, command.opts(), globalOptions);
666
- printResult(result, globalOptions);
667
- if (!result.ok) {
668
- process.exitCode = EXIT_CODE.GENERIC_FAILURE;
669
- }
670
- if (globalOptions.profile) {
671
- printError(`profile:command=upgrade took_ms=${Date.now() - startedAt}`);
672
- }
712
+ .description("Upgrade the pm CLI/SDK and refresh managed installable pm packages."))).action(async (target, _options, command) => {
713
+ await executeUpgradeCommand(target, command, true);
673
714
  });
674
715
  }
675
716
  //# sourceMappingURL=register-setup.js.map
676
- //# debugId=2a7939ad-52a6-5d9c-b7cf-2bc59a6b3d32
717
+ //# debugId=feb682f9-344c-569e-bbab-861fe20f08f1