@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
@@ -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]="8d5e0d6f-5ffa-5302-87da-3e741b80b716")}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]="1d184acd-e639-5b28-a294-98d22de2ebc7")}catch(e){}}();
3
3
  import { collectUsedExtensionCapabilities, normalizeExtensionName, } from "./capability-usage.js";
4
4
  /**
5
5
  * Canonical lifecycle hook kinds paired with their {@link ExtensionHookRegistry}
@@ -77,10 +77,13 @@ export function describeExtensionActivation(activation, options = {}) {
77
77
  ? { renderer_ownership: rendererOwnership }
78
78
  : {}),
79
79
  preflight_overrides: preflight.overrides.filter((entry) => matches(entry.name)).length,
80
+ preflight_ownership: preflight.overrides
81
+ .filter((entry) => matches(entry.name))
82
+ .map((entry) => ({ commands: [...(entry.commands ?? [])] })),
80
83
  };
81
84
  }
82
85
  function sortUnique(values) {
83
86
  return [...new Set(values)].sort((left, right) => left.localeCompare(right));
84
87
  }
85
88
  //# sourceMappingURL=activation-summary.js.map
86
- //# debugId=8d5e0d6f-5ffa-5302-87da-3e741b80b716
89
+ //# debugId=1d184acd-e639-5b28-a294-98d22de2ebc7
@@ -22,4 +22,5 @@ export declare function createExtensionContributionInventory(summary: {
22
22
  renderer_overrides: string[];
23
23
  renderer_ownership?: ExtensionContributionInventory["renderer_ownership"];
24
24
  preflight_overrides: number;
25
+ preflight_ownership?: ExtensionContributionInventory["preflight_ownership"];
25
26
  }): ExtensionContributionInventory;
@@ -4,7 +4,7 @@
4
4
  * Validates and canonicalizes the serializable extension surface inventory.
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]="8ba4e82a-ab38-5527-84cf-ec553f434a22")}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]="2c4e3831-6644-5db3-a28b-1c6a131da2e1")}catch(e){}}();
8
8
  import { normalizeCommandName } from "./extension-runtime-helpers.js";
9
9
  const COMMAND_PATH_FIELDS = new Set([
10
10
  "commands",
@@ -75,6 +75,29 @@ function normalizeRendererOwnership(value) {
75
75
  }
76
76
  return ownership.sort((left, right) => left.format.localeCompare(right.format));
77
77
  }
78
+ /** Validate preflight command ownership without importing extension code. */
79
+ function normalizePreflightOwnership(value) {
80
+ if (!Array.isArray(value))
81
+ return null;
82
+ const ownership = [];
83
+ for (const rawEntry of value) {
84
+ if (typeof rawEntry !== "object" || rawEntry === null)
85
+ return null;
86
+ const commands = rawEntry.commands;
87
+ if (!Array.isArray(commands) ||
88
+ commands.some((command) => typeof command !== "string")) {
89
+ return null;
90
+ }
91
+ ownership.push({
92
+ commands: [
93
+ ...new Set(commands.map((command) => normalizeCommandName(command))),
94
+ ]
95
+ .filter((command) => command.length > 0)
96
+ .sort((left, right) => left.localeCompare(right)),
97
+ });
98
+ }
99
+ return ownership;
100
+ }
78
101
  /** Normalize an optional contribution inventory, returning null for malformed data. */
79
102
  export function normalizeExtensionContributionInventory(value) {
80
103
  if (value === undefined || value === null)
@@ -102,6 +125,13 @@ export function normalizeExtensionContributionInventory(value) {
102
125
  return null;
103
126
  inventory.renderer_ownership = ownership;
104
127
  }
128
+ const rawPreflightOwnership = record.preflight_ownership;
129
+ if (rawPreflightOwnership !== undefined) {
130
+ const ownership = normalizePreflightOwnership(rawPreflightOwnership);
131
+ if (ownership === null)
132
+ return null;
133
+ inventory.preflight_ownership = ownership;
134
+ }
105
135
  return inventory;
106
136
  }
107
137
  /** Project an activation summary into the versioned static inventory contract. */
@@ -131,7 +161,10 @@ export function createExtensionContributionInventory(summary) {
131
161
  ? { renderer_ownership: summary.renderer_ownership }
132
162
  : {}),
133
163
  preflight_overrides: summary.preflight_overrides,
164
+ ...(summary.preflight_ownership
165
+ ? { preflight_ownership: summary.preflight_ownership }
166
+ : {}),
134
167
  };
135
168
  }
136
169
  //# sourceMappingURL=contribution-inventory.js.map
