@unbrained/pm-cli 2026.5.27 → 2026.5.28

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.
@@ -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]="94e19c77-3288-5a43-a8b2-6b9f15d4f234")}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]="b4271a85-6407-5151-876e-6b38c7881b67")}catch(e){}}();
3
3
  import { pathExists } from "../../core/fs/fs-utils.js";
4
4
  import { canonicalizeCommandOptionKey, commandOptionFlagLabel, resolveItemTypeRegistry, resolveCommandOptionPolicyState, resolveTypeDefinition, resolveTypeName, validateTypeOptions, } from "../../core/item/type-registry.js";
5
5
  import { normalizeItemId } from "../../core/item/id.js";
@@ -586,6 +586,25 @@ function looksLikeStructuredDependencyEntry(raw) {
586
586
  }
587
587
  return /^(?:[-*+]\s+)?(?:id|kind|author|created_at|source_kind)\s*[:=]/i.test(raw);
588
588
  }
589
+ // pm-fl0c #4 (2026-05-28): `pm plan` accepts `depends_on` as a link kind
590
+ // (`PLAN_STEP_LINK_KIND_VALUES`) but `pm update --dep kind=depends_on` rejected
591
+ // it because `DEPENDENCY_KIND_VALUES` only lists `blocked_by`. The two terms
592
+ // are semantically identical from this side ("X depends on Y" === "X blocked
593
+ // by Y"), so we normalize input here rather than expanding the persisted enum
594
+ // — the stored kind stays canonical (`blocked_by`) and downstream consumers
595
+ // (closing logic, dependency graphs, blockers views) keep working unchanged.
596
+ const DEPENDENCY_KIND_INPUT_ALIASES = {
597
+ depends_on: "blocked_by",
598
+ "depends-on": "blocked_by",
599
+ };
600
+ function normalizeDependencyKindInput(raw) {
601
+ if (typeof raw !== "string") {
602
+ return raw;
603
+ }
604
+ const trimmed = raw.trim();
605
+ const alias = DEPENDENCY_KIND_INPUT_ALIASES[trimmed.toLowerCase()];
606
+ return alias ?? trimmed;
607
+ }
589
608
  function parseDependencyAdditions(raw, prefix, nowIso) {
590
609
  if (!raw) {
591
610
  return { additions: [] };
@@ -595,7 +614,7 @@ function parseDependencyAdditions(raw, prefix, nowIso) {
595
614
  const trimmedEntry = entry.trim();
596
615
  const kv = looksLikeStructuredDependencyEntry(trimmedEntry) ? parseCsvKv(entry, "--dep") : { id: trimmedEntry, kind: "related" };
597
616
  const id = kv.id?.trim();
598
- const kind = kv.kind?.trim();
617
+ const kind = normalizeDependencyKindInput(kv.kind?.trim());
599
618
  if (!id || !kind) {
600
619
  throw new PmCliError("--dep requires id and kind, or a bare item id to add a related dependency", EXIT_CODE.USAGE);
601
620
  }
@@ -632,7 +651,7 @@ function parseDependencyRemovals(raw, prefix) {
632
651
  if (idRaw.toLowerCase() === "undefined") {
633
652
  throw new PmCliError(`--dep-remove id must not use placeholder token "${idRaw}"`, EXIT_CODE.USAGE);
634
653
  }
635
- const kindRaw = parseOptionalDependencyString(kv.kind);
654
+ const kindRaw = normalizeDependencyKindInput(parseOptionalDependencyString(kv.kind));
636
655
  const sourceKind = parseOptionalDependencyString(kv.source_kind);
637
656
  return {
638
657
  id: normalizeItemId(idRaw, prefix),
@@ -1613,4 +1632,4 @@ export async function runUpdate(id, options, global) {
1613
1632
  };
1614
1633
  }
1615
1634
  //# sourceMappingURL=update.js.map
1616
- //# debugId=94e19c77-3288-5a43-a8b2-6b9f15d4f234
1635
+ //# debugId=b4271a85-6407-5151-876e-6b38c7881b67