@unbrained/pm-cli 2026.8.4 → 2026.8.5

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 (214) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +39 -13
  3. package/dist/cli/error-guidance.js +4 -4
  4. package/dist/cli/register-structured-mutation.d.ts +2 -0
  5. package/dist/cli/register-structured-mutation.js +124 -12
  6. package/dist/cli-bundle/bundle-manifest.json +407 -407
  7. package/dist/cli-bundle/chunks/append-VXXGOXSG.js +2 -0
  8. package/dist/cli-bundle/chunks/{chunk-QVO3VTA4.js → chunk-2WFXWAYX.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-NM5G7RLU.js → chunk-3FTILRJ2.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-VH2EAGUG.js → chunk-42E7YPLG.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-RB65T4RX.js → chunk-43HQQI6S.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-J4EPW4GT.js → chunk-45G53IU4.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-PQXEB7W4.js → chunk-4VN6GS4U.js} +2 -2
  14. package/dist/cli-bundle/chunks/chunk-4YUBDMQM.js +2 -0
  15. package/dist/cli-bundle/chunks/{chunk-D2MBVMVE.js → chunk-54FNT7U2.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-NRDKVOUE.js → chunk-5ZBOIPGP.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-3XZYTRPC.js → chunk-6MSQJOTG.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-GOICHIX4.js → chunk-7A5OT5J2.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-HTYC76A4.js → chunk-7C4PTJG6.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-BKMZTZYL.js → chunk-A62CYISG.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-5H47J5FG.js → chunk-BPELKUQD.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-HE3DZFN4.js → chunk-BXQLRKWF.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-BLINBTMX.js → chunk-CSI3WS5I.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-KH4GVBMC.js → chunk-DXDREUXT.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-KIKLF2W4.js → chunk-E2RKBKWB.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-377OOXUF.js → chunk-EGJ4JTUG.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-SULWTPQO.js → chunk-FPBQHMFT.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-V5K52PYW.js → chunk-GE4KCSZP.js} +35 -35
  29. package/dist/cli-bundle/chunks/{chunk-NPUJ7OLK.js → chunk-HNFD72UK.js} +2 -2
  30. package/dist/cli-bundle/chunks/{chunk-QMWUL66F.js → chunk-HWRRMBJO.js} +5 -5
  31. package/dist/cli-bundle/chunks/chunk-L3AZOELJ.js +2 -0
  32. package/dist/cli-bundle/chunks/{chunk-CGY5I2GO.js → chunk-LKDGK44W.js} +2 -2
  33. package/dist/cli-bundle/chunks/chunk-LN2WFEU4.js +2 -0
  34. package/dist/cli-bundle/chunks/{chunk-ZSH4GNBH.js → chunk-M72BKL5Q.js} +2 -2
  35. package/dist/cli-bundle/chunks/{chunk-HQ2WU7OY.js → chunk-MHK6LIWE.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-H6FITE7D.js → chunk-NE5VRDAI.js} +2 -2
  37. package/dist/cli-bundle/chunks/chunk-NY4T3JWN.js +2 -0
  38. package/dist/cli-bundle/chunks/{chunk-DCJ6CM6F.js → chunk-OMXVBQ2N.js} +2 -2
  39. package/dist/cli-bundle/chunks/chunk-OPVH7SKD.js +8 -0
  40. package/dist/cli-bundle/chunks/{chunk-CU5ENFNP.js → chunk-OTHLDSFP.js} +2 -2
  41. package/dist/cli-bundle/chunks/{chunk-NH35JNK5.js → chunk-PMXJEU3F.js} +2 -2
  42. package/dist/cli-bundle/chunks/{chunk-SVDH5CHC.js → chunk-Q35VBGOQ.js} +4 -4
  43. package/dist/cli-bundle/chunks/{chunk-5PZGZMPG.js → chunk-R546TPDE.js} +2 -2
  44. package/dist/cli-bundle/chunks/{chunk-Q5F6OI7C.js → chunk-RKAVWO3O.js} +2 -2
  45. package/dist/cli-bundle/chunks/{chunk-JMKVCQSE.js → chunk-SSF4PIUR.js} +2 -2
  46. package/dist/cli-bundle/chunks/{chunk-PA5XRN2A.js → chunk-UN66FZRO.js} +3 -3
  47. package/dist/cli-bundle/chunks/{chunk-FQ4EFFDU.js → chunk-UP7DTVMD.js} +2 -2
  48. package/dist/cli-bundle/chunks/{chunk-NFF3JAQR.js → chunk-UZBWIUYD.js} +2 -2
  49. package/dist/cli-bundle/chunks/{chunk-2POYGY53.js → chunk-V3774P7D.js} +2 -2
  50. package/dist/cli-bundle/chunks/{chunk-B5ZLCD5Z.js → chunk-V3EUXXOF.js} +2 -2
  51. package/dist/cli-bundle/chunks/{chunk-6S7I3UKV.js → chunk-VCKLFEUN.js} +19 -19
  52. package/dist/cli-bundle/chunks/{chunk-PYYPQLHC.js → chunk-VN5VITU3.js} +2 -2
  53. package/dist/cli-bundle/chunks/chunk-WRL4KNDL.js +20 -0
  54. package/dist/cli-bundle/chunks/{chunk-UJHUR3LZ.js → chunk-XCEZYMNI.js} +2 -2
  55. package/dist/cli-bundle/chunks/{chunk-JDPKBV5P.js → chunk-YEWNL576.js} +2 -2
  56. package/dist/cli-bundle/chunks/{chunk-OB7TRZ2G.js → chunk-YSO3YFZ4.js} +2 -2
  57. package/dist/cli-bundle/chunks/{chunk-UVZREFZU.js → chunk-ZYHOB3SN.js} +2 -2
  58. package/dist/cli-bundle/chunks/close-VZ3OQPN5.js +2 -0
  59. package/dist/cli-bundle/chunks/close-many-SB4TI27P.js +2 -0
  60. package/dist/cli-bundle/chunks/comments-BIF3Q4KY.js +2 -0
  61. package/dist/cli-bundle/chunks/copy-6AI5Z57X.js +2 -0
  62. package/dist/cli-bundle/chunks/{create-RLLCBCXM.js → create-XLKTXTUF.js} +2 -2
  63. package/dist/cli-bundle/chunks/delete-ZY2VHQTP.js +2 -0
  64. package/dist/cli-bundle/chunks/{deps-J4ONTF4X.js → deps-ITTY3GIC.js} +2 -2
  65. package/dist/cli-bundle/chunks/{docs-YL2DJ4WD.js → docs-W4OSRTYR.js} +2 -2
  66. package/dist/cli-bundle/chunks/{files-NGNAIYKK.js → files-EOK4AZI4.js} +2 -2
  67. package/dist/cli-bundle/chunks/focus-DLBNWL7L.js +2 -0
  68. package/dist/cli-bundle/chunks/{history-compact-HW62K5XP.js → history-compact-7UGTMLL3.js} +2 -2
  69. package/dist/cli-bundle/chunks/{history-redact-HVBKUJOW.js → history-redact-4DZRMD6Z.js} +2 -2
  70. package/dist/cli-bundle/chunks/{history-repair-OPNBH5JJ.js → history-repair-UPOSZW5R.js} +2 -2
  71. package/dist/cli-bundle/chunks/{learnings-F36PZXT6.js → learnings-GMRNCBS3.js} +2 -2
  72. package/dist/cli-bundle/chunks/{profile-N3XMWBM7.js → profile-2MUUMHRE.js} +2 -2
  73. package/dist/cli-bundle/chunks/{register-list-query-BKGHBI7Y.js → register-list-query-LR3SQ5ZF.js} +2 -2
  74. package/dist/cli-bundle/chunks/register-mutation-SUOHFVWM.js +20 -0
  75. package/dist/cli-bundle/chunks/register-operations-ARRRKOVN.js +2 -0
  76. package/dist/cli-bundle/chunks/{register-setup-KWV6UD77.js → register-setup-O6AYP6NP.js} +2 -2
  77. package/dist/cli-bundle/chunks/restore-ZVCVHTB5.js +2 -0
  78. package/dist/cli-bundle/chunks/{schema-4PJQMGUY.js → schema-FJ4EA3XF.js} +2 -2
  79. package/dist/cli-bundle/chunks/update-YHV52CSS.js +2 -0
  80. package/dist/cli-bundle/chunks/update-many-M6YHVNXM.js +2 -0
  81. package/dist/cli-bundle/focused-chunks/chunk-7J5TUBUJ.js +153 -0
  82. package/dist/cli-bundle/focused-chunks/{chunk-ONIX2KKW.js → chunk-A7BJ5SS6.js} +2 -2
  83. package/dist/cli-bundle/focused-chunks/chunk-B7LJWAZE.js +2 -0
  84. package/dist/cli-bundle/focused-chunks/{chunk-QM2BIVK7.js → chunk-BIMTMOS7.js} +3 -3
  85. package/dist/cli-bundle/focused-chunks/{chunk-BOGRY7M6.js → chunk-FGKY4MBE.js} +10 -10
  86. package/dist/cli-bundle/focused-chunks/chunk-G6ETT4QK.js +2 -0
  87. package/dist/cli-bundle/focused-chunks/{chunk-C2QSL62X.js → chunk-GJ2TG2CW.js} +2 -2
  88. package/dist/cli-bundle/focused-chunks/{chunk-RO5BQFG3.js → chunk-IPWSFADF.js} +2 -2
  89. package/dist/cli-bundle/focused-chunks/{chunk-UFCPSWIL.js → chunk-MJ7HWSFK.js} +2 -2
  90. package/dist/cli-bundle/focused-chunks/{chunk-2VIIXOAD.js → chunk-N5XU5UVK.js} +2 -2
  91. package/dist/cli-bundle/focused-chunks/chunk-PG2RIZBX.js +2 -0
  92. package/dist/cli-bundle/focused-chunks/{chunk-OYTK4VNH.js → chunk-PIMMYG7Q.js} +2 -2
  93. package/dist/cli-bundle/focused-chunks/{chunk-K37BB4JL.js → chunk-QVHKCI4T.js} +2 -2
  94. package/dist/cli-bundle/focused-chunks/{chunk-SQXVGHMH.js → chunk-RUR5I3TK.js} +2 -2
  95. package/dist/cli-bundle/focused-chunks/chunk-SV3O7TSH.js +8 -0
  96. package/dist/cli-bundle/focused-chunks/{chunk-L6A4NVQC.js → chunk-UIL2M2NA.js} +2 -2
  97. package/dist/cli-bundle/focused-chunks/{chunk-WVGJAD7L.js → chunk-VLYOEYML.js} +2 -2
  98. package/dist/cli-bundle/focused-chunks/chunk-W7BJEWHX.js +2 -0
  99. package/dist/cli-bundle/focused-chunks/{chunk-DQ4PLKEE.js → chunk-WEM2E2PE.js} +2 -2
  100. package/dist/cli-bundle/focused-chunks/chunk-WVIVUWVL.js +5 -0
  101. package/dist/cli-bundle/focused-chunks/chunk-Y4LDYLLT.js +2 -0
  102. package/dist/cli-bundle/main.js +4 -4
  103. package/dist/cli-bundle/sdk-authoring.js +1 -1
  104. package/dist/cli-bundle/sdk-contracts.js +1 -1
  105. package/dist/cli-bundle/sdk-core.js +28 -28
  106. package/dist/cli-bundle/sdk-governance.js +1 -1
  107. package/dist/cli-bundle/sdk-graph.js +1 -1
  108. package/dist/cli-bundle/sdk-merge.js +1 -1
  109. package/dist/cli-bundle/sdk-query.js +1 -1
  110. package/dist/cli-bundle/sdk-runtime.js +1 -1
  111. package/dist/cli-bundle/sdk-testing.js +1 -1
  112. package/dist/cli-bundle/sdk.js +1 -1
  113. package/dist/core/extensions/loader.js +5 -2
  114. package/dist/core/item/item-format.js +14 -20
  115. package/dist/core/shared/constants.js +3 -2
  116. package/dist/core/store/item-store.js +2 -2
  117. package/dist/core/store/settings.js +2 -2
  118. package/dist/mcp/server.js +12 -6
  119. package/dist/mcp/tool-definitions.js +14 -7
  120. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +18 -18
  121. package/dist/sdk/cli-contracts/agent-output-contracts.js +51 -23
  122. package/dist/sdk/cli-contracts/commander-mutation-options.js +26 -2
  123. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  124. package/dist/sdk/cli-contracts/flag-contracts.js +28 -2
  125. package/dist/sdk/cli-contracts/registration-helpers.js +4 -2
  126. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +10 -2
  127. package/dist/sdk/cli-contracts/runtime-contracts.js +20 -5
  128. package/dist/sdk/cli-contracts/tool-schema.js +4 -2
  129. package/dist/sdk/cli-contracts.d.ts +2 -2
  130. package/dist/sdk/cli-contracts.js +4 -4
  131. package/dist/sdk/cli-program.js +3 -3
  132. package/dist/sdk/contracts.d.ts +1 -0
  133. package/dist/sdk/contracts.js +3 -2
  134. package/dist/sdk/dependency-provenance.d.ts +2 -0
  135. package/dist/sdk/dependency-provenance.js +7 -3
  136. package/dist/sdk/error-code-catalog.d.ts +23 -0
  137. package/dist/sdk/error-code-catalog.js +25 -5
  138. package/dist/sdk/generated-error-code-catalog.js +499 -3
  139. package/dist/sdk/graph/governance.js +3 -3
  140. package/dist/sdk/graph/remediation.js +3 -3
  141. package/dist/sdk/graph/run.js +4 -8
  142. package/dist/sdk/index.d.ts +2 -1
  143. package/dist/sdk/index.js +4 -3
  144. package/dist/sdk/item-transaction.d.ts +51 -6
  145. package/dist/sdk/item-transaction.js +132 -22
  146. package/dist/sdk/lifecycle/create.d.ts +4 -0
  147. package/dist/sdk/lifecycle/create.js +26 -10
  148. package/dist/sdk/lifecycle-policy.d.ts +9 -0
  149. package/dist/sdk/lifecycle-policy.js +22 -9
  150. package/dist/sdk/merge/driver.js +6 -3
  151. package/dist/sdk/output-contracts.d.ts +67 -0
  152. package/dist/sdk/output-contracts.js +173 -0
  153. package/dist/sdk/package-import-adapters.js +2 -2
  154. package/dist/sdk/structured-mutations.d.ts +23 -0
  155. package/dist/sdk/structured-mutations.js +219 -10
  156. package/dist/sdk/workspace-snapshot.js +58 -12
  157. package/dist/sdk/workspace.js +30 -4
  158. package/docs/COMMANDS.md +40 -10
  159. package/docs/EXTENSIONS.md +1 -1
  160. package/docs/MERGE_SAFETY.md +2 -0
  161. package/docs/PR_REVIEW_LOOP.md +10 -4
  162. package/docs/README.md +22 -22
  163. package/docs/RELEASING.md +3 -3
  164. package/docs/SCRIPTING.md +32 -9
  165. package/docs/SDK.md +91 -11
  166. package/docs/SELF_DESCRIBING_CONTEXT_CONTRACTS.md +13 -0
  167. package/docs/TESTING.md +25 -0
  168. package/docs/examples/sdk-contract-consumer/README.md +11 -1
  169. package/docs/examples/sdk-contract-consumer/package.json +2 -1
  170. package/docs/examples/sdk-contract-consumer/parse-receipt.mjs +22 -0
  171. package/marketplace.json +2 -2
  172. package/package.json +3 -2
  173. package/packages/pm-beads/package.json +1 -1
  174. package/packages/pm-calendar/package.json +1 -1
  175. package/packages/pm-command-kit/package.json +1 -1
  176. package/packages/pm-digital-twin/package.json +1 -1
  177. package/packages/pm-governance-audit/package.json +1 -1
  178. package/packages/pm-guide-shell/package.json +1 -1
  179. package/packages/pm-kanban/package.json +1 -1
  180. package/packages/pm-lifecycle-hooks/package.json +1 -1
  181. package/packages/pm-linked-test-adapters/package.json +1 -1
  182. package/packages/pm-search-advanced/package.json +1 -1
  183. package/packages/pm-templates/package.json +1 -1
  184. package/packages/pm-todos/package.json +1 -1
  185. package/packages/pm-vcs/package.json +1 -1
  186. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  187. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  188. package/sdk/public-surface.json +292 -14
  189. package/dist/cli-bundle/chunks/append-DHBRLHHS.js +0 -2
  190. package/dist/cli-bundle/chunks/chunk-2INN52SU.js +0 -8
  191. package/dist/cli-bundle/chunks/chunk-6RSK4IFN.js +0 -20
  192. package/dist/cli-bundle/chunks/chunk-ASJJKA57.js +0 -2
  193. package/dist/cli-bundle/chunks/chunk-IYAVULRN.js +0 -2
  194. package/dist/cli-bundle/chunks/chunk-RRQBHQOV.js +0 -2
  195. package/dist/cli-bundle/chunks/chunk-XBLOD5TZ.js +0 -2
  196. package/dist/cli-bundle/chunks/close-VLHNN6YB.js +0 -2
  197. package/dist/cli-bundle/chunks/close-many-LSJNZKU6.js +0 -2
  198. package/dist/cli-bundle/chunks/comments-AAIA6A6X.js +0 -2
  199. package/dist/cli-bundle/chunks/copy-Z7YMLEHN.js +0 -2
  200. package/dist/cli-bundle/chunks/delete-KNOHHQJM.js +0 -2
  201. package/dist/cli-bundle/chunks/focus-LFRCGALV.js +0 -2
  202. package/dist/cli-bundle/chunks/register-mutation-GU3DCECN.js +0 -20
  203. package/dist/cli-bundle/chunks/register-operations-PTWH727R.js +0 -2
  204. package/dist/cli-bundle/chunks/restore-4HZSLILR.js +0 -2
  205. package/dist/cli-bundle/chunks/update-E6LPS5IV.js +0 -2
  206. package/dist/cli-bundle/chunks/update-many-OSIC6KRO.js +0 -2
  207. package/dist/cli-bundle/focused-chunks/chunk-5MTKO7TV.js +0 -153
  208. package/dist/cli-bundle/focused-chunks/chunk-6GIZK7VQ.js +0 -2
  209. package/dist/cli-bundle/focused-chunks/chunk-AOP2WIZZ.js +0 -2
  210. package/dist/cli-bundle/focused-chunks/chunk-CL75YW32.js +0 -2
  211. package/dist/cli-bundle/focused-chunks/chunk-E7OFMWGT.js +0 -8
  212. package/dist/cli-bundle/focused-chunks/chunk-I5F5UK3Q.js +0 -2
  213. package/dist/cli-bundle/focused-chunks/chunk-T5TSY36R.js +0 -5
  214. package/dist/cli-bundle/focused-chunks/chunk-VT6BF2IX.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]="251ae2b0-10f4-528d-86b0-d224b126f8eb")}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]="76fa19c7-a421-5026-8de8-450285987c4e")}catch(e){}}();
