@unbrained/pm-cli 2026.7.17 → 2026.7.18

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 (264) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +13 -0
  3. package/dist/cli/commands/close.d.ts +1 -1
  4. package/dist/cli/commands/close.js +3 -3
  5. package/dist/cli/commands/close.js.map +1 -1
  6. package/dist/cli/commands/completion.js +47 -5
  7. package/dist/cli/commands/completion.js.map +1 -1
  8. package/dist/cli/commands/context.d.ts +2 -2
  9. package/dist/cli/commands/context.js +42 -28
  10. package/dist/cli/commands/context.js.map +1 -1
  11. package/dist/cli/commands/contracts.js +5 -3
  12. package/dist/cli/commands/contracts.js.map +1 -1
  13. package/dist/cli/commands/graph.d.ts +7 -0
  14. package/dist/cli/commands/graph.js +11 -0
  15. package/dist/cli/commands/graph.js.map +1 -0
  16. package/dist/cli/commands/index.d.ts +1 -0
  17. package/dist/cli/commands/index.js +3 -2
  18. package/dist/cli/commands/index.js.map +1 -1
  19. package/dist/cli/commands/next.d.ts +1 -1
  20. package/dist/cli/commands/next.js +3 -3
  21. package/dist/cli/commands/next.js.map +1 -1
  22. package/dist/cli/main.js +3 -2
  23. package/dist/cli/main.js.map +1 -1
  24. package/dist/cli/register-list-query.js +49 -7
  25. package/dist/cli/register-list-query.js.map +1 -1
  26. package/dist/cli/register-mutation.js +7 -3
  27. package/dist/cli/register-mutation.js.map +1 -1
  28. package/dist/cli-bundle/bundle-manifest.json +157 -149
  29. package/dist/cli-bundle/chunks/{chunk-N7I2DGLP.js → chunk-35FHWD4C.js} +4 -4
  30. package/dist/cli-bundle/chunks/{chunk-37V5MXAU.js.map → chunk-35FHWD4C.js.map} +1 -7
  31. package/dist/cli-bundle/chunks/{chunk-MSGETE6I.js → chunk-3CUQZNQ6.js} +67 -509
  32. package/dist/cli-bundle/chunks/chunk-3CUQZNQ6.js.map +7 -0
  33. package/dist/cli-bundle/chunks/chunk-3QDR6ZLU.js +800 -0
  34. package/dist/cli-bundle/chunks/chunk-3QDR6ZLU.js.map +7 -0
  35. package/dist/cli-bundle/chunks/{chunk-QNUAZYGW.js → chunk-43UMFKCK.js} +3 -3
  36. package/dist/cli-bundle/chunks/{chunk-HF63SBLC.js → chunk-6VHUGVNP.js} +39 -16
  37. package/dist/cli-bundle/chunks/chunk-6VHUGVNP.js.map +1 -0
  38. package/dist/cli-bundle/chunks/{chunk-B6SH2YNN.js → chunk-7R6UIHYY.js} +2 -2
  39. package/dist/cli-bundle/chunks/{chunk-NCAFUBJX.js → chunk-7UCY6DR5.js} +183 -12
  40. package/dist/cli-bundle/chunks/chunk-7UCY6DR5.js.map +1 -0
  41. package/dist/cli-bundle/chunks/{chunk-23TCGBRK.js → chunk-ADXDCAKP.js} +2 -2
  42. package/dist/cli-bundle/chunks/{chunk-7LTCLTRG.js → chunk-AXRT7K5V.js} +16 -3
  43. package/dist/cli-bundle/chunks/chunk-AXRT7K5V.js.map +7 -0
  44. package/dist/cli-bundle/chunks/{chunk-P56LKFQX.js → chunk-BDA35QG5.js} +34 -4
  45. package/dist/cli-bundle/chunks/chunk-BDA35QG5.js.map +7 -0
  46. package/dist/cli-bundle/chunks/{chunk-2MPMKJF2.js → chunk-DHNG452T.js} +2 -2
  47. package/dist/cli-bundle/chunks/{chunk-AFSV5HBB.js → chunk-E4FXM2XB.js} +2 -2
  48. package/dist/cli-bundle/chunks/{chunk-QKVVV6QO.js → chunk-EWIT5WIC.js} +3 -3
  49. package/dist/cli-bundle/chunks/chunk-EX7OQT3Y.js +783 -0
  50. package/dist/cli-bundle/chunks/chunk-EX7OQT3Y.js.map +1 -0
  51. package/dist/cli-bundle/chunks/{chunk-LLODAQMP.js → chunk-F3VC3GOV.js} +41 -18
  52. package/dist/cli-bundle/chunks/chunk-F3VC3GOV.js.map +7 -0
  53. package/dist/cli-bundle/chunks/{chunk-S46R2M3W.js → chunk-GKPCTQYG.js} +1709 -5
  54. package/dist/cli-bundle/chunks/chunk-GKPCTQYG.js.map +7 -0
  55. package/dist/cli-bundle/chunks/{chunk-HXVHBERL.js → chunk-HPAYDSR2.js} +2 -2
  56. package/dist/cli-bundle/chunks/{chunk-XNPMDSQQ.js → chunk-HYTOJW2Q.js} +2 -2
  57. package/dist/cli-bundle/chunks/{chunk-V3VBXQQV.js → chunk-I3INI567.js} +516 -429
  58. package/dist/cli-bundle/chunks/chunk-I3INI567.js.map +7 -0
  59. package/dist/cli-bundle/chunks/{chunk-V7MP6YTN.js → chunk-IL5SPRMH.js} +2 -2
  60. package/dist/cli-bundle/chunks/{chunk-YQCWK2MB.js → chunk-L5BTTDU5.js} +68 -503
  61. package/dist/cli-bundle/chunks/chunk-L5BTTDU5.js.map +1 -0
  62. package/dist/cli-bundle/chunks/{chunk-SIJV365F.js → chunk-NCVT6XEL.js} +17 -4
  63. package/dist/cli-bundle/chunks/chunk-NCVT6XEL.js.map +1 -0
  64. package/dist/cli-bundle/chunks/{chunk-DCC2AQBD.js → chunk-OGVTB5VO.js} +32 -31
  65. package/dist/cli-bundle/chunks/chunk-OGVTB5VO.js.map +7 -0
  66. package/dist/cli-bundle/chunks/{chunk-6XAZB6SE.js → chunk-QPGQNLPI.js} +1660 -7
  67. package/dist/cli-bundle/chunks/chunk-QPGQNLPI.js.map +1 -0
  68. package/dist/cli-bundle/chunks/{chunk-KOEZCHRF.js → chunk-QRZNCRNA.js} +2 -2
  69. package/dist/cli-bundle/chunks/{chunk-G6KM4YKY.js → chunk-RXPQ5Q23.js} +3 -3
  70. package/dist/cli-bundle/chunks/{chunk-7CTQ7WW5.js → chunk-SIPOACV5.js} +514 -427
  71. package/dist/cli-bundle/chunks/chunk-SIPOACV5.js.map +1 -0
  72. package/dist/cli-bundle/chunks/{chunk-XYJK6GIQ.js → chunk-TGBTLGPX.js} +2 -2
  73. package/dist/cli-bundle/chunks/{chunk-37V5MXAU.js → chunk-TLWJP5BF.js} +3 -3
  74. package/dist/cli-bundle/chunks/chunk-TLWJP5BF.js.map +7 -0
  75. package/dist/cli-bundle/chunks/{chunk-3D4YVTNG.js → chunk-TZAE66GQ.js} +2 -2
  76. package/dist/cli-bundle/chunks/{chunk-S6FF7VW6.js → chunk-WQXRZMFN.js} +187 -16
  77. package/dist/cli-bundle/chunks/chunk-WQXRZMFN.js.map +7 -0
  78. package/dist/cli-bundle/chunks/{chunk-SPFZV2GR.js → chunk-XPUTSGJU.js} +32 -31
  79. package/dist/cli-bundle/chunks/chunk-XPUTSGJU.js.map +1 -0
  80. package/dist/cli-bundle/chunks/{chunk-CFSUNEL7.js → chunk-XWBD6DSR.js} +3 -3
  81. package/dist/cli-bundle/chunks/{chunk-MNV226E4.js → chunk-XWYQ2LT4.js} +2 -2
  82. package/dist/cli-bundle/chunks/{chunk-I7GY4X6Y.js → chunk-YFE7JHX3.js} +26 -5
  83. package/dist/cli-bundle/chunks/chunk-YFE7JHX3.js.map +1 -0
  84. package/dist/cli-bundle/chunks/{chunk-FZGM3PNA.js → chunk-YIIIAKCE.js} +2 -2
  85. package/dist/cli-bundle/chunks/{close-BEP7MHF3.js → close-GPD7DTJV.js} +3 -3
  86. package/dist/cli-bundle/chunks/{close-Y6QFUJQN.js → close-X3CF6FQP.js} +3 -3
  87. package/dist/cli-bundle/chunks/{close-many-JJFW7KTT.js → close-many-J7A5EHOQ.js} +5 -5
  88. package/dist/cli-bundle/chunks/{close-many-QJ6FKJUE.js → close-many-NQLYGPYW.js} +5 -5
  89. package/dist/cli-bundle/chunks/{deps-EVTOQMKW.js → deps-MQ4ZIGZB.js} +13 -4
  90. package/dist/cli-bundle/chunks/{deps-5NC4IZH7.js → deps-NIIKXLPB.js} +13 -4
  91. package/dist/cli-bundle/chunks/{profile-U2B6Y7GE.js → profile-AVCIIZID.js} +3 -3
  92. package/dist/cli-bundle/chunks/{profile-AGUKS52S.js → profile-LFYO3HHX.js} +3 -3
  93. package/dist/cli-bundle/chunks/{register-list-query-A5KRJ5J2.js → register-list-query-MZUF2EEC.js} +41 -13
  94. package/dist/cli-bundle/chunks/register-list-query-MZUF2EEC.js.map +1 -0
  95. package/dist/cli-bundle/chunks/{register-list-query-NEYP3TXO.js → register-list-query-UKMF55FT.js} +40 -12
  96. package/dist/cli-bundle/chunks/register-list-query-UKMF55FT.js.map +7 -0
  97. package/dist/cli-bundle/chunks/{register-mutation-6LOPBAHC.js → register-mutation-2PBW2GEX.js} +15 -13
  98. package/dist/cli-bundle/chunks/register-mutation-2PBW2GEX.js.map +1 -0
  99. package/dist/cli-bundle/chunks/{register-mutation-GCZOALNJ.js → register-mutation-T6RVNJC4.js} +14 -12
  100. package/dist/cli-bundle/chunks/{register-mutation-GCZOALNJ.js.map → register-mutation-T6RVNJC4.js.map} +2 -2
  101. package/dist/cli-bundle/chunks/{register-operations-6ZZIF27A.js → register-operations-KHZYR6MG.js} +11 -11
  102. package/dist/cli-bundle/chunks/{register-operations-REDIAEGI.js → register-operations-WPQ2LWZJ.js} +11 -11
  103. package/dist/cli-bundle/chunks/{register-setup-J3JS2ZVT.js → register-setup-PGDNOXDQ.js} +5 -5
  104. package/dist/cli-bundle/chunks/{register-setup-BHPMN5SK.js → register-setup-TDN7WAO6.js} +5 -5
  105. package/dist/cli-bundle/chunks/{update-SA6AG23P.js → update-SQYZA3ZW.js} +4 -4
  106. package/dist/cli-bundle/chunks/{update-PQQHLYCC.js → update-XZJYS5X7.js} +4 -4
  107. package/dist/cli-bundle/chunks/{update-many-RQVTFJPD.js → update-many-R24B3GBK.js} +6 -6
  108. package/dist/cli-bundle/chunks/{update-many-TV3L3KBX.js → update-many-WQ3R3J6N.js} +6 -6
  109. package/dist/cli-bundle/main.js +25 -9
  110. package/dist/cli-bundle/main.js.map +2 -2
  111. package/dist/cli-bundle/sdk-runtime.js +19 -16
  112. package/dist/cli-bundle/sdk.js +95 -305
  113. package/dist/cli-bundle/sdk.js.map +4 -4
  114. package/dist/core/item/actionability.d.ts +12 -0
  115. package/dist/core/item/actionability.js +39 -4
  116. package/dist/core/item/actionability.js.map +1 -1
  117. package/dist/core/sentry/instrument.d.ts +11 -0
  118. package/dist/core/sentry/instrument.js +21 -2
  119. package/dist/core/sentry/instrument.js.map +1 -1
  120. package/dist/mcp/server.d.ts +16 -18
  121. package/dist/mcp/server.js +84 -31
  122. package/dist/mcp/server.js.map +1 -1
  123. package/dist/mcp/tool-definitions.js +17 -4
  124. package/dist/mcp/tool-definitions.js.map +1 -1
  125. package/dist/sdk/actionability.d.ts +10 -0
  126. package/dist/sdk/actionability.js +14 -0
  127. package/dist/sdk/actionability.js.map +1 -0
  128. package/dist/sdk/cli-contracts/enum-contracts.d.ts +6 -2
  129. package/dist/sdk/cli-contracts/enum-contracts.js +19 -2
  130. package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
  131. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  132. package/dist/sdk/cli-contracts/flag-contracts.js +21 -2
  133. package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
  134. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +2 -0
  135. package/dist/sdk/cli-contracts/tool-option-contracts.js +16 -2
  136. package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
  137. package/dist/sdk/cli-contracts/tool-parameter-tables.js +80 -3
  138. package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
  139. package/dist/sdk/cli-contracts/tool-schema.d.ts +20 -0
  140. package/dist/sdk/cli-contracts/tool-schema.js +97 -9
  141. package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
  142. package/dist/sdk/cli-contracts.d.ts +2 -2
  143. package/dist/sdk/cli-contracts.js +4 -4
  144. package/dist/sdk/cli-contracts.js.map +1 -1
  145. package/dist/sdk/dependencies.d.ts +42 -53
  146. package/dist/sdk/dependencies.js +177 -125
  147. package/dist/sdk/dependencies.js.map +1 -1
  148. package/dist/sdk/governance/validate.js +3 -3
  149. package/dist/sdk/governance/validate.js.map +1 -1
  150. package/dist/sdk/graph/analytics.d.ts +124 -0
  151. package/dist/sdk/graph/analytics.js +464 -0
  152. package/dist/sdk/graph/analytics.js.map +1 -0
  153. package/dist/sdk/graph/assembly.d.ts +97 -0
  154. package/dist/sdk/graph/assembly.js +146 -0
  155. package/dist/sdk/graph/assembly.js.map +1 -0
  156. package/dist/sdk/graph/cache.d.ts +66 -0
  157. package/dist/sdk/graph/cache.js +148 -0
  158. package/dist/sdk/graph/cache.js.map +1 -0
  159. package/dist/sdk/graph/governance.d.ts +108 -0
  160. package/dist/sdk/graph/governance.js +360 -0
  161. package/dist/sdk/graph/governance.js.map +1 -0
  162. package/dist/sdk/graph/index.d.ts +16 -0
  163. package/dist/sdk/graph/index.js +20 -0
  164. package/dist/sdk/graph/index.js.map +1 -0
  165. package/dist/sdk/graph/remediation.d.ts +52 -0
  166. package/dist/sdk/graph/remediation.js +148 -0
  167. package/dist/sdk/graph/remediation.js.map +1 -0
  168. package/dist/sdk/graph/run.d.ts +295 -0
  169. package/dist/sdk/graph/run.js +468 -0
  170. package/dist/sdk/graph/run.js.map +1 -0
  171. package/dist/sdk/graph/traversal.d.ts +77 -0
  172. package/dist/sdk/graph/traversal.js +262 -0
  173. package/dist/sdk/graph/traversal.js.map +1 -0
  174. package/dist/sdk/index.d.ts +4 -2
  175. package/dist/sdk/index.js +6 -4
  176. package/dist/sdk/index.js.map +1 -1
  177. package/dist/sdk/query/list.d.ts +8 -0
  178. package/dist/sdk/query/list.js +19 -3
  179. package/dist/sdk/query/list.js.map +1 -1
  180. package/dist/sdk/relationship-context.d.ts +42 -0
  181. package/dist/sdk/relationship-context.js +99 -20
  182. package/dist/sdk/relationship-context.js.map +1 -1
  183. package/dist/sdk/relationships.d.ts +13 -0
  184. package/dist/sdk/relationships.js +30 -2
  185. package/dist/sdk/relationships.js.map +1 -1
  186. package/dist/sdk/runtime-input.d.ts +41 -0
  187. package/dist/sdk/runtime-input.js +422 -2
  188. package/dist/sdk/runtime-input.js.map +1 -1
  189. package/dist/sdk/runtime.d.ts +12 -23
  190. package/dist/sdk/runtime.js +19 -371
  191. package/dist/sdk/runtime.js.map +1 -1
  192. package/dist/sdk/test/linked-command-detection.js +12 -3
  193. package/dist/sdk/test/linked-command-detection.js.map +1 -1
  194. package/docs/AGENT_GUIDE.md +1 -0
  195. package/docs/COMMANDS.md +19 -1
  196. package/docs/RELATIONSHIP_GRAPH.md +99 -3
  197. package/docs/SDK.md +17 -3
  198. package/marketplace.json +2 -2
  199. package/package.json +1 -1
  200. package/packages/pm-beads/package.json +1 -1
  201. package/packages/pm-calendar/package.json +1 -1
  202. package/packages/pm-command-kit/package.json +1 -1
  203. package/packages/pm-governance-audit/package.json +1 -1
  204. package/packages/pm-guide-shell/package.json +1 -1
  205. package/packages/pm-kanban/package.json +1 -1
  206. package/packages/pm-lifecycle-hooks/package.json +1 -1
  207. package/packages/pm-linked-test-adapters/package.json +1 -1
  208. package/packages/pm-search-advanced/package.json +1 -1
  209. package/packages/pm-templates/package.json +1 -1
  210. package/packages/pm-todos/package.json +1 -1
  211. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  212. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  213. package/dist/cli-bundle/chunks/chunk-6XAZB6SE.js.map +0 -1
  214. package/dist/cli-bundle/chunks/chunk-7CTQ7WW5.js.map +0 -1
  215. package/dist/cli-bundle/chunks/chunk-7LTCLTRG.js.map +0 -7
  216. package/dist/cli-bundle/chunks/chunk-DCC2AQBD.js.map +0 -7
  217. package/dist/cli-bundle/chunks/chunk-HF63SBLC.js.map +0 -1
  218. package/dist/cli-bundle/chunks/chunk-I7GY4X6Y.js.map +0 -1
  219. package/dist/cli-bundle/chunks/chunk-LLODAQMP.js.map +0 -7
  220. package/dist/cli-bundle/chunks/chunk-MSGETE6I.js.map +0 -7
  221. package/dist/cli-bundle/chunks/chunk-N7I2DGLP.js.map +0 -1
  222. package/dist/cli-bundle/chunks/chunk-NCAFUBJX.js.map +0 -1
  223. package/dist/cli-bundle/chunks/chunk-P56LKFQX.js.map +0 -7
  224. package/dist/cli-bundle/chunks/chunk-S46R2M3W.js.map +0 -7
  225. package/dist/cli-bundle/chunks/chunk-S6FF7VW6.js.map +0 -7
  226. package/dist/cli-bundle/chunks/chunk-SIJV365F.js.map +0 -1
  227. package/dist/cli-bundle/chunks/chunk-SPFZV2GR.js.map +0 -1
  228. package/dist/cli-bundle/chunks/chunk-V3VBXQQV.js.map +0 -7
  229. package/dist/cli-bundle/chunks/chunk-YQCWK2MB.js.map +0 -1
  230. package/dist/cli-bundle/chunks/register-list-query-A5KRJ5J2.js.map +0 -1
  231. package/dist/cli-bundle/chunks/register-list-query-NEYP3TXO.js.map +0 -7
  232. package/dist/cli-bundle/chunks/register-mutation-6LOPBAHC.js.map +0 -1
  233. /package/dist/cli-bundle/chunks/{chunk-QNUAZYGW.js.map → chunk-43UMFKCK.js.map} +0 -0
  234. /package/dist/cli-bundle/chunks/{chunk-B6SH2YNN.js.map → chunk-7R6UIHYY.js.map} +0 -0
  235. /package/dist/cli-bundle/chunks/{chunk-23TCGBRK.js.map → chunk-ADXDCAKP.js.map} +0 -0
  236. /package/dist/cli-bundle/chunks/{chunk-2MPMKJF2.js.map → chunk-DHNG452T.js.map} +0 -0
  237. /package/dist/cli-bundle/chunks/{chunk-AFSV5HBB.js.map → chunk-E4FXM2XB.js.map} +0 -0
  238. /package/dist/cli-bundle/chunks/{chunk-QKVVV6QO.js.map → chunk-EWIT5WIC.js.map} +0 -0
  239. /package/dist/cli-bundle/chunks/{chunk-HXVHBERL.js.map → chunk-HPAYDSR2.js.map} +0 -0
  240. /package/dist/cli-bundle/chunks/{chunk-XNPMDSQQ.js.map → chunk-HYTOJW2Q.js.map} +0 -0
  241. /package/dist/cli-bundle/chunks/{chunk-V7MP6YTN.js.map → chunk-IL5SPRMH.js.map} +0 -0
  242. /package/dist/cli-bundle/chunks/{chunk-KOEZCHRF.js.map → chunk-QRZNCRNA.js.map} +0 -0
  243. /package/dist/cli-bundle/chunks/{chunk-G6KM4YKY.js.map → chunk-RXPQ5Q23.js.map} +0 -0
  244. /package/dist/cli-bundle/chunks/{chunk-XYJK6GIQ.js.map → chunk-TGBTLGPX.js.map} +0 -0
  245. /package/dist/cli-bundle/chunks/{chunk-3D4YVTNG.js.map → chunk-TZAE66GQ.js.map} +0 -0
  246. /package/dist/cli-bundle/chunks/{chunk-CFSUNEL7.js.map → chunk-XWBD6DSR.js.map} +0 -0
  247. /package/dist/cli-bundle/chunks/{chunk-MNV226E4.js.map → chunk-XWYQ2LT4.js.map} +0 -0
  248. /package/dist/cli-bundle/chunks/{chunk-FZGM3PNA.js.map → chunk-YIIIAKCE.js.map} +0 -0
  249. /package/dist/cli-bundle/chunks/{close-BEP7MHF3.js.map → close-GPD7DTJV.js.map} +0 -0
  250. /package/dist/cli-bundle/chunks/{close-Y6QFUJQN.js.map → close-X3CF6FQP.js.map} +0 -0
  251. /package/dist/cli-bundle/chunks/{close-many-JJFW7KTT.js.map → close-many-J7A5EHOQ.js.map} +0 -0
  252. /package/dist/cli-bundle/chunks/{close-many-QJ6FKJUE.js.map → close-many-NQLYGPYW.js.map} +0 -0
  253. /package/dist/cli-bundle/chunks/{deps-EVTOQMKW.js.map → deps-MQ4ZIGZB.js.map} +0 -0
  254. /package/dist/cli-bundle/chunks/{deps-5NC4IZH7.js.map → deps-NIIKXLPB.js.map} +0 -0
  255. /package/dist/cli-bundle/chunks/{profile-U2B6Y7GE.js.map → profile-AVCIIZID.js.map} +0 -0
  256. /package/dist/cli-bundle/chunks/{profile-AGUKS52S.js.map → profile-LFYO3HHX.js.map} +0 -0
  257. /package/dist/cli-bundle/chunks/{register-operations-6ZZIF27A.js.map → register-operations-KHZYR6MG.js.map} +0 -0
  258. /package/dist/cli-bundle/chunks/{register-operations-REDIAEGI.js.map → register-operations-WPQ2LWZJ.js.map} +0 -0
  259. /package/dist/cli-bundle/chunks/{register-setup-J3JS2ZVT.js.map → register-setup-PGDNOXDQ.js.map} +0 -0
  260. /package/dist/cli-bundle/chunks/{register-setup-BHPMN5SK.js.map → register-setup-TDN7WAO6.js.map} +0 -0
  261. /package/dist/cli-bundle/chunks/{update-SA6AG23P.js.map → update-SQYZA3ZW.js.map} +0 -0
  262. /package/dist/cli-bundle/chunks/{update-PQQHLYCC.js.map → update-XZJYS5X7.js.map} +0 -0
  263. /package/dist/cli-bundle/chunks/{update-many-RQVTFJPD.js.map → update-many-R24B3GBK.js.map} +0 -0
  264. /package/dist/cli-bundle/chunks/{update-many-TV3L3KBX.js.map → update-many-WQ3R3J6N.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EXECUTABLE_COMMAND_ALIASES,
3
3
  resolveSubcommandFlagContractsForCommand
4
- } from "./chunk-S6FF7VW6.js";
4
+ } from "./chunk-WQXRZMFN.js";
5
5
  import {
6
6
  writeStdout
7
7
  } from "./chunk-EHJFUOXL.js";
