@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.
Files changed (225) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +2 -1
  3. package/dist/cli/commander-usage.js +16 -2
  4. package/dist/cli/commander-usage.js.map +1 -1
  5. package/dist/cli/commands/annotation-command.d.ts +49 -0
  6. package/dist/cli/commands/annotation-command.js +135 -0
  7. package/dist/cli/commands/annotation-command.js.map +1 -0
  8. package/dist/cli/commands/append.js +3 -7
  9. package/dist/cli/commands/append.js.map +1 -1
  10. package/dist/cli/commands/calendar.js +3 -6
  11. package/dist/cli/commands/calendar.js.map +1 -1
  12. package/dist/cli/commands/claim.js +12 -22
  13. package/dist/cli/commands/claim.js.map +1 -1
  14. package/dist/cli/commands/close.js +61 -9
  15. package/dist/cli/commands/close.js.map +1 -1
  16. package/dist/cli/commands/comments.d.ts +5 -0
  17. package/dist/cli/commands/comments.js +27 -117
  18. package/dist/cli/commands/comments.js.map +1 -1
  19. package/dist/cli/commands/completion.js +102 -15
  20. package/dist/cli/commands/completion.js.map +1 -1
  21. package/dist/cli/commands/context.js +4 -10
  22. package/dist/cli/commands/context.js.map +1 -1
  23. package/dist/cli/commands/contracts.js +168 -36
  24. package/dist/cli/commands/contracts.js.map +1 -1
  25. package/dist/cli/commands/create.js +49 -44
  26. package/dist/cli/commands/create.js.map +1 -1
  27. package/dist/cli/commands/dedupe-audit.js +7 -4
  28. package/dist/cli/commands/dedupe-audit.js.map +1 -1
  29. package/dist/cli/commands/delete.d.ts +3 -0
  30. package/dist/cli/commands/delete.js +9 -8
  31. package/dist/cli/commands/delete.js.map +1 -1
  32. package/dist/cli/commands/docs.d.ts +1 -0
  33. package/dist/cli/commands/docs.js +4 -8
  34. package/dist/cli/commands/docs.js.map +1 -1
  35. package/dist/cli/commands/event-validation-messages.d.ts +3 -0
  36. package/dist/cli/commands/event-validation-messages.js +44 -0
  37. package/dist/cli/commands/event-validation-messages.js.map +1 -0
  38. package/dist/cli/commands/extension.d.ts +1 -0
  39. package/dist/cli/commands/extension.js +138 -21
  40. package/dist/cli/commands/extension.js.map +1 -1
  41. package/dist/cli/commands/files.js +6 -13
  42. package/dist/cli/commands/files.js.map +1 -1
  43. package/dist/cli/commands/gc.js +17 -4
  44. package/dist/cli/commands/gc.js.map +1 -1
  45. package/dist/cli/commands/get.d.ts +3 -2
  46. package/dist/cli/commands/get.js +50 -8
  47. package/dist/cli/commands/get.js.map +1 -1
  48. package/dist/cli/commands/health.d.ts +10 -0
  49. package/dist/cli/commands/health.js +254 -75
  50. package/dist/cli/commands/health.js.map +1 -1
  51. package/dist/cli/commands/history-redact.d.ts +8 -0
  52. package/dist/cli/commands/history-redact.js +14 -97
  53. package/dist/cli/commands/history-redact.js.map +1 -1
  54. package/dist/cli/commands/history-repair.d.ts +33 -0
  55. package/dist/cli/commands/history-repair.js +166 -0
  56. package/dist/cli/commands/history-repair.js.map +1 -0
  57. package/dist/cli/commands/history.d.ts +4 -4
  58. package/dist/cli/commands/history.js +10 -88
  59. package/dist/cli/commands/history.js.map +1 -1
  60. package/dist/cli/commands/index.d.ts +3 -1
  61. package/dist/cli/commands/index.js +5 -3
  62. package/dist/cli/commands/index.js.map +1 -1
  63. package/dist/cli/commands/init.d.ts +28 -0
  64. package/dist/cli/commands/init.js +23 -2
  65. package/dist/cli/commands/init.js.map +1 -1
  66. package/dist/cli/commands/learnings.js +20 -119
  67. package/dist/cli/commands/learnings.js.map +1 -1
  68. package/dist/cli/commands/linked-test-entry.d.ts +3 -0
  69. package/dist/cli/commands/linked-test-entry.js +62 -0
  70. package/dist/cli/commands/linked-test-entry.js.map +1 -0
  71. package/dist/cli/commands/list.js +32 -22
  72. package/dist/cli/commands/list.js.map +1 -1
  73. package/dist/cli/commands/notes.js +20 -119
  74. package/dist/cli/commands/notes.js.map +1 -1
  75. package/dist/cli/commands/plan.d.ts +3 -0
  76. package/dist/cli/commands/plan.js +184 -22
  77. package/dist/cli/commands/plan.js.map +1 -1
  78. package/dist/cli/commands/restore.js +7 -50
  79. package/dist/cli/commands/restore.js.map +1 -1
  80. package/dist/cli/commands/schema.d.ts +31 -0
  81. package/dist/cli/commands/schema.js +98 -0
  82. package/dist/cli/commands/schema.js.map +1 -0
  83. package/dist/cli/commands/search.js +151 -40
  84. package/dist/cli/commands/search.js.map +1 -1
  85. package/dist/cli/commands/templates.d.ts +4 -0
  86. package/dist/cli/commands/templates.js +89 -17
  87. package/dist/cli/commands/templates.js.map +1 -1
  88. package/dist/cli/commands/test-all.js +4 -8
  89. package/dist/cli/commands/test-all.js.map +1 -1
  90. package/dist/cli/commands/test.d.ts +1 -0
  91. package/dist/cli/commands/test.js +7 -10
  92. package/dist/cli/commands/test.js.map +1 -1
  93. package/dist/cli/commands/update-many.js +4 -8
  94. package/dist/cli/commands/update-many.js.map +1 -1
  95. package/dist/cli/commands/update.js +109 -51
  96. package/dist/cli/commands/update.js.map +1 -1
  97. package/dist/cli/commands/validate.d.ts +3 -1
  98. package/dist/cli/commands/validate.js +23 -71
  99. package/dist/cli/commands/validate.js.map +1 -1
  100. package/dist/cli/error-guidance.js +96 -6
  101. package/dist/cli/error-guidance.js.map +1 -1
  102. package/dist/cli/extension-command-help.d.ts +0 -1
  103. package/dist/cli/extension-command-help.js +2 -13
  104. package/dist/cli/extension-command-help.js.map +1 -1
  105. package/dist/cli/extension-command-options.d.ts +1 -0
  106. package/dist/cli/extension-command-options.js +106 -7
  107. package/dist/cli/extension-command-options.js.map +1 -1
  108. package/dist/cli/help-content.d.ts +0 -1
  109. package/dist/cli/help-content.js +13 -9
  110. package/dist/cli/help-content.js.map +1 -1
  111. package/dist/cli/help-json-payload.d.ts +1 -0
  112. package/dist/cli/help-json-payload.js +33 -3
  113. package/dist/cli/help-json-payload.js.map +1 -1
  114. package/dist/cli/main.js +35 -29
  115. package/dist/cli/main.js.map +1 -1
  116. package/dist/cli/register-list-query.d.ts +1 -1
  117. package/dist/cli/register-list-query.js +40 -17
  118. package/dist/cli/register-list-query.js.map +1 -1
  119. package/dist/cli/register-mutation.d.ts +1 -1
  120. package/dist/cli/register-mutation.js +232 -64
  121. package/dist/cli/register-mutation.js.map +1 -1
  122. package/dist/cli/register-operations.js +16 -11
  123. package/dist/cli/register-operations.js.map +1 -1
  124. package/dist/cli/register-setup.js +26 -14
  125. package/dist/cli/register-setup.js.map +1 -1
  126. package/dist/cli/registration-helpers.d.ts +0 -2
  127. package/dist/cli/registration-helpers.js +13 -40
  128. package/dist/cli/registration-helpers.js.map +1 -1
  129. package/dist/cli.js +23 -3
  130. package/dist/cli.js.map +1 -1
  131. package/dist/core/extensions/index.d.ts +0 -1
  132. package/dist/core/extensions/index.js +2 -14
  133. package/dist/core/extensions/index.js.map +1 -1
  134. package/dist/core/extensions/loader.js +3 -9
  135. package/dist/core/extensions/loader.js.map +1 -1
  136. package/dist/core/fs/path-utils.d.ts +1 -0
  137. package/dist/core/fs/path-utils.js +12 -0
  138. package/dist/core/fs/path-utils.js.map +1 -0
  139. package/dist/core/history/drift-scan.d.ts +11 -0
  140. package/dist/core/history/drift-scan.js +67 -0
  141. package/dist/core/history/drift-scan.js.map +1 -0
  142. package/dist/core/history/replay.d.ts +82 -0
  143. package/dist/core/history/replay.js +249 -0
  144. package/dist/core/history/replay.js.map +1 -0
  145. package/dist/core/item/item-format.js +11 -8
  146. package/dist/core/item/item-format.js.map +1 -1
  147. package/dist/core/item/item-type-definition.d.ts +52 -0
  148. package/dist/core/item/item-type-definition.js +123 -0
  149. package/dist/core/item/item-type-definition.js.map +1 -0
  150. package/dist/core/item/parse.js +3 -2
  151. package/dist/core/item/parse.js.map +1 -1
  152. package/dist/core/item/priority.d.ts +23 -0
  153. package/dist/core/item/priority.js +55 -0
  154. package/dist/core/item/priority.js.map +1 -0
  155. package/dist/core/item/status.d.ts +14 -1
  156. package/dist/core/item/status.js +22 -2
  157. package/dist/core/item/status.js.map +1 -1
  158. package/dist/core/item/toon-decode.d.ts +19 -0
  159. package/dist/core/item/toon-decode.js +69 -0
  160. package/dist/core/item/toon-decode.js.map +1 -0
  161. package/dist/core/item/type-registry.js +13 -84
  162. package/dist/core/item/type-registry.js.map +1 -1
  163. package/dist/core/packages/manifest.js +3 -9
  164. package/dist/core/packages/manifest.js.map +1 -1
  165. package/dist/core/schema/item-types-file.d.ts +85 -0
  166. package/dist/core/schema/item-types-file.js +243 -0
  167. package/dist/core/schema/item-types-file.js.map +1 -0
  168. package/dist/core/schema/runtime-schema.d.ts +2 -1
  169. package/dist/core/schema/runtime-schema.js +11 -9
  170. package/dist/core/schema/runtime-schema.js.map +1 -1
  171. package/dist/core/search/semantic-defaults.js +3 -3
  172. package/dist/core/search/semantic-defaults.js.map +1 -1
  173. package/dist/core/shared/author.d.ts +1 -0
  174. package/dist/core/shared/author.js +9 -0
  175. package/dist/core/shared/author.js.map +1 -0
  176. package/dist/core/shared/lazy-module.d.ts +1 -0
  177. package/dist/core/shared/lazy-module.js +11 -0
  178. package/dist/core/shared/lazy-module.js.map +1 -0
  179. package/dist/core/shared/option-alias-visibility.d.ts +44 -0
  180. package/dist/core/shared/option-alias-visibility.js +76 -0
  181. package/dist/core/shared/option-alias-visibility.js.map +1 -0
  182. package/dist/core/shared/text-normalization.d.ts +0 -1
  183. package/dist/core/shared/text-normalization.js +2 -5
  184. package/dist/core/shared/text-normalization.js.map +1 -1
  185. package/dist/core/store/item-store.d.ts +2 -0
  186. package/dist/core/store/item-store.js +70 -39
  187. package/dist/core/store/item-store.js.map +1 -1
  188. package/dist/core/store/settings-validator.d.ts +106 -0
  189. package/dist/core/store/settings-validator.js +279 -0
  190. package/dist/core/store/settings-validator.js.map +1 -0
  191. package/dist/core/store/settings.js +6 -343
  192. package/dist/core/store/settings.js.map +1 -1
  193. package/dist/core/telemetry/runtime.js +5 -3
  194. package/dist/core/telemetry/runtime.js.map +1 -1
  195. package/dist/mcp/server.js +64 -13
  196. package/dist/mcp/server.js.map +1 -1
  197. package/dist/sdk/cli-contracts.d.ts +9 -2
  198. package/dist/sdk/cli-contracts.js +204 -13
  199. package/dist/sdk/cli-contracts.js.map +1 -1
  200. package/dist/sdk/runtime.d.ts +25 -1
  201. package/dist/sdk/runtime.js +46 -3
  202. package/dist/sdk/runtime.js.map +1 -1
  203. package/dist/types.d.ts +6 -0
  204. package/dist/types.js +10 -2
  205. package/dist/types.js.map +1 -1
  206. package/docs/AGENT_GUIDE.md +7 -1
  207. package/docs/ARCHITECTURE.md +1 -1
  208. package/docs/COMMANDS.md +39 -6
  209. package/docs/CONFIGURATION.md +1 -1
  210. package/docs/RELEASING.md +11 -7
  211. package/docs/SDK.md +11 -2
  212. package/package.json +12 -11
  213. package/packages/pm-calendar/README.md +3 -1
  214. package/packages/pm-calendar/extensions/calendar/index.js +21 -2
  215. package/packages/pm-calendar/extensions/calendar/index.ts +21 -2
  216. package/packages/pm-search-advanced/README.md +8 -0
  217. package/packages/pm-search-advanced/extensions/search-advanced/index.js +74 -0
  218. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +74 -0
  219. package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +67 -9
  220. package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +67 -9
  221. package/packages/pm-templates/extensions/templates/runtime.js +11 -202
  222. package/packages/pm-templates/extensions/templates/runtime.ts +38 -230
  223. package/dist/core/output/command-aware.d.ts +0 -1
  224. package/dist/core/output/command-aware.js +0 -397
  225. package/dist/core/output/command-aware.js.map +0 -1
