@unbrained/pm-cli 2026.8.4 → 2026.8.6

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 (253) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +53 -13
  3. package/dist/cli/error-guidance.js +4 -4
  4. package/dist/cli/main.js +12 -37
  5. package/dist/cli/register-setup.d.ts +1 -1
  6. package/dist/cli/register-setup.js +46 -20
  7. package/dist/cli/register-structured-mutation.d.ts +2 -0
  8. package/dist/cli/register-structured-mutation.js +124 -12
  9. package/dist/cli-bundle/bundle-manifest.json +397 -397
  10. package/dist/cli-bundle/chunks/append-XAJ5Z4XS.js +2 -0
  11. package/dist/cli-bundle/chunks/{chunk-QVO3VTA4.js → chunk-343QETLI.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-Q5F6OI7C.js → chunk-3KFVGGRE.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-6S7I3UKV.js → chunk-3ZJRFYY2.js} +19 -19
  14. package/dist/cli-bundle/chunks/{chunk-NFF3JAQR.js → chunk-4AVFKHHC.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-5H47J5FG.js → chunk-4OVGQW22.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-D2MBVMVE.js → chunk-5PBP2ZP3.js} +2 -2
  17. package/dist/cli-bundle/chunks/chunk-5ZKQPA44.js +2 -0
  18. package/dist/cli-bundle/chunks/chunk-A3XQ7VPU.js +2 -0
  19. package/dist/cli-bundle/chunks/chunk-AJE3AHPD.js +8 -0
  20. package/dist/cli-bundle/chunks/{chunk-2POYGY53.js → chunk-AOBDLU4T.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-PYYPQLHC.js → chunk-AYRUGRNS.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-QMWUL66F.js → chunk-BP6EMEDP.js} +5 -5
  23. package/dist/cli-bundle/chunks/{chunk-UVZREFZU.js → chunk-C3YABSJK.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-RB65T4RX.js → chunk-CA3BURYF.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-KIKLF2W4.js → chunk-D7I3TUGV.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-PQXEB7W4.js → chunk-DQGJ2RWT.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-OB7TRZ2G.js → chunk-DWOAOZHZ.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-SVDH5CHC.js → chunk-E7BFPLUZ.js} +4 -4
  29. package/dist/cli-bundle/chunks/{chunk-CGY5I2GO.js → chunk-F4NREH3G.js} +2 -2
  30. package/dist/cli-bundle/chunks/{chunk-DCJ6CM6F.js → chunk-FDBRXV25.js} +2 -2
  31. package/dist/cli-bundle/chunks/{chunk-NM5G7RLU.js → chunk-GU3TSEHD.js} +2 -2
  32. package/dist/cli-bundle/chunks/chunk-HS7OVAUN.js +164 -0
  33. package/dist/cli-bundle/chunks/{chunk-CU5ENFNP.js → chunk-JFZIS6JF.js} +2 -2
  34. package/dist/cli-bundle/chunks/{chunk-GOICHIX4.js → chunk-JQ4NZ5EB.js} +2 -2
  35. package/dist/cli-bundle/chunks/{chunk-HE3DZFN4.js → chunk-L6LGKJX3.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-BLINBTMX.js → chunk-M357ZCOR.js} +2 -2
  37. package/dist/cli-bundle/chunks/{chunk-NRDKVOUE.js → chunk-M4VEE3FK.js} +2 -2
  38. package/dist/cli-bundle/chunks/{chunk-HTYC76A4.js → chunk-MCS73BKB.js} +2 -2
  39. package/dist/cli-bundle/chunks/{chunk-BKMZTZYL.js → chunk-MDTH7SAE.js} +2 -2
  40. package/dist/cli-bundle/chunks/{chunk-H6FITE7D.js → chunk-NE5VRDAI.js} +2 -2
  41. package/dist/cli-bundle/chunks/{chunk-NPUJ7OLK.js → chunk-OXY3SJ3N.js} +2 -2
  42. package/dist/cli-bundle/chunks/chunk-PECV7L5T.js +2 -0
  43. package/dist/cli-bundle/chunks/{chunk-KH4GVBMC.js → chunk-Q3VOP62W.js} +2 -2
  44. package/dist/cli-bundle/chunks/{chunk-FQ4EFFDU.js → chunk-QJ7C3JIW.js} +2 -2
  45. package/dist/cli-bundle/chunks/{chunk-VH2EAGUG.js → chunk-R6LSRGPS.js} +2 -2
  46. package/dist/cli-bundle/chunks/{chunk-HQ2WU7OY.js → chunk-R6RKEYYW.js} +2 -2
  47. package/dist/cli-bundle/chunks/{chunk-PA5XRN2A.js → chunk-RAFUN7IX.js} +4 -4
  48. package/dist/cli-bundle/chunks/chunk-RUAU5OSH.js +2 -0
  49. package/dist/cli-bundle/chunks/chunk-SD3YXU2U.js +56 -0
  50. package/dist/cli-bundle/chunks/{chunk-JMKVCQSE.js → chunk-SV3YQ4RY.js} +2 -2
  51. package/dist/cli-bundle/chunks/{chunk-B5ZLCD5Z.js → chunk-SVV3DQES.js} +2 -2
  52. package/dist/cli-bundle/chunks/{chunk-J4EPW4GT.js → chunk-SXECIECW.js} +2 -2
  53. package/dist/cli-bundle/chunks/chunk-T45OHXDW.js +8 -0
  54. package/dist/cli-bundle/chunks/{chunk-NH35JNK5.js → chunk-TPKDJ5WL.js} +2 -2
  55. package/dist/cli-bundle/chunks/{chunk-ZSH4GNBH.js → chunk-UVVXHGYS.js} +2 -2
  56. package/dist/cli-bundle/chunks/chunk-V663653R.js +20 -0
  57. package/dist/cli-bundle/chunks/{chunk-5PZGZMPG.js → chunk-WSI5KZQJ.js} +2 -2
  58. package/dist/cli-bundle/chunks/{chunk-3XZYTRPC.js → chunk-XPOQQJTX.js} +2 -2
  59. package/dist/cli-bundle/chunks/{chunk-UJHUR3LZ.js → chunk-YCCDXBNU.js} +2 -2
  60. package/dist/cli-bundle/chunks/chunk-ZFBWCKYF.js +2 -0
  61. package/dist/cli-bundle/chunks/close-DI66JMSB.js +2 -0
  62. package/dist/cli-bundle/chunks/close-many-VFKT6U3O.js +2 -0
  63. package/dist/cli-bundle/chunks/comments-E73HIEZJ.js +2 -0
  64. package/dist/cli-bundle/chunks/copy-WBYVLCPC.js +2 -0
  65. package/dist/cli-bundle/chunks/{create-RLLCBCXM.js → create-TG67IVFI.js} +2 -2
  66. package/dist/cli-bundle/chunks/delete-6XKUVVQN.js +2 -0
  67. package/dist/cli-bundle/chunks/{deps-J4ONTF4X.js → deps-AJUGP2OH.js} +2 -2
  68. package/dist/cli-bundle/chunks/{docs-YL2DJ4WD.js → docs-QOCLDRKJ.js} +2 -2
  69. package/dist/cli-bundle/chunks/{files-NGNAIYKK.js → files-3ST5TY64.js} +2 -2
  70. package/dist/cli-bundle/chunks/focus-R2AWS63Y.js +2 -0
  71. package/dist/cli-bundle/chunks/{history-compact-HW62K5XP.js → history-compact-7BJFML4S.js} +2 -2
  72. package/dist/cli-bundle/chunks/{history-redact-HVBKUJOW.js → history-redact-WJN3HYXR.js} +2 -2
  73. package/dist/cli-bundle/chunks/{history-repair-OPNBH5JJ.js → history-repair-XDNZUB7F.js} +2 -2
  74. package/dist/cli-bundle/chunks/{learnings-F36PZXT6.js → learnings-SZMUPVNA.js} +2 -2
  75. package/dist/cli-bundle/chunks/{profile-N3XMWBM7.js → profile-KL53JIAC.js} +2 -2
  76. package/dist/cli-bundle/chunks/{register-list-query-BKGHBI7Y.js → register-list-query-QH7ONPKU.js} +2 -2
  77. package/dist/cli-bundle/chunks/register-mutation-OCRQNZK4.js +20 -0
  78. package/dist/cli-bundle/chunks/register-operations-HIBJXRGB.js +2 -0
  79. package/dist/cli-bundle/chunks/register-setup-QWBQ6HBS.js +2 -0
  80. package/dist/cli-bundle/chunks/restore-FXA5QPM7.js +2 -0
  81. package/dist/cli-bundle/chunks/{schema-4PJQMGUY.js → schema-QJ27OTRV.js} +2 -2
  82. package/dist/cli-bundle/chunks/update-7GBO4SXG.js +2 -0
  83. package/dist/cli-bundle/chunks/update-many-VF6ZKQUO.js +2 -0
  84. package/dist/cli-bundle/focused-chunks/chunk-27DK4A5O.js +2 -0
  85. package/dist/cli-bundle/focused-chunks/chunk-4JC3AOGS.js +8 -0
  86. package/dist/cli-bundle/focused-chunks/chunk-6KDHXURF.js +2 -0
  87. package/dist/cli-bundle/focused-chunks/chunk-74CWP3A4.js +2 -0
  88. package/dist/cli-bundle/focused-chunks/chunk-7AZDTGPA.js +2 -0
  89. package/dist/cli-bundle/focused-chunks/chunk-7YTZ7A4E.js +2 -0
  90. package/dist/cli-bundle/focused-chunks/{chunk-ONIX2KKW.js → chunk-CL3NB7VW.js} +2 -2
  91. package/dist/cli-bundle/focused-chunks/chunk-EAXXF2HW.js +4 -0
  92. package/dist/cli-bundle/focused-chunks/{chunk-L6A4NVQC.js → chunk-EYO4F74Z.js} +2 -2
  93. package/dist/cli-bundle/focused-chunks/chunk-GEYU23YS.js +153 -0
  94. package/dist/cli-bundle/focused-chunks/{chunk-DQ4PLKEE.js → chunk-GIERI4YU.js} +2 -2
  95. package/dist/cli-bundle/focused-chunks/chunk-GSW2Y7VZ.js +5 -0
  96. package/dist/cli-bundle/focused-chunks/{chunk-WVGJAD7L.js → chunk-LKQXXO62.js} +2 -2
  97. package/dist/cli-bundle/focused-chunks/{chunk-UFCPSWIL.js → chunk-MBBMTDD3.js} +2 -2
  98. package/dist/cli-bundle/focused-chunks/{chunk-OYTK4VNH.js → chunk-ME4XVOBJ.js} +2 -2
  99. package/dist/cli-bundle/focused-chunks/{chunk-RO5BQFG3.js → chunk-N7QN3NE6.js} +2 -2
  100. package/dist/cli-bundle/focused-chunks/chunk-QL5H3AQH.js +2 -0
  101. package/dist/cli-bundle/focused-chunks/chunk-TQMFQYXR.js +29 -0
  102. package/dist/cli-bundle/focused-chunks/{chunk-SQXVGHMH.js → chunk-XNVXIQ4B.js} +2 -2
  103. package/dist/cli-bundle/focused-chunks/{chunk-BOGRY7M6.js → chunk-YHDCGUIW.js} +10 -10
  104. package/dist/cli-bundle/focused-chunks/{chunk-K37BB4JL.js → chunk-YLPZHWX7.js} +2 -2
  105. package/dist/cli-bundle/main.js +13 -13
  106. package/dist/cli-bundle/sdk-authoring.js +1 -1
  107. package/dist/cli-bundle/sdk-contracts.js +1 -1
  108. package/dist/cli-bundle/sdk-core.js +28 -28
  109. package/dist/cli-bundle/sdk-governance.js +1 -1
  110. package/dist/cli-bundle/sdk-graph.js +1 -1
  111. package/dist/cli-bundle/sdk-merge.js +1 -1
  112. package/dist/cli-bundle/sdk-query.js +1 -1
  113. package/dist/cli-bundle/sdk-runtime.js +1 -1
  114. package/dist/cli-bundle/sdk-testing.js +1 -1
  115. package/dist/cli-bundle/sdk.js +1 -1
  116. package/dist/core/extensions/activation-summary.d.ts +4 -0
  117. package/dist/core/extensions/activation-summary.js +5 -2
  118. package/dist/core/extensions/contribution-inventory.d.ts +1 -0
  119. package/dist/core/extensions/contribution-inventory.js +35 -2
  120. package/dist/core/extensions/extension-hook-runtime.js +5 -3
  121. package/dist/core/extensions/extension-types.d.ts +18 -1
  122. package/dist/core/extensions/extension-types.js +2 -2
  123. package/dist/core/extensions/loader.js +8 -13
  124. package/dist/core/extensions/preflight-ownership.d.ts +5 -0
  125. package/dist/core/extensions/preflight-ownership.js +42 -0
  126. package/dist/core/item/item-format.js +14 -20
  127. package/dist/core/shared/constants.js +3 -2
  128. package/dist/core/store/item-store.js +2 -2
  129. package/dist/core/store/settings.js +2 -2
  130. package/dist/mcp/server.js +12 -6
  131. package/dist/mcp/tool-definitions.js +14 -7
  132. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +18 -18
  133. package/dist/sdk/cli-contracts/agent-output-contracts.js +51 -23
  134. package/dist/sdk/cli-contracts/commander-mutation-options.js +26 -2
  135. package/dist/sdk/cli-contracts/flag-contracts.d.ts +4 -0
  136. package/dist/sdk/cli-contracts/flag-contracts.js +34 -2
  137. package/dist/sdk/cli-contracts/registration-helpers.js +4 -2
  138. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +10 -2
  139. package/dist/sdk/cli-contracts/runtime-contracts.js +21 -5
  140. package/dist/sdk/cli-contracts/tool-schema.js +4 -2
  141. package/dist/sdk/cli-contracts.d.ts +2 -2
  142. package/dist/sdk/cli-contracts.js +4 -4
  143. package/dist/sdk/cli-program.js +3 -3
  144. package/dist/sdk/compose.d.ts +2 -2
  145. package/dist/sdk/compose.js +7 -2
  146. package/dist/sdk/contracts.d.ts +1 -0
  147. package/dist/sdk/contracts.js +3 -2
  148. package/dist/sdk/define.d.ts +3 -1
  149. package/dist/sdk/define.js +3 -8
  150. package/dist/sdk/dependency-provenance.d.ts +2 -0
  151. package/dist/sdk/dependency-provenance.js +7 -3
  152. package/dist/sdk/error-code-catalog.d.ts +23 -0
  153. package/dist/sdk/error-code-catalog.js +25 -5
  154. package/dist/sdk/extension/install-sources.d.ts +43 -5
  155. package/dist/sdk/extension/install-sources.js +36 -2
  156. package/dist/sdk/extension/migrations.d.ts +114 -0
  157. package/dist/sdk/extension/migrations.js +175 -0
  158. package/dist/sdk/extension/scaffold.js +14 -9
  159. package/dist/sdk/extension/source-resolution.d.ts +50 -0
  160. package/dist/sdk/extension/source-resolution.js +66 -0
  161. package/dist/sdk/extension.d.ts +5 -1
  162. package/dist/sdk/extension.js +24 -26
  163. package/dist/sdk/generated-error-code-catalog.js +499 -3
  164. package/dist/sdk/governance/health.js +11 -2
  165. package/dist/sdk/graph/governance.js +3 -3
  166. package/dist/sdk/graph/remediation.js +3 -3
  167. package/dist/sdk/graph/run.js +4 -8
  168. package/dist/sdk/index.d.ts +7 -2
  169. package/dist/sdk/index.js +9 -4
  170. package/dist/sdk/item-transaction.d.ts +51 -6
  171. package/dist/sdk/item-transaction.js +132 -22
  172. package/dist/sdk/lifecycle/create.d.ts +4 -0
  173. package/dist/sdk/lifecycle/create.js +26 -10
  174. package/dist/sdk/lifecycle-policy.d.ts +9 -0
  175. package/dist/sdk/lifecycle-policy.js +22 -9
  176. package/dist/sdk/merge/driver.js +6 -3
  177. package/dist/sdk/output-contracts.d.ts +67 -0
  178. package/dist/sdk/output-contracts.js +173 -0
  179. package/dist/sdk/package-import-adapters.js +2 -2
  180. package/dist/sdk/package-migrations.d.ts +10 -0
  181. package/dist/sdk/package-migrations.js +21 -0
  182. package/dist/sdk/runtime.d.ts +2 -0
  183. package/dist/sdk/runtime.js +6 -2
  184. package/dist/sdk/structured-mutations.d.ts +23 -0
  185. package/dist/sdk/structured-mutations.js +219 -10
  186. package/dist/sdk/workspace-snapshot.js +58 -12
  187. package/dist/sdk/workspace.js +30 -4
  188. package/docs/COMMANDS.md +49 -10
  189. package/docs/EXTENSIONS.md +3 -3
  190. package/docs/EXTENSION_LIFECYCLE.md +46 -0
  191. package/docs/MERGE_SAFETY.md +2 -0
  192. package/docs/PR_REVIEW_LOOP.md +10 -4
  193. package/docs/README.md +23 -22
  194. package/docs/RELEASING.md +36 -23
  195. package/docs/SCRIPTING.md +32 -9
  196. package/docs/SDK.md +122 -14
  197. package/docs/SELF_DESCRIBING_CONTEXT_CONTRACTS.md +13 -0
  198. package/docs/TESTING.md +25 -0
  199. package/docs/examples/sdk-contract-consumer/README.md +11 -1
  200. package/docs/examples/sdk-contract-consumer/package.json +2 -1
  201. package/docs/examples/sdk-contract-consumer/parse-receipt.mjs +22 -0
  202. package/marketplace.json +2 -2
  203. package/package.json +5 -4
  204. package/packages/pm-beads/package.json +1 -1
  205. package/packages/pm-calendar/package.json +1 -1
  206. package/packages/pm-command-kit/package.json +1 -1
  207. package/packages/pm-digital-twin/package.json +1 -1
  208. package/packages/pm-governance-audit/package.json +1 -1
  209. package/packages/pm-guide-shell/package.json +1 -1
  210. package/packages/pm-kanban/package.json +1 -1
  211. package/packages/pm-lifecycle-hooks/package.json +1 -1
  212. package/packages/pm-linked-test-adapters/package.json +1 -1
  213. package/packages/pm-search-advanced/package.json +1 -1
  214. package/packages/pm-templates/package.json +1 -1
  215. package/packages/pm-todos/package.json +1 -1
  216. package/packages/pm-vcs/package.json +1 -1
  217. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  218. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  219. package/sdk/public-surface.json +508 -32
  220. package/dist/cli-bundle/chunks/append-DHBRLHHS.js +0 -2
  221. package/dist/cli-bundle/chunks/chunk-2INN52SU.js +0 -8
  222. package/dist/cli-bundle/chunks/chunk-377OOXUF.js +0 -55
  223. package/dist/cli-bundle/chunks/chunk-6RSK4IFN.js +0 -20
  224. package/dist/cli-bundle/chunks/chunk-ASJJKA57.js +0 -2
  225. package/dist/cli-bundle/chunks/chunk-IYAVULRN.js +0 -2
  226. package/dist/cli-bundle/chunks/chunk-JDPKBV5P.js +0 -2
  227. package/dist/cli-bundle/chunks/chunk-RRQBHQOV.js +0 -2
  228. package/dist/cli-bundle/chunks/chunk-SULWTPQO.js +0 -8
  229. package/dist/cli-bundle/chunks/chunk-V5K52PYW.js +0 -164
  230. package/dist/cli-bundle/chunks/chunk-XBLOD5TZ.js +0 -2
  231. package/dist/cli-bundle/chunks/close-VLHNN6YB.js +0 -2
  232. package/dist/cli-bundle/chunks/close-many-LSJNZKU6.js +0 -2
  233. package/dist/cli-bundle/chunks/comments-AAIA6A6X.js +0 -2
  234. package/dist/cli-bundle/chunks/copy-Z7YMLEHN.js +0 -2
  235. package/dist/cli-bundle/chunks/delete-KNOHHQJM.js +0 -2
  236. package/dist/cli-bundle/chunks/focus-LFRCGALV.js +0 -2
  237. package/dist/cli-bundle/chunks/register-mutation-GU3DCECN.js +0 -20
  238. package/dist/cli-bundle/chunks/register-operations-PTWH727R.js +0 -2
  239. package/dist/cli-bundle/chunks/register-setup-KWV6UD77.js +0 -2
  240. package/dist/cli-bundle/chunks/restore-4HZSLILR.js +0 -2
  241. package/dist/cli-bundle/chunks/update-E6LPS5IV.js +0 -2
  242. package/dist/cli-bundle/chunks/update-many-OSIC6KRO.js +0 -2
  243. package/dist/cli-bundle/focused-chunks/chunk-2VIIXOAD.js +0 -2
  244. package/dist/cli-bundle/focused-chunks/chunk-5MTKO7TV.js +0 -153
  245. package/dist/cli-bundle/focused-chunks/chunk-6GIZK7VQ.js +0 -2
  246. package/dist/cli-bundle/focused-chunks/chunk-AOP2WIZZ.js +0 -2
  247. package/dist/cli-bundle/focused-chunks/chunk-C2QSL62X.js +0 -28
  248. package/dist/cli-bundle/focused-chunks/chunk-CL75YW32.js +0 -2
  249. package/dist/cli-bundle/focused-chunks/chunk-E7OFMWGT.js +0 -8
  250. package/dist/cli-bundle/focused-chunks/chunk-I5F5UK3Q.js +0 -2
  251. package/dist/cli-bundle/focused-chunks/chunk-QM2BIVK7.js +0 -4
  252. package/dist/cli-bundle/focused-chunks/chunk-T5TSY36R.js +0 -5
  253. package/dist/cli-bundle/focused-chunks/chunk-VT6BF2IX.js +0 -2