@@ -848,4 +848,4 @@ export {
848
848
  applyInvocationAuthorOverride,
849
849
  createPmCliProgram
850
850
  };
851
- //# sourceMappingURL=chunk-XYJK6GIQ.js.map
851
+ //# sourceMappingURL=chunk-TGBTLGPX.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  collectBlockedByIds
3
- } from "./chunk-P56LKFQX.js";
3
+ } from "./chunk-BDA35QG5.js";
4
4
  import {
5
5
  buildItemNotFoundError,
6
6
  isTerminalStatus,
@@ -25,7 +25,7 @@ import {
25
25
  !(function() {
26
26
  try {
27
27
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
28
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "0d8fc5b7-1ebe-55cb-96d0-f174fe1f738a");
28
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "cd698989-6067-569b-9ca0-81f33fa89cfd");
29
29
  } catch (e2) {
30
30
  }
31
31
  })();
@@ -463,4 +463,4 @@ export {
463
463
  _testOnlyCloseCommand,
464
464
  runClose
465
465
  };
466
- //# sourceMappingURL=chunk-37V5MXAU.js.map
466
+ //# sourceMappingURL=chunk-TLWJP5BF.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../../cli/commands/close.ts"],
4
+ "sourcesContent": ["/**\n * @module cli/commands/close\n *\n * Implements the pm close command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { collectBlockedByIds } from \"../../sdk/actionability.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { isTerminalStatus } from \"../../core/item/status.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport {\n resolveRuntimeStatusRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport {\n buildItemNotFoundError,\n listAllItemMetadataLight,\n locateItem,\n mutateItem,\n readLocatedItem,\n} from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemMetadata } from \"../../types/index.js\";\n\n/** Documents the close command options payload exchanged by command, SDK, and package integrations. */\nexport interface CloseCommandOptions {\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message?: string;\n /** Value that configures or reports validate close for this contract. */\n validateClose?: string;\n /** Value that configures or reports force for this contract. */\n force?: boolean;\n // pm-fl0c #11 (2026-05-28): allow setting the three closure validation\n // fields inline on `pm close` so agents do not have to issue a prior\n // `pm update` just to satisfy --validate-close warn|strict. These map 1:1\n // to ItemMetadata.{resolution,expected_result,actual_result}.\n /** Value that configures or reports resolution for this contract. */\n resolution?: string;\n /** Structured result returned by the expected operation. */\n expectedResult?: string;\n /** Structured result returned by the actual operation. */\n actualResult?: string;\n /** Value that configures or reports duplicate of for this contract. */\n duplicateOf?: string;\n}\n\n/** Documents the close result payload exchanged by command, SDK, and package integrations. */\nexport interface CloseResult {\n /** Value that configures or reports item for this contract. */\n item: Record<string, unknown>;\n /** Value that configures or reports changed fields for this contract. */\n changed_fields: string[];\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\ninterface AutoUnblockCandidate {\n id: string;\n blocker_ids: string[];\n}\n\ntype CloseInlineFieldKey = \"resolution\" | \"expected_result\" | \"actual_result\";\n\ninterface CloseMutationContext {\n statusRegistry: RuntimeStatusRegistry;\n force: boolean | undefined;\n options: CloseCommandOptions;\n duplicateOf: string | undefined;\n validateCloseMode: ValidateCloseMode;\n activeChildIds: string[];\n closeReason: string | undefined;\n closedAt: string;\n}\n\nfunction toAuthor(\n candidate: string | undefined,\n defaultAuthor: string,\n): string {\n const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;\n const trimmed = resolved.trim();\n return trimmed || \"unknown\";\n}\n\nfunction normalizeCloseReason(\n reasonText: string | undefined,\n required: boolean,\n): string | undefined {\n const reason = (reasonText ?? \"\").trim();\n if (reason.length > 0) {\n return reason;\n }\n if (required) {\n throw new PmCliError(\n \"Close reason text is required because governance.require_close_reason is enabled\",\n EXIT_CODE.USAGE,\n {\n code: \"close_reason_required\",\n required:\n \"Provide a one-line closing summary as the positional text, --reason, or --message.\",\n why: \"governance.require_close_reason is enabled, so every close must record why the item is done.\",\n examples: [\n 'pm close <id> \"Done: <what changed and why>\"',\n 'pm close <id> --reason \"<closing summary>\"',\n 'pm close <id> -m \"<closing summary>\"',\n \"pm close <id> --duplicate-of <canonical-id>\",\n ],\n nextSteps: [\n \"Re-run the close with a closing summary.\",\n 'When closing as a duplicate, --duplicate-of <id> auto-fills the close reason as \"Duplicate of <id>\".',\n \"To stop requiring reasons, run: pm config set governance-require-close-reason --policy disabled\",\n ],\n },\n );\n }\n return undefined;\n}\n\ntype ValidateCloseMode = \"off\" | \"warn\" | \"strict\";\n\ninterface CloseReasonFallbackInput {\n closeReasonText: string | undefined;\n duplicateOf: string | undefined;\n resolution: string | undefined;\n message: string | undefined;\n requireCloseReason: boolean;\n}\n\nfunction resolveEffectiveCloseReasonText(\n input: CloseReasonFallbackInput,\n): string | undefined {\n if ((input.closeReasonText ?? \"\").trim().length > 0) {\n return input.closeReasonText;\n }\n if (input.duplicateOf !== undefined) {\n return `Duplicate of ${input.duplicateOf}`;\n }\n const trimmedResolution =\n typeof input.resolution === \"string\" ? input.resolution.trim() : \"\";\n if (trimmedResolution.length > 0) {\n return trimmedResolution;\n }\n const trimmedMessage =\n typeof input.message === \"string\" ? input.message.trim() : \"\";\n if (input.requireCloseReason && trimmedMessage.length > 0) {\n return trimmedMessage;\n }\n return input.closeReasonText;\n}\n\nconst CLOSE_VALIDATION_FIELDS: Array<{\n key: keyof Pick<\n ItemMetadata,\n \"resolution\" | \"expected_result\" | \"actual_result\"\n >;\n label: string;\n}> = [\n { key: \"resolution\", label: \"resolution\" },\n { key: \"expected_result\", label: \"expected_result\" },\n { key: \"actual_result\", label: \"actual_result\" },\n];\n\nfunction parseValidateCloseMode(\n raw: string | undefined,\n): ValidateCloseMode | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized.length === 0 || normalized === \"warn\") {\n return \"warn\";\n }\n if (\n normalized === \"off\" ||\n normalized === \"none\" ||\n normalized === \"disabled\"\n ) {\n return \"off\";\n }\n if (normalized === \"strict\") {\n return \"strict\";\n }\n throw new PmCliError(\n `Invalid --validate-close mode \"${raw}\" (expected \"off\", \"warn\", or \"strict\")`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction findMissingCloseValidationFields(\n itemMetadata: ItemMetadata,\n): string[] {\n const missing: string[] = [];\n for (const field of CLOSE_VALIDATION_FIELDS) {\n const rawValue = itemMetadata[field.key];\n if (typeof rawValue !== \"string\" || rawValue.trim().length === 0) {\n missing.push(field.label);\n }\n }\n return missing;\n}\n\nasync function duplicateChainReferencesClosingItem(\n loadItemById: (id: string) => Promise<ItemMetadata | null>,\n initialDuplicateOf: unknown,\n closingId: string,\n): Promise<boolean> {\n const visited = new Set<string>();\n let current = initialDuplicateOf;\n while (typeof current === \"string\" && current.trim().length > 0) {\n const currentId = current.trim();\n if (currentId === closingId) {\n return true;\n }\n if (visited.has(currentId)) {\n return false;\n }\n visited.add(currentId);\n current = (await loadItemById(currentId))?.duplicate_of;\n }\n return false;\n}\n\nfunction shouldApplyDuplicateFallback(value: unknown): boolean {\n return typeof value !== \"string\" || value.trim().length === 0;\n}\n\nasync function assertDuplicateTargetExists(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n duplicateOf: string | undefined,\n closingId: string,\n): Promise<string | undefined> {\n const rawTarget = duplicateOf?.trim();\n if (!rawTarget) {\n return undefined;\n }\n if (rawTarget === closingId) {\n throw new PmCliError(\n \"An item cannot be closed as a duplicate of itself.\",\n EXIT_CODE.USAGE,\n {\n code: \"duplicate_target_self\",\n why: \"--duplicate-of must identify the canonical item that should remain open or already represent the work.\",\n },\n );\n }\n const typeRegistry = resolveItemTypeRegistry(settings);\n const itemCache = new Map<string, ItemMetadata | null>();\n const loadItemById = async (id: string): Promise<ItemMetadata | null> => {\n if (itemCache.has(id)) {\n return itemCache.get(id) ?? null;\n }\n const located = await locateItem(\n pmRoot,\n id,\n settings.id_prefix,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n if (!located) {\n itemCache.set(id, null);\n return null;\n }\n const { document } = await readLocatedItem(located, {\n schema: settings.schema,\n });\n itemCache.set(id, document.metadata);\n return document.metadata;\n };\n const target = await loadItemById(rawTarget);\n if (!target) {\n throw new PmCliError(\n `Duplicate target \"${rawTarget}\" was not found. Create or locate the canonical item first.`,\n EXIT_CODE.USAGE,\n {\n code: \"duplicate_target_missing\",\n why: \"Duplicate closure should point at a real canonical pm item so future dedupe and changelog tooling can trace the relationship.\",\n examples: [\n `pm close ${closingId} \"Duplicate of ${rawTarget}\" --duplicate-of ${rawTarget}`,\n ],\n nextSteps: [\n \"Run pm search/list to find the canonical item, then retry with --duplicate-of <id>.\",\n ],\n },\n );\n }\n if (\n await duplicateChainReferencesClosingItem(\n loadItemById,\n target.duplicate_of,\n closingId,\n )\n ) {\n throw new PmCliError(\n `Circular duplicate reference detected. Target \"${rawTarget}\" points back to \"${closingId}\".`,\n EXIT_CODE.USAGE,\n {\n code: \"duplicate_target_circular\",\n why: \"Circular duplicate relationships create loops for dedupe and status propagation tooling.\",\n nextSteps: [\n \"Choose the existing canonical item, or clear the target duplicate_of metadata before closing this item as a duplicate.\",\n ],\n },\n );\n }\n if (\n typeof target.duplicate_of === \"string\" &&\n target.duplicate_of.trim().length > 0\n ) {\n throw new PmCliError(\n `Duplicate target \"${rawTarget}\" is already marked as a duplicate of \"${target.duplicate_of.trim()}\".`,\n EXIT_CODE.USAGE,\n {\n code: \"duplicate_target_is_duplicate\",\n why: \"Duplicate closure should point directly at the canonical item, not another duplicate.\",\n examples: [\n `pm close ${closingId} \"Duplicate of ${target.duplicate_of.trim()}\" --duplicate-of ${target.duplicate_of.trim()}`,\n ],\n nextSteps: [\n \"Use the canonical item referenced by duplicate_of as the --duplicate-of target.\",\n ],\n },\n );\n }\n return target.id;\n}\n\nasync function findActiveChildIds(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n parentId: string,\n statusRegistry: RuntimeStatusRegistry,\n): Promise<string[]> {\n const typeRegistry = resolveItemTypeRegistry(settings);\n const items = await listAllItemMetadataLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n return items\n .filter(\n (item) =>\n item.parent === parentId &&\n !isTerminalStatus(item.status, statusRegistry),\n )\n .map((item) => item.id)\n .sort((left, right) => left.localeCompare(right));\n}\n\nasync function findAutoUnblockCandidates(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n closedId: string,\n statusRegistry: RuntimeStatusRegistry,\n): Promise<AutoUnblockCandidate[]> {\n const typeRegistry = resolveItemTypeRegistry(settings);\n const items = await listAllItemMetadataLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n const itemsById = new Map(items.map((item) => [item.id, item]));\n const blockedStatuses = statusRegistry.blocked_statuses;\n return items\n .filter((item) => blockedStatuses.has(item.status))\n .map((item) => ({ item, blockerIds: collectBlockedByIds(item) }))\n .filter(({ blockerIds }) => blockerIds.includes(closedId))\n .filter(({ blockerIds }) =>\n blockerIds.every((blockerId) => {\n const blocker = itemsById.get(blockerId);\n return (\n blocker !== undefined &&\n isTerminalStatus(blocker.status, statusRegistry)\n );\n }),\n )\n .map(({ item, blockerIds }) => ({ id: item.id, blocker_ids: blockerIds }))\n .sort((left, right) => left.id.localeCompare(right.id));\n}\n\nasync function autoUnblockResolvedDependents(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n closedId: string,\n author: string,\n statusRegistry: RuntimeStatusRegistry,\n): Promise<string[]> {\n const candidates = await findAutoUnblockCandidates(\n pmRoot,\n settings,\n closedId,\n statusRegistry,\n );\n const warnings: string[] = [];\n for (const candidate of candidates) {\n try {\n const unblocked = await mutateItem({\n pmRoot,\n settings,\n id: candidate.id,\n op: \"update\",\n author,\n message: `Auto-unblocked after blocker ${closedId} closed`,\n mutate(document) {\n /* c8 ignore start -- normal auto-unblock candidates carry dependency metadata; fallback preserves hand-edited scalar-only blockers. */\n const dependencies = document.metadata.dependencies ?? [];\n /* c8 ignore stop */\n const remainingDependencies = dependencies.filter((dependency) => {\n const dependencyId = dependency.id.trim();\n return (\n dependency.kind !== \"blocked_by\" ||\n !candidate.blocker_ids.includes(dependencyId)\n );\n });\n document.metadata.status = statusRegistry.open_status;\n delete document.metadata.blocked_by;\n delete document.metadata.blocked_reason;\n document.metadata.unblock_note = `Auto-unblocked after blocker ${closedId} closed; all blockers resolved (${candidate.blocker_ids.join(\", \")}).`;\n if (remainingDependencies.length > 0) {\n document.metadata.dependencies = remainingDependencies;\n } else {\n delete document.metadata.dependencies;\n }\n const changedFields = [\n \"status\",\n \"blocked_by\",\n \"blocked_reason\",\n \"unblock_note\",\n ];\n if (remainingDependencies.length !== dependencies.length) {\n changedFields.push(\"dependencies\");\n }\n return {\n changedFields,\n };\n },\n });\n warnings.push(\n `auto_unblocked:${unblocked.item.id}:resolved_blockers=${candidate.blocker_ids.join(\",\")}`,\n );\n /* c8 ignore start -- defensive fan-out failure path; normal lock/claim state is auditable and still unblocks. */\n } catch (error) {\n const reason =\n error instanceof Error\n ? error.message.replace(/\\s+/g, \" \").trim()\n : \"unknown\";\n warnings.push(`auto_unblock_failed:${candidate.id}:${reason}`);\n }\n /* c8 ignore stop */\n }\n return warnings;\n}\n\nfunction applyInlineCloseFields(\n metadata: ItemMetadata,\n options: CloseCommandOptions,\n): CloseInlineFieldKey[] {\n const changedFields: CloseInlineFieldKey[] = [];\n const inlineCloseFields: Array<{\n option: string | undefined;\n key: CloseInlineFieldKey;\n }> = [\n { option: options.resolution, key: \"resolution\" },\n { option: options.expectedResult, key: \"expected_result\" },\n { option: options.actualResult, key: \"actual_result\" },\n ];\n for (const { option, key } of inlineCloseFields) {\n if (typeof option !== \"string\") {\n continue;\n }\n const trimmed = option.trim();\n if (trimmed.length === 0) {\n continue;\n }\n metadata[key] = trimmed;\n changedFields.push(key);\n }\n return changedFields;\n}\n\nfunction applyDuplicateCloseMetadata(\n metadata: ItemMetadata,\n duplicateOf: string | undefined,\n): CloseInlineFieldKey[] {\n if (duplicateOf === undefined) {\n return [];\n }\n metadata.duplicate_of = duplicateOf;\n const duplicateFallbackFields: CloseInlineFieldKey[] = [];\n const fallbackValues: Array<{ key: CloseInlineFieldKey; value: string }> = [\n { key: \"resolution\", value: `Duplicate of ${duplicateOf}` },\n {\n key: \"expected_result\",\n value: `Canonical item ${duplicateOf} tracks the work.`,\n },\n { key: \"actual_result\", value: `Closed as duplicate of ${duplicateOf}.` },\n ];\n for (const { key, value } of fallbackValues) {\n if (shouldApplyDuplicateFallback(metadata[key])) {\n metadata[key] = value;\n duplicateFallbackFields.push(key);\n }\n }\n return duplicateFallbackFields;\n}\n\nfunction collectCloseValidationWarnings(\n metadata: ItemMetadata,\n validateCloseMode: ValidateCloseMode,\n activeChildIds: string[],\n): string[] {\n const warnings: string[] = [];\n if (validateCloseMode !== \"off\") {\n const missingFields = findMissingCloseValidationFields(metadata);\n if (missingFields.length > 0) {\n if (validateCloseMode === \"strict\") {\n throw new PmCliError(\n `Cannot close item ${metadata.id}: missing ${missingFields.join(\", \")}. Populate fields or use --validate-close warn.`,\n EXIT_CODE.USAGE,\n );\n }\n warnings.push(\n `close_validation_missing_fields:${metadata.id}:${missingFields.join(\",\")}`,\n );\n }\n if (activeChildIds.length > 0) {\n if (validateCloseMode === \"strict\") {\n throw new PmCliError(\n `Cannot close item ${metadata.id}: active child items remain open (${activeChildIds.join(\", \")}). Close, cancel, or re-parent them first, or use --validate-close warn.`,\n EXIT_CODE.USAGE,\n );\n }\n warnings.push(\n `close_validation_active_children:${metadata.id}:${activeChildIds.join(\",\")}`,\n );\n }\n return warnings;\n }\n if (activeChildIds.length > 0) {\n warnings.push(\n `closed_with_active_children:${metadata.id}:${activeChildIds.join(\",\")}`,\n );\n }\n return warnings;\n}\n\nfunction applyCloseReason(\n metadata: ItemMetadata,\n closeReason: string | undefined,\n): string[] {\n if (closeReason !== undefined) {\n metadata.close_reason = closeReason;\n return [\"close_reason\"];\n }\n if (metadata.close_reason !== undefined) {\n delete metadata.close_reason;\n return [\"close_reason\"];\n }\n return [];\n}\n\nfunction clearCloseAssignee(metadata: ItemMetadata): string[] {\n if (metadata.assignee === undefined) {\n return [];\n }\n delete metadata.assignee;\n return [\"assignee\"];\n}\n\nfunction clearClosedBlockerSignals(metadata: ItemMetadata): {\n changedFields: string[];\n warnings: string[];\n} {\n const previousBlockedBy =\n typeof metadata.blocked_by === \"string\" ? metadata.blocked_by.trim() : \"\";\n const existingDeps = metadata.dependencies ?? [];\n const blockedByEdge = existingDeps.find((dep) => dep.kind === \"blocked_by\");\n const hadBlockedReason = metadata.blocked_reason !== undefined;\n if (\n previousBlockedBy.length === 0 &&\n blockedByEdge === undefined &&\n !hadBlockedReason\n ) {\n return { changedFields: [], warnings: [] };\n }\n const changedFields: string[] = [];\n if (previousBlockedBy.length > 0) {\n delete metadata.blocked_by;\n changedFields.push(\"blocked_by\");\n }\n if (hadBlockedReason) {\n delete metadata.blocked_reason;\n changedFields.push(\"blocked_reason\");\n }\n if (blockedByEdge !== undefined) {\n const remainingDeps = existingDeps.filter(\n (dep) => dep.kind !== \"blocked_by\",\n );\n if (remainingDeps.length > 0) {\n metadata.dependencies = remainingDeps;\n } else {\n delete metadata.dependencies;\n }\n changedFields.push(\"dependencies\");\n }\n // A stale reason-only close has no blocker identity; omit the blocker-clear warning instead of inventing one.\n const reportedBlocker = previousBlockedBy || blockedByEdge?.id;\n return {\n changedFields,\n warnings: reportedBlocker\n ? [`closed_cleared_blocked_by:${metadata.id}:${reportedBlocker}`]\n : [],\n };\n}\n\nfunction mutateCloseMetadata(\n metadata: ItemMetadata,\n context: CloseMutationContext,\n): { changedFields: string[]; warnings?: string[] } {\n if (\n isTerminalStatus(metadata.status, context.statusRegistry) &&\n !context.force\n ) {\n throw new PmCliError(\n `Item ${metadata.id} is already terminal; use --force to close again.`,\n EXIT_CODE.CONFLICT,\n );\n }\n const inlineChangedFields = applyInlineCloseFields(metadata, context.options);\n const duplicateFallbackFields = applyDuplicateCloseMetadata(\n metadata,\n context.duplicateOf,\n );\n const mutationWarnings = collectCloseValidationWarnings(\n metadata,\n context.validateCloseMode,\n context.activeChildIds,\n );\n metadata.status = context.statusRegistry.close_status;\n metadata.closed_at = context.closedAt;\n const changedFields = [\n \"status\",\n \"closed_at\",\n ...applyCloseReason(metadata, context.closeReason),\n ...inlineChangedFields,\n ];\n if (context.duplicateOf !== undefined) {\n changedFields.push(\"duplicate_of\");\n for (const key of duplicateFallbackFields) {\n /* v8 ignore start -- duplicate fallback keys are already pre-deduped by applyDuplicateCloseMetadata in covered close paths */\n if (!changedFields.includes(key)) {\n changedFields.push(key);\n }\n /* v8 ignore stop */\n }\n }\n changedFields.push(...clearCloseAssignee(metadata));\n const blockerCleanup = clearClosedBlockerSignals(metadata);\n changedFields.push(...blockerCleanup.changedFields);\n mutationWarnings.push(...blockerCleanup.warnings);\n return {\n changedFields,\n ...(mutationWarnings.length > 0 ? { warnings: mutationWarnings } : {}),\n };\n}\n\n/** Public contract for test only close command, shared by SDK and presentation-layer consumers. */\nexport const _testOnlyCloseCommand = {\n blockedByIds: collectBlockedByIds,\n};\n\n/** Implements run close for the public runtime surface of this module. */\nexport async function runClose(\n id: string,\n closeReasonText: string | undefined,\n options: CloseCommandOptions,\n global: GlobalOptions,\n): Promise<CloseResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const author = toAuthor(options.author, settings.author_default);\n // GH-250: verify the target item EXISTS before the governance close-reason\n // gate fires. Otherwise closing a typo'd id with no reason reports\n // \"Close reason text is required\" and hides the real cause (bad id) until a\n // reason is supplied. Existence is the more fundamental precondition, so it\n // is validated first regardless of whether a reason was provided.\n const typeToFolder = resolveItemTypeRegistry(settings).type_to_folder;\n const located = await locateItem(\n pmRoot,\n id,\n settings.id_prefix,\n settings.item_format,\n typeToFolder,\n );\n if (!located) {\n throw await buildItemNotFoundError(\n pmRoot,\n id,\n settings.id_prefix,\n typeToFolder,\n );\n }\n // GH-204: resolve the duplicate target BEFORE reason validation so\n // `pm close <id> --duplicate-of <canonical>` succeeds under\n // governance.require_close_reason without a manual reason — when no\n // positional/--reason text is provided the reason defaults to\n // \"Duplicate of <id>\" (mirroring the auto-filled closure metadata).\n // Explicit reason text still wins.\n const duplicateOf = await assertDuplicateTargetExists(\n pmRoot,\n settings,\n options.duplicateOf,\n id,\n );\n // pm-7x8d / pm-9hry / GH-204: when no explicit positional/--reason text is given, derive\n // the close reason from the next-best closure signal instead of hard-blocking\n // under governance.require_close_reason. Precedence: explicit reason text >\n // --duplicate-of (\"Duplicate of <id>\") > --resolution summary > --message.\n // Resolution still writes metadata.resolution below; message still writes the\n // history entry through mutateItem. Reusing either as the close reason just lets\n // a single agent-authored close command succeed when it already supplied a\n // closure summary through another structured option.\n const effectiveCloseReasonText = resolveEffectiveCloseReasonText({\n closeReasonText,\n duplicateOf,\n resolution: options.resolution,\n message: options.message,\n requireCloseReason: settings.governance.require_close_reason,\n });\n const closeReason = normalizeCloseReason(\n effectiveCloseReasonText,\n settings.governance.require_close_reason,\n );\n const validateCloseMode =\n parseValidateCloseMode(options.validateClose) ??\n settings.governance.close_validation_default;\n // C3 (pm-fu5d): scan for active children even under minimal governance so\n // closing a parent is never silently orphaning — off mode emits an\n // informational note instead of the warn/strict validation warning.\n const activeChildIds = await findActiveChildIds(\n pmRoot,\n settings,\n id,\n statusRegistry,\n );\n\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"close\",\n author,\n message: options.message,\n force: options.force,\n mutate(document) {\n return mutateCloseMetadata(document.metadata, {\n statusRegistry,\n force: options.force,\n options,\n duplicateOf,\n validateCloseMode,\n activeChildIds,\n closeReason,\n closedAt: new Date().toISOString(),\n });\n },\n });\n\n return {\n item: toItemRecord(result.item),\n changed_fields: result.changedFields,\n warnings: [\n ...result.warnings,\n ...(await autoUnblockResolvedDependents(\n pmRoot,\n settings,\n located.id,\n author,\n statusRegistry,\n )),\n ],\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFA,SAAS,SACP,WACA,eAAqB;AAErB,QAAM,WAAW,aAAa,QAAQ,IAAI,aAAa;AACvD,QAAM,UAAU,SAAS,KAAI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AAI,CAAC,SAAS;AACZ,UAAM,MAAM,uBACV,QACA,IACA,SAAS,WACT,YAAY;EAEhB;AAOA,QAAM,cAAc,MAAM,4BACxB,QACA,UACA,QAAQ,aACR,EAAE;AAUJ,QAAM,2BAA2B,gCAAgC;IAC/D;IACA;IACA,YAAY,QAAQ;IACpB,SAAS,QAAQ;IACjB,oBAAoB,SAAS,WAAW;GACzC;AACD,QAAM,cAAc,qBAClB,0BACA,SAAS,WAAW,oBAAoB;AAE1C,QAAM,oBACJ,uBAAuB,QAAQ,aAAa,KAC5C,SAAS,WAAW;AAItB,QAAM,iBAAiB,MAAM,mBAC3B,QACA,UACA,IACA,cAAc;AAGhB,QAAM,SAAS,MAAM,WAAW;IAC9B;IACA;IACA;IACA,IAAI;IACJ;IACA,SAAS,QAAQ;IACjB,OAAO,QAAQ;IACf,OAAO,UAAQ;AACb,aAAO,oBAAoB,SAAS,UAAU;QAC5C;QACA,OAAO,QAAQ;QACf;QACA;QACA;QACA;QACA;QACA,WAAU,oBAAI,KAAI,GAAG,YAAW;OACjC;IACH;GACD;AAED,SAAO;IACL,MAAM,aAAa,OAAO,IAAI;IAC9B,gBAAgB,OAAO;IACvB,UAAU;MACR,GAAG,OAAO;MACV,GAAI,MAAM,8BACR,QACA,UACA,QAAQ,IACR,QACA,cAAc;;;AAItB;",
6
+ "names": ["global"]
7
+ }
@@ -27,7 +27,7 @@ import {
27
27
  } from "./chunk-YRYYFGV3.js";
