@unbrained/pm-cli 2026.6.11 → 2026.6.12

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 (180) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/cli/commands/completion.js +20 -8
  3. package/dist/cli/commands/completion.js.map +1 -1
  4. package/dist/cli/commands/create.js +6 -3
  5. package/dist/cli/commands/create.js.map +1 -1
  6. package/dist/cli/commands/docs.d.ts +2 -0
  7. package/dist/cli/commands/docs.js +2 -2
  8. package/dist/cli/commands/docs.js.map +1 -1
  9. package/dist/cli/commands/files.d.ts +2 -0
  10. package/dist/cli/commands/files.js +2 -2
  11. package/dist/cli/commands/files.js.map +1 -1
  12. package/dist/cli/commands/health.d.ts +1 -1
  13. package/dist/cli/commands/health.js +77 -2
  14. package/dist/cli/commands/health.js.map +1 -1
  15. package/dist/cli/commands/history-repair.d.ts +36 -0
  16. package/dist/cli/commands/history-repair.js +68 -3
  17. package/dist/cli/commands/history-repair.js.map +1 -1
  18. package/dist/cli/commands/index.d.ts +1 -1
  19. package/dist/cli/commands/index.js +3 -3
  20. package/dist/cli/commands/index.js.map +1 -1
  21. package/dist/cli/commands/linked-artifacts.d.ts +18 -0
  22. package/dist/cli/commands/linked-artifacts.js +26 -3
  23. package/dist/cli/commands/linked-artifacts.js.map +1 -1
  24. package/dist/cli/commands/plan.d.ts +6 -0
  25. package/dist/cli/commands/plan.js +93 -32
  26. package/dist/cli/commands/plan.js.map +1 -1
  27. package/dist/cli/commands/validate.d.ts +20 -0
  28. package/dist/cli/commands/validate.js +292 -28
  29. package/dist/cli/commands/validate.js.map +1 -1
  30. package/dist/cli/help-content.js +7 -3
  31. package/dist/cli/help-content.js.map +1 -1
  32. package/dist/cli/register-mutation.js +47 -16
  33. package/dist/cli/register-mutation.js.map +1 -1
  34. package/dist/cli/register-operations.js +10 -2
  35. package/dist/cli/register-operations.js.map +1 -1
  36. package/dist/cli/register-setup.js +16 -16
  37. package/dist/cli/register-setup.js.map +1 -1
  38. package/dist/cli-bundle/chunks/{chunk-P2PSODAQ.js → chunk-35P4GT6E.js} +110 -9
  39. package/dist/cli-bundle/chunks/chunk-35P4GT6E.js.map +7 -0
  40. package/dist/cli-bundle/chunks/{chunk-B65UUCGQ.js → chunk-37CYVF73.js} +2 -2
  41. package/dist/cli-bundle/chunks/{chunk-J3GD64J2.js → chunk-7AMK6DOW.js} +4 -4
  42. package/dist/cli-bundle/chunks/{chunk-J3GD64J2.js.map → chunk-7AMK6DOW.js.map} +1 -1
  43. package/dist/cli-bundle/chunks/{chunk-IKOH24GZ.js → chunk-AX4GEVQC.js} +3 -3
  44. package/dist/cli-bundle/chunks/{chunk-IKOH24GZ.js.map → chunk-AX4GEVQC.js.map} +2 -2
  45. package/dist/cli-bundle/chunks/chunk-C6SAP27O.js +187 -0
  46. package/dist/cli-bundle/chunks/chunk-C6SAP27O.js.map +1 -0
  47. package/dist/cli-bundle/chunks/chunk-EKS6O2IR.js +217 -0
  48. package/dist/cli-bundle/chunks/chunk-EKS6O2IR.js.map +1 -0
  49. package/dist/cli-bundle/chunks/{chunk-PSD7F7DX.js → chunk-KBPQHXWG.js} +17 -4
  50. package/dist/cli-bundle/chunks/chunk-KBPQHXWG.js.map +1 -0
  51. package/dist/cli-bundle/chunks/{chunk-3SLOMKCJ.js → chunk-L5EPZQIC.js} +2 -2
  52. package/dist/cli-bundle/chunks/chunk-NAWVUHXH.js +220 -0
  53. package/dist/cli-bundle/chunks/chunk-NAWVUHXH.js.map +7 -0
  54. package/dist/cli-bundle/chunks/{chunk-UOO6BYIA.js → chunk-PNYAAB4S.js} +21 -188
  55. package/dist/cli-bundle/chunks/chunk-PNYAAB4S.js.map +1 -0
  56. package/dist/cli-bundle/chunks/chunk-R2OUQVBK.js +190 -0
  57. package/dist/cli-bundle/chunks/chunk-R2OUQVBK.js.map +7 -0
  58. package/dist/cli-bundle/chunks/{chunk-LCSCXBGT.js → chunk-R4VWYWRN.js} +19 -193
  59. package/dist/cli-bundle/chunks/chunk-R4VWYWRN.js.map +7 -0
  60. package/dist/cli-bundle/chunks/{chunk-7RIT3OCD.js → chunk-SO55HRA5.js} +2 -2
  61. package/dist/cli-bundle/chunks/{chunk-FXRU333M.js → chunk-UIG4TW2H.js} +110 -9
  62. package/dist/cli-bundle/chunks/chunk-UIG4TW2H.js.map +1 -0
  63. package/dist/cli-bundle/chunks/{chunk-E5DUIJA4.js → chunk-WPDMBIX6.js} +16 -3
  64. package/dist/cli-bundle/chunks/chunk-WPDMBIX6.js.map +7 -0
  65. package/dist/cli-bundle/chunks/{chunk-IH4MBKK7.js → chunk-XWMF3POR.js} +2 -2
  66. package/dist/cli-bundle/chunks/{contracts-3NKWYKKU.js → contracts-2G66IGIA.js} +2 -2
  67. package/dist/cli-bundle/chunks/{contracts-MIXBWJIB.js → contracts-PJCHYSO5.js} +2 -2
  68. package/dist/cli-bundle/chunks/{create-IFA26O2I.js → create-5433DP3G.js} +2 -2
  69. package/dist/cli-bundle/chunks/{create-JVXYHYH4.js → create-VWLWS34Z.js} +2 -2
  70. package/dist/cli-bundle/chunks/{docs-5WMBVQT2.js → docs-I3BAF5WH.js} +4 -4
  71. package/dist/cli-bundle/chunks/docs-I3BAF5WH.js.map +1 -0
  72. package/dist/cli-bundle/chunks/{docs-MB53UJAJ.js → docs-MXLGZUIT.js} +3 -3
  73. package/dist/cli-bundle/chunks/docs-MXLGZUIT.js.map +7 -0
  74. package/dist/cli-bundle/chunks/{files-GVMNVLCB.js → files-FYP3MDPX.js} +3 -3
  75. package/dist/cli-bundle/chunks/files-FYP3MDPX.js.map +7 -0
  76. package/dist/cli-bundle/chunks/{files-DLB5LJEP.js → files-GUXUM2MB.js} +4 -4
  77. package/dist/cli-bundle/chunks/files-GUXUM2MB.js.map +1 -0
  78. package/dist/cli-bundle/chunks/{gc-2WEPW6D6.js → gc-FENB2ESG.js} +12 -174
  79. package/dist/cli-bundle/chunks/gc-FENB2ESG.js.map +1 -0
  80. package/dist/cli-bundle/chunks/{gc-4Z3IKHAZ.js → gc-KGQG66SA.js} +10 -179
  81. package/dist/cli-bundle/chunks/gc-KGQG66SA.js.map +7 -0
  82. package/dist/cli-bundle/chunks/{health-YO5LRWN4.js → health-7MTXAVR2.js} +71 -4
  83. package/dist/cli-bundle/chunks/health-7MTXAVR2.js.map +7 -0
  84. package/dist/cli-bundle/chunks/{health-4ZYB3IYQ.js → health-E4D7KGHD.js} +72 -5
  85. package/dist/cli-bundle/chunks/health-E4D7KGHD.js.map +1 -0
  86. package/dist/cli-bundle/chunks/{history-repair-KVPFJKOS.js → history-repair-OSQOKJ3E.js} +61 -3
  87. package/dist/cli-bundle/chunks/history-repair-OSQOKJ3E.js.map +7 -0
  88. package/dist/cli-bundle/chunks/{history-repair-RUGKD3YR.js → history-repair-SBK7P34V.js} +62 -4
  89. package/dist/cli-bundle/chunks/history-repair-SBK7P34V.js.map +1 -0
  90. package/dist/cli-bundle/chunks/{plan-VNUG3WZZ.js → plan-2YTQYWGM.js} +52 -12
  91. package/dist/cli-bundle/chunks/plan-2YTQYWGM.js.map +1 -0
  92. package/dist/cli-bundle/chunks/{plan-FQLMJRLZ.js → plan-7IVSICR6.js} +51 -11
  93. package/dist/cli-bundle/chunks/plan-7IVSICR6.js.map +7 -0
  94. package/dist/cli-bundle/chunks/{register-list-query-VHDXWEPP.js → register-list-query-4UPMHONX.js} +3 -3
  95. package/dist/cli-bundle/chunks/{register-list-query-NPE3ECJQ.js → register-list-query-7VOW2C3W.js} +3 -3
  96. package/dist/cli-bundle/chunks/{register-mutation-EAYNLGOS.js → register-mutation-FARSGYRD.js} +43 -26
  97. package/dist/cli-bundle/chunks/{register-mutation-EAYNLGOS.js.map → register-mutation-FARSGYRD.js.map} +2 -2
  98. package/dist/cli-bundle/chunks/{register-mutation-DG53FCBV.js → register-mutation-LJDNVREU.js} +44 -27
  99. package/dist/cli-bundle/chunks/{register-mutation-DG53FCBV.js.map → register-mutation-LJDNVREU.js.map} +1 -1
  100. package/dist/cli-bundle/chunks/{register-operations-AM6KTWB6.js → register-operations-FFTYAL42.js} +17 -13
  101. package/dist/cli-bundle/chunks/register-operations-FFTYAL42.js.map +1 -0
  102. package/dist/cli-bundle/chunks/{register-operations-FWFE64JG.js → register-operations-HCJKDUA6.js} +16 -12
  103. package/dist/cli-bundle/chunks/{register-operations-FWFE64JG.js.map → register-operations-HCJKDUA6.js.map} +2 -2
  104. package/dist/cli-bundle/chunks/{register-setup-IKX5524L.js → register-setup-6AVIUOCC.js} +19 -19
  105. package/dist/cli-bundle/chunks/register-setup-6AVIUOCC.js.map +1 -0
  106. package/dist/cli-bundle/chunks/{register-setup-G4QYI3RX.js → register-setup-KVNLO5OJ.js} +18 -18
  107. package/dist/cli-bundle/chunks/register-setup-KVNLO5OJ.js.map +7 -0
  108. package/dist/cli-bundle/chunks/{update-2EVXOC7V.js → update-36JM7YZT.js} +3 -3
  109. package/dist/cli-bundle/chunks/{update-5A2B6QYB.js → update-I246PCLO.js} +3 -3
  110. package/dist/cli-bundle/chunks/{update-many-V4LA3C4H.js → update-many-F4IKDWZB.js} +3 -3
  111. package/dist/cli-bundle/chunks/{update-many-TUGU5YXQ.js → update-many-NTWZ5YT3.js} +3 -3
  112. package/dist/cli-bundle/chunks/{validate-EQTT6WVX.js → validate-46KCRHL7.js} +448 -36
  113. package/dist/cli-bundle/chunks/validate-46KCRHL7.js.map +1 -0
  114. package/dist/cli-bundle/chunks/{validate-XN4I4DPL.js → validate-CRFMPTYD.js} +468 -35
  115. package/dist/cli-bundle/chunks/validate-CRFMPTYD.js.map +7 -0
  116. package/dist/cli-bundle/main.js +24 -10
  117. package/dist/cli-bundle/main.js.map +2 -2
  118. package/dist/core/diagnostics/remediation.js +19 -6
  119. package/dist/core/diagnostics/remediation.js.map +1 -1
  120. package/dist/core/lock/lock-gc.d.ts +31 -0
  121. package/dist/core/lock/lock-gc.js +120 -62
  122. package/dist/core/lock/lock-gc.js.map +1 -1
  123. package/dist/core/telemetry/consent.js +18 -3
  124. package/dist/core/telemetry/consent.js.map +1 -1
  125. package/dist/core/validate/fix-planning.d.ts +130 -0
  126. package/dist/core/validate/fix-planning.js +202 -0
  127. package/dist/core/validate/fix-planning.js.map +1 -0
  128. package/dist/core/validate/missing-by-type.d.ts +21 -0
  129. package/dist/core/validate/missing-by-type.js +39 -0
  130. package/dist/core/validate/missing-by-type.js.map +1 -0
  131. package/dist/core/validate/stale-file-classification.d.ts +41 -0
  132. package/dist/core/validate/stale-file-classification.js +73 -0
  133. package/dist/core/validate/stale-file-classification.js.map +1 -0
  134. package/dist/mcp/server.js +41 -8
  135. package/dist/mcp/server.js.map +1 -1
  136. package/dist/sdk/cli-contracts/tool-parameter-tables.js +38 -2
  137. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  138. package/dist/sdk/cli-contracts.d.ts +6 -1
  139. package/dist/sdk/cli-contracts.js +74 -7
  140. package/dist/sdk/cli-contracts.js.map +1 -1
  141. package/docs/AGENT_GUIDE.md +6 -1
  142. package/docs/COMMANDS.md +23 -1
  143. package/package.json +1 -1
  144. package/dist/cli-bundle/chunks/chunk-E5DUIJA4.js.map +0 -7
  145. package/dist/cli-bundle/chunks/chunk-FXRU333M.js.map +0 -1
  146. package/dist/cli-bundle/chunks/chunk-LCSCXBGT.js.map +0 -7
  147. package/dist/cli-bundle/chunks/chunk-P2PSODAQ.js.map +0 -7
  148. package/dist/cli-bundle/chunks/chunk-PSD7F7DX.js.map +0 -1
  149. package/dist/cli-bundle/chunks/chunk-UOO6BYIA.js.map +0 -1
  150. package/dist/cli-bundle/chunks/docs-5WMBVQT2.js.map +0 -1
  151. package/dist/cli-bundle/chunks/docs-MB53UJAJ.js.map +0 -7
  152. package/dist/cli-bundle/chunks/files-DLB5LJEP.js.map +0 -1
  153. package/dist/cli-bundle/chunks/files-GVMNVLCB.js.map +0 -7
  154. package/dist/cli-bundle/chunks/gc-2WEPW6D6.js.map +0 -1
  155. package/dist/cli-bundle/chunks/gc-4Z3IKHAZ.js.map +0 -7
  156. package/dist/cli-bundle/chunks/health-4ZYB3IYQ.js.map +0 -1
  157. package/dist/cli-bundle/chunks/health-YO5LRWN4.js.map +0 -7
  158. package/dist/cli-bundle/chunks/history-repair-KVPFJKOS.js.map +0 -7
  159. package/dist/cli-bundle/chunks/history-repair-RUGKD3YR.js.map +0 -1
  160. package/dist/cli-bundle/chunks/plan-FQLMJRLZ.js.map +0 -7
  161. package/dist/cli-bundle/chunks/plan-VNUG3WZZ.js.map +0 -1
  162. package/dist/cli-bundle/chunks/register-operations-AM6KTWB6.js.map +0 -1
  163. package/dist/cli-bundle/chunks/register-setup-G4QYI3RX.js.map +0 -7
  164. package/dist/cli-bundle/chunks/register-setup-IKX5524L.js.map +0 -1
  165. package/dist/cli-bundle/chunks/validate-EQTT6WVX.js.map +0 -1
  166. package/dist/cli-bundle/chunks/validate-XN4I4DPL.js.map +0 -7
  167. /package/dist/cli-bundle/chunks/{chunk-B65UUCGQ.js.map → chunk-37CYVF73.js.map} +0 -0
  168. /package/dist/cli-bundle/chunks/{chunk-3SLOMKCJ.js.map → chunk-L5EPZQIC.js.map} +0 -0
  169. /package/dist/cli-bundle/chunks/{chunk-7RIT3OCD.js.map → chunk-SO55HRA5.js.map} +0 -0
  170. /package/dist/cli-bundle/chunks/{chunk-IH4MBKK7.js.map → chunk-XWMF3POR.js.map} +0 -0
  171. /package/dist/cli-bundle/chunks/{contracts-3NKWYKKU.js.map → contracts-2G66IGIA.js.map} +0 -0
  172. /package/dist/cli-bundle/chunks/{contracts-MIXBWJIB.js.map → contracts-PJCHYSO5.js.map} +0 -0
  173. /package/dist/cli-bundle/chunks/{create-IFA26O2I.js.map → create-5433DP3G.js.map} +0 -0
  174. /package/dist/cli-bundle/chunks/{create-JVXYHYH4.js.map → create-VWLWS34Z.js.map} +0 -0
  175. /package/dist/cli-bundle/chunks/{register-list-query-VHDXWEPP.js.map → register-list-query-4UPMHONX.js.map} +0 -0
  176. /package/dist/cli-bundle/chunks/{register-list-query-NPE3ECJQ.js.map → register-list-query-7VOW2C3W.js.map} +0 -0
  177. /package/dist/cli-bundle/chunks/{update-2EVXOC7V.js.map → update-36JM7YZT.js.map} +0 -0
  178. /package/dist/cli-bundle/chunks/{update-5A2B6QYB.js.map → update-I246PCLO.js.map} +0 -0
  179. /package/dist/cli-bundle/chunks/{update-many-V4LA3C4H.js.map → update-many-F4IKDWZB.js.map} +0 -0
  180. /package/dist/cli-bundle/chunks/{update-many-TUGU5YXQ.js.map → update-many-NTWZ5YT3.js.map} +0 -0
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="91207821-104c-58e1-8a8f-259822fd06d3")}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]="227d8bfe-b531-50fb-a2f0-b43b2855cd2b")}catch(e){}}();
3
3
  import { pathExists } from "../../core/fs/fs-utils.js";