@@ -4,7 +4,7 @@
4
4
  * Implements the pm health 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]="6d814d40-522c-5bcc-b404-7e6511cf999a")}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]="34fc99f6-45e5-53f2-96eb-767d50ed449c")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
@@ -35,6 +35,7 @@ import { readSettingsWithMetadata } from "../../core/store/settings.js";
35
35
  import { buildRemediationMap } from "../../core/diagnostics/remediation.js";
36
36
  import { scanHistoryAuthorAttribution, } from "../author-attribution.js";
37
37
  import { readManagedExtensionState } from "../extension.js";
38
+ import { applyStoredExtensionMigrationState } from "../extension/migrations.js";
38
39
  import { buildCapabilityContractMetadata, buildRegistrationCollisionRemediation, collectUnknownCapabilityGuidance, } from "../extension/doctor.js";
39
40
  import { scanStaleInProgressItems, } from "./stale-work.js";
40
41
  import { scanTrackedRuntimeCache } from "./tracked-runtime-cache.js";
@@ -605,6 +606,7 @@ async function buildExtensionCheck(pmRoot, settings, noExtensionsFlag) {
605
606
  readManagedExtensionState(loadResult.roots.project),
606
607
  readManagedExtensionState(loadResult.roots.global),
607
608
  ]);
