@unbrained/pm-cli 2026.8.18 → 2026.8.20

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 (186) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +35 -2
  3. package/dist/cli/error-guidance.js +3 -2
  4. package/dist/cli/help-content.js +32 -13
  5. package/dist/cli/help-json-payload.d.ts +15 -0
  6. package/dist/cli/help-json-payload.js +101 -23
  7. package/dist/cli/main.js +6 -2
  8. package/dist/cli/register-list-query.js +18 -13
  9. package/dist/cli/register-mutation.js +8 -8
  10. package/dist/cli/register-operations.js +6 -6
  11. package/dist/cli/register-structured-mutation.d.ts +2 -0
  12. package/dist/cli/register-structured-mutation.js +29 -6
  13. package/dist/cli-bundle/bundle-manifest.json +151 -143
  14. package/dist/cli-bundle/chunks/{chunk-UYCLQVL2.js → chunk-2RDVGYWE.js} +12 -12
  15. package/dist/cli-bundle/chunks/{chunk-BSK2IN3C.js → chunk-4GB2LTOQ.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-RZQTVMRQ.js → chunk-7BRF2BX2.js} +2 -2
  17. package/dist/cli-bundle/chunks/chunk-BLVQHFSY.js +35 -0
  18. package/dist/cli-bundle/chunks/chunk-CU25EQVV.js +5 -0
  19. package/dist/cli-bundle/chunks/chunk-K3EN3LK2.js +2 -0
  20. package/dist/cli-bundle/chunks/{chunk-YRGOLZA7.js → chunk-L4LGPBJU.js} +49 -49
  21. package/dist/cli-bundle/chunks/chunk-RS3IV2R6.js +197 -0
  22. package/dist/cli-bundle/chunks/chunk-TSMWLCHS.js +3 -0
  23. package/dist/cli-bundle/chunks/chunk-US2ZQW2M.js +77 -0
  24. package/dist/cli-bundle/chunks/{chunk-5UZZAJKR.js → chunk-XYDDWBZN.js} +2 -2
  25. package/dist/cli-bundle/chunks/register-list-query-JSAQCVOC.js +11 -0
  26. package/dist/cli-bundle/chunks/register-mutation-XJPAW63D.js +20 -0
  27. package/dist/cli-bundle/chunks/register-operations-DSOSB2XQ.js +2 -0
  28. package/dist/cli-bundle/chunks/{register-setup-PPPEF3SN.js → register-setup-QUR6QL2C.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/chunk-325UXIO7.js +2 -0
  30. package/dist/cli-bundle/focused-chunks/chunk-5L7M4AI7.js +2 -0
  31. package/dist/cli-bundle/focused-chunks/{chunk-ODOVCP45.js → chunk-6AHG2YW7.js} +44 -44
  32. package/dist/cli-bundle/focused-chunks/chunk-AZBACT5T.js +2 -0
  33. package/dist/cli-bundle/focused-chunks/{chunk-TN4AE665.js → chunk-BLJCGGID.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/chunk-FUREQLQN.js +18 -0
  35. package/dist/cli-bundle/focused-chunks/{chunk-M62NO7EI.js → chunk-G3C5ERXG.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-K43KKAFS.js → chunk-GXWQBE3T.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-UI6AJ5TD.js → chunk-JWKEDZJI.js} +3 -3
  38. package/dist/cli-bundle/focused-chunks/chunk-KYZ6JGPL.js +155 -0
  39. package/dist/cli-bundle/focused-chunks/{chunk-EX6MKP2X.js → chunk-M32HFIQB.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-EUEGXZ2A.js → chunk-OM65KHGF.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/chunk-Q47EX4DI.js +2 -0
  42. package/dist/cli-bundle/focused-chunks/{chunk-V5XTGLK7.js → chunk-RIHDMCUM.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/chunk-T4ZFY7ZJ.js +16 -0
  44. package/dist/cli-bundle/focused-chunks/chunk-TDR5OGG3.js +2 -0
  45. package/dist/cli-bundle/focused-chunks/chunk-UGSS4F5X.js +2 -0
  46. package/dist/cli-bundle/focused-chunks/chunk-Z3PLWSGM.js +2 -0
  47. package/dist/cli-bundle/main.js +13 -13
  48. package/dist/cli-bundle/sdk-authoring.js +1 -1
  49. package/dist/cli-bundle/sdk-contracts.js +2 -1
  50. package/dist/cli-bundle/sdk-core.js +41 -41
  51. package/dist/cli-bundle/sdk-governance.js +1 -1
  52. package/dist/cli-bundle/sdk-graph.js +1 -1
  53. package/dist/cli-bundle/sdk-merge.js +32 -32
  54. package/dist/cli-bundle/sdk-query.js +1 -1
  55. package/dist/cli-bundle/sdk-runtime.js +1 -1
  56. package/dist/cli-bundle/sdk-testing.js +1 -1
  57. package/dist/cli-bundle/sdk.js +5 -4
  58. package/dist/core/output/mutation-projection.js +26 -2
  59. package/dist/core/shared/constants.d.ts +1 -5
  60. package/dist/core/shared/constants.js +3 -81
  61. package/dist/core/shared/errors.d.ts +2 -0
  62. package/dist/core/shared/errors.js +2 -2
  63. package/dist/core/shared/item-metadata-contract.d.ts +14 -0
  64. package/dist/core/shared/item-metadata-contract.js +90 -0
  65. package/dist/core/store/item-store.d.ts +60 -0
  66. package/dist/core/store/item-store.js +22 -5
  67. package/dist/sdk/agent/closed-domain-contracts.d.ts +25 -0
  68. package/dist/sdk/agent/closed-domain-contracts.js +140 -0
  69. package/dist/sdk/agent/refusal-closure.d.ts +53 -0
  70. package/dist/sdk/agent/refusal-closure.js +134 -0
  71. package/dist/sdk/agent/refusal-reachability.d.ts +27 -1
  72. package/dist/sdk/agent/refusal-reachability.js +26 -2
  73. package/dist/sdk/agent-capability-contracts.d.ts +13 -0
  74. package/dist/sdk/agent-capability-contracts.js +101 -9
  75. package/dist/sdk/cli-contracts/command-aliases.js +18 -2
  76. package/dist/sdk/cli-contracts/commander-mutation-options.js +30 -6
  77. package/dist/sdk/cli-contracts/commander-types.js +5 -4
  78. package/dist/sdk/cli-contracts/completeness.js +8 -2
  79. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -2
  80. package/dist/sdk/cli-contracts/enum-contracts.js +16 -6
  81. package/dist/sdk/cli-contracts/flag-contracts.d.ts +7 -0
  82. package/dist/sdk/cli-contracts/flag-contracts.js +84 -8
  83. package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +72 -0
  84. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +340 -0
  85. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +83 -2
  86. package/dist/sdk/cli-contracts/grammar-contracts.js +618 -2
  87. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +15 -4
  88. package/dist/sdk/cli-contracts/runtime-contracts.js +47 -13
  89. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +28 -1
  90. package/dist/sdk/cli-contracts/tool-option-contracts.js +38 -3
  91. package/dist/sdk/cli-contracts/tool-schema.js +7 -2
  92. package/dist/sdk/cli-contracts.d.ts +4 -3
  93. package/dist/sdk/cli-contracts.js +6 -5
  94. package/dist/sdk/context-intent-contracts.d.ts +2 -2
  95. package/dist/sdk/context-intent-contracts.js +22 -7
  96. package/dist/sdk/contracts.d.ts +3 -0
  97. package/dist/sdk/contracts.js +5 -2
  98. package/dist/sdk/core.d.ts +1 -1
  99. package/dist/sdk/core.js +3 -3
  100. package/dist/sdk/flag-invocation-contracts.d.ts +37 -0
  101. package/dist/sdk/flag-invocation-contracts.js +218 -9
  102. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +206 -2
  103. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +244 -40
  104. package/dist/sdk/index.d.ts +11 -7
  105. package/dist/sdk/index.js +10 -6
  106. package/dist/sdk/init-agent-guidance.d.ts +5 -3
  107. package/dist/sdk/init-agent-guidance.js +69 -9
  108. package/dist/sdk/lifecycle/mcp-actions.d.ts +18 -0
  109. package/dist/sdk/lifecycle/mcp-actions.js +52 -0
  110. package/dist/sdk/lifecycle/reopen.d.ts +44 -0
  111. package/dist/sdk/lifecycle/reopen.js +69 -0
  112. package/dist/sdk/lifecycle/update.d.ts +31 -0
  113. package/dist/sdk/lifecycle/update.js +95 -13
  114. package/dist/sdk/output-projection.d.ts +2 -0
  115. package/dist/sdk/output-projection.js +11 -5
  116. package/dist/sdk/query/get.d.ts +1 -1
  117. package/dist/sdk/query/get.js +34 -49
  118. package/dist/sdk/query/list.d.ts +7 -21
  119. package/dist/sdk/query/list.js +44 -44
  120. package/dist/sdk/query/projection-contracts.d.ts +33 -0
  121. package/dist/sdk/query/projection-contracts.js +185 -0
  122. package/dist/sdk/query/search-contracts.d.ts +3 -2
  123. package/dist/sdk/query/search-contracts.js +30 -85
  124. package/dist/sdk/query/search.d.ts +15 -0
  125. package/dist/sdk/query/search.js +32 -6
  126. package/dist/sdk/read-output/continuation.d.ts +1 -1
  127. package/dist/sdk/read-output/continuation.js +7 -24
  128. package/dist/sdk/read-output-contracts.js +55 -6
  129. package/dist/sdk/read-output-rows.d.ts +4 -0
  130. package/dist/sdk/read-output-rows.js +47 -18
  131. package/dist/sdk/runtime-primitives.d.ts +1 -1
  132. package/dist/sdk/runtime-primitives.js +3 -3
  133. package/dist/sdk/runtime.d.ts +6 -0
  134. package/dist/sdk/runtime.js +25 -17
  135. package/dist/sdk/similarity.d.ts +13 -0
  136. package/dist/sdk/similarity.js +32 -6
  137. package/dist/sdk/workspace-snapshot.d.ts +2 -0
  138. package/dist/sdk/workspace-snapshot.js +10 -2
  139. package/docs/COMMANDS.md +29 -5
  140. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +11 -2
  141. package/docs/README.md +1 -0
  142. package/docs/READ_OUTPUT_CONTRACTS.md +10 -6
  143. package/docs/RECURRENCE_RECOVERY_CONTRACTS.md +114 -0
  144. package/docs/SDK.md +16 -2
  145. package/docs/SDK_CONTEXT_INTEGRITY.md +45 -0
  146. package/docs/TESTING.md +14 -1
  147. package/docs/generated/AGENT_COMMAND_SURFACE.md +78 -78
  148. package/docs/generated/FLAG_LEXICON_BUDGETS.md +76 -0
  149. package/docs/performance/sdk-entrypoint-import-costs.md +14 -21
  150. package/marketplace.json +2 -2
  151. package/package.json +9 -7
  152. package/packages/pm-beads/package.json +1 -1
  153. package/packages/pm-calendar/package.json +1 -1
  154. package/packages/pm-command-kit/package.json +1 -1
  155. package/packages/pm-digital-twin/package.json +1 -1
  156. package/packages/pm-governance-audit/package.json +1 -1
  157. package/packages/pm-guide-shell/package.json +1 -1
  158. package/packages/pm-kanban/package.json +1 -1
  159. package/packages/pm-lifecycle-hooks/package.json +1 -1
  160. package/packages/pm-linked-test-adapters/package.json +1 -1
  161. package/packages/pm-search-advanced/package.json +1 -1
  162. package/packages/pm-templates/package.json +1 -1
  163. package/packages/pm-todos/package.json +1 -1
  164. package/packages/pm-vcs/package.json +1 -1
  165. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  166. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  167. package/scripts/generate-agent-capability-surfaces.mjs +20 -14
  168. package/sdk/public-surface.json +950 -24
  169. package/dist/cli-bundle/chunks/chunk-ALDJGKAK.js +0 -2
  170. package/dist/cli-bundle/chunks/chunk-DY4DMUMC.js +0 -197
  171. package/dist/cli-bundle/chunks/chunk-GNFAFIJI.js +0 -77
  172. package/dist/cli-bundle/chunks/chunk-L5Q2CLPE.js +0 -35
  173. package/dist/cli-bundle/chunks/chunk-PVRUN5ZS.js +0 -5
  174. package/dist/cli-bundle/chunks/chunk-SARFF5H5.js +0 -3
  175. package/dist/cli-bundle/chunks/register-list-query-I23LALEE.js +0 -11
  176. package/dist/cli-bundle/chunks/register-mutation-6YGU3GPH.js +0 -20
  177. package/dist/cli-bundle/chunks/register-operations-4HTFC6J7.js +0 -2
  178. package/dist/cli-bundle/focused-chunks/chunk-2PN4TJXH.js +0 -2
  179. package/dist/cli-bundle/focused-chunks/chunk-3TKWMNKF.js +0 -18
  180. package/dist/cli-bundle/focused-chunks/chunk-5AF3ZBNB.js +0 -155
  181. package/dist/cli-bundle/focused-chunks/chunk-C5IW2NDA.js +0 -2
  182. package/dist/cli-bundle/focused-chunks/chunk-RNDNMARJ.js +0 -16
  183. package/dist/cli-bundle/focused-chunks/chunk-TVV2DONO.js +0 -2
  184. package/dist/cli-bundle/focused-chunks/chunk-WGHQVU6P.js +0 -2
  185. package/dist/cli-bundle/focused-chunks/chunk-XYNBXTDQ.js +0 -2
  186. package/dist/cli-bundle/focused-chunks/chunk-Z56ECT7I.js +0 -2
@@ -1,5 +1,5 @@
1
1
 
2
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7feb0fe0-386c-56dc-afe1-e7b4ce1bc95a")}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]="07f3212f-c6d3-534e-8273-fae43a8fca18")}catch(e){}}();
3
3
  import { resolveBodyFileContent, EXIT_CODE, splitCommaList, PmCliError, createUnknownSubcommandError, } from "../sdk/runtime-primitives.js";
4
4
  import { CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, PLAN_CREATE_METADATA_PARAMETER_KEYS, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, } from "../sdk/cli-contracts.js";
5
5
  import { BUILTIN_ITEM_TYPE_VALUES, PLAN_STEP_LINK_KIND_VALUES, } from "../types/index.js";
@@ -1233,7 +1233,7 @@ async function runDepsAction(id, options, command) {
1233
1233
  export function registerMutationCommands(program, registrationOptions = {}) {
1234
1234
  const createCommand = program
1235
1235
  .command("create")
1236
- .argument("[typeOrTitle]", 'Item title, or item type when a title follows (e.g. `pm create task "Fix bug"`)')
1236
+ .argument("[type-or-title]", 'Item title, or item type when a title follows (e.g. `pm create task "Fix bug"`)')
1237
1237
  .argument("[title]", "Item title when the first argument is an item type")
1238
1238
  .description("Create a new project management item.");
1239
1239
  registerCommanderOptionContracts(createCommand, CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS);
@@ -1530,10 +1530,10 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1530
1530
  const planCommand = program
1531
1531
  .command("plan")
1532
1532
  .description("Agent-optimized Plan item workflow: create, manage steps, link dependencies, approve, and materialize.")
1533
- .argument("[subcommand]", "Plan subcommand: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize")
1533
+ .argument("[subcommand]", "Required; Plan subcommand: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize")
1534
1534
  .argument("[id]", "Plan id (required for non-create subcommands); for create this may be the positional title")
1535
- .argument("[stepRef]", "Step reference: stable id (plan-step-001) or order integer")
1536
- .argument("[reorderTo]", "New order integer for reorder-step")
1535
+ .argument("[step]", "Step reference: stable id (plan-step-001) or order integer")
1536
+ .argument("[new-order]", "New order integer for reorder-step")
1537
1537
  .option("--title <value>", "Plan title")
1538
1538
  .option("--description <value>", "Plan description")
1539
1539
  .option("--scope <value>", "Short scope statement of the target change or investigation")
@@ -1740,7 +1740,7 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1740
1740
  .action(runMergeAction);
1741
1741
  const schemaCommand = program
1742
1742
  .command("schema")
1743
- .argument("[subcommand]", "Schema subcommand: list, show, show-status, add/remove type/status/field, rename-type, rename-field, remap-status, or a custom item type name shorthand")
1743
+ .argument("[subcommand]", "Required; Schema subcommand: list, show, show-status, add/remove type/status/field, rename-type, rename-field, remap-status, or a custom item type name shorthand")
1744
1744
  .argument("[name]", "Definition name, or source name for rename/remap migrations")
1745
1745
  .option("--description <text>", "Human description for the custom item type, status, or field")
1746
1746
  .option("--default-status <status>", "Default status hint recorded for the custom item type")
@@ -1770,7 +1770,7 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1770
1770
  schemaCommand.action(runSchemaAction);
1771
1771
  const profileCommand = program
1772
1772
  .command("profile")
1773
- .argument("[subcommand]", "Profile subcommand: list, show, apply, or lint")
1773
+ .argument("[subcommand]", "Required; Profile subcommand: list, show, apply, or lint")
1774
1774
  .argument("[name]", "Profile name for show/apply/lint: agile, ops, or research")
1775
1775
  .option("--dry-run", "Preview the apply diff without writing any files (apply)")
1776
1776
  .option("--author <value>", "Mutation author")
@@ -1840,4 +1840,4 @@ export function registerMutationCommands(program, registrationOptions = {}) {
1840
1840
  .action(runDepsAction);
1841
1841
  }
1842
1842
  //# sourceMappingURL=register-mutation.js.map
1843
- //# debugId=7feb0fe0-386c-56dc-afe1-e7b4ce1bc95a
1843
+ //# debugId=07f3212f-c6d3-534e-8273-fae43a8fca18
@@ -1,9 +1,9 @@
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]="dec5fb7d-416f-5da6-bd97-c05c25dbf769")}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]="975321a1-0375-5829-a012-f23e32e9c6bf")}catch(e){}}();
3
3
  import { resolveRuntimeStatusRegistry, setActiveCommandResult, EXIT_CODE, PmCliError, createUnknownSubcommandError, resolveAuthor, resolvePmRoot, readSettings, } from "../sdk/runtime-primitives.js";