137
- //# debugId=8ba4e82a-ab38-5527-84cf-ec553f434a22
170
+ //# debugId=2c4e3831-6644-5db3-a28b-1c6a131da2e1
@@ -4,7 +4,7 @@
4
4
  * Implements extension runtime contracts and governance for Extension Hook Runtime.
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]="4c40667c-1e20-5813-b2f3-eb4cb966b246")}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]="ac377139-8ce2-58ad-8005-0ac907a9baed")}catch(e){}}();
8
8
  import { cloneCommandOptionsSnapshot, cloneContextSnapshot, cloneGlobalOptionsSnapshot, normalizeCommandName, } from "./extension-runtime-helpers.js";
9
9
  import { stableValueEquals } from "../shared/serialization.js";
10
10
  import { EXIT_CODE } from "../shared/constants.js";
@@ -337,7 +337,6 @@ export async function runParserOverride(parsers, context) {
337
337
  }
338
338
  /** Implements run preflight override for the public runtime surface of this module. */
339
339
  export async function runPreflightOverride(preflight, context) {
340
- const matched = [...preflight.overrides].reverse()[0];
341
340
  const baseContext = {
342
341
  command: normalizeCommandName(context.command),
343
342
  args: cloneContextSnapshot(context.args),
@@ -349,6 +348,9 @@ export async function runPreflightOverride(preflight, context) {
349
348
  pm_root_rel: context.pm_root_rel,
350
349
  };
351
350
  const baseDecision = cloneContextSnapshot(context.decision);
351
+ const matched = [...preflight.overrides]
352
+ .reverse()
353
+ .find((entry) => !entry.commands?.length || entry.commands.includes(baseContext.command));
352
354
  if (!matched) {
353
355
  return {
354
356
  overridden: false,
@@ -693,4 +695,4 @@ export function runRendererOverride(renderers, context) {
693
695
  }
694
696
  }
695
697
  //# sourceMappingURL=extension-hook-runtime.js.map
696
- //# debugId=4c40667c-1e20-5813-b2f3-eb4cb966b246
698
+ //# debugId=ac377139-8ce2-58ad-8005-0ac907a9baed
@@ -162,6 +162,11 @@ export interface ExtensionContributionInventory {
162
162
  }>;
163
163
  /** Number of preflight overrides in the package. */
164
164
  preflight_overrides?: number;
165
+ /** Optional command ownership for each preflight override. Empty commands mean global ownership. */
166
+ preflight_ownership?: Array<{
167
+ /** Command paths on which the override may run. */
168
+ commands: string[];
169
+ }>;
165
170
  }
166
171
  /** Documents the extension manifest payload exchanged by command, SDK, and package integrations. */
167
172
  export interface ExtensionManifest {
@@ -457,6 +462,16 @@ export type CommandHandler = (context: CommandHandlerContext) => unknown;
457
462
  export type ParserOverride = (context: ParserOverrideContext) => ParserOverrideDelta | Promise<ParserOverrideDelta>;
458
463
  /** Restricts preflight override values accepted by command, SDK, and storage contracts. */
459
464
  export type PreflightOverride = (context: PreflightOverrideContext) => PreflightOverrideDelta | Promise<PreflightOverrideDelta>;
465
+ /** Static ownership declaration used to select and diagnose preflight overrides. */
466
+ export interface PreflightOverrideOwnership {
467
+ /** Normalized command paths on which this preflight override may run. */
468
+ commands?: string[];
469
+ }
470
+ /** Declarative preflight override paired with statically inspectable ownership. */
471
+ export interface ScopedPreflightOverrideDefinition extends PreflightOverrideOwnership {
472
+ /** Preflight handler invoked only for a declared command, or globally when unscoped. */
473
+ run: PreflightOverride;
474
+ }
460
475
  /** Explicitly claims or declines one service payload without relying on object identity. */
461
476
  export type ServiceOverrideDecision = {
462
477
  handled: true;
@@ -1065,6 +1080,8 @@ export interface RegisteredExtensionPreflightOverride {
1065
1080
  name: string;
1066
1081
  /** Value that configures or reports run for this contract. */
1067
1082
  run: PreflightOverride;
1083
+ /** Normalized command paths owned by this preflight override. */
1084
+ commands?: string[];
1068
1085
  }
1069
1086
  /** Documents the registered extension service override payload exchanged by command, SDK, and package integrations. */
1070
1087
  export interface RegisteredExtensionServiceOverride {
@@ -1330,7 +1347,7 @@ export interface ExtensionApi {
1330
1347
  /** Value that configures or reports register parser for this contract. */
1331
1348
  registerParser(command: string, override: ParserOverride): void;
1332
1349
  /** Value that configures or reports register preflight for this contract. */
1333
- registerPreflight(override: PreflightOverride): void;
1350
+ registerPreflight(override: PreflightOverride | ScopedPreflightOverrideDefinition): void;
1334
1351
  /** Value that configures or reports register service for this contract. */
1335
1352
  registerService(service: ExtensionServiceName, override: ServiceOverride): void;
1336
1353
  /** Value that configures or reports register flags for this contract. */
@@ -1,6 +1,6 @@
1
1
  /** Public contract for known extension capabilities, shared by SDK and presentation-layer consumers. */
2
2
 
3
- !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]="938c39a8-6545-5d8b-b717-69138932d528")}catch(e){}}();
3
+ !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]="50ad61f1-6719-541c-b4e0-4a88468725cf")}catch(e){}}();
4
4
  export const KNOWN_EXTENSION_CAPABILITIES = [
5
5
  "commands",
6
6
  "renderers",
@@ -99,4 +99,4 @@ export function createDefaultExtensionGovernancePolicy() {
99
99
  };
100
100
  }