3
3
  import { isTransitiveKind, orientTransitiveEdge, transitiveFamilyKey, } from "./analytics.js";
4
4
  /** Default bounded sample size applied to every finding family. */
5
5
  const DEFAULT_MAX_SAMPLE_SIZE = 25;
@@ -195,7 +195,7 @@ function collectOrderingFindings(assembly, nodeStates, isBlocked, maxSampleSize)
195
195
  return predecessorState === undefined || !predecessorState.terminal;
196
196
  }))
197
197
  .map((state) => state.id);
198
- appendFinding(findings, staleLifecycleBlocks, maxSampleSize, "stale_lifecycle_block", "warning", "A blocked lifecycle status must be backed by at least one open ordering predecessor.", (count) => `${count} status-blocked item(s) with no open blocker edge`, "Re-open the missing prerequisite as an edge, or move the item back to an active status.");
198
+ appendFinding(findings, staleLifecycleBlocks, maxSampleSize, "stale_lifecycle_block", "warning", "A blocked lifecycle status must be backed by at least one open ordering predecessor.", (count) => `${count} status-blocked item(s) with no open blocker edge`, 'Add a local blocker edge, declare an external blocker with --dep "id=<external-ref>,kind=blocked_by,source_kind=external", or move the item back to an active status.');
199
199
  return findings;
