@unbrained/pm-cli 2026.5.2 → 2026.5.3
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/AGENTS.md +8 -1
- package/CHANGELOG.md +25 -0
- package/dist/cli/bootstrap-args.d.ts +18 -0
- package/dist/cli/bootstrap-args.js +242 -0
- package/dist/cli/bootstrap-args.js.map +1 -0
- package/dist/cli/commander-usage.d.ts +17 -0
- package/dist/cli/commander-usage.js +178 -0
- package/dist/cli/commander-usage.js.map +1 -0
- package/dist/cli/commands/activity.js +1 -9
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/calendar.js +3 -29
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/comments.js +1 -9
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/config.d.ts +21 -3
- package/dist/cli/commands/config.js +118 -2
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.d.ts +90 -1
- package/dist/cli/commands/context.js +485 -23
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +2 -11
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/history.js +1 -9
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/learnings.js +1 -9
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/list.js +3 -29
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/normalize.js +9 -6
- package/dist/cli/commands/normalize.js.map +1 -1
- package/dist/cli/commands/notes.js +1 -9
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/reindex.js +2 -7
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.js +4 -35
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test-runs.js +1 -11
- package/dist/cli/commands/test-runs.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +13 -0
- package/dist/cli/error-guidance.js +43 -4
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +48 -0
- package/dist/cli/extension-command-help.js +389 -0
- package/dist/cli/extension-command-help.js.map +1 -0
- package/dist/cli/help-content.js +9 -3
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.d.ts +25 -0
- package/dist/cli/help-json-payload.js +265 -0
- package/dist/cli/help-json-payload.js.map +1 -0
- package/dist/cli/main.js +769 -4495
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/migration-gates.d.ts +22 -0
- package/dist/cli/migration-gates.js +146 -0
- package/dist/cli/migration-gates.js.map +1 -0
- package/dist/cli/register-list-query.d.ts +2 -0
- package/dist/cli/register-list-query.js +317 -0
- package/dist/cli/register-list-query.js.map +1 -0
- package/dist/cli/register-mutation.d.ts +2 -0
- package/dist/cli/register-mutation.js +795 -0
- package/dist/cli/register-mutation.js.map +1 -0
- package/dist/cli/register-operations.d.ts +2 -0
- package/dist/cli/register-operations.js +610 -0
- package/dist/cli/register-operations.js.map +1 -0
- package/dist/cli/register-setup.d.ts +2 -0
- package/dist/cli/register-setup.js +334 -0
- package/dist/cli/register-setup.js.map +1 -0
- package/dist/cli/registration-helpers.d.ts +53 -0
- package/dist/cli/registration-helpers.js +669 -0
- package/dist/cli/registration-helpers.js.map +1 -0
- package/dist/cli/shared-parsers.d.ts +6 -0
- package/dist/cli/shared-parsers.js +40 -0
- package/dist/cli/shared-parsers.js.map +1 -0
- package/dist/core/search/http-client.d.ts +29 -0
- package/dist/core/search/http-client.js +64 -0
- package/dist/core/search/http-client.js.map +1 -0
- package/dist/core/search/providers.d.ts +3 -13
- package/dist/core/search/providers.js +19 -69
- package/dist/core/search/providers.js.map +1 -1
- package/dist/core/search/semantic-defaults.js +2 -7
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +3 -13
- package/dist/core/search/vector-stores.js +17 -66
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/helpers.d.ts +8 -0
- package/dist/core/sentry/helpers.js +28 -0
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/sentry/instrument.d.ts +21 -0
- package/dist/core/sentry/instrument.js +34 -3
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/shared/constants.d.ts +3 -0
- package/dist/core/shared/constants.js +55 -1
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +6 -0
- package/dist/core/store/front-matter-cache.js +150 -0
- package/dist/core/store/front-matter-cache.js.map +1 -0
- package/dist/core/store/item-store.js +2 -1
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings.js +36 -0
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/runtime.d.ts +21 -3
- package/dist/core/telemetry/runtime.js +170 -10
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/sdk/cli-contracts.js +28 -0
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/types.d.ts +21 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -1
- package/docs/ARCHITECTURE.md +7 -1
- package/docs/COMMANDS.md +11 -1
- package/docs/CONFIGURATION.md +2 -0
- package/docs/RELEASING.md +33 -10
- package/package.json +3 -3
|
@@ -8,6 +8,7 @@ import { PmCliError } from "../../core/shared/errors.js";
|
|
|
8
8
|
import { migrateItemFilesToFormat } from "../../core/store/item-format-migration.js";
|
|
9
9
|
import { getSettingsPath, resolveGlobalPmRoot, resolvePmRoot, } from "../../core/store/paths.js";
|
|
10
10
|
import { readSettingsWithMetadata, writeSettings } from "../../core/store/settings.js";
|
|
11
|
+
import { CONTEXT_DEPTH_VALUES } from "../../types/index.js";
|
|
11
12
|
const CONFIG_SCOPE_VALUES = ["project", "global"];
|
|
12
13
|
const CONFIG_KEY_VALUES = [
|
|
13
14
|
"definition-of-done",
|
|
@@ -50,6 +51,7 @@ const CONFIG_KEY_VALUES = [
|
|
|
50
51
|
"test_result_tracking",
|
|
51
52
|
"telemetry-tracking",
|
|
52
53
|
"telemetry_tracking",
|
|
54
|
+
"context",
|
|
53
55
|
];
|
|
54
56
|
const CONFIG_KEY_ALIASES = {
|
|
55
57
|
definition_of_done: ["definition-of-done", "definition_of_done"],
|
|
@@ -93,6 +95,7 @@ const CONFIG_KEY_ALIASES = {
|
|
|
93
95
|
],
|
|
94
96
|
test_result_tracking: ["test-result-tracking", "test_result_tracking"],
|
|
95
97
|
telemetry_tracking: ["telemetry-tracking", "telemetry_tracking"],
|
|
98
|
+
context: ["context"],
|
|
96
99
|
};
|
|
97
100
|
const CONFIG_KEY_SUMMARIES = {
|
|
98
101
|
definition_of_done: "Definition of Done criteria list.",
|
|
@@ -115,6 +118,7 @@ const CONFIG_KEY_SUMMARIES = {
|
|
|
115
118
|
governance_force_required_for_stale_lock: "Governance stale-lock force policy (enabled|disabled).",
|
|
116
119
|
test_result_tracking: "Item-level linked test result persistence policy.",
|
|
117
120
|
telemetry_tracking: "Telemetry usage reporting policy.",
|
|
121
|
+
context: "Context command settings (depth, section toggles, limits).",
|
|
118
122
|
};
|
|
119
123
|
const LIFECYCLE_PATTERN_CONFIG_KEYS = [
|
|
120
124
|
"lifecycle_stale_blocker_reason_patterns",
|
|
@@ -202,6 +206,9 @@ function normalizeKey(value) {
|
|
|
202
206
|
if (value === "telemetry-tracking" || value === "telemetry_tracking") {
|
|
203
207
|
return "telemetry_tracking";
|
|
204
208
|
}
|
|
209
|
+
if (value === "context") {
|
|
210
|
+
return "context";
|
|
211
|
+
}
|
|
205
212
|
return "definition_of_done";
|
|
206
213
|
}
|
|
207
214
|
throw new PmCliError(`Invalid config key "${value}". Supported: ${CONFIG_KEY_VALUES.join(", ")}`, EXIT_CODE.USAGE);
|
|
@@ -423,6 +430,14 @@ function readConfigValue(settings, key) {
|
|
|
423
430
|
if (key === "telemetry_tracking") {
|
|
424
431
|
return settings.telemetry.enabled ? "enabled" : "disabled";
|
|
425
432
|
}
|
|
433
|
+
if (key === "context") {
|
|
434
|
+
return {
|
|
435
|
+
default_depth: settings.context.default_depth,
|
|
436
|
+
activity_limit: settings.context.activity_limit,
|
|
437
|
+
stale_threshold_days: settings.context.stale_threshold_days,
|
|
438
|
+
sections: { ...settings.context.sections },
|
|
439
|
+
};
|
|
440
|
+
}
|
|
426
441
|
return [...settings.workflow.definition_of_done];
|
|
427
442
|
}
|
|
428
443
|
function withWarnings(result, warnings) {
|
|
@@ -443,6 +458,85 @@ async function resolveSettingsTarget(scope, global) {
|
|
|
443
458
|
}
|
|
444
459
|
return { pmRoot, settingsPath };
|
|
445
460
|
}
|
|
461
|
+
function parseSectionToggle(raw) {
|
|
462
|
+
if (raw === undefined)
|
|
463
|
+
return undefined;
|
|
464
|
+
const normalized = raw.trim().toLowerCase();
|
|
465
|
+
if (normalized === "true" || normalized === "enabled" || normalized === "on" || normalized === "1")
|
|
466
|
+
return true;
|
|
467
|
+
if (normalized === "false" || normalized === "disabled" || normalized === "off" || normalized === "0")
|
|
468
|
+
return false;
|
|
469
|
+
throw new PmCliError(`Context section toggle must be true|false|enabled|disabled, got "${raw}"`, EXIT_CODE.USAGE);
|
|
470
|
+
}
|
|
471
|
+
async function applyContextConfig(settings, options, target, scope, warnings) {
|
|
472
|
+
let changed = false;
|
|
473
|
+
const ctx = settings.context;
|
|
474
|
+
if (options.defaultDepth !== undefined) {
|
|
475
|
+
const normalized = options.defaultDepth.trim().toLowerCase();
|
|
476
|
+
if (!CONTEXT_DEPTH_VALUES.includes(normalized)) {
|
|
477
|
+
throw new PmCliError(`Context --default-depth must be one of ${CONTEXT_DEPTH_VALUES.join("|")}`, EXIT_CODE.USAGE);
|
|
478
|
+
}
|
|
479
|
+
if (ctx.default_depth !== normalized) {
|
|
480
|
+
ctx.default_depth = normalized;
|
|
481
|
+
changed = true;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
if (options.activityLimit !== undefined) {
|
|
485
|
+
const parsed = parseInt(options.activityLimit.trim(), 10);
|
|
486
|
+
if (isNaN(parsed) || parsed <= 0) {
|
|
487
|
+
throw new PmCliError("Context --activity-limit must be a positive integer", EXIT_CODE.USAGE);
|
|
488
|
+
}
|
|
489
|
+
if (ctx.activity_limit !== parsed) {
|
|
490
|
+
ctx.activity_limit = parsed;
|
|
491
|
+
changed = true;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
if (options.staleThresholdDays !== undefined) {
|
|
495
|
+
const parsed = parseInt(options.staleThresholdDays.trim(), 10);
|
|
496
|
+
if (isNaN(parsed) || parsed <= 0) {
|
|
497
|
+
throw new PmCliError("Context --stale-threshold-days must be a positive integer", EXIT_CODE.USAGE);
|
|
498
|
+
}
|
|
499
|
+
if (ctx.stale_threshold_days !== parsed) {
|
|
500
|
+
ctx.stale_threshold_days = parsed;
|
|
501
|
+
changed = true;
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
const sectionToggles = [
|
|
505
|
+
["hierarchy", options.sectionHierarchy],
|
|
506
|
+
["activity", options.sectionActivity],
|
|
507
|
+
["progress", options.sectionProgress],
|
|
508
|
+
["blockers", options.sectionBlockers],
|
|
509
|
+
["files", options.sectionFiles],
|
|
510
|
+
["workload", options.sectionWorkload],
|
|
511
|
+
["staleness", options.sectionStaleness],
|
|
512
|
+
["tests", options.sectionTests],
|
|
513
|
+
];
|
|
514
|
+
for (const [sectionName, rawValue] of sectionToggles) {
|
|
515
|
+
const toggle = parseSectionToggle(rawValue);
|
|
516
|
+
if (toggle !== undefined) {
|
|
517
|
+
const key = sectionName;
|
|
518
|
+
if (ctx.sections[key] !== toggle) {
|
|
519
|
+
ctx.sections[key] = toggle;
|
|
520
|
+
changed = true;
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
if (changed) {
|
|
525
|
+
await writeSettings(target.pmRoot, settings, "config:set:context");
|
|
526
|
+
}
|
|
527
|
+
return withWarnings({
|
|
528
|
+
scope,
|
|
529
|
+
key: "context",
|
|
530
|
+
context_settings: {
|
|
531
|
+
default_depth: ctx.default_depth,
|
|
532
|
+
activity_limit: ctx.activity_limit,
|
|
533
|
+
stale_threshold_days: ctx.stale_threshold_days,
|
|
534
|
+
sections: { ...ctx.sections },
|
|
535
|
+
},
|
|
536
|
+
settings_path: target.settingsPath,
|
|
537
|
+
changed,
|
|
538
|
+
}, warnings);
|
|
539
|
+
}
|
|
446
540
|
export async function runConfig(scopeValue, actionValue, keyValue, options, global) {
|
|
447
541
|
const scope = normalizeScope(scopeValue);
|
|
448
542
|
const action = normalizeAction(actionValue);
|
|
@@ -454,8 +548,12 @@ export async function runConfig(scopeValue, actionValue, keyValue, options, glob
|
|
|
454
548
|
const keys = Object.keys(CONFIG_KEY_ALIASES).map((candidate) => ({
|
|
455
549
|
key: candidate,
|
|
456
550
|
aliases: CONFIG_KEY_ALIASES[candidate],
|
|
457
|
-
value_kind:
|
|
458
|
-
|
|
551
|
+
value_kind: candidate === "context"
|
|
552
|
+
? "object"
|
|
553
|
+
: isCriteriaConfigKey(candidate) ? "string_array" : "enum",
|
|
554
|
+
set_flags: candidate === "context"
|
|
555
|
+
? ["--default-depth", "--activity-limit", "--stale-threshold-days", "--section-<name>"]
|
|
556
|
+
: isCriteriaConfigKey(candidate) ? ["--criterion", "--clear-criteria"] : candidate === "item_format" ? ["--format"] : ["--policy"],
|
|
459
557
|
summary: CONFIG_KEY_SUMMARIES[candidate],
|
|
460
558
|
value: readConfigValue(settings, candidate),
|
|
461
559
|
}));
|
|
@@ -489,6 +587,7 @@ export async function runConfig(scopeValue, actionValue, keyValue, options, glob
|
|
|
489
587
|
governance_force_required_for_stale_lock: readConfigValue(settings, "governance_force_required_for_stale_lock"),
|
|
490
588
|
test_result_tracking: readConfigValue(settings, "test_result_tracking"),
|
|
491
589
|
telemetry_tracking: readConfigValue(settings, "telemetry_tracking"),
|
|
590
|
+
context: readConfigValue(settings, "context"),
|
|
492
591
|
};
|
|
493
592
|
return withWarnings({
|
|
494
593
|
scope,
|
|
@@ -673,6 +772,20 @@ export async function runConfig(scopeValue, actionValue, keyValue, options, glob
|
|
|
673
772
|
changed: false,
|
|
674
773
|
}, warnings);
|
|
675
774
|
}
|
|
775
|
+
if (key === "context") {
|
|
776
|
+
return withWarnings({
|
|
777
|
+
scope,
|
|
778
|
+
key,
|
|
779
|
+
context_settings: {
|
|
780
|
+
default_depth: settings.context.default_depth,
|
|
781
|
+
activity_limit: settings.context.activity_limit,
|
|
782
|
+
stale_threshold_days: settings.context.stale_threshold_days,
|
|
783
|
+
sections: { ...settings.context.sections },
|
|
784
|
+
},
|
|
785
|
+
settings_path: target.settingsPath,
|
|
786
|
+
changed: false,
|
|
787
|
+
}, warnings);
|
|
788
|
+
}
|
|
676
789
|
return withWarnings({
|
|
677
790
|
scope,
|
|
678
791
|
key,
|
|
@@ -1009,6 +1122,9 @@ export async function runConfig(scopeValue, actionValue, keyValue, options, glob
|
|
|
1009
1122
|
changed,
|
|
1010
1123
|
}, warnings);
|
|
1011
1124
|
}
|
|
1125
|
+
if (key === "context") {
|
|
1126
|
+
return applyContextConfig(settings, options, target, scope, warnings);
|
|
1127
|
+
}
|
|
1012
1128
|
const nextCriteria = normalizeCriteria(options.criterion, options.clearCriteria);
|
|
1013
1129
|
const changed = nextCriteria.length !== settings.workflow.definition_of_done.length ||
|
|
1014
1130
|
nextCriteria.some((value, index) => value !== settings.workflow.definition_of_done[index]);
|