101
101
  //# sourceMappingURL=extension-types.js.map
102
- //# debugId=938c39a8-6545-5d8b-b717-69138932d528
102
+ //# debugId=50ad61f1-6719-541c-b4e0-4a88468725cf
@@ -4,7 +4,7 @@
4
4
  * Implements extension runtime contracts and governance for Loader.
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]="b21c2101-ceac-54b1-acaa-6c8d9c25ae8b")}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]="3d5208e5-0ea5-54a5-82a8-50294b4a0655")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { pathToFileURL } from "node:url";
@@ -17,6 +17,7 @@ import { flattenFlagListValue, isFlagDefaultValueCoercible, resolveFlagValueKind
17
17
  import { KNOWN_ITEM_FIELD_TYPES, normalizeItemFieldType, suggestKnownItemFieldType, } from "./item-field-types.js";
18
18
  import { snapshotExtensionModuleGraph } from "./module-graph-snapshot.js";
19
19
  import { captureExtensionActivationRollback } from "./activation-transaction.js";
20
+ import { collectPreflightCollisionWarnings, normalizePreflightOverride, } from "./preflight-ownership.js";
20
21
  import { assertCommandDefinitionMetadataStrings } from "./command-visibility-tier.js";
21
22
  import { asRegistrationRecord, assertOptionalBooleanField, assertOptionalFlagDefaultField, assertOptionalStringArrayField, assertOptionalStringField, normalizeOptionalStringArrayField, } from "./registration-validation.js";
22
23
  import { describeExtensionLongFlagFailure, findExtensionFlagTokenFailure, } from "./flag-definition-validation.js";
@@ -1675,11 +1676,11 @@ class ExtensionApiRegistrar {
1675
1676
  if (!this.allowRegistration("preflight.override", "registerPreflight", "preflight")) {
1676
1677
  return;
1677
1678
  }
1678
- assertFunctionHandler("registerPreflight override", override);
1679
+ const normalized = normalizePreflightOverride(override);
1679
1680
  this.#preflightRegistry.overrides.push({
1680
1681
  layer: this.#loadedExtension.layer,
1681
1682
  name: this.#loadedExtension.name,
1682
- run: override,
1683
+ ...normalized,
1683
1684
  });
1684
1685
  }
1685
1686
  registerService(service, override) {
@@ -2143,6 +2144,9 @@ function collectRendererCollisionWarnings(renderers) {
2143
2144
  }
2144
2145
  const winner = bucket[bucket.length - 1];
2145
2146
  for (const displaced of bucket.slice(0, -1)) {
2147
+ if (winner.commands?.length && displaced.commands?.length && !displaced.commands.some((command) => winner.commands?.includes(command))) {
2148
+ continue;
2149
+ }
2146
2150
  warnings.push(`extension_renderer_collision:${format}:${winner.layer}:${winner.name}:${displaced.layer}:${displaced.name}`);
2147
2151
  }
2148
2152
  }
@@ -2168,15 +2172,6 @@ function collectParserCollisionWarnings(parsers) {
2168
2172
  }
2169
2173
  return warnings;
2170
2174
  }
2171
- function collectPreflightCollisionWarnings(preflight) {
2172
- if (preflight.overrides.length <= 1) {
2173
- return [];
2174
- }
2175
- const winner = preflight.overrides[preflight.overrides.length - 1];
2176
- return preflight.overrides
2177
- .slice(0, -1)
2178
- .map((displaced) => `extension_preflight_override_collision:${winner.layer}:${winner.name}:${displaced.layer}:${displaced.name}`);
2179
- }
2180
2175
  // Services whose runtime semantics are chain/fall-through (each override gets a chance);
2181
2176
  // for those, registering multiple overrides is by design, not a collision.
2182
2177
  const CHAINED_SERVICE_NAMES = new Set(["output_format"]);
@@ -2317,4 +2312,4 @@ export const _testOnlyLoader = {
2317
2312
  },
2318
2313
  };
2319
2314
  //# sourceMappingURL=loader.js.map