200
200
  }
201
201
  /** Format one duplicate-edge group as a compact deterministic evidence string. */
@@ -466,4 +466,4 @@ export function diffRelationshipAuditSnapshots(baseline, current) {
466
466
  };
467
467
  }
468
468
  //# sourceMappingURL=governance.js.map
469
- //# debugId=251ae2b0-10f4-528d-86b0-d224b126f8eb
469
+ //# debugId=76fa19c7-a421-5026-8de8-450285987c4e
@@ -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]="1f26594a-5843-556e-90b4-d733733f8828")}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]="9b8e22ad-6268-515d-994e-6b98a062ba93")}catch(e){}}();
3
3
  import { findRedundantRelationshipEdges } from "./analytics.js";
4
4
  import { auditWorkspaceRelationshipGraph, collectDuplicateRelationshipEdgeGroups, formatDuplicateEdgeGroup, } from "./governance.js";
5
5
  /** Per-finding-code operation template applied to every sampled subject. */
@@ -55,7 +55,7 @@ const FINDING_STEP_TEMPLATES = {
55
55
  stale_lifecycle_block: {
56
56
  op: "investigate",
57
57
  confidence: "medium",
58
- rationale: "Re-open the missing prerequisite as an ordering edge, or move the item back to an active status; only the holder's owner knows which is true.",
58
+ rationale: 'Add a local ordering edge, declare an external blocker with --dep "id=<external-ref>,kind=blocked_by,source_kind=external", or move the item back to an active status; only the holder\'s owner knows which is true.',
59
59
  },
60
60
  isolated_active_node: {
61
61
  op: "investigate",
@@ -155,4 +155,4 @@ export function planRelationshipRemediation(assembly, options = {}) {
155
155
  };
156
156
  }
157
157
  //# sourceMappingURL=remediation.js.map
158
- //# debugId=1f26594a-5843-556e-90b4-d733733f8828
158
+ //# debugId=9b8e22ad-6268-515d-994e-6b98a062ba93
@@ -11,7 +11,7 @@
11
11
  * queries in long-lived hosts are answered from the memoized snapshot.
12
12
  */
13
13
 
14
- !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]="ab1a6d49-f6e6-5a02-a948-8fd6e9be265a")}catch(e){}}();
14
+ !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]="0fbc54bf-3321-5c73-a351-5db01aab5544")}catch(e){}}();
15
15
  import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
16
16
  import { pathExists } from "../../core/fs/fs-utils.js";
17
17
  import { isTerminalStatus } from "../../core/item/status.js";