@@ -1,7 +1,8 @@
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]="4e7e9e79-ece5-54e2-883e-5ef16db5152b")}catch(e){}}();
2
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b7c80b7e-7951-5ab0-ab77-8e309cf59f0d")}catch(e){}}();
3
3
  export { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, readFirstStringFromCommanderOptions, readStringArrayFromCommanderOptions, } from "./cli-contracts/commander-types.js";
4
4
  export { CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, } from "./cli-contracts/commander-mutation-options.js";
5
+ import { PLAN_HARNESS_VALUES, PLAN_MODE_VALUES, PLAN_STEP_LINK_KIND_VALUES, PLAN_STEP_STATUS_VALUES, } from "../types/index.js";
5
6
  export const PM_EXTENSION_CAPABILITY_CONTRACTS = [
6
7
  "commands",
7
8
  "renderers",
@@ -121,6 +122,8 @@ export const PM_CORE_COMMAND_NAMES = [
121
122
  "reindex",
122
123
  "history",
123
124
  "history-redact",
125
+ "history-repair",
126
+ "schema",
124
127
  "activity",
125
128
  "restore",
126
129
  "update",
@@ -200,6 +203,8 @@ export const PM_TOOL_ACTIONS = [
200
203
  "search",
201
204
  "history",
202
205
  "history-redact",
206
+ "history-repair",
207
+ "schema",
203
208
  "activity",
204
209
  "restore",
205
210
  "update",
@@ -243,6 +248,7 @@ export function isPmExtensionPolicySurfaceContract(value) {
243
248
  return PM_EXTENSION_POLICY_SURFACE_CONTRACTS.includes(value);
244
249
  }
245
250
  export const TOOL_LIST_FILTER_OPTION_CONTRACTS = [
251
+ { param: "status", flag: "--status" },
246
252
  { param: "type", flag: "--type" },
247
253
  { param: "tag", flag: "--tag" },
248
254
  { param: "priority", flag: "--priority" },
@@ -453,6 +459,8 @@ export const TOOL_ACTIVITY_OPTION_CONTRACTS = [
453
459
  { param: "from", flag: "--from" },
454
460
  { param: "to", flag: "--to" },
455
461
  { param: "limit", flag: "--limit" },
462
+ { param: "compact", flag: "--compact" },
463
+ { param: "full", flag: "--full" },
456
464
  ];
457
465
  export const TOOL_CONTEXT_OPTION_CONTRACTS = [
458
466
  { param: "date", flag: "--date" },
@@ -492,6 +500,7 @@ export const GLOBAL_FLAG_CONTRACTS = [
492
500
  { flag: "--version" },
493
501
  ];
494
502
  export const LIST_FILTER_FLAG_CONTRACTS = [
503
+ { flag: "--status" },
495
504
  { flag: "--type" },
496
505
  { flag: "--tag" },
497
506
  { flag: "--priority" },
@@ -621,6 +630,8 @@ export const DOCS_FLAG_CONTRACTS = [
621
630
  ];
622
631
  export const HISTORY_FLAG_CONTRACTS = [
623
632
  { flag: "--limit" },
633
+ { flag: "--compact" },
634
+ { flag: "--full" },
624
635
  { flag: "--diff" },
625
636
  { flag: "--verify" },
626
637
  ];
@@ -633,6 +644,20 @@ export const HISTORY_REDACT_FLAG_CONTRACTS = [
633
644
  { flag: "--message" },
634
645
  { flag: "--force" },
635
646
  ];
647
+ export const HISTORY_REPAIR_FLAG_CONTRACTS = [
648
+ { flag: "--dry-run" },
649
+ { flag: "--author" },
650
+ { flag: "--message" },
651
+ { flag: "--force" },
652
+ ];
653
+ export const SCHEMA_FLAG_CONTRACTS = [
654
+ { flag: "--description" },
655
+ { flag: "--default-status", aliases: ["--default_status"] },
656
+ { flag: "--folder" },
657
+ { flag: "--alias" },
658
+ { flag: "--author" },
659
+ { flag: "--force" },
660
+ ];
636
661
  export const PLAN_FLAG_CONTRACTS = [
637
662
  { flag: "--title" },
638
663
  { flag: "--description" },
@@ -649,7 +674,7 @@ export const PLAN_FLAG_CONTRACTS = [
649
674
  { flag: "--body" },
650
675
  { flag: "--claim" },
651
676
  { flag: "--from-search", aliases: ["--from_search"] },
652
- { flag: "--step-title", aliases: ["--step_title"] },
677
+ { flag: "--step-title", aliases: ["--step", "--step_title"] },
653
678
  { flag: "--step-body", aliases: ["--step_body"] },
654
679
  { flag: "--step-owner", aliases: ["--step_owner"] },
655
680
  { flag: "--step-status", aliases: ["--step_status"] },
@@ -665,11 +690,11 @@ export const PLAN_FLAG_CONTRACTS = [
665
690
  { flag: "--file" },
666
691
  { flag: "--test" },
667
692
  { flag: "--doc" },
668
- { flag: "--decision-text", aliases: ["--decision_text"] },
693
+ { flag: "--decision-text", aliases: ["--decision_text", "--decision"] },
669
694
  { flag: "--decision-rationale", aliases: ["--decision_rationale"] },
670
695
  { flag: "--decision-evidence", aliases: ["--decision_evidence"] },
671
- { flag: "--discovery-text", aliases: ["--discovery_text"] },
672
- { flag: "--validation-text", aliases: ["--validation_text"] },
696
+ { flag: "--discovery-text", aliases: ["--discovery_text", "--discovery"] },
697
+ { flag: "--validation-text", aliases: ["--validation_text", "--validation"] },
673
698
  { flag: "--validation-command", aliases: ["--validation_command"] },
674
699
  { flag: "--validation-expected", aliases: ["--validation_expected"] },
675
700
  { flag: "--depth" },
@@ -688,6 +713,7 @@ export const INIT_FLAG_CONTRACTS = [
688
713
  { flag: "--author" },
689
714
  { flag: "--agent-guidance" },
690
715
  { flag: "--with-packages" },
716
+ { flag: "--verbose" },
691
717
  ];
692
718
  export const CONFIG_FLAG_CONTRACTS = [
693
719
  { flag: "--criterion" },
@@ -712,6 +738,7 @@ export const EXTENSION_FLAG_CONTRACTS = [
712
738
  { flag: "--install" },
713
739
  { flag: "--uninstall" },
714
740
  { flag: "--explore" },
741
+ { flag: "--list" },
715
742
  { flag: "--manage" },
716
743
  { flag: "--reload" },
717
744
  { flag: "--watch" },
@@ -782,6 +809,7 @@ export const RESTORE_FLAG_CONTRACTS = [
782
809
  { flag: "--force" },
783
810
  ];
784
811
  export const DELETE_FLAG_CONTRACTS = [
812
+ { flag: "--dry-run" },
785
813
  { flag: "--author" },
786
814
  { flag: "--message" },
787
815
  { flag: "--force" },
@@ -870,6 +898,8 @@ export const HEALTH_FLAG_CONTRACTS = [
870
898
  { flag: "--no-refresh" },
871
899
  { flag: "--refresh-vectors" },
872
900
  { flag: "--verbose-stale-items" },
901
+ { flag: "--brief" },
902
+ { flag: "--summary" },
873
903
  { flag: "--skip-vectors" },
874
904
  { flag: "--skip-integrity" },
875
905
  { flag: "--skip-drift" },
@@ -886,6 +916,7 @@ export const VALIDATE_FLAG_CONTRACTS = [
886
916
  { flag: "--scan-mode" },
887
917
  { flag: "--include-pm-internals" },
888
918
  { flag: "--verbose-file-lists" },
919
+ { flag: "--verbose-diagnostics" },
889
920
  { flag: "--strict-exit" },
890
921
  { flag: "--fail-on-warn" },
891
922
  { flag: "--check-history-drift" },
@@ -1224,6 +1255,8 @@ export const ACTIVITY_FLAG_CONTRACTS = [
1224
1255
  { flag: "--from" },
1225
1256
  { flag: "--to" },
1226
1257
  { flag: "--limit" },
1258
+ { flag: "--compact" },
1259
+ { flag: "--full" },
1227
1260
  { flag: "--stream" },
1228
1261
  ];
1229
1262
  export const CONTEXT_FLAG_CONTRACTS = [
@@ -1248,6 +1281,7 @@ export const CONTEXT_FLAG_CONTRACTS = [
1248
1281
  ];
1249
1282
  export const GET_FLAG_CONTRACTS = [
1250
1283
  { flag: "--depth" },
1284
+ { flag: "--full" },
1251
1285
  { flag: "--fields" },
1252
1286
  ];
1253
1287
  export const GUIDE_FLAG_CONTRACTS = [
@@ -1385,6 +1419,10 @@ export function resolveSubcommandFlagContractsForCommand(commandName) {
1385
1419
  return withSubcommandGlobalFlags(HISTORY_FLAG_CONTRACTS);
1386
1420
  case "history-redact":
1387
1421
  return withSubcommandGlobalFlags(HISTORY_REDACT_FLAG_CONTRACTS);
1422
+ case "history-repair":
1423
+ return withSubcommandGlobalFlags(HISTORY_REPAIR_FLAG_CONTRACTS);
1424
+ case "schema":
1425
+ return withSubcommandGlobalFlags(SCHEMA_FLAG_CONTRACTS);
1388
1426
  case "plan":
1389
1427
  return withSubcommandGlobalFlags(PLAN_FLAG_CONTRACTS);
1390
1428
  case "activity":
@@ -1663,6 +1701,10 @@ const PM_TOOL_PARAMETER_PROPERTIES = {
1663
1701
  file: { type: "string" },
1664
1702
  preserveSourceIds: { type: "boolean" },
1665
1703
  folder: { type: "string" },
1704
+ subcommand: { type: "string" },
1705
+ name: { type: "string" },
1706
+ defaultStatus: { type: "string" },
1707
+ alias: { type: "array", items: { type: "string" } },
1666
1708
  text: { type: "string" },
1667
1709
  add: { type: "array", items: { type: "string" } },
1668
1710
  addGlob: { type: "array", items: { type: "string" } },
@@ -1709,6 +1751,101 @@ const PM_TOOL_PARAMETER_PROPERTIES = {
1709
1751
  staleThreshold: { type: "string" },
1710
1752
  policy: { type: "string" },
1711
1753
  };
1754
+ const PLAN_SUBCOMMAND_VALUES = [
1755
+ "create",
1756
+ "show",
1757
+ "add-step",
1758
+ "update-step",
1759
+ "complete-step",
1760
+ "block-step",
1761
+ "reorder-step",
1762
+ "remove-step",
1763
+ "link",
1764
+ "unlink",
1765
+ "decision",
1766
+ "discovery",
1767
+ "validation",
1768
+ "resume",
1769
+ "approve",
1770
+ "materialize",
1771
+ ];
1772
+ const PLAN_ACTION_PARAMETER_PROPERTIES = {
1773
+ subcommand: { type: "string", enum: [...PLAN_SUBCOMMAND_VALUES] },
1774
+ stepRef: { type: "string" },
1775
+ reorderTo: { anyOf: [{ type: "string" }, { type: "number" }] },
1776
+ scope: { type: "string" },
1777
+ harness: { type: "string", enum: [...PLAN_HARNESS_VALUES] },
1778
+ mode: { type: "string", enum: [...PLAN_MODE_VALUES] },
1779
+ resumeContext: { type: "string" },
1780
+ related: { type: "string" },
1781
+ blocks: { type: "string" },
1782
+ claim: { type: "boolean" },
1783
+ fromSearch: { type: "string" },
1784
+ stepTitle: { type: "string" },
1785
+ stepBody: { type: "string" },
1786
+ stepOwner: { type: "string" },
1787
+ stepStatus: { type: "string", enum: [...PLAN_STEP_STATUS_VALUES] },
1788
+ stepEvidence: { type: "string" },
1789
+ stepBlockedReason: { type: "string" },
1790
+ stepReplacement: { type: "string" },
1791
+ dependsOn: { type: "string" },
1792
+ link: { type: "string" },
1793
+ linkKind: { type: "string", enum: [...PLAN_STEP_LINK_KIND_VALUES] },
1794
+ linkNote: { type: "string" },
1795
+ promoteToItemDep: { type: "boolean" },
1796
+ allowMultipleActive: { type: "boolean" },
1797
+ file: { anyOf: [{ type: "string" }, { type: "array", items: { type: "string" } }] },
1798
+ test: { anyOf: [{ type: "string" }, { type: "array", items: { type: "string" } }] },
1799
+ doc: { anyOf: [{ type: "string" }, { type: "array", items: { type: "string" } }] },
1800
+ decisionText: { type: "string" },
1801
+ decision: { type: "string" },
1802
+ decisionRationale: { type: "string" },
1803
+ decisionEvidence: { type: "string" },
1804
+ discoveryText: { type: "string" },
1805
+ discovery: { type: "string" },
1806
+ validationText: { type: "string" },
1807
+ validation: { type: "string" },
1808
+ validationCommand: { type: "string" },
1809
+ validationExpected: { type: "string" },
1810
+ steps: { type: "array", items: { type: "string" } },
1811
+ materializeType: { type: "string" },
1812
+ materializeParent: { type: "string" },
1813
+ materializeTags: { type: "string" },
1814
+ };
1815
+ const PLAN_ACTION_PARAMETER_METADATA = {
1816
+ subcommand: {
1817
+ description: "Plan workflow operation to run.",
1818
+ examples: ["create", "show", "add-step", "approve"],
1819
+ },
1820
+ stepRef: {
1821
+ description: "Plan step id or order for step lifecycle subcommands.",
1822
+ examples: ["plan-step-001", "1"],
1823
+ },
1824
+ reorderTo: {
1825
+ description: "New integer order for reorder-step.",
1826
+ examples: [1, "2"],
1827
+ },
1828
+ scope: {
1829
+ description: "Short free-text scope statement describing what the Plan covers.",
1830
+ examples: ["Release readiness audit", "Search package migration"],
1831
+ },
1832
+ mode: {
1833
+ description: "Plan lifecycle mode.",
1834
+ examples: ["draft", "research", "approved"],
1835
+ },
1836
+ file: {
1837
+ description: "File link to attach while creating or materializing a Plan.",
1838
+ examples: ["path=src/cli.ts,note=implementation surface"],
1839
+ },
1840
+ test: {
1841
+ description: "Test command link to attach while creating or materializing a Plan.",
1842
+ examples: ["command=pnpm build,timeout_seconds=300"],
1843
+ },
1844
+ doc: {
1845
+ description: "Documentation link to attach while creating or materializing a Plan.",
1846
+ examples: ["path=docs/SDK.md,note=public API reference"],
1847
+ },
1848
+ };
1712
1849
  const PM_TOOL_GLOBAL_PARAMETER_KEYS = ["json", "quiet", "profile", "noExtensions", "noPager", "path", "pmExecutable", "timeoutMs"];
1713
1850
  function toSchemaKeyList(values) {
1714
1851
  return normalizeUniqueStringList(values);
@@ -1889,18 +2026,27 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
1889
2026
  guide: { optional: ["format", "depth"] },
1890
2027
  context: { optional: CONTEXT_CONTRACT_PARAMETER_KEYS },
1891
2028
  ctx: { optional: CONTEXT_CONTRACT_PARAMETER_KEYS },
1892
- get: { required: ["id"], optional: ["depth", "fields"] },
2029
+ get: { required: ["id"], optional: ["depth", "full", "fields"] },
1893
2030
  search: {
1894
2031
  optional: SEARCH_CONTRACT_PARAMETER_KEYS,
1895
2032
  anyOfRequired: [["query"], ["keywords"]],
1896
2033
  },
1897
2034
  reindex: { optional: ["mode", "progress"] },
1898
- history: { required: ["id"], optional: ["limit", "diff", "verify"] },
2035
+ history: { required: ["id"], optional: ["limit", "compact", "full", "diff", "verify"] },
1899
2036
  "history-redact": {
1900
2037
  required: ["id"],
1901
2038
  optional: ["literal", "regex", "replacement", "dryRun", ...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],
1902
2039
  anyOfRequired: [["literal"], ["regex"]],
1903
2040
  },
2041
+ "history-repair": {
2042
+ required: ["id"],
2043
+ optional: ["dryRun", ...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS],
2044
+ },
2045
+ schema: {
2046
+ required: ["subcommand", "name"],
2047
+ // No --message: schema add-type writes a config file, not item history.
2048
+ optional: ["description", "defaultStatus", "folder", "alias", "author", "force"],
2049
+ },
1904
2050
  plan: {
1905
2051
  required: ["subcommand"],
1906
2052
  optional: [
@@ -1939,10 +2085,13 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
1939
2085
  "test",
1940
2086
  "doc",
1941
2087
  "decisionText",
2088
+ "decision",
1942
2089
  "decisionRationale",
1943
2090
  "decisionEvidence",
1944
2091
  "discoveryText",
2092
+ "discovery",
1945
2093
  "validationText",
2094
+ "validation",
1946
2095
  "validationCommand",
1947
2096
  "validationExpected",
1948
2097
  "depth",
@@ -1960,7 +2109,7 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
1960
2109
  "update-many": { optional: UPDATE_MANY_CONTRACT_PARAMETER_KEYS },
1961
2110
  normalize: { optional: NORMALIZE_CONTRACT_PARAMETER_KEYS },
1962
2111
  close: { required: ["id", "text"], optional: ["validateClose", ...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS] },
1963
- delete: { required: ["id"], optional: AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS },
2112
+ delete: { required: ["id"], optional: ["dryRun", ...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS] },
1964
2113
  append: { required: ["id", "body"], optional: AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS },
1965
2114
  comments: {
1966
2115
  required: ["id"],
@@ -2085,6 +2234,7 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
2085
2234
  "noRefresh",
2086
2235
  "refreshVectors",
2087
2236
  "verboseStaleItems",
2237
+ "summary",
2088
2238
  "skipVectors",
2089
2239
  "skipIntegrity",
2090
2240
  "skipDrift",
@@ -2103,6 +2253,7 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
2103
2253
  "scanMode",
2104
2254
  "includePmInternals",
2105
2255
  "verboseFileLists",
2256
+ "verboseDiagnostics",
2106
2257
  "strictExit",
2107
2258
  "failOnWarn",
2108
2259
  "checkHistoryDrift",
@@ -2216,6 +2367,22 @@ const PM_TOOL_PARAMETER_METADATA = {
2216
2367
  description: "Item type name from the active runtime type registry.",
2217
2368
  examples: ["Task", "Feature"],
2218
2369
  },
2370
+ subcommand: {
2371
+ description: "Subcommand for the schema action.",
2372
+ examples: ["add-type"],
2373
+ },
2374
+ name: {
2375
+ description: "Custom item type name to register (for schema add-type).",
2376
+ examples: ["Spike"],
2377
+ },
2378
+ defaultStatus: {
2379
+ description: "Default status hint recorded for a custom item type.",
2380
+ examples: ["open"],
2381
+ },
2382
+ alias: {
2383
+ description: "Aliases for the custom item type (repeatable).",
2384
+ examples: [["spike", "research"]],
2385
+ },
2219
2386
  preset: {
2220
2387
  description: "Governance preset for initialization flows.",
2221
2388
  examples: ["minimal", "default", "strict"],
@@ -2482,8 +2649,11 @@ const PM_TOOL_PARAMETER_METADATA = {
2482
2649
  verboseFileLists: {
2483
2650
  description: "For validate action, include full file-path lists for --check-files details.",
2484
2651
  },
2652
+ verboseDiagnostics: {
2653
+ description: "For validate action, include full diagnostic ID lists instead of compact summaries.",
2654
+ },
2485
2655
  strictExit: {
2486
- description: "Return non-zero exit when health/validate/extension-doctor warnings are present (ok=false).",
2656
+ description: "Return non-zero exit when health/validate/extension-doctor warnings are present.",
2487
2657
  },
2488
2658
  failOnWarn: {
2489
2659
  description: "Alias for strictExit in health/validate/extension-doctor action payloads.",
@@ -2566,7 +2736,7 @@ const PM_TOOL_PARAMETER_METADATA = {
2566
2736
  description: "Render compact projection output for search and list-family actions.",
2567
2737
  },
2568
2738
  full: {
2569
- description: "Render full nested search hit payload output.",
2739
+ description: "Enable command-specific full/detail output mode when supported, such as deep item reads for get or full payload mode for search/history.",
2570
2740
  },
2571
2741
  fields: {
2572
2742
  description: "Comma-separated projection fields for get, search, or list-family outputs.",
@@ -2661,6 +2831,27 @@ function decorateToolParameterDefinition(key, definition) {
2661
2831
  ...(metadata?.examples ? { examples: metadata.examples } : {}),
2662
2832
  };
2663
2833
  }
2834
+ function actionScopedToolParameterMetadata(action, key) {
2835
+ if (action === "plan" && Object.prototype.hasOwnProperty.call(PLAN_ACTION_PARAMETER_METADATA, key)) {
2836
+ return PLAN_ACTION_PARAMETER_METADATA[key];
2837
+ }
2838
+ return PM_TOOL_PARAMETER_METADATA[key];
2839
+ }
2840
+ function decorateActionScopedToolParameterDefinition(action, key, definition) {
2841
+ const baseDefinition = typeof definition === "object" && definition !== null ? { ...definition } : {};
2842
+ const metadata = actionScopedToolParameterMetadata(action, key);
2843
+ return {
2844
+ ...baseDefinition,
2845
+ description: metadata?.description ?? fallbackToolParameterDescription(key),
2846
+ ...(metadata?.examples ? { examples: metadata.examples } : {}),
2847
+ };
2848
+ }
2849
+ function actionScopedToolParameterDefinition(action, key) {
2850
+ if (action === "plan" && Object.prototype.hasOwnProperty.call(PLAN_ACTION_PARAMETER_PROPERTIES, key)) {
2851
+ return PLAN_ACTION_PARAMETER_PROPERTIES[key];
2852
+ }
2853
+ return PM_TOOL_PARAMETER_PROPERTIES[key];
2854
+ }
2664
2855
  function buildActionScopedToolSchema(action) {
2665
2856
  const contract = PM_TOOL_ACTION_SCHEMA_CONTRACTS[action];
2666
2857
  const required = toSchemaKeyList(contract.required ?? []);
@@ -2676,9 +2867,9 @@ function buildActionScopedToolSchema(action) {
2676
2867
  if (key === "action") {
2677
2868
  continue;
2678
2869
  }
2679
- const definition = PM_TOOL_PARAMETER_PROPERTIES[key];
2870
+ const definition = actionScopedToolParameterDefinition(action, key);
2680
2871
  if (definition) {
2681
- properties[key] = decorateToolParameterDefinition(key, definition);
2872
+ properties[key] = decorateActionScopedToolParameterDefinition(action, key, definition);
2682
2873
  }
2683
2874
  }
2684
2875
  const schema = {
@@ -2749,4 +2940,4 @@ function buildProviderCompatibleToolSchema() {
2749
2940
  }
2750
2941
  export const PM_PROVIDER_TOOL_PARAMETERS_SCHEMA = buildProviderCompatibleToolSchema();
2751
2942
  //# sourceMappingURL=cli-contracts.js.map
2752
- //# debugId=4e7e9e79-ece5-54e2-883e-5ef16db5152b
2943
+ //# debugId=b7c80b7e-7951-5ab0-ab77-8e309cf59f0d