@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.
- package/CHANGELOG.md +28 -0
- package/dist/cli/commands/completion.js +20 -8
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/create.js +6 -3
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/docs.d.ts +2 -0
- package/dist/cli/commands/docs.js +2 -2
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/files.d.ts +2 -0
- package/dist/cli/commands/files.js +2 -2
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/health.d.ts +1 -1
- package/dist/cli/commands/health.js +77 -2
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-repair.d.ts +36 -0
- package/dist/cli/commands/history-repair.js +68 -3
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.js +3 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/linked-artifacts.d.ts +18 -0
- package/dist/cli/commands/linked-artifacts.js +26 -3
- package/dist/cli/commands/linked-artifacts.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +6 -0
- package/dist/cli/commands/plan.js +93 -32
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +20 -0
- package/dist/cli/commands/validate.js +292 -28
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/help-content.js +7 -3
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/register-mutation.js +47 -16
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +10 -2
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +16 -16
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli-bundle/chunks/{chunk-P2PSODAQ.js → chunk-35P4GT6E.js} +110 -9
- package/dist/cli-bundle/chunks/chunk-35P4GT6E.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-B65UUCGQ.js → chunk-37CYVF73.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-J3GD64J2.js → chunk-7AMK6DOW.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-J3GD64J2.js.map → chunk-7AMK6DOW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-IKOH24GZ.js → chunk-AX4GEVQC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-IKOH24GZ.js.map → chunk-AX4GEVQC.js.map} +2 -2
- package/dist/cli-bundle/chunks/chunk-C6SAP27O.js +187 -0
- package/dist/cli-bundle/chunks/chunk-C6SAP27O.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-EKS6O2IR.js +217 -0
- package/dist/cli-bundle/chunks/chunk-EKS6O2IR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-PSD7F7DX.js → chunk-KBPQHXWG.js} +17 -4
- package/dist/cli-bundle/chunks/chunk-KBPQHXWG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3SLOMKCJ.js → chunk-L5EPZQIC.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-NAWVUHXH.js +220 -0
- package/dist/cli-bundle/chunks/chunk-NAWVUHXH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UOO6BYIA.js → chunk-PNYAAB4S.js} +21 -188
- package/dist/cli-bundle/chunks/chunk-PNYAAB4S.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-R2OUQVBK.js +190 -0
- package/dist/cli-bundle/chunks/chunk-R2OUQVBK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LCSCXBGT.js → chunk-R4VWYWRN.js} +19 -193
- package/dist/cli-bundle/chunks/chunk-R4VWYWRN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7RIT3OCD.js → chunk-SO55HRA5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FXRU333M.js → chunk-UIG4TW2H.js} +110 -9
- package/dist/cli-bundle/chunks/chunk-UIG4TW2H.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-E5DUIJA4.js → chunk-WPDMBIX6.js} +16 -3
- package/dist/cli-bundle/chunks/chunk-WPDMBIX6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IH4MBKK7.js → chunk-XWMF3POR.js} +2 -2
- package/dist/cli-bundle/chunks/{contracts-3NKWYKKU.js → contracts-2G66IGIA.js} +2 -2
- package/dist/cli-bundle/chunks/{contracts-MIXBWJIB.js → contracts-PJCHYSO5.js} +2 -2
- package/dist/cli-bundle/chunks/{create-IFA26O2I.js → create-5433DP3G.js} +2 -2
- package/dist/cli-bundle/chunks/{create-JVXYHYH4.js → create-VWLWS34Z.js} +2 -2
- package/dist/cli-bundle/chunks/{docs-5WMBVQT2.js → docs-I3BAF5WH.js} +4 -4
- package/dist/cli-bundle/chunks/docs-I3BAF5WH.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-MB53UJAJ.js → docs-MXLGZUIT.js} +3 -3
- package/dist/cli-bundle/chunks/docs-MXLGZUIT.js.map +7 -0
- package/dist/cli-bundle/chunks/{files-GVMNVLCB.js → files-FYP3MDPX.js} +3 -3
- package/dist/cli-bundle/chunks/files-FYP3MDPX.js.map +7 -0
- package/dist/cli-bundle/chunks/{files-DLB5LJEP.js → files-GUXUM2MB.js} +4 -4
- package/dist/cli-bundle/chunks/files-GUXUM2MB.js.map +1 -0
- package/dist/cli-bundle/chunks/{gc-2WEPW6D6.js → gc-FENB2ESG.js} +12 -174
- package/dist/cli-bundle/chunks/gc-FENB2ESG.js.map +1 -0
- package/dist/cli-bundle/chunks/{gc-4Z3IKHAZ.js → gc-KGQG66SA.js} +10 -179
- package/dist/cli-bundle/chunks/gc-KGQG66SA.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-YO5LRWN4.js → health-7MTXAVR2.js} +71 -4
- package/dist/cli-bundle/chunks/health-7MTXAVR2.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-4ZYB3IYQ.js → health-E4D7KGHD.js} +72 -5
- package/dist/cli-bundle/chunks/health-E4D7KGHD.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-KVPFJKOS.js → history-repair-OSQOKJ3E.js} +61 -3
- package/dist/cli-bundle/chunks/history-repair-OSQOKJ3E.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-repair-RUGKD3YR.js → history-repair-SBK7P34V.js} +62 -4
- package/dist/cli-bundle/chunks/history-repair-SBK7P34V.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-VNUG3WZZ.js → plan-2YTQYWGM.js} +52 -12
- package/dist/cli-bundle/chunks/plan-2YTQYWGM.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-FQLMJRLZ.js → plan-7IVSICR6.js} +51 -11
- package/dist/cli-bundle/chunks/plan-7IVSICR6.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-VHDXWEPP.js → register-list-query-4UPMHONX.js} +3 -3
- package/dist/cli-bundle/chunks/{register-list-query-NPE3ECJQ.js → register-list-query-7VOW2C3W.js} +3 -3
- package/dist/cli-bundle/chunks/{register-mutation-EAYNLGOS.js → register-mutation-FARSGYRD.js} +43 -26
- package/dist/cli-bundle/chunks/{register-mutation-EAYNLGOS.js.map → register-mutation-FARSGYRD.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-DG53FCBV.js → register-mutation-LJDNVREU.js} +44 -27
- package/dist/cli-bundle/chunks/{register-mutation-DG53FCBV.js.map → register-mutation-LJDNVREU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-AM6KTWB6.js → register-operations-FFTYAL42.js} +17 -13
- package/dist/cli-bundle/chunks/register-operations-FFTYAL42.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-FWFE64JG.js → register-operations-HCJKDUA6.js} +16 -12
- package/dist/cli-bundle/chunks/{register-operations-FWFE64JG.js.map → register-operations-HCJKDUA6.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-IKX5524L.js → register-setup-6AVIUOCC.js} +19 -19
- package/dist/cli-bundle/chunks/register-setup-6AVIUOCC.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-G4QYI3RX.js → register-setup-KVNLO5OJ.js} +18 -18
- package/dist/cli-bundle/chunks/register-setup-KVNLO5OJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{update-2EVXOC7V.js → update-36JM7YZT.js} +3 -3
- package/dist/cli-bundle/chunks/{update-5A2B6QYB.js → update-I246PCLO.js} +3 -3
- package/dist/cli-bundle/chunks/{update-many-V4LA3C4H.js → update-many-F4IKDWZB.js} +3 -3
- package/dist/cli-bundle/chunks/{update-many-TUGU5YXQ.js → update-many-NTWZ5YT3.js} +3 -3
- package/dist/cli-bundle/chunks/{validate-EQTT6WVX.js → validate-46KCRHL7.js} +448 -36
- package/dist/cli-bundle/chunks/validate-46KCRHL7.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-XN4I4DPL.js → validate-CRFMPTYD.js} +468 -35
- package/dist/cli-bundle/chunks/validate-CRFMPTYD.js.map +7 -0
- package/dist/cli-bundle/main.js +24 -10
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/core/diagnostics/remediation.js +19 -6
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/lock/lock-gc.d.ts +31 -0
- package/dist/core/lock/lock-gc.js +120 -62
- package/dist/core/lock/lock-gc.js.map +1 -1
- package/dist/core/telemetry/consent.js +18 -3
- package/dist/core/telemetry/consent.js.map +1 -1
- package/dist/core/validate/fix-planning.d.ts +130 -0
- package/dist/core/validate/fix-planning.js +202 -0
- package/dist/core/validate/fix-planning.js.map +1 -0
- package/dist/core/validate/missing-by-type.d.ts +21 -0
- package/dist/core/validate/missing-by-type.js +39 -0
- package/dist/core/validate/missing-by-type.js.map +1 -0
- package/dist/core/validate/stale-file-classification.d.ts +41 -0
- package/dist/core/validate/stale-file-classification.js +73 -0
- package/dist/core/validate/stale-file-classification.js.map +1 -0
- package/dist/mcp/server.js +41 -8
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +38 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +6 -1
- package/dist/sdk/cli-contracts.js +74 -7
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/docs/AGENT_GUIDE.md +6 -1
- package/docs/COMMANDS.md +23 -1
- package/package.json +1 -1
- package/dist/cli-bundle/chunks/chunk-E5DUIJA4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FXRU333M.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LCSCXBGT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-P2PSODAQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PSD7F7DX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UOO6BYIA.js.map +0 -1
- package/dist/cli-bundle/chunks/docs-5WMBVQT2.js.map +0 -1
- package/dist/cli-bundle/chunks/docs-MB53UJAJ.js.map +0 -7
- package/dist/cli-bundle/chunks/files-DLB5LJEP.js.map +0 -1
- package/dist/cli-bundle/chunks/files-GVMNVLCB.js.map +0 -7
- package/dist/cli-bundle/chunks/gc-2WEPW6D6.js.map +0 -1
- package/dist/cli-bundle/chunks/gc-4Z3IKHAZ.js.map +0 -7
- package/dist/cli-bundle/chunks/health-4ZYB3IYQ.js.map +0 -1
- package/dist/cli-bundle/chunks/health-YO5LRWN4.js.map +0 -7
- package/dist/cli-bundle/chunks/history-repair-KVPFJKOS.js.map +0 -7
- package/dist/cli-bundle/chunks/history-repair-RUGKD3YR.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-FQLMJRLZ.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-VNUG3WZZ.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-AM6KTWB6.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-G4QYI3RX.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-IKX5524L.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-EQTT6WVX.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-XN4I4DPL.js.map +0 -7
- /package/dist/cli-bundle/chunks/{chunk-B65UUCGQ.js.map → chunk-37CYVF73.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3SLOMKCJ.js.map → chunk-L5EPZQIC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7RIT3OCD.js.map → chunk-SO55HRA5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IH4MBKK7.js.map → chunk-XWMF3POR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-3NKWYKKU.js.map → contracts-2G66IGIA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-MIXBWJIB.js.map → contracts-PJCHYSO5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-IFA26O2I.js.map → create-5433DP3G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-JVXYHYH4.js.map → create-VWLWS34Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-VHDXWEPP.js.map → register-list-query-4UPMHONX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-NPE3ECJQ.js.map → register-list-query-7VOW2C3W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-2EVXOC7V.js.map → update-36JM7YZT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-5A2B6QYB.js.map → update-I246PCLO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-V4LA3C4H.js.map → update-many-F4IKDWZB.js.map} +0 -0
- /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]="
|
|
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
|
-
|
|
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
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
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
|
-
|
|
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:
|
|
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 =
|
|
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 (
|
|
551
|
-
options
|
|
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=
|
|
1247
|
+
//# debugId=227d8bfe-b531-50fb-a2f0-b43b2855cd2b
|