2320
- //# debugId=b21c2101-ceac-54b1-acaa-6c8d9c25ae8b
2315
+ //# debugId=3d5208e5-0ea5-54a5-82a8-50294b4a0655
@@ -0,0 +1,5 @@
1
+ import type { ExtensionPreflightRegistry, PreflightOverride, RegisteredExtensionPreflightOverride, ScopedPreflightOverrideDefinition } from "./extension-types.js";
2
+ /** Normalize one callback or scoped definition into a registered handler payload. */
3
+ export declare function normalizePreflightOverride(override: PreflightOverride | ScopedPreflightOverrideDefinition): Pick<RegisteredExtensionPreflightOverride, "run" | "commands">;
4
+ /** Report pairwise overlap while permitting disjoint scoped ownership. */
5
+ export declare function collectPreflightCollisionWarnings(preflight: ExtensionPreflightRegistry): string[];
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @module core/extensions/preflight-ownership
3
+ *
4
+ * Normalizes preflight ownership and diagnoses competing registrations.
5
+ */
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]="065f61c6-2123-5a6d-984a-569bb14d6911")}catch(e){}}();
8
+ import { normalizeCommandName } from "./extension-runtime-helpers.js";
9
+ /** Normalize one callback or scoped definition into a registered handler payload. */
10
+ export function normalizePreflightOverride(override) {
11
+ const run = typeof override === "function" ? override : override.run;
12
+ if (typeof run !== "function") {
13
+ throw new TypeError("registerPreflight override requires a function handler");
14
+ }
15
+ const commands = [
16
+ ...new Set((typeof override === "function" ? [] : (override.commands ?? [])).map((command) => {
17
+ if (typeof command !== "string" || command.trim().length === 0) {
18
+ throw new TypeError("registerPreflight ownership.commands must contain non-empty command paths");
19
+ }
20
+ return normalizeCommandName(command);
21
+ })),
22
+ ];
23
+ return { run, ...(commands.length > 0 ? { commands } : {}) };
24
+ }
25
+ /** Report pairwise overlap while permitting disjoint scoped ownership. */
26
+ export function collectPreflightCollisionWarnings(preflight) {
27
+ const warnings = [];
28
+ for (let winnerIndex = 1; winnerIndex < preflight.overrides.length; winnerIndex += 1) {
29
+ const winner = preflight.overrides[winnerIndex];
30
+ for (const displaced of preflight.overrides.slice(0, winnerIndex)) {
31
+ if (winner.commands?.length &&
32
+ displaced.commands?.length &&
33
+ !displaced.commands.some((command) => winner.commands.includes(command))) {
34
+ continue;
35
+ }
36
+ warnings.push(`extension_preflight_override_collision:${winner.layer}:${winner.name}:${displaced.layer}:${displaced.name}`);
37
+ }
38
+ }
39
+ return warnings;
40
+ }
41
+ //# sourceMappingURL=preflight-ownership.js.map
42
+ //# debugId=065f61c6-2123-5a6d-984a-569bb14d6911
@@ -4,7 +4,7 @@
4
4
  * Defines item parsing, formatting, and lifecycle helpers for Item Format.
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]="c9225594-bc3b-5b07-8703-1debd1a98693")}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]="a4c22692-fe27-5178-bba2-190ac3f80628")}catch(e){}}();
8
8
  import { encode as encodeToon } from "@toon-format/toon";
9
9
  import { isDeepStrictEqual } from "node:util";
10
10
  import { CONFIDENCE_TEXT_VALUES, ISSUE_SEVERITY_VALUES, PLAN_STEP_STATUS_VALUES, RECURRENCE_FREQUENCY_VALUES, RECURRENCE_WEEKDAY_VALUES, STATUS_VALUES, weekdayOrderIndex, } from "../../types/index.js";
@@ -116,6 +116,12 @@ function assertItemMetadataCondition(condition, message) {
116
116
  validationError(message);
117
117
  }
118
118
  }
119
+ function requireItemMetadataRecord(value, message) {
120
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
121
+ validationError(message);
122
+ }
123
+ return value;
124
+ }
119
125
  function assertTimestampField(record, fieldName) {
120
126
  const rawValue = record[fieldName];
121
127
  assertItemMetadataCondition(typeof rawValue === "string", `${fieldName} must be a string`);
@@ -168,10 +174,7 @@ function assertRecurrenceExdates(value) {
168
174
  }
169
175
  }