4
4
  import { resolveStartTaskInProgressStatus } from "../sdk/start-task-status.js";
5
5
  import { parseStatsAnalyticsJson } from "./stats-analytics-json.js";
6
- import { createWorkspaceSnapshot, deleteWorkspaceSnapshot, inspectWorkspaceSnapshot, listWorkspaceSnapshots, planWorkspaceSnapshotRestore, restoreWorkspaceSnapshotWithRecovery, } from "../sdk/workspace-snapshot.js";
6
+ import { createWorkspaceSnapshot, deleteWorkspaceSnapshot, inspectWorkspaceSnapshot, listWorkspaceSnapshots, planWorkspaceSnapshotRestore, restoreWorkspaceSnapshotWithRecovery, WORKSPACE_SNAPSHOT_ACTIONS, } from "../sdk/workspace-snapshot.js";
7
7
  import { runClaim, runClaimNext, runRelease } from "./commands/claim.js";
8
8
  import { runClose } from "./commands/close.js";
9
9
  import { runContracts } from "./commands/contracts.js";
@@ -380,11 +380,11 @@ async function runWorkspaceSnapshotAction(action, target, options, command) {
380
380
  const globalOptions = getGlobalOptions(command);
381
381
  const pmRoot = resolvePmRoot(process.cwd(), globalOptions.path);
382
382
  const normalizedAction = action.trim().toLowerCase();
383
- if (!["create", "list", "inspect", "restore", "delete"].includes(normalizedAction)) {
383
+ if (!WORKSPACE_SNAPSHOT_ACTIONS.some((entry) => entry === normalizedAction)) {
384
384
  throw createUnknownSubcommandError({
385
385
  command_path: "workspace snapshot",
386
386
  token: action,
387
- allowed: ["create", "list", "inspect", "restore", "delete"],
387
+ allowed: WORKSPACE_SNAPSHOT_ACTIONS,
388
388
  display_name: "workspace snapshot",
389
389
  token_kind: "action",
390
390
  examples: [
@@ -606,7 +606,7 @@ export function registerOperationCommands(program) {
606
606
  });
607
607
  program
608
608
  .command("telemetry")
609
- .argument("[namespaceOrSubcommand]", "Telemetry subcommand: status, flush, stats, clear (default: status)")
609
+ .argument("[namespace-or-subcommand]", "Telemetry subcommand: status, flush, stats, clear (default: status)")
610
610
  .argument("[subcommand]", "Compatibility alias target for local-analytics: status, flush, stats, clear")
611
611
  .option("--limit <n>", "Maximum command groups returned by telemetry stats")
612
612
  .description("Inspect and manage local telemetry queue/runtime state.")
@@ -873,4 +873,4 @@ function registerSchedulingShortcutCommands(program) {
873
873
  });
874
874
  }
875
875
  //# sourceMappingURL=register-operations.js.map
876
- //# debugId=dec5fb7d-416f-5da6-bd97-c05c25dbf769
876
+ //# debugId=975321a1-0375-5829-a012-f23e32e9c6bf
@@ -4,6 +4,7 @@
4
4
  * Registers the noun-first CLI adapter for public SDK atomic item mutations.
5
5
  */
6
6
  import type { Command } from "commander";
7
+ declare function runItemReopenAction(id: string, reason: string, options: Record<string, unknown>, command: Command): Promise<void>;
7
8
  declare function runItemMutateAction(options: Record<string, unknown>, command: Command): Promise<void>;
8
9
  declare function runItemCompleteAction(id: string, positionalReason: string | undefined, options: Record<string, unknown>, command: Command): Promise<void>;
9
10
  /** Register `pm item mutate`, the stable noun-first atomic batch surface. */
@@ -12,5 +13,6 @@ export declare function registerStructuredMutationCommands(program: Command): vo
12
13
  export declare const structuredMutationTestOnly: {
13
14
  runItemCompleteAction: typeof runItemCompleteAction;
14
15
  runItemMutateAction: typeof runItemMutateAction;
16
+ runItemReopenAction: typeof runItemReopenAction;
15
17
  };
16
18
  export {};
@@ -1,9 +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]="94fe3b7b-3aeb-5a31-a3a5-d85ae7e1ac83")}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]="3b23ded4-a821-5ff0-8783-927875d0457b")}catch(e){}}();
3
3
  import { createStdinTokenResolver, EXIT_CODE, PmCliError, readSettings, resolveAuthor, resolvePmRoot, } from "../sdk/runtime-primitives.js";
