@unbrained/pm-cli 2026.5.18 → 2026.5.24
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 +60 -0
- package/README.md +2 -1
- package/dist/cli/commander-usage.js +16 -2
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/annotation-command.d.ts +49 -0
- package/dist/cli/commands/annotation-command.js +135 -0
- package/dist/cli/commands/annotation-command.js.map +1 -0
- package/dist/cli/commands/append.js +3 -7
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/calendar.js +3 -6
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/claim.js +12 -22
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.js +61 -9
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments.d.ts +5 -0
- package/dist/cli/commands/comments.js +27 -117
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js +102 -15
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/context.js +4 -10
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.js +168 -36
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +49 -44
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +7 -4
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/delete.d.ts +3 -0
- package/dist/cli/commands/delete.js +9 -8
- package/dist/cli/commands/delete.js.map +1 -1
- package/dist/cli/commands/docs.d.ts +1 -0
- package/dist/cli/commands/docs.js +4 -8
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/event-validation-messages.d.ts +3 -0
- package/dist/cli/commands/event-validation-messages.js +44 -0
- package/dist/cli/commands/event-validation-messages.js.map +1 -0
- package/dist/cli/commands/extension.d.ts +1 -0
- package/dist/cli/commands/extension.js +138 -21
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.js +6 -13
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/gc.js +17 -4
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +3 -2
- package/dist/cli/commands/get.js +50 -8
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.d.ts +10 -0
- package/dist/cli/commands/health.js +254 -75
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +8 -0
- package/dist/cli/commands/history-redact.js +14 -97
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.d.ts +33 -0
- package/dist/cli/commands/history-repair.js +166 -0
- package/dist/cli/commands/history-repair.js.map +1 -0
- package/dist/cli/commands/history.d.ts +4 -4
- package/dist/cli/commands/history.js +10 -88
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +3 -1
- package/dist/cli/commands/index.js +5 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +28 -0
- package/dist/cli/commands/init.js +23 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +20 -119
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/linked-test-entry.d.ts +3 -0
- package/dist/cli/commands/linked-test-entry.js +62 -0
- package/dist/cli/commands/linked-test-entry.js.map +1 -0
- package/dist/cli/commands/list.js +32 -22
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/notes.js +20 -119
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +3 -0
- package/dist/cli/commands/plan.js +184 -22
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/restore.js +7 -50
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +31 -0
- package/dist/cli/commands/schema.js +98 -0
- package/dist/cli/commands/schema.js.map +1 -0
- package/dist/cli/commands/search.js +151 -40
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/templates.d.ts +4 -0
- package/dist/cli/commands/templates.js +89 -17
- package/dist/cli/commands/templates.js.map +1 -1
- package/dist/cli/commands/test-all.js +4 -8
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +1 -0
- package/dist/cli/commands/test.js +7 -10
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +4 -8
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.js +109 -51
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +3 -1
- package/dist/cli/commands/validate.js +23 -71
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +96 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +0 -1
- package/dist/cli/extension-command-help.js +2 -13
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/extension-command-options.d.ts +1 -0
- package/dist/cli/extension-command-options.js +106 -7
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.d.ts +0 -1
- package/dist/cli/help-content.js +13 -9
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.d.ts +1 -0
- package/dist/cli/help-json-payload.js +33 -3
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +35 -29
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +1 -1
- package/dist/cli/register-list-query.js +40 -17
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.d.ts +1 -1
- package/dist/cli/register-mutation.js +232 -64
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +16 -11
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +26 -14
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +0 -2
- package/dist/cli/registration-helpers.js +13 -40
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli.js +23 -3
- package/dist/cli.js.map +1 -1
- package/dist/core/extensions/index.d.ts +0 -1
- package/dist/core/extensions/index.js +2 -14
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.js +3 -9
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/fs/path-utils.d.ts +1 -0
- package/dist/core/fs/path-utils.js +12 -0
- package/dist/core/fs/path-utils.js.map +1 -0
- package/dist/core/history/drift-scan.d.ts +11 -0
- package/dist/core/history/drift-scan.js +67 -0
- package/dist/core/history/drift-scan.js.map +1 -0
- package/dist/core/history/replay.d.ts +82 -0
- package/dist/core/history/replay.js +249 -0
- package/dist/core/history/replay.js.map +1 -0
- package/dist/core/item/item-format.js +11 -8
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/item-type-definition.d.ts +52 -0
- package/dist/core/item/item-type-definition.js +123 -0
- package/dist/core/item/item-type-definition.js.map +1 -0
- package/dist/core/item/parse.js +3 -2
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/item/priority.d.ts +23 -0
- package/dist/core/item/priority.js +55 -0
- package/dist/core/item/priority.js.map +1 -0
- package/dist/core/item/status.d.ts +14 -1
- package/dist/core/item/status.js +22 -2
- package/dist/core/item/status.js.map +1 -1
- package/dist/core/item/toon-decode.d.ts +19 -0
- package/dist/core/item/toon-decode.js +69 -0
- package/dist/core/item/toon-decode.js.map +1 -0
- package/dist/core/item/type-registry.js +13 -84
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/packages/manifest.js +3 -9
- package/dist/core/packages/manifest.js.map +1 -1
- package/dist/core/schema/item-types-file.d.ts +85 -0
- package/dist/core/schema/item-types-file.js +243 -0
- package/dist/core/schema/item-types-file.js.map +1 -0
- package/dist/core/schema/runtime-schema.d.ts +2 -1
- package/dist/core/schema/runtime-schema.js +11 -9
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/semantic-defaults.js +3 -3
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/shared/author.d.ts +1 -0
- package/dist/core/shared/author.js +9 -0
- package/dist/core/shared/author.js.map +1 -0
- package/dist/core/shared/lazy-module.d.ts +1 -0
- package/dist/core/shared/lazy-module.js +11 -0
- package/dist/core/shared/lazy-module.js.map +1 -0
- package/dist/core/shared/option-alias-visibility.d.ts +44 -0
- package/dist/core/shared/option-alias-visibility.js +76 -0
- package/dist/core/shared/option-alias-visibility.js.map +1 -0
- package/dist/core/shared/text-normalization.d.ts +0 -1
- package/dist/core/shared/text-normalization.js +2 -5
- package/dist/core/shared/text-normalization.js.map +1 -1
- package/dist/core/store/item-store.d.ts +2 -0
- package/dist/core/store/item-store.js +70 -39
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +106 -0
- package/dist/core/store/settings-validator.js +279 -0
- package/dist/core/store/settings-validator.js.map +1 -0
- package/dist/core/store/settings.js +6 -343
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/runtime.js +5 -3
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.js +64 -13
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +9 -2
- package/dist/sdk/cli-contracts.js +204 -13
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/runtime.d.ts +25 -1
- package/dist/sdk/runtime.js +46 -3
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/types.js +10 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +7 -1
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/COMMANDS.md +39 -6
- package/docs/CONFIGURATION.md +1 -1
- package/docs/RELEASING.md +11 -7
- package/docs/SDK.md +11 -2
- package/package.json +12 -11
- package/packages/pm-calendar/README.md +3 -1
- package/packages/pm-calendar/extensions/calendar/index.js +21 -2
- package/packages/pm-calendar/extensions/calendar/index.ts +21 -2
- package/packages/pm-search-advanced/README.md +8 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +74 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +74 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +67 -9
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +67 -9
- package/packages/pm-templates/extensions/templates/runtime.js +11 -202
- package/packages/pm-templates/extensions/templates/runtime.ts +38 -230
- package/dist/core/output/command-aware.d.ts +0 -1
- package/dist/core/output/command-aware.js +0 -397
- package/dist/core/output/command-aware.js.map +0 -1
|
@@ -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]="64b2c911-6e92-5df3-a24a-40c811b5939e")}catch(e){}}();
|
|
3
3
|
import { pathExists, removeFileIfExists, writeFileAtomic } from "../../core/fs/fs-utils.js";
|
|
4
4
|
import { appendHistoryEntry, createHistoryEntry } from "../../core/history/history.js";
|
|
5
5
|
import { generateItemId, normalizeItemId } from "../../core/item/id.js";
|
|
@@ -7,9 +7,11 @@ import { canonicalDocument, normalizeFrontMatter, serializeItemDocument } from "
|
|
|
7
7
|
import { normalizeParentReferenceValue, validateMissingParentReference, } from "../../core/item/parent-reference-policy.js";
|
|
8
8
|
import { validateSprintOrReleaseValue } from "../../core/item/sprint-release-format.js";
|
|
9
9
|
import { createStdinTokenResolver, parseCsvKv, parseOptionalNumber, parseTags } from "../../core/item/parse.js";
|
|
10
|
+
import { resolvePriority } from "../../core/item/priority.js";
|
|
10
11
|
import { normalizeStatusInput } from "../../core/item/status.js";
|
|
11
12
|
import { canonicalizeCommandOptionKey, commandOptionFlagLabel, resolveItemTypeRegistry, resolveCommandOptionPolicyState, resolveTypeDefinition, resolveTypeName, validateTypeOptions, } from "../../core/item/type-registry.js";
|
|
12
13
|
import { acquireLock } from "../../core/lock/lock.js";
|
|
14
|
+
import { buildInvalidTypeError } from "../../core/schema/item-types-file.js";
|
|
13
15
|
import { collectRuntimeCreateFieldValues } from "../../core/schema/runtime-field-values.js";
|
|
14
16
|
import { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, } from "../../core/schema/runtime-schema.js";
|
|
15
17
|
import { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from "../../core/shared/constants.js";
|
|
@@ -21,7 +23,9 @@ import { locateItem } from "../../core/store/item-store.js";
|
|
|
21
23
|
import { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
|
|
22
24
|
import { readSettings } from "../../core/store/settings.js";
|
|
23
25
|
import { normalizeRiskInput, normalizeSeverityInput, parseConfidenceInput, parseRegressionInput, } from "./metadata-normalizers.js";
|
|
24
|
-
import {
|
|
26
|
+
import { resolveEventEndAt } from "./event-validation-messages.js";
|
|
27
|
+
import { looksLikeStructuredLinkedTestEntry, normalizeStructuredLinkedTestEntry } from "./linked-test-entry.js";
|
|
28
|
+
import { DEPENDENCY_KIND_VALUES, ISSUE_SEVERITY_VALUES, RECURRENCE_FREQUENCY_VALUES, RECURRENCE_WEEKDAY_VALUES, RISK_VALUES, SCOPE_VALUES, weekdayOrderIndex, } from "../../types/index.js";
|
|
25
29
|
const CREATE_MODE_VALUES = ["strict", "progressive"];
|
|
26
30
|
const SCHEDULE_CREATE_PRESET_VALUES = ["lightweight"];
|
|
27
31
|
const SCHEDULE_CREATE_PRESET_TYPES = new Set(["Reminder", "Meeting", "Event"]);
|
|
@@ -316,9 +320,6 @@ function parseCreateUnsetTargets(raw, runtimeFieldRegistry) {
|
|
|
316
320
|
}
|
|
317
321
|
return { frontMatterKeys, optionKeys };
|
|
318
322
|
}
|
|
319
|
-
function weekdayOrderIndex(value) {
|
|
320
|
-
return RECURRENCE_WEEKDAY_VALUES.indexOf(value);
|
|
321
|
-
}
|
|
322
323
|
function parseDependencies(raw, nowValue, prefix) {
|
|
323
324
|
if (!raw || raw.length === 0)
|
|
324
325
|
return { values: undefined, explicitEmpty: false };
|
|
@@ -599,26 +600,8 @@ export function parseTests(raw) {
|
|
|
599
600
|
assertNoLegacyNoneTokens(raw, "--test", "Use --clear-tests to clear linked tests.");
|
|
600
601
|
const values = raw.map((entry) => {
|
|
601
602
|
const trimmedEntry = entry.trim();
|
|
602
|
-
const kv =
|
|
603
|
-
"
|
|
604
|
-
"path",
|
|
605
|
-
"scope",
|
|
606
|
-
"timeout",
|
|
607
|
-
"timeout_seconds",
|
|
608
|
-
"pm_context_mode",
|
|
609
|
-
"env_set",
|
|
610
|
-
"env_clear",
|
|
611
|
-
"shared_host_safe",
|
|
612
|
-
"assert_stdout_contains",
|
|
613
|
-
"assert_stdout_regex",
|
|
614
|
-
"assert_stderr_contains",
|
|
615
|
-
"assert_stderr_regex",
|
|
616
|
-
"assert_stdout_min_lines",
|
|
617
|
-
"assert_json_field_equals",
|
|
618
|
-
"assert_json_field_gte",
|
|
619
|
-
"note",
|
|
620
|
-
])
|
|
621
|
-
? parseCsvKv(entry, "--test")
|
|
603
|
+
const kv = looksLikeStructuredLinkedTestEntry(trimmedEntry)
|
|
604
|
+
? normalizeStructuredLinkedTestEntry(parseCsvKv(entry, "--test"), "--test")
|
|
622
605
|
: { command: trimmedEntry };
|
|
623
606
|
const command = parseOptionalString(kv.command);
|
|
624
607
|
const filePath = parseOptionalString(kv.path);
|
|
@@ -678,10 +661,10 @@ function parseReminders(raw, nowValue) {
|
|
|
678
661
|
assertNoLegacyNoneTokens(raw, "--reminder", "Use --clear-reminders to clear reminders.");
|
|
679
662
|
const values = raw.map((entry) => {
|
|
680
663
|
const kv = parseCsvKv(entry, "--reminder");
|
|
681
|
-
const atRaw = parseOptionalString(kv.at);
|
|
682
|
-
const textRaw = parseOptionalString(kv.text);
|
|
664
|
+
const atRaw = parseOptionalString(kv.at ?? kv.date);
|
|
665
|
+
const textRaw = parseOptionalString(kv.text ?? kv.title);
|
|
683
666
|
if (!atRaw || !textRaw) {
|
|
684
|
-
throw new PmCliError("--reminder requires at=<iso|relative>
|
|
667
|
+
throw new PmCliError("--reminder requires at=<iso|relative> or date=<iso|relative>, plus text=<value> or title=<value>", EXIT_CODE.USAGE);
|
|
685
668
|
}
|
|
686
669
|
const text = textRaw.trim();
|
|
687
670
|
if (!text) {
|
|
@@ -774,10 +757,8 @@ function parseEvents(raw, nowValue) {
|
|
|
774
757
|
}
|
|
775
758
|
const startAt = resolveIsoOrRelative(startRaw, referenceDate, "event.start");
|
|
776
759
|
const endRaw = parseOptionalString(kv.end)?.trim();
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
throw new PmCliError("--event end must be after start", EXIT_CODE.USAGE);
|
|
780
|
-
}
|
|
760
|
+
const durationRaw = parseOptionalString(kv.duration)?.trim();
|
|
761
|
+
const endAt = resolveEventEndAt(startAt, endRaw, durationRaw, referenceDate);
|
|
781
762
|
const titleRaw = parseOptionalString(kv.title);
|
|
782
763
|
const descriptionRaw = parseOptionalString(kv.description);
|
|
783
764
|
const locationRaw = parseOptionalString(kv.location);
|
|
@@ -813,10 +794,10 @@ function parseEvents(raw, nowValue) {
|
|
|
813
794
|
});
|
|
814
795
|
return { values, explicitEmpty: false };
|
|
815
796
|
}
|
|
816
|
-
function buildChangedFields(frontMatter, explicitUnsets) {
|
|
797
|
+
function buildChangedFields(frontMatter, body, explicitUnsets) {
|
|
817
798
|
const changed = [
|
|
818
799
|
...FRONT_MATTER_KEY_ORDER.filter((key) => frontMatter[key] !== undefined),
|
|
819
|
-
"body",
|
|
800
|
+
...(body.length > 0 ? ["body"] : []),
|
|
820
801
|
...explicitUnsets.map((key) => `unset:${key}`),
|
|
821
802
|
];
|
|
822
803
|
return Array.from(new Set(changed));
|
|
@@ -1127,11 +1108,7 @@ function selectAuthor(explicitAuthor, settingsAuthor) {
|
|
|
1127
1108
|
return trimmed || "unknown";
|
|
1128
1109
|
}
|
|
1129
1110
|
function ensurePriority(rawPriority) {
|
|
1130
|
-
|
|
1131
|
-
if (![0, 1, 2, 3, 4].includes(parsed)) {
|
|
1132
|
-
throw new PmCliError("Priority must be 0..4 (0=critical, 1=high, 2=medium, 3=low, 4=minimal)", EXIT_CODE.USAGE);
|
|
1133
|
-
}
|
|
1134
|
-
return parsed;
|
|
1111
|
+
return resolvePriority(rawPriority);
|
|
1135
1112
|
}
|
|
1136
1113
|
function mergeCreateOptionsWithTemplate(templateOptions, explicitOptions) {
|
|
1137
1114
|
const merged = {};
|
|
@@ -1244,7 +1221,7 @@ export async function runCreate(options, global) {
|
|
|
1244
1221
|
}
|
|
1245
1222
|
const resolvedTypeName = resolveTypeName(resolvedOptions.type, typeRegistry);
|
|
1246
1223
|
if (!resolvedTypeName) {
|
|
1247
|
-
throw new PmCliError(
|
|
1224
|
+
throw new PmCliError(buildInvalidTypeError(resolvedOptions.type, typeRegistry.types), EXIT_CODE.USAGE);
|
|
1248
1225
|
}
|
|
1249
1226
|
const typeDefinition = resolveTypeDefinition(resolvedTypeName, typeRegistry);
|
|
1250
1227
|
if (!typeDefinition) {
|
|
@@ -1498,7 +1475,7 @@ export async function runCreate(options, global) {
|
|
|
1498
1475
|
});
|
|
1499
1476
|
}
|
|
1500
1477
|
const id = await generateItemId(pmRoot, settings.id_prefix);
|
|
1501
|
-
|
|
1478
|
+
let status = resolvedOptions.status !== undefined ? parseStatusValue(resolvedOptions.status, statusRegistry) : statusRegistry.open_status;
|
|
1502
1479
|
const priority = resolvedOptions.priority !== undefined ? ensurePriority(resolvedOptions.priority) : 2;
|
|
1503
1480
|
const tags = unsetTargets.frontMatterKeys.has("tags")
|
|
1504
1481
|
? []
|
|
@@ -1572,6 +1549,10 @@ export async function runCreate(options, global) {
|
|
|
1572
1549
|
const parentReferencePolicy = settings.validation.parent_reference;
|
|
1573
1550
|
const sprintReleasePolicy = settings.validation.sprint_release_format;
|
|
1574
1551
|
const validationWarnings = [];
|
|
1552
|
+
// Event-type items with no attached schedule never surface on the calendar; warn (never block).
|
|
1553
|
+
if (type.toLowerCase() === "event" && (events.values === undefined || events.values.length === 0)) {
|
|
1554
|
+
validationWarnings.push(`event_without_schedule:${id}:no_time_set`);
|
|
1555
|
+
}
|
|
1575
1556
|
if (parent !== undefined) {
|
|
1576
1557
|
parent = normalizeParentReferenceValue(parent);
|
|
1577
1558
|
const parentLocated = await locateItem(pmRoot, parent, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
|
|
@@ -1599,6 +1580,30 @@ export async function runCreate(options, global) {
|
|
|
1599
1580
|
const blockedBy = unsetTargets.frontMatterKeys.has("blocked_by") || resolvedOptions.blockedBy === undefined
|
|
1600
1581
|
? undefined
|
|
1601
1582
|
: parseOptionalString(resolvedOptions.blockedBy);
|
|
1583
|
+
let dependencyValues = dependencies.values;
|
|
1584
|
+
if (blockedBy !== undefined) {
|
|
1585
|
+
const normalizedBlockedBy = normalizeItemId(blockedBy, settings.id_prefix);
|
|
1586
|
+
const blockedByLocated = await locateItem(pmRoot, normalizedBlockedBy, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
|
|
1587
|
+
if (blockedByLocated) {
|
|
1588
|
+
const hasBlockedByDependency = (dependencyValues ?? []).some((dependency) => dependency.id === blockedByLocated.id && dependency.kind === "blocked_by");
|
|
1589
|
+
if (!hasBlockedByDependency) {
|
|
1590
|
+
dependencyValues = [
|
|
1591
|
+
...(dependencyValues ?? []),
|
|
1592
|
+
{
|
|
1593
|
+
id: blockedByLocated.id,
|
|
1594
|
+
kind: "blocked_by",
|
|
1595
|
+
created_at: nowValue,
|
|
1596
|
+
author,
|
|
1597
|
+
},
|
|
1598
|
+
];
|
|
1599
|
+
}
|
|
1600
|
+
if (resolvedOptions.status === undefined) {
|
|
1601
|
+
status = statusRegistry.blocked_statuses.has("blocked")
|
|
1602
|
+
? "blocked"
|
|
1603
|
+
: [...statusRegistry.blocked_statuses].sort((left, right) => left.localeCompare(right))[0] ?? statusRegistry.open_status;
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1602
1607
|
const blockedReason = unsetTargets.frontMatterKeys.has("blocked_reason") || resolvedOptions.blockedReason === undefined
|
|
1603
1608
|
? undefined
|
|
1604
1609
|
: parseOptionalString(resolvedOptions.blockedReason);
|
|
@@ -1691,7 +1696,7 @@ export async function runCreate(options, global) {
|
|
|
1691
1696
|
component,
|
|
1692
1697
|
regression,
|
|
1693
1698
|
customer_impact: customerImpact,
|
|
1694
|
-
dependencies:
|
|
1699
|
+
dependencies: dependencyValues,
|
|
1695
1700
|
comments: comments.values,
|
|
1696
1701
|
notes: notes.values,
|
|
1697
1702
|
learnings: learnings.values,
|
|
@@ -1755,7 +1760,7 @@ export async function runCreate(options, global) {
|
|
|
1755
1760
|
finally {
|
|
1756
1761
|
await lockRelease();
|
|
1757
1762
|
}
|
|
1758
|
-
const changedFields = buildChangedFields(frontMatter, explicitUnsetKeys);
|
|
1763
|
+
const changedFields = buildChangedFields(frontMatter, body, explicitUnsetKeys);
|
|
1759
1764
|
const outputItem = structuredClone(frontMatter);
|
|
1760
1765
|
return {
|
|
1761
1766
|
item: outputItem,
|
|
@@ -1764,4 +1769,4 @@ export async function runCreate(options, global) {
|
|
|
1764
1769
|
};
|
|
1765
1770
|
}
|
|
1766
1771
|
//# sourceMappingURL=create.js.map
|
|
1767
|
-
//# debugId=
|
|
1772
|
+
//# debugId=64b2c911-6e92-5df3-a24a-40c811b5939e
|