@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,29 +1,8 @@
1
- import {
2
- createQueryFingerprint,
3
- encodeQueryCursor,
4
- resolveQueryCursorStart
5
- } from "./chunk-M7MVOKVV.js";
6
- import {
7
- getActiveExtensionRegistrations,
8
- isTerminalStatus,
9
- listAllItemMetadataLight,
10
- readSettings
11
- } from "./chunk-646MQXFW.js";
12
- import {
13
- EXIT_CODE,
14
- PmCliError,
15
- getSettingsPath,
16
- pathExists,
17
- resolveItemTypeRegistry,
18
- resolvePmRoot,
19
- resolveRuntimeStatusRegistry
20
- } from "./chunk-WACRQ26A.js";
21
-
22
1
  // dist/sdk/relationships.js
23
2
  !(function() {
24
3
  try {
25
4
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
26
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "f5e9e0a6-4550-5e55-9fef-ee54ec06a495");
5
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "00588d49-70aa-59c8-bc85-d0bbd5e77d4b");
27
6
  } catch (e2) {
28
7
  }
29
8
  })();
@@ -369,6 +348,14 @@ var RelationshipGraph = class _RelationshipGraph {
369
348
  nodes() {
370
349
  return this.#nodeSnapshot;
371
350
  }
351
+ /** Report whether an identifier names an indexed node. */
352
+ hasNode(id) {
353
+ return this.#nodes.has(id);
354
+ }
355
+ /** Return the registry that interprets this graph's relationship kinds. */
356
+ registry() {
357
+ return this.#registry;
358
+ }
372
359
  #assertNode(id) {
373
360
  if (!this.#nodes.has(id))
374
361
  throw new TypeError(`Relationship node not found: ${id}`);
@@ -408,6 +395,24 @@ var RelationshipGraph = class _RelationshipGraph {
408
395
  }
409
396
  };
410
397
  }
398
+ /** Return deterministic one-hop neighbor rows paired with each connecting edge. */
399
+ neighborEdges(id, options = {}) {
400
+ this.#assertNode(id);
401
+ options.signal?.throwIfAborted();
402
+ const kinds = options.kinds ? new Set(options.kinds.map((kind) => this.#registry.require(kind).kind)) : void 0;
403
+ const rows = this.#neighbors(id, options.direction ?? "outgoing", kinds);
404
+ const limit = options.limit ?? Number.POSITIVE_INFINITY;
405
+ const value = rows.slice(0, limit);
406
+ return {
407
+ value,
408
+ meta: {
409
+ visitedNodes: 1,
410
+ inspectedEdges: rows.length,
411
+ truncated: value.length < rows.length,
412
+ nextCursor: value.at(-1)?.id
413
+ }
414
+ };
415
+ }
411
416
  /** Return bounded transitive closure in breadth-first discovery order. */
412
417
  closure(id, options = {}) {
413
418
  this.#assertNode(id);
@@ -533,207 +538,14 @@ function dependencyToRelationship(source, dependency, registry = defaultRegistry
533
538
  };
534
539
  }
535
540
 
536
- // dist/sdk/relationship-context.js
541
+ // dist/sdk/graph/assembly.js
537
542
  !(function() {
538
543
  try {
539
544
  var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
540
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "dfd47ca8-a68d-50e1-9aba-638d974a0027");
545
+ n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "6d8ff34a-789b-5b49-8304-9a7d53f8365d");
541
546
  } catch (e2) {
542
547
  }
543
548
  })();
