@unbrained/pm-cli 2026.5.10 → 2026.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +4 -4
- package/AGENTS.md +3 -116
- package/CHANGELOG.md +14 -0
- package/PRD.md +11 -11
- package/README.md +20 -2
- package/dist/cli/argv-utils.d.ts +5 -0
- package/dist/cli/argv-utils.js +34 -0
- package/dist/cli/argv-utils.js.map +1 -0
- package/dist/cli/bootstrap-args.d.ts +15 -0
- package/dist/cli/bootstrap-args.js +211 -0
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.js +109 -3
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/completion.js +7 -3
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/contracts.d.ts +19 -0
- package/dist/cli/commands/contracts.js +40 -2
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +112 -51
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/docs.js +9 -2
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +12 -3
- package/dist/cli/commands/extension.js +421 -69
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.js +9 -2
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.js +1 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.js +21 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/metadata-normalizers.d.ts +4 -0
- package/dist/cli/commands/metadata-normalizers.js +37 -0
- package/dist/cli/commands/metadata-normalizers.js.map +1 -0
- package/dist/cli/commands/reindex.js +173 -135
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.js +16 -6
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.js +23 -8
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update.js +70 -39
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/upgrade.d.ts +63 -0
- package/dist/cli/commands/upgrade.js +260 -0
- package/dist/cli/commands/upgrade.js.map +1 -0
- package/dist/cli/error-guidance.d.ts +9 -1
- package/dist/cli/error-guidance.js +147 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/guide-topics.js +18 -16
- package/dist/cli/guide-topics.js.map +1 -1
- package/dist/cli/help-content.js +42 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.js +11 -1
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +69 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-setup.js +174 -82
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/telemetry-flush.d.ts +2 -0
- package/dist/cli/telemetry-flush.js +4 -0
- package/dist/cli/telemetry-flush.js.map +1 -0
- package/dist/cli.js +1 -2
- package/dist/cli.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +72 -0
- package/dist/core/extensions/extension-types.js +24 -0
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +1 -0
- package/dist/core/extensions/loader.js +766 -7
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/lock/lock.js +2 -0
- package/dist/core/lock/lock.js.map +1 -1
- package/dist/core/packages/manifest.d.ts +13 -0
- package/dist/core/packages/manifest.js +139 -0
- package/dist/core/packages/manifest.js.map +1 -0
- package/dist/core/sentry/instrument.d.ts +15 -0
- package/dist/core/sentry/instrument.js +35 -3
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/shared/constants.js +20 -0
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/errors.d.ts +8 -0
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/shared/levenshtein.d.ts +1 -0
- package/dist/core/shared/levenshtein.js +37 -0
- package/dist/core/shared/levenshtein.js.map +1 -0
- package/dist/core/store/paths.js +34 -1
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/store/settings.js +210 -1
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/runtime.d.ts +1 -0
- package/dist/core/telemetry/runtime.js +102 -3
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/mcp/server.js +11 -2
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +38 -17
- package/dist/sdk/cli-contracts.js +387 -35
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.d.ts +13 -1
- package/dist/sdk/index.js +9 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/types.d.ts +41 -0
- package/dist/types.js.map +1 -1
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +39 -0
- package/docs/COMMANDS.md +14 -1
- package/docs/EXTENSIONS.md +782 -12
- package/docs/MIGRATION_CLI_SIMPLIFICATION.md +64 -0
- package/docs/QUICKSTART.md +10 -2
- package/docs/README.md +4 -6
- package/docs/SDK.md +445 -0
- package/docs/examples/ci/github-actions-pm-extension-gate.yml +53 -0
- package/docs/examples/ci/gitlab-ci-pm-extension-gate.yml +41 -0
- package/docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile +45 -0
- package/docs/examples/policy-restricted-extension/README.md +74 -0
- package/docs/examples/policy-restricted-extension/index.js +21 -0
- package/docs/examples/policy-restricted-extension/manifest.json +21 -0
- package/docs/examples/policy-restricted-extension/package.json +8 -0
- package/docs/examples/sdk-app-embedding/README.md +39 -0
- package/docs/examples/sdk-app-embedding/package.json +9 -0
- package/docs/examples/sdk-app-embedding/run-embedded-pm.mjs +61 -0
- package/docs/examples/sdk-contract-consumer/README.md +57 -0
- package/docs/examples/sdk-contract-consumer/inspect-contracts.mjs +47 -0
- package/docs/examples/sdk-contract-consumer/package.json +10 -0
- package/docs/examples/starter-extension/README.md +57 -42
- package/docs/examples/starter-extension/manifest.json +15 -0
- package/marketplace.json +3 -3
- package/package.json +5 -23
- package/packages/pm-beads/README.md +10 -0
- package/{.agents/pm → packages/pm-beads}/extensions/beads/index.js +24 -9
- package/packages/pm-beads/extensions/beads/index.ts +131 -0
- package/packages/pm-beads/package.json +17 -0
- package/packages/pm-todos/README.md +11 -0
- package/{.agents/pm → packages/pm-todos}/extensions/todos/index.js +24 -9
- package/packages/pm-todos/extensions/todos/index.ts +149 -0
- package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.js +1 -1
- package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.ts +1 -1
- package/packages/pm-todos/package.json +17 -0
- package/plugins/pm-cli-claude/.claude-plugin/plugin.json +2 -2
- package/plugins/pm-cli-claude/README.md +54 -14
- package/plugins/pm-cli-claude/agents/pm-delivery-chain.md +88 -0
- package/plugins/pm-cli-claude/agents/pm-triage-agent.md +83 -0
- package/plugins/pm-cli-claude/agents/pm-verification-agent.md +88 -0
- package/plugins/pm-cli-claude/hooks/session-start.mjs +35 -21
- package/.agents/pm/extensions/.managed-extensions.json +0 -42
- package/.agents/skills/HARNESS_COMPATIBILITY.md +0 -45
- package/.agents/skills/README.md +0 -21
- package/.agents/skills/pm-developer/SKILL.md +0 -73
- package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +0 -48
- package/.agents/skills/pm-developer/references/PROMPTS.md +0 -17
- package/.agents/skills/pm-extensions/SKILL.md +0 -57
- package/.agents/skills/pm-extensions/references/LIFECYCLE.md +0 -40
- package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +0 -25
- package/.agents/skills/pm-sdk/SKILL.md +0 -50
- package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +0 -31
- package/.agents/skills/pm-sdk/references/PROMPTS.md +0 -13
- package/.agents/skills/pm-user/SKILL.md +0 -59
- package/.agents/skills/pm-user/references/PROMPTS.md +0 -17
- package/.agents/skills/pm-user/references/WORKFLOWS.md +0 -35
- package/.pi/README.md +0 -26
- package/.pi/extensions/pm-cli/index.js +0 -147
- package/.pi/prompts/pm-workflow.md +0 -5
- package/.pi/skills/pm-native/SKILL.md +0 -40
- package/.pi/skills/pm-release/SKILL.md +0 -35
- package/dist/pi/native.d.ts +0 -5
- package/dist/pi/native.js +0 -183
- package/dist/pi/native.js.map +0 -1
- package/docs/PI_PACKAGE.md +0 -56
- /package/{.agents/pm → packages/pm-beads}/extensions/beads/manifest.json +0 -0
- /package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.js +0 -0
- /package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.ts +0 -0
- /package/{.agents/pm → packages/pm-todos}/extensions/todos/manifest.json +0 -0
|
@@ -19,6 +19,30 @@ export const PM_EXTENSION_SERVICE_NAME_CONTRACTS = [
|
|
|
19
19
|
"item_store_write",
|
|
20
20
|
"item_store_delete",
|
|
21
21
|
];
|
|
22
|
+
export const PM_EXTENSION_POLICY_MODE_CONTRACTS = ["off", "warn", "enforce"];
|
|
23
|
+
export const PM_EXTENSION_TRUST_MODE_CONTRACTS = ["off", "warn", "enforce"];
|
|
24
|
+
export const PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS = ["none", "restricted", "strict"];
|
|
25
|
+
export const PM_EXTENSION_POLICY_SURFACE_CONTRACTS = [
|
|
26
|
+
"commands.override",
|
|
27
|
+
"commands.handler",
|
|
28
|
+
"hooks.beforecommand",
|
|
29
|
+
"hooks.aftercommand",
|
|
30
|
+
"hooks.onwrite",
|
|
31
|
+
"hooks.onread",
|
|
32
|
+
"hooks.onindex",
|
|
33
|
+
"schema.flags",
|
|
34
|
+
"schema.itemfields",
|
|
35
|
+
"schema.itemtypes",
|
|
36
|
+
"schema.migrations",
|
|
37
|
+
"parser.override",
|
|
38
|
+
"preflight.override",
|
|
39
|
+
"services.override",
|
|
40
|
+
"renderers.override",
|
|
41
|
+
"importers.importer",
|
|
42
|
+
"importers.exporter",
|
|
43
|
+
"search.provider",
|
|
44
|
+
"search.vectorstore",
|
|
45
|
+
];
|
|
22
46
|
function normalizeUniqueStringList(values) {
|
|
23
47
|
return [...new Set(Array.from(values).filter((value) => value.trim().length > 0))];
|
|
24
48
|
}
|
|
@@ -62,6 +86,10 @@ export const PM_CORE_COMMAND_NAMES = [
|
|
|
62
86
|
"init",
|
|
63
87
|
"config",
|
|
64
88
|
"extension",
|
|
89
|
+
"package",
|
|
90
|
+
"packages",
|
|
91
|
+
"install",
|
|
92
|
+
"upgrade",
|
|
65
93
|
"create",
|
|
66
94
|
"list",
|
|
67
95
|
"list-all",
|
|
@@ -122,11 +150,27 @@ export const PM_TOOL_ACTIONS = [
|
|
|
122
150
|
"extension-uninstall",
|
|
123
151
|
"extension-explore",
|
|
124
152
|
"extension-manage",
|
|
153
|
+
"extension-reload",
|
|
125
154
|
"extension-doctor",
|
|
126
155
|
"extension-adopt",
|
|
127
156
|
"extension-adopt-all",
|
|
128
157
|
"extension-activate",
|
|
129
158
|
"extension-deactivate",
|
|
159
|
+
"extension",
|
|
160
|
+
"package-init",
|
|
161
|
+
"package-install",
|
|
162
|
+
"package-uninstall",
|
|
163
|
+
"package-explore",
|
|
164
|
+
"package-manage",
|
|
165
|
+
"package-reload",
|
|
166
|
+
"package-doctor",
|
|
167
|
+
"package-adopt",
|
|
168
|
+
"package-adopt-all",
|
|
169
|
+
"package-activate",
|
|
170
|
+
"package-deactivate",
|
|
171
|
+
"package",
|
|
172
|
+
"install",
|
|
173
|
+
"upgrade",
|
|
130
174
|
"create",
|
|
131
175
|
"list",
|
|
132
176
|
"list-all",
|
|
@@ -138,8 +182,11 @@ export const PM_TOOL_ACTIONS = [
|
|
|
138
182
|
"list-canceled",
|
|
139
183
|
"aggregate",
|
|
140
184
|
"dedupe-audit",
|
|
185
|
+
"guide",
|
|
141
186
|
"calendar",
|
|
187
|
+
"cal",
|
|
142
188
|
"context",
|
|
189
|
+
"ctx",
|
|
143
190
|
"get",
|
|
144
191
|
"search",
|
|
145
192
|
"reindex",
|
|
@@ -184,7 +231,22 @@ export const PM_TOOL_ACTIONS = [
|
|
|
184
231
|
"pause-task",
|
|
185
232
|
"close-task",
|
|
186
233
|
];
|
|
187
|
-
export
|
|
234
|
+
export function isPmToolAction(value) {
|
|
235
|
+
return PM_TOOL_ACTIONS.includes(value);
|
|
236
|
+
}
|
|
237
|
+
export function isPmExtensionCapabilityContract(value) {
|
|
238
|
+
return PM_EXTENSION_CAPABILITY_CONTRACTS.includes(value);
|
|
239
|
+
}
|
|
240
|
+
export function isPmExtensionServiceNameContract(value) {
|
|
241
|
+
return PM_EXTENSION_SERVICE_NAME_CONTRACTS.includes(value);
|
|
242
|
+
}
|
|
243
|
+
export function isPmExtensionPolicyModeContract(value) {
|
|
244
|
+
return PM_EXTENSION_POLICY_MODE_CONTRACTS.includes(value);
|
|
245
|
+
}
|
|
246
|
+
export function isPmExtensionPolicySurfaceContract(value) {
|
|
247
|
+
return PM_EXTENSION_POLICY_SURFACE_CONTRACTS.includes(value);
|
|
248
|
+
}
|
|
249
|
+
export const TOOL_LIST_FILTER_OPTION_CONTRACTS = [
|
|
188
250
|
{ param: "type", flag: "--type" },
|
|
189
251
|
{ param: "tag", flag: "--tag" },
|
|
190
252
|
{ param: "priority", flag: "--priority" },
|
|
@@ -201,7 +263,7 @@ export const PI_LIST_FILTER_OPTION_CONTRACTS = [
|
|
|
201
263
|
{ param: "sort", flag: "--sort" },
|
|
202
264
|
{ param: "order", flag: "--order" },
|
|
203
265
|
];
|
|
204
|
-
export const
|
|
266
|
+
export const TOOL_AGGREGATE_OPTION_CONTRACTS = [
|
|
205
267
|
{ param: "groupBy", flag: "--group-by" },
|
|
206
268
|
{ param: "status", flag: "--status" },
|
|
207
269
|
{ param: "type", flag: "--type" },
|
|
@@ -215,7 +277,7 @@ export const PI_AGGREGATE_OPTION_CONTRACTS = [
|
|
|
215
277
|
{ param: "sprint", flag: "--sprint" },
|
|
216
278
|
{ param: "release", flag: "--release" },
|
|
217
279
|
];
|
|
218
|
-
export const
|
|
280
|
+
export const TOOL_DEDUPE_AUDIT_OPTION_CONTRACTS = [
|
|
219
281
|
{ param: "mode", flag: "--mode" },
|
|
220
282
|
{ param: "limit", flag: "--limit" },
|
|
221
283
|
{ param: "threshold", flag: "--threshold" },
|
|
@@ -231,7 +293,7 @@ export const PI_DEDUPE_AUDIT_OPTION_CONTRACTS = [
|
|
|
231
293
|
{ param: "sprint", flag: "--sprint" },
|
|
232
294
|
{ param: "release", flag: "--release" },
|
|
233
295
|
];
|
|
234
|
-
export const
|
|
296
|
+
export const TOOL_SEARCH_FILTER_OPTION_CONTRACTS = [
|
|
235
297
|
{ param: "type", flag: "--type" },
|
|
236
298
|
{ param: "tag", flag: "--tag" },
|
|
237
299
|
{ param: "priority", flag: "--priority" },
|
|
@@ -240,7 +302,7 @@ export const PI_SEARCH_FILTER_OPTION_CONTRACTS = [
|
|
|
240
302
|
{ param: "fields", flag: "--fields" },
|
|
241
303
|
{ param: "limit", flag: "--limit" },
|
|
242
304
|
];
|
|
243
|
-
export const
|
|
305
|
+
export const TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS = [
|
|
244
306
|
{ param: "parent", flag: "--parent" },
|
|
245
307
|
{ param: "reviewer", flag: "--reviewer" },
|
|
246
308
|
{ param: "risk", flag: "--risk" },
|
|
@@ -271,7 +333,7 @@ export const PI_SHARED_CREATE_UPDATE_OPTION_CONTRACTS = [
|
|
|
271
333
|
{ param: "outcome", flag: "--outcome" },
|
|
272
334
|
{ param: "whyNow", flag: "--why-now" },
|
|
273
335
|
];
|
|
274
|
-
export const
|
|
336
|
+
export const TOOL_CREATE_OPTION_CONTRACTS = [
|
|
275
337
|
{ param: "title", flag: "--title" },
|
|
276
338
|
{ param: "description", flag: "--description", allowEmpty: true },
|
|
277
339
|
{ param: "type", flag: "--type" },
|
|
@@ -311,7 +373,7 @@ export const PI_CREATE_OPTION_CONTRACTS = [
|
|
|
311
373
|
{ param: "clearTypeOptions", flag: "--clear-type-options" },
|
|
312
374
|
{ param: "allowAuditUpdate", flag: "--allow-audit-update" },
|
|
313
375
|
];
|
|
314
|
-
export const
|
|
376
|
+
export const TOOL_UPDATE_OPTION_CONTRACTS = [
|
|
315
377
|
{ param: "title", flag: "--title" },
|
|
316
378
|
{ param: "description", flag: "--description", allowEmpty: true },
|
|
317
379
|
{ param: "body", flag: "--body", allowEmpty: true },
|
|
@@ -352,7 +414,7 @@ export const PI_UPDATE_OPTION_CONTRACTS = [
|
|
|
352
414
|
{ param: "clearTypeOptions", flag: "--clear-type-options" },
|
|
353
415
|
{ param: "allowAuditDepUpdate", flag: "--allow-audit-dep-update" },
|
|
354
416
|
];
|
|
355
|
-
export const
|
|
417
|
+
export const TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS = [
|
|
356
418
|
{ param: "filterStatus", flag: "--filter-status" },
|
|
357
419
|
{ param: "filterType", flag: "--filter-type" },
|
|
358
420
|
{ param: "filterTag", flag: "--filter-tag" },
|
|
@@ -367,8 +429,8 @@ export const PI_UPDATE_MANY_FILTER_OPTION_CONTRACTS = [
|
|
|
367
429
|
{ param: "limit", flag: "--limit" },
|
|
368
430
|
{ param: "offset", flag: "--offset" },
|
|
369
431
|
];
|
|
370
|
-
export const
|
|
371
|
-
export const
|
|
432
|
+
export const TOOL_NORMALIZE_FILTER_OPTION_CONTRACTS = [...TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS];
|
|
433
|
+
export const TOOL_CALENDAR_OPTION_CONTRACTS = [
|
|
372
434
|
{ param: "view", flag: "--view" },
|
|
373
435
|
{ param: "date", flag: "--date" },
|
|
374
436
|
{ param: "from", flag: "--from" },
|
|
@@ -388,7 +450,7 @@ export const PI_CALENDAR_OPTION_CONTRACTS = [
|
|
|
388
450
|
{ param: "limit", flag: "--limit" },
|
|
389
451
|
{ param: "format", flag: "--format" },
|
|
390
452
|
];
|
|
391
|
-
export const
|
|
453
|
+
export const TOOL_ACTIVITY_OPTION_CONTRACTS = [
|
|
392
454
|
{ param: "id", flag: "--id" },
|
|
393
455
|
{ param: "op", flag: "--op" },
|
|
394
456
|
{ param: "author", flag: "--author" },
|
|
@@ -396,7 +458,7 @@ export const PI_ACTIVITY_OPTION_CONTRACTS = [
|
|
|
396
458
|
{ param: "to", flag: "--to" },
|
|
397
459
|
{ param: "limit", flag: "--limit" },
|
|
398
460
|
];
|
|
399
|
-
export const
|
|
461
|
+
export const TOOL_CONTEXT_OPTION_CONTRACTS = [
|
|
400
462
|
{ param: "date", flag: "--date" },
|
|
401
463
|
{ param: "from", flag: "--from" },
|
|
402
464
|
{ param: "to", flag: "--to" },
|
|
@@ -414,7 +476,7 @@ export const PI_CONTEXT_OPTION_CONTRACTS = [
|
|
|
414
476
|
{ param: "activityLimit", flag: "--activity-limit" },
|
|
415
477
|
{ param: "staleThreshold", flag: "--stale-threshold" },
|
|
416
478
|
];
|
|
417
|
-
export const
|
|
479
|
+
export const TOOL_DEPS_OPTION_CONTRACTS = [
|
|
418
480
|
{ param: "format", flag: "--format" },
|
|
419
481
|
{ param: "maxDepth", flag: "--max-depth" },
|
|
420
482
|
{ param: "collapse", flag: "--collapse" },
|
|
@@ -572,6 +634,17 @@ export const CONFIG_FLAG_CONTRACTS = [
|
|
|
572
634
|
{ flag: "--clear-criteria" },
|
|
573
635
|
{ flag: "--format" },
|
|
574
636
|
{ flag: "--policy" },
|
|
637
|
+
{ flag: "--default-depth" },
|
|
638
|
+
{ flag: "--activity-limit" },
|
|
639
|
+
{ flag: "--stale-threshold-days" },
|
|
640
|
+
{ flag: "--section-hierarchy" },
|
|
641
|
+
{ flag: "--section-activity" },
|
|
642
|
+
{ flag: "--section-progress" },
|
|
643
|
+
{ flag: "--section-blockers" },
|
|
644
|
+
{ flag: "--section-files" },
|
|
645
|
+
{ flag: "--section-workload" },
|
|
646
|
+
{ flag: "--section-staleness" },
|
|
647
|
+
{ flag: "--section-tests" },
|
|
575
648
|
];
|
|
576
649
|
export const EXTENSION_FLAG_CONTRACTS = [
|
|
577
650
|
{ flag: "--init" },
|
|
@@ -580,6 +653,8 @@ export const EXTENSION_FLAG_CONTRACTS = [
|
|
|
580
653
|
{ flag: "--uninstall" },
|
|
581
654
|
{ flag: "--explore" },
|
|
582
655
|
{ flag: "--manage" },
|
|
656
|
+
{ flag: "--reload" },
|
|
657
|
+
{ flag: "--watch" },
|
|
583
658
|
{ flag: "--doctor" },
|
|
584
659
|
{ flag: "--adopt" },
|
|
585
660
|
{ flag: "--adopt-all" },
|
|
@@ -598,6 +673,17 @@ export const EXTENSION_FLAG_CONTRACTS = [
|
|
|
598
673
|
{ flag: "--strict-exit" },
|
|
599
674
|
{ flag: "--fail-on-warn" },
|
|
600
675
|
];
|
|
676
|
+
export const UPGRADE_FLAG_CONTRACTS = [
|
|
677
|
+
{ flag: "--dry-run" },
|
|
678
|
+
{ flag: "--cli-only" },
|
|
679
|
+
{ flag: "--packages-only" },
|
|
680
|
+
{ flag: "--project" },
|
|
681
|
+
{ flag: "--local" },
|
|
682
|
+
{ flag: "--global" },
|
|
683
|
+
{ flag: "--repair" },
|
|
684
|
+
{ flag: "--tag" },
|
|
685
|
+
{ flag: "--package-name" },
|
|
686
|
+
];
|
|
601
687
|
export const REINDEX_FLAG_CONTRACTS = [
|
|
602
688
|
{ flag: "--mode" },
|
|
603
689
|
{ flag: "--progress" },
|
|
@@ -1080,6 +1166,10 @@ export const CONTEXT_FLAG_CONTRACTS = [
|
|
|
1080
1166
|
{ flag: "--release" },
|
|
1081
1167
|
{ flag: "--limit" },
|
|
1082
1168
|
{ flag: "--format" },
|
|
1169
|
+
{ flag: "--depth" },
|
|
1170
|
+
{ flag: "--section" },
|
|
1171
|
+
{ flag: "--activity-limit" },
|
|
1172
|
+
{ flag: "--stale-threshold" },
|
|
1083
1173
|
];
|
|
1084
1174
|
export const GUIDE_FLAG_CONTRACTS = [
|
|
1085
1175
|
{ flag: "--list" },
|
|
@@ -1119,6 +1209,161 @@ export const CONTRACTS_FLAG_CONTRACTS = [
|
|
|
1119
1209
|
export const COMPLETION_FLAG_CONTRACTS = [
|
|
1120
1210
|
{ flag: "--eager-tags" },
|
|
1121
1211
|
];
|
|
1212
|
+
function toUniqueFlagContracts(contracts) {
|
|
1213
|
+
const seen = new Set();
|
|
1214
|
+
const unique = [];
|
|
1215
|
+
for (const contract of contracts) {
|
|
1216
|
+
const aliasKey = (contract.aliases ?? []).join(",");
|
|
1217
|
+
const key = `${contract.flag}|${contract.short ?? ""}|${aliasKey}`;
|
|
1218
|
+
if (seen.has(key)) {
|
|
1219
|
+
continue;
|
|
1220
|
+
}
|
|
1221
|
+
seen.add(key);
|
|
1222
|
+
unique.push(contract);
|
|
1223
|
+
}
|
|
1224
|
+
return unique;
|
|
1225
|
+
}
|
|
1226
|
+
function withSubcommandGlobalFlags(contracts) {
|
|
1227
|
+
return withFlagAliasMetadata(toUniqueFlagContracts([...SUBCOMMAND_GLOBAL_FLAG_CONTRACTS, ...contracts]));
|
|
1228
|
+
}
|
|
1229
|
+
const LIST_COMMAND_NAME_CONTRACTS = new Set([
|
|
1230
|
+
"list",
|
|
1231
|
+
"list-all",
|
|
1232
|
+
"list-draft",
|
|
1233
|
+
"list-open",
|
|
1234
|
+
"list-in-progress",
|
|
1235
|
+
"list-blocked",
|
|
1236
|
+
"list-closed",
|
|
1237
|
+
"list-canceled",
|
|
1238
|
+
]);
|
|
1239
|
+
const NO_SURFACE_COMMAND_NAME_CONTRACTS = new Set([
|
|
1240
|
+
"get",
|
|
1241
|
+
"stats",
|
|
1242
|
+
"reindex",
|
|
1243
|
+
"beads",
|
|
1244
|
+
"todos",
|
|
1245
|
+
"beads-import",
|
|
1246
|
+
"todos-import",
|
|
1247
|
+
"todos-export",
|
|
1248
|
+
"help",
|
|
1249
|
+
]);
|
|
1250
|
+
function normalizeCommandNameForContracts(commandName) {
|
|
1251
|
+
if (typeof commandName !== "string") {
|
|
1252
|
+
return "";
|
|
1253
|
+
}
|
|
1254
|
+
return commandName.trim().toLowerCase();
|
|
1255
|
+
}
|
|
1256
|
+
export function resolveSubcommandFlagContractsForCommand(commandName) {
|
|
1257
|
+
const normalized = normalizeCommandNameForContracts(commandName);
|
|
1258
|
+
if (normalized.length === 0) {
|
|
1259
|
+
return withSubcommandGlobalFlags([]);
|
|
1260
|
+
}
|
|
1261
|
+
if (LIST_COMMAND_NAME_CONTRACTS.has(normalized)) {
|
|
1262
|
+
return withSubcommandGlobalFlags(LIST_FILTER_FLAG_CONTRACTS);
|
|
1263
|
+
}
|
|
1264
|
+
if (NO_SURFACE_COMMAND_NAME_CONTRACTS.has(normalized)) {
|
|
1265
|
+
return withSubcommandGlobalFlags([]);
|
|
1266
|
+
}
|
|
1267
|
+
if (normalized === "templates") {
|
|
1268
|
+
return withSubcommandGlobalFlags(CREATE_FLAG_CONTRACTS);
|
|
1269
|
+
}
|
|
1270
|
+
if (normalized === "cal") {
|
|
1271
|
+
return withSubcommandGlobalFlags(CALENDAR_FLAG_CONTRACTS);
|
|
1272
|
+
}
|
|
1273
|
+
if (normalized === "ctx") {
|
|
1274
|
+
return withSubcommandGlobalFlags(CONTEXT_FLAG_CONTRACTS);
|
|
1275
|
+
}
|
|
1276
|
+
if (normalized === "test-runs-worker") {
|
|
1277
|
+
return withSubcommandGlobalFlags(TEST_RUNS_FLAG_CONTRACTS);
|
|
1278
|
+
}
|
|
1279
|
+
switch (normalized) {
|
|
1280
|
+
case "init":
|
|
1281
|
+
return withSubcommandGlobalFlags(INIT_FLAG_CONTRACTS);
|
|
1282
|
+
case "config":
|
|
1283
|
+
return withSubcommandGlobalFlags(CONFIG_FLAG_CONTRACTS);
|
|
1284
|
+
case "extension":
|
|
1285
|
+
case "package":
|
|
1286
|
+
case "packages":
|
|
1287
|
+
case "install":
|
|
1288
|
+
return withSubcommandGlobalFlags(EXTENSION_FLAG_CONTRACTS);
|
|
1289
|
+
case "upgrade":
|
|
1290
|
+
return withSubcommandGlobalFlags(UPGRADE_FLAG_CONTRACTS);
|
|
1291
|
+
case "create":
|
|
1292
|
+
return withSubcommandGlobalFlags(CREATE_FLAG_CONTRACTS);
|
|
1293
|
+
case "aggregate":
|
|
1294
|
+
return withSubcommandGlobalFlags(AGGREGATE_FLAG_CONTRACTS);
|
|
1295
|
+
case "dedupe-audit":
|
|
1296
|
+
return withSubcommandGlobalFlags(DEDUPE_AUDIT_FLAG_CONTRACTS);
|
|
1297
|
+
case "comments-audit":
|
|
1298
|
+
return withSubcommandGlobalFlags(COMMENTS_AUDIT_FLAG_CONTRACTS);
|
|
1299
|
+
case "calendar":
|
|
1300
|
+
return withSubcommandGlobalFlags(CALENDAR_FLAG_CONTRACTS);
|
|
1301
|
+
case "context":
|
|
1302
|
+
return withSubcommandGlobalFlags(CONTEXT_FLAG_CONTRACTS);
|
|
1303
|
+
case "search":
|
|
1304
|
+
return withSubcommandGlobalFlags(SEARCH_FLAG_CONTRACTS);
|
|
1305
|
+
case "history":
|
|
1306
|
+
return withSubcommandGlobalFlags(HISTORY_FLAG_CONTRACTS);
|
|
1307
|
+
case "activity":
|
|
1308
|
+
return withSubcommandGlobalFlags(ACTIVITY_FLAG_CONTRACTS);
|
|
1309
|
+
case "restore":
|
|
1310
|
+
return withSubcommandGlobalFlags(RESTORE_FLAG_CONTRACTS);
|
|
1311
|
+
case "update":
|
|
1312
|
+
return withSubcommandGlobalFlags(UPDATE_FLAG_CONTRACTS);
|
|
1313
|
+
case "update-many":
|
|
1314
|
+
return withSubcommandGlobalFlags(UPDATE_MANY_FLAG_CONTRACTS);
|
|
1315
|
+
case "normalize":
|
|
1316
|
+
return withSubcommandGlobalFlags(NORMALIZE_FLAG_CONTRACTS);
|
|
1317
|
+
case "close":
|
|
1318
|
+
return withSubcommandGlobalFlags(CLOSE_FLAG_CONTRACTS);
|
|
1319
|
+
case "delete":
|
|
1320
|
+
return withSubcommandGlobalFlags(DELETE_FLAG_CONTRACTS);
|
|
1321
|
+
case "append":
|
|
1322
|
+
return withSubcommandGlobalFlags(APPEND_FLAG_CONTRACTS);
|
|
1323
|
+
case "comments":
|
|
1324
|
+
return withSubcommandGlobalFlags(COMMENTS_FLAG_CONTRACTS);
|
|
1325
|
+
case "notes":
|
|
1326
|
+
return withSubcommandGlobalFlags(NOTES_FLAG_CONTRACTS);
|
|
1327
|
+
case "learnings":
|
|
1328
|
+
return withSubcommandGlobalFlags(LEARNINGS_FLAG_CONTRACTS);
|
|
1329
|
+
case "files":
|
|
1330
|
+
return withSubcommandGlobalFlags(FILES_FLAG_CONTRACTS);
|
|
1331
|
+
case "docs":
|
|
1332
|
+
return withSubcommandGlobalFlags(DOCS_FLAG_CONTRACTS);
|
|
1333
|
+
case "deps":
|
|
1334
|
+
return withSubcommandGlobalFlags(DEPS_FLAG_CONTRACTS);
|
|
1335
|
+
case "test":
|
|
1336
|
+
return withSubcommandGlobalFlags(TEST_FLAG_CONTRACTS);
|
|
1337
|
+
case "test-all":
|
|
1338
|
+
return withSubcommandGlobalFlags(TEST_ALL_FLAG_CONTRACTS);
|
|
1339
|
+
case "test-runs":
|
|
1340
|
+
return withSubcommandGlobalFlags(TEST_RUNS_FLAG_CONTRACTS);
|
|
1341
|
+
case "health":
|
|
1342
|
+
return withSubcommandGlobalFlags(HEALTH_FLAG_CONTRACTS);
|
|
1343
|
+
case "validate":
|
|
1344
|
+
return withSubcommandGlobalFlags(VALIDATE_FLAG_CONTRACTS);
|
|
1345
|
+
case "gc":
|
|
1346
|
+
return withSubcommandGlobalFlags(GC_FLAG_CONTRACTS);
|
|
1347
|
+
case "contracts":
|
|
1348
|
+
return withSubcommandGlobalFlags(CONTRACTS_FLAG_CONTRACTS);
|
|
1349
|
+
case "claim":
|
|
1350
|
+
return withSubcommandGlobalFlags(CLAIM_FLAG_CONTRACTS);
|
|
1351
|
+
case "release":
|
|
1352
|
+
return withSubcommandGlobalFlags(RELEASE_FLAG_CONTRACTS);
|
|
1353
|
+
case "start-task":
|
|
1354
|
+
return withSubcommandGlobalFlags(START_TASK_FLAG_CONTRACTS);
|
|
1355
|
+
case "pause-task":
|
|
1356
|
+
return withSubcommandGlobalFlags(PAUSE_TASK_FLAG_CONTRACTS);
|
|
1357
|
+
case "close-task":
|
|
1358
|
+
return withSubcommandGlobalFlags(CLOSE_TASK_FLAG_CONTRACTS);
|
|
1359
|
+
case "guide":
|
|
1360
|
+
return withSubcommandGlobalFlags(GUIDE_FLAG_CONTRACTS);
|
|
1361
|
+
case "completion":
|
|
1362
|
+
return withSubcommandGlobalFlags(COMPLETION_FLAG_CONTRACTS);
|
|
1363
|
+
default:
|
|
1364
|
+
return withSubcommandGlobalFlags([]);
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1122
1367
|
export function toCompletionFlagString(flagContracts, includeGlobal = true) {
|
|
1123
1368
|
const aliasAwareContracts = withFlagAliasMetadata(flagContracts);
|
|
1124
1369
|
const scoped = aliasAwareContracts
|
|
@@ -1473,6 +1718,8 @@ const PM_TOOL_PARAMETER_PROPERTIES = {
|
|
|
1473
1718
|
sharedHostSafe: { type: "boolean" },
|
|
1474
1719
|
detail: { type: "string", enum: ["summary", "deep"] },
|
|
1475
1720
|
trace: { type: "boolean" },
|
|
1721
|
+
reload: { type: "boolean" },
|
|
1722
|
+
watch: { type: "boolean" },
|
|
1476
1723
|
runtimeProbe: { type: "boolean" },
|
|
1477
1724
|
fixManagedState: { type: "boolean" },
|
|
1478
1725
|
pmContext: { type: "string", enum: ["schema", "tracker", "auto"] },
|
|
@@ -1514,6 +1761,10 @@ const PM_TOOL_PARAMETER_PROPERTIES = {
|
|
|
1514
1761
|
allowAuditDepUpdate: { type: "boolean" },
|
|
1515
1762
|
allowAuditRelease: { type: "boolean" },
|
|
1516
1763
|
dryRun: { type: "boolean" },
|
|
1764
|
+
cliOnly: { type: "boolean" },
|
|
1765
|
+
packagesOnly: { type: "boolean" },
|
|
1766
|
+
repair: { type: "boolean" },
|
|
1767
|
+
packageName: { type: "string" },
|
|
1517
1768
|
rollback: { type: "string" },
|
|
1518
1769
|
noCheckpoint: { type: "boolean" },
|
|
1519
1770
|
force: { type: "boolean" },
|
|
@@ -1583,8 +1834,8 @@ function toSchemaKeyList(values) {
|
|
|
1583
1834
|
return normalizeUniqueStringList(values);
|
|
1584
1835
|
}
|
|
1585
1836
|
const CREATE_CONTRACT_PARAMETER_KEYS = toSchemaKeyList([
|
|
1586
|
-
...
|
|
1587
|
-
...
|
|
1837
|
+
...TOOL_CREATE_OPTION_CONTRACTS.map((entry) => entry.param),
|
|
1838
|
+
...TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS.map((entry) => entry.param),
|
|
1588
1839
|
"assignee",
|
|
1589
1840
|
]);
|
|
1590
1841
|
const TEMPLATE_SAVE_UNSUPPORTED_PARAMETER_KEYS = new Set([
|
|
@@ -1604,19 +1855,19 @@ const TEMPLATE_SAVE_UNSUPPORTED_PARAMETER_KEYS = new Set([
|
|
|
1604
1855
|
]);
|
|
1605
1856
|
const TEMPLATE_SAVE_CONTRACT_PARAMETER_KEYS = toSchemaKeyList(CREATE_CONTRACT_PARAMETER_KEYS.filter((key) => !TEMPLATE_SAVE_UNSUPPORTED_PARAMETER_KEYS.has(key)));
|
|
1606
1857
|
const UPDATE_CONTRACT_PARAMETER_KEYS = toSchemaKeyList([
|
|
1607
|
-
...
|
|
1608
|
-
...
|
|
1858
|
+
...TOOL_UPDATE_OPTION_CONTRACTS.map((entry) => entry.param),
|
|
1859
|
+
...TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS.map((entry) => entry.param),
|
|
1609
1860
|
"force",
|
|
1610
1861
|
]);
|
|
1611
1862
|
const UPDATE_MANY_CONTRACT_PARAMETER_KEYS = toSchemaKeyList([
|
|
1612
|
-
...
|
|
1863
|
+
...TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS.map((entry) => entry.param),
|
|
1613
1864
|
...UPDATE_CONTRACT_PARAMETER_KEYS,
|
|
1614
1865
|
"dryRun",
|
|
1615
1866
|
"rollback",
|
|
1616
1867
|
"noCheckpoint",
|
|
1617
1868
|
]);
|
|
1618
1869
|
const NORMALIZE_CONTRACT_PARAMETER_KEYS = toSchemaKeyList([
|
|
1619
|
-
...
|
|
1870
|
+
...TOOL_NORMALIZE_FILTER_OPTION_CONTRACTS.map((entry) => entry.param),
|
|
1620
1871
|
"dryRun",
|
|
1621
1872
|
"apply",
|
|
1622
1873
|
"author",
|
|
@@ -1625,30 +1876,30 @@ const NORMALIZE_CONTRACT_PARAMETER_KEYS = toSchemaKeyList([
|
|
|
1625
1876
|
"force",
|
|
1626
1877
|
]);
|
|
1627
1878
|
const CALENDAR_CONTRACT_PARAMETER_KEYS = toSchemaKeyList([
|
|
1628
|
-
...
|
|
1879
|
+
...TOOL_CALENDAR_OPTION_CONTRACTS.map((entry) => entry.param),
|
|
1629
1880
|
"past",
|
|
1630
1881
|
"fullPeriod",
|
|
1631
1882
|
]);
|
|
1632
1883
|
const CONTEXT_CONTRACT_PARAMETER_KEYS = toSchemaKeyList([
|
|
1633
|
-
...
|
|
1884
|
+
...TOOL_CONTEXT_OPTION_CONTRACTS.map((entry) => entry.param),
|
|
1634
1885
|
"past",
|
|
1635
1886
|
"section",
|
|
1636
1887
|
]);
|
|
1637
1888
|
const ACTIVITY_CONTRACT_PARAMETER_KEYS = toSchemaKeyList([
|
|
1638
|
-
...
|
|
1889
|
+
...TOOL_ACTIVITY_OPTION_CONTRACTS.map((entry) => entry.param),
|
|
1639
1890
|
"stream",
|
|
1640
1891
|
]);
|
|
1641
1892
|
const LIST_CONTRACT_PARAMETER_KEYS = toSchemaKeyList([
|
|
1642
|
-
...
|
|
1893
|
+
...TOOL_LIST_FILTER_OPTION_CONTRACTS.map((entry) => entry.param),
|
|
1643
1894
|
"includeBody",
|
|
1644
1895
|
"compact",
|
|
1645
1896
|
]);
|
|
1646
1897
|
const AGGREGATE_CONTRACT_PARAMETER_KEYS = toSchemaKeyList([
|
|
1647
|
-
...
|
|
1898
|
+
...TOOL_AGGREGATE_OPTION_CONTRACTS.map((entry) => entry.param),
|
|
1648
1899
|
"count",
|
|
1649
1900
|
"includeUnparented",
|
|
1650
1901
|
]);
|
|
1651
|
-
const DEDUPE_AUDIT_CONTRACT_PARAMETER_KEYS = toSchemaKeyList(
|
|
1902
|
+
const DEDUPE_AUDIT_CONTRACT_PARAMETER_KEYS = toSchemaKeyList(TOOL_DEDUPE_AUDIT_OPTION_CONTRACTS.map((entry) => entry.param));
|
|
1652
1903
|
const SEARCH_CONTRACT_PARAMETER_KEYS = toSchemaKeyList([
|
|
1653
1904
|
"query",
|
|
1654
1905
|
"keywords",
|
|
@@ -1658,7 +1909,7 @@ const SEARCH_CONTRACT_PARAMETER_KEYS = toSchemaKeyList([
|
|
|
1658
1909
|
"phraseExact",
|
|
1659
1910
|
"compact",
|
|
1660
1911
|
"full",
|
|
1661
|
-
...
|
|
1912
|
+
...TOOL_SEARCH_FILTER_OPTION_CONTRACTS.map((entry) => entry.param),
|
|
1662
1913
|
]);
|
|
1663
1914
|
const AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS = ["author", "message", "force"];
|
|
1664
1915
|
const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
@@ -1675,11 +1926,85 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
1675
1926
|
"extension-uninstall": { required: ["target"], optional: ["scope"] },
|
|
1676
1927
|
"extension-explore": { optional: ["scope"] },
|
|
1677
1928
|
"extension-manage": { optional: ["scope", "runtimeProbe", "fixManagedState"] },
|
|
1929
|
+
"extension-reload": { optional: ["scope", "watch"] },
|
|
1678
1930
|
"extension-doctor": { optional: ["scope", "detail", "trace", "fixManagedState", "strictExit", "failOnWarn"] },
|
|
1679
1931
|
"extension-adopt": { required: ["target"], optional: ["scope", "github", "ref"] },
|
|
1680
1932
|
"extension-adopt-all": { optional: ["scope"] },
|
|
1681
1933
|
"extension-activate": { required: ["target"], optional: ["scope"] },
|
|
1682
1934
|
"extension-deactivate": { required: ["target"], optional: ["scope"] },
|
|
1935
|
+
extension: {
|
|
1936
|
+
optional: [
|
|
1937
|
+
"target",
|
|
1938
|
+
"scope",
|
|
1939
|
+
"github",
|
|
1940
|
+
"ref",
|
|
1941
|
+
"init",
|
|
1942
|
+
"install",
|
|
1943
|
+
"uninstall",
|
|
1944
|
+
"explore",
|
|
1945
|
+
"manage",
|
|
1946
|
+
"reload",
|
|
1947
|
+
"doctor",
|
|
1948
|
+
"adopt",
|
|
1949
|
+
"adoptAll",
|
|
1950
|
+
"activate",
|
|
1951
|
+
"deactivate",
|
|
1952
|
+
"runtimeProbe",
|
|
1953
|
+
"fixManagedState",
|
|
1954
|
+
"detail",
|
|
1955
|
+
"trace",
|
|
1956
|
+
"watch",
|
|
1957
|
+
"strictExit",
|
|
1958
|
+
"failOnWarn",
|
|
1959
|
+
],
|
|
1960
|
+
},
|
|
1961
|
+
"package-init": { required: ["target"], optional: ["scope"] },
|
|
1962
|
+
"package-install": {
|
|
1963
|
+
optional: ["target", "github", "scope", "ref"],
|
|
1964
|
+
anyOfRequired: [["target"], ["github"]],
|
|
1965
|
+
},
|
|
1966
|
+
"package-uninstall": { required: ["target"], optional: ["scope"] },
|
|
1967
|
+
"package-explore": { optional: ["scope"] },
|
|
1968
|
+
"package-manage": { optional: ["scope", "runtimeProbe", "fixManagedState"] },
|
|
1969
|
+
"package-reload": { optional: ["scope", "watch"] },
|
|
1970
|
+
"package-doctor": { optional: ["scope", "detail", "trace", "fixManagedState", "strictExit", "failOnWarn"] },
|
|
1971
|
+
"package-adopt": { required: ["target"], optional: ["scope", "github", "ref"] },
|
|
1972
|
+
"package-adopt-all": { optional: ["scope"] },
|
|
1973
|
+
"package-activate": { required: ["target"], optional: ["scope"] },
|
|
1974
|
+
"package-deactivate": { required: ["target"], optional: ["scope"] },
|
|
1975
|
+
package: {
|
|
1976
|
+
optional: [
|
|
1977
|
+
"target",
|
|
1978
|
+
"scope",
|
|
1979
|
+
"github",
|
|
1980
|
+
"ref",
|
|
1981
|
+
"init",
|
|
1982
|
+
"install",
|
|
1983
|
+
"uninstall",
|
|
1984
|
+
"explore",
|
|
1985
|
+
"manage",
|
|
1986
|
+
"reload",
|
|
1987
|
+
"doctor",
|
|
1988
|
+
"adopt",
|
|
1989
|
+
"adoptAll",
|
|
1990
|
+
"activate",
|
|
1991
|
+
"deactivate",
|
|
1992
|
+
"runtimeProbe",
|
|
1993
|
+
"fixManagedState",
|
|
1994
|
+
"detail",
|
|
1995
|
+
"trace",
|
|
1996
|
+
"watch",
|
|
1997
|
+
"strictExit",
|
|
1998
|
+
"failOnWarn",
|
|
1999
|
+
],
|
|
2000
|
+
},
|
|
2001
|
+
install: {
|
|
2002
|
+
optional: ["target", "github", "scope", "ref"],
|
|
2003
|
+
anyOfRequired: [["target"], ["github"]],
|
|
2004
|
+
},
|
|
2005
|
+
upgrade: {
|
|
2006
|
+
optional: ["target", "scope", "dryRun", "cliOnly", "packagesOnly", "repair", "tag", "packageName"],
|
|
2007
|
+
},
|
|
1683
2008
|
create: {
|
|
1684
2009
|
required: ["title", "description", "type", "status", "priority", "message"],
|
|
1685
2010
|
optional: CREATE_CONTRACT_PARAMETER_KEYS,
|
|
@@ -1694,8 +2019,11 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
1694
2019
|
"list-canceled": { optional: LIST_CONTRACT_PARAMETER_KEYS },
|
|
1695
2020
|
aggregate: { optional: AGGREGATE_CONTRACT_PARAMETER_KEYS },
|
|
1696
2021
|
"dedupe-audit": { optional: DEDUPE_AUDIT_CONTRACT_PARAMETER_KEYS },
|
|
2022
|
+
guide: { optional: ["format", "depth"] },
|
|
1697
2023
|
calendar: { optional: CALENDAR_CONTRACT_PARAMETER_KEYS },
|
|
2024
|
+
cal: { optional: CALENDAR_CONTRACT_PARAMETER_KEYS },
|
|
1698
2025
|
context: { optional: CONTEXT_CONTRACT_PARAMETER_KEYS },
|
|
2026
|
+
ctx: { optional: CONTEXT_CONTRACT_PARAMETER_KEYS },
|
|
1699
2027
|
get: { required: ["id"] },
|
|
1700
2028
|
search: {
|
|
1701
2029
|
optional: SEARCH_CONTRACT_PARAMETER_KEYS,
|
|
@@ -1872,6 +2200,7 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
|
|
|
1872
2200
|
"pause-task": { required: ["id"], optional: AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS },
|
|
1873
2201
|
"close-task": { required: ["id", "text"], optional: AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS },
|
|
1874
2202
|
};
|
|
2203
|
+
export const PM_TOOL_ACTION_PARAMETER_CONTRACTS = PM_TOOL_ACTION_SCHEMA_CONTRACTS;
|
|
1875
2204
|
const PM_TOOL_PARAMETER_METADATA = {
|
|
1876
2205
|
action: {
|
|
1877
2206
|
description: "Tool action to execute.",
|
|
@@ -1891,6 +2220,12 @@ const PM_TOOL_PARAMETER_METADATA = {
|
|
|
1891
2220
|
trace: {
|
|
1892
2221
|
description: "When true for extension-doctor, include actionable registration traces in deep diagnostics.",
|
|
1893
2222
|
},
|
|
2223
|
+
reload: {
|
|
2224
|
+
description: "When true for extension action payloads, trigger cache-busted extension module reload.",
|
|
2225
|
+
},
|
|
2226
|
+
watch: {
|
|
2227
|
+
description: "When true for extension-reload/extension action payloads, enable watch mode semantics.",
|
|
2228
|
+
},
|
|
1894
2229
|
runtimeProbe: {
|
|
1895
2230
|
description: "When true for extension-manage, run a doctor-like runtime activation probe for parity fields.",
|
|
1896
2231
|
},
|
|
@@ -1898,17 +2233,34 @@ const PM_TOOL_PARAMETER_METADATA = {
|
|
|
1898
2233
|
description: "When true for extension-manage/extension-doctor, adopt unmanaged extensions before diagnostics/update checks.",
|
|
1899
2234
|
},
|
|
1900
2235
|
target: {
|
|
1901
|
-
description: "Positional target argument for the selected action (ID, source, or extension name).",
|
|
2236
|
+
description: "Positional target argument for the selected action (ID, source, package source, or extension name).",
|
|
1902
2237
|
examples: ["pm-a1b2", ".agents/pm/extensions/sample", "sample-extension"],
|
|
1903
2238
|
},
|
|
1904
2239
|
github: {
|
|
1905
|
-
description: "GitHub shorthand owner/repo[/path] source for extension install actions.",
|
|
1906
|
-
examples: ["
|
|
2240
|
+
description: "GitHub shorthand owner/repo[/path] source for package/extension install actions.",
|
|
2241
|
+
examples: ["org/repo/extensions/sample"],
|
|
1907
2242
|
},
|
|
1908
2243
|
ref: {
|
|
1909
2244
|
description: "Git ref/branch/tag used when installing from GitHub shorthand/URL sources.",
|
|
1910
2245
|
examples: ["main", "v1.0.0"],
|
|
1911
2246
|
},
|
|
2247
|
+
cliOnly: {
|
|
2248
|
+
description: "Restrict upgrade to the pm CLI/SDK npm package.",
|
|
2249
|
+
},
|
|
2250
|
+
packagesOnly: {
|
|
2251
|
+
description: "Restrict upgrade to managed installable pm packages.",
|
|
2252
|
+
},
|
|
2253
|
+
repair: {
|
|
2254
|
+
description: "Force npm global reinstall semantics when upgrading the pm CLI/SDK.",
|
|
2255
|
+
},
|
|
2256
|
+
tag: {
|
|
2257
|
+
description: "npm version or dist-tag used for CLI and registry package upgrades.",
|
|
2258
|
+
examples: ["latest", "next", "2026.5.11"],
|
|
2259
|
+
},
|
|
2260
|
+
packageName: {
|
|
2261
|
+
description: "Override the pm CLI package name for self-upgrade automation and tests.",
|
|
2262
|
+
examples: ["@unbrained/pm-cli"],
|
|
2263
|
+
},
|
|
1912
2264
|
json: {
|
|
1913
2265
|
description: "Emit machine-readable JSON output.",
|
|
1914
2266
|
},
|
|
@@ -1925,7 +2277,7 @@ const PM_TOOL_PARAMETER_METADATA = {
|
|
|
1925
2277
|
description: "Emit deterministic timing diagnostics to stderr.",
|
|
1926
2278
|
},
|
|
1927
2279
|
timeoutMs: {
|
|
1928
|
-
description: "
|
|
2280
|
+
description: "Tool execution timeout in milliseconds.",
|
|
1929
2281
|
examples: [120000],
|
|
1930
2282
|
},
|
|
1931
2283
|
id: {
|
|
@@ -2396,8 +2748,8 @@ function buildActionScopedToolSchema(action) {
|
|
|
2396
2748
|
}
|
|
2397
2749
|
export const PM_TOOL_PARAMETERS_SCHEMA = {
|
|
2398
2750
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
2399
|
-
$id: "https://unbrained.dev/
|
|
2400
|
-
title: "pm-cli
|
|
2751
|
+
$id: "https://schema.unbrained.dev/pm-cli/tool-parameters-v4.schema.json",
|
|
2752
|
+
title: "pm-cli tool parameters (action-scoped strict schema)",
|
|
2401
2753
|
"x-schema-version": "4.0.1",
|
|
2402
2754
|
type: "object",
|
|
2403
2755
|
oneOf: PM_TOOL_ACTIONS.map((action) => buildActionScopedToolSchema(action)),
|
|
@@ -2422,7 +2774,7 @@ function toProviderCompatibleParameterDefinition(key, definition) {
|
|
|
2422
2774
|
type: "string",
|
|
2423
2775
|
};
|
|
2424
2776
|
}
|
|
2425
|
-
function
|
|
2777
|
+
function buildProviderCompatibleToolSchema() {
|
|
2426
2778
|
const properties = {
|
|
2427
2779
|
action: {
|
|
2428
2780
|
type: "string",
|
|
@@ -2438,7 +2790,7 @@ function buildProviderCompatiblePiToolSchema() {
|
|
|
2438
2790
|
properties[key] = toProviderCompatibleParameterDefinition(key, PM_TOOL_PARAMETER_PROPERTIES[key]);
|
|
2439
2791
|
}
|
|
2440
2792
|
return {
|
|
2441
|
-
title: "pm-cli
|
|
2793
|
+
title: "pm-cli tool parameters (provider-compatible flat schema)",
|
|
2442
2794
|
"x-schema-version": "1.0.0",
|
|
2443
2795
|
type: "object",
|
|
2444
2796
|
additionalProperties: false,
|
|
@@ -2446,5 +2798,5 @@ function buildProviderCompatiblePiToolSchema() {
|
|
|
2446
2798
|
properties,
|
|
2447
2799
|
};
|
|
2448
2800
|
}
|
|
2449
|
-
export const
|
|
2801
|
+
export const PM_PROVIDER_TOOL_PARAMETERS_SCHEMA = buildProviderCompatibleToolSchema();
|
|
2450
2802
|
//# sourceMappingURL=cli-contracts.js.map
|