170
176
  function assertValidRecurrenceRule(recurrence) {
171
- assertItemMetadataCondition(typeof recurrence === "object" &&
172
- recurrence !== null &&
173
- !Array.isArray(recurrence), "event.recurrence must be an object");
174
- const recurrenceRecord = recurrence;
177
+ const recurrenceRecord = requireItemMetadataRecord(recurrence, "event.recurrence must be an object");
175
178
  assertItemMetadataCondition(typeof recurrenceRecord.freq === "string", "event.recurrence.freq must be a string");
176
179
  const frequency = recurrenceRecord.freq.trim().toLowerCase();
177
180
  assertItemMetadataCondition(RECURRENCE_FREQUENCY_VALUES.includes(frequency), `event.recurrence.freq must be one of: ${RECURRENCE_FREQUENCY_VALUES.join(", ")}`);
@@ -261,10 +264,7 @@ function assertReminderEntries(record) {
261
264
  }
262
265
  assertItemMetadataCondition(Array.isArray(reminders), "reminders must be an array");
263
266
  for (const reminder of reminders) {
264
- assertItemMetadataCondition(typeof reminder === "object" &&
265
- reminder !== null &&
266
- !Array.isArray(reminder), "reminders entries must be objects");
267
- const reminderRecord = reminder;
267
+ const reminderRecord = requireItemMetadataRecord(reminder, "reminders entries must be objects");
268
268
  assertItemMetadataCondition(typeof reminderRecord.at === "string", "reminder.at must be a string");
269
269
  assertItemMetadataCondition(isTimestampLiteral(reminderRecord.at), "reminder.at must be a valid ISO timestamp");
270
270
  assertItemMetadataCondition(typeof reminderRecord.text === "string", "reminder.text must be a string");
@@ -294,8 +294,7 @@ function assertEventRecurrence(eventRecord) {
294
294
  }
295
295
  }
296
296
  function assertCalendarEventEntry(event) {
297
- assertItemMetadataCondition(typeof event === "object" && event !== null && !Array.isArray(event), "events entries must be objects");
298
- const eventRecord = event;
297
+ const eventRecord = requireItemMetadataRecord(event, "events entries must be objects");
299
298
  assertItemMetadataCondition(typeof eventRecord.start_at === "string", "event.start_at must be a string");
300
299
  assertItemMetadataCondition(isTimestampLiteral(eventRecord.start_at), "event.start_at must be a valid ISO timestamp");
301
300
  if (eventRecord.end_at !== undefined) {
@@ -337,10 +336,8 @@ function assertTypeOptionsField(record) {
337
336
  if (typeOptions === undefined) {
338
337
  return;
339
338
  }
340
- assertItemMetadataCondition(typeof typeOptions === "object" &&
341
- typeOptions !== null &&
342
- !Array.isArray(typeOptions), "type_options must be an object");
343
- for (const [optionKey, optionValue] of Object.entries(typeOptions)) {
339
+ const typeOptionsRecord = requireItemMetadataRecord(typeOptions, "type_options must be an object");
340
+ for (const [optionKey, optionValue] of Object.entries(typeOptionsRecord)) {
344
341
  assertItemMetadataCondition(optionKey.trim().length > 0, "type_options keys must be non-empty");
345
342
  assertItemMetadataCondition(typeof optionValue === "string", "type_options values must be strings");
346
343
  const optionText = optionValue;
@@ -386,10 +383,7 @@ function assertRuntimeUnknownItemMetadataFields(record, runtimeContext) {
386
383
  }
387
384
  }
388
385
  function assertValidItemMetadata(itemMetadata, runtimeContext) {
389
- assertItemMetadataCondition(typeof itemMetadata === "object" &&
390
- itemMetadata !== null &&
391
- !Array.isArray(itemMetadata), "item metadata must be an object");
392
- const record = itemMetadata;
386
+ const record = requireItemMetadataRecord(itemMetadata, "item metadata must be an object");
393
387
  const itemType = assertRequiredItemMetadataFields(record);
394
388
  assertStatusItemMetadataField(record, runtimeContext);
395
389
  assertPriorityAndTags(record);
@@ -1428,4 +1422,4 @@ export const _testOnlyItemFormat = {
1428
1422
  sortTests,
1429
1423
  };
1430
1424
  //# sourceMappingURL=item-format.js.map
1431
- //# debugId=c9225594-bc3b-5b07-8703-1debd1a98693
1425
+ //# debugId=a4c22692-fe27-5178-bba2-190ac3f80628
@@ -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]="8a44d44d-70c7-5321-b436-08aa6505a854")}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]="46d7e58b-d1b6-5f9d-86cb-76ca671ed127")}catch(e){}}();
3
3
  import { createDefaultExtensionGovernancePolicy } from "../extensions/extension-types.js";
