@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,7 @@
|
|
|
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]="d166f748-b8c5-5837-a22e-8a0e34b28c72")}catch(e){}}();
|
|
3
|
+
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
4
|
+
import { PmCliError } from "../core/shared/errors.js";
|
|
3
5
|
const UNSAFE_LOOSE_OPTION_KEYS = new Set(["__proto__", "prototype", "constructor"]);
|
|
4
6
|
function toLooseOptionKey(rawKey) {
|
|
5
7
|
const key = rawKey.trim().toLowerCase();
|
|
@@ -20,9 +22,33 @@ function setLooseOptionValue(options, key, value) {
|
|
|
20
22
|
}
|
|
21
23
|
function parseLooseOptionToken(args, index) {
|
|
22
24
|
const token = args[index];
|
|
23
|
-
if (!token.startsWith("
|
|
25
|
+
if (!token.startsWith("-") || token === "-" || token === "--") {
|
|
24
26
|
return null;
|
|
25
27
|
}
|
|
28
|
+
if (!token.startsWith("--")) {
|
|
29
|
+
const equalsIndex = token.indexOf("=");
|
|
30
|
+
if (equalsIndex >= 0) {
|
|
31
|
+
return {
|
|
32
|
+
consumed: 1,
|
|
33
|
+
key: token.slice(1, equalsIndex).trim(),
|
|
34
|
+
value: token.slice(equalsIndex + 1),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const key = token.slice(1).trim();
|
|
38
|
+
const next = args[index + 1];
|
|
39
|
+
if (typeof next === "string" && !next.startsWith("-")) {
|
|
40
|
+
return {
|
|
41
|
+
consumed: 2,
|
|
42
|
+
key,
|
|
43
|
+
value: next,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
consumed: 1,
|
|
48
|
+
key,
|
|
49
|
+
value: true,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
26
52
|
const equalsIndex = token.indexOf("=");
|
|
27
53
|
if (equalsIndex >= 0) {
|
|
28
54
|
return {
|
|
@@ -89,6 +115,67 @@ function collectLooseOptionKeys(definition) {
|
|
|
89
115
|
}
|
|
90
116
|
return [...new Set(keys)];
|
|
91
117
|
}
|
|
118
|
+
function resolveCanonicalLooseOptionKey(definition) {
|
|
119
|
+
const long = typeof definition.long === "string" ? definition.long.trim() : "";
|
|
120
|
+
if (long.startsWith("--")) {
|
|
121
|
+
const normalized = toLooseOptionKey(long.slice(2));
|
|
122
|
+
if (normalized.length > 0 && !isUnsafeLooseOptionKey(normalized)) {
|
|
123
|
+
return normalized;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return collectLooseOptionKeys(definition)[0] ?? null;
|
|
127
|
+
}
|
|
128
|
+
function formatLooseOptionLabel(definition) {
|
|
129
|
+
const long = typeof definition.long === "string" ? definition.long.trim() : "";
|
|
130
|
+
if (long.startsWith("--") && long.length > 2) {
|
|
131
|
+
return long;
|
|
132
|
+
}
|
|
133
|
+
const short = typeof definition.short === "string" ? definition.short.trim() : "";
|
|
134
|
+
if (short.startsWith("-") && !short.startsWith("--") && short.length > 1) {
|
|
135
|
+
return short;
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
export function validateLooseCommandOptionsWithFlagDefinitions(options, definitions, commandPath) {
|
|
140
|
+
if (definitions.length === 0) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
const allowed = new Set();
|
|
144
|
+
const disabled = new Map();
|
|
145
|
+
const required = [];
|
|
146
|
+
const labels = [];
|
|
147
|
+
for (const definition of definitions) {
|
|
148
|
+
const keys = collectLooseOptionKeys(definition);
|
|
149
|
+
const label = formatLooseOptionLabel(definition);
|
|
150
|
+
if (label) {
|
|
151
|
+
labels.push(label);
|
|
152
|
+
}
|
|
153
|
+
for (const key of keys) {
|
|
154
|
+
allowed.add(key);
|
|
155
|
+
if (definition.enabled === false) {
|
|
156
|
+
disabled.set(key, label ?? `--${key}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (definition.required === true && definition.enabled !== false && keys.length > 0) {
|
|
160
|
+
required.push({ keys, label: label ?? `--${keys[0]}` });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
for (const key of Object.keys(options)) {
|
|
164
|
+
if (!allowed.has(key)) {
|
|
165
|
+
const expected = labels.length > 0 ? ` Expected one of: ${[...new Set(labels)].join(", ")}.` : "";
|
|
166
|
+
throw new PmCliError(`Unknown option '--${key}' for extension command '${commandPath}'.${expected}`, EXIT_CODE.USAGE);
|
|
167
|
+
}
|
|
168
|
+
const disabledLabel = disabled.get(key);
|
|
169
|
+
if (disabledLabel) {
|
|
170
|
+
throw new PmCliError(`Option '${disabledLabel}' is disabled for extension command '${commandPath}'.`, EXIT_CODE.USAGE);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
for (const entry of required) {
|
|
174
|
+
if (!entry.keys.some((key) => Object.hasOwn(options, key))) {
|
|
175
|
+
throw new PmCliError(`Missing required option '${entry.label}' for extension command '${commandPath}'.`, EXIT_CODE.USAGE);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
92
179
|
function coerceLooseOptionValue(value, kind) {
|
|
93
180
|
if (Array.isArray(value)) {
|
|
94
181
|
return value.map((entry) => coerceLooseOptionValue(entry, kind));
|
|
@@ -135,16 +222,28 @@ export function coerceLooseCommandOptionsWithFlagDefinitions(options, definition
|
|
|
135
222
|
coerced[key] = value;
|
|
136
223
|
}
|
|
137
224
|
for (const definition of definitions) {
|
|
138
|
-
const
|
|
139
|
-
if (!
|
|
225
|
+
const canonical = resolveCanonicalLooseOptionKey(definition);
|
|
226
|
+
if (!canonical) {
|
|
140
227
|
continue;
|
|
141
228
|
}
|
|
142
229
|
for (const key of collectLooseOptionKeys(definition)) {
|
|
143
|
-
if (!Object.hasOwn(coerced, key)) {
|
|
230
|
+
if (key === canonical || !Object.hasOwn(coerced, key)) {
|
|
144
231
|
continue;
|
|
145
232
|
}
|
|
146
|
-
|
|
233
|
+
if (Object.hasOwn(coerced, canonical)) {
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
coerced[canonical] = coerced[key];
|
|
237
|
+
delete coerced[key];
|
|
238
|
+
}
|
|
239
|
+
const kind = resolveLooseOptionCoercionKind(definition);
|
|
240
|
+
if (!kind) {
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
if (!Object.hasOwn(coerced, canonical)) {
|
|
244
|
+
continue;
|
|
147
245
|
}
|
|
246
|
+
coerced[canonical] = coerceLooseOptionValue(coerced[canonical], kind);
|
|
148
247
|
}
|
|
149
248
|
return coerced;
|
|
150
249
|
}
|
|
@@ -168,4 +267,4 @@ export function parseLooseCommandOptions(args) {
|
|
|
168
267
|
return options;
|
|
169
268
|
}
|
|
170
269
|
//# sourceMappingURL=extension-command-options.js.map
|
|
171
|
-
//# debugId=
|
|
270
|
+
//# debugId=d166f748-b8c5-5837-a22e-8a0e34b28c72
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extension-command-options.js","sources":["cli/extension-command-options.ts"],"sourceRoot":"/","sourcesContent":["const UNSAFE_LOOSE_OPTION_KEYS = new Set([\"__proto__\", \"prototype\", \"constructor\"]);\n\nfunction toLooseOptionKey(rawKey: string): string {\n const key = rawKey.trim().toLowerCase();\n return key.replaceAll(/-([a-z0-9])/g, (_match, group: string) => group.toUpperCase());\n}\n\nfunction setLooseOptionValue(options: Record<string, unknown>, key: string, value: unknown): void {\n const existing = options[key];\n if (existing === undefined) {\n options[key] = value;\n return;\n }\n if (Array.isArray(existing)) {\n existing.push(value);\n options[key] = existing;\n return;\n }\n options[key] = [existing, value];\n}\n\ninterface ParsedLooseOptionToken {\n consumed: number;\n key: string;\n value: unknown;\n}\n\nfunction parseLooseOptionToken(args: string[], index: number): ParsedLooseOptionToken | null {\n const token = args[index];\n if (!token.startsWith(\"--\") || token === \"--\") {\n return null;\n }\n\n const equalsIndex = token.indexOf(\"=\");\n if (equalsIndex >= 0) {\n return {\n consumed: 1,\n key: token.slice(2, equalsIndex).trim(),\n value: token.slice(equalsIndex + 1),\n };\n }\n\n if (token.startsWith(\"--no-\")) {\n return {\n consumed: 1,\n key: token.slice(5).trim(),\n value: false,\n };\n }\n\n const key = token.slice(2).trim();\n const next = args[index + 1];\n if (typeof next === \"string\" && !next.startsWith(\"-\")) {\n return {\n consumed: 2,\n key,\n value: next,\n };\n }\n return {\n consumed: 1,\n key,\n value: true,\n };\n}\n\nfunction isUnsafeLooseOptionKey(key: string): boolean {\n return UNSAFE_LOOSE_OPTION_KEYS.has(key);\n}\n\ntype LooseOptionCoercionKind = \"string\" | \"number\" | \"boolean\";\n\nfunction resolveLooseOptionCoercionKind(definition: Record<string, unknown>): LooseOptionCoercionKind | null {\n const explicitType = typeof definition.type === \"string\" ? definition.type.trim().toLowerCase() : undefined;\n const valueType = typeof definition.value_type === \"string\" ? definition.value_type.trim().toLowerCase() : undefined;\n const kind = explicitType ?? valueType;\n if (kind === \"string\") {\n return \"string\";\n }\n if (kind === \"number\" || kind === \"int\" || kind === \"integer\" || kind === \"float\") {\n return \"number\";\n }\n if (kind === \"boolean\" || kind === \"bool\") {\n return \"boolean\";\n }\n return null;\n}\n\nfunction collectLooseOptionKeys(definition: Record<string, unknown>): string[] {\n const keys: string[] = [];\n const long = typeof definition.long === \"string\" ? definition.long.trim() : \"\";\n const short = typeof definition.short === \"string\" ? definition.short.trim() : \"\";\n if (long.startsWith(\"--\")) {\n const normalized = toLooseOptionKey(long.slice(2));\n if (normalized.length > 0 && !isUnsafeLooseOptionKey(normalized)) {\n keys.push(normalized);\n }\n }\n if (short.startsWith(\"-\") && !short.startsWith(\"--\")) {\n const normalized = toLooseOptionKey(short.slice(1));\n if (normalized.length > 0 && !isUnsafeLooseOptionKey(normalized)) {\n keys.push(normalized);\n }\n }\n return [...new Set(keys)];\n}\n\nfunction coerceLooseOptionValue(value: unknown, kind: LooseOptionCoercionKind): unknown {\n if (Array.isArray(value)) {\n return value.map((entry) => coerceLooseOptionValue(entry, kind));\n }\n if (kind === \"string\") {\n if (typeof value === \"string\") {\n return value;\n }\n if (value === null || value === undefined) {\n return value;\n }\n return String(value);\n }\n if (kind === \"number\") {\n if (typeof value === \"number\") {\n return Number.isFinite(value) ? value : value;\n }\n if (typeof value === \"string\" && value.trim().length > 0) {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : value;\n }\n return value;\n }\n if (typeof value === \"boolean\") {\n return value;\n }\n if (typeof value === \"string\") {\n const normalized = value.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\") {\n return false;\n }\n }\n return value;\n}\n\nexport function coerceLooseCommandOptionsWithFlagDefinitions(\n options: Record<string, unknown>,\n definitions: Array<Record<string, unknown>>,\n): Record<string, unknown> {\n if (definitions.length === 0) {\n return options;\n }\n const coerced = Object.create(null) as Record<string, unknown>;\n for (const [key, value] of Object.entries(options)) {\n coerced[key] = value;\n }\n for (const definition of definitions) {\n const kind = resolveLooseOptionCoercionKind(definition);\n if (!kind) {\n continue;\n }\n for (const key of collectLooseOptionKeys(definition)) {\n if (!Object.hasOwn(coerced, key)) {\n continue;\n }\n coerced[key] = coerceLooseOptionValue(coerced[key], kind);\n }\n }\n return coerced;\n}\n\nexport function parseLooseCommandOptions(args: string[]): Record<string, unknown> {\n const options = Object.create(null) as Record<string, unknown>;\n let index = 0;\n while (index < args.length) {\n const parsed = parseLooseOptionToken(args, index);\n if (!parsed) {\n index += 1;\n continue;\n }\n\n const normalizedKey = toLooseOptionKey(parsed.key);\n if (normalizedKey.length === 0 || isUnsafeLooseOptionKey(normalizedKey)) {\n index += parsed.consumed;\n continue;\n }\n setLooseOptionValue(options, normalizedKey, parsed.value);\n index += parsed.consumed;\n }\n return options;\n}\n"],"names":[],"mappings":";;AAAA,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;AAEpF,SAAS,gBAAgB,CAAC,MAAc;IACtC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACxC,OAAO,GAAG,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;AACxF,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAgC,EAAE,GAAW,EAAE,KAAc;IACxF,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACrB,OAAO;IACT,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;QACxB,OAAO;IACT,CAAC;IACD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B,SAAS;QACX,CAAC;QACD,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1D,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC;IAC3B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","debugId":"0eb015c7-dbd0-53de-a4c7-ed7c5ef96601"}
|
|
1
|
+
{"version":3,"file":"extension-command-options.js","sources":["cli/extension-command-options.ts"],"sourceRoot":"/","sourcesContent":["import { EXIT_CODE } from \"../core/shared/constants.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\n\nconst UNSAFE_LOOSE_OPTION_KEYS = new Set([\"__proto__\", \"prototype\", \"constructor\"]);\n\nfunction toLooseOptionKey(rawKey: string): string {\n const key = rawKey.trim().toLowerCase();\n return key.replaceAll(/-([a-z0-9])/g, (_match, group: string) => group.toUpperCase());\n}\n\nfunction setLooseOptionValue(options: Record<string, unknown>, key: string, value: unknown): void {\n const existing = options[key];\n if (existing === undefined) {\n options[key] = value;\n return;\n }\n if (Array.isArray(existing)) {\n existing.push(value);\n options[key] = existing;\n return;\n }\n options[key] = [existing, value];\n}\n\ninterface ParsedLooseOptionToken {\n consumed: number;\n key: string;\n value: unknown;\n}\n\nfunction parseLooseOptionToken(args: string[], index: number): ParsedLooseOptionToken | null {\n const token = args[index];\n if (!token.startsWith(\"-\") || token === \"-\" || token === \"--\") {\n return null;\n }\n\n if (!token.startsWith(\"--\")) {\n const equalsIndex = token.indexOf(\"=\");\n if (equalsIndex >= 0) {\n return {\n consumed: 1,\n key: token.slice(1, equalsIndex).trim(),\n value: token.slice(equalsIndex + 1),\n };\n }\n const key = token.slice(1).trim();\n const next = args[index + 1];\n if (typeof next === \"string\" && !next.startsWith(\"-\")) {\n return {\n consumed: 2,\n key,\n value: next,\n };\n }\n return {\n consumed: 1,\n key,\n value: true,\n };\n }\n\n const equalsIndex = token.indexOf(\"=\");\n if (equalsIndex >= 0) {\n return {\n consumed: 1,\n key: token.slice(2, equalsIndex).trim(),\n value: token.slice(equalsIndex + 1),\n };\n }\n\n if (token.startsWith(\"--no-\")) {\n return {\n consumed: 1,\n key: token.slice(5).trim(),\n value: false,\n };\n }\n\n const key = token.slice(2).trim();\n const next = args[index + 1];\n if (typeof next === \"string\" && !next.startsWith(\"-\")) {\n return {\n consumed: 2,\n key,\n value: next,\n };\n }\n return {\n consumed: 1,\n key,\n value: true,\n };\n}\n\nfunction isUnsafeLooseOptionKey(key: string): boolean {\n return UNSAFE_LOOSE_OPTION_KEYS.has(key);\n}\n\ntype LooseOptionCoercionKind = \"string\" | \"number\" | \"boolean\";\n\nfunction resolveLooseOptionCoercionKind(definition: Record<string, unknown>): LooseOptionCoercionKind | null {\n const explicitType = typeof definition.type === \"string\" ? definition.type.trim().toLowerCase() : undefined;\n const valueType = typeof definition.value_type === \"string\" ? definition.value_type.trim().toLowerCase() : undefined;\n const kind = explicitType ?? valueType;\n if (kind === \"string\") {\n return \"string\";\n }\n if (kind === \"number\" || kind === \"int\" || kind === \"integer\" || kind === \"float\") {\n return \"number\";\n }\n if (kind === \"boolean\" || kind === \"bool\") {\n return \"boolean\";\n }\n return null;\n}\n\nfunction collectLooseOptionKeys(definition: Record<string, unknown>): string[] {\n const keys: string[] = [];\n const long = typeof definition.long === \"string\" ? definition.long.trim() : \"\";\n const short = typeof definition.short === \"string\" ? definition.short.trim() : \"\";\n if (long.startsWith(\"--\")) {\n const normalized = toLooseOptionKey(long.slice(2));\n if (normalized.length > 0 && !isUnsafeLooseOptionKey(normalized)) {\n keys.push(normalized);\n }\n }\n if (short.startsWith(\"-\") && !short.startsWith(\"--\")) {\n const normalized = toLooseOptionKey(short.slice(1));\n if (normalized.length > 0 && !isUnsafeLooseOptionKey(normalized)) {\n keys.push(normalized);\n }\n }\n return [...new Set(keys)];\n}\n\nfunction resolveCanonicalLooseOptionKey(definition: Record<string, unknown>): string | null {\n const long = typeof definition.long === \"string\" ? definition.long.trim() : \"\";\n if (long.startsWith(\"--\")) {\n const normalized = toLooseOptionKey(long.slice(2));\n if (normalized.length > 0 && !isUnsafeLooseOptionKey(normalized)) {\n return normalized;\n }\n }\n return collectLooseOptionKeys(definition)[0] ?? null;\n}\n\nfunction formatLooseOptionLabel(definition: Record<string, unknown>): string | null {\n const long = typeof definition.long === \"string\" ? definition.long.trim() : \"\";\n if (long.startsWith(\"--\") && long.length > 2) {\n return long;\n }\n const short = typeof definition.short === \"string\" ? definition.short.trim() : \"\";\n if (short.startsWith(\"-\") && !short.startsWith(\"--\") && short.length > 1) {\n return short;\n }\n return null;\n}\n\nexport function validateLooseCommandOptionsWithFlagDefinitions(\n options: Record<string, unknown>,\n definitions: Array<Record<string, unknown>>,\n commandPath: string,\n): void {\n if (definitions.length === 0) {\n return;\n }\n const allowed = new Set<string>();\n const disabled = new Map<string, string>();\n const required: Array<{ keys: string[]; label: string }> = [];\n const labels: string[] = [];\n for (const definition of definitions) {\n const keys = collectLooseOptionKeys(definition);\n const label = formatLooseOptionLabel(definition);\n if (label) {\n labels.push(label);\n }\n for (const key of keys) {\n allowed.add(key);\n if (definition.enabled === false) {\n disabled.set(key, label ?? `--${key}`);\n }\n }\n if (definition.required === true && definition.enabled !== false && keys.length > 0) {\n required.push({ keys, label: label ?? `--${keys[0]}` });\n }\n }\n for (const key of Object.keys(options)) {\n if (!allowed.has(key)) {\n const expected = labels.length > 0 ? ` Expected one of: ${[...new Set(labels)].join(\", \")}.` : \"\";\n throw new PmCliError(`Unknown option '--${key}' for extension command '${commandPath}'.${expected}`, EXIT_CODE.USAGE);\n }\n const disabledLabel = disabled.get(key);\n if (disabledLabel) {\n throw new PmCliError(`Option '${disabledLabel}' is disabled for extension command '${commandPath}'.`, EXIT_CODE.USAGE);\n }\n }\n for (const entry of required) {\n if (!entry.keys.some((key) => Object.hasOwn(options, key))) {\n throw new PmCliError(`Missing required option '${entry.label}' for extension command '${commandPath}'.`, EXIT_CODE.USAGE);\n }\n }\n}\n\nfunction coerceLooseOptionValue(value: unknown, kind: LooseOptionCoercionKind): unknown {\n if (Array.isArray(value)) {\n return value.map((entry) => coerceLooseOptionValue(entry, kind));\n }\n if (kind === \"string\") {\n if (typeof value === \"string\") {\n return value;\n }\n if (value === null || value === undefined) {\n return value;\n }\n return String(value);\n }\n if (kind === \"number\") {\n if (typeof value === \"number\") {\n return Number.isFinite(value) ? value : value;\n }\n if (typeof value === \"string\" && value.trim().length > 0) {\n const parsed = Number(value);\n return Number.isFinite(parsed) ? parsed : value;\n }\n return value;\n }\n if (typeof value === \"boolean\") {\n return value;\n }\n if (typeof value === \"string\") {\n const normalized = value.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\") {\n return false;\n }\n }\n return value;\n}\n\nexport function coerceLooseCommandOptionsWithFlagDefinitions(\n options: Record<string, unknown>,\n definitions: Array<Record<string, unknown>>,\n): Record<string, unknown> {\n if (definitions.length === 0) {\n return options;\n }\n const coerced = Object.create(null) as Record<string, unknown>;\n for (const [key, value] of Object.entries(options)) {\n coerced[key] = value;\n }\n for (const definition of definitions) {\n const canonical = resolveCanonicalLooseOptionKey(definition);\n if (!canonical) {\n continue;\n }\n for (const key of collectLooseOptionKeys(definition)) {\n if (key === canonical || !Object.hasOwn(coerced, key)) {\n continue;\n }\n if (Object.hasOwn(coerced, canonical)) {\n continue;\n }\n coerced[canonical] = coerced[key];\n delete coerced[key];\n }\n const kind = resolveLooseOptionCoercionKind(definition);\n if (!kind) {\n continue;\n }\n if (!Object.hasOwn(coerced, canonical)) {\n continue;\n }\n coerced[canonical] = coerceLooseOptionValue(coerced[canonical], kind);\n }\n return coerced;\n}\n\nexport function parseLooseCommandOptions(args: string[]): Record<string, unknown> {\n const options = Object.create(null) as Record<string, unknown>;\n let index = 0;\n while (index < args.length) {\n const parsed = parseLooseOptionToken(args, index);\n if (!parsed) {\n index += 1;\n continue;\n }\n\n const normalizedKey = toLooseOptionKey(parsed.key);\n if (normalizedKey.length === 0 || isUnsafeLooseOptionKey(normalizedKey)) {\n index += parsed.consumed;\n continue;\n }\n setLooseOptionValue(options, normalizedKey, parsed.value);\n index += parsed.consumed;\n }\n return options;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,MAAM,wBAAwB,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC;AAEpF,SAAS,gBAAgB,CAAC,MAAc;IACtC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACxC,OAAO,GAAG,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;AACxF,CAAC;AAED,SAAS,mBAAmB,CAAC,OAAgC,EAAE,GAAW,EAAE,KAAc;IACxF,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACrB,OAAO;IACT,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC5B,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;QACxB,OAAO;IACT,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC;AAQD,SAAS,qBAAqB,CAAC,IAAc,EAAE,KAAa;IAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KA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AS;QACX,CAAC;QACD,OAAO,CAAC,SAAS,CAAC,GAAG,sBAAsB,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,IAAc;IACrD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAA4B,CAAC;IAC/D,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,OAAO,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,MAAM,GAAG,qBAAqB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAClD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,KAAK,IAAI,CAAC,CAAC;YACX,SAAS;QACX,CAAC;QAED,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACnD,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,IAAI,sBAAsB,CAAC,aAAa,CAAC,EAAE,CAAC;YACxE,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC;YACzB,SAAS;QACX,CAAC;QACD,mBAAmB,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1D,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC;IAC3B,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","debugId":"d166f748-b8c5-5837-a22e-8a0e34b28c72"}
|
|
@@ -16,5 +16,4 @@ export declare function resolveHelpDetailMode(argv: string[]): HelpDetailMode;
|
|
|
16
16
|
export declare const ROOT_HELP_BUNDLE: HelpBundle;
|
|
17
17
|
export declare function resolveHelpBundleForPath(commandPath: string | undefined): HelpBundle;
|
|
18
18
|
export declare function resolveHelpNarrative(commandPath: string | undefined, detailMode: HelpDetailMode): HelpNarrative;
|
|
19
|
-
export declare function listDocumentedHelpPaths(): string[];
|
|
20
19
|
export declare function attachRichHelpText(program: Command, argv?: string[]): void;
|
package/dist/cli/help-content.js
CHANGED
|
@@ -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]="87ab8982-4eaf-5b48-88af-96ff4450ab0f")}catch(e){}}();
|
|
3
3
|
function renderCompactHelpBundle(bundle) {
|
|
4
4
|
const lines = [
|
|
5
5
|
"",
|
|
@@ -379,12 +379,13 @@ const HELP_BY_COMMAND_PATH = {
|
|
|
379
379
|
},
|
|
380
380
|
history: {
|
|
381
381
|
why: "Inspects item mutation timeline and audit trail.",
|
|
382
|
-
examples: ["pm history pm-a1b2 --limit 20"],
|
|
382
|
+
examples: ["pm history pm-a1b2 --limit 20", "pm history pm-a1b2 --full --verify"],
|
|
383
383
|
},
|
|
384
384
|
activity: {
|
|
385
385
|
why: "Reviews recent tracker-wide activity across items.",
|
|
386
386
|
examples: [
|
|
387
387
|
"pm activity --limit 50",
|
|
388
|
+
"pm activity --full --id pm-a1b2 --limit 50",
|
|
388
389
|
"pm activity --id pm-a1b2 --op update --author codex-agent --from -7d --to now",
|
|
389
390
|
"pm activity --json --stream rows --limit 200",
|
|
390
391
|
],
|
|
@@ -515,7 +516,13 @@ const HELP_BY_COMMAND_PATH = {
|
|
|
515
516
|
},
|
|
516
517
|
health: {
|
|
517
518
|
why: "Validates tracker/runtime health including extension triage, migration, and integrity diagnostics.",
|
|
518
|
-
examples: [
|
|
519
|
+
examples: [
|
|
520
|
+
"pm health",
|
|
521
|
+
"pm health --check-only --summary --json",
|
|
522
|
+
"pm health --brief --json",
|
|
523
|
+
"pm health --no-refresh",
|
|
524
|
+
"pm health --refresh-vectors",
|
|
525
|
+
],
|
|
519
526
|
},
|
|
520
527
|
validate: {
|
|
521
528
|
why: "Runs standalone metadata, resolution, lifecycle (including dependency-cycle diagnostics), linked-file, linked-command reference, and history drift checks with default remediation hints for resolution gaps.",
|
|
@@ -531,8 +538,8 @@ const HELP_BY_COMMAND_PATH = {
|
|
|
531
538
|
tips: ["Resolution-gap warnings include default `pm update <id> ...` remediation hint templates in check details."],
|
|
532
539
|
},
|
|
533
540
|
gc: {
|
|
534
|
-
why: "
|
|
535
|
-
examples: ["pm gc"],
|
|
541
|
+
why: "Deletes optional cache artifacts by default to keep local tracker state tidy; use --dry-run to preview targets without deleting files.",
|
|
542
|
+
examples: ["pm gc --dry-run", "pm gc"],
|
|
536
543
|
},
|
|
537
544
|
claim: {
|
|
538
545
|
why: "Claims an item to signal active ownership and reduce conflicts.",
|
|
@@ -618,9 +625,6 @@ export function resolveHelpNarrative(commandPath, detailMode) {
|
|
|
618
625
|
detail_mode: detailMode,
|
|
619
626
|
};
|
|
620
627
|
}
|
|
621
|
-
export function listDocumentedHelpPaths() {
|
|
622
|
-
return Object.keys(HELP_BY_COMMAND_PATH).sort((left, right) => left.localeCompare(right));
|
|
623
|
-
}
|
|
624
628
|
export function attachRichHelpText(program, argv = process.argv.slice(2)) {
|
|
625
629
|
const detailMode = resolveHelpDetailMode(argv);
|
|
626
630
|
program.addHelpText("after", renderHelpBundle(ROOT_HELP_BUNDLE, detailMode));
|
|
@@ -629,4 +633,4 @@ export function attachRichHelpText(program, argv = process.argv.slice(2)) {
|
|
|
629
633
|
}
|
|
630
634
|
}
|
|
631
635
|
//# sourceMappingURL=help-content.js.map
|
|
632
|
-
//# debugId=
|
|
636
|
+
//# debugId=87ab8982-4eaf-5b48-88af-96ff4450ab0f
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-content.js","sources":["cli/help-content.ts"],"sourceRoot":"/","sourcesContent":["import { Command } from \"commander\";\n\nexport interface HelpBundle {\n why: string;\n examples: string[];\n tips?: string[];\n}\n\nexport interface HelpNarrative {\n intent: string;\n examples: string[];\n tips: string[];\n detail_mode: HelpDetailMode;\n}\n\nexport type HelpDetailMode = \"compact\" | \"detailed\";\n\nfunction renderCompactHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Intent:\",\n ` ${bundle.why}`,\n ];\n if (bundle.examples.length > 0) {\n lines.push(\"\", \"Example:\");\n lines.push(` ${bundle.examples[0]}`);\n }\n lines.push(\"\", \"Need deeper rationale and more examples?\");\n lines.push(\" Re-run with --explain.\");\n return lines.join(\"\\n\");\n}\n\nfunction renderDetailedHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Why use this command:\",\n ` ${bundle.why}`,\n \"\",\n \"Examples:\",\n ...bundle.examples.map((example) => ` ${example}`),\n ];\n if (bundle.tips && bundle.tips.length > 0) {\n lines.push(\"\", \"Tips:\");\n lines.push(...bundle.tips.map((tip) => ` - ${tip}`));\n }\n return lines.join(\"\\n\");\n}\n\nfunction renderHelpBundle(bundle: HelpBundle, detailMode: HelpDetailMode): string {\n if (detailMode === \"detailed\") {\n return renderDetailedHelpBundle(bundle);\n }\n return renderCompactHelpBundle(bundle);\n}\n\nexport function normalizeHelpCommandPath(commandPath: string): string {\n return commandPath\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nconst HELP_PATH_ALIASES: Record<string, string> = {\n cal: \"calendar\",\n ctx: \"context\",\n};\n\nfunction findDirectChildCommand(parent: Command, name: string): Command | null {\n return parent.commands.find((entry) => entry.name() === name) ?? null;\n}\n\nfunction findCommandByPath(root: Command, pathParts: string[]): Command | null {\n let current: Command = root;\n for (const part of pathParts) {\n const next = findDirectChildCommand(current, part);\n if (!next) {\n return null;\n }\n current = next;\n }\n return current;\n}\n\nfunction attachBundleByPath(root: Command, commandPath: string, bundle: HelpBundle, detailMode: HelpDetailMode): void {\n const command = findCommandByPath(root, commandPath.split(\" \").filter((part) => part.length > 0));\n if (!command) {\n return;\n }\n command.addHelpText(\"after\", renderHelpBundle(bundle, detailMode));\n}\n\nexport function resolveHelpDetailMode(argv: string[]): HelpDetailMode {\n if (argv.includes(\"--explain\")) {\n return \"detailed\";\n }\n return \"compact\";\n}\n\nconst HELP_BY_COMMAND_PATH: Record<string, HelpBundle> = {\n init: {\n why: \"Bootstraps tracker storage and settings so all other commands can run safely.\",\n examples: [\n \"pm init\",\n \"pm init acme\",\n \"pm init --preset minimal\",\n \"pm init --agent-guidance add\",\n \"pm init --defaults --with-packages\",\n ],\n tips: [\n \"Run this once per repository before create/list/update commands.\",\n \"Use --preset for non-interactive automation; omit it in a TTY to use the setup wizard.\",\n \"Use --agent-guidance add to inject compact AGENTS/CLAUDE workflow guidance, or --agent-guidance status to inspect missing guidance without modifying files.\",\n \"Use --with-packages when agents need bundled commands such as calendar and templates available immediately.\",\n ],\n },\n config: {\n why: \"Reads or updates project/global settings such as definition-of-done, item format, telemetry, and policy toggles.\",\n examples: [\n 'pm config project get definition-of-done',\n 'pm config project set definition-of-done --criterion \"tests pass\"',\n \"pm config project set item-format --format toon\",\n \"pm config project set sprint-release-format-policy --policy strict_error\",\n \"pm config project set governance-preset --policy minimal\",\n \"pm config project set governance-ownership-enforcement --policy none\",\n \"pm config project set test-result-tracking --policy enabled\",\n \"pm config global set telemetry-tracking --policy disabled\",\n ],\n },\n extension: {\n why:\n \"Compatibility command for package-backed runtime extension lifecycle operations across project or global scope.\",\n examples: [\n \"pm install ./my-package --project\",\n \"pm install '*' --project\",\n \"pm package doctor --project --detail summary\",\n \"pm package manage --global\",\n \"pm package activate sample-ext --project\",\n \"pm package deactivate sample-ext --project\",\n \"pm package uninstall sample-ext --global\",\n \"pm extension explore --project\",\n \"pm extension manage --global\",\n \"pm extension doctor --detail deep\",\n ],\n tips: [\n \"Prefer pm install and pm package in new user-facing automation.\",\n \"Use pm extension when maintaining existing extension-specific scripts or debugging the compatibility runtime directly.\",\n \"Bundled aliases beads and todos resolve to package-shipped extension sources.\",\n \"Use --gh/--github shorthand for GitHub sources and --ref to pin a branch, tag, or ref.\",\n \"Install updates settings activation state automatically unless extension allowlist mode is unchanged.\",\n \"Use --adopt for single-extension adoption and --adopt-all to bulk-register unmanaged installs as managed without reinstalling.\",\n \"Use --manage for concise triage summaries and remediation-oriented diagnostics alongside full extension details.\",\n \"Use --doctor for consolidated diagnostics with warning codes, remediation hints, and optional deep detail payloads.\",\n ],\n },\n package: {\n why:\n \"Installs, explores, manages, diagnoses, adopts, activates, deactivates, and refreshes package-backed pm runtime extensions.\",\n examples: [\n \"pm install npm:@scope/pm-package --project\",\n \"pm package install ./my-package --project\",\n \"pm package doctor --project --detail deep\",\n \"pm package manage --project --runtime-probe\",\n \"pm package activate sample-ext --project\",\n \"pm upgrade --packages-only --dry-run\",\n ],\n tips: [\n \"Prefer package vocabulary for user-facing workflows; extension vocabulary remains available for compatibility.\",\n \"Use pm upgrade to refresh the CLI/SDK and managed packages from their recorded sources.\",\n \"Use --dry-run before upgrade when automation needs a deterministic plan.\",\n ],\n },\n install: {\n why: \"Installs a pm package into project scope by default, using local, npm, GitHub, or bundled alias sources.\",\n examples: [\n \"pm install '*' --project\",\n \"pm install ./packages/pm-todos --project\",\n \"pm install npm:@scope/pm-package --global\",\n \"pm install --github org/repo/packages/my-pm-package --ref main\",\n ],\n tips: [\"Installed packages are recorded in managed state and can be inspected with pm package manage.\"],\n },\n upgrade: {\n why: \"Updates the global pm CLI/SDK and refreshes managed pm packages from recorded install sources.\",\n examples: [\n \"pm upgrade --dry-run\",\n \"pm upgrade --packages-only --project\",\n \"pm upgrade todos --dry-run\",\n \"pm upgrade --cli-only --repair\",\n \"pm upgrade --tag next --dry-run\",\n ],\n tips: [\n \"Omit target to include the CLI/SDK plus all managed packages in the selected scope.\",\n \"Pass a target to refresh one managed package by name, directory, package name, or source.\",\n \"Use --packages-only in repository automation when the global CLI should not be changed.\",\n ],\n },\n create: {\n why: \"Creates a new planning item with deterministic metadata and history.\",\n examples: [\n 'pm create --title \"Harden lock flow\" --description \"Improve stale lock handling\" --type Task --status open --priority 1 --message \"Create lock hardening task\" --create-mode progressive',\n 'pm create --title \"Weekly planning sync\" --description \"Recurring coordination meeting\" --type Meeting --schedule-preset lightweight',\n 'pm create --title \"Asset: Hero model\" --description \"Track playable model asset\" --type Asset --status open --priority 1 --message \"Create asset item\" --type-option category=Character --dep \"id=pm-epic01,kind=parent,author=codex-agent,created_at=now\" --comment \"author=codex-agent,created_at=now,text=Why this asset item exists.\" --note \"author=codex-agent,created_at=now,text=Initial implementation note.\" --learning \"author=codex-agent,created_at=now,text=Durable lesson placeholder.\" --file \"path=src/assets/hero.glb,note=tracked asset\" --test \"command=node scripts/run-tests.mjs test,timeout_seconds=240\" --doc \"path=README.md,note=asset docs\"',\n ],\n tips: [\n \"Use --schedule-preset lightweight for Reminder/Meeting/Event when you want minimal required create inputs.\",\n \"Use --type <value> to load type-aware policy guidance in --help output.\",\n ],\n },\n update: {\n why: \"Mutates existing item fields while preserving history and lock safety.\",\n examples: [\n 'pm update pm-a1b2 --status in_progress --message \"Start implementation\"',\n 'pm update pm-a1b2 --unset close-reason --message \"Clear stale close reason after reopen\"',\n 'pm update pm-a1b2 --unset assignee --deadline +2d --message \"Replan ownership and deadline\"',\n 'pm update pm-a1b2 --body \"Backfilled body text for legacy item\" --message \"Normalize missing body\"',\n ],\n tips: [\n 'Use \"pm close <ID> <TEXT>\" to close items instead of --status closed.',\n \"When reopening from closed to a non-terminal status, update clears stale close_reason unless explicitly set via --close-reason.\",\n 'Use \"pm append <ID> --body <text>\" for additive notes; use update --body to replace body content.',\n ],\n },\n \"update-many\": {\n why: \"Bulk-updates matched item sets with dry-run previews and rollback checkpoints for safe large-scale metadata changes.\",\n examples: [\n \"pm update-many --filter-status open --status in_progress --dry-run\",\n 'pm update-many --filter-tag wave:7 --replace-tests --test \"command=node scripts/run-tests.mjs test -- tests/core/history.spec.ts,timeout_seconds=240\"',\n 'pm update-many --filter-tag governance --reviewer maintainer-review --message \"Normalize reviewer metadata\"',\n \"pm update-many --rollback ckpt-abc123\",\n ],\n tips: [\n \"Use --dry-run first to inspect proposed changes before apply mode.\",\n \"Linked-array mutation flags mirror pm update semantics (for example --replace-tests, --clear-files, and repeatable --doc/--note seeds).\",\n \"Checkpoints are enabled by default for apply mode and can be restored with --rollback.\",\n ],\n },\n normalize: {\n why:\n \"Scans items for low-signal lifecycle metadata drift, emits deterministic per-item plans, and optionally applies normalized metadata updates with update-style safety checks.\",\n examples: [\n \"pm normalize --dry-run\",\n \"pm normalize --filter-status in_progress --dry-run\",\n 'pm normalize --filter-status closed --apply --author \"codex-agent\" --message \"Normalize closure metadata\"',\n ],\n tips: [\n \"Dry-run mode is the default; pass --apply only after reviewing planned changes.\",\n \"Apply mode honors ownership/audit constraints and supports --allow-audit-update with optional --force override.\",\n ],\n },\n templates: {\n why: \"Saves, lists, and inspects reusable create option bundles for repeatable workflows.\",\n examples: [\n 'pm templates save triage-default --title \"Triage item\" --description \"...\" --type Task --status open --priority 2 --message \"Seed triage template\"',\n \"pm templates list\",\n \"pm templates show triage-default\",\n ],\n tips: [\n \"Template names are positional arguments (`pm templates save <name>` and `pm templates show <name>`), not --name flags.\",\n \"Combine templates with explicit create flags; explicit flags always override template defaults.\",\n ],\n },\n deps: {\n why: \"Inspects an item dependency graph as a tree or graph payload to understand blockers and hierarchy links.\",\n examples: [\n \"pm deps pm-a1b2\",\n \"pm deps pm-a1b2 --format graph\",\n \"pm deps pm-a1b2 --max-depth 2 --collapse repeated --summary\",\n ],\n tips: [\"Use --summary for lightweight counts when full graph payloads are unnecessary.\"],\n },\n list: {\n why: \"Lists active items with deterministic filtering and ordering.\",\n examples: [\n \"pm list --limit 20\",\n \"pm list --type Task --priority 0 --tag release --assignee codex-agent\",\n \"pm list --compact --sort deadline --order asc\",\n \"pm list --fields id,title,parent,type --sort parent --order asc\",\n ],\n },\n \"list-all\": {\n why: \"Lists all item states (including terminal states) when you need full visibility.\",\n examples: [\"pm list-all --limit 50\", \"pm list-all --type Issue --include-body\"],\n },\n \"list-open\": {\n why: \"Shows work that is ready to claim and start.\",\n examples: [\"pm list-open --priority 0 --limit 10\"],\n },\n \"list-in-progress\": {\n why: \"Tracks active execution and owner progress.\",\n examples: [\"pm list-in-progress --assignee codex-agent --limit 20\"],\n },\n \"list-blocked\": {\n why: \"Surfaces blocked work that needs intervention.\",\n examples: [\"pm list-blocked --limit 20\"],\n },\n \"list-closed\": {\n why: \"Reviews completed work and closure outcomes.\",\n examples: [\"pm list-closed --limit 20 --type Task\"],\n },\n \"list-canceled\": {\n why: \"Audits intentionally discontinued work.\",\n examples: [\"pm list-canceled --limit 20\"],\n },\n \"list-draft\": {\n why: \"Finds incompletely defined items that need refinement before execution.\",\n examples: [\"pm list-draft --limit 20\"],\n },\n aggregate: {\n why: \"Runs grouped aggregation queries for governance checks such as decomposition by parent/type or triage by status/priority.\",\n examples: [\n \"pm aggregate --group-by parent,type --count\",\n \"pm aggregate --group-by type,status --count\",\n \"pm aggregate --group-by parent,type --count --status open --parent pm-feature01\",\n ],\n tips: [\"Current aggregate mode is grouped counts only, so pass --count explicitly.\"],\n },\n \"dedupe-audit\": {\n why: \"Audits potential duplicate items and emits deterministic merge suggestions before any mutation.\",\n examples: [\n \"pm dedupe-audit --mode title_exact\",\n \"pm dedupe-audit --mode title_fuzzy --threshold 0.8 --limit 20\",\n \"pm dedupe-audit --mode parent_scope --status open\",\n ],\n tips: [\"Use title_exact for strict collisions, title_fuzzy for near-duplicates, and parent_scope for child-level collisions.\"],\n },\n guide: {\n why: \"Routes local progressive-disclosure documentation so agents can fetch only the context they need.\",\n examples: [\n \"pm install guide-shell --project\",\n \"pm guide\",\n \"pm guide quickstart\",\n \"pm guide commands --depth standard\",\n \"pm guide skills --depth deep --format markdown\",\n \"pm guide release --json\",\n ],\n tips: [\n \"Use brief depth for minimal token footprint, standard for excerpted docs, and deep for full local document rendering.\",\n \"Use --list to force topic index output even when topic parsing is ambiguous.\",\n ],\n },\n calendar: {\n why: \"Provides deadline/reminder/event scheduling views for planning and coordination.\",\n examples: [\n \"pm calendar\",\n \"pm calendar --view agenda --from +0d --to +7d --assignee codex-agent\",\n \"pm calendar --view week --date 2026-04-06 --full-period --include deadlines,events\",\n \"pm calendar --view month --tag release --format json\",\n ],\n tips: [\n \"Day/week/month views are anchored period windows; default mode clips the start to now unless --past or --full-period is set.\",\n \"--full-period applies only to day/week/month views; use --from/--to to bound agenda windows.\",\n ],\n },\n context: {\n why: \"Builds an agent-optimized snapshot of critical active work plus near-term agenda context with progressive depth levels.\",\n examples: [\n \"pm context\",\n \"pm ctx --depth standard --limit 10\",\n \"pm ctx --depth deep --assignee codex-agent\",\n \"pm ctx --section hierarchy --section progress --section blockers\",\n \"pm context --depth standard --activity-limit 20 --stale-threshold 14d\",\n \"pm context --from +0d --to +7d --format markdown --depth deep\",\n ],\n tips: [\n \"High-level focus contains Epics/Features and low-level focus contains Tasks/Issues/Chores/Decisions/Event/Reminder/Milestone/Meeting/Plan.\",\n \"When no open or in-progress work exists, blocked items are shown as fallback context.\",\n \"--depth brief (default) shows focus+agenda; standard adds hierarchy/activity/progress/workload; deep adds blockers/files/staleness/tests.\",\n \"--section overrides --depth and selects specific sections: hierarchy, activity, progress, blockers, files, workload, staleness, tests.\",\n \"Configure defaults via pm config project set context --default-depth standard --activity-limit 15.\",\n ],\n },\n search: {\n why: \"Finds relevant items by keyword, semantic, or hybrid retrieval modes.\",\n examples: [\n 'pm search \"lock stale retry\" --mode keyword --limit 10',\n 'pm search \"extension migration blockers\" --mode hybrid --type Task --priority 0',\n 'pm search \"Cross-Epic Realism Dependency Council\" --mode keyword --title-exact',\n ],\n tips: [\n \"Use --title-exact to require exact normalized title parity, or --phrase-exact to require full-phrase matches in item text fields.\",\n \"Use --include-linked when linked docs/files/tests should influence scoring.\",\n ],\n },\n reindex: {\n why: \"Rebuilds search artifacts after large changes to item corpus or provider/vector config.\",\n examples: [\"pm reindex --mode keyword\", \"pm reindex --mode hybrid --progress --json\"],\n tips: [\n \"Use --progress for non-interactive visibility during local embedding runs.\",\n \"JSON output includes semantic stale/unchanged/embed/upsert counts so agents can gate long reindex work without parsing stderr.\",\n ],\n },\n get: {\n why: \"Shows details for one item by ID, with optional lower-token projections for agent loops.\",\n examples: [\n \"pm get pm-a1b2\",\n \"pm get pm-a1b2 --depth brief --json\",\n \"pm get pm-a1b2 --fields id,title,status,parent,type --json\",\n ],\n tips: [\n \"Default depth is deep for backward compatibility; use brief for metadata-only checks and standard for body plus linked artifacts without append-only logs.\",\n \"Use --fields for the smallest deterministic item metadata payload when an agent only needs specific fields.\",\n \"JSON output shape is { item, body, linked, claim_state }; body is top-level (not item.body).\",\n ],\n },\n history: {\n why: \"Inspects item mutation timeline and audit trail.\",\n examples: [\"pm history pm-a1b2 --limit 20\"],\n },\n activity: {\n why: \"Reviews recent tracker-wide activity across items.\",\n examples: [\n \"pm activity --limit 50\",\n \"pm activity --id pm-a1b2 --op update --author codex-agent --from -7d --to now\",\n \"pm activity --json --stream rows --limit 200\",\n ],\n tips: [\"Use --stream with --json for line-delimited automation output; --from is inclusive and --to is exclusive.\"],\n },\n restore: {\n why: \"Restores an item to a prior timestamp/version with history replay safety.\",\n examples: ['pm restore pm-a1b2 2026-04-01T00:00:00.000Z --author \"codex-agent\" --message \"Rollback to known-good state\"'],\n },\n close: {\n why: \"Transitions work to terminal closed state with explicit rationale.\",\n examples: [\n 'pm close pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close after verification\"',\n 'pm close pm-a1b2 \"Done\" --validate-close',\n 'pm close pm-a1b2 \"Done\" --validate-close off',\n 'pm close pm-a1b2 \"Done\" --validate-close strict',\n ],\n },\n delete: {\n why: \"Removes an item while preserving history evidence and lock/ownership checks.\",\n examples: ['pm delete pm-a1b2 --author \"codex-agent\" --message \"Remove duplicate item\"'],\n },\n append: {\n why: \"Adds implementation notes to body without replacing existing content.\",\n examples: ['pm append pm-a1b2 --body \"Implemented retry with bounded backoff.\" --message \"Record implementation detail\"'],\n },\n comments: {\n why: \"Adds or reviews lightweight status updates linked to an item.\",\n examples: [\n 'pm comments pm-a1b2 \"Verified fix on Linux and macOS\"',\n 'pm comments pm-a1b2 --add \"Verified fix on Linux and macOS\"',\n 'printf \"%s\\\\n\" \"## Verification\" \"- linux pass\" \"- mac pass\" | pm comments pm-a1b2 --stdin',\n 'pm comments pm-a1b2 --file docs/release-evidence.md --author \"codex-agent\"',\n 'pm comments pm-a1b2 --add \"text: verification note with commas, key-like words, and parser details\"',\n 'pm comments pm-a1b2 --add \"Follow-up needed after review\" --author \"codex-agent\" --force',\n \"pm comments pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use exactly one comment source at a time: positional [text], --add, --stdin, or --file.\",\n \"Use --force when adding comments to items currently assigned to a different owner.\",\n \"When --add payload resembles CSV-like key fragments (for example text=hello,scope:project), plain-text fallback is intentional; use explicit text=..., markdown text: ..., or stdin token - for structured intent.\",\n ],\n },\n \"comments-audit\": {\n why: \"Audits latest comments or full history rows across filtered item sets.\",\n examples: [\n \"pm comments-audit --status open --latest 1\",\n \"pm comments-audit --status open --latest 0\",\n \"pm comments-audit --parent pm-feature01 --tag governance --sprint sprint-12 --release vnext --priority 0\",\n \"pm comments-audit --full-history --limit 50\",\n ],\n tips: [\n \"Use either --latest or --full-history (not both). --latest 0 returns item summaries without comment rows. --limit is an alias for --limit-items.\",\n ],\n },\n notes: {\n why: \"Adds or reviews durable implementation notes linked to an item.\",\n examples: [\n 'pm notes pm-a1b2 --add \"Investigated parser edge case and documented fallback logic.\"',\n 'pm notes pm-a1b2 --add \"text: parser rationale with commas, colons, and key-like wording\"',\n 'pm notes pm-a1b2 --add \"Audit note\" --author \"reviewer\" --allow-audit-note',\n \"pm notes pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-note for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"CSV-like add payloads with extra key fragments are treated as plain text by design; use explicit text keys (text= or text:) when structured parsing is required.\",\n ],\n },\n learnings: {\n why: \"Adds or reviews post-implementation learnings for future work.\",\n examples: [\n 'pm learnings pm-a1b2 --add \"Avoid direct test-runner commands in linked tests; use sandbox runner.\"',\n 'pm learnings pm-a1b2 --add \"text: lesson with commas, key-like words, and punctuation-safe context\"',\n 'pm learnings pm-a1b2 --add \"Audit learning\" --author \"reviewer\" --allow-audit-learning',\n \"pm learnings pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-learning for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"If you intended structured parsing for a key-like payload, prefer explicit text=..., markdown text: ..., or stdin token -; ambiguous CSV-like forms intentionally remain plain text.\",\n ],\n },\n files: {\n why: \"Associates changed source files with tracker items for reproducibility.\",\n examples: [\n 'pm files pm-a1b2 --add \"path=src/cli/main.ts,note=help orchestration\"',\n \"pm files discover pm-a1b2\",\n 'pm files discover pm-a1b2 --apply --note \"discovered from item text\"',\n ],\n },\n docs: {\n why: \"Associates relevant documentation paths with tracker items.\",\n examples: ['pm docs pm-a1b2 --add \"path=README.md,note=user-facing command guidance\"'],\n },\n test: {\n why: \"Links test commands/paths and optionally executes them for one item.\",\n examples: [\n 'pm test pm-a1b2 --add \"command=node scripts/run-tests.mjs test -- tests/unit/output.spec.ts,timeout_seconds=2400\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,assert_stdout_contains=count:,assert_stdout_regex=count:\\\\s+\\\\d+\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,pm_context_mode=auto\"',\n \"pm test pm-a1b2 --run --timeout 2400 --env-set PORT=0 --env-clear PLAYWRIGHT_BASE_URL --shared-host-safe --pm-context tracker --fail-on-context-mismatch --fail-on-skipped\",\n \"pm test pm-a1b2 --run --timeout 2400 --pm-context auto\",\n \"pm test pm-a1b2 --run --background --timeout 2400 --progress\",\n ],\n },\n \"test-all\": {\n why: \"Runs linked tests in bulk for release/readiness sweeps.\",\n examples: [\n \"pm test-all --status in_progress --limit 5 --offset 10 --timeout 2400\",\n \"pm test-all --status closed --timeout 3600 --progress --env-set PORT=0 --shared-host-safe --fail-on-skipped\",\n \"pm test-all --status in_progress --pm-context tracker --fail-on-context-mismatch --require-assertions-for-pm\",\n \"pm test-all --status in_progress --pm-context auto --fail-on-context-mismatch\",\n \"pm test-all --status in_progress --background --timeout 3600\",\n ],\n },\n \"test-runs\": {\n why: \"Manages background linked-test runs with lifecycle controls and log/status inspection.\",\n examples: [\n \"pm test-runs list --status running --limit 20\",\n \"pm test-runs status tr-abc123\",\n \"pm test-runs logs tr-abc123 --stream stderr --tail 200\",\n \"pm test-runs stop tr-abc123\",\n \"pm test-runs resume tr-abc123\",\n ],\n },\n stats: {\n why: \"Reports tracker-level totals and distribution by type/status.\",\n examples: [\"pm stats\", \"pm stats --json\"],\n },\n health: {\n why: \"Validates tracker/runtime health including extension triage, migration, and integrity diagnostics.\",\n examples: [\"pm health\", \"pm health --json\", \"pm health --check-only\", \"pm health --no-refresh\", \"pm health --refresh-vectors\"],\n },\n validate: {\n why:\n \"Runs standalone metadata, resolution, lifecycle (including dependency-cycle diagnostics), linked-file, linked-command reference, and history drift checks with default remediation hints for resolution gaps.\",\n examples: [\n \"pm validate\",\n \"pm validate --check-resolution --json\",\n \"pm validate --check-lifecycle --dependency-cycle-severity error\",\n \"pm validate --check-files --scan-mode tracked-all\",\n \"pm validate --check-files --scan-mode tracked-all-strict --include-pm-internals\",\n \"pm validate --check-command-references\",\n \"pm validate --check-resolution --fail-on-warn --json\",\n ],\n tips: [\"Resolution-gap warnings include default `pm update <id> ...` remediation hint templates in check details.\"],\n },\n gc: {\n why: \"Cleans optional cache artifacts to keep local tracker state tidy.\",\n examples: [\"pm gc\"],\n },\n claim: {\n why: \"Claims an item to signal active ownership and reduce conflicts.\",\n examples: [\n 'pm claim pm-a1b2 --author \"codex-agent\" --message \"Claim for implementation\"',\n 'pm claim pm-a1b2 --force --author \"codex-agent\" --message \"Take over terminal item\"',\n ],\n tips: [\"Claim takeover for non-terminal items does not require --force; --force is reserved for terminal/lock overrides.\"],\n },\n release: {\n why: \"Releases an active claim when paused, handed off, or completed.\",\n examples: [\n 'pm release pm-a1b2 --author \"codex-agent\" --message \"Release after closure\"',\n 'pm release pm-a1b2 --allow-audit-release --author \"reviewer\" --message \"Audit handoff release\"',\n ],\n tips: [\"Use --allow-audit-release for non-owner handoffs that only clear assignee metadata.\"],\n },\n \"start-task\": {\n why: \"Lifecycle alias that claims an item and sets status to in_progress.\",\n examples: ['pm start-task pm-a1b2 --author \"codex-agent\" --message \"Start implementation\"'],\n },\n \"pause-task\": {\n why: \"Lifecycle alias that sets status to open and releases active assignment.\",\n examples: ['pm pause-task pm-a1b2 --author \"codex-agent\" --message \"Pause for dependency unblock\"'],\n },\n \"close-task\": {\n why: \"Lifecycle alias that closes with reason text and clears assignment metadata.\",\n examples: ['pm close-task pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close and handoff\"'],\n },\n completion: {\n why: \"Generates shell completion scripts for faster and more reliable command entry.\",\n examples: [\"pm completion bash\", \"pm completion zsh\", \"pm completion fish\", \"pm completion bash --eager-tags\"],\n tips: [\"Default scripts resolve tag suggestions lazily at completion time; use --eager-tags to embed current tags directly.\"],\n },\n contracts: {\n why: \"Exposes machine-readable CLI command and tool schema contracts for agent integrations.\",\n examples: [\n \"pm contracts\",\n \"pm contracts --command list --runtime-only\",\n \"pm contracts --command update --flags-only\",\n \"pm contracts --availability-only --runtime-only\",\n \"pm contracts --action create\",\n \"pm contracts --schema-only\",\n ],\n tips: [\"Use --command to narrow actions/schema to one CLI surface; combine with --flags-only or --availability-only for lighter payloads.\"],\n },\n};\n\nexport const ROOT_HELP_BUNDLE: HelpBundle = {\n why: \"Provides deterministic project management workflows for humans and coding agents.\",\n examples: [\n \"pm init\",\n \"pm install guide-shell --project\",\n \"pm list-open --limit 10\",\n 'pm create --title \"...\" --description \"...\" --type Task --status open --priority 1 --message \"...\" --create-mode progressive',\n ],\n tips: [\n \"Use <command> --help for command-specific guidance and examples.\",\n \"Install guide-shell before using pm guide for local docs and skills routing.\",\n \"Use --json for machine parsing and integration flows.\",\n \"Use --no-pager to force direct help output in CI and other non-interactive shells.\",\n ],\n};\n\nfunction resolveCanonicalHelpPath(commandPath: string | undefined): string {\n const normalized = normalizeHelpCommandPath(commandPath ?? \"\");\n if (!normalized) {\n return \"\";\n }\n return HELP_PATH_ALIASES[normalized] ?? normalized;\n}\n\nexport function resolveHelpBundleForPath(commandPath: string | undefined): HelpBundle {\n const canonicalPath = resolveCanonicalHelpPath(commandPath);\n if (!canonicalPath) {\n return ROOT_HELP_BUNDLE;\n }\n return HELP_BY_COMMAND_PATH[canonicalPath] ?? ROOT_HELP_BUNDLE;\n}\n\nexport function resolveHelpNarrative(commandPath: string | undefined, detailMode: HelpDetailMode): HelpNarrative {\n const bundle = resolveHelpBundleForPath(commandPath);\n return {\n intent: bundle.why,\n examples: detailMode === \"detailed\" ? [...bundle.examples] : bundle.examples.length > 0 ? [bundle.examples[0]] : [],\n tips: detailMode === \"detailed\" ? [...(bundle.tips ?? [])] : [],\n detail_mode: detailMode,\n };\n}\n\nexport function listDocumentedHelpPaths(): string[] {\n return Object.keys(HELP_BY_COMMAND_PATH).sort((left, right) => left.localeCompare(right));\n}\n\nexport function attachRichHelpText(program: Command, argv: string[] = process.argv.slice(2)): void {\n const detailMode = resolveHelpDetailMode(argv);\n program.addHelpText(\"after\", renderHelpBundle(ROOT_HELP_BUNDLE, detailMode));\n for (const [commandPath, bundle] of Object.entries(HELP_BY_COMMAND_PATH)) {\n attachBundleByPath(program, commandPath, bundle, detailMode);\n }\n}\n"],"names":[],"mappings":";;AAiBA,SAAS,uBAAuB,CAAC,MAAkB;IACjD,MAAM,KAAK,GAAa;QACtB,EAAE;QACF,SAAS;QACT,KAAK,MAAM,CA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AAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,OAAO,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAgB,EAAE,OAAiB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACzF,MAAM,UAAU,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC7E,KAAK,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;QACzE,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC","debugId":"4db9e67d-db76-5a1c-8647-1d30849ef208"}
|
|
1
|
+
{"version":3,"file":"help-content.js","sources":["cli/help-content.ts"],"sourceRoot":"/","sourcesContent":["import { Command } from \"commander\";\n\nexport interface HelpBundle {\n why: string;\n examples: string[];\n tips?: string[];\n}\n\nexport interface HelpNarrative {\n intent: string;\n examples: string[];\n tips: string[];\n detail_mode: HelpDetailMode;\n}\n\nexport type HelpDetailMode = \"compact\" | \"detailed\";\n\nfunction renderCompactHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Intent:\",\n ` ${bundle.why}`,\n ];\n if (bundle.examples.length > 0) {\n lines.push(\"\", \"Example:\");\n lines.push(` ${bundle.examples[0]}`);\n }\n lines.push(\"\", \"Need deeper rationale and more examples?\");\n lines.push(\" Re-run with --explain.\");\n return lines.join(\"\\n\");\n}\n\nfunction renderDetailedHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Why use this command:\",\n ` ${bundle.why}`,\n \"\",\n \"Examples:\",\n ...bundle.examples.map((example) => ` ${example}`),\n ];\n if (bundle.tips && bundle.tips.length > 0) {\n lines.push(\"\", \"Tips:\");\n lines.push(...bundle.tips.map((tip) => ` - ${tip}`));\n }\n return lines.join(\"\\n\");\n}\n\nfunction renderHelpBundle(bundle: HelpBundle, detailMode: HelpDetailMode): string {\n if (detailMode === \"detailed\") {\n return renderDetailedHelpBundle(bundle);\n }\n return renderCompactHelpBundle(bundle);\n}\n\nexport function normalizeHelpCommandPath(commandPath: string): string {\n return commandPath\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nconst HELP_PATH_ALIASES: Record<string, string> = {\n cal: \"calendar\",\n ctx: \"context\",\n};\n\nfunction findDirectChildCommand(parent: Command, name: string): Command | null {\n return parent.commands.find((entry) => entry.name() === name) ?? null;\n}\n\nfunction findCommandByPath(root: Command, pathParts: string[]): Command | null {\n let current: Command = root;\n for (const part of pathParts) {\n const next = findDirectChildCommand(current, part);\n if (!next) {\n return null;\n }\n current = next;\n }\n return current;\n}\n\nfunction attachBundleByPath(root: Command, commandPath: string, bundle: HelpBundle, detailMode: HelpDetailMode): void {\n const command = findCommandByPath(root, commandPath.split(\" \").filter((part) => part.length > 0));\n if (!command) {\n return;\n }\n command.addHelpText(\"after\", renderHelpBundle(bundle, detailMode));\n}\n\nexport function resolveHelpDetailMode(argv: string[]): HelpDetailMode {\n if (argv.includes(\"--explain\")) {\n return \"detailed\";\n }\n return \"compact\";\n}\n\nconst HELP_BY_COMMAND_PATH: Record<string, HelpBundle> = {\n init: {\n why: \"Bootstraps tracker storage and settings so all other commands can run safely.\",\n examples: [\n \"pm init\",\n \"pm init acme\",\n \"pm init --preset minimal\",\n \"pm init --agent-guidance add\",\n \"pm init --defaults --with-packages\",\n ],\n tips: [\n \"Run this once per repository before create/list/update commands.\",\n \"Use --preset for non-interactive automation; omit it in a TTY to use the setup wizard.\",\n \"Use --agent-guidance add to inject compact AGENTS/CLAUDE workflow guidance, or --agent-guidance status to inspect missing guidance without modifying files.\",\n \"Use --with-packages when agents need bundled commands such as calendar and templates available immediately.\",\n ],\n },\n config: {\n why: \"Reads or updates project/global settings such as definition-of-done, item format, telemetry, and policy toggles.\",\n examples: [\n 'pm config project get definition-of-done',\n 'pm config project set definition-of-done --criterion \"tests pass\"',\n \"pm config project set item-format --format toon\",\n \"pm config project set sprint-release-format-policy --policy strict_error\",\n \"pm config project set governance-preset --policy minimal\",\n \"pm config project set governance-ownership-enforcement --policy none\",\n \"pm config project set test-result-tracking --policy enabled\",\n \"pm config global set telemetry-tracking --policy disabled\",\n ],\n },\n extension: {\n why:\n \"Compatibility command for package-backed runtime extension lifecycle operations across project or global scope.\",\n examples: [\n \"pm install ./my-package --project\",\n \"pm install '*' --project\",\n \"pm package doctor --project --detail summary\",\n \"pm package manage --global\",\n \"pm package activate sample-ext --project\",\n \"pm package deactivate sample-ext --project\",\n \"pm package uninstall sample-ext --global\",\n \"pm extension explore --project\",\n \"pm extension manage --global\",\n \"pm extension doctor --detail deep\",\n ],\n tips: [\n \"Prefer pm install and pm package in new user-facing automation.\",\n \"Use pm extension when maintaining existing extension-specific scripts or debugging the compatibility runtime directly.\",\n \"Bundled aliases beads and todos resolve to package-shipped extension sources.\",\n \"Use --gh/--github shorthand for GitHub sources and --ref to pin a branch, tag, or ref.\",\n \"Install updates settings activation state automatically unless extension allowlist mode is unchanged.\",\n \"Use --adopt for single-extension adoption and --adopt-all to bulk-register unmanaged installs as managed without reinstalling.\",\n \"Use --manage for concise triage summaries and remediation-oriented diagnostics alongside full extension details.\",\n \"Use --doctor for consolidated diagnostics with warning codes, remediation hints, and optional deep detail payloads.\",\n ],\n },\n package: {\n why:\n \"Installs, explores, manages, diagnoses, adopts, activates, deactivates, and refreshes package-backed pm runtime extensions.\",\n examples: [\n \"pm install npm:@scope/pm-package --project\",\n \"pm package install ./my-package --project\",\n \"pm package doctor --project --detail deep\",\n \"pm package manage --project --runtime-probe\",\n \"pm package activate sample-ext --project\",\n \"pm upgrade --packages-only --dry-run\",\n ],\n tips: [\n \"Prefer package vocabulary for user-facing workflows; extension vocabulary remains available for compatibility.\",\n \"Use pm upgrade to refresh the CLI/SDK and managed packages from their recorded sources.\",\n \"Use --dry-run before upgrade when automation needs a deterministic plan.\",\n ],\n },\n install: {\n why: \"Installs a pm package into project scope by default, using local, npm, GitHub, or bundled alias sources.\",\n examples: [\n \"pm install '*' --project\",\n \"pm install ./packages/pm-todos --project\",\n \"pm install npm:@scope/pm-package --global\",\n \"pm install --github org/repo/packages/my-pm-package --ref main\",\n ],\n tips: [\"Installed packages are recorded in managed state and can be inspected with pm package manage.\"],\n },\n upgrade: {\n why: \"Updates the global pm CLI/SDK and refreshes managed pm packages from recorded install sources.\",\n examples: [\n \"pm upgrade --dry-run\",\n \"pm upgrade --packages-only --project\",\n \"pm upgrade todos --dry-run\",\n \"pm upgrade --cli-only --repair\",\n \"pm upgrade --tag next --dry-run\",\n ],\n tips: [\n \"Omit target to include the CLI/SDK plus all managed packages in the selected scope.\",\n \"Pass a target to refresh one managed package by name, directory, package name, or source.\",\n \"Use --packages-only in repository automation when the global CLI should not be changed.\",\n ],\n },\n create: {\n why: \"Creates a new planning item with deterministic metadata and history.\",\n examples: [\n 'pm create --title \"Harden lock flow\" --description \"Improve stale lock handling\" --type Task --status open --priority 1 --message \"Create lock hardening task\" --create-mode progressive',\n 'pm create --title \"Weekly planning sync\" --description \"Recurring coordination meeting\" --type Meeting --schedule-preset lightweight',\n 'pm create --title \"Asset: Hero model\" --description \"Track playable model asset\" --type Asset --status open --priority 1 --message \"Create asset item\" --type-option category=Character --dep \"id=pm-epic01,kind=parent,author=codex-agent,created_at=now\" --comment \"author=codex-agent,created_at=now,text=Why this asset item exists.\" --note \"author=codex-agent,created_at=now,text=Initial implementation note.\" --learning \"author=codex-agent,created_at=now,text=Durable lesson placeholder.\" --file \"path=src/assets/hero.glb,note=tracked asset\" --test \"command=node scripts/run-tests.mjs test,timeout_seconds=240\" --doc \"path=README.md,note=asset docs\"',\n ],\n tips: [\n \"Use --schedule-preset lightweight for Reminder/Meeting/Event when you want minimal required create inputs.\",\n \"Use --type <value> to load type-aware policy guidance in --help output.\",\n ],\n },\n update: {\n why: \"Mutates existing item fields while preserving history and lock safety.\",\n examples: [\n 'pm update pm-a1b2 --status in_progress --message \"Start implementation\"',\n 'pm update pm-a1b2 --unset close-reason --message \"Clear stale close reason after reopen\"',\n 'pm update pm-a1b2 --unset assignee --deadline +2d --message \"Replan ownership and deadline\"',\n 'pm update pm-a1b2 --body \"Backfilled body text for legacy item\" --message \"Normalize missing body\"',\n ],\n tips: [\n 'Use \"pm close <ID> <TEXT>\" to close items instead of --status closed.',\n \"When reopening from closed to a non-terminal status, update clears stale close_reason unless explicitly set via --close-reason.\",\n 'Use \"pm append <ID> --body <text>\" for additive notes; use update --body to replace body content.',\n ],\n },\n \"update-many\": {\n why: \"Bulk-updates matched item sets with dry-run previews and rollback checkpoints for safe large-scale metadata changes.\",\n examples: [\n \"pm update-many --filter-status open --status in_progress --dry-run\",\n 'pm update-many --filter-tag wave:7 --replace-tests --test \"command=node scripts/run-tests.mjs test -- tests/core/history.spec.ts,timeout_seconds=240\"',\n 'pm update-many --filter-tag governance --reviewer maintainer-review --message \"Normalize reviewer metadata\"',\n \"pm update-many --rollback ckpt-abc123\",\n ],\n tips: [\n \"Use --dry-run first to inspect proposed changes before apply mode.\",\n \"Linked-array mutation flags mirror pm update semantics (for example --replace-tests, --clear-files, and repeatable --doc/--note seeds).\",\n \"Checkpoints are enabled by default for apply mode and can be restored with --rollback.\",\n ],\n },\n normalize: {\n why:\n \"Scans items for low-signal lifecycle metadata drift, emits deterministic per-item plans, and optionally applies normalized metadata updates with update-style safety checks.\",\n examples: [\n \"pm normalize --dry-run\",\n \"pm normalize --filter-status in_progress --dry-run\",\n 'pm normalize --filter-status closed --apply --author \"codex-agent\" --message \"Normalize closure metadata\"',\n ],\n tips: [\n \"Dry-run mode is the default; pass --apply only after reviewing planned changes.\",\n \"Apply mode honors ownership/audit constraints and supports --allow-audit-update with optional --force override.\",\n ],\n },\n templates: {\n why: \"Saves, lists, and inspects reusable create option bundles for repeatable workflows.\",\n examples: [\n 'pm templates save triage-default --title \"Triage item\" --description \"...\" --type Task --status open --priority 2 --message \"Seed triage template\"',\n \"pm templates list\",\n \"pm templates show triage-default\",\n ],\n tips: [\n \"Template names are positional arguments (`pm templates save <name>` and `pm templates show <name>`), not --name flags.\",\n \"Combine templates with explicit create flags; explicit flags always override template defaults.\",\n ],\n },\n deps: {\n why: \"Inspects an item dependency graph as a tree or graph payload to understand blockers and hierarchy links.\",\n examples: [\n \"pm deps pm-a1b2\",\n \"pm deps pm-a1b2 --format graph\",\n \"pm deps pm-a1b2 --max-depth 2 --collapse repeated --summary\",\n ],\n tips: [\"Use --summary for lightweight counts when full graph payloads are unnecessary.\"],\n },\n list: {\n why: \"Lists active items with deterministic filtering and ordering.\",\n examples: [\n \"pm list --limit 20\",\n \"pm list --type Task --priority 0 --tag release --assignee codex-agent\",\n \"pm list --compact --sort deadline --order asc\",\n \"pm list --fields id,title,parent,type --sort parent --order asc\",\n ],\n },\n \"list-all\": {\n why: \"Lists all item states (including terminal states) when you need full visibility.\",\n examples: [\"pm list-all --limit 50\", \"pm list-all --type Issue --include-body\"],\n },\n \"list-open\": {\n why: \"Shows work that is ready to claim and start.\",\n examples: [\"pm list-open --priority 0 --limit 10\"],\n },\n \"list-in-progress\": {\n why: \"Tracks active execution and owner progress.\",\n examples: [\"pm list-in-progress --assignee codex-agent --limit 20\"],\n },\n \"list-blocked\": {\n why: \"Surfaces blocked work that needs intervention.\",\n examples: [\"pm list-blocked --limit 20\"],\n },\n \"list-closed\": {\n why: \"Reviews completed work and closure outcomes.\",\n examples: [\"pm list-closed --limit 20 --type Task\"],\n },\n \"list-canceled\": {\n why: \"Audits intentionally discontinued work.\",\n examples: [\"pm list-canceled --limit 20\"],\n },\n \"list-draft\": {\n why: \"Finds incompletely defined items that need refinement before execution.\",\n examples: [\"pm list-draft --limit 20\"],\n },\n aggregate: {\n why: \"Runs grouped aggregation queries for governance checks such as decomposition by parent/type or triage by status/priority.\",\n examples: [\n \"pm aggregate --group-by parent,type --count\",\n \"pm aggregate --group-by type,status --count\",\n \"pm aggregate --group-by parent,type --count --status open --parent pm-feature01\",\n ],\n tips: [\"Current aggregate mode is grouped counts only, so pass --count explicitly.\"],\n },\n \"dedupe-audit\": {\n why: \"Audits potential duplicate items and emits deterministic merge suggestions before any mutation.\",\n examples: [\n \"pm dedupe-audit --mode title_exact\",\n \"pm dedupe-audit --mode title_fuzzy --threshold 0.8 --limit 20\",\n \"pm dedupe-audit --mode parent_scope --status open\",\n ],\n tips: [\"Use title_exact for strict collisions, title_fuzzy for near-duplicates, and parent_scope for child-level collisions.\"],\n },\n guide: {\n why: \"Routes local progressive-disclosure documentation so agents can fetch only the context they need.\",\n examples: [\n \"pm install guide-shell --project\",\n \"pm guide\",\n \"pm guide quickstart\",\n \"pm guide commands --depth standard\",\n \"pm guide skills --depth deep --format markdown\",\n \"pm guide release --json\",\n ],\n tips: [\n \"Use brief depth for minimal token footprint, standard for excerpted docs, and deep for full local document rendering.\",\n \"Use --list to force topic index output even when topic parsing is ambiguous.\",\n ],\n },\n calendar: {\n why: \"Provides deadline/reminder/event scheduling views for planning and coordination.\",\n examples: [\n \"pm calendar\",\n \"pm calendar --view agenda --from +0d --to +7d --assignee codex-agent\",\n \"pm calendar --view week --date 2026-04-06 --full-period --include deadlines,events\",\n \"pm calendar --view month --tag release --format json\",\n ],\n tips: [\n \"Day/week/month views are anchored period windows; default mode clips the start to now unless --past or --full-period is set.\",\n \"--full-period applies only to day/week/month views; use --from/--to to bound agenda windows.\",\n ],\n },\n context: {\n why: \"Builds an agent-optimized snapshot of critical active work plus near-term agenda context with progressive depth levels.\",\n examples: [\n \"pm context\",\n \"pm ctx --depth standard --limit 10\",\n \"pm ctx --depth deep --assignee codex-agent\",\n \"pm ctx --section hierarchy --section progress --section blockers\",\n \"pm context --depth standard --activity-limit 20 --stale-threshold 14d\",\n \"pm context --from +0d --to +7d --format markdown --depth deep\",\n ],\n tips: [\n \"High-level focus contains Epics/Features and low-level focus contains Tasks/Issues/Chores/Decisions/Event/Reminder/Milestone/Meeting/Plan.\",\n \"When no open or in-progress work exists, blocked items are shown as fallback context.\",\n \"--depth brief (default) shows focus+agenda; standard adds hierarchy/activity/progress/workload; deep adds blockers/files/staleness/tests.\",\n \"--section overrides --depth and selects specific sections: hierarchy, activity, progress, blockers, files, workload, staleness, tests.\",\n \"Configure defaults via pm config project set context --default-depth standard --activity-limit 15.\",\n ],\n },\n search: {\n why: \"Finds relevant items by keyword, semantic, or hybrid retrieval modes.\",\n examples: [\n 'pm search \"lock stale retry\" --mode keyword --limit 10',\n 'pm search \"extension migration blockers\" --mode hybrid --type Task --priority 0',\n 'pm search \"Cross-Epic Realism Dependency Council\" --mode keyword --title-exact',\n ],\n tips: [\n \"Use --title-exact to require exact normalized title parity, or --phrase-exact to require full-phrase matches in item text fields.\",\n \"Use --include-linked when linked docs/files/tests should influence scoring.\",\n ],\n },\n reindex: {\n why: \"Rebuilds search artifacts after large changes to item corpus or provider/vector config.\",\n examples: [\"pm reindex --mode keyword\", \"pm reindex --mode hybrid --progress --json\"],\n tips: [\n \"Use --progress for non-interactive visibility during local embedding runs.\",\n \"JSON output includes semantic stale/unchanged/embed/upsert counts so agents can gate long reindex work without parsing stderr.\",\n ],\n },\n get: {\n why: \"Shows details for one item by ID, with optional lower-token projections for agent loops.\",\n examples: [\n \"pm get pm-a1b2\",\n \"pm get pm-a1b2 --depth brief --json\",\n \"pm get pm-a1b2 --fields id,title,status,parent,type --json\",\n ],\n tips: [\n \"Default depth is deep for backward compatibility; use brief for metadata-only checks and standard for body plus linked artifacts without append-only logs.\",\n \"Use --fields for the smallest deterministic item metadata payload when an agent only needs specific fields.\",\n \"JSON output shape is { item, body, linked, claim_state }; body is top-level (not item.body).\",\n ],\n },\n history: {\n why: \"Inspects item mutation timeline and audit trail.\",\n examples: [\"pm history pm-a1b2 --limit 20\", \"pm history pm-a1b2 --full --verify\"],\n },\n activity: {\n why: \"Reviews recent tracker-wide activity across items.\",\n examples: [\n \"pm activity --limit 50\",\n \"pm activity --full --id pm-a1b2 --limit 50\",\n \"pm activity --id pm-a1b2 --op update --author codex-agent --from -7d --to now\",\n \"pm activity --json --stream rows --limit 200\",\n ],\n tips: [\"Use --stream with --json for line-delimited automation output; --from is inclusive and --to is exclusive.\"],\n },\n restore: {\n why: \"Restores an item to a prior timestamp/version with history replay safety.\",\n examples: ['pm restore pm-a1b2 2026-04-01T00:00:00.000Z --author \"codex-agent\" --message \"Rollback to known-good state\"'],\n },\n close: {\n why: \"Transitions work to terminal closed state with explicit rationale.\",\n examples: [\n 'pm close pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close after verification\"',\n 'pm close pm-a1b2 \"Done\" --validate-close',\n 'pm close pm-a1b2 \"Done\" --validate-close off',\n 'pm close pm-a1b2 \"Done\" --validate-close strict',\n ],\n },\n delete: {\n why: \"Removes an item while preserving history evidence and lock/ownership checks.\",\n examples: ['pm delete pm-a1b2 --author \"codex-agent\" --message \"Remove duplicate item\"'],\n },\n append: {\n why: \"Adds implementation notes to body without replacing existing content.\",\n examples: ['pm append pm-a1b2 --body \"Implemented retry with bounded backoff.\" --message \"Record implementation detail\"'],\n },\n comments: {\n why: \"Adds or reviews lightweight status updates linked to an item.\",\n examples: [\n 'pm comments pm-a1b2 \"Verified fix on Linux and macOS\"',\n 'pm comments pm-a1b2 --add \"Verified fix on Linux and macOS\"',\n 'printf \"%s\\\\n\" \"## Verification\" \"- linux pass\" \"- mac pass\" | pm comments pm-a1b2 --stdin',\n 'pm comments pm-a1b2 --file docs/release-evidence.md --author \"codex-agent\"',\n 'pm comments pm-a1b2 --add \"text: verification note with commas, key-like words, and parser details\"',\n 'pm comments pm-a1b2 --add \"Follow-up needed after review\" --author \"codex-agent\" --force',\n \"pm comments pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use exactly one comment source at a time: positional [text], --add, --stdin, or --file.\",\n \"Use --force when adding comments to items currently assigned to a different owner.\",\n \"When --add payload resembles CSV-like key fragments (for example text=hello,scope:project), plain-text fallback is intentional; use explicit text=..., markdown text: ..., or stdin token - for structured intent.\",\n ],\n },\n \"comments-audit\": {\n why: \"Audits latest comments or full history rows across filtered item sets.\",\n examples: [\n \"pm comments-audit --status open --latest 1\",\n \"pm comments-audit --status open --latest 0\",\n \"pm comments-audit --parent pm-feature01 --tag governance --sprint sprint-12 --release vnext --priority 0\",\n \"pm comments-audit --full-history --limit 50\",\n ],\n tips: [\n \"Use either --latest or --full-history (not both). --latest 0 returns item summaries without comment rows. --limit is an alias for --limit-items.\",\n ],\n },\n notes: {\n why: \"Adds or reviews durable implementation notes linked to an item.\",\n examples: [\n 'pm notes pm-a1b2 --add \"Investigated parser edge case and documented fallback logic.\"',\n 'pm notes pm-a1b2 --add \"text: parser rationale with commas, colons, and key-like wording\"',\n 'pm notes pm-a1b2 --add \"Audit note\" --author \"reviewer\" --allow-audit-note',\n \"pm notes pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-note for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"CSV-like add payloads with extra key fragments are treated as plain text by design; use explicit text keys (text= or text:) when structured parsing is required.\",\n ],\n },\n learnings: {\n why: \"Adds or reviews post-implementation learnings for future work.\",\n examples: [\n 'pm learnings pm-a1b2 --add \"Avoid direct test-runner commands in linked tests; use sandbox runner.\"',\n 'pm learnings pm-a1b2 --add \"text: lesson with commas, key-like words, and punctuation-safe context\"',\n 'pm learnings pm-a1b2 --add \"Audit learning\" --author \"reviewer\" --allow-audit-learning',\n \"pm learnings pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-learning for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"If you intended structured parsing for a key-like payload, prefer explicit text=..., markdown text: ..., or stdin token -; ambiguous CSV-like forms intentionally remain plain text.\",\n ],\n },\n files: {\n why: \"Associates changed source files with tracker items for reproducibility.\",\n examples: [\n 'pm files pm-a1b2 --add \"path=src/cli/main.ts,note=help orchestration\"',\n \"pm files discover pm-a1b2\",\n 'pm files discover pm-a1b2 --apply --note \"discovered from item text\"',\n ],\n },\n docs: {\n why: \"Associates relevant documentation paths with tracker items.\",\n examples: ['pm docs pm-a1b2 --add \"path=README.md,note=user-facing command guidance\"'],\n },\n test: {\n why: \"Links test commands/paths and optionally executes them for one item.\",\n examples: [\n 'pm test pm-a1b2 --add \"command=node scripts/run-tests.mjs test -- tests/unit/output.spec.ts,timeout_seconds=2400\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,assert_stdout_contains=count:,assert_stdout_regex=count:\\\\s+\\\\d+\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,pm_context_mode=auto\"',\n \"pm test pm-a1b2 --run --timeout 2400 --env-set PORT=0 --env-clear PLAYWRIGHT_BASE_URL --shared-host-safe --pm-context tracker --fail-on-context-mismatch --fail-on-skipped\",\n \"pm test pm-a1b2 --run --timeout 2400 --pm-context auto\",\n \"pm test pm-a1b2 --run --background --timeout 2400 --progress\",\n ],\n },\n \"test-all\": {\n why: \"Runs linked tests in bulk for release/readiness sweeps.\",\n examples: [\n \"pm test-all --status in_progress --limit 5 --offset 10 --timeout 2400\",\n \"pm test-all --status closed --timeout 3600 --progress --env-set PORT=0 --shared-host-safe --fail-on-skipped\",\n \"pm test-all --status in_progress --pm-context tracker --fail-on-context-mismatch --require-assertions-for-pm\",\n \"pm test-all --status in_progress --pm-context auto --fail-on-context-mismatch\",\n \"pm test-all --status in_progress --background --timeout 3600\",\n ],\n },\n \"test-runs\": {\n why: \"Manages background linked-test runs with lifecycle controls and log/status inspection.\",\n examples: [\n \"pm test-runs list --status running --limit 20\",\n \"pm test-runs status tr-abc123\",\n \"pm test-runs logs tr-abc123 --stream stderr --tail 200\",\n \"pm test-runs stop tr-abc123\",\n \"pm test-runs resume tr-abc123\",\n ],\n },\n stats: {\n why: \"Reports tracker-level totals and distribution by type/status.\",\n examples: [\"pm stats\", \"pm stats --json\"],\n },\n health: {\n why: \"Validates tracker/runtime health including extension triage, migration, and integrity diagnostics.\",\n examples: [\n \"pm health\",\n \"pm health --check-only --summary --json\",\n \"pm health --brief --json\",\n \"pm health --no-refresh\",\n \"pm health --refresh-vectors\",\n ],\n },\n validate: {\n why:\n \"Runs standalone metadata, resolution, lifecycle (including dependency-cycle diagnostics), linked-file, linked-command reference, and history drift checks with default remediation hints for resolution gaps.\",\n examples: [\n \"pm validate\",\n \"pm validate --check-resolution --json\",\n \"pm validate --check-lifecycle --dependency-cycle-severity error\",\n \"pm validate --check-files --scan-mode tracked-all\",\n \"pm validate --check-files --scan-mode tracked-all-strict --include-pm-internals\",\n \"pm validate --check-command-references\",\n \"pm validate --check-resolution --fail-on-warn --json\",\n ],\n tips: [\"Resolution-gap warnings include default `pm update <id> ...` remediation hint templates in check details.\"],\n },\n gc: {\n why: \"Deletes optional cache artifacts by default to keep local tracker state tidy; use --dry-run to preview targets without deleting files.\",\n examples: [\"pm gc --dry-run\", \"pm gc\"],\n },\n claim: {\n why: \"Claims an item to signal active ownership and reduce conflicts.\",\n examples: [\n 'pm claim pm-a1b2 --author \"codex-agent\" --message \"Claim for implementation\"',\n 'pm claim pm-a1b2 --force --author \"codex-agent\" --message \"Take over terminal item\"',\n ],\n tips: [\"Claim takeover for non-terminal items does not require --force; --force is reserved for terminal/lock overrides.\"],\n },\n release: {\n why: \"Releases an active claim when paused, handed off, or completed.\",\n examples: [\n 'pm release pm-a1b2 --author \"codex-agent\" --message \"Release after closure\"',\n 'pm release pm-a1b2 --allow-audit-release --author \"reviewer\" --message \"Audit handoff release\"',\n ],\n tips: [\"Use --allow-audit-release for non-owner handoffs that only clear assignee metadata.\"],\n },\n \"start-task\": {\n why: \"Lifecycle alias that claims an item and sets status to in_progress.\",\n examples: ['pm start-task pm-a1b2 --author \"codex-agent\" --message \"Start implementation\"'],\n },\n \"pause-task\": {\n why: \"Lifecycle alias that sets status to open and releases active assignment.\",\n examples: ['pm pause-task pm-a1b2 --author \"codex-agent\" --message \"Pause for dependency unblock\"'],\n },\n \"close-task\": {\n why: \"Lifecycle alias that closes with reason text and clears assignment metadata.\",\n examples: ['pm close-task pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close and handoff\"'],\n },\n completion: {\n why: \"Generates shell completion scripts for faster and more reliable command entry.\",\n examples: [\"pm completion bash\", \"pm completion zsh\", \"pm completion fish\", \"pm completion bash --eager-tags\"],\n tips: [\"Default scripts resolve tag suggestions lazily at completion time; use --eager-tags to embed current tags directly.\"],\n },\n contracts: {\n why: \"Exposes machine-readable CLI command and tool schema contracts for agent integrations.\",\n examples: [\n \"pm contracts\",\n \"pm contracts --command list --runtime-only\",\n \"pm contracts --command update --flags-only\",\n \"pm contracts --availability-only --runtime-only\",\n \"pm contracts --action create\",\n \"pm contracts --schema-only\",\n ],\n tips: [\"Use --command to narrow actions/schema to one CLI surface; combine with --flags-only or --availability-only for lighter payloads.\"],\n },\n};\n\nexport const ROOT_HELP_BUNDLE: HelpBundle = {\n why: \"Provides deterministic project management workflows for humans and coding agents.\",\n examples: [\n \"pm init\",\n \"pm install guide-shell --project\",\n \"pm list-open --limit 10\",\n 'pm create --title \"...\" --description \"...\" --type Task --status open --priority 1 --message \"...\" --create-mode progressive',\n ],\n tips: [\n \"Use <command> --help for command-specific guidance and examples.\",\n \"Install guide-shell before using pm guide for local docs and skills routing.\",\n \"Use --json for machine parsing and integration flows.\",\n \"Use --no-pager to force direct help output in CI and other non-interactive shells.\",\n ],\n};\n\nfunction resolveCanonicalHelpPath(commandPath: string | undefined): string {\n const normalized = normalizeHelpCommandPath(commandPath ?? \"\");\n if (!normalized) {\n return \"\";\n }\n return HELP_PATH_ALIASES[normalized] ?? normalized;\n}\n\nexport function resolveHelpBundleForPath(commandPath: string | undefined): HelpBundle {\n const canonicalPath = resolveCanonicalHelpPath(commandPath);\n if (!canonicalPath) {\n return ROOT_HELP_BUNDLE;\n }\n return HELP_BY_COMMAND_PATH[canonicalPath] ?? ROOT_HELP_BUNDLE;\n}\n\nexport function resolveHelpNarrative(commandPath: string | undefined, detailMode: HelpDetailMode): HelpNarrative {\n const bundle = resolveHelpBundleForPath(commandPath);\n return {\n intent: bundle.why,\n examples: detailMode === \"detailed\" ? [...bundle.examples] : bundle.examples.length > 0 ? [bundle.examples[0]] : [],\n tips: detailMode === \"detailed\" ? [...(bundle.tips ?? [])] : [],\n detail_mode: detailMode,\n };\n}\n\nexport function attachRichHelpText(program: Command, argv: string[] = process.argv.slice(2)): void {\n const detailMode = resolveHelpDetailMode(argv);\n program.addHelpText(\"after\", renderHelpBundle(ROOT_HELP_BUNDLE, detailMode));\n for (const [commandPath, bundle] of Object.entries(HELP_BY_COMMAND_PATH)) {\n attachBundleByPath(program, commandPath, bundle, detailMode);\n }\n}\n"],"names":[],"mappings":";;AAiBA,SAAS,uBAAuB,CAAC,MAAkB;IACjD,MAAM,KAAK,GAAa;QACtB,EAAE;QACF,SAAS;QACT,KAAK,MAAM,CAAC,GAAG,EAAE;KAClB,CAAC;IACF,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,0CAA0C,CAAC,CAAC;IAC3D,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,w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AW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC","debugId":"87ab8982-4eaf-5b48-88af-96ff4450ab0f"}
|
|
@@ -17,6 +17,7 @@ export declare function extractOptionValueName(flags: string): string | null;
|
|
|
17
17
|
export declare function readOptionAttributeName(option: unknown): string | null;
|
|
18
18
|
export declare function buildOptionAliasMap(options: unknown[]): Map<string, string[]>;
|
|
19
19
|
export declare function buildHelpOptionSummaries(command: Command): HelpOptionSummary[];
|
|
20
|
+
export declare function compactHelpOptionAliases(options: HelpOptionSummary[]): HelpOptionSummary[];
|
|
20
21
|
export declare function buildHelpArgumentSummaries(command: Command): HelpArgumentSummary[];
|
|
21
22
|
export declare function buildHelpSubcommandSummaries(command: Command): HelpSubcommandSummary[];
|
|
22
23
|
export declare function buildJsonHelpPayload(rootProgram: Command, targetCommand: Command, argv: string[], requestedPath: string[], extensionDescriptors: ReadonlyMap<string, ExtensionCommandHelpDescriptor>): Record<string, unknown>;
|
|
@@ -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]="8ed1b6f2-0119-5667-be8f-8a1e245d795f")}catch(e){}}();
|
|
3
3
|
import { commandOptionFlagLabel, resolveCommandOptionPolicyState, resolveTypeDefinition, } from "../core/item/type-registry.js";
|
|
4
4
|
import { EXIT_CODE } from "../core/shared/constants.js";
|
|
5
5
|
import { printError, writeStdout } from "../core/output/output.js";
|
|
@@ -92,6 +92,36 @@ export function buildHelpOptionSummaries(command) {
|
|
|
92
92
|
return summary;
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
+
export function compactHelpOptionAliases(options) {
|
|
96
|
+
const canonicalByLong = new Map();
|
|
97
|
+
const aliasOptions = [];
|
|
98
|
+
for (const option of options) {
|
|
99
|
+
if (option.alias_for && option.long) {
|
|
100
|
+
aliasOptions.push(option);
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
if (option.long) {
|
|
104
|
+
canonicalByLong.set(option.long, option);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
for (const aliasOption of aliasOptions) {
|
|
108
|
+
if (!aliasOption.alias_for || !aliasOption.long) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const canonical = canonicalByLong.get(aliasOption.alias_for);
|
|
112
|
+
if (!canonical) {
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
const aliases = new Set([...(canonical.aliases ?? []), aliasOption.long]);
|
|
116
|
+
canonical.aliases = [...aliases].sort((left, right) => left.localeCompare(right));
|
|
117
|
+
}
|
|
118
|
+
return options.filter((option) => {
|
|
119
|
+
if (!option.alias_for || !option.long) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
return !canonicalByLong.has(option.alias_for);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
95
125
|
export function buildHelpArgumentSummaries(command) {
|
|
96
126
|
const commandRecord = command;
|
|
97
127
|
const argumentsList = Array.isArray(commandRecord.registeredArguments)
|
|
@@ -151,7 +181,7 @@ export function buildJsonHelpPayload(rootProgram, targetCommand, argv, requested
|
|
|
151
181
|
detail_mode: detailMode,
|
|
152
182
|
}
|
|
153
183
|
: fallbackNarrative;
|
|
154
|
-
const optionSummaries = mergeHelpOptionSummaries(buildHelpOptionSummaries(targetCommand), buildDynamicExtensionHelpOptionSummaries(extensionDescriptor));
|
|
184
|
+
const optionSummaries = compactHelpOptionAliases(mergeHelpOptionSummaries(buildHelpOptionSummaries(targetCommand), buildDynamicExtensionHelpOptionSummaries(extensionDescriptor)));
|
|
155
185
|
const subcommands = buildHelpSubcommandSummaries(targetCommand);
|
|
156
186
|
return {
|
|
157
187
|
format: "pm_help_v1",
|
|
@@ -275,4 +305,4 @@ export function attachCreateUpdatePolicyHelpText(rootProgram, typeRegistry, argv
|
|
|
275
305
|
command.addHelpText("after", buildCreateUpdatePolicyHelpText(bootstrapCommand, typeRegistry, argv));
|
|
276
306
|
}
|
|
277
307
|
//# sourceMappingURL=help-json-payload.js.map
|
|
278
|
-
//# debugId=
|
|
308
|
+
//# debugId=8ed1b6f2-0119-5667-be8f-8a1e245d795f
|