28
28
  import {
29
29
  CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS
30
- } from "./chunk-S6FF7VW6.js";
30
+ } from "./chunk-WQXRZMFN.js";
31
31
  import {
32
32
  normalizeAddTypeInput,
33
33
  parseItemTypesFile,
@@ -875,4 +875,4 @@ export {
875
875
  formatProfileLintHuman,
876
876
  formatProfileApplyHuman
877
877
  };
878
- //# sourceMappingURL=chunk-3D4YVTNG.js.map
878
+ //# sourceMappingURL=chunk-TZAE66GQ.js.map
@@ -1173,7 +1173,7 @@ var UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS = UPDATE_COMMANDER_OPTION_REGIS
1173
1173
  !(function() {
1174
1174
  try {
1175
1175
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
1176
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "2f7d8ae8-4fb8-5ec4-a440-d42f8499589f");
1176
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a665adfd-c6a7-544c-a3f9-55a6d5fa4472");
1177
1177
  } catch (e2) {
1178
1178
  }
1179
1179
  })();
@@ -1218,6 +1218,7 @@ var PM_CORE_COMMAND_NAMES = [
1218
1218
  "context",
1219
1219
  "ctx",
1220
1220
  "get",
1221
+ "graph",
1221
1222
  "search",
1222
1223
  "eval",
1223
1224
  "next",
@@ -1260,6 +1261,20 @@ var PM_CORE_COMMAND_NAMES = [
1260
1261
  "remind",
1261
1262
  "help"
1262
1263
  ];
1264
+ var GRAPH_SUBCOMMAND_VALUES = [
1265
+ "ancestors",
1266
+ "descendants",
1267
+ "predecessors",
1268
+ "successors",
1269
+ "paths",
1270
+ "impact",
1271
+ "analyze",
1272
+ "audit",
1273
+ "communities",
1274
+ "redundancy",
1275
+ "dominators",
1276
+ "plan"
1277
+ ];
1263
1278
  var PM_TOOL_ACTIONS = [
1264
1279
  "init",
1265
1280
  "config",
@@ -1331,6 +1346,7 @@ var PM_TOOL_ACTIONS = [
1331
1346
  "files",
1332
1347
  "docs",
1333
1348
  "deps",
1349
+ "graph",
1334
1350
  "test",
1335
1351
  "test-all",
1336
1352
  "telemetry",
@@ -1365,7 +1381,7 @@ function isPmExtensionPolicySurfaceContract(value) {
1365
1381
  !(function() {
1366
1382
  try {
1367
1383
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
1368
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "737c225c-aa32-5277-b169-faedbb057f39");
1384
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "bbb41f64-eaab-546b-b21e-9535853ee1f9");
1369
1385
  } catch (e2) {
1370
1386
  }
1371
1387
  })();
@@ -1710,7 +1726,9 @@ var TOOL_DEPS_OPTION_CONTRACTS = [
1710
1726
  { param: "nodeLimit", flag: "--node-limit" },
1711
1727
  { param: "edgeLimit", flag: "--edge-limit" },
1712
1728
  { param: "tokenBudget", flag: "--token-budget" },
1713
- { param: "cursor", flag: "--cursor" }
1729
+ { param: "cursor", flag: "--cursor" },
1730
+ { param: "direction", flag: "--direction" },
1731
+ { param: "kind", flag: "--kind", repeatable: true }
1714
1732
  ];
1715
1733
 
1716
1734
  // dist/sdk/cli-contracts/string-lists.js
@@ -1731,7 +1749,7 @@ function normalizeUniqueStringList(values) {
1731
1749
  !(function() {
1732
1750
  try {
1733
1751
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
1734
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "cb1e2010-bf9f-5eb9-a77d-70e31f5463ac");
1752
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "c5e59d37-0b45-54cc-93a0-4e52a78d6dd0");
1735
1753
  } catch (e2) {
1736
1754
  }
1737
1755
  })();
@@ -2878,6 +2896,23 @@ var DEPS_FLAG_CONTRACTS = [
2878
2896
  { flag: "--format" },
2879
2897
  { flag: "--max-depth" },
2880
2898
  { flag: "--collapse" },
2899
+ { flag: "--summary" },
2900
+ { flag: "--node-limit" },
2901
+ { flag: "--edge-limit" },
2902
+ { flag: "--token-budget" },
2903
+ { flag: "--cursor" },
2904
+ { flag: "--direction" },
2905
+ { flag: "--kind", list: true }
2906
+ ];
2907
+ var GRAPH_FLAG_CONTRACTS = [
2908
+ { flag: "--kind", list: true },
2909
+ { flag: "--max-depth" },
2910
+ { flag: "--limit" },
2911
+ { flag: "--after" },
2912
+ { flag: "--direction" },
2913
+ { flag: "--max-paths" },
2914
+ { flag: "--sample" },
2915
+ { flag: "--exempt-isolate", list: true },
2881
2916
  { flag: "--summary" }
2882
2917
  ];
2883
2918
  var EVAL_FLAG_CONTRACTS = [
@@ -3030,6 +3065,7 @@ var SUBCOMMAND_FLAG_CONTRACTS_BY_COMMAND = new Map([
3030
3065
  ["files", FILES_FLAG_CONTRACTS],
3031
3066
  ["docs", DOCS_FLAG_CONTRACTS],
3032
3067
  ["deps", DEPS_FLAG_CONTRACTS],
3068
+ ["graph", GRAPH_FLAG_CONTRACTS],
3033
3069
  ["test", TEST_FLAG_CONTRACTS],
3034
3070
  ["test-all", TEST_ALL_FLAG_CONTRACTS],
3035
3071
  ["telemetry", TELEMETRY_FLAG_CONTRACTS],
@@ -3103,7 +3139,7 @@ function toCompletionFlagString(flagContracts, includeGlobal = true) {
3103
3139
  !(function() {
3104
3140
  try {
3105
3141
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
3106
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "ced0a4db-9b0d-50c6-9de1-1d08dcf39c93");
3142
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "d9640c02-2d99-5ec4-b954-c6f5800d3af4");
3107
3143
  } catch (e2) {
3108
3144
  }
3109
3145
  })();
@@ -3449,6 +3485,22 @@ var PM_TOOL_PARAMETER_PROPERTIES = {
3449
3485
  edgeLimit: { anyOf: [{ type: "string" }, { type: "integer", minimum: 1 }] },
3450
3486
  tokenBudget: { anyOf: [{ type: "string" }, { type: "integer", minimum: 1 }] },
3451
3487
  cursor: { type: "string" },
3488
+ direction: { type: "string", enum: ["outgoing", "incoming", "both"] },
3489
+ kind: {
3490
+ anyOf: [
3491
+ { type: "string" },
3492
+ { type: "array", items: { type: "string" } }
3493
+ ]
3494
+ },
3495
+ after: { type: "string" },
3496
+ maxPaths: { anyOf: [{ type: "string" }, { type: "integer", minimum: 1 }] },
3497
+ sample: { anyOf: [{ type: "string" }, { type: "integer", minimum: 1 }] },
3498
+ exemptIsolate: {
3499
+ anyOf: [
3500
+ { type: "string" },
3501
+ { type: "array", items: { type: "string" } }
3502
+ ]
3503
+ },
3452
3504
  collapse: { type: "string", enum: ["none", "repeated"] },
3453
3505
  shell: { type: "string", enum: ["bash", "zsh", "fish"] },
3454
3506
  stdin: { type: "boolean" },
@@ -3764,7 +3816,7 @@ var PM_TOOL_PARAMETER_METADATA = {
3764
3816
  examples: ["Task", "Feature"]
3765
3817
  },
3766
3818
  subcommand: {
3767
- description: "Subcommand selector for schema, profile, and telemetry actions."
3819
+ description: "Subcommand selector for schema, profile, telemetry, and graph actions."
3768
3820
  },
3769
3821
  name: {
3770
3822
  description: "Custom item type name (schema add-type/remove-type/show), custom status id (schema show-status/add-status/remove-status), custom field key (schema add-field/remove-field/show-field), or profile name (profile show/apply/lint).",
@@ -4344,6 +4396,30 @@ var PM_TOOL_PARAMETER_METADATA = {
4344
4396
  cursor: {
4345
4397
  description: "Opaque continuation cursor returned by deps --format context."
4346
4398
  },
4399
+ direction: {
4400
+ description: 'Graph-context traversal direction for deps action ("outgoing", "incoming", or "both").',
4401
+ examples: ["both", "incoming"]
4402
+ },
4403
+ kind: {
4404
+ description: "Registered relationship kinds narrowing deps --format context traversal (string, comma-separated, or array).",
4405
+ examples: ["blocked_by", ["parent", "related"]]
4406
+ },
4407
+ after: {
4408
+ description: "Continuation cursor resuming a bounded listing or traversal after this previously returned id.",
4409
+ examples: ["pm-x1y2"]
4410
+ },
4411
+ maxPaths: {
4412
+ description: "Maximum enumerated paths for graph paths queries.",
4413
+ examples: [5, "10"]
4414
+ },
4415
+ sample: {
4416
+ description: "Maximum evidence sample entries per graph audit finding.",
4417
+ examples: [10, "25"]
4418
+ },
4419
+ exemptIsolate: {
4420
+ description: "Item ids the graph audit treats as explicitly valid isolates (string, comma-separated, or array).",
4421
+ examples: ["pm-x1y2", ["pm-x1y2", "pm-a3b4"]]
4422
+ },
4347
4423
  collapse: {
4348
4424
  description: 'Dependency tree collapse mode for deps action ("none" or "repeated").',
4349
4425
  examples: ["none", "repeated"]
@@ -4413,6 +4489,43 @@ var PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
4413
4489
  description: "Profile name for show/apply/lint. Built-in profiles are agile, ops, and research; an active extension can contribute additional archetype names that resolve here too.",
4414
4490
  examples: ["agile", "ops", "research"]
4415
4491
  }
4492
+ },
4493
+ graph: {
4494
+ subcommand: {
4495
+ description: "Graph query selector: ancestors|descendants|predecessors|successors|paths|impact|analyze|audit|communities|redundancy|dominators|plan. Traversals, paths, impact, and dominators require id; paths also requires target; plan derives dry-run remediation proposals from the governance audit.",
4496
+ examples: ["successors", "audit"]
4497
+ },
4498
+ id: {
4499
+ description: "Root item id for traversal, paths, impact, and dominators graph queries.",
4500
+ examples: ["pm-x1y2"]
4501
+ },
4502
+ target: {
4503
+ description: "Target item id for graph paths queries.",
4504
+ examples: ["pm-a3b4"]
4505
+ },
4506
+ direction: {
4507
+ description: 'Edge orientation for graph paths/impact/dominators queries ("outgoing", "incoming", or "both"; default "both").',
4508
+ examples: ["incoming"]
4509
+ },
4510
+ kind: {
4511
+ description: "Registered relationship kinds narrowing the graph query (string, comma-separated, or array).",
4512
+ examples: ["blocked_by", ["parent", "related"]]
4513
+ },
4514
+ maxDepth: {
4515
+ description: "Maximum graph traversal depth (non-negative integer).",
4516
+ examples: [2, "4"]
4517
+ },
4518
+ after: {
4519
+ description: "Resume a hierarchy/ordering graph traversal after this previously returned node id.",
4520
+ examples: ["pm-x1y2"]
4521
+ },
4522
+ limit: {
4523
+ description: "Maximum returned rows per bounded graph collection (traversal ids, impact rows, analyze/communities samples, redundancy rows, dominator bottlenecks).",
4524
+ examples: [10, "25"]
4525
+ },
4526
+ summary: {
4527
+ description: "When true, return counts-first graph envelopes without row collections."
4528
+ }
4416
4529
  }
4417
4530
  };
4418
4531
 
@@ -4420,7 +4533,7 @@ var PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
4420
4533
  !(function() {
4421
4534
  try {
4422
4535
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
4423
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "15ef6d3d-a3e4-50ab-a3d8-ac9cfa57c110");
4536
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b2640e2f-8ec1-5746-a121-018b7de82393");
4424
4537
  } catch (e2) {
4425
4538
  }
4426
4539
  })();
@@ -4444,6 +4557,29 @@ var PM_TOOL_ACTION_MUTATION_PARAMETER_KEYS = {
4444
4557
  "update-many": ["fullChangedFields"],
4445
4558
  "close-many": ["fullChangedFields"]
4446
4559
  };
4560
+ var PM_TOOL_ACTION_NESTED_OPTION_COMPATIBILITY_KEYS = Object.freeze({
4561
+ "close-many": [
4562
+ "list",
4563
+ "expected_result",
4564
+ "expected",
4565
+ "actual_result",
4566
+ "actual",
4567
+ "validate_close",
4568
+ "dry_run",
4569
+ "checkpoint",
4570
+ "no_checkpoint",
4571
+ "filterAssignee_filter"
4572
+ ],
4573
+ "update-many": [
4574
+ "list",
4575
+ "update",
4576
+ "dry_run",
4577
+ "checkpoint",
4578
+ "no_checkpoint",
4579
+ "filterAssignee_filter"
4580
+ ],
4581
+ ...Object.fromEntries(PM_TOOL_ACTIONS.filter((action) => action === "install" || action === "extension" || action === "package" || action.startsWith("extension-") || action.startsWith("package-")).map((action) => [action, ["project", "local", "global"]]))
4582
+ });
4447
4583
  function toSchemaKeyList(values) {
4448
4584
  return normalizeUniqueStringList(values);
4449
4585
  }
@@ -5008,7 +5144,34 @@ var PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
5008
5144
  },
5009
5145
  deps: {
5010
5146
  required: ["id"],
5011
- optional: ["format", "maxDepth", "collapse", "summary", "nodeLimit", "edgeLimit", "tokenBudget", "cursor"]
5147
+ optional: [
5148
+ "format",
5149
+ "maxDepth",
5150
+ "collapse",
5151
+ "summary",
5152
+ "nodeLimit",
5153
+ "edgeLimit",
5154
+ "tokenBudget",
5155
+ "cursor",
5156
+ "direction",
5157
+ "kind"
5158
+ ]
5159
+ },
5160
+ graph: {
5161
+ required: ["subcommand"],
5162
+ optional: [
5163
+ "id",
5164
+ "target",
5165
+ "kind",
5166
+ "maxDepth",
5167
+ "limit",
5168
+ "after",
5169
+ "direction",
5170
+ "maxPaths",
5171
+ "sample",
5172
+ "exemptIsolate",
5173
+ "summary"
5174
+ ]
5012
5175
  },
5013
5176
  test: {
5014
5177
  required: ["id"],
@@ -5308,18 +5471,24 @@ function buildActionScopedAllOf(contract) {
5308
5471
  }
5309
5472
  return allOf;
5310
5473
  }
5311
- function buildActionScopedToolSchema(action) {
5474
+ function pmToolActionParameterKeys(action) {
5475
+ if (!Object.prototype.hasOwnProperty.call(PM_TOOL_ACTION_SCHEMA_CONTRACTS, action)) {
5476
+ return void 0;
5477
+ }
5312
5478
  const contract = PM_TOOL_ACTION_SCHEMA_CONTRACTS[action];
5313
- const required = toSchemaKeyList(contract.required ?? []);
5314
- const optional = toSchemaKeyList(contract.optional ?? []);
5315
5479
  const mutationParameterKeys = PM_TOOL_ACTION_MUTATION_PARAMETER_KEYS[action] ?? [];
5316
- const allowedKeys = toSchemaKeyList([
5480
+ return toSchemaKeyList([
5317
5481
  "action",
5318
5482
  ...PM_TOOL_GLOBAL_PARAMETER_KEYS,
5319
5483
  ...mutationParameterKeys,
5320
- ...required,
5321
- ...optional
5484
+ ...contract.required ?? [],
5485
+ ...contract.optional ?? []
5322
5486
  ]);
5487
+ }
5488
+ function buildActionScopedToolSchema(action) {
5489
+ const contract = PM_TOOL_ACTION_SCHEMA_CONTRACTS[action];
5490
+ const required = toSchemaKeyList(contract.required ?? []);
5491
+ const allowedKeys = pmToolActionParameterKeys(action);
5323
5492
  const schema = {
5324
5493
  type: "object",
5325
5494
  additionalProperties: false,
@@ -5418,7 +5587,7 @@ var PM_PROVIDER_TOOL_PARAMETERS_SCHEMA = createLazyContractSchema(buildProviderC
5418
5587
  !(function() {
5419
5588
  try {
5420
5589
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
5421
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "03628345-205e-5ae0-9a16-1f47628ea7af");
5590
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "04a1cf17-7ffe-56c2-bf4d-73e4368161f5");
5422
5591
  } catch (e2) {
5423
5592
  }
5424
5593
  })();
@@ -5447,6 +5616,7 @@ export {
5447
5616
  PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,
5448
5617
  PM_EXTENSION_POLICY_SURFACE_CONTRACTS,
5449
5618
  PM_CORE_COMMAND_NAMES,
5619
+ GRAPH_SUBCOMMAND_VALUES,
5450
5620
  PM_TOOL_ACTIONS,
5451
5621
  isPmToolAction,
5452
5622
  isPmExtensionCapabilityContract,
@@ -5536,6 +5706,7 @@ export {
5536
5706
  GET_FLAG_CONTRACTS,
5537
5707
  GUIDE_FLAG_CONTRACTS,
5538
5708
  DEPS_FLAG_CONTRACTS,
5709
+ GRAPH_FLAG_CONTRACTS,
5539
5710
  EVAL_FLAG_CONTRACTS,
5540
5711
  NEXT_FLAG_CONTRACTS,
5541
5712
  SEARCH_FLAG_CONTRACTS,
@@ -5550,4 +5721,4 @@ export {
5550
5721
  PM_TOOL_PARAMETERS_SCHEMA,
5551
5722
  PM_PROVIDER_TOOL_PARAMETERS_SCHEMA
5552
5723
  };
5553
- //# sourceMappingURL=chunk-S6FF7VW6.js.map
5724
+ //# sourceMappingURL=chunk-WQXRZMFN.js.map