4
4
  /**
5
5
  * Canonical default lifecycle status model and workflow role mapping.
@@ -442,6 +442,7 @@ export const TELEMETRY_ERROR_CATEGORY_BY_CODE = Object.freeze({
442
442
  lock_conflict: "conflict",
443
443
  terminal_state_conflict: "conflict",
444
444
  dependency_failed: "runtime",
445
+ init_gitignore_unwritable: "runtime",
445
446
  merge_git_config_unwritable: "runtime",
446
447
  command_failed: "runtime",
447
448
  unknown_error: "runtime",
@@ -474,4 +475,4 @@ export function resolveTelemetryErrorCategory(errorCode) {
474
475
  return "unknown";
475
476
  }
476
477
  //# sourceMappingURL=constants.js.map
477
- //# debugId=8a44d44d-70c7-5321-b436-08aa6505a854
478
+ //# debugId=46d7e58b-d1b6-5f9d-86cb-76ca671ed127
@@ -4,7 +4,7 @@
4
4
  * Reads and writes tracker storage with format-aware helpers for Item Store.
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]="827bddce-74c6-5b36-ae56-bf3b14625f82")}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]="f43e1170-e797-5a0c-b02e-d31e002ab275")}catch(e){}}();
8
8
  import fs from "node:fs/promises";
9
9
  import path from "node:path";
10
10
  import { getActiveExtensionRegistrations, projectAfterCommandItemSnapshot, recordAfterCommandAffectedItem, runActiveOnReadHooks, runActiveBeforeMutationHooks, runActiveOnWriteHooks, runActiveServiceOverride, } from "../extensions/index.js";
@@ -684,4 +684,4 @@ export async function deleteItem(params) {
684
684
  }
685
685
  }
686
686
  //# sourceMappingURL=item-store.js.map
687
- //# debugId=827bddce-74c6-5b36-ae56-bf3b14625f82
687
+ //# debugId=f43e1170-e797-5a0c-b02e-d31e002ab275
@@ -4,7 +4,7 @@
4
4
  * Reads and writes tracker storage with format-aware helpers for Settings.
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]="9381a512-7436-5d2c-9667-3845b777b901")}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]="a434b9ea-4692-51c5-8761-0f1759fff394")}catch(e){}}();
8
8
  import { validateSettings } from "./settings-validator.js";
9
9
  import { runActiveOnReadHooks, runActiveOnWriteHooks, } from "../extensions/index.js";
10
10
  import { GOVERNANCE_PRESET_DEFAULTS, SETTINGS_DEFAULTS, } from "../shared/constants.js";
@@ -1298,4 +1298,4 @@ export const settingsStoreTestOnly = {
1298
1298
  selectedSettingsReadCacheSignaturesEqual,
1299
1299
  };
1300
1300
  //# sourceMappingURL=settings.js.map
1301
- //# debugId=9381a512-7436-5d2c-9667-3845b777b901
1301
+ //# debugId=a434b9ea-4692-51c5-8761-0f1759fff394
@@ -5,7 +5,7 @@
5
5
  * Runs the MCP server adapter that exposes pm actions and contracts to external agents.
6
6
  */
7
7
 
8
- !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]="fdff0dd1-1651-5f01-b822-60c075d14ad2")}catch(e){}}();
8
+ !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]="561c51e0-d7d9-5303-b116-443ad5037943")}catch(e){}}();
9
9
  import { realpathSync } from "node:fs";
10
10
  import { readFile } from "node:fs/promises";
11
11
  import path from "node:path";
@@ -20,7 +20,7 @@ import { PM_MCP_PROMPT_CONTRACTS, PM_MCP_RESOURCE_CONTRACTS, } from "../sdk/agen
20
20
  import { commitItemMutations } from "../sdk/item-transaction.js";
21
21
  import { isRuntimeRecord } from "../sdk/runtime-input.js";
22
22
  import { attachOutputTokenAccounting } from "../sdk/output-token-accounting.js";
23
- import { parseAtomicMutationControls, validateItemMutationRows, } from "../sdk/structured-mutations.js";
23
+ import { parseAtomicMutationControls, resolveItemMutationDocument, } from "../sdk/structured-mutations.js";
24
24
  import { resolveAuthor, resolvePmRoot } from "../sdk/runtime-primitives.js";
25
25
  const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