544
- var tokenEncoder = new TextEncoder();
545
- function positiveInteger(value, fallback, field) {
546
- const resolved = value ?? fallback;
547
- if (!Number.isInteger(resolved) || resolved < 1)
548
- throw new TypeError(`Relationship context ${field} must be positive`);
549
- return resolved;
550
- }
551
- function estimateTokens(value) {
552
- return Math.max(1, Math.ceil(tokenEncoder.encode(JSON.stringify(value)).byteLength / 4));
553
- }
554
- function explainDirectEdge(edge, root, node, registry) {
555
- const definition = registry.require(edge.kind);
556
- if (definition.ordering) {
557
- const sourceFirst = (definition.precedence ?? "source_before_target") === "source_before_target";
558
- const before = sourceFirst ? edge.source : edge.target;
559
- return node === before ? "prerequisite" : "dependent";
560
- }
561
- if (definition.hierarchy) {
562
- const sourceIsParent = (definition.hierarchyDirection ?? "source_parent") === "source_parent";
563
- const parent = sourceIsParent ? edge.source : edge.target;
564
- return node === parent ? "ancestor" : "descendant";
565
- }
566
- if (edge.kind === "discovered_from" || edge.kind === "incident_from")
567
- return "provenance";
568
- return "related";
569
- }
570
- function directReasons(rootEdges, root, node, registry) {
571
- const reasons = rootEdges.filter((edge) => edge.source === root && edge.target === node || edge.target === root && edge.source === node).map((edge) => explainDirectEdge(edge, root, node, registry));
572
- return [...new Set(reasons)].sort();
573
- }
574
- function discoverNodes(graph, root, options) {
575
- const direction = options.direction ?? "both";
576
- const maxDepth = options.maxDepth ?? 3;
577
- if (!Number.isInteger(maxDepth) || maxDepth < 0)
578
- throw new TypeError("Relationship context maxDepth must be non-negative");
579
- const seen = /* @__PURE__ */ new Set([root]);
580
- const queue = [{ id: root, distance: 0 }];
581
- const rows = [];
582
- let inspectedEdges = 0;
583
- let depthTruncated = false;
584
- for (let index = 0; index < queue.length; index += 1) {
585
- options.signal?.throwIfAborted();
586
- const current = queue[index];
587
- if (current.distance >= maxDepth && depthTruncated)
588
- continue;
589
- const adjacent = graph.adjacency(current.id, {
590
- direction,
591
- kinds: options.kinds,
592
- signal: options.signal
593
- });
594
- inspectedEdges += adjacent.meta.inspectedEdges;
595
- if (current.distance >= maxDepth) {
596
- if (adjacent.value.some((id) => !seen.has(id)))
597
- depthTruncated = true;
598
- continue;
599
- }
600
- for (const id of adjacent.value) {
601
- if (seen.has(id))
602
- continue;
603
- seen.add(id);
604
- const row = { id, distance: current.distance + 1 };
605
- rows.push(row);
606
- queue.push(row);
607
- }
608
- }
609
- rows.sort((left, right) => left.distance - right.distance || left.id.localeCompare(right.id));
610
- return {
611
- rows,
612
- visitedNodes: queue.length,
613
- inspectedEdges,
614
- depthTruncated
615
- };
616
- }
617
- function selectContextNodes(params) {
618
- const nodes = [];
619
- let usedTokens = params.initialTokens;
620
- const rootEdges = params.graph.incidentEdges(params.rootId);
621
- for (const candidate of params.candidates) {
622
- if (nodes.length >= params.nodeLimit)
623
- break;
624
- const node = {
625
- ...params.details.get(candidate.id) ?? { id: candidate.id },
626
- distance: candidate.distance,
627
- reasons: candidate.distance === 1 ? directReasons(rootEdges, params.rootId, candidate.id, params.registry) : [`reachable at depth ${candidate.distance}`]
628
- };
629
- const cost = estimateTokens(node);
630
- if (usedTokens + cost > params.tokenBudget)
631
- break;
632
- nodes.push(node);
633
- usedTokens += cost;
634
- }
635
- if (params.candidates.length > 0 && nodes.length === 0)
636
- throw new TypeError("Relationship context tokenBudget cannot fit one node");
637
- return { nodes, usedTokens };
638
- }
639
- function selectContextEdges(params) {
640
- const candidates = params.graph.edges().filter((edge) => params.included.has(edge.source) && params.included.has(edge.target));
641
- const edges = [];
642
- let usedTokens = params.initialTokens;
643
- for (const edge of candidates) {
644
- if (edges.length >= params.edgeLimit)
645
- break;
646
- const cost = estimateTokens(edge);
647
- if (usedTokens + cost > params.tokenBudget)
648
- break;
649
- edges.push(edge);
650
- usedTokens += cost;
651
- }
652
- return { edges, usedTokens, candidateCount: candidates.length };
653
- }
654
- function buildRelationshipContext(graph, rootId, details, options = {}) {
655
- if (!graph.nodes().includes(rootId))
656
- throw new TypeError(`Relationship node not found: ${rootId}`);
657
- const nodeLimit = positiveInteger(options.nodeLimit, 20, "nodeLimit");
658
- const edgeLimit = positiveInteger(options.edgeLimit, 40, "edgeLimit");
659
- const tokenBudget = positiveInteger(options.tokenBudget, 1200, "tokenBudget");
660
- const registry = options.registry ?? createRelationshipKindRegistry();
661
- const byId = new Map(details.map((detail) => [detail.id, detail]));
662
- const rootDetails = byId.get(rootId) ?? {
663
- id: rootId
664
- };
665
- const { evidence: rootEvidence = [], ...root } = rootDetails;
666
- const evidence = [...rootEvidence];
667
- const discovery = discoverNodes(graph, rootId, options);
668
- const fingerprint = createQueryFingerprint("relationship-context", {
669
- rootId,
670
- direction: options.direction ?? "both",
671
- kinds: [...options.kinds ?? []].sort(),
672
- maxDepth: options.maxDepth ?? 3
673
- });
674
- const pageStart = resolveQueryCursorStart(discovery.rows, options.cursor, fingerprint, ({ id }) => id);
675
- const candidates = discovery.rows.slice(pageStart);
676
- const initialTokens = estimateTokens(root) + estimateTokens(evidence);
677
- if (initialTokens > tokenBudget)
678
- throw new TypeError("Relationship context tokenBudget cannot fit root and evidence");
679
- const nodeSelection = selectContextNodes({
680
- candidates,
681
- details: byId,
682
- graph,
683
- rootId,
684
- registry,
685
- nodeLimit,
686
- tokenBudget,
687
- initialTokens
688
- });
689
- const { nodes } = nodeSelection;
690
- const included = /* @__PURE__ */ new Set([rootId, ...nodes.map(({ id }) => id)]);
691
- const edgeSelection = selectContextEdges({
692
- graph,
693
- included,
694
- edgeLimit,
695
- tokenBudget,
696
- initialTokens: nodeSelection.usedTokens
697
- });
698
- const { edges, usedTokens } = edgeSelection;
699
- const consumed = pageStart + nodes.length;
700
- const hasMoreNodes = consumed < discovery.rows.length;
701
- const lastNode = nodes.at(-1);
702
- const omittedEdges = edgeSelection.candidateCount - edges.length;
703
- const truncated = discovery.depthTruncated || hasMoreNodes || omittedEdges > 0;
704
- return {
705
- root,
706
- nodes,
707
- edges,
708
- evidence,
709
- meta: {
710
- exact: true,
711
- truncated,
712
- nodeLimit,
713
- edgeLimit,
714
- tokenBudget,
715
- usedTokens,
716
- visitedNodes: discovery.visitedNodes,
717
- inspectedEdges: discovery.inspectedEdges,
718
- omittedNodes: discovery.rows.length - consumed,
719
- omittedEdges,
720
- ...hasMoreNodes && lastNode ? {
721
- nextCursor: encodeQueryCursor(fingerprint, lastNode.id, consumed - 1)
722
- } : {}
723
- }
724
- };
725
- }
726
-
727
- // dist/sdk/dependencies.js
728
- !(function() {
729
- try {
730
- var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
731
- n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "f44a0567-53d9-5c87-b01f-15fb84782227");
732
- } catch (e2) {
733
- }
734
- })();
735
- var DEPS_FORMAT_VALUES = ["tree", "graph", "context"];
736
- var DEPS_COLLAPSE_VALUES = ["none", "repeated"];
737
549
  function normalizeDependencyReferenceTarget(target) {
738
550
  if (typeof target !== "string")
739
551
  return void 0;
@@ -747,7 +559,8 @@ function normalizeDependencyGraphTarget(target) {
747
559
  return normalized?.toLowerCase() === "no-active-blocker" ? void 0 : normalized;
748
560
  }
749
561
  function collectDanglingDependencyReferences(items, isTerminal = (status) => status === "closed" || status === "canceled") {
750
- const knownIds = new Set(items.map((item) => item.id.trim().toLowerCase()));
562
+ const safeItems = items.filter((item) => typeof item?.id === "string" && item.id.trim().length > 0);
563
+ const knownIds = new Set(safeItems.map((item) => item.id.trim().toLowerCase()));
751
564
  const rows = /* @__PURE__ */ new Map();
752
565
  const addReference = (item, target, kind, source) => {
753
566
  const normalized = normalizeDependencyReferenceTarget(target);
@@ -755,7 +568,7 @@ function collectDanglingDependencyReferences(items, isTerminal = (status) => sta
755
568
  return;
756
569
  }
757
570
  const row = {
758
- holder_id: item.id,
571
+ holder_id: item.id.trim(),
759
572
  target_id: normalized,
760
573
  kind,
761
574
  source,
@@ -765,7 +578,7 @@ function collectDanglingDependencyReferences(items, isTerminal = (status) => sta
765
578
  };
766
579
  rows.set(`${row.holder_id}::${row.target_id}::${row.kind}::${row.source}`, row);
767
580
  };
768
- for (const item of items) {
581
+ for (const item of safeItems) {
769
582
  addReference(item, item.parent, "parent", "parent");
770
583
  addReference(item, item.blocked_by, "blocked_by", "blocked_by");
771
584
  for (const dependency of item.dependencies ?? []) {
@@ -796,211 +609,14 @@ function collectMissingDependencyTargetIds(dangling) {
796
609
  }
797
610
  return [...targets.values()].sort((left, right) => left.localeCompare(right));
798
611
  }
799
- function parseFormat(raw) {
800
- const candidate = raw?.trim().toLowerCase() ?? "tree";
801
- if (DEPS_FORMAT_VALUES.includes(candidate)) {
802
- return candidate;
803
- }
804
- throw new PmCliError(`Invalid --format value "${raw}". Use "tree", "graph", or "context".`, EXIT_CODE.USAGE);
805
- }
806
- function parsePositiveInteger(raw, flag) {
807
- if (raw === void 0)
808
- return void 0;
809
- const value = typeof raw === "number" ? raw : Number(raw.trim());
810
- if (!Number.isInteger(value) || value < 1)
811
- throw new PmCliError(`Invalid --${flag} value "${raw}". Use a positive integer.`, EXIT_CODE.USAGE);
812
- return value;
813
- }
814
- function parseMaxDepth(raw) {
815
- if (raw === void 0) {
816
- return void 0;
817
- }
818
- const normalized = typeof raw === "number" ? raw : Number(raw.trim());
819
- if (!Number.isInteger(normalized) || normalized < 0) {
820
- throw new PmCliError(`Invalid --max-depth value "${raw}". Use a non-negative integer.`, EXIT_CODE.USAGE);
821
- }
822
- return normalized;
823
- }
824
- function parseCollapse(raw) {
825
- const candidate = raw?.trim().toLowerCase() ?? "none";
826
- if (DEPS_COLLAPSE_VALUES.includes(candidate)) {
827
- return candidate;
828
- }
829
- throw new PmCliError(`Invalid --collapse value "${raw}". Use "none" or "repeated".`, EXIT_CODE.USAGE);
830
- }
831
- function normalizeDependencies(dependencies) {
832
- if (!dependencies || dependencies.length === 0) {
833
- return [];
834
- }
835
- const sorted = dependencies.map(({ id, kind }) => ({
836
- id: id.trim(),
837
- kind: kind.trim().toLowerCase()
838
- })).sort((left, right) => {
839
- const byKind = left.kind.localeCompare(right.kind);
840
- if (byKind !== 0)
841
- return byKind;
842
- return left.id.localeCompare(right.id);
843
- });
844
- const deduped = /* @__PURE__ */ new Map();
845
- for (const dependency of sorted) {
846
- const key = `${dependency.kind.toLowerCase()}::${dependency.id.toLowerCase()}`;
847
- if (!deduped.has(key)) {
848
- deduped.set(key, { id: dependency.id, kind: dependency.kind });
849
- }
850
- }
851
- return [...deduped.values()];
852
- }
853
- function toIndexedItem(item) {
854
- return {
855
- id: item.id,
856
- title: item.title,
857
- type: item.type,
858
- status: item.status,
859
- dependencies: normalizeDependencies(item.dependencies)
860
- };
861
- }
862
- function toTreeNode(id, index, lineage, maxDepth, collapse, expanded, depth = 0, via) {
863
- const lookupId = id.trim().toLowerCase();
864
- const item = index.get(lookupId);
865
- const baseNode = {
866
- id: item?.id ?? id,
867
- title: item?.title,
868
- type: item?.type,
869
- status: item?.status,
870
- via,
871
- missing: !item,
872
- cycle: lineage.has(lookupId),
873
- dependencies: []
874
- };
875
- if (!item || baseNode.cycle) {
876
- return baseNode;
877
- }
878
- if (maxDepth !== void 0 && depth >= maxDepth) {
879
- if (item.dependencies.length > 0) {
880
- baseNode.truncated = true;
881
- }
882
- return baseNode;
883
- }
884
- if (collapse === "repeated" && expanded.has(lookupId)) {
885
- baseNode.collapsed = true;
886
- return baseNode;
887
- }
888
- if (collapse === "repeated") {
889
- expanded.add(lookupId);
890
- }
891
- const nextLineage = new Set(lineage);
892
- nextLineage.add(lookupId);
893
- baseNode.dependencies = item.dependencies.map((dependency) => toTreeNode(dependency.id, index, nextLineage, maxDepth, collapse, expanded, depth + 1, dependency.kind));
894
- return baseNode;
895
- }
896
- function mergeGraphNode(existing, candidate) {
897
- if (!existing) {
898
- return candidate;
899
- }
900
- if (existing.missing && !candidate.missing)
901
- return candidate;
902
- return {
903
- ...existing,
904
- title: existing.title ?? candidate.title,
905
- type: existing.type ?? candidate.type,
906
- status: existing.status ?? candidate.status
907
- };
908
- }
909
- function toGraph(root) {
910
- const nodesById = /* @__PURE__ */ new Map();
911
- const edgesByKey = /* @__PURE__ */ new Map();
912
- const visit = (node) => {
913
- nodesById.set(node.id, mergeGraphNode(nodesById.get(node.id), {
914
- id: node.id,
915
- title: node.title,
916
- type: node.type,
917
- status: node.status,
918
- missing: node.missing
919
- }));
920
- for (const child of node.dependencies) {
921
- nodesById.set(child.id, mergeGraphNode(nodesById.get(child.id), {
922
- id: child.id,
923
- title: child.title,
924
- type: child.type,
925
- status: child.status,
926
- missing: child.missing
927
- }));
928
- const relationKind = child.via ?? "related";
929
- const edgeKey = `${node.id}::${child.id}::${relationKind}`;
930
- if (!edgesByKey.has(edgeKey)) {
931
- edgesByKey.set(edgeKey, {
932
- from: node.id,
933
- to: child.id,
934
- kind: relationKind
935
- });
936
- }
937
- if (!child.cycle) {
938
- visit(child);
939
- }
940
- }
941
- };
942
- visit(root);
943
- const nodes = [...nodesById.values()].sort((left, right) => left.id.localeCompare(right.id));
944
- const edges = [...edgesByKey.values()].sort((left, right) => {
945
- const byFrom = left.from.localeCompare(right.from);
946
- if (byFrom !== 0)
947
- return byFrom;
948
- const byTo = left.to.localeCompare(right.to);
949
- if (byTo !== 0)
950
- return byTo;
951
- return left.kind.localeCompare(right.kind);
952
- });
953
- const missingIds = nodes.filter((node) => node.missing).map((node) => node.id);
954
- return {
955
- root_id: root.id,
956
- nodes,
957
- edges,
958
- missing_ids: missingIds
959
- };
960
- }
961
- function countDependencyGraph(rootId, index, maxDepth) {
962
- const nodeIds = /* @__PURE__ */ new Set();
963
- const edgeKeys = /* @__PURE__ */ new Set();
964
- const missingIds = /* @__PURE__ */ new Set();
965
- const expanded = /* @__PURE__ */ new Set();
966
- const pending = [{ id: rootId, depth: 0 }];
967
- let pendingIndex = 0;
968
- while (pendingIndex < pending.length) {
969
- const current = pending[pendingIndex++];
970
- const lookupId = current.id.trim().toLowerCase();
971
- nodeIds.add(lookupId);
972
- const item = index.get(lookupId);
973
- if (!item) {
974
- missingIds.add(lookupId);
975
- continue;
976
- }
977
- if (maxDepth !== void 0 && current.depth >= maxDepth) {
978
- continue;
979
- }
980
- if (expanded.has(lookupId)) {
981
- continue;
982
- }
983
- expanded.add(lookupId);
984
- for (const dependency of item.dependencies) {
985
- edgeKeys.add(`${lookupId}::${dependency.id.trim().toLowerCase()}::${dependency.kind}`);
986
- pending.push({ id: dependency.id, depth: current.depth + 1 });
987
- }
988
- }
989
- return {
990
- node_count: nodeIds.size,
991
- edge_count: edgeKeys.size,
992
- missing_count: missingIds.size
993
- };
994
- }
995
- function buildDepsRelationshipContext(rootId, items, options) {
996
- const maxDepth = parseMaxDepth(options.maxDepth);
997
- const nodeLimit = parsePositiveInteger(options.nodeLimit, "node-limit");
998
- const edgeLimit = parsePositiveInteger(options.edgeLimit, "edge-limit");
999
- const tokenBudget = parsePositiveInteger(options.tokenBudget, "token-budget");
1000
- const canonicalIds = new Map(items.map((item) => [item.id.trim().toLowerCase(), item.id.trim()]));
1001
- const dangling = collectDanglingDependencyReferences(items);
612
+ function assembleWorkspaceRelationshipGraph(items, isTerminal, registry) {
613
+ const safeItems = items.filter((item) => typeof item?.id === "string" && item.id.trim().length > 0);
614
+ const canonicalIds = new Map(safeItems.map((item) => [item.id.trim().toLowerCase(), item.id.trim()]));
615
+ const dangling = collectDanglingDependencyReferences(safeItems, isTerminal);
1002
616
  const missingIds = collectMissingDependencyTargetIds(dangling);
1003
- const graphItems = items.map((item) => {
617
+ for (const id of missingIds)
618
+ canonicalIds.set(id.toLowerCase(), id);
619
+ const graphItems = safeItems.map((item) => {
1004
620
  const parent = normalizeDependencyGraphTarget(item.parent);
1005
621
  const blocker = normalizeDependencyGraphTarget(item.blocked_by);
1006
622
  const dependencies = (item.dependencies ?? []).flatMap((rawDependency) => {
@@ -1010,91 +626,36 @@ function buildDepsRelationshipContext(rootId, items, options) {
1010
626
  const target = normalizeDependencyGraphTarget(dependency.id);
1011
627
  if (!target)
1012
628
  return [];
1013
- return [{
1014
- id: canonicalIds.get(target.toLowerCase()) ?? target,
1015
- kind: typeof dependency.kind === "string" ? dependency.kind : "related"
1016
- }];
629
+ return [
630
+ {
631
+ id: canonicalIds.get(target.toLowerCase()),
632
+ kind: typeof dependency.kind === "string" ? dependency.kind : "related"
633
+ }
634
+ ];
1017
635
  });
1018
636
  return {
1019
- id: item.id,
1020
- ...parent ? { parent: canonicalIds.get(parent.toLowerCase()) ?? parent } : {},
1021
- ...blocker ? { blocked_by: canonicalIds.get(blocker.toLowerCase()) ?? blocker } : {},
637
+ id: item.id.trim(),
638
+ ...parent ? { parent: canonicalIds.get(parent.toLowerCase()) } : {},
639
+ ...blocker ? { blocked_by: canonicalIds.get(blocker.toLowerCase()) } : {},
1022
640
  dependencies
1023
641
  };
1024
642
  });
1025
- return buildRelationshipContext(RelationshipGraph.fromItems([...graphItems, ...missingIds.map((id) => ({ id }))]), rootId, [
1026
- ...items.map((item) => ({ id: item.id, title: item.title, status: item.status })),
1027
- ...missingIds.map((id) => ({ id, title: `[missing] ${id}`, status: "missing" }))
1028
- ], {
1029
- ...maxDepth === void 0 ? {} : { maxDepth },
1030
- ...nodeLimit === void 0 ? {} : { nodeLimit },
1031
- ...edgeLimit === void 0 ? {} : { edgeLimit },
1032
- ...tokenBudget === void 0 ? {} : { tokenBudget },
1033
- ...options.cursor?.trim() ? { cursor: options.cursor.trim() } : {}
1034
- });
1035
- }
1036
- async function runDeps(id, options, global2) {
1037
- const pmRoot = resolvePmRoot(process.cwd(), global2.path);
1038
- if (!await pathExists(getSettingsPath(pmRoot))) {
1039
- throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
1040
- }
1041
- const format = parseFormat(options.format);
1042
- const maxDepth = parseMaxDepth(options.maxDepth);
1043
- const collapse = parseCollapse(options.collapse);
1044
- const summaryOnly = options.summary === true;
1045
- const settings = await readSettings(pmRoot);
1046
- const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
1047
- const items = await listAllItemMetadataLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, void 0, settings.schema);
1048
- const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
1049
- const index = new Map(items.map((item) => [item.id.trim().toLowerCase(), toIndexedItem(item)]));
1050
- const dangling = collectDanglingDependencyReferences(items, (status) => isTerminalStatus(status, statusRegistry));
1051
- for (const reference of [...dangling.active, ...dangling.legacy_terminal]) {
1052
- const holder = index.get(reference.holder_id.trim().toLowerCase());
1053
- const referenceKind = reference.kind.trim().toLowerCase();
1054
- if (holder && !holder.dependencies.some((dependency) => dependency.id.trim().toLowerCase() === reference.target_id.trim().toLowerCase() && dependency.kind === referenceKind)) {
1055
- holder.dependencies.push({ id: reference.target_id, kind: referenceKind });
1056
- }
1057
- }
1058
- if (!index.has(id.trim().toLowerCase())) {
1059
- throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);
1060
- }
1061
- if (format === "context") {
1062
- const canonicalId = index.get(id.trim().toLowerCase()).id;
1063
- const context = buildDepsRelationshipContext(canonicalId, items, options);
1064
- return {
1065
- id: canonicalId,
1066
- format,
1067
- node_count: context.nodes.length + 1,
1068
- edge_count: context.edges.length,
1069
- missing_count: collectMissingDependencyTargetIds(dangling).length,
1070
- ...summaryOnly ? {} : { context }
1071
- };
1072
- }
1073
- if (summaryOnly) {
1074
- return {
1075
- id,
1076
- format,
1077
- ...countDependencyGraph(id, index, maxDepth)
1078
- };
1079
- }
1080
- const tree = toTreeNode(id, index, /* @__PURE__ */ new Set(), maxDepth, collapse, /* @__PURE__ */ new Set());
1081
- const graph = toGraph(tree);
1082
- const baseResult = {
1083
- id,
1084
- format,
1085
- node_count: graph.nodes.length,
1086
- edge_count: graph.edges.length,
1087
- missing_count: graph.missing_ids.length
1088
- };
1089
- if (format === "tree") {
1090
- return {
1091
- ...baseResult,
1092
- tree
1093
- };
1094
- }
1095
643
  return {
1096
- ...baseResult,
1097
- graph
644
+ graph: RelationshipGraph.fromItems([...graphItems, ...missingIds.map((id) => ({ id }))], registry),
645
+ details: [
646
+ ...safeItems.map((item) => ({
647
+ id: item.id.trim(),
648
+ title: item.title,
649
+ status: item.status
650
+ })),
651
+ ...missingIds.map((id) => ({
652
+ id,
653
+ title: `[missing] ${id}`,
654
+ status: "missing"
655
+ }))
656
+ ],
657
+ missingIdSet: new Set(missingIds.map((id) => id.toLowerCase())),
658
+ dangling
1098
659
  };
1099
660
  }
1100
661
 
@@ -1104,11 +665,8 @@ export {
1104
665
  isOrderingRelationshipKind,
1105
666
  RelationshipGraph,
1106
667
  dependencyToRelationship,
1107
- buildRelationshipContext,
1108
- DEPS_FORMAT_VALUES,
1109
- DEPS_COLLAPSE_VALUES,
1110
668
  collectDanglingDependencyReferences,
1111
- buildDepsRelationshipContext,
1112
- runDeps
669
+ collectMissingDependencyTargetIds,
670
+ assembleWorkspaceRelationshipGraph
1113
671
  };
1114
- //# sourceMappingURL=chunk-MSGETE6I.js.map
672
+ //# sourceMappingURL=chunk-3CUQZNQ6.js.map