@unbrained/pm-cli 2026.10.30 → 2026.11.1

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 (262) hide show
  1. package/.agents/skills/pm-user/references/ECOSYSTEM_PLANNING.md +1 -1
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/AGENTS.md +3 -3
  4. package/CHANGELOG.md +41 -0
  5. package/README.md +1 -1
  6. package/dist/cli/commander-usage.js +2 -2
  7. package/dist/cli/error-guidance.d.ts +45 -5
  8. package/dist/cli/error-guidance.js +5 -3
  9. package/dist/cli/extension-command-help.d.ts +1 -0
  10. package/dist/cli/extension-command-help.js +2 -2
  11. package/dist/cli/main.d.ts +1 -5
  12. package/dist/cli/main.js +5 -5
  13. package/dist/cli/migration-gates.d.ts +1 -1
  14. package/dist/cli/migration-gates.js +1 -1
  15. package/dist/cli/preflight-warnings.d.ts +11 -0
  16. package/dist/cli/preflight-warnings.js +4 -0
  17. package/dist/cli/register-mutation.js +2 -2
  18. package/dist/cli/register-operations.d.ts +3 -3
  19. package/dist/cli/register-operations.js +1 -1
  20. package/dist/cli-bundle/bundle-manifest.json +1 -1
  21. package/dist/cli-bundle/chunks/chunk-2GK2IVU5.js +8 -0
  22. package/dist/cli-bundle/chunks/chunk-5KW4WUAK.js +6 -0
  23. package/dist/cli-bundle/chunks/chunk-5WVE7XBS.js +114 -0
  24. package/dist/cli-bundle/chunks/chunk-6PKWKVS6.js +8 -0
  25. package/dist/cli-bundle/chunks/chunk-E74BORFX.js +128 -0
  26. package/dist/cli-bundle/chunks/chunk-F3ECOBKA.js +2 -0
  27. package/dist/cli-bundle/chunks/chunk-ICT6E4IW.js +2 -0
  28. package/dist/cli-bundle/chunks/chunk-MP2DQJH2.js +3 -0
  29. package/dist/cli-bundle/chunks/{chunk-LWW4F4G2.js → chunk-MRUA2Z43.js} +2 -2
  30. package/dist/cli-bundle/chunks/{chunk-UUQX3PFD.js → chunk-MTRIGD7M.js} +76 -76
  31. package/dist/cli-bundle/chunks/{chunk-S2U7ECUJ.js → chunk-N45IXPCA.js} +2 -2
  32. package/dist/cli-bundle/chunks/{chunk-MVL27TAH.js → chunk-NILQ2ZMV.js} +2 -2
  33. package/dist/cli-bundle/chunks/{chunk-GRABKNFL.js → chunk-O56O7NIE.js} +2 -2
  34. package/dist/cli-bundle/chunks/chunk-O6TFUV6M.js +31 -0
  35. package/dist/cli-bundle/chunks/{chunk-TH5KPAN4.js → chunk-SBVX5CMV.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-Y6NC3X3E.js → chunk-TMPO4CTZ.js} +3 -3
  37. package/dist/cli-bundle/chunks/chunk-TYERATXH.js +2 -0
  38. package/dist/cli-bundle/chunks/{chunk-EHBGHX55.js → chunk-UEEG47TU.js} +2 -2
  39. package/dist/cli-bundle/chunks/chunk-UUN3WNMQ.js +20 -0
  40. package/dist/cli-bundle/chunks/chunk-WFBYKDB2.js +2 -0
  41. package/dist/cli-bundle/chunks/{chunk-RZQNFHXO.js → chunk-WX25MU4N.js} +3 -3
  42. package/dist/cli-bundle/chunks/{chunk-4BQD5SW2.js → chunk-Y7CKVU56.js} +30 -30
  43. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-LHLE7PSG.js → indexed-receipt-blobs-KGMJVFH2.js} +2 -2
  44. package/dist/cli-bundle/chunks/item-transaction-Q5S5YLEJ.js +2 -0
  45. package/dist/cli-bundle/chunks/{mutation-admission-TRGAVS7N.js → mutation-admission-BOOCJPCU.js} +2 -2
  46. package/dist/cli-bundle/chunks/{register-list-query-BH4F6M7Z.js → register-list-query-23OX36Q3.js} +3 -3
  47. package/dist/cli-bundle/chunks/register-mutation-JPJ5YNDX.js +20 -0
  48. package/dist/cli-bundle/chunks/register-operations-IGR7ERY5.js +2 -0
  49. package/dist/cli-bundle/chunks/{register-setup-QPWSVHFZ.js → register-setup-BMIFKZZP.js} +2 -2
  50. package/dist/cli-bundle/chunks/{settlement-hook-MN3Y7LVX.js → settlement-hook-YWSWFOZY.js} +2 -2
  51. package/dist/cli-bundle/chunks/{stage-RTB6RAAO.js → stage-ON7CYYPM.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-POJPJX64.js → chunk-2Y77HWIX.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-SAT7IAEB.js → chunk-3NYWMUX3.js} +3 -3
  54. package/dist/cli-bundle/focused-chunks/chunk-3Z53POXU.js +2 -0
  55. package/dist/cli-bundle/focused-chunks/chunk-5TWS5KOM.js +26 -0
  56. package/dist/cli-bundle/focused-chunks/chunk-5WCQFH6D.js +12 -0
  57. package/dist/cli-bundle/focused-chunks/{chunk-S23ZUASN.js → chunk-6GMYW42K.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-YQUZL2CK.js → chunk-6OKPYCLU.js} +5 -5
  59. package/dist/cli-bundle/focused-chunks/chunk-7WJDRZOR.js +22 -0
  60. package/dist/cli-bundle/focused-chunks/{chunk-3SRX77ES.js → chunk-AL7SOFUL.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/chunk-CIQ6YWCW.js +26 -0
  62. package/dist/cli-bundle/focused-chunks/{chunk-RKPUQDWF.js → chunk-DFUTCKUF.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{chunk-RYEZSZJ7.js → chunk-GE755ODZ.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/chunk-JCR32IAO.js +91 -0
  65. package/dist/cli-bundle/focused-chunks/{chunk-BPE6JTKL.js → chunk-JLXGRDTG.js} +3 -3
  66. package/dist/cli-bundle/focused-chunks/chunk-LVA76N27.js +6 -0
  67. package/dist/cli-bundle/focused-chunks/{chunk-YU7QOYYV.js → chunk-M22TI7LP.js} +3 -3
  68. package/dist/cli-bundle/focused-chunks/chunk-PAT6QF63.js +2 -0
  69. package/dist/cli-bundle/focused-chunks/{chunk-VFWCSQAG.js → chunk-RPUDOJVB.js} +2 -2
  70. package/dist/cli-bundle/focused-chunks/chunk-SXZM4PSS.js +44 -0
  71. package/dist/cli-bundle/focused-chunks/chunk-UQIBGLDR.js +2 -0
  72. package/dist/cli-bundle/focused-chunks/{chunk-RGQEJFXO.js → chunk-VFQAZLKO.js} +2 -2
  73. package/dist/cli-bundle/focused-chunks/{chunk-BCIUAEWX.js → chunk-VS2ZFPXD.js} +2 -2
  74. package/dist/cli-bundle/focused-chunks/{chunk-FRFNGMAK.js → chunk-WX2RVS2Y.js} +2 -2
  75. package/dist/cli-bundle/focused-chunks/chunk-Z7GIVH6B.js +3 -0
  76. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-VK2363JB.js → indexed-receipt-blobs-KHWT44EK.js} +2 -2
  77. package/dist/cli-bundle/focused-chunks/item-transaction-7VLPA2SU.js +2 -0
  78. package/dist/cli-bundle/focused-chunks/{mutation-admission-7VUODEPJ.js → mutation-admission-2DH27R5Y.js} +2 -2
  79. package/dist/cli-bundle/focused-chunks/{settlement-hook-OK6A7PG2.js → settlement-hook-SJV52ZTV.js} +2 -2
  80. package/dist/cli-bundle/focused-chunks/{stage-S5RP5SZH.js → stage-FYOBWQA7.js} +2 -2
  81. package/dist/cli-bundle/main.js +26 -22
  82. package/dist/cli-bundle/sdk-authoring.js +1 -1
  83. package/dist/cli-bundle/sdk-contracts.js +4 -4
  84. package/dist/cli-bundle/sdk-core.js +1 -1
  85. package/dist/cli-bundle/sdk-governance.js +1 -1
  86. package/dist/cli-bundle/sdk-graph.js +1 -1
  87. package/dist/cli-bundle/sdk-merge.js +57 -57
  88. package/dist/cli-bundle/sdk-query.js +1 -1
  89. package/dist/cli-bundle/sdk-runtime.js +1 -1
  90. package/dist/cli-bundle/sdk-testing.js +1 -1
  91. package/dist/cli-bundle/sdk.js +11 -11
  92. package/dist/core/config/nested-settings.js +1 -1
  93. package/dist/core/extensions/extension-hook-runtime.js +1 -1
  94. package/dist/core/extensions/extension-types.d.ts +4 -0
  95. package/dist/core/extensions/extension-types.js +1 -1
  96. package/dist/core/extensions/loader.js +1 -1
  97. package/dist/core/lock/lock.js +4 -4
  98. package/dist/core/output/mutation-projection.js +1 -1
  99. package/dist/core/output/output.js +3 -3
  100. package/dist/core/schema/fields-file.js +1 -1
  101. package/dist/core/sentry/helpers.d.ts +6 -0
  102. package/dist/core/sentry/helpers.js +1 -1
  103. package/dist/core/sentry/instrument.d.ts +1 -1
  104. package/dist/core/sentry/instrument.js +1 -1
  105. package/dist/core/shared/constants.js +1 -1
  106. package/dist/core/shared/errors.d.ts +6 -0
  107. package/dist/core/shared/errors.js +1 -1
  108. package/dist/core/shared/output-unicode.d.ts +10 -0
  109. package/dist/core/shared/output-unicode.js +2 -0
  110. package/dist/core/store/settings-validator.d.ts +1 -0
  111. package/dist/core/store/settings-validator.js +1 -1
  112. package/dist/core/store/settings.js +1 -1
  113. package/dist/core/telemetry/policy.d.ts +8 -0
  114. package/dist/core/telemetry/policy.js +1 -1
  115. package/dist/core/telemetry/runtime.js +3 -3
  116. package/dist/sdk/agent/command-recovery.d.ts +15 -0
  117. package/dist/sdk/agent/command-recovery.js +1 -1
  118. package/dist/sdk/cli-bootstrap.js +1 -1
  119. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +28 -0
  120. package/dist/sdk/cli-contracts/agent-output-contracts.js +2 -2
  121. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
  122. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  123. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  124. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  125. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  126. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  127. package/dist/sdk/cli-contracts.d.ts +1 -1
  128. package/dist/sdk/cli-contracts.js +1 -1
  129. package/dist/sdk/completion/fish.js +4 -4
  130. package/dist/sdk/completion/zsh.js +3 -3
  131. package/dist/sdk/config.d.ts +1 -0
  132. package/dist/sdk/config.js +1 -1
  133. package/dist/sdk/context-intent-contracts.d.ts +17 -0
  134. package/dist/sdk/context-intent-contracts.js +1 -1
  135. package/dist/sdk/core.d.ts +2 -1
  136. package/dist/sdk/core.js +1 -1
  137. package/dist/sdk/error-runtime.d.ts +9 -0
  138. package/dist/sdk/error-runtime.js +1 -1
  139. package/dist/sdk/errors.js +1 -1
  140. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  141. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  142. package/dist/sdk/index.d.ts +3 -3
  143. package/dist/sdk/index.js +1 -1
  144. package/dist/sdk/init-agent-guidance.js +2 -2
  145. package/dist/sdk/lifecycle/claim.d.ts +27 -0
  146. package/dist/sdk/lifecycle/claim.js +1 -1
  147. package/dist/sdk/lifecycle/close.js +1 -1
  148. package/dist/sdk/lifecycle/create.js +1 -1
  149. package/dist/sdk/lifecycle/mcp-actions.d.ts +1 -1
  150. package/dist/sdk/lifecycle/mcp-actions.js +1 -1
  151. package/dist/sdk/lifecycle/plan.d.ts +2 -3
  152. package/dist/sdk/lifecycle/plan.js +1 -1
  153. package/dist/sdk/lifecycle/repeated-terminal-state.d.ts +45 -0
  154. package/dist/sdk/lifecycle/repeated-terminal-state.js +2 -0
  155. package/dist/sdk/lifecycle/shared-unset-fields.d.ts +9 -0
  156. package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
  157. package/dist/sdk/lifecycle/task-composition.js +1 -1
  158. package/dist/sdk/lifecycle/update-many.d.ts +0 -1
  159. package/dist/sdk/lifecycle/update-many.js +1 -1
  160. package/dist/sdk/lifecycle/update.d.ts +29 -1
  161. package/dist/sdk/lifecycle/update.js +2 -2
  162. package/dist/sdk/output/list-envelope.d.ts +8 -0
  163. package/dist/sdk/output/list-envelope.js +1 -1
  164. package/dist/sdk/output/table-rows.d.ts +7 -1
  165. package/dist/sdk/output/table-rows.js +1 -1
  166. package/dist/sdk/output.d.ts +2 -1
  167. package/dist/sdk/output.js +2 -2
  168. package/dist/sdk/ownership-source.d.ts +18 -0
  169. package/dist/sdk/ownership-source.js +1 -1
  170. package/dist/sdk/public-surface.json +1 -1
  171. package/dist/sdk/query/context.js +2 -2
  172. package/dist/sdk/query/get.d.ts +1 -1
  173. package/dist/sdk/query/get.js +1 -1
  174. package/dist/sdk/query/next-ranking-policy.d.ts +35 -0
  175. package/dist/sdk/query/next-ranking-policy.js +2 -0
  176. package/dist/sdk/query/next.d.ts +12 -2
  177. package/dist/sdk/query/next.js +2 -2
  178. package/dist/sdk/query/projection-contracts.d.ts +4 -0
  179. package/dist/sdk/query/projection-contracts.js +1 -1
  180. package/dist/sdk/read-output/surfaces.d.ts +27 -0
  181. package/dist/sdk/read-output/surfaces.js +2 -0
  182. package/dist/sdk/read-output-contracts.js +1 -1
  183. package/dist/sdk/runtime/actions.js +1 -1
  184. package/dist/sdk/runtime-input.js +1 -1
  185. package/dist/sdk/runtime-primitives.d.ts +1 -0
  186. package/dist/sdk/runtime-primitives.js +1 -1
  187. package/dist/sdk/runtime-public-contracts.d.ts +2 -0
  188. package/dist/sdk/runtime.d.ts +2 -2
  189. package/dist/sdk/runtime.js +1 -1
  190. package/dist/sdk/start-task-status.d.ts +1 -1
  191. package/dist/sdk/start-task-status.js +1 -1
  192. package/dist/sdk/test/execution-receipts.d.ts +25 -0
  193. package/dist/sdk/test/execution-receipts.js +2 -2
  194. package/dist/sdk/test/execution.d.ts +5 -0
  195. package/dist/sdk/test/execution.js +2 -2
  196. package/dist/types.d.ts +2 -0
  197. package/dist/types.js +1 -1
  198. package/docs/AGENT_GUIDE.md +4 -4
  199. package/docs/AGENT_OUTPUT_ENCODINGS.md +12 -0
  200. package/docs/AGENT_UX_CONTRACTS.md +2 -1
  201. package/docs/COMMANDS.md +59 -5
  202. package/docs/COMMAND_NAMESPACES.md +1 -1
  203. package/docs/CONFIGURATION.md +48 -1
  204. package/docs/DEVELOPMENT_DEPENDENCY_SECURITY.md +26 -0
  205. package/docs/LIFECYCLE_COMMANDS.md +19 -4
  206. package/docs/PACKED_FIRST_RUN.md +2 -1
  207. package/docs/READ_OUTPUT_CONTRACTS.md +24 -6
  208. package/docs/SDK.md +82 -3
  209. package/docs/SDK_ACTION_CONFORMANCE.md +21 -0
  210. package/docs/TESTING.md +38 -2
  211. package/docs/agent-task-token-baseline.json +1 -1
  212. package/docs/agent-task-transcripts.json +1 -1
  213. package/marketplace.json +1 -1
  214. package/package.json +1 -1
  215. package/packages/pm-beads/package.json +1 -1
  216. package/packages/pm-calendar/extensions/calendar/index.ts +1 -0
  217. package/packages/pm-calendar/package.json +1 -1
  218. package/packages/pm-command-kit/package.json +1 -1
  219. package/packages/pm-digital-twin/package.json +1 -1
  220. package/packages/pm-governance-audit/package.json +1 -1
  221. package/packages/pm-guide-shell/package.json +1 -1
  222. package/packages/pm-kanban/package.json +1 -1
  223. package/packages/pm-lifecycle-hooks/package.json +1 -1
  224. package/packages/pm-linked-test-adapters/package.json +1 -1
  225. package/packages/pm-search-advanced/package.json +1 -1
  226. package/packages/pm-templates/package.json +1 -1
  227. package/packages/pm-todos/package.json +1 -1
  228. package/packages/pm-vcs/package.json +1 -1
  229. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  230. package/plugins/pm-claude/package.json +1 -1
  231. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  232. package/plugins/pm-codex/package.json +1 -1
  233. package/plugins/pm-codex/plugin.json +1 -1
  234. package/runtime-dependencies.json +1 -1
  235. package/dist/cli-bundle/chunks/chunk-34MP7WKK.js +0 -6
  236. package/dist/cli-bundle/chunks/chunk-3KMYHYJV.js +0 -2
  237. package/dist/cli-bundle/chunks/chunk-42BHHNTL.js +0 -128
  238. package/dist/cli-bundle/chunks/chunk-I5O3XZOA.js +0 -2
  239. package/dist/cli-bundle/chunks/chunk-LEIVUGDH.js +0 -8
  240. package/dist/cli-bundle/chunks/chunk-OH7WPD42.js +0 -114
  241. package/dist/cli-bundle/chunks/chunk-OOD2A7AF.js +0 -20
  242. package/dist/cli-bundle/chunks/chunk-Q5V7P6NM.js +0 -2
  243. package/dist/cli-bundle/chunks/chunk-QLPFYBXN.js +0 -2
  244. package/dist/cli-bundle/chunks/chunk-SA5NYLPE.js +0 -8
  245. package/dist/cli-bundle/chunks/chunk-VHLAVTJN.js +0 -31
  246. package/dist/cli-bundle/chunks/chunk-XAOVJG52.js +0 -3
  247. package/dist/cli-bundle/chunks/chunk-XPQ4RTSF.js +0 -2
  248. package/dist/cli-bundle/chunks/item-transaction-WIOBZW4E.js +0 -2
  249. package/dist/cli-bundle/chunks/register-mutation-5V2NANIS.js +0 -20
  250. package/dist/cli-bundle/chunks/register-operations-XSFRMUFX.js +0 -2
  251. package/dist/cli-bundle/focused-chunks/chunk-2V6NMNYN.js +0 -26
  252. package/dist/cli-bundle/focused-chunks/chunk-ASHGXMX4.js +0 -3
  253. package/dist/cli-bundle/focused-chunks/chunk-CKBN2D42.js +0 -12
  254. package/dist/cli-bundle/focused-chunks/chunk-I642DXOT.js +0 -22
  255. package/dist/cli-bundle/focused-chunks/chunk-K7DKG5HM.js +0 -91
  256. package/dist/cli-bundle/focused-chunks/chunk-NMQBXU7N.js +0 -44
  257. package/dist/cli-bundle/focused-chunks/chunk-PGM3ENGZ.js +0 -2
  258. package/dist/cli-bundle/focused-chunks/chunk-QFNV4JTA.js +0 -6
  259. package/dist/cli-bundle/focused-chunks/chunk-QVJCQMZY.js +0 -26
  260. package/dist/cli-bundle/focused-chunks/chunk-R2TPPPVU.js +0 -2
  261. package/dist/cli-bundle/focused-chunks/chunk-VJVJ2ZX2.js +0 -2
  262. package/dist/cli-bundle/focused-chunks/item-transaction-ZFDKJIP7.js +0 -2
@@ -1,2 +0,0 @@
1
- import{J as O,a as R,c as C,e as P,f as k,h as _,i as N}from"./chunk-42BHHNTL.js";import{Bi as g,Da as y,Dh as D,Oc as p,Tf as u,ci as T,dg as b,ei as H,fi as M,pa as c,sh as E,xa as h,zh as x}from"./chunk-OH7WPD42.js";import{A as m,C as f,E as w}from"./chunk-RZQNFHXO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="59842825-3a81-53f4-845d-db2257ec6286")}catch{}})();async function B(e){let t=h(process.cwd(),e);await u(t);let r=await g(t),s=c(r,p());return{pmRoot:t,settings:r,typeRegistry:s}}async function z(e,t,r,s){y(e,_(t));let o=await O(e,t,r.id_prefix,r.item_format,s);if(o)return{id:o.id,historyPath:y(e,o.id),located:o};let n=N(t,r.id_prefix),a=_(t),i=n===a?[n]:[n,a];for(let d of i){let l=y(e,d);if(await w(l))return{id:d,historyPath:l,located:null}}throw new f(`Item ${t} not found`,m.NOT_FOUND)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eb2e6046-156c-56ee-a03a-ecaa1cccfb45")}catch{}})();function ye(e,t){let r=D(e),s=e.length>0?e[e.length-1].after_hash:M(),o=t===void 0||r.item_hash_version===void 0?void 0:H(t,r.item_hash_version,b(e.at(-1)?.hash_algorithm)),n=t===void 0?void 0:o===void 0?T(t):o[Math.max(0,o.indexOf(s))],a=n===void 0?void 0:n===s,i=[...r.errors];return a===!1&&i.push("verify_failed:current_item_hash_mismatch"),{ok:i.length===0,entries:e.length,errors:i,latest_after_hash:e.length>0?e[e.length-1].after_hash:void 0,current_item_hash:n,current_matches_latest:a}}async function pe(e,t,r={}){let s=h(r.cwd??process.cwd(),r.pmRoot);await u(s);let o=await g(s),n=c(o,p()),a=await z(s,e,o,n.type_to_folder),i=await E(a.historyPath,a.id);if(i.length===0)throw new f(`No history exists for ${a.id}; point-in-time reads are unavailable.`,m.NOT_FOUND);let d=C(t,i),l=k(P(i,d.historyIndex),d),I=x(l,{schema:o.schema});if(I.metadata.id!==a.id)throw new f(`History target resolved to item ${I.metadata.id}, expected ${a.id}.`,m.GENERIC_FAILURE);let A=i[d.historyIndex],v=R(i,!0);return{document:I,reconstructed:!0,as_of_version:v===null?null:v+d.historyIndex+1,as_of_timestamp:A.ts,target:d,history_length:i.length}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e524f0ad-faad-5d89-b8f5-1283979919ad")}catch{}})();export{B as a,z as b,ye as c,pe as d};
2
- //# sourceMappingURL=chunk-I5O3XZOA.js.map
@@ -1,8 +0,0 @@
1
- import{Bi as P,Gi as V,Tf as W,Ue as U,df as $,pa as B,qh as H,wi as L,xa as E,z as G}from"./chunk-OH7WPD42.js";import{d as K}from"./chunk-TH5KPAN4.js";import{a as X,b as v,c as q}from"./chunk-VS565KBX.js";import{A as b,C as k,E as S,G as j,H as N,K as F}from"./chunk-RZQNFHXO.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="6d1f8e03-97b4-5d83-b85c-e47f39c07d48")}catch{}})();var se="PM_SOURCE_CONTEXT_ACCESS",ce="PM_ALLOW_SOURCE_CONTEXT_WRITES";function J(e){let r=e[se],i=r===void 0||r.trim().toLowerCase()==="write"?"write":"read_only",t=i==="read_only"&&e[ce]?.trim()==="1";return{access:i,write_override_applied:t,source_writes_allowed:i==="write"||t}}import{access as le,readFile as A,realpath as w}from"node:fs/promises";import{constants as me}from"node:fs";import{execFile as ue}from"node:child_process";import c from"node:path";import{promisify as de}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="b1828465-0619-514c-8956-2a81dea9efbc")}catch{}})();var _=de(ue),T="# pm-cli:merge-drivers:start",pe="# pm-cli:merge-drivers:end",x="# pm-cli:merge-drivers:v2:start",Q="# pm-cli:merge-drivers:v2:end",fe="merge-fence",ge="merge-attributes";function R(e){return`'${e.replaceAll("'",`'"'"'`)}'`}async function he(e,r){let i=await w(e);if(/(?:^|[\\/])bun-node-[^\\/]+[\\/]bun(?:\.exe)?$/iu.test(i))return;let{stdout:t}=await _(e,["--version"],{encoding:"utf8",windowsHide:!0,timeout:1e4});return t.trim()===r?i:void 0}async function we(){let e=G(import.meta.url,["../../.."]),r=process.execPath,i=!1,t=await w(process.execPath),o=process.versions.bun,a=(process.env.PATH??"").split(c.delimiter).filter(n=>c.isAbsolute(n)).map(n=>c.join(n,o===void 0?c.basename(process.execPath):process.platform==="win32"?"bun.exe":"bun")),s=o===void 0?a:[process.env.npm_execpath??"",...a,t].filter(n=>c.isAbsolute(n)&&/^(?:bun|bun\.exe)$/iu.test(c.basename(n)));for(let n of s)try{if(await le(n,me.X_OK),o!==void 0){let p=await he(n,o);if(p!==void 0){r=p,i=!0;break}continue}if(n!==t&&await w(n)===t){r=n;break}}catch{}if(o!==void 0&&!i)throw new k("Cannot install Bun merge drivers without a durable executable matching the current Bun version.",b.DEPENDENCY_FAILED,{code:"merge_bun_launcher_unavailable",why:"The current Bun process may be a temporary bunx launcher that Git cannot reuse after this command exits.",nextSteps:["Run with a durable version-matched Bun executable, expose one on an absolute PATH entry, or invoke pm through a Bun runner that publishes an absolute npm_execpath.","Retry pm merge install, then check pm health --strict-exit before merging branches."]});return`${R(r)} ${R(c.join(e,"dist","cli.js"))}`}var Z=[{key:"pm-item-toon",name:"pm field-aware TOON item document merge",artifact:"item",itemPath:"%P"},{key:"pm-item-markdown",name:"pm field-aware JSON-markdown item document merge",artifact:"item",itemPath:"%P"},{key:"pm-history",name:"pm append-only history stream merge",artifact:"history",itemPath:void 0},{key:"pm-relationship",name:"pm append-only relationship event store merge",artifact:"relationship",itemPath:void 0},{key:"pm-json",name:"pm key-level JSON config merge",artifact:"json",itemPath:void 0}];function ye(e){let r=e.explicitPath?.trim(),i=e.environment.PM_SOURCE_WORKSPACE_ROOT?.trim(),t=e.environment.PM_SOURCE_PM_PATH?.trim(),o=J(e.environment),a=!!(i&&t),s=r===void 0&&a&&(e.dryRun||o.source_writes_allowed);if(r!==void 0){let n=E(e.cwd,r);return{pm_root:n,workspace_start:n,source_coordinates_available:a,source_context_selected:!1,source_policy:o}}return s?{pm_root:c.resolve(t),workspace_start:c.resolve(i),source_coordinates_available:!0,source_context_selected:!0,source_policy:o}:{pm_root:a?E(e.cwd,".agents/pm"):E(e.cwd),workspace_start:e.cwd,source_coordinates_available:a,source_context_selected:!1,source_policy:o}}async function ee(e){try{let{stdout:r}=await _("git",["rev-parse","--show-toplevel"],{cwd:e,env:v(),encoding:"utf8",windowsHide:!0,timeout:1e4});return await w(r.trim())}catch{return null}}async function te(e){let r=await ee(e);if(r===null)throw new k("pm merge install requires a git repository (merge drivers are git configuration).",b.USAGE);return r}function O(e,r){return c.relative(e,r).split(c.sep).join("/")}function z(e){return e.replace(/[\\*?[\]!]/gu,"\\$&")}function h(e){return`"${e.replaceAll("\\","\\\\").replaceAll('"','\\"')}"`}function Y(e,r){if(e[r]!=="'")return null;let i="";for(let t=r+1;t<e.length;t+=1){if(e.startsWith(`'"'"'`,t)){i+="'",t+=4;continue}if(e[t]==="'")return{value:i,nextOffset:t+1};i+=e[t]}return null}async function ve(e,r,i){if(V(r).filter(o=>o.constraint==="exact").some(o=>o.version!==i))return!1;let t=await ee(e);if(t!==null&&t!==await w(r)){let o=await Promise.all([t,r].map(async a=>{let s=await _("git",["rev-parse","--path-format=absolute","--git-common-dir"],{cwd:a,env:v(),timeout:1e4});return w(s.stdout.trim())}));if(o[0]===o[1])return!1}return!0}async function _e(e,r,i){let t=Y(e,0);if(t===null||e[t.nextOffset]!==" ")return!1;let o=Y(e,t.nextOffset+1);if(o===null||e.slice(o.nextOffset)!==r||!/^(?:node|bun)(?:\.exe)?$/iu.test(c.basename(t.value))||c.basename(o.value)!=="cli.js"||c.basename(c.dirname(o.value))!=="dist"||!await S(t.value)||!await S(o.value))return!1;try{let a=c.dirname(c.dirname(o.value)),s=JSON.parse(await A(c.join(a,"package.json"),"utf8")),n=typeof s.bin=="string"?s.bin:s.bin?.pm;return await ve(a,i,s.version)?s.name==="@unbrained/pm-cli"&&n==="dist/cli.js":!1}catch{return!1}}function M(e,r){let i=e.length>0?`${z(e)}/`:"",t=[`${h(`${i}**/*.toon`)} merge=pm-item-toon`,`${h(`${i}**/*.md`)} merge=pm-item-markdown`];for(let o of r){let a=z(o);t.push(`${h(`${i}${a}/*.toon`)} merge=pm-item-toon`),t.push(`${h(`${i}${a}/*.md`)} merge=pm-item-markdown`)}return t.push(`${h(`${i}**/*.jsonl`)} merge=pm-relationship`),t.push(`${h(`${i}history/*.jsonl`)} merge=pm-history`),t.push(`${h(`${i}settings.json`)} merge=pm-json`),t.push(`${h(`${i}**/*.json`)} merge=pm-json`),t.push(`${h(`${i}extensions/**`)} merge=text`),t.push(`${h(`${i}extensions/.managed-extensions.json`)} merge=pm-json`),t}function re(e){let r=[],i=0;for(;i<e.length;){let t=e.indexOf(T,i),o=e.indexOf(x,i),a=t===-1?o:o===-1?t:Math.min(t,o);if(a===-1)break;let s=a===o,n=s?x:T,p=s?Q:pe,u=e.indexOf(p,a+n.length),m=u===-1?e.length:u+p.length;r.push({start:a,end:m,closed:u!==-1,lines:e.slice(a+n.length,u===-1?m:u).split(`
2
- `).map(l=>l.trim()).filter(Boolean)}),i=m}return r}function ie(e,r,i){let t=new Set(r),o=h(i.length>0?`${i}/`:"").slice(0,-1);return e.some(a=>t.has(a)||a.startsWith(o)&&/^[^/]+\/\*\.(?:toon|md)" merge=pm-item-(?:toon|markdown)$/u.test(a.slice(o.length)))}async function oe(e,r,i,t){let o=c.join(e,".gitattributes"),a=t?null:(await _("git",["rev-parse","--absolute-git-dir"],{cwd:e,env:v(),encoding:"utf8",windowsHide:!0,timeout:1e4})).stdout.trim(),s=a===null?null:await $(a,ge,120,"merge-fence",!1,!0,5e3);try{let n=await N(o)??"",p=[x,...i,Q].join(`
3
- `),u=re(n),m=u.filter(d=>ie(d.lines,i,r));m.length===0&&r===".agents/pm"&&u.length===1&&u[0].lines.every(d=>!d.includes("/"))&&m.push(u[0]);let l;if(m.length>0){let d=m[0];l=n;for(let y of m.slice(1).reverse())l=`${l.slice(0,y.start)}${l.slice(y.end)}`;l=`${l.slice(0,d.start)}${p}${l.slice(d.end)}`}else{let d=n.trimEnd();l=`${d.length>0?`${d}
4
-
5
- `:""}${p}
6
- `}return l===n?{path:o,changed:!1}:(t||await F(o,l),{path:o,changed:!0})}finally{await s?.()}}function ne(e){let r=B(e,null);return[...new Set(Object.values(r.type_to_folder))].sort((i,t)=>i.localeCompare(t))}async function Ve(e,r){let i=c.resolve(e),t=null,o="",a=i;for(let g=0;g<8;g+=1){let ae=c.join(a,".gitattributes");try{let C=await A(ae,"utf8");if(C.includes(x)||C.includes(T)){t=a,o=C;break}}catch{}let D=c.dirname(a);if(D===a)break;a=D}if(t===null)return{status:"not_installed",missing_patterns:[],stale_patterns:[],schema_scope:"project"};let s=c.join(t,".gitattributes"),n=O(t,i),p=re(o),u=M(n,r),m=p.filter(g=>ie(g.lines,u,n)),l=m.flatMap(g=>g.closed?g.lines:[]),d=new Set(l),y=new Set(u),f=u.filter(g=>!d.has(g)),I=l.filter(g=>!y.has(g));return{status:m.length!==1||!m[0].closed||f.length>0||I.length>0?"drift":"ok",path:s,missing_patterns:f,stale_patterns:I,schema_scope:"project"}}async function Ke(e){let r=[],i=[];for(let t of Z){let o=`merge.${t.key}.driver`,a=` merge driver ${t.artifact} "%O" "%A" "%B"${t.itemPath===void 0?"":` --item-path ${t.itemPath}`}`;try{let{stdout:s}=await _("git",["config","--get",o],{cwd:e,env:v(),encoding:"utf8",windowsHide:!0,timeout:1e4}),n=s.trim();await _e(n,a,e)||i.push(o)}catch{r.push(o)}}return{status:r.length>0?"missing":i.length>0?"drift":"ok",missing_keys:r,drifted_keys:i}}async function Xe(e){let r;try{r=await te(c.resolve(e))}catch{return{status:"no_git"}}let i=O(r,c.resolve(e)),t=await P(e),o=H(void 0,t.author_default),a=await $(e,fe,t.locks.ttl_seconds,o,!1,L(t).force_required_for_stale_lock,t.locks.wait_ms);try{let s=c.join(r,".gitattributes"),n;try{n=await A(s,"utf8")}catch(l){if(l instanceof Error&&"code"in l&&j(l))return{status:"not_installed",path:s};throw l}if(!n.includes(x)&&!n.includes(T))return{status:"not_installed",path:s};let p=await P(e),u=ne(p),m=await oe(r,i,M(i,u),!1);return{status:m.changed?"refreshed":"unchanged",path:m.path}}finally{await a()}}async function qe(e,r){let i=ye({cwd:process.cwd(),explicitPath:r.path,dryRun:e.dryRun===!0,environment:process.env}),t=i.pm_root;await W(t);let o=await te(i.workspace_start);return ke({pmRoot:t,workspaceRoot:o,dryRun:e.dryRun===!0,preCommitHook:e.preCommitHook===!0})}async function be(e,r){let i=(await _("git",["rev-parse","--path-format=absolute","--git-common-dir"],{cwd:e,env:v(),timeout:1e4})).stdout.trim(),t=await $(i,"merge-driver-config",120,"merge-install",!1,!0,5e3);try{let o=await q(e),a;try{a=(await _("git",["config",o,"--null","--get-regexp","."],{cwd:e,env:v(),timeout:1e4})).stdout}catch(n){if(typeof n!="object"||n===null||!("code"in n)||n.code!==1)throw n;a=""}let s=new Map(a.split("\0").filter(Boolean).map(n=>{let p=n.indexOf(`
7
- `);return[n.slice(0,p),n.slice(p+1)]}));for(let n of r)s.get(n.key)!==n.value&&await X(e,[o,n.key,n.value])}finally{await t()}}async function ke(e){let r=c.resolve(e.pmRoot),i=c.resolve(e.workspaceRoot),t=e.dryRun===!0,o,a;try{[o,a]=await Promise.all([w(r),w(i)])}catch(f){throw new k(`Cannot resolve tracker root ${r} or workspace root ${i}: ${String(f)}`,b.NOT_FOUND,{code:"merge_root_not_found",nextSteps:["Initialize the tracker and ensure both paths are accessible.",'Retry "pm merge install" from the repository workspace.']})}let s=O(a,o);if(K(s))throw new k(`Tracker root ${r} is outside the git repository ${i}; there is nothing to configure for this repository.`,b.USAGE);let n=await P(o),p=ne(n),u=M(s,p),m=[],l=await we(),d=e.preCommitHook===!0?await import("./settlement-hook-MN3Y7LVX.js").then(async f=>({plan:await f.prepareMergeSettlementHook(a,`${l} --pm-path ${R(s||".")}`),write:f.writeMergeSettlementHook})):void 0;for(let f of Z)m.push({key:`merge.${f.key}.name`,value:f.name}),m.push({key:`merge.${f.key}.driver`,value:`${l} merge driver ${f.artifact} "%O" "%A" "%B"${f.itemPath===void 0?"":` --item-path ${f.itemPath}`}`});if(!t)try{await be(a,m)}catch{throw new k(`Cannot install repository-local merge drivers in ${a}. Ensure the repository Git config is writable and no other Git process holds its lock, then retry.`,b.DEPENDENCY_FAILED,{code:"merge_git_config_unwritable",why:"pm merge install must persist clone-local driver commands before publishing their shared .gitattributes mappings.",nextSteps:["Make the repository Git config writable or wait for the process holding its lock to finish.",'Retry "pm merge install"; the operation is idempotent.','Use "pm merge install --dry-run --json" when the workspace is intentionally read-only.']})}let y=await oe(a,s,u,t);return d!==void 0&&!t&&await d.write(d.plan),{ok:!0,dry_run:t,workspace_root:a,pm_root:o,gitattributes:{path:y.path,changed:y.changed,patterns:u,schema_scope:"project"},git_config:m,...d===void 0?{}:{settlement_hook:{path:d.plan.path,changed:d.plan.changed}},guidance:["Commit .gitattributes so every branch and collaborator shares the merge mapping.",'git config is per-clone: each collaborator (and each fresh worktree/clone) runs "pm merge install" once.','After merging branches, run "pm merge reconcile --dry-run" to inspect the complete receipt and history repair, then apply "pm merge reconcile"; use --force only after explicitly accepting any discarded values.',"Custom item types registered later refresh this fence automatically (pm schema add-type/remove-type); rerun pm merge install only after out-of-band type-folder edits."],generated_at:U()}}export{se as a,ce as b,J as c,T as d,pe as e,x as f,Q as g,ye as h,ee as i,M as j,ne as k,Ve as l,Ke as m,Xe as n,qe as o,ke as p};
8
- //# sourceMappingURL=chunk-LEIVUGDH.js.map