@@ -423,9 +423,7 @@ function runGraphSlack(invocation) {
423
423
  /** Execute the structural-centrality ranking subcommand. */
424
424
  function runGraphCentrality(invocation) {
425
425
  const limit = invocation.limit ?? DEFAULT_SAMPLE_LIMIT;
426
- const result = computeRelationshipCentrality(invocation.assembly.graph, {
427
- ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),
428
- });
426
+ const result = computeRelationshipCentrality(invocation.assembly.graph, invocation.kinds === undefined ? {} : { kinds: invocation.kinds });
429
427
  const analysis = result.value;
430
428
  return {
431
429
  subcommand: "centrality",
@@ -454,9 +452,7 @@ function runGraphCentrality(invocation) {
454
452
  /** Execute the articulation-point and bridge (cut-structure) subcommand. */
455
453
  function runGraphArticulation(invocation) {
456
454
  const limit = invocation.limit ?? DEFAULT_SAMPLE_LIMIT;
457
- const result = findRelationshipCutStructure(invocation.assembly.graph, {
458
- ...(invocation.kinds === undefined ? {} : { kinds: invocation.kinds }),
459
- });
455
+ const result = findRelationshipCutStructure(invocation.assembly.graph, invocation.kinds === undefined ? {} : { kinds: invocation.kinds });
460
456
  const { articulationPoints, bridges } = result.value;
461
457
  return {
462
458
  subcommand: "articulation",
@@ -717,4 +713,4 @@ export async function runGraph(subcommandRaw, id, target, options, global) {
717
713
  return attachGraphProjection(value, invocation.summary, "result_rows");
718
714
  }
719
715
  //# sourceMappingURL=run.js.map
720
- //# debugId=ab1a6d49-f6e6-5a02-a948-8fd6e9be265a
716
+ //# debugId=0fbc54bf-3321-5c73-a351-5db01aab5544
@@ -45,7 +45,7 @@ export { RESERVED_ITEM_FIELD_NAMES } from "../core/extensions/item-fields.js";
45
45
  export type { LocatedItem } from "../core/store/item-store.js";
46
46
  export { PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS, PM_PACKAGE_RESOURCE_KINDS, collectPackageExtensionDirectories, readPmPackageManifest, type PmPackageCatalogLinkMap, type PmPackageCatalogMediaMap, type PmPackageCatalogMetadata, type PmPackageManifest, type PmPackageResourceKind, type PmPackageResourceMap, } from "../core/packages/manifest.js";
47
47
  export type { CommanderOptionAliasContract, CommanderOptionRegistrationContract, } from "./cli-contracts.js";
48
- export { ACTIVITY_FLAG_CONTRACTS, ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, CLOSE_ACTION_OPTION_KEYS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, EVAL_FLAG_CONTRACTS, EVENT_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, EXTENSION_ACTIVATE_FLAG_CONTRACTS, EXTENSION_ADOPT_ALL_FLAG_CONTRACTS, EXTENSION_ADOPT_FLAG_CONTRACTS, EXTENSION_CATALOG_FLAG_CONTRACTS, EXTENSION_DEACTIVATE_FLAG_CONTRACTS, EXTENSION_DESCRIBE_FLAG_CONTRACTS, EXTENSION_DOCTOR_FLAG_CONTRACTS, EXTENSION_EXPLORE_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, EXTENSION_INIT_FLAG_CONTRACTS, EXTENSION_INSTALL_FLAG_CONTRACTS, EXTENSION_MANAGE_FLAG_CONTRACTS, EXTENSION_RELOAD_FLAG_CONTRACTS, EXTENSION_SCOPE_FLAG_CONTRACTS, EXTENSION_UNINSTALL_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, PLAN_CREATE_METADATA_PARAMETER_KEYS, PLAN_FLAG_CONTRACTS, PM_COMMAND_OUTPUT_BUDGET_CONTRACTS, PM_CLI_ONLY_TOOL_ACTION_WAIVERS, PM_CORE_COMMAND_NAMES, PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS, PM_EXTENSION_CAPABILITY_CONTRACTS, PM_EXTENSION_POLICY_MODE_CONTRACTS, PM_EXTENSION_POLICY_SURFACE_CONTRACTS, PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS, PM_EXTENSION_SERVICE_NAME_CONTRACTS, PM_EXTENSION_TRUST_MODE_CONTRACTS, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION, PM_TOOL_ACTIONS, analyzePmToolActionParity, PM_TOOL_ACTION_PARAMETER_CONTRACTS, PM_TOOL_PARAMETERS_SCHEMA, PM_TOOL_PARAMETERS_SCHEMA_MAJOR, PM_TOOL_PARAMETERS_SCHEMA_VERSION, PM_OUTPUT_BUDGET_CLASSES, PM_OUTPUT_DEGRADATION_STEPS, PROFILE_FLAG_CONTRACTS, REINDEX_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, SUBCOMMAND_GLOBAL_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE, TOOL_CALENDAR_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_CREATE_OPTION_CONTRACTS, TOOL_CREATE_OPTION_CONTRACT_SOURCE, TOOL_DEPS_OPTION_CONTRACTS, TOOL_GRAPH_OPTION_CONTRACTS, TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACT_SOURCE, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, buildPmActionToolInputSchema, PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES, compactFlagAliasContracts, definePmCommandOutputBudget, estimatePmOutputTokens, analyzeSdkCliParameterCompleteness, isPmExtensionCapabilityContract, isPmExtensionPolicyModeContract, isPmExtensionPolicySurfaceContract, isPmExtensionServiceNameContract, isPmToolAction, hasSubcommandFlagContractsForCommand, readFirstStringFromCommanderOptions, readFirstValueFromCommanderOptions, readStringArrayFromCommanderOptions, resolveSubcommandFlagContractsForCommand, resolvePmCommandOutputBudget, resolvePmToolCustomFieldCollision, toCompletionFlagString, withFlagAliasMetadata, } from "./cli-contracts.js";
48
+ export { ACTIVITY_FLAG_CONTRACTS, ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, CLOSE_ACTION_OPTION_KEYS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, EVAL_FLAG_CONTRACTS, EVENT_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, EXTENSION_ACTIVATE_FLAG_CONTRACTS, EXTENSION_ADOPT_ALL_FLAG_CONTRACTS, EXTENSION_ADOPT_FLAG_CONTRACTS, EXTENSION_CATALOG_FLAG_CONTRACTS, EXTENSION_DEACTIVATE_FLAG_CONTRACTS, EXTENSION_DESCRIBE_FLAG_CONTRACTS, EXTENSION_DOCTOR_FLAG_CONTRACTS, EXTENSION_EXPLORE_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, EXTENSION_INIT_FLAG_CONTRACTS, EXTENSION_INSTALL_FLAG_CONTRACTS, EXTENSION_MANAGE_FLAG_CONTRACTS, EXTENSION_RELOAD_FLAG_CONTRACTS, EXTENSION_SCOPE_FLAG_CONTRACTS, EXTENSION_UNINSTALL_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, ITEM_COMPLETE_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, PLAN_CREATE_METADATA_PARAMETER_KEYS, PLAN_FLAG_CONTRACTS, PM_COMMAND_OUTPUT_BUDGET_CONTRACTS, PM_CLI_ONLY_TOOL_ACTION_WAIVERS, PM_CORE_COMMAND_NAMES, PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS, PM_EXTENSION_CAPABILITY_CONTRACTS, PM_EXTENSION_POLICY_MODE_CONTRACTS, PM_EXTENSION_POLICY_SURFACE_CONTRACTS, PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS, PM_EXTENSION_SERVICE_NAME_CONTRACTS, PM_EXTENSION_TRUST_MODE_CONTRACTS, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION, PM_TOOL_ACTIONS, analyzePmToolActionParity, PM_TOOL_ACTION_PARAMETER_CONTRACTS, PM_TOOL_PARAMETERS_SCHEMA, PM_TOOL_PARAMETERS_SCHEMA_MAJOR, PM_TOOL_PARAMETERS_SCHEMA_VERSION, PM_OUTPUT_BUDGET_CLASSES, PM_OUTPUT_DEGRADATION_STEPS, PROFILE_FLAG_CONTRACTS, REINDEX_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, SUBCOMMAND_GLOBAL_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE, TOOL_CALENDAR_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_CREATE_OPTION_CONTRACTS, TOOL_CREATE_OPTION_CONTRACT_SOURCE, TOOL_DEPS_OPTION_CONTRACTS, TOOL_GRAPH_OPTION_CONTRACTS, TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACT_SOURCE, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, buildPmActionToolInputSchema, PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES, compactFlagAliasContracts, createPmCommandOutputBudget, definePmCommandOutputBudget, estimatePmOutputTokens, inferPmOutputBudgetClass, analyzeSdkCliParameterCompleteness, isPmExtensionCapabilityContract, isPmExtensionPolicyModeContract, isPmExtensionPolicySurfaceContract, isPmExtensionServiceNameContract, isPmToolAction, hasSubcommandFlagContractsForCommand, readFirstStringFromCommanderOptions, readFirstValueFromCommanderOptions, readStringArrayFromCommanderOptions, resolveSubcommandFlagContractsForCommand, resolvePmCommandOutputBudget, resolvePmToolCustomFieldCollision, toCompletionFlagString, withFlagAliasMetadata, } from "./cli-contracts.js";
49
49
  export type { CliFlagContract, OptionsFromContracts, PmActionSchemaContract, PmActionToolInputSchemaOptions, PmToolCustomFieldCollision, PmBulkMutationControlOptions, PmBulkMutationFilterOptions, PmCloseActionOptions, PmCloseManyActionOptions, PmCreateActionOptions, PmMutationAttributionOptions, PmOptionScalar, PmCommandOutputBudgetContract, PmOutputBudgetClass, PmOutputDegradationStep, PmUpdateActionOptions, PmUpdateManyActionOptions, PmExtensionCapabilityContract, PmExtensionPolicyModeContract, PmExtensionPolicySurfaceContract, PmExtensionSandboxProfileContract, PmExtensionServiceNameContract, PmExtensionTrustModeContract, PmToolAction, SdkCliActionParameterCoverage, SdkCliCompletenessContractSource, SdkCliParameterCoverageEntry, SdkCliParameterDisposition, ToolOptionFlagContract, } from "./cli-contracts.js";
50
50
  export * from "./compose.js";
51
51
  export * from "./compile-cache.js";
@@ -83,6 +83,7 @@ export * from "./pagination.js";
83
83
  export * from "./query/item-filter-options.js";
84
84
  export * from "./query/parsers.js";
85
85
  export * from "./output.js";
86
+ export * from "./output-contracts.js";
86
87
  export * from "./relationship-analytics.js";
87
88
  export * from "./relationship-context.js";
88
89
  export * from "./relationship-history.js";
package/dist/sdk/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Defines public SDK APIs and package-author helpers for Index.
5
5
  */
6
6
 
7
- !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]="d5bccdd6-a532-570a-b545-f316abaaf70b")}catch(e){}}();
7
+ !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]="ee9b3579-e9c4-505d-9b38-3d3616757e64")}catch(e){}}();
8
8
  export { PM_COMMAND_VISIBILITY_CONTRACTS, PM_MCP_PROMPT_CONTRACTS, PM_MCP_RESOURCE_CONTRACTS, PM_MCP_TOOL_COMMAND_CONTRACTS, listPmCommandsForTier, listPmMcpToolsForProfile, renderPmCommandVisibilityMarkdown, resolvePmCommandVisibilityTier, } from "./agent-capability-contracts.js";