609
+ await applyStoredExtensionMigrationState(pmRoot, activationResult.registrations.migrations);
608
610
  const migrationStatus = summarizeMigrationStatuses(activationResult.registrations.migrations);
609
611
  const activationDetails = {
610
612
  failed: activationResult.failed,
@@ -695,6 +697,13 @@ async function buildExtensionCheck(pmRoot, settings, noExtensionsFlag) {
695
697
  warnings: extensionWarnings,
696
698
  activation: activationDetails,
697
699
  triage: extensionTriage,
700
+ ...(migrationStatus.summary.pending_count > 0
701
+ ? {
702
+ remediation_map: {
703
+ extension_migration_pending: "pm extension migrate --project",
704
+ },
705
+ }
706
+ : {}),
698
707
  capability_contract: capabilityContract,
699
708
  capability_guidance: capabilityGuidance,
700
709
  },
@@ -1955,4 +1964,4 @@ export const _testOnlyHealthCommand = {
1955
1964
  warningCode,
1956
1965
  };
1957
1966
  //# sourceMappingURL=health.js.map
1958
- //# debugId=6d814d40-522c-5bcc-b404-7e6511cf999a
1967
+ //# debugId=34fc99f6-45e5-53f2-96eb-767d50ed449c
@@ -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
@@ -20,7 +20,10 @@ export { quoteCommandArg, quoteWindowsCommandArg, renderPmCommand, } from "./com
20
20
  export { runGc, type GcCheckpointsSummary, type GcLocksSummary, } from "./governance/gc.js";
21
21
  export { _testOnlyHealthCommand, runHealth, type HealthCheck, } from "./governance/health.js";
22
22
  export { _testOnlyValidateCommand, projectValidateCounts, runValidate, type ValidateCheck, type ValidateCountsFixesSummary, type ValidateCountsResult, type ValidateFixesSummary, type ValidateMutationServices, } from "./governance/validate.js";
23
- export { runExtension } from "./extension.js";
23
+ export { runExtension, type ExtensionCommandAction, } from "./extension.js";
24
+ export { resolveExtensionInstallSourceIdentity, type ExtensionInstallSourceCandidate, type ExtensionInstallSourceResolution, type ExtensionInstallSourceSelection, type ResolvedExtensionInstallSource, } from "./extension/source-resolution.js";
25
+ export { applyStoredExtensionMigrationState, readExtensionMigrationState, resolveExtensionMigrationStatePath, runExtensionMigrateAction, runExtensionMigrations, type ExtensionMigrationActionContext, type ExtensionMigrationOutcomeStatus, type ExtensionMigrationReceipt, type ExtensionMigrationRunResult, type ExtensionMigrationState, type ExtensionMigrationStateEntry, type RunExtensionMigrationsOptions, } from "./extension/migrations.js";
26
+ export { findInstalledNpmPackageCandidate, type GithubInstallSource, type InstalledNpmPackageCandidate, type InstallSource, type LocalInstallSource, type NpmInstallSource, type ResolvedInstallSource, } from "./extension/install-sources.js";
24
27
  export { buildExtensionDescribeResult, renderExtensionDescribeMarkdown, type ExtensionCommandClaimant, type ExtensionCommandOwnership, type ExtensionDescribeActivationStatus, type ExtensionDescribeResult, type ExtensionSurfaceDescription, } from "./extension/describe.js";
25
28
  export { runEvent, runMeet, runRemind, type MeetingEventShortcutOptions, type ReminderShortcutOptions, type SchedulingShortcutCommonOptions, } from "./scheduling-shortcuts.js";
26
29
  export { createExtensionCommandSdk } from "./extension-command-context.js";
@@ -45,7 +48,7 @@ export { RESERVED_ITEM_FIELD_NAMES } from "../core/extensions/item-fields.js";
45
48
  export type { LocatedItem } from "../core/store/item-store.js";
46
49
  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
50
  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";
51
+ 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_MIGRATE_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
52
  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
53
  export * from "./compose.js";
51
54
  export * from "./compile-cache.js";
@@ -83,6 +86,7 @@ export * from "./pagination.js";
83
86
  export * from "./query/item-filter-options.js";
84
87
  export * from "./query/parsers.js";
85
88
  export * from "./output.js";
89
+ export * from "./output-contracts.js";
86
90
  export * from "./relationship-analytics.js";
87
91
  export * from "./relationship-context.js";
88
92
  export * from "./relationship-history.js";
@@ -118,6 +122,7 @@ export { runUpgrade } from "./governance/upgrade.js";
118
122
  export { PLAN_SHOW_DEPTH_VALUES, PLAN_SUBCOMMANDS, PLAN_TEMPLATE_NAMES, } from "./lifecycle/plan.js";
119
123
  export * from "./define.js";
120
124
  export { BASELINE_ITEM_FORMAT_VERSION, BUILTIN_ITEM_TYPE_VALUES, CONFIDENCE_TEXT_VALUES, CURRENT_ITEM_FORMAT_VERSION, DEPENDENCY_KIND_VALUES, EXIT_CODE, ISSUE_SEVERITY_VALUES, ITEM_TYPE_VALUES, PM_CLI_EXPECTED_ERROR_NAME, PmCliError, PmClient, RISK_VALUES, STATUS_VALUES, acquireLock, appendHistoryEntry, canonicalDocument, classifyItemFormatVersion, clearWorkspaceContractsCache, commitImportedItem, createHistoryEntry, createPmCliExpectedError, effectiveItemFormatVersion, emptyImportedDocument, ensureTrackerInitialized, generateItemId, getActiveExtensionRegistrations, getContracts, getHistoryPath, getItemPath, getSettingsPath, getWorkspaceContracts, isPmCliExpectedError, isTimestampLiteral, listAllItemMetadata, loadCreateTemplateOptions, locateItem, normalizeItemMetadata, normalizeItemFormatVersion, normalizeItemId, normalizeRawItemId, normalizeStatusInput, nowIso, parseTags, pathExists, readBooleanOption, readCsvListOption, readFileIfExists, readLocatedItem, readRequiredString, readSettings, readStringOption, removeFileIfExists, renderCalendarMarkdown, renderCalendarToon, renderGuideMarkdown, resolveCalendarOutputFormat, resolveGuideOutputFormat, resolveItemTypeRegistry, resolveImplicitPmRoot, resolvePmRoot, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, runAction, runActiveOnReadHooks, runActiveOnWriteHooks, runCalendar, runCompletion, runGuide, runList, runReindex, runSearch, runTemplatesList, runTemplatesSave, runTemplatesShow, runTestRunsList, runTestRunsLogs, runTestRunsResume, runTestRunsStatus, runTestRunsStop, scanItemFormatVersions, selectImportAuthor, serializeItemDocument, splitFrontMatter, toEstimatedMinutesValue, toImportBoolean, toImportConfidence, toImportInteger, toImportLinkedDocs, toImportLinkedFiles, toImportLinkedTests, toImportLogEntries, toImportNormalizedEnum, toImportNumberMap, toImportPriority, toImportStatus, toImportStringList, toImportStringMap, toImportTags, toNonEmptyImportString, writeFileAtomic, aggregate, append, claim, claimNext, close, closeTask, comments, config, context, copy, create, deleteItem, deps, docs, duplicates, extension, extensionActivate, extensionDeactivate, extensionList, files, filesDiscover, filesLookup, focus, gc, get, graph, health, historyCompact, historyCompactBulk, historyRedact, historyRepair, historyRepairAll, init, learnings, list, next, notes, packageActivate, packageCatalog, packageDeactivate, packageDescribe, packageDoctor, packageInstall, packageLifecycle, packageList, packageManage, packageReload, packageUninstall, pauseTask, profile, profileApply, profileLint, profileList, profileShow, release, restore, schema, schemaAddField, schemaAddStatus, schemaAddType, schemaApplyPreset, schemaInferTypes, schemaList, schemaListFields, schemaRemapStatus, schemaRemoveField, schemaRemoveStatus, schemaRemoveType, schemaShow, schemaShowField, schemaShowStatus, schemaRenameField, schemaRenameType, search, startTask, stats, update, upgrade, validate, type AggregateOptions, type AggregateResult, type AggregateRow, type AppendCommandOptions, type AppendResult, type BlockerEntry, type CalendarOptions, type CalendarResult, type ClaimResult, type CloseResult, type CloseTaskResult, type CommitImportedItemParams, type CommitImportedItemResult, type CommentsCommandOptions, type CommentsResult, type ConfigCommandOptions, type ConfigResult, type CompletionResult, type CompletionShell, type ContractsCommandOptions, type ContractsResult, type ContextFocusItem, type ContextOptions, type ContextOutputFormat, type ContextResult, type CopyResult, type CreatePmCliExpectedErrorOptions, type CreateResult, type CreateTemplateOptions, type Dependency, type DeleteResult, type DepsCommandOptions, type DepsResult, type DocsCommandOptions, type DocsResult, type ExtensionCommandOptions, type ExtensionCommandResult, type FilesCommandOptions, type FilesDiscoverOptions, type FilesDiscoverResult, type FilesLookupOptions, type FilesLookupResult, type FilesResult, type FocusResult, type GcCommandOptions, type GcResult, type GetContractsOptions, type GetOptions, type GetResult, type GuideDepth, type GuideOptions, type GuideOutputFormat, type GuideResult, type HealthResult, type ImportLinkedScope, type InitCommandOptions, type InitResult, type ItemFormatVersionScanEntry, type ItemFormatVersionScanResult, type ItemFormatVersionStatus, type LearningsCommandOptions, type LearningsResult, type LinkedDoc, type LinkedFile, type LinkedTest, type ListedItem, type ListCompactResult, type ListFullResult, type ListOptions, type ListProjectedItem, type ListProjectedItemCore, type ListResult, type ListResultItem, type ListSortField, type ListSortOrder, type ListTreeItem, type ListTreeMetadata, type ListVerboseResult, type LogNote, type NextActionableItem, type NextBlockerRef, type NextOptions, type NextOutputFormat, type NextRecommendation, type NextResult, type NotesCommandOptions, type NotesResult, type PackageCommandOptions, type PackageCommandResult, type PauseTaskResult, type PmActionInput, type PmActionName, type PmActionOptions, type PmClientCloseActionOptions, type PmClientFullMutationOptions, type PmClientMutationOptions, type PmClientOptions, type PmClientRunArgs, type PmCliExpectedError, type ProfileApplyCommandOptions, type ProfileApplyResult, type ProfileLintResult, type ProfileListResult, type ProfileResult, type ProfileShowResult, type ProfileSubcommand, type ReindexOptions, type ReindexResult, type ReleaseResult, type RestoreResult, type RunHealthOptions, type SchemaAddFieldCommandOptions, type SchemaAddFieldResult, type SchemaAddStatusCommandOptions, type SchemaAddStatusResult, type SchemaAddTypeCommandOptions, type SchemaAddTypeInferCommandOptions, type SchemaAddTypeInferResult, type SchemaAddTypeResult, type SchemaApplyPresetCommandOptions, type SchemaApplyPresetResult, type SchemaInspectResult, type SchemaListFieldsResult, type SchemaListResult, type SchemaRemoveFieldCommandOptions, type SchemaRemoveFieldResult, type SchemaRemoveStatusCommandOptions, type SchemaRemoveStatusResult, type SchemaRemoveTypeCommandOptions, type SchemaRemoveTypeResult, type SchemaShowFieldResult, type SchemaShowResult, type SchemaShowStatusResult, type SchemaResult, type RunSchemaEvolutionMigrationOptions, type SchemaEvolutionMigrationRequest, type SchemaEvolutionMigrationResult, type SchemaSubcommand, type SearchCompactResult, type SearchHit, type SearchHitHighlight, type SearchMatchMode, type SearchOptions, type ClaimNextOptions, type SearchResult, type SearchResultItem, type SearchVerboseResult, type StartTaskResult, type StatsCommandOptions, type StatsResult, type TemplatesListResult, type TemplatesSaveResult, type TemplatesShowResult, type TestRunsListCommandOptions, type TestRunsLogsCommandOptions, type TestRunsResumeCommandOptions, type TestRunsStopCommandOptions, type ToImportLinkedArtifactsOptions, type ToImportLinkedTestsOptions, type ToImportLogEntriesOptions, type UpdateResult, type UpgradeCommandOptions, type UpgradeResult, type ValidateCommandOptions, type ValidateResult, type WorkspaceContracts, type WorkspaceContractsOptions, type WorkspaceExtensionCommandContract, type WorkspaceFieldContract, } from "./runtime.js";
125
+ export { extensionMigrate, packageMigrate } from "./package-migrations.js";
121
126
  export { CONTEXT_OUTPUT_VALUES, NEXT_OUTPUT_VALUES, PM_GITIGNORE_END, PM_GITIGNORE_START, analyzeSdkActionCoverage, ensurePmGitignore, getPmGitignoreBlock, closeItem, runAggregate, runClose, runCopy, runContext, runDelete, runFocus, runGet, runNext, runRestore, runUpdate, type CloseCommandOptions, type CopyOptions, type DeleteCommandOptions, type EnsurePmGitignoreResult, type HierarchyChild, type HierarchyNode, type HotFile, type FocusOptions, type ImportPriorityValue, type ProgressEntry, type RecentContextItem, type RestoreCommandOptions, type SdkActionCoverageRow, type StaleEntry, type TestHealthSummary, type UpdateCommandOptions, type WorkloadEntry, } from "./runtime.js";
122
127
  export { runStats } from "./stats.js";
123
128
  export { DEFAULT_EVAL_QUERIES_RELATIVE_PATH, EVAL_QUERY_SET_CONTRACT, EVAL_QUERY_SET_EXAMPLE, EVAL_QUERY_SET_SCHEMA_ID, parseEvalQuerySet, runEval, type EvalOptions, type EvalQueryReport, type EvalResult, } from "./eval.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]="4e336574-f00e-5296-a55f-7f27a264188c")}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";
@@ -21,7 +21,10 @@ export { quoteCommandArg, quoteWindowsCommandArg, renderPmCommand, } from "./com
21
21
  export { runGc, } from "./governance/gc.js";
22
22
  export { _testOnlyHealthCommand, runHealth, } from "./governance/health.js";
23
23
  export { _testOnlyValidateCommand, projectValidateCounts, runValidate, } from "./governance/validate.js";
24
- export { runExtension } from "./extension.js";
24
+ export { runExtension, } from "./extension.js";
25
+ export { resolveExtensionInstallSourceIdentity, } from "./extension/source-resolution.js";
26
+ export { applyStoredExtensionMigrationState, readExtensionMigrationState, resolveExtensionMigrationStatePath, runExtensionMigrateAction, runExtensionMigrations, } from "./extension/migrations.js";
27
+ export { findInstalledNpmPackageCandidate, } from "./extension/install-sources.js";
25
28
  export { buildExtensionDescribeResult, renderExtensionDescribeMarkdown, } from "./extension/describe.js";
26
29
  export { runEvent, runMeet, runRemind, } from "./scheduling-shortcuts.js";
27
30
  export { createExtensionCommandSdk } from "./extension-command-context.js";
@@ -44,7 +47,7 @@ export { PROFILE_SUBCOMMANDS, formatProfileApplyHuman, formatProfileLintHuman, f
44
47
  export * from "./extension-contracts.js";
45
48
  export { RESERVED_ITEM_FIELD_NAMES } from "../core/extensions/item-fields.js";
46
49
  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";
50
+ 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_MIGRATE_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
51
  export * from "./compose.js";
49
52
  export * from "./compile-cache.js";
50
53
  export * from "./context-relevance.js";
@@ -81,6 +84,7 @@ export * from "./pagination.js";
81
84
  export * from "./query/item-filter-options.js";
82
85
  export * from "./query/parsers.js";
83
86
  export * from "./output.js";
87
+ export * from "./output-contracts.js";
84
88
  export * from "./relationship-analytics.js";
85
89
  export * from "./relationship-context.js";
86
90
  export * from "./relationship-history.js";
@@ -110,6 +114,7 @@ export { runUpgrade } from "./governance/upgrade.js";
110
114
  export { PLAN_SHOW_DEPTH_VALUES, PLAN_SUBCOMMANDS, PLAN_TEMPLATE_NAMES, } from "./lifecycle/plan.js";
111
115
  export * from "./define.js";
112
116
  export { BASELINE_ITEM_FORMAT_VERSION, BUILTIN_ITEM_TYPE_VALUES, CONFIDENCE_TEXT_VALUES, CURRENT_ITEM_FORMAT_VERSION, DEPENDENCY_KIND_VALUES, EXIT_CODE, ISSUE_SEVERITY_VALUES, ITEM_TYPE_VALUES, PM_CLI_EXPECTED_ERROR_NAME, PmCliError, PmClient, RISK_VALUES, STATUS_VALUES, acquireLock, appendHistoryEntry, canonicalDocument, classifyItemFormatVersion, clearWorkspaceContractsCache, commitImportedItem, createHistoryEntry, createPmCliExpectedError, effectiveItemFormatVersion, emptyImportedDocument, ensureTrackerInitialized, generateItemId, getActiveExtensionRegistrations, getContracts, getHistoryPath, getItemPath, getSettingsPath, getWorkspaceContracts, isPmCliExpectedError, isTimestampLiteral, listAllItemMetadata, loadCreateTemplateOptions, locateItem, normalizeItemMetadata, normalizeItemFormatVersion, normalizeItemId, normalizeRawItemId, normalizeStatusInput, nowIso, parseTags, pathExists, readBooleanOption, readCsvListOption, readFileIfExists, readLocatedItem, readRequiredString, readSettings, readStringOption, removeFileIfExists, renderCalendarMarkdown, renderCalendarToon, renderGuideMarkdown, resolveCalendarOutputFormat, resolveGuideOutputFormat, resolveItemTypeRegistry, resolveImplicitPmRoot, resolvePmRoot, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, runAction, runActiveOnReadHooks, runActiveOnWriteHooks, runCalendar, runCompletion, runGuide, runList, runReindex, runSearch, runTemplatesList, runTemplatesSave, runTemplatesShow, runTestRunsList, runTestRunsLogs, runTestRunsResume, runTestRunsStatus, runTestRunsStop, scanItemFormatVersions, selectImportAuthor, serializeItemDocument, splitFrontMatter, toEstimatedMinutesValue, toImportBoolean, toImportConfidence, toImportInteger, toImportLinkedDocs, toImportLinkedFiles, toImportLinkedTests, toImportLogEntries, toImportNormalizedEnum, toImportNumberMap, toImportPriority, toImportStatus, toImportStringList, toImportStringMap, toImportTags, toNonEmptyImportString, writeFileAtomic, aggregate, append, claim, claimNext, close, closeTask, comments, config, context, copy, create, deleteItem, deps, docs, duplicates, extension, extensionActivate, extensionDeactivate, extensionList, files, filesDiscover, filesLookup, focus, gc, get, graph, health, historyCompact, historyCompactBulk, historyRedact, historyRepair, historyRepairAll, init, learnings, list, next, notes, packageActivate, packageCatalog, packageDeactivate, packageDescribe, packageDoctor, packageInstall, packageLifecycle, packageList, packageManage, packageReload, packageUninstall, pauseTask, profile, profileApply, profileLint, profileList, profileShow, release, restore, schema, schemaAddField, schemaAddStatus, schemaAddType, schemaApplyPreset, schemaInferTypes, schemaList, schemaListFields, schemaRemapStatus, schemaRemoveField, schemaRemoveStatus, schemaRemoveType, schemaShow, schemaShowField, schemaShowStatus, schemaRenameField, schemaRenameType, search, startTask, stats, update, upgrade, validate, } from "./runtime.js";
117
+ export { extensionMigrate, packageMigrate } from "./package-migrations.js";
113
118
  export { CONTEXT_OUTPUT_VALUES, NEXT_OUTPUT_VALUES, PM_GITIGNORE_END, PM_GITIGNORE_START, analyzeSdkActionCoverage, ensurePmGitignore, getPmGitignoreBlock, closeItem, runAggregate, runClose, runCopy, runContext, runDelete, runFocus, runGet, runNext, runRestore, runUpdate, } from "./runtime.js";
114
119
  export { runStats } from "./stats.js";
115
120
  export { DEFAULT_EVAL_QUERIES_RELATIVE_PATH, EVAL_QUERY_SET_CONTRACT, EVAL_QUERY_SET_EXAMPLE, EVAL_QUERY_SET_SCHEMA_ID, parseEvalQuerySet, runEval, } from "./eval.js";
@@ -128,4 +133,4 @@ export * from "./governance.js";
128
133
  export * from "./query.js";
129
134
  export * from "./testing.js";
130
135
  //# sourceMappingURL=index.js.map
131
- //# debugId=d5bccdd6-a532-570a-b545-f316abaaf70b
136
+ //# debugId=4e336574-f00e-5296-a55f-7f27a264188c
@@ -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. */