4
4
  import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
5
5
  import { resolveItemTypeRegistry, resolveTypeName } from "../../core/item/type-registry.js";
@@ -38,6 +38,19 @@ function resolveAuthor(candidate, fallback) {
38
38
  const trimmed = resolved.trim();
39
39
  return trimmed.length > 0 ? trimmed : "unknown";
40
40
  }
41
+ /**
42
+ * pm-6mit: ordered step titles from repeated --step values. Unlike toArray
43
+ * this NEVER comma-splits — each --step value is one full step title, so
44
+ * titles containing commas survive intact (also why --step must not be
45
+ * list:true in contracts: the bootstrap coalescer would comma-join values).
46
+ */
47
+ function toOrderedStepTitles(value) {
48
+ const values = Array.isArray(value) ? value : value === undefined || value === null ? [] : [value];
49
+ return values
50
+ .filter((entry) => entry !== undefined && entry !== null)
51
+ .map((entry) => (typeof entry === "string" ? entry : String(entry)).trim())
52
+ .filter((entry) => entry.length > 0);
53
+ }
41
54
  function toArray(value) {
42
55
  if (Array.isArray(value))
43
56
  return value.flatMap((entry) => splitCommaList(entry, { unique: false }));
@@ -489,40 +502,85 @@ async function planCreate(options, global, ctx) {
489
502
  expected: initialValidationExpected || undefined,
490
503
  }
491
504
  : undefined;
492
- if (options.stepTitle?.trim()) {
505
+ // pm-6mit: collect ordered initial-step titles. Mixed-usage semantics
506
+ // (documented on pm-6mit): --step-title (when present) is the FIRST step,
507
+ // followed by each repeated --step value in argv order.
508
+ const stepTitleFlag = options.stepTitle?.trim();
509
+ const repeatedStepTitles = toOrderedStepTitles(options.step);
510
+ const stepTitles = stepTitleFlag ? [stepTitleFlag, ...repeatedStepTitles] : repeatedStepTitles;
511
+ const hasPerStepDetailOptions = Boolean(options.stepBody?.trim()) ||
512
+ Boolean(options.stepOwner?.trim()) ||
513
+ Boolean(options.stepStatus?.trim()) ||
514
+ Boolean(options.stepEvidence?.trim()) ||
515
+ Boolean(options.stepBlockedReason?.trim()) ||
516
+ Boolean(options.stepReplacement?.trim()) ||
517
+ toArray(options.dependsOn).length > 0 ||
518
+ toArray(options.link).length > 0 ||
519
+ toSpecArray(options.file).length > 0 ||
520
+ toSpecArray(options.test).length > 0 ||
521
+ toSpecArray(options.doc).length > 0;
522
+ if (stepTitles.length > 1 && hasPerStepDetailOptions) {
523
+ // Per-step detail flags target exactly one step; silently attaching them to
524
+ // the first (or all) of several seeded steps would be unpredictable.
525
+ throw new PmCliError("pm plan create per-step options apply to a single initial step; with multiple --step values create the plan first, then refine steps individually", EXIT_CODE.USAGE, {
526
+ code: "ambiguous_option_combination",
527
+ examples: [
528
+ 'pm plan create --title "Execution plan" --step "Read the code" --step "Write the fix"',
529
+ 'pm plan update-step <plan-id> plan-step-001 --step-body "Inspect retry path"',
530
+ ],
531
+ });
532
+ }
533
+ let initialSteps = [];
534
+ if (stepTitles.length === 1) {
493
535
  const status = asStepStatus(options.stepStatus, "pending");
494
536
  const linkedItems = buildLinkInputs(options, "depends_on");
495
537
  const files = toSpecArray(options.file).map(parseStepFile);
496
538
  const tests = toSpecArray(options.test).map(parseStepTest);
497
539
  const docs = toSpecArray(options.doc).map(parseStepDoc);
498
540
  const now = nowIso();
499
- initialStep = {
500
- id: "plan-step-001",
501
- order: 1,
502
- title: options.stepTitle.trim(),
503
- body: options.stepBody?.trim() || undefined,
504
- status,
505
- owner: options.stepOwner?.trim() || undefined,
506
- evidence: options.stepEvidence?.trim() || undefined,
507
- blocked_reason: status === "blocked" ? options.stepBlockedReason?.trim() || "" : undefined,
508
- linked_items: linkedItems.length > 0 ? linkedItems : undefined,
509
- files: files.length > 0 ? files : undefined,
510
- tests: tests.length > 0 ? tests : undefined,
511
- docs: docs.length > 0 ? docs : undefined,
541
+ initialSteps = [{
542
+ id: "plan-step-001",
543
+ order: 1,
544
+ title: stepTitles[0],
545
+ body: options.stepBody?.trim() || undefined,
546
+ status,
547
+ owner: options.stepOwner?.trim() || undefined,
548
+ evidence: options.stepEvidence?.trim() || undefined,
549
+ blocked_reason: status === "blocked" ? options.stepBlockedReason?.trim() || "" : undefined,
550
+ linked_items: linkedItems.length > 0 ? linkedItems : undefined,
551
+ files: files.length > 0 ? files : undefined,
552
+ tests: tests.length > 0 ? tests : undefined,
553
+ docs: docs.length > 0 ? docs : undefined,
554
+ created_at: now,
555
+ updated_at: now,
556
+ completed_at: status === "completed" ? now : undefined,
557
+ }];
558
+ }
559
+ else if (stepTitles.length > 1) {
560
+ const now = nowIso();
561
+ initialSteps = stepTitles.map((stepTitle, index) => ({
562
+ id: `${STEP_ID_PREFIX}${String(index + 1).padStart(3, "0")}`,
563
+ order: index + 1,
564
+ title: stepTitle,
565
+ status: "pending",
512
566
  created_at: now,
513
567
  updated_at: now,
514
- completed_at: status === "completed" ? now : undefined,
515
- };
568
+ }));
569
+ }
570
+ if (initialSteps.length > 0) {
571
+ initialStep = initialSteps[0];
516
572
  const stepped = await mutateItem({
517
573
  pmRoot: ctx.pmRoot,
518
574
  settings: ctx.settings,
519
575
  id: createResult.item.id,
520
576
  op: "plan_create_initial_step",
521
577
  author: resolveAuthor(options.author, ctx.settings.author_default),
522
- message: `plan create initial step "${initialStep.title}"`,
578
+ message: initialSteps.length === 1
579
+ ? `plan create initial step "${initialSteps[0].title}"`
580
+ : `plan create ${initialSteps.length} initial steps`,
523
581
  mutate(doc) {
524
582
  ensurePlanItem(doc.metadata);
525
- doc.metadata.plan_steps = [initialStep];
583
+ doc.metadata.plan_steps = initialSteps;
526
584
  if (initialValidation) {
527
585
  doc.metadata.plan_validation = [...(doc.metadata.plan_validation ?? []), initialValidation];
528
586
  }
@@ -547,18 +605,8 @@ async function planCreate(options, global, ctx) {
547
605
  });
548
606
  finalMetadata = validated.item;
549
607
  }
550
- else if (options.stepBody?.trim() ||
551
- options.stepOwner?.trim() ||
552
- options.stepStatus?.trim() ||
553
- options.stepEvidence?.trim() ||
554
- options.stepBlockedReason?.trim() ||
555
- options.stepReplacement?.trim() ||
556
- toArray(options.dependsOn).length > 0 ||
557
- toArray(options.link).length > 0 ||
558
- toSpecArray(options.file).length > 0 ||
559
- toSpecArray(options.test).length > 0 ||
560
- toSpecArray(options.doc).length > 0) {
561
- throw new PmCliError("pm plan create step options require --step-title", EXIT_CODE.USAGE, {
608
+ else if (hasPerStepDetailOptions) {
609
+ throw new PmCliError("pm plan create step options require --step-title (or a single --step)", EXIT_CODE.USAGE, {
562
610
  code: "missing_required_option",
563
611
  examples: ['pm plan create --title "Execution plan" --step-title "Read the code"'],
564
612
  });
@@ -1115,6 +1163,19 @@ async function planMaterialize(id, options, ctx) {
1115
1163
  }
1116
1164
  export async function runPlan(input) {
1117
1165
  const ctx = await loadContext(input.global);
1166
+ // pm-6mit: --step accumulates ordered step titles on create. For every other
1167
+ // subcommand a single --step value keeps its historical alias-of---step-title
1168
+ // behavior; multiple values would be ambiguous there (one step is targeted),
1169
+ // so they are rejected instead of silently dropping all but the last.
1170
+ if (input.subcommand !== "create") {
1171
+ const stepValues = toOrderedStepTitles(input.options.step);
1172
+ if (stepValues.length > 1) {
1173
+ throw new PmCliError(`pm plan ${input.subcommand} accepts a single --step/--step-title value (repeated --step seeds ordered steps only on pm plan create)`, EXIT_CODE.USAGE);
1174
+ }
1175
+ if (stepValues.length === 1 && !input.options.stepTitle?.trim()) {
1176
+ input = { ...input, options: { ...input.options, stepTitle: stepValues[0] } };
1177
+ }
1178
+ }
1118
1179
  switch (input.subcommand) {
1119
1180
  case "create":
1120
1181
  return planCreate(input.options, input.global, ctx);
@@ -1183,4 +1244,4 @@ export async function runPlan(input) {
1183
1244
  }
1184
1245
  }
1185
1246
  //# sourceMappingURL=plan.js.map
1186
- //# debugId=91207821-104c-58e1-8a8f-259822fd06d3
1247
+ //# debugId=227d8bfe-b531-50fb-a2f0-b43b2855cd2b