9
9
  export * from "./agent-session-context.js";
10
10
  export { isErrnoError, limitAnnotationEntries, parseAnnotationTextInput, readAnnotationEntries, resolveAnnotationInput, resolveAnnotationIndex, runAnnotationCommand, wrapOwnershipConflict, } from "./annotations.js";
@@ -44,7 +44,7 @@ export { PROFILE_SUBCOMMANDS, formatProfileApplyHuman, formatProfileLintHuman, f
44
44
  export * from "./extension-contracts.js";
45
45
  export { RESERVED_ITEM_FIELD_NAMES } from "../core/extensions/item-fields.js";
46
46
  export { PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS, PM_PACKAGE_RESOURCE_KINDS, collectPackageExtensionDirectories, readPmPackageManifest, } from "../core/packages/manifest.js";
47
- export { ACTIVITY_FLAG_CONTRACTS, ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, CLOSE_ACTION_OPTION_KEYS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, EVAL_FLAG_CONTRACTS, EVENT_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, EXTENSION_ACTIVATE_FLAG_CONTRACTS, EXTENSION_ADOPT_ALL_FLAG_CONTRACTS, EXTENSION_ADOPT_FLAG_CONTRACTS, EXTENSION_CATALOG_FLAG_CONTRACTS, EXTENSION_DEACTIVATE_FLAG_CONTRACTS, EXTENSION_DESCRIBE_FLAG_CONTRACTS, EXTENSION_DOCTOR_FLAG_CONTRACTS, EXTENSION_EXPLORE_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, EXTENSION_INIT_FLAG_CONTRACTS, EXTENSION_INSTALL_FLAG_CONTRACTS, EXTENSION_MANAGE_FLAG_CONTRACTS, EXTENSION_RELOAD_FLAG_CONTRACTS, EXTENSION_SCOPE_FLAG_CONTRACTS, EXTENSION_UNINSTALL_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, PLAN_CREATE_METADATA_PARAMETER_KEYS, PLAN_FLAG_CONTRACTS, PM_COMMAND_OUTPUT_BUDGET_CONTRACTS, PM_CLI_ONLY_TOOL_ACTION_WAIVERS, PM_CORE_COMMAND_NAMES, PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS, PM_EXTENSION_CAPABILITY_CONTRACTS, PM_EXTENSION_POLICY_MODE_CONTRACTS, PM_EXTENSION_POLICY_SURFACE_CONTRACTS, PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS, PM_EXTENSION_SERVICE_NAME_CONTRACTS, PM_EXTENSION_TRUST_MODE_CONTRACTS, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION, PM_TOOL_ACTIONS, analyzePmToolActionParity, PM_TOOL_ACTION_PARAMETER_CONTRACTS, PM_TOOL_PARAMETERS_SCHEMA, PM_TOOL_PARAMETERS_SCHEMA_MAJOR, PM_TOOL_PARAMETERS_SCHEMA_VERSION, PM_OUTPUT_BUDGET_CLASSES, PM_OUTPUT_DEGRADATION_STEPS, PROFILE_FLAG_CONTRACTS, REINDEX_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, SUBCOMMAND_GLOBAL_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE, TOOL_CALENDAR_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_CREATE_OPTION_CONTRACTS, TOOL_CREATE_OPTION_CONTRACT_SOURCE, TOOL_DEPS_OPTION_CONTRACTS, TOOL_GRAPH_OPTION_CONTRACTS, TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACT_SOURCE, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, buildPmActionToolInputSchema, PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES, compactFlagAliasContracts, definePmCommandOutputBudget, estimatePmOutputTokens, analyzeSdkCliParameterCompleteness, isPmExtensionCapabilityContract, isPmExtensionPolicyModeContract, isPmExtensionPolicySurfaceContract, isPmExtensionServiceNameContract, isPmToolAction, hasSubcommandFlagContractsForCommand, readFirstStringFromCommanderOptions, readFirstValueFromCommanderOptions, readStringArrayFromCommanderOptions, resolveSubcommandFlagContractsForCommand, resolvePmCommandOutputBudget, resolvePmToolCustomFieldCollision, toCompletionFlagString, withFlagAliasMetadata, } from "./cli-contracts.js";
47
+ export { ACTIVITY_FLAG_CONTRACTS, ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, CLOSE_ACTION_OPTION_KEYS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, COPY_FLAG_CONTRACTS, CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, EVAL_FLAG_CONTRACTS, EVENT_FLAG_CONTRACTS, EVENTS_FLAG_CONTRACTS, EXTENSION_ACTIVATE_FLAG_CONTRACTS, EXTENSION_ADOPT_ALL_FLAG_CONTRACTS, EXTENSION_ADOPT_FLAG_CONTRACTS, EXTENSION_CATALOG_FLAG_CONTRACTS, EXTENSION_DEACTIVATE_FLAG_CONTRACTS, EXTENSION_DESCRIBE_FLAG_CONTRACTS, EXTENSION_DOCTOR_FLAG_CONTRACTS, EXTENSION_EXPLORE_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, EXTENSION_INIT_FLAG_CONTRACTS, EXTENSION_INSTALL_FLAG_CONTRACTS, EXTENSION_MANAGE_FLAG_CONTRACTS, EXTENSION_RELOAD_FLAG_CONTRACTS, EXTENSION_SCOPE_FLAG_CONTRACTS, EXTENSION_UNINSTALL_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, FOCUS_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, ITEM_COMPLETE_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, MEET_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, PLAN_CREATE_METADATA_PARAMETER_KEYS, PLAN_FLAG_CONTRACTS, PM_COMMAND_OUTPUT_BUDGET_CONTRACTS, PM_CLI_ONLY_TOOL_ACTION_WAIVERS, PM_CORE_COMMAND_NAMES, PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS, PM_EXTENSION_CAPABILITY_CONTRACTS, PM_EXTENSION_POLICY_MODE_CONTRACTS, PM_EXTENSION_POLICY_SURFACE_CONTRACTS, PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS, PM_EXTENSION_SERVICE_NAME_CONTRACTS, PM_EXTENSION_TRUST_MODE_CONTRACTS, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA, PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION, PM_TOOL_ACTIONS, analyzePmToolActionParity, PM_TOOL_ACTION_PARAMETER_CONTRACTS, PM_TOOL_PARAMETERS_SCHEMA, PM_TOOL_PARAMETERS_SCHEMA_MAJOR, PM_TOOL_PARAMETERS_SCHEMA_VERSION, PM_OUTPUT_BUDGET_CLASSES, PM_OUTPUT_DEGRADATION_STEPS, PROFILE_FLAG_CONTRACTS, REINDEX_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, REMIND_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, SUBCOMMAND_GLOBAL_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE, TOOL_CALENDAR_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_CREATE_OPTION_CONTRACTS, TOOL_CREATE_OPTION_CONTRACT_SOURCE, TOOL_DEPS_OPTION_CONTRACTS, TOOL_GRAPH_OPTION_CONTRACTS, TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACT_SOURCE, UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, buildPmActionToolInputSchema, PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES, compactFlagAliasContracts, createPmCommandOutputBudget, definePmCommandOutputBudget, estimatePmOutputTokens, inferPmOutputBudgetClass, analyzeSdkCliParameterCompleteness, isPmExtensionCapabilityContract, isPmExtensionPolicyModeContract, isPmExtensionPolicySurfaceContract, isPmExtensionServiceNameContract, isPmToolAction, hasSubcommandFlagContractsForCommand, readFirstStringFromCommanderOptions, readFirstValueFromCommanderOptions, readStringArrayFromCommanderOptions, resolveSubcommandFlagContractsForCommand, resolvePmCommandOutputBudget, resolvePmToolCustomFieldCollision, toCompletionFlagString, withFlagAliasMetadata, } from "./cli-contracts.js";
48
48
  export * from "./compose.js";
49
49
  export * from "./compile-cache.js";
50
50
  export * from "./context-relevance.js";
@@ -81,6 +81,7 @@ export * from "./pagination.js";
81
81
  export * from "./query/item-filter-options.js";
82
82
  export * from "./query/parsers.js";
83
83
  export * from "./output.js";
84
+ export * from "./output-contracts.js";
84
85
  export * from "./relationship-analytics.js";
85
86
  export * from "./relationship-context.js";
86
87
  export * from "./relationship-history.js";
@@ -128,4 +129,4 @@ export * from "./governance.js";
128
129
  export * from "./query.js";
129
130
  export * from "./testing.js";
130
131
  //# sourceMappingURL=index.js.map
131
- //# debugId=d5bccdd6-a532-570a-b545-f316abaaf70b
132
+ //# debugId=ee9b3579-e9c4-505d-9b38-3d3616757e64
@@ -33,8 +33,17 @@ export interface BulkItemCloseMutation {
33
33
  /** Close options forwarded to the public `close` runtime primitive. */
34
34
  options?: PmClientFullMutationOptions;
35
35
  }
36
+ /** One atomic claim release inside a bulk mutation batch. */
37
+ export interface BulkItemReleaseMutation {
38
+ /** Discriminates the claim-release operation. */
39
+ op: "release";
40
+ /** Target item id. */
41
+ id: string;
42
+ /** Release options forwarded to the public `release` runtime primitive. */
43
+ options?: PmClientFullMutationOptions;
44
+ }
36
45
  /** Union of the item mutations a bulk transaction batch can carry. */
37
- export type BulkItemMutation = BulkItemCreateMutation | BulkItemUpdateMutation | BulkItemCloseMutation;
46
+ export type BulkItemMutation = BulkItemCreateMutation | BulkItemUpdateMutation | BulkItemCloseMutation | BulkItemReleaseMutation;
38
47
  /** Options accepted by the bulk item-mutation transaction helper. */
39
48
  export interface CommitItemMutationsOptions {
40
49
  /** Tracker root that owns the journal and workspace-wide writer lock. */
@@ -80,18 +89,20 @@ interface LocatedItemSnapshot {
80
89
  id: string;
81
90
  closedAt: string | undefined;
82
91
  updatedAt: string;
92
+ assignee: string | undefined;
93
+ claimPrincipal: string | undefined;
83
94
  }
84
95
  /** Read one item's transaction-relevant fields, mapping not-found to undefined. */
85
96
  declare function readItemSnapshot(pmRoot: string, id: string): Promise<LocatedItemSnapshot | undefined>;
86
- /** Derive a journal-safe step id from one mutation's position and target. */
97
+ /** Derive a journal-safe step id bound to position, target, and payload. */
87
98
  declare function deriveStepId(mutation: BulkItemMutation, index: number): string;
88
99
  /** Build the durable history-message marker for one bulk mutation phase. */
89
100
  declare function bulkHistoryMarker(transactionId: string, stepId: string, phase: "apply" | "compensate"): string;
90
101
  /**
91
- * Report whether an update step's forward mutation is durably applied. Updates
92
- * cannot be inferred from field values (a moving target), so the applied apply
93
- * marker in the item's immutable history is the source of truth; a later
94
- * compensate marker means the mutation was rolled back and must re-apply.
102
+ * Report whether a step's forward mutation is durably applied. Mutable item
103
+ * fields cannot prove transaction ownership, so the apply marker in immutable
104
+ * history is the source of truth; a later compensation marker means the
105
+ * mutation was rolled back and must re-apply.
95
106
  */
96
107
  declare function isUpdateMarkerApplied(pmRoot: string, canonicalId: string, transactionId: string, stepId: string): Promise<boolean>;
97
108
  /** Idempotently restore an item to its captured pre-mutation version. */
@@ -119,6 +130,40 @@ declare function buildCreateStep(config: {
119
130
  * interrupted batches resumable across processes and agents.
120
131
  */
121
132
  export declare function commitItemMutations(options: CommitItemMutationsOptions): Promise<CommitItemMutationsResult>;
133
+ /** Options for completing one item as a single atomic SDK transaction. */
134
+ export interface CommitItemCompletionOptions {
135
+ /** Tracker root that owns the item and transaction journal. */
136
+ pmRoot: string;
137
+ /** Stable idempotency key for the composed completion. */
138
+ transactionId: string;
139
+ /** Attributable actor for evidence, closure, and claim release. */
140
+ author: string;
141
+ /** Item being completed. */
142
+ id: string;
143
+ /** Durable close reason. */
144
+ reason: string;
145
+ /** Evidence and linked-resource updates recorded before closure. */
146
+ evidence?: PmClientFullMutationOptions;
147
+ /** Structured closure fields and validation policy. */
148
+ closeOptions?: PmClientFullMutationOptions;
149
+ /** Claim-release controls. */
150
+ releaseOptions?: PmClientFullMutationOptions;
151
+ /** Workspace transaction lock lifetime in seconds. */
152
+ lockTtlSeconds?: number;
153
+ /** Maximum time to wait for the workspace transaction lock. */
154
+ lockWaitMs?: number;
155
+ /** Optional transition observer used by telemetry and crash tests. */
156
+ onTransition?: CommitWorkspaceTransactionOptions["onTransition"];
157
+ }
158
+ /** Build the ordered mutation sequence used by atomic item completion. */
159
+ export declare function buildItemCompletionMutations(options: Pick<CommitItemCompletionOptions, "id" | "reason" | "evidence" | "closeOptions" | "releaseOptions">): BulkItemMutation[];
160
+ /**
161
+ * Record evidence, close an item, and release its claim as one compensating
162
+ * transaction. A failure restores the exact pre-completion item version, so
163
+ * callers never observe the protocol's otherwise possible half-finished
164
+ * states through a committed result.
165
+ */
166
+ export declare function commitItemCompletion(options: CommitItemCompletionOptions): Promise<CommitItemMutationsResult>;
122
167
  /** Public contract for test only item transaction internals, shared with white-box specs. */
123
168
  export declare const _testOnlyItemTransaction: {
124
169
  buildCreateStep: typeof buildCreateStep;
@@ -6,12 +6,14 @@
6
6
  * with correct-by-construction inspection and compensation wiring.
7
7
  */
8
8
 
9
- !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]="0b22a2a8-d626-54e1-8f14-670e651a6eb2")}catch(e){}}();
9
+ !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]="ed638747-7a72-5332-87fc-c82088457b91")}catch(e){}}();
10
+ import crypto from "node:crypto";
10
11
  import path from "node:path";