26
26
  function resolvePmPackageRoot() {
@@ -99,18 +99,23 @@ const HANDLERS = {
99
99
  pm_run: (args) => runAction(args),
100
100
  pm_mutate: async (args) => {
101
101
  const transactionId = readRequiredString(args, "transactionId");
102
- const mutations = validateItemMutationRows(args.mutations);
103
102
  const controls = parseAtomicMutationControls(args);
103
+ const cwd = typeof args.cwd === "string" ? args.cwd : process.cwd();
104
+ const pmRoot = resolvePmRoot(cwd, typeof args.path === "string" ? args.path : undefined);
105
+ const resolved = resolveItemMutationDocument(JSON.stringify({ schema_version: 1, mutations: args.mutations }), {
106
+ transactionId,
107
+ idPrefix: (await readSettings(pmRoot)).id_prefix,
108
+ });
109
+ const { mutations, references } = resolved;
104
110
  if (args.dryRun === true) {
105
111
  return {
106
112
  transaction_id: transactionId,
107
113
  dry_run: true,
108
114
  mutation_count: mutations.length,
109
115
  mutations,
116
+ references,
110
117
  };
111
118
  }
112
- const cwd = typeof args.cwd === "string" ? args.cwd : process.cwd();
113
- const pmRoot = resolvePmRoot(cwd, typeof args.path === "string" ? args.path : undefined);
114
119
  const result = await runWithActiveExtensions({
115
120
  cwd: typeof args.cwd === "string" ? args.cwd : undefined,
116
121
  path: typeof args.path === "string" ? args.path : undefined,
@@ -127,6 +132,7 @@ const HANDLERS = {
127
132
  ...commitResult,
128
133
  transaction_id: committedTransactionId,
129
134
  mutation_count: mutations.length,
135
+ references,
130
136
  };
131
137
  },
132
138
  ...Object.fromEntries(Object.entries(NARROW_TOOL_ACTIONS).map(([tool, action]) => [
@@ -615,4 +621,4 @@ if (isInvokedAsMcpMainModule(process.argv[1], import.meta.url)) {
615
621
  }
616
622
  /* c8 ignore stop */
617
623
  //# sourceMappingURL=server.js.map
618
- //# debugId=fdff0dd1-1651-5f01-b822-60c075d14ad2
624
+ //# debugId=561c51e0-d7d9-5303-b116-443ad5037943
@@ -4,7 +4,7 @@
4
4
  * Defines the Tool Definitions module for pm CLI source.
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]="ade687e6-6547-5a2f-818f-0ed06dce9de5")}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]="89c1ac6d-c217-54ea-8728-5a58762f86d9")}catch(e){}}();
8
8
  import { GRAPH_SUBCOMMAND_VALUES, PM_TOOL_ACTIONS, } from "../sdk/cli-contracts/enum-contracts.js";
9
9
  import { buildPmActionToolInputSchema } from "../sdk/cli-contracts/tool-schema.js";
10
10
  import { RUNTIME_STATUS_ROLE_VALUES } from "../types.js";
@@ -254,8 +254,8 @@ const RAW_TOOLS = [
254
254
  },
