@unbrained/pm-cli 2026.5.24 → 2026.5.28

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 (246) hide show
  1. package/CHANGELOG.md +953 -522
  2. package/README.md +2 -10
  3. package/dist/cli/bootstrap-args.d.ts +18 -1
  4. package/dist/cli/bootstrap-args.js +143 -3
  5. package/dist/cli/bootstrap-args.js.map +1 -1
  6. package/dist/cli/commander-usage.js +134 -11
  7. package/dist/cli/commander-usage.js.map +1 -1
  8. package/dist/cli/commands/append.js +4 -3
  9. package/dist/cli/commands/append.js.map +1 -1
  10. package/dist/cli/commands/claim.js +5 -4
  11. package/dist/cli/commands/claim.js.map +1 -1
  12. package/dist/cli/commands/close.d.ts +3 -0
  13. package/dist/cli/commands/close.js +26 -3
  14. package/dist/cli/commands/close.js.map +1 -1
  15. package/dist/cli/commands/completion.d.ts +2 -2
  16. package/dist/cli/commands/completion.js +109 -56
  17. package/dist/cli/commands/completion.js.map +1 -1
  18. package/dist/cli/commands/config.d.ts +1 -1
  19. package/dist/cli/commands/config.js +82 -4
  20. package/dist/cli/commands/config.js.map +1 -1
  21. package/dist/cli/commands/create.js +7 -272
  22. package/dist/cli/commands/create.js.map +1 -1
  23. package/dist/cli/commands/delete.js +4 -3
  24. package/dist/cli/commands/delete.js.map +1 -1
  25. package/dist/cli/commands/docs.d.ts +1 -12
  26. package/dist/cli/commands/docs.js +8 -312
  27. package/dist/cli/commands/docs.js.map +1 -1
  28. package/dist/cli/commands/extension/bundled-catalog.d.ts +14 -0
  29. package/dist/cli/commands/extension/bundled-catalog.js +268 -0
  30. package/dist/cli/commands/extension/bundled-catalog.js.map +1 -0
  31. package/dist/cli/commands/extension/doctor.d.ts +31 -0
  32. package/dist/cli/commands/extension/doctor.js +345 -0
  33. package/dist/cli/commands/extension/doctor.js.map +1 -0
  34. package/dist/cli/commands/extension/install-sources.d.ts +37 -0
  35. package/dist/cli/commands/extension/install-sources.js +384 -0
  36. package/dist/cli/commands/extension/install-sources.js.map +1 -0
  37. package/dist/cli/commands/extension/managed-state.d.ts +48 -0
  38. package/dist/cli/commands/extension/managed-state.js +172 -0
  39. package/dist/cli/commands/extension/managed-state.js.map +1 -0
  40. package/dist/cli/commands/extension/scaffold.d.ts +14 -0
  41. package/dist/cli/commands/extension/scaffold.js +202 -0
  42. package/dist/cli/commands/extension/scaffold.js.map +1 -0
  43. package/dist/cli/commands/extension/shared.d.ts +14 -0
  44. package/dist/cli/commands/extension/shared.js +106 -0
  45. package/dist/cli/commands/extension/shared.js.map +1 -0
  46. package/dist/cli/commands/extension.d.ts +36 -68
  47. package/dist/cli/commands/extension.js +143 -1422
  48. package/dist/cli/commands/extension.js.map +1 -1
  49. package/dist/cli/commands/files.d.ts +1 -12
  50. package/dist/cli/commands/files.js +11 -308
  51. package/dist/cli/commands/files.js.map +1 -1
  52. package/dist/cli/commands/get.js +4 -3
  53. package/dist/cli/commands/get.js.map +1 -1
  54. package/dist/cli/commands/health.js +17 -3
  55. package/dist/cli/commands/health.js.map +1 -1
  56. package/dist/cli/commands/history-redact.js +23 -18
  57. package/dist/cli/commands/history-redact.js.map +1 -1
  58. package/dist/cli/commands/history-repair.js +24 -18
  59. package/dist/cli/commands/history-repair.js.map +1 -1
  60. package/dist/cli/commands/legacy-none-tokens.d.ts +3 -0
  61. package/dist/cli/commands/legacy-none-tokens.js +39 -0
  62. package/dist/cli/commands/legacy-none-tokens.js.map +1 -0
  63. package/dist/cli/commands/linked-artifacts.d.ts +96 -0
  64. package/dist/cli/commands/linked-artifacts.js +335 -0
  65. package/dist/cli/commands/linked-artifacts.js.map +1 -0
  66. package/dist/cli/commands/linked-test-parsers.d.ts +28 -0
  67. package/dist/cli/commands/linked-test-parsers.js +192 -0
  68. package/dist/cli/commands/linked-test-parsers.js.map +1 -0
  69. package/dist/cli/commands/list.js +19 -5
  70. package/dist/cli/commands/list.js.map +1 -1
  71. package/dist/cli/commands/normalize.js +4 -3
  72. package/dist/cli/commands/normalize.js.map +1 -1
  73. package/dist/cli/commands/plan.d.ts +5 -0
  74. package/dist/cli/commands/plan.js +56 -8
  75. package/dist/cli/commands/plan.js.map +1 -1
  76. package/dist/cli/commands/recurrence-parsers.d.ts +26 -0
  77. package/dist/cli/commands/recurrence-parsers.js +98 -0
  78. package/dist/cli/commands/recurrence-parsers.js.map +1 -0
  79. package/dist/cli/commands/restore.js +19 -8
  80. package/dist/cli/commands/restore.js.map +1 -1
  81. package/dist/cli/commands/search.js +5 -8
  82. package/dist/cli/commands/search.js.map +1 -1
  83. package/dist/cli/commands/test/linked-command-detection.d.ts +37 -0
  84. package/dist/cli/commands/test/linked-command-detection.js +200 -0
  85. package/dist/cli/commands/test/linked-command-detection.js.map +1 -0
  86. package/dist/cli/commands/test.d.ts +1 -2
  87. package/dist/cli/commands/test.js +8 -350
  88. package/dist/cli/commands/test.js.map +1 -1
  89. package/dist/cli/commands/update-many.js +4 -3
  90. package/dist/cli/commands/update-many.js.map +1 -1
  91. package/dist/cli/commands/update.js +83 -356
  92. package/dist/cli/commands/update.js.map +1 -1
  93. package/dist/cli/commands/validate.js +32 -12
  94. package/dist/cli/commands/validate.js.map +1 -1
  95. package/dist/cli/error-guidance.d.ts +1 -0
  96. package/dist/cli/error-guidance.js +6 -2
  97. package/dist/cli/error-guidance.js.map +1 -1
  98. package/dist/cli/main.d.ts +11 -0
  99. package/dist/cli/main.js +76 -28
  100. package/dist/cli/main.js.map +1 -1
  101. package/dist/cli/register-list-query.d.ts +4 -1
  102. package/dist/cli/register-list-query.js +242 -203
  103. package/dist/cli/register-list-query.js.map +1 -1
  104. package/dist/cli/register-mutation.js +73 -11
  105. package/dist/cli/register-mutation.js.map +1 -1
  106. package/dist/cli/register-operations.js +3 -3
  107. package/dist/cli/register-operations.js.map +1 -1
  108. package/dist/cli/register-setup.js +12 -7
  109. package/dist/cli/register-setup.js.map +1 -1
  110. package/dist/cli/registration-helpers.js +3 -2
  111. package/dist/cli/registration-helpers.js.map +1 -1
  112. package/dist/cli.js +4 -3
  113. package/dist/cli.js.map +1 -1
  114. package/dist/core/config/positional-value.d.ts +44 -0
  115. package/dist/core/config/positional-value.js +109 -0
  116. package/dist/core/config/positional-value.js.map +1 -0
  117. package/dist/core/extensions/extension-capability-aliases.d.ts +14 -0
  118. package/dist/core/extensions/extension-capability-aliases.js +159 -0
  119. package/dist/core/extensions/extension-capability-aliases.js.map +1 -0
  120. package/dist/core/extensions/extension-hook-runtime.d.ts +13 -0
  121. package/dist/core/extensions/extension-hook-runtime.js +414 -0
  122. package/dist/core/extensions/extension-hook-runtime.js.map +1 -0
  123. package/dist/core/extensions/extension-policy.d.ts +69 -0
  124. package/dist/core/extensions/extension-policy.js +481 -0
  125. package/dist/core/extensions/extension-policy.js.map +1 -0
  126. package/dist/core/extensions/extension-registries.d.ts +8 -0
  127. package/dist/core/extensions/extension-registries.js +52 -0
  128. package/dist/core/extensions/extension-registries.js.map +1 -0
  129. package/dist/core/extensions/extension-runtime-helpers.d.ts +6 -0
  130. package/dist/core/extensions/extension-runtime-helpers.js +29 -0
  131. package/dist/core/extensions/extension-runtime-helpers.js.map +1 -0
  132. package/dist/core/extensions/extension-types.d.ts +13 -39
  133. package/dist/core/extensions/extension-types.js +34 -2
  134. package/dist/core/extensions/extension-types.js.map +1 -1
  135. package/dist/core/extensions/index.d.ts +7 -0
  136. package/dist/core/extensions/index.js +11 -2
  137. package/dist/core/extensions/index.js.map +1 -1
  138. package/dist/core/extensions/loader.d.ts +4 -22
  139. package/dist/core/extensions/loader.js +22 -1139
  140. package/dist/core/extensions/loader.js.map +1 -1
  141. package/dist/core/history/drift-scan.d.ts +11 -0
  142. package/dist/core/history/drift-scan.js +114 -32
  143. package/dist/core/history/drift-scan.js.map +1 -1
  144. package/dist/core/history/history-rewrite.d.ts +43 -0
  145. package/dist/core/history/history-rewrite.js +48 -0
  146. package/dist/core/history/history-rewrite.js.map +1 -0
  147. package/dist/core/history/history.js +5 -4
  148. package/dist/core/history/history.js.map +1 -1
  149. package/dist/core/history/replay.js +4 -3
  150. package/dist/core/history/replay.js.map +1 -1
  151. package/dist/core/item/item-record.d.ts +19 -0
  152. package/dist/core/item/item-record.js +24 -0
  153. package/dist/core/item/item-record.js.map +1 -0
  154. package/dist/core/output/mutation-projection.d.ts +31 -0
  155. package/dist/core/output/mutation-projection.js +103 -0
  156. package/dist/core/output/mutation-projection.js.map +1 -0
  157. package/dist/core/output/output.d.ts +2 -0
  158. package/dist/core/output/output.js +5 -3
  159. package/dist/core/output/output.js.map +1 -1
  160. package/dist/core/schema/runtime-schema.js +8 -38
  161. package/dist/core/schema/runtime-schema.js.map +1 -1
  162. package/dist/core/search/vector-stores.js +46 -9
  163. package/dist/core/search/vector-stores.js.map +1 -1
  164. package/dist/core/sentry/helpers.d.ts +1 -1
  165. package/dist/core/sentry/helpers.js +20 -3
  166. package/dist/core/sentry/helpers.js.map +1 -1
  167. package/dist/core/shared/command-types.d.ts +1 -0
  168. package/dist/core/shared/command-types.js +2 -2
  169. package/dist/core/shared/command-types.js.map +1 -1
  170. package/dist/core/shared/constants.d.ts +10 -1
  171. package/dist/core/shared/constants.js +56 -58
  172. package/dist/core/shared/constants.js.map +1 -1
  173. package/dist/core/shared/levenshtein.js +23 -7
  174. package/dist/core/shared/levenshtein.js.map +1 -1
  175. package/dist/core/shared/primitives.d.ts +23 -0
  176. package/dist/core/shared/primitives.js +39 -2
  177. package/dist/core/shared/primitives.js.map +1 -1
  178. package/dist/core/store/front-matter-cache.d.ts +16 -2
  179. package/dist/core/store/front-matter-cache.js +99 -33
  180. package/dist/core/store/front-matter-cache.js.map +1 -1
  181. package/dist/core/store/item-store.js +8 -73
  182. package/dist/core/store/item-store.js.map +1 -1
  183. package/dist/mcp/server.js +76 -28
  184. package/dist/mcp/server.js.map +1 -1
  185. package/dist/sdk/cli-contracts/enum-contracts.d.ts +20 -0
  186. package/dist/sdk/cli-contracts/enum-contracts.js +156 -0
  187. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -0
  188. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +14 -0
  189. package/dist/sdk/cli-contracts/tool-option-contracts.js +243 -0
  190. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -0
  191. package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +11 -0
  192. package/dist/sdk/cli-contracts/tool-parameter-tables.js +901 -0
  193. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -0
  194. package/dist/sdk/cli-contracts.d.ts +11 -33
  195. package/dist/sdk/cli-contracts.js +30 -1356
  196. package/dist/sdk/cli-contracts.js.map +1 -1
  197. package/dist/sdk/package-import-adapters.d.ts +74 -0
  198. package/dist/sdk/package-import-adapters.js +186 -0
  199. package/dist/sdk/package-import-adapters.js.map +1 -0
  200. package/dist/sdk/package-runtime-options.d.ts +26 -0
  201. package/dist/sdk/package-runtime-options.js +71 -0
  202. package/dist/sdk/package-runtime-options.js.map +1 -0
  203. package/dist/sdk/runtime.d.ts +2 -0
  204. package/dist/sdk/runtime.js +4 -2
  205. package/dist/sdk/runtime.js.map +1 -1
  206. package/docs/AGENT_GUIDE.md +6 -10
  207. package/docs/CLAUDE_CODE_PLUGIN.md +5 -28
  208. package/docs/CODEX_PLUGIN.md +5 -5
  209. package/docs/COMMANDS.md +19 -3
  210. package/docs/CONFIGURATION.md +15 -0
  211. package/docs/EXTENSIONS.md +4 -63
  212. package/docs/RELEASING.md +4 -4
  213. package/marketplace.json +7 -3
  214. package/package.json +9 -6
  215. package/packages/pm-beads/extensions/beads/index.js +2 -49
  216. package/packages/pm-beads/extensions/beads/index.ts +2 -54
  217. package/packages/pm-beads/extensions/beads/runtime-loader.js +86 -0
  218. package/packages/pm-beads/extensions/beads/runtime-loader.ts +88 -0
  219. package/packages/pm-beads/extensions/beads/runtime.js +26 -115
  220. package/packages/pm-beads/extensions/beads/runtime.ts +33 -132
  221. package/packages/pm-calendar/extensions/calendar/index.js +47 -2
  222. package/packages/pm-calendar/extensions/calendar/index.ts +52 -2
  223. package/packages/pm-calendar/extensions/calendar/runtime.js +1 -0
  224. package/packages/pm-calendar/extensions/calendar/runtime.ts +1 -0
  225. package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +14 -41
  226. package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +25 -41
  227. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +10 -50
  228. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +17 -50
  229. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +8 -40
  230. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +10 -40
  231. package/packages/pm-search-advanced/extensions/search-advanced/index.js +1 -1
  232. package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +4 -37
  233. package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +6 -37
  234. package/packages/pm-todos/extensions/todos/index.js +3 -50
  235. package/packages/pm-todos/extensions/todos/index.ts +3 -55
  236. package/packages/pm-todos/extensions/todos/runtime-loader.js +86 -0
  237. package/packages/pm-todos/extensions/todos/runtime-loader.ts +88 -0
  238. package/packages/pm-todos/extensions/todos/runtime.js +24 -117
  239. package/packages/pm-todos/extensions/todos/runtime.ts +32 -129
  240. package/plugins/pm-claude/README.md +2 -2
  241. package/plugins/pm-claude/commands/pm-planner.md +1 -15
  242. package/plugins/pm-claude/scripts/pm-mcp-server.mjs +5 -2
  243. package/plugins/pm-claude/skills/pm-planner/SKILL.md +3 -21
  244. package/plugins/pm-codex/scripts/pm-mcp-server.mjs +15 -6
  245. package/plugins/pm-codex/skills/pm-native/SKILL.md +1 -13
  246. package/PRD.md +0 -1734