11
12
  import { EXIT_CODE } from "../core/shared/constants.js";
12
13
  import { PmCliError } from "../core/shared/errors.js";
14
+ import { stableStringify } from "../core/shared/serialization.js";
13
15
  import { readHistoryEntries } from "./history-read.js";
14
- import { close, create, deleteItem, get, restore, update, } from "./runtime.js";
16
+ import { close, create, deleteItem, get, release, restore, update, } from "./runtime.js";
15
17
  import { commitWorkspaceTransaction, } from "./workspace-transaction.js";
16
18
  /** Read one item's transaction-relevant fields, mapping not-found to undefined. */
17
19
  async function readItemSnapshot(pmRoot, id) {
@@ -22,18 +24,29 @@ async function readItemSnapshot(pmRoot, id) {
22
24
  id: item.id,
23
25
  closedAt: item.closed_at,
24
26
  updatedAt: item.updated_at,
27
+ assignee: item.assignee,
28
+ claimPrincipal: item.claim_principal,
25
29
  };
26
30
  }
27
31
  catch (error) {
28
- if (error instanceof PmCliError &&
29
- error.exitCode === EXIT_CODE.NOT_FOUND) {
32
+ if (error instanceof PmCliError && error.exitCode === EXIT_CODE.NOT_FOUND) {
30
33
  return undefined;
31
34
  }
32
35
  throw error;
33
36
  }
34
37
  }
35
- /** Derive a journal-safe step id from one mutation's position and target. */
38
+ /** Derive a journal-safe step id bound to position, target, and payload. */
36
39
  function deriveStepId(mutation, index) {
40
+ const sanitizedTarget = mutation.id.replaceAll(/[^a-zA-Z0-9._-]/gu, "_");
41
+ const fingerprint = crypto
42
+ .createHash("sha256")
43
+ .update(stableStringify(mutation))
44
+ .digest("hex")
45
+ .slice(0, 12);
46
+ return `${index + 1}-${mutation.op}-${sanitizedTarget}-${fingerprint}`;
47
+ }
48
+ /** Derive the stable public outcome key without exposing journal internals. */
49
+ function deriveOutcomeKey(mutation, index) {
37
50
  const sanitizedTarget = mutation.id.replaceAll(/[^a-zA-Z0-9._-]/gu, "_");
38
51
  return `${index + 1}-${mutation.op}-${sanitizedTarget}`;
39
52
  }
@@ -42,10 +55,10 @@ function bulkHistoryMarker(transactionId, stepId, phase) {
42
55
  return `bulk-item-transaction ${transactionId} ${stepId} ${phase}`;
43
56
  }