255
255
  {
256
256
  name: "pm_mutate",
257
- description: "Apply an ordered create/update/close batch atomically through the public pm SDK. " +
258
- "Use a stable transactionId to resume interrupted work; set dryRun=true to validate and preview without writes.",
257
+ description: "Apply an ordered create/update/close/release batch atomically through the public pm SDK. " +
258
+ "Create rows may declare ref and omit id; @ref forward references resolve deterministically from the stable transactionId. Set dryRun=true to validate and preview without writes.",
259
259
  inputSchema: objectSchema({
260
260
  transactionId: {
261
261
  type: "string",
@@ -264,16 +264,23 @@ const RAW_TOOLS = [
264
264
  mutations: {
265
265
  type: "array",
266
266
  minItems: 1,
267
- description: "Ordered rows shaped as {op:create|update|close,id,options?,reason?}.",
267
+ description: "Ordered rows shaped as {op:create|update|close|release,id?,ref?,options?,reason?}.",
268
268
  items: {
269
269
  type: "object",
270
270
  properties: {
271
- op: { type: "string", enum: ["create", "update", "close"] },
271
+ op: {
272
+ type: "string",
273
+ enum: ["create", "update", "close", "release"],
274
+ },
272
275
  id: idSchema,
276
+ ref: {
277
+ type: "string",
278
+ description: "Batch-local create alias; its deterministic id can be referenced as @alias by any row.",
279
+ },
273
280
  reason: { type: "string" },
274
281
  options: { type: "object" },
275
282
  },
276
- required: ["op", "id"],
283
+ required: ["op"],
277
284
  additionalProperties: false,
278
285
  },
279
286
  },
@@ -728,4 +735,4 @@ export function buildMcpToolContracts() {
728
735
  }).sort((left, right) => left.name.localeCompare(right.name));
729
736
  }
730
737
  //# sourceMappingURL=tool-definitions.js.map
731
- //# debugId=ade687e6-6547-5a2f-818f-0ed06dce9de5
738
+ //# debugId=89c1ac6d-c217-54ea-8728-5a58762f86d9
@@ -1,11 +1,3 @@
1
- /**
2
- * @module sdk/cli-contracts/agent-output-contracts
3
- *
4
- * Declares the agent-facing output budget vocabulary shared by CLI, SDK,
5
- * packages, contract discovery, and regression gates. The contracts describe
6
- * output policy without coupling package authors to pm's renderer.
7
- */
8
- import { PM_CORE_COMMAND_NAMES } from "./enum-contracts.js";
9
1
  /** Stable degradation stages applied when an output exceeds its token budget. */
10
2
  export declare const PM_OUTPUT_DEGRADATION_STEPS: readonly ["full", "compact", "brief", "summary", "counts"];
11
3
  /** Restricts deterministic output degradation stages. */
@@ -17,11 +9,16 @@ export type PmOutputBudgetClass = (typeof PM_OUTPUT_BUDGET_CLASSES)[number];
17
9
  /** Describes one command's default agent-output budget and degradation policy. */
18
10
  export interface PmCommandOutputBudgetContract {
19
11
  /** Canonical or compatibility command name. */
20
- command: (typeof PM_CORE_COMMAND_NAMES)[number];
12
+ command: string;
21
13
  /** Workload class that selected the default ceiling. */
22
14
  budget_class: PmOutputBudgetClass;
23
15
  /** Default estimated-token ceiling for representative output. */
24
16
  default_max_estimated_tokens: number;
17
+ /** Encoding-specific ceilings generated from the workload-class default. */
18
+ default_max_estimated_tokens_by_format: Readonly<{
19
+ toon: number;
20
+ json: number;
21
+ }>;
25
22
  /** Ordered fallback projections, from richest to smallest. */
26
23
  degradation_ladder: readonly PmOutputDegradationStep[];
27
24
  /** Whether callers may explicitly request an unbounded result. */
@@ -29,6 +26,10 @@ export interface PmCommandOutputBudgetContract {
29
26
  /** Stable estimate used by gates and SDK consumers. */
30
27
  token_estimate: "ceil(utf8_bytes / 4)";
31
28
  }
29
+ /** Infer the conservative workload class for a core or package command. */
30
+ export declare function inferPmOutputBudgetClass(command: string): PmOutputBudgetClass;
31
+ /** Build the generated default budget for a core or package command. */
32
+ export declare function createPmCommandOutputBudget(command: string, budgetClass?: PmOutputBudgetClass): PmCommandOutputBudgetContract;
32
33
  /**
33
34
  * Declares one budget contract while preserving literal command metadata for
34
35
  * package-authored registries and test fixtures. Rejects ceilings that cannot
@@ -36,15 +37,14 @@ export interface PmCommandOutputBudgetContract {
36
37
  */
37
38
  export declare function definePmCommandOutputBudget<TContract extends PmCommandOutputBudgetContract>(contract: TContract): TContract;
38
39
  /** Public default budget contract for every built-in pm command. */
39
- export declare const PM_COMMAND_OUTPUT_BUDGET_CONTRACTS: {
40
- command: "search" | "create" | "update" | "list" | "context" | "release" | "schema" | "test" | "test-all" | "events" | "comments" | "notes" | "learnings" | "files" | "docs" | "copy" | "activity" | "history" | "item" | "extension" | "package" | "config" | "packages" | "event" | "list-all" | "list-draft" | "list-open" | "list-in-progress" | "list-blocked" | "list-closed" | "list-canceled" | "ctx" | "init" | "install" | "upgrade" | "focus" | "aggregate" | "get" | "next" | "eval" | "workspace" | "history-redact" | "history-repair" | "history-author-acknowledge" | "history-compact" | "merge" | "profile" | "plan" | "restore" | "update-many" | "close" | "close-many" | "delete" | "append" | "deps" | "graph" | "telemetry" | "health" | "validate" | "gc" | "stats" | "duplicates" | "contracts" | "claim" | "start-task" | "pause-task" | "close-task" | "meet" | "remind" | "help";
41
- budget_class: "governance" | "mutation" | "read" | "discovery";
42
- default_max_estimated_tokens: number;
43
- degradation_ladder: readonly ["full", "compact", "brief", "summary", "counts"];
44
- allows_unbounded_opt_out: true;
45
- token_estimate: "ceil(utf8_bytes / 4)";
46
- }[];
40
+ export declare const PM_COMMAND_OUTPUT_BUDGET_CONTRACTS: PmCommandOutputBudgetContract[];
47
41
  /** Resolve the declared output budget for one built-in command. */
48
- export declare function resolvePmCommandOutputBudget(command: string): PmCommandOutputBudgetContract | null;
42
+ export declare function resolvePmCommandOutputBudget(command: string, options: {
43
+ generateFallback: true;
44
+ }): PmCommandOutputBudgetContract;
45
+ /** Resolve a declared output budget without generating a package fallback. */
46
+ export declare function resolvePmCommandOutputBudget(command: string, options?: {
47
+ generateFallback?: false;
48
+ }): PmCommandOutputBudgetContract | null;
49
49
  /** Estimate conservative token usage from UTF-8 output bytes. */
50
50
  export declare function estimatePmOutputTokens(utf8Bytes: number): number;