@@ -1,2 +1,5 @@
1
1
  import { type Command } from "commander";
2
- export declare function registerListQueryCommands(program: Command): void;
2
+ export interface RegisterListQueryCommandsOptions {
3
+ commandFilter?: Set<string>;
4
+ }
5
+ export declare function registerListQueryCommands(program: Command, options?: RegisterListQueryCommandsOptions): void;
@@ -1,12 +1,23 @@
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]="f3123310-eac0-5611-ac12-ac8837d3702b")}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]="79117409-1ffd-53b1-948a-0ac6ac8d878a")}catch(e){}}();
3
3
  import { Option } from "commander";
4
4
  import { EXIT_CODE } from "../core/shared/constants.js";
5
5
  import { PmCliError } from "../core/shared/errors.js";
6
6
  import { getGlobalOptions, normalizeAggregateOptions, normalizeActivityOptions, normalizeContextOptions, normalizeListOptions, normalizeSearchKeywordsInput, normalizeSearchOptions, printActivityJsonStream, printError, printListJsonStream, printResult, resolveActivityStreamMode, writeStdout, } from "./registration-helpers.js";
7
7
  import { createLazyModule } from "../core/shared/lazy-module.js";
8
8
  const loadListQueryCommandsModule = createLazyModule(() => import("./commands/index.js"));