44
57
  /**
45
- * Report whether an update step's forward mutation is durably applied. Updates
46
- * cannot be inferred from field values (a moving target), so the applied apply
47
- * marker in the item's immutable history is the source of truth; a later
48
- * compensate marker means the mutation was rolled back and must re-apply.
58
+ * Report whether a step's forward mutation is durably applied. Mutable item
59
+ * fields cannot prove transaction ownership, so the apply marker in immutable
60
+ * history is the source of truth; a later compensation marker means the
61
+ * mutation was rolled back and must re-apply.
49
62
  */
50
63
  async function isUpdateMarkerApplied(pmRoot, canonicalId, transactionId, stepId) {
51
64
  const entries = await readHistoryEntries(path.join(pmRoot, "history", `${canonicalId}.jsonl`), canonicalId);
@@ -163,7 +176,13 @@ function buildCloseStep(config, mutation, stepId) {
163
176
  // fight legitimate prior closure, and recovery must adopt completed work.
164
177
  async inspect() {
165
178
  const snapshot = await readItemSnapshot(config.pmRoot, mutation.id);
166
- if (snapshot?.closedAt === undefined) {
179
+ if (snapshot === undefined) {
180
+ return { state: "pending" };
181
+ }
182
+ if (await isUpdateMarkerApplied(config.pmRoot, snapshot.id, config.transactionId, stepId)) {
183
+ return { state: "applied", result: { id: snapshot.id, op: "close" } };
184
+ }
185
+ if (snapshot.closedAt === undefined) {
167
186
  return { state: "pending" };
168
187
  }
169
188
  return { state: "applied", result: { id: snapshot.id, op: "close" } };
@@ -172,7 +191,11 @@ function buildCloseStep(config, mutation, stepId) {
172
191
  return prepareRestoreCompensation(config.pmRoot, mutation);
173
192
  },
174
193
  async apply() {
175
- const closed = await close(mutation.id, mutation.reason, { ...mutation.options, author: config.author }, { pmRoot: config.pmRoot });
194
+ const closed = await close(mutation.id, mutation.reason, {
195
+ ...mutation.options,
196
+ author: config.author,
197
+ message: bulkHistoryMarker(config.transactionId, stepId, "apply"),
198
+ }, { pmRoot: config.pmRoot });
176
199
  const closedItem = closed.item;
177
200
  return { id: String(closedItem.id), op: "close" };
178
201
  },
@@ -181,16 +204,54 @@ function buildCloseStep(config, mutation, stepId) {
181
204
  },
182
205
  };
183
206
  }
207
+ /** Build the workspace-transaction step for one claim release. */
208
+ function buildReleaseStep(config, mutation, stepId) {
209
+ return {
210
+ id: stepId,
211
+ async inspect() {
212
+ const snapshot = await readItemSnapshot(config.pmRoot, mutation.id);
213
+ if (snapshot === undefined) {
214
+ return { state: "pending" };
215
+ }
216
+ if (await isUpdateMarkerApplied(config.pmRoot, snapshot.id, config.transactionId, stepId)) {
217
+ return { state: "applied", result: { id: snapshot.id, op: "release" } };
218
+ }
219
+ if (snapshot.assignee !== undefined ||
220
+ snapshot.claimPrincipal !== undefined) {
221
+ return { state: "pending" };
222
+ }
223
+ return { state: "applied", result: { id: snapshot.id, op: "release" } };
224
+ },
225
+ async prepareCompensation() {
226
+ return prepareRestoreCompensation(config.pmRoot, mutation);
227
+ },
228
+ async apply() {
229
+ const released = await release(mutation.id, {
230
+ ...mutation.options,
231
+ author: config.author,
232
+ message: bulkHistoryMarker(config.transactionId, stepId, "apply"),
233
+ }, { pmRoot: config.pmRoot });
234
+ const releasedItem = released.item;
235
+ return { id: String(releasedItem.id), op: "release" };
236
+ },
237
+ async compensate(data) {
238
+ await compensateByRestore(config, mutation.id, stepId, data);
239
+ },
240
+ };
241
+ }
184
242
  /** Convert one validated bulk mutation into its workspace-transaction step. */
185
243
  function buildStepForMutation(config, mutation, index) {
186
244
  const stepId = deriveStepId(mutation, index);
187
- if (mutation.op === "create") {
188
- return buildCreateStep(config, mutation, stepId);
245
+ switch (mutation.op) {
246
+ case "create":
247
+ return buildCreateStep(config, mutation, stepId);
248
+ case "update":
249
+ return buildUpdateStep(config, mutation, stepId);
250
+ case "close":
251
+ return buildCloseStep(config, mutation, stepId);
252
+ case "release":
253
+ return buildReleaseStep(config, mutation, stepId);
189
254
  }
190
- if (mutation.op === "update") {
191
- return buildUpdateStep(config, mutation, stepId);
192
- }
193
- return buildCloseStep(config, mutation, stepId);
194
255
  }
195
256
  /** Reject malformed bulk mutation rows before any journal or lock work. */
196
257
  function assertValidBulkMutation(mutation, index) {
@@ -199,8 +260,8 @@ function assertValidBulkMutation(mutation, index) {
199
260
  Array.isArray(mutation)) {
200
261
  throw new TypeError(`Bulk mutation ${index + 1} must be an object`);
201
262
  }
202
- if (!["create", "update", "close"].includes(mutation.op)) {
203
- throw new TypeError(`Bulk mutation ${index + 1} op must be create, update, or close`);
263
+ if (!["create", "update", "close", "release"].includes(mutation.op)) {
264
+ throw new TypeError(`Bulk mutation ${index + 1} op must be create, update, close, or release`);
204
265
  }
205
266
  if (typeof mutation.id !== "string" || mutation.id.trim().length === 0) {
206
267
  throw new TypeError(`Bulk mutation ${index + 1} requires a non-empty id`);
@@ -255,10 +316,13 @@ export async function commitItemMutations(options) {
255
316
  : { onTransition: options.onTransition }),
256
317
  });
257
318
  const results = {};
258
- for (const [stepId, value] of Object.entries(committed.results)) {
319
+ for (const [index, mutation] of mutations.entries()) {
320
+ const stepId = deriveStepId(mutation, index);
321
+ const value = committed.results[stepId];
259
322
  // Journal values round-trip this module's own step outputs, which are
260
323
  // always {id, op} objects — the cast restores the concrete outcome shape.
261
- results[stepId] = value;
324
+ results[deriveOutcomeKey(mutation, index)] =
325
+ value;
262
326
  }
263
327
  return {
264
328
  transactionId: committed.transactionId,
@@ -267,6 +331,52 @@ export async function commitItemMutations(options) {
267
331
  results,
268
332
  };
269
333
  }
334
+ /** Build the ordered mutation sequence used by atomic item completion. */
335
+ export function buildItemCompletionMutations(options) {
336
+ const mutations = [];
337
+ if (options.evidence !== undefined &&
338
+ Object.keys(options.evidence).length > 0) {
339
+ mutations.push({ op: "update", id: options.id, options: options.evidence });
340
+ }
341
+ mutations.push({
342
+ op: "close",
343
+ id: options.id,
344
+ reason: options.reason,
345
+ ...(options.closeOptions === undefined
346
+ ? {}
347
+ : { options: options.closeOptions }),
348
+ }, {
349
+ op: "release",
350
+ id: options.id,
351
+ ...(options.releaseOptions === undefined
352
+ ? {}
353
+ : { options: options.releaseOptions }),
354
+ });
355
+ return mutations;
356
+ }
357
+ /**
358
+ * Record evidence, close an item, and release its claim as one compensating
359
+ * transaction. A failure restores the exact pre-completion item version, so
360
+ * callers never observe the protocol's otherwise possible half-finished
361
+ * states through a committed result.
362
+ */
363
+ export function commitItemCompletion(options) {
364
+ return commitItemMutations({
365
+ pmRoot: options.pmRoot,
366
+ transactionId: options.transactionId,
367
+ author: options.author,
368
+ mutations: buildItemCompletionMutations(options),
369
+ ...(options.lockTtlSeconds === undefined
370
+ ? {}
371
+ : { lockTtlSeconds: options.lockTtlSeconds }),
372
+ ...(options.lockWaitMs === undefined
373
+ ? {}
374
+ : { lockWaitMs: options.lockWaitMs }),
375
+ ...(options.onTransition === undefined
376
+ ? {}
377
+ : { onTransition: options.onTransition }),
378
+ });
379
+ }
270
380
  /** Public contract for test only item transaction internals, shared with white-box specs. */
271
381
  export const _testOnlyItemTransaction = {
272
382
  buildCreateStep,
@@ -277,4 +387,4 @@ export const _testOnlyItemTransaction = {
277
387
  readItemSnapshot,
278
388
  };
279
389
  //# sourceMappingURL=item-transaction.js.map
280
- //# debugId=0b22a2a8-d626-54e1-8f14-670e651a6eb2
390
+ //# debugId=ed638747-7a72-5332-87fc-c82088457b91
@@ -20,6 +20,10 @@ export interface CreateCommandOptions extends MutationMetadataCommandOptions, Sh
20
20
  type?: string;
21
21
  /** Lifecycle state reported for status. */
22
22
  status?: string;
23
+ /** Author-controlled reason when creating directly in a terminal status. */
24
+ closeReason?: string;
25
+ /** Actual completion time when importing an already-completed item. */
26
+ completedAt?: string;
23
27
  /** Value that configures or reports priority for this contract. */
24
28
  priority?: string | number;
25
29
  /** Value that configures or reports tags for this contract. */
@@ -4,9 +4,9 @@
4
4
  * Implements the pm create command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !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]="5f01dc2b-6239-5724-aa36-8f81b580b76a")}catch(e){}}();
7
+ !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]="93dc76a3-f205-5a44-85bd-5a6fad80c8d4")}catch(e){}}();
8
8
  import { pathExists, removeFileIfExists, writeFileAtomic, appendHistoryEntry, createHistoryEntry, generateItemId, normalizeItemId, canonicalDocument, normalizeItemMetadata, serializeItemDocument, assertParentReferenceIsNotSelf, isPlaceholderReferenceToken, normalizeParentReferenceValue, validateMissingParentReference, validateSprintOrReleaseValue, assertNoUnknownCsvKeys, createStdinTokenResolver, looksLikeGenericKeyValueEntry, mergeAdditiveTags, parseCsvKv, parseOptionalNonNegativeInteger, parseOptionalNumber, parseTags, resolvePriority, getFocusedItem, normalizeStatusInput, canonicalizeCommandOptionKey, commandOptionFlagLabel, resolveItemTypeRegistry, resolveCommandOptionPolicyState, resolveTypeDefinition, resolveTypeName, validateTypeOptions, acquireLock, printError, buildInvalidTypeError, resolveTypeSynonym, collectRuntimeCreateFieldValues, resolveItemTypesFilePath, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, EXIT_CODE, ITEM_METADATA_KEY_ORDER, PmCliError, nowIso, resolveIsoOrRelative, getActiveExtensionRegistrations, projectAfterCommandItemSnapshot, recordAfterCommandAffectedItem, runActiveCommandHandler, runActiveBeforeMutationHooks, runActiveOnWriteHooks, collectRegisteredItemFieldNames, applyRegisteredItemFieldDefaultsAndValidation, parseRegisteredItemFieldAssignments, listAllItemMetadataLight, locateItem, createMutationGuardSdk, getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot, readSettings, resolveAuthor, } from "../runtime-primitives.js";