4
4
  import { buildItemCompletionMutations, commitItemCompletion, commitItemMutations, } from "../sdk/item-transaction.js";
5
+ import { runReopen } from "../sdk/lifecycle/reopen.js";
5
6
  import { parseAtomicMutationControls, resolveItemMutationDocument, } from "../sdk/structured-mutations.js";
6
- import { collect, getGlobalOptions, printResult, } from "./registration-helpers.js";
7
+ import { collect, getGlobalOptions, invalidateSearchCachesForMutation, printResult, } from "./registration-helpers.js";
8
+ async function runItemReopenAction(id, reason, options, command) {
9
+ const globalOptions = getGlobalOptions(command);
10
+ const result = await runReopen(id, reason, {
11
+ status: typeof options.status === "string" ? options.status : undefined,
12
+ author: typeof options.author === "string"
13
+ ? options.author
14
+ : globalOptions.author,
15
+ message: typeof options.message === "string" ? options.message : undefined,
16
+ force: options.force === true,
17
+ }, globalOptions);
18
+ await invalidateSearchCachesForMutation(globalOptions, result);
19
+ printResult(result, globalOptions);
20
+ }
7
21
  async function runItemMutateAction(options, command) {
8
22
  const globalOptions = getGlobalOptions(command);
9
23
  const input = await createStdinTokenResolver().resolveValue("-", "--stdin-json");
@@ -130,7 +144,15 @@ export function registerStructuredMutationCommands(program) {
130
144
  const itemCommand = program.commands.find((command) => command.name() === "item") ??
131
145
  program
132
146
  .command("item")
133
- .description("Run item lifecycle and mutation operations.");
147
+ .description("Run item lifecycle operations.");
148
+ itemCommand
149
+ .command("reopen <id> <reason>")
150
+ .option("--status <value>", "Active target status: open or in_progress")
151
+ .option("--message <value>", "Human-readable recurrence history message")
152
+ .option("--force", "Override ownership or stale-lock conflicts")
153
+ .option("--author <value>", "Mutation author")
154
+ .description("Reopen terminal work with recurrence evidence.")
155
+ .action(runItemReopenAction);
134
156
  itemCommand
135
157
  .command("mutate")
136
158
  .requiredOption("--transaction-id <value>", "Stable idempotency key used to resume an interrupted batch")
@@ -140,7 +162,7 @@ export function registerStructuredMutationCommands(program) {
140
162
  .option("--lock-ttl-seconds <n>", "Workspace transaction lock lifetime in seconds")
141
163
  .option("--lock-wait-ms <n>", "Maximum time to wait for the workspace transaction lock")
142
164
  .option("--author <value>", "Mutation author")
143
- .description("Apply create/update/close/release mutations atomically through the public pm SDK.")
165
+ .description("Apply SDK-backed mutations atomically.")
144
166
  .action(runItemMutateAction);
145
167
  itemCommand
146
168
  .command("complete <id> [reason]")
@@ -162,13 +184,14 @@ export function registerStructuredMutationCommands(program) {
162
184
  .option("--dry-run", "Validate and preview completion without writing")
163
185
  .option("--force", "Override lifecycle and ownership conflicts")
164
186
  .option("--author <value>", "Completion author")
165
- .description("Record evidence, close the item, and release its claim atomically.")
187
+ .description("Close with evidence and release the claim.")
166
188
  .action(runItemCompleteAction);
167
189
  }
168
190
  /** Internal action hooks used by exhaustive source-level registration tests. */
169
191
  export const structuredMutationTestOnly = {
170
192
  runItemCompleteAction,
171
193
  runItemMutateAction,
194
+ runItemReopenAction,
172
195
  };
173
196
  //# sourceMappingURL=register-structured-mutation.js.map
174
- //# debugId=94fe3b7b-3aeb-5a31-a3a5-d85ae7e1ac83
197
+ //# debugId=3b23ded4-a821-5ff0-8783-927875d0457b