9
- export function registerListQueryCommands(program) {
9
+ function shouldRegisterListQueryCommand(commandName, commandFilter) {
10
+ if (!commandFilter || commandFilter.size === 0) {
11
+ return true;
12
+ }
13
+ if (commandName === "context") {
14
+ return commandFilter.has("context") || commandFilter.has("ctx");
15
+ }
16
+ return commandFilter.has(commandName);
17
+ }
18
+ export function registerListQueryCommands(program, options) {
19
+ const commandFilter = options?.commandFilter;
20
+ const shouldRegister = (commandName) => shouldRegisterListQueryCommand(commandName, commandFilter);
10
21
  // Register a flag and hide it from --help text while keeping it functional as
11
22
  // a parse-time alias. Used for pure snake_case underscore-duplicate aliases
12
23
  // (e.g. --assignee_filter for --assignee-filter) so they no longer bloat
@@ -38,7 +49,7 @@ export function registerListQueryCommands(program) {
38
49
  .option("--brief", "Ultra-compact output: id, status, type, title only (agent-optimized, mutually exclusive with --compact/--full/--fields)")
39
50
  .option("--full", "Render full list projection fields (mutually exclusive with --compact/--brief/--fields)")
40
51
  .option("--fields <value>", "Render custom comma-separated list fields (mutually exclusive with --compact/--brief/--full; valid: --fields id,title)")
41
- .option("--sort <value>", "Sort field: priority|deadline|updated_at|created_at|title|parent")
52
+ .option("--sort <value>", "Sort field: priority|deadline|updated_at|created_at|title|parent (aliases: updated, created)")
42
53
  .option("--order <value>", "Sort order: asc|desc (requires --sort)")
43
54
  .option("--stream", "Emit line-delimited JSON rows (requires --json)")
44
55
  .action(async (options, actionCommand) => {
@@ -74,209 +85,237 @@ export function registerListQueryCommands(program) {
74
85
  // Hidden pure snake_case underscore-duplicate alias (kept parse-functional).
75
86
  addHiddenOption(command, "--assignee_filter <value>", "Alias for --assignee-filter");
76
87
  }
77
- registerListCommand("list", "List active items with optional filters.", undefined, true, true, true);
78
- registerListCommand("list-all", "List all items with optional filters.", undefined, false, true);
79
- registerListCommand("list-draft", "List draft items with optional filters.", "draft");
80
- registerListCommand("list-open", "List open items with optional filters.", "open", false, false, true);
81
- registerListCommand("list-in-progress", "List in-progress items with optional filters.", "in_progress", false, false, true);
82
- registerListCommand("list-blocked", "List blocked items with optional filters.", "blocked");
83
- registerListCommand("list-closed", "List closed items with optional filters.", "closed");
84
- registerListCommand("list-canceled", "List canceled items with optional filters.", "canceled");
85
- const aggregateCommand = program
86
- .command("aggregate")
87
- .description("Aggregate grouped item counts for governance queries.")
88
- .option("--group-by <value>", "Comma-separated group-by fields (supported: parent,type,priority,status,assignee,tags,sprint,release)")
89
- .option("--count", "Return grouped counts (default behavior)")
90
- .option("--include-unparented", "Include unparented rows when grouping by parent")
91
- .option("--status <value>", "Filter by item status")
92
- .option("--type <value>", "Filter by item type")
93
- .option("--tag <value>", "Filter by tag")
94
- .option("--priority <value>", "Filter by priority")
95
- .option("--deadline-before <value>", "Filter by deadline upper bound (ISO/date string or relative)")
96
- .option("--deadline-after <value>", "Filter by deadline lower bound (ISO/date string or relative)")
97
- .option("--assignee <value>", "Filter by assignee")
98
- .option("--assignee-filter <value>", "Filter assignee presence: assigned|unassigned")
99
- .option("--parent <value>", "Filter by parent item ID")
100
- .option("--sprint <value>", "Filter by sprint")
101
- .option("--release <value>", "Filter by release");
102
- // Hidden pure snake_case underscore-duplicate aliases (kept parse-functional).
103
- addHiddenOption(aggregateCommand, "--include_unparented", "Alias for --include-unparented");
104
- addHiddenOption(aggregateCommand, "--assignee_filter <value>", "Alias for --assignee-filter");
105
- aggregateCommand
106
- .action(async (options, command) => {
107
- const globalOptions = getGlobalOptions(command);
108
- const startedAt = Date.now();
109
- const { runAggregate } = await loadListQueryCommandsModule();
110
- const result = await runAggregate(normalizeAggregateOptions(options), globalOptions);
111
- printResult(result, globalOptions);
112
- if (globalOptions.profile) {
113
- printError(`profile:command=aggregate took_ms=${Date.now() - startedAt}`);
114
- }
115
- });
116
- const contextCommand = program
117
- .command("context")
118
- .alias("ctx")
119
- .description("Show a token-efficient project context snapshot for next-work decisions.")
120
- .option("--date <value>", "Anchor date/time for agenda window calculations (ISO/date string or relative)")
121
- .option("--from <value>", "Agenda lower bound (ISO/date string or relative)")
122
- .option("--to <value>", "Agenda upper bound (ISO/date string or relative)")
123
- .option("--past", "Include past agenda entries in bounded windows")
124
- .option("--type <value>", "Filter by item type")
125
- .option("--tag <value>", "Filter by tag")
126
- .option("--priority <value>", "Filter by priority")
127
- .option("--assignee <value>", "Filter by assignee")
128
- .option("--assignee-filter <value>", "Filter assignee presence: assigned|unassigned")
129
- .option("--sprint <value>", "Filter by sprint")
130
- .option("--release <value>", "Filter by release")
131
- .option("--limit <n>", "Limit focus and agenda rows per section")
132
- .option("--format <value>", "Context output format override: markdown|toon|json")
133
- .option("--depth <value>", "Context depth: brief|standard|deep (default: settings or brief)")
134
- .option("--section <value...>", "Include specific sections (repeatable; overrides --depth)")
135
- .option("--activity-limit <n>", "Limit recent activity entries (default: settings or 10)")
136
- .option("--stale-threshold <value>", "Staleness cutoff in days (e.g. 7 or 7d; default: settings or 7)");
137
- // Hidden pure snake_case underscore-duplicate alias (kept parse-functional).
138
- addHiddenOption(contextCommand, "--assignee_filter <value>", "Alias for --assignee-filter");
139
- contextCommand
140
- .action(async (options, actionCommand) => {
141
- const globalOptions = getGlobalOptions(actionCommand);
142
- const startedAt = Date.now();
143
- const normalized = normalizeContextOptions(options);
144
- const commands = await loadListQueryCommandsModule();
145
- const result = await commands.runContext(normalized, globalOptions);
146
- const outputFormat = commands.resolveContextOutputFormat(normalized, globalOptions);
147
- if (outputFormat === "markdown") {
148
- if (!globalOptions.quiet) {
149
- writeStdout(`${commands.renderContextMarkdown(result)}\n`);
88
+ if (shouldRegister("list")) {
89
+ registerListCommand("list", "List active items with optional filters.", undefined, true, true, true);
90
+ }
91
+ if (shouldRegister("list-all")) {
92
+ registerListCommand("list-all", "List all items with optional filters.", undefined, false, true);
93
+ }
94
+ if (shouldRegister("list-draft")) {
95
+ registerListCommand("list-draft", "List draft items with optional filters.", "draft");
96
+ }
97
+ if (shouldRegister("list-open")) {
98
+ registerListCommand("list-open", "List open items with optional filters.", "open", false, false, true);
99
+ }
100
+ if (shouldRegister("list-in-progress")) {
101
+ registerListCommand("list-in-progress", "List in-progress items with optional filters.", "in_progress", false, false, true);
102
+ }
103
+ if (shouldRegister("list-blocked")) {
104
+ registerListCommand("list-blocked", "List blocked items with optional filters.", "blocked");
105
+ }
106
+ if (shouldRegister("list-closed")) {
107
+ registerListCommand("list-closed", "List closed items with optional filters.", "closed");
108
+ }
109
+ if (shouldRegister("list-canceled")) {
110
+ registerListCommand("list-canceled", "List canceled items with optional filters.", "canceled");
111
+ }
112
+ if (shouldRegister("aggregate")) {
113
+ const aggregateCommand = program
114
+ .command("aggregate")
115
+ .description("Aggregate grouped item counts for governance queries.")
116
+ .option("--group-by <value>", "Comma-separated group-by fields (supported: parent,type,priority,status,assignee,tags,sprint,release)")
117
+ .option("--count", "Return grouped counts (default behavior)")
118
+ .option("--include-unparented", "Include unparented rows when grouping by parent")
119
+ .option("--status <value>", "Filter by item status")
120
+ .option("--type <value>", "Filter by item type")
121
+ .option("--tag <value>", "Filter by tag")
122
+ .option("--priority <value>", "Filter by priority")
123
+ .option("--deadline-before <value>", "Filter by deadline upper bound (ISO/date string or relative)")
124
+ .option("--deadline-after <value>", "Filter by deadline lower bound (ISO/date string or relative)")
125
+ .option("--assignee <value>", "Filter by assignee")
126
+ .option("--assignee-filter <value>", "Filter assignee presence: assigned|unassigned")
127
+ .option("--parent <value>", "Filter by parent item ID")
128
+ .option("--sprint <value>", "Filter by sprint")
129
+ .option("--release <value>", "Filter by release");
130
+ // Hidden pure snake_case underscore-duplicate aliases (kept parse-functional).
131
+ addHiddenOption(aggregateCommand, "--include_unparented", "Alias for --include-unparented");
132
+ addHiddenOption(aggregateCommand, "--assignee_filter <value>", "Alias for --assignee-filter");
133
+ aggregateCommand
134
+ .action(async (options, command) => {
135
+ const globalOptions = getGlobalOptions(command);
136
+ const startedAt = Date.now();
137
+ const { runAggregate } = await loadListQueryCommandsModule();
138
+ const result = await runAggregate(normalizeAggregateOptions(options), globalOptions);
139
+ printResult(result, globalOptions);
140
+ if (globalOptions.profile) {
141
+ printError(`profile:command=aggregate took_ms=${Date.now() - startedAt}`);
150
142
  }
151
- }
152
- else {
153
- printResult(result, {
154
- ...globalOptions,
155
- json: outputFormat === "json",
143
+ });
144
+ }
145
+ if (shouldRegister("context")) {
146
+ const contextCommand = program
147
+ .command("context")
148
+ .alias("ctx")
149
+ .description("Show a token-efficient project context snapshot for next-work decisions.")
150
+ .option("--date <value>", "Anchor date/time for agenda window calculations (ISO/date string or relative)")
151
+ .option("--from <value>", "Agenda lower bound (ISO/date string or relative)")
152
+ .option("--to <value>", "Agenda upper bound (ISO/date string or relative)")
153
+ .option("--past", "Include past agenda entries in bounded windows")
154
+ .option("--type <value>", "Filter by item type")
155
+ .option("--tag <value>", "Filter by tag")
156
+ .option("--priority <value>", "Filter by priority")
157
+ .option("--assignee <value>", "Filter by assignee")
158
+ .option("--assignee-filter <value>", "Filter assignee presence: assigned|unassigned")
159
+ .option("--sprint <value>", "Filter by sprint")
160
+ .option("--release <value>", "Filter by release")
161
+ .option("--limit <n>", "Limit focus and agenda rows per section")
162
+ .option("--format <value>", "Context output format override: markdown|toon|json")
163
+ .option("--depth <value>", "Context depth: brief|standard|deep (default: settings or brief)")
164
+ .option("--section <value...>", "Include specific sections (repeatable; overrides --depth)")
165
+ .option("--activity-limit <n>", "Limit recent activity entries (default: settings or 10)")
166
+ .option("--stale-threshold <value>", "Staleness cutoff in days (e.g. 7 or 7d; default: settings or 7)");
167
+ // Hidden pure snake_case underscore-duplicate alias (kept parse-functional).
168
+ addHiddenOption(contextCommand, "--assignee_filter <value>", "Alias for --assignee-filter");
169
+ contextCommand
170
+ .action(async (options, actionCommand) => {
171
+ const globalOptions = getGlobalOptions(actionCommand);
172
+ const startedAt = Date.now();
173
+ const normalized = normalizeContextOptions(options);
174
+ const commands = await loadListQueryCommandsModule();
175
+ const result = await commands.runContext(normalized, globalOptions);
176
+ const outputFormat = commands.resolveContextOutputFormat(normalized, globalOptions);
177
+ if (outputFormat === "markdown") {
178
+ if (!globalOptions.quiet) {
179
+ writeStdout(`${commands.renderContextMarkdown(result)}\n`);
180
+ }
181
+ }
182
+ else {
183
+ printResult(result, {
184
+ ...globalOptions,
185
+ json: outputFormat === "json",
186
+ });
187
+ }
188
+ if (globalOptions.profile) {
189
+ printError(`profile:command=context took_ms=${Date.now() - startedAt}`);
190
+ }
191
+ });
192
+ }
193
+ if (shouldRegister("search")) {
194
+ program
195
+ .command("search")
196
+ .argument("<keywords...>", "Keyword query tokens")
197
+ .description("Search items with keyword, semantic, or hybrid retrieval.")
198
+ .option("--mode <value>", "Search mode: keyword|semantic|hybrid (default: keyword)")
199
+ .option("--semantic", "Shorthand for --mode semantic")
200
+ .option("--hybrid", "Shorthand for --mode hybrid")
201
+ .option("--include-linked", "Include linked files, docs, and tests in the searchable corpus")
202
+ .option("--title-exact", "Require exact normalized title match for the full query string")
203
+ .option("--phrase-exact", "Require exact normalized phrase match in searchable text")
204
+ .option("--type <value>", "Filter by item type")
205
+ .option("--tag <value>", "Filter by tag")
206
+ .option("--priority <value>", "Filter by priority")
207
+ .option("--deadline-before <value>", "Filter by deadline upper bound (ISO/date string or relative)")
208
+ .option("--deadline-after <value>", "Filter by deadline lower bound (ISO/date string or relative)")
209
+ .option("--compact", "Render compact search hits (default; mutually exclusive with --full/--fields)")
210
+ .option("--full", "Render full search hits with nested item payloads (mutually exclusive with --compact/--fields)")
211
+ .option("--fields <value>", "Render custom comma-separated search hit fields (mutually exclusive with --compact/--full; valid: --fields id,title,score; invalid: --full --fields id,title)")
212
+ .option("--limit <n>", "Limit returned item count")
213
+ .action(async (keywords, options, command) => {
214
+ const globalOptions = getGlobalOptions(command);
215
+ const startedAt = Date.now();
216
+ const { runSearch } = await loadListQueryCommandsModule();
217
+ const searchOptions = normalizeSearchOptions(options);
218
+ const result = await runSearch(normalizeSearchKeywordsInput(keywords), {
219
+ ...searchOptions,
220
+ mode: typeof searchOptions.mode === "string" && searchOptions.mode.trim().length > 0
221
+ ? searchOptions.mode
222
+ : "keyword",
223
+ }, globalOptions);
224
+ printResult(result, globalOptions);
225
+ if (globalOptions.profile) {
226
+ printError(`profile:command=search took_ms=${Date.now() - startedAt}`);
227
+ }
228
+ });
229
+ }
230
+ if (shouldRegister("get")) {
231
+ program
232
+ .command("get")
233
+ .argument("<id>", "Item id")
234
+ .option("--depth <value>", "Detail depth: brief|standard|deep (default: deep)")
235
+ .option("--full", "Explicit full item read; equivalent to --depth deep (mutually exclusive with --depth/--fields)")
236
+ .option("--fields <value>", "Render custom comma-separated item metadata fields (for example: --fields id,title,status,parent,type)")
237
+ .description("Show item details by ID.")
238
+ .action(async (id, options, command) => {
239
+ const globalOptions = getGlobalOptions(command);
240
+ const startedAt = Date.now();
241
+ const { runGet } = await loadListQueryCommandsModule();
242
+ const result = await runGet(id, globalOptions, {
243
+ depth: typeof options.depth === "string" ? options.depth : undefined,
244
+ fields: typeof options.fields === "string" ? options.fields : undefined,
245
+ full: Boolean(options.full),
156
246
  });
157
- }
158
- if (globalOptions.profile) {
159
- printError(`profile:command=context took_ms=${Date.now() - startedAt}`);
160
- }
161
- });
162
- program
163
- .command("search")
164
- .argument("<keywords...>", "Keyword query tokens")
165
- .description("Search items with keyword, semantic, or hybrid retrieval.")
166
- .option("--mode <value>", "Search mode: keyword|semantic|hybrid (default: keyword)")
167
- .option("--semantic", "Shorthand for --mode semantic")
168
- .option("--hybrid", "Shorthand for --mode hybrid")
169
- .option("--include-linked", "Include linked files, docs, and tests in the searchable corpus")
170
- .option("--title-exact", "Require exact normalized title match for the full query string")
171
- .option("--phrase-exact", "Require exact normalized phrase match in searchable text")
172
- .option("--type <value>", "Filter by item type")
173
- .option("--tag <value>", "Filter by tag")
174
- .option("--priority <value>", "Filter by priority")
175
- .option("--deadline-before <value>", "Filter by deadline upper bound (ISO/date string or relative)")
176
- .option("--deadline-after <value>", "Filter by deadline lower bound (ISO/date string or relative)")
177
- .option("--compact", "Render compact search hits (default; mutually exclusive with --full/--fields)")
178
- .option("--full", "Render full search hits with nested item payloads (mutually exclusive with --compact/--fields)")
179
- .option("--fields <value>", "Render custom comma-separated search hit fields (mutually exclusive with --compact/--full; valid: --fields id,title,score; invalid: --full --fields id,title)")
180
- .option("--limit <n>", "Limit returned item count")
181
- .action(async (keywords, options, command) => {
182
- const globalOptions = getGlobalOptions(command);
183
- const startedAt = Date.now();
184
- const { runSearch } = await loadListQueryCommandsModule();
185
- const searchOptions = normalizeSearchOptions(options);
186
- const result = await runSearch(normalizeSearchKeywordsInput(keywords), {
187
- ...searchOptions,
188
- mode: typeof searchOptions.mode === "string" && searchOptions.mode.trim().length > 0
189
- ? searchOptions.mode
190
- : "keyword",
191
- }, globalOptions);
192
- printResult(result, globalOptions);
193
- if (globalOptions.profile) {
194
- printError(`profile:command=search took_ms=${Date.now() - startedAt}`);
195
- }
196
- });
197
- program
198
- .command("get")
199
- .argument("<id>", "Item id")
200
- .option("--depth <value>", "Detail depth: brief|standard|deep (default: deep)")
201
- .option("--full", "Explicit full item read; equivalent to --depth deep (mutually exclusive with --depth/--fields)")
202
- .option("--fields <value>", "Render custom comma-separated item metadata fields (for example: --fields id,title,status,parent,type)")
203
- .description("Show item details by ID.")
204
- .action(async (id, options, command) => {
205
- const globalOptions = getGlobalOptions(command);
206
- const startedAt = Date.now();
207
- const { runGet } = await loadListQueryCommandsModule();
208
- const result = await runGet(id, globalOptions, {
209
- depth: typeof options.depth === "string" ? options.depth : undefined,
210
- fields: typeof options.fields === "string" ? options.fields : undefined,
211
- full: Boolean(options.full),
247
+ printResult(result, globalOptions);
248
+ if (globalOptions.profile) {
249
+ printError(`profile:command=get took_ms=${Date.now() - startedAt}`);
250
+ }
212
251
  });
213
- printResult(result, globalOptions);
214
- if (globalOptions.profile) {
215
- printError(`profile:command=get took_ms=${Date.now() - startedAt}`);
216
- }
217
- });
218
- program
219
- .command("history")
220
- .argument("<id>", "Item id")
221
- .option("--limit <n>", "Return only the latest n history entries")
222
- .option("--compact", "Condensed output: show entry index, timestamp, op, author, patch count, and changed fields")
223
- .option("--full", "Show full history entries with JSON Patch payloads")
224
- .option("--diff", "Include per-entry changed field summaries from history patches")
225
- .option("--verify", "Verify hash chain and replay integrity for the full history stream")
226
- .description("Show item history entries.")
227
- .action(async (id, options, command) => {
228
- const globalOptions = getGlobalOptions(command);
229
- const startedAt = Date.now();
230
- if (options.compact === true && options.full === true) {
231
- throw new PmCliError("History projection options are mutually exclusive. Use either --compact or --full.", EXIT_CODE.USAGE);
232
- }
233
- const { runHistory } = await loadListQueryCommandsModule();
234
- const result = await runHistory(id, {
235
- limit: typeof options.limit === "string" ? options.limit : undefined,
236
- compact: options.full === true ? false : true,
237
- diff: Boolean(options.diff),
238
- verify: Boolean(options.verify),
239
- }, globalOptions);
240
- printResult(result, globalOptions);
241
- if (globalOptions.profile) {
242
- printError(`profile:command=history took_ms=${Date.now() - startedAt}`);
243
- }
244
- });
245
- program
246
- .command("activity")
247
- .option("--id <value>", "Filter by item ID")
248
- .option("--op <value>", "Filter by history operation")
249
- .option("--author <value>", "Filter by history author")
250
- .option("--from <value>", "Lower timestamp bound (ISO/date string or relative)")
251
- .option("--to <value>", "Upper timestamp bound (ISO/date string or relative)")
252
- .option("--limit <n>", "Return only the latest n activity entries")
253
- .option("--compact", "Condensed output: show only id, op, ts, author, msg per entry")
254
- .option("--full", "Show full activity entries with JSON Patch payloads")
255
- .option("--stream [mode]", "Emit line-delimited JSON rows (requires --json). Optional mode: rows|ndjson|jsonl")
256
- .description("Show recent activity across items.")
257
- .action(async (options, command) => {
258
- const globalOptions = getGlobalOptions(command);
259
- const startedAt = Date.now();
260
- if (options.compact === true && options.full === true) {
261
- throw new PmCliError("Activity projection options are mutually exclusive. Use either --compact or --full.", EXIT_CODE.USAGE);
262
- }
263
- const normalized = normalizeActivityOptions(options);
264
- const { runActivity } = await loadListQueryCommandsModule();
265
- const result = await runActivity(normalized, globalOptions);
266
- const streamMode = resolveActivityStreamMode(options.stream);
267
- if (streamMode && !globalOptions.json) {
268
- throw new PmCliError("--stream requires --json output mode.", EXIT_CODE.USAGE);
269
- }
270
- if (streamMode) {
271
- printActivityJsonStream(result, normalized, globalOptions);
272
- }
273
- else {
252
+ }
253
+ if (shouldRegister("history")) {
254
+ program
255
+ .command("history")
256
+ .argument("<id>", "Item id")
257
+ .option("--limit <n>", "Return only the latest n history entries")
258
+ .option("--compact", "Condensed output: show entry index, timestamp, op, author, patch count, and changed fields")
259
+ .option("--full", "Show full history entries with JSON Patch payloads")
260
+ .option("--diff", "Include per-entry changed field summaries from history patches")
261
+ .option("--verify", "Verify hash chain and replay integrity for the full history stream")
262
+ .description("Show item history entries.")
263
+ .action(async (id, options, command) => {
264
+ const globalOptions = getGlobalOptions(command);
265
+ const startedAt = Date.now();
266
+ if (options.compact === true && options.full === true) {
267
+ throw new PmCliError("History projection options are mutually exclusive. Use either --compact or --full.", EXIT_CODE.USAGE);
268
+ }
269
+ const { runHistory } = await loadListQueryCommandsModule();
270
+ const result = await runHistory(id, {
271
+ limit: typeof options.limit === "string" ? options.limit : undefined,
272
+ compact: options.full === true ? false : true,
273
+ diff: Boolean(options.diff),
274
+ verify: Boolean(options.verify),
275
+ }, globalOptions);
274
276
  printResult(result, globalOptions);
275
- }
276
- if (globalOptions.profile) {
277
- printError(`profile:command=activity took_ms=${Date.now() - startedAt}`);
278
- }
279
- });
277
+ if (globalOptions.profile) {
278
+ printError(`profile:command=history took_ms=${Date.now() - startedAt}`);
279
+ }
280
+ });
281
+ }
282
+ if (shouldRegister("activity")) {
283
+ program
284
+ .command("activity")
285
+ .option("--id <value>", "Filter by item ID")
286
+ .option("--op <value>", "Filter by history operation")
287
+ .option("--author <value>", "Filter by history author")
288
+ .option("--from <value>", "Lower timestamp bound (ISO/date string or relative)")
289
+ .option("--to <value>", "Upper timestamp bound (ISO/date string or relative)")
290
+ .option("--limit <n>", "Return only the latest n activity entries")
291
+ .option("--compact", "Condensed output: show only id, op, ts, author, msg per entry")
292
+ .option("--full", "Show full activity entries with JSON Patch payloads")
293
+ .option("--stream [mode]", "Emit line-delimited JSON rows (requires --json). Optional mode: rows|ndjson|jsonl")
294
+ .description("Show recent activity across items.")
295
+ .action(async (options, command) => {
296
+ const globalOptions = getGlobalOptions(command);
297
+ const startedAt = Date.now();
298
+ if (options.compact === true && options.full === true) {
299
+ throw new PmCliError("Activity projection options are mutually exclusive. Use either --compact or --full.", EXIT_CODE.USAGE);
300
+ }
301
+ const normalized = normalizeActivityOptions(options);
302
+ const { runActivity } = await loadListQueryCommandsModule();
303
+ const result = await runActivity(normalized, globalOptions);
304
+ const streamMode = resolveActivityStreamMode(options.stream);
305
+ if (streamMode && !globalOptions.json) {
306
+ throw new PmCliError("--stream requires --json output mode.", EXIT_CODE.USAGE);
307
+ }
308
+ if (streamMode) {
309
+ printActivityJsonStream(result, normalized, globalOptions);
310
+ }
311
+ else {
312
+ printResult(result, globalOptions);
313
+ }
314
+ if (globalOptions.profile) {
315
+ printError(`profile:command=activity took_ms=${Date.now() - startedAt}`);
316
+ }
317
+ });
318
+ }
280
319
  }
281
320
  //# sourceMappingURL=register-list-query.js.map
282
- //# debugId=f3123310-eac0-5611-ac12-ac8837d3702b
321
+ //# debugId=79117409-1ffd-53b1-948a-0ac6ac8d878a