9
- import { requireTerminalReason } from "../lifecycle-policy.js";
9
+ import { requireTerminalReasonWithRecovery } from "../lifecycle-policy.js";
10
10
  import { evaluateSimilarityGovernance, similarityAdvisoryWarnings, } from "../similarity.js";
11
11
  import { acquireItemMetadataDerivedIndexLock, refreshItemMetadataDerivedIndex, } from "../item-metadata-index.js";
12
12
  import { collectNewOrderingCycleWarnings } from "../graph/mutation-advisory.js";
@@ -1384,13 +1384,28 @@ function resolveCreateOrder(unsetKeys, resolvedOptions) {
1384
1384
  return order;
1385
1385
  }
1386
1386
  /** Resolve an author-controlled reason for an item created directly in the close status. */
1387
- function resolveCreateCloseReason(status, statusRegistry, settings, resolvedOptions, resolution) {
1388
- if (status !== statusRegistry.close_status ||
1389
- !settings.governance.require_close_reason) {
1390
- return { closeReason: undefined, warnings: [] };
1387
+ function resolveCreateCloseReason(status, statusRegistry, settings, resolvedOptions, resolution, nowValue) {
1388
+ if (resolvedOptions.completedAt !== undefined &&
1389
+ status !== statusRegistry.close_status) {
1390
+ throw new PmCliError("--completed-at requires a terminal create status.", EXIT_CODE.USAGE);
1391
1391
  }
1392
+ const completedAt = status !== statusRegistry.close_status
1393
+ ? undefined
1394
+ : resolvedOptions.completedAt === undefined
1395
+ ? nowValue
1396
+ : resolveIsoOrRelative(resolvedOptions.completedAt, new Date(nowValue), "completed-at");
1397
+ if (status !== statusRegistry.close_status) {
1398
+ return { closeReason: undefined, completedAt, warnings: [] };
1399
+ }
1400
+ const reasonInput = settings.governance.require_close_reason
1401
+ ? {
1402
+ explicit: resolvedOptions.closeReason ?? resolvedOptions.message,
1403
+ resolution,
1404
+ }
1405
+ : { explicit: resolvedOptions.closeReason };
1392
1406
  return {
1393
- closeReason: requireTerminalReason({ explicit: resolvedOptions.message, resolution }, true).closeReason,
1407
+ closeReason: requireTerminalReasonWithRecovery(reasonInput, settings.governance.require_close_reason, { operation: "create", status }).closeReason,
1408
+ completedAt,
1394
1409
  warnings: [],
1395
1410
  };
1396
1411
  }
@@ -1671,9 +1686,10 @@ export async function runCreate(options, global) {
1671
1686
  // GH-249: creating an item directly in the close status must honor
1672
1687
  // governance.require_close_reason, just like `pm close` (errors when missing)
1673
1688
  // and `pm update --status closed` (defaults + warns).
1674
- const closeReasonResolution = resolveCreateCloseReason(status, statusRegistry, settings, resolvedOptions, resolution);
1689
+ const closeReasonResolution = resolveCreateCloseReason(status, statusRegistry, settings, resolvedOptions, resolution, nowValue);
1675
1690
  const closeReason = closeReasonResolution.closeReason;
1676
1691
  const closedAt = status === statusRegistry.close_status ? nowValue : undefined;
1692
+ const completedAt = closeReasonResolution.completedAt;
1677
1693
  validationWarnings.push(...closeReasonResolution.warnings);
1678
1694
  const itemMetadata = normalizeItemMetadata({
1679
1695
  id,
@@ -1683,7 +1699,7 @@ export async function runCreate(options, global) {
1683
1699
  type_options: validatedTypeOptions.normalized,
1684
1700
  status,
1685
1701
  closed_at: closedAt,
1686
- completed_at: closedAt,
1702
+ completed_at: completedAt,
1687
1703
  close_reason: closeReason,
1688
1704
  priority,
1689
1705
  tags,
@@ -1825,4 +1841,4 @@ export const _testOnlyCreateCommand = {
1825
1841
  typeOptionExampleValue,
1826
1842
  };
1827
1843
  //# sourceMappingURL=create.js.map
1828
- //# debugId=5f01dc2b-6239-5724-aa36-8f81b580b76a
1844
+ //# debugId=93dc76a3-f205-5a44-85bd-5a6fad80c8d4
@@ -58,6 +58,13 @@ export interface TerminalReasonResolution {
58
58
  /** Field that supplied the resolved reason. */
59
59
  source: TerminalReasonSource;
60
60
  }
61
+ /** Presentation context used to make terminal-policy recovery actionable. */
62
+ export interface TerminalReasonRecoveryContext {
63
+ /** Operation whose input failed terminal-reason governance. */
64
+ operation: "close" | "create";
65
+ /** Terminal status requested by a create operation. */
66
+ status?: string;
67
+ }
61
68
  /** Result of applying ordering-edge lifecycle policy to mutable item metadata. */
62
69
  export interface TerminalOrderingMutation {
63
70
  /** Metadata fields changed by the policy. */
@@ -71,6 +78,8 @@ export declare const DEFAULT_TERMINAL_TRANSITION_POLICY: Readonly<TerminalTransi
71
78
  export declare function resolveTerminalReason(input: TerminalReasonInput): TerminalReasonResolution;
72
79
  /** Enforce close-reason governance without inventing immutable history content. */
73
80
  export declare function requireTerminalReason(input: TerminalReasonInput, required: boolean): TerminalReasonResolution;
81
+ /** Enforce close-reason governance with recovery for a specific operation. */
82
+ export declare function requireTerminalReasonWithRecovery(input: TerminalReasonInput, required: boolean, recovery: TerminalReasonRecoveryContext): TerminalReasonResolution;
74
83
  /**
75
84
  * Apply terminal ordering policy while clearing only transient blocked-state
76
85
  * scalars. Preserving `blocked_by` dependency rows keeps predecessor history