@unbrained/pm-cli 2026.10.27 → 2026.10.30

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 (190) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +41 -0
  3. package/dist/cli/commander-usage.js +2 -2
  4. package/dist/cli/commands/lifecycle/append.d.ts +4 -0
  5. package/dist/cli/commands/lifecycle/append.js +1 -1
  6. package/dist/cli/commands/lifecycle/create.d.ts +4 -0
  7. package/dist/cli/commands/lifecycle/create.js +1 -1
  8. package/dist/cli/commands/lifecycle/plan.d.ts +3 -0
  9. package/dist/cli/commands/lifecycle/plan.js +1 -1
  10. package/dist/cli/commands/lifecycle/update-many.d.ts +4 -0
  11. package/dist/cli/commands/lifecycle/update-many.js +1 -1
  12. package/dist/cli/commands/lifecycle/update.d.ts +4 -0
  13. package/dist/cli/commands/lifecycle/update.js +1 -1
  14. package/dist/cli/error-guidance.js +2 -2
  15. package/dist/cli/help-content.js +2 -2
  16. package/dist/cli/register-list-query.js +3 -3
  17. package/dist/cli-bundle/bundle-manifest.json +1 -1
  18. package/dist/cli-bundle/chunks/chunk-34MP7WKK.js +6 -0
  19. package/dist/cli-bundle/chunks/{chunk-25MTQAHX.js → chunk-3KMYHYJV.js} +2 -2
  20. package/dist/cli-bundle/chunks/chunk-42BHHNTL.js +128 -0
  21. package/dist/cli-bundle/chunks/{chunk-NNIYQHYT.js → chunk-4BQD5SW2.js} +46 -46
  22. package/dist/cli-bundle/chunks/{chunk-OQOEBWHU.js → chunk-EHBGHX55.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-2XUDAQK5.js → chunk-GRABKNFL.js} +2 -2
  24. package/dist/cli-bundle/chunks/chunk-I5O3XZOA.js +2 -0
  25. package/dist/cli-bundle/chunks/{chunk-34OQP43K.js → chunk-LEIVUGDH.js} +3 -3
  26. package/dist/cli-bundle/chunks/{chunk-57YPOOED.js → chunk-LWW4F4G2.js} +2 -2
  27. package/dist/cli-bundle/chunks/chunk-MVL27TAH.js +2 -0
  28. package/dist/cli-bundle/chunks/{chunk-UHKN6TJM.js → chunk-OH7WPD42.js} +44 -44
  29. package/dist/cli-bundle/chunks/chunk-OOD2A7AF.js +20 -0
  30. package/dist/cli-bundle/chunks/chunk-Q5V7P6NM.js +2 -0
  31. package/dist/cli-bundle/chunks/chunk-QLPFYBXN.js +2 -0
  32. package/dist/cli-bundle/chunks/{chunk-ONC4BBQP.js → chunk-RZQNFHXO.js} +2 -2
  33. package/dist/cli-bundle/chunks/chunk-S2U7ECUJ.js +2 -0
  34. package/dist/cli-bundle/chunks/{chunk-32QK43XG.js → chunk-SA5NYLPE.js} +2 -2
  35. package/dist/cli-bundle/chunks/{chunk-ER7RLJW5.js → chunk-TH5KPAN4.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-EKV5GP6P.js → chunk-UUQX3PFD.js} +57 -57
  37. package/dist/cli-bundle/chunks/chunk-VHLAVTJN.js +31 -0
  38. package/dist/cli-bundle/chunks/{chunk-HIX2OMEZ.js → chunk-XAOVJG52.js} +2 -2
  39. package/dist/cli-bundle/chunks/chunk-XPQ4RTSF.js +2 -0
  40. package/dist/cli-bundle/chunks/{chunk-X5TMR7KC.js → chunk-Y6NC3X3E.js} +2 -2
  41. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-63WYG2PY.js → indexed-receipt-blobs-LHLE7PSG.js} +2 -2
  42. package/dist/cli-bundle/chunks/item-transaction-WIOBZW4E.js +2 -0
  43. package/dist/cli-bundle/chunks/{mutation-admission-L3A6FSZ7.js → mutation-admission-TRGAVS7N.js} +2 -2
  44. package/dist/cli-bundle/chunks/{register-list-query-YSQ7UTFI.js → register-list-query-BH4F6M7Z.js} +6 -6
  45. package/dist/cli-bundle/chunks/register-mutation-5V2NANIS.js +20 -0
  46. package/dist/cli-bundle/chunks/register-operations-XSFRMUFX.js +2 -0
  47. package/dist/cli-bundle/chunks/{register-setup-3WAXNDMY.js → register-setup-QPWSVHFZ.js} +2 -2
  48. package/dist/cli-bundle/chunks/{settlement-hook-CRW6PVQK.js → settlement-hook-MN3Y7LVX.js} +2 -2
  49. package/dist/cli-bundle/chunks/{stage-I46WD4EN.js → stage-RTB6RAAO.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/chunk-2V6NMNYN.js +26 -0
  51. package/dist/cli-bundle/focused-chunks/{chunk-YW5GHQN2.js → chunk-3SRX77ES.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-YLVHHWHN.js → chunk-4PW5XWVI.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-ZH7GTEWL.js → chunk-ASHGXMX4.js} +3 -3
  54. package/dist/cli-bundle/focused-chunks/{chunk-XK3XMZM4.js → chunk-BCIUAEWX.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-KTXU5WU6.js → chunk-BPE6JTKL.js} +3 -3
  56. package/dist/cli-bundle/focused-chunks/{chunk-MVY6JDIH.js → chunk-CKBN2D42.js} +11 -11
  57. package/dist/cli-bundle/focused-chunks/chunk-FRFNGMAK.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-I642DXOT.js +22 -0
  59. package/dist/cli-bundle/focused-chunks/chunk-K7DKG5HM.js +91 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-NMQBXU7N.js +44 -0
  61. package/dist/cli-bundle/focused-chunks/{chunk-WDKZB3V6.js → chunk-PGM3ENGZ.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-R2MTHS2H.js → chunk-POJPJX64.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{chunk-YQKLKRMW.js → chunk-QFNV4JTA.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/{chunk-4TXZBGOR.js → chunk-QVJCQMZY.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/chunk-R2TPPPVU.js +2 -0
  66. package/dist/cli-bundle/focused-chunks/{chunk-B266DDBJ.js → chunk-RGQEJFXO.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/{chunk-BH7RE2ZY.js → chunk-RKPUQDWF.js} +2 -2
  68. package/dist/cli-bundle/focused-chunks/chunk-RYEZSZJ7.js +2 -0
  69. package/dist/cli-bundle/focused-chunks/{chunk-E5C24MCV.js → chunk-S23ZUASN.js} +2 -2
  70. package/dist/cli-bundle/focused-chunks/{chunk-SYL73MEI.js → chunk-SAT7IAEB.js} +3 -3
  71. package/dist/cli-bundle/focused-chunks/{chunk-TGUOEOKP.js → chunk-VFWCSQAG.js} +2 -2
  72. package/dist/cli-bundle/focused-chunks/chunk-VJVJ2ZX2.js +2 -0
  73. package/dist/cli-bundle/focused-chunks/{chunk-Y57A4ZDI.js → chunk-YQUZL2CK.js} +54 -54
  74. package/dist/cli-bundle/focused-chunks/{chunk-SM2KGD4J.js → chunk-YU7QOYYV.js} +18 -18
  75. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-GAFC52LQ.js → indexed-receipt-blobs-VK2363JB.js} +2 -2
  76. package/dist/cli-bundle/focused-chunks/item-transaction-ZFDKJIP7.js +2 -0
  77. package/dist/cli-bundle/focused-chunks/{mutation-admission-ENBFMV2X.js → mutation-admission-7VUODEPJ.js} +2 -2
  78. package/dist/cli-bundle/focused-chunks/{settlement-hook-PUYJJDFL.js → settlement-hook-OK6A7PG2.js} +2 -2
  79. package/dist/cli-bundle/focused-chunks/{stage-MAWZTM2H.js → stage-S5RP5SZH.js} +2 -2
  80. package/dist/cli-bundle/main.js +21 -21
  81. package/dist/cli-bundle/sdk-authoring.js +1 -1
  82. package/dist/cli-bundle/sdk-contracts.js +2 -2
  83. package/dist/cli-bundle/sdk-core.js +1 -42
  84. package/dist/cli-bundle/sdk-governance.js +1 -1
  85. package/dist/cli-bundle/sdk-graph.js +1 -1
  86. package/dist/cli-bundle/sdk-merge.js +61 -61
  87. package/dist/cli-bundle/sdk-query.js +1 -1
  88. package/dist/cli-bundle/sdk-runtime.js +1 -1
  89. package/dist/cli-bundle/sdk-testing.js +1 -1
  90. package/dist/cli-bundle/sdk.js +11 -11
  91. package/dist/core/history/operation-contract.d.ts +2 -2
  92. package/dist/core/history/operation-contract.js +1 -1
  93. package/dist/core/item/literal-mutation-input.d.ts +12 -0
  94. package/dist/core/item/literal-mutation-input.js +2 -0
  95. package/dist/core/item/parse.d.ts +2 -0
  96. package/dist/core/item/parse.js +2 -2
  97. package/dist/core/item/priority.js +1 -1
  98. package/dist/core/output/output.js +2 -2
  99. package/dist/core/shared/errors.d.ts +2 -0
  100. package/dist/core/shared/errors.js +1 -1
  101. package/dist/core/store/item-store.js +1 -1
  102. package/dist/sdk/agent/command-recovery.d.ts +5 -0
  103. package/dist/sdk/agent/command-recovery.js +1 -1
  104. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  105. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  106. package/dist/sdk/cli-contracts/registration-helpers.js +1 -1
  107. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  108. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  109. package/dist/sdk/command-line.d.ts +6 -0
  110. package/dist/sdk/command-line.js +1 -1
  111. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  112. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  113. package/dist/sdk/index.d.ts +1 -1
  114. package/dist/sdk/index.js +1 -1
  115. package/dist/sdk/item-transaction.d.ts +33 -2
  116. package/dist/sdk/item-transaction.js +1 -1
  117. package/dist/sdk/lifecycle/append.js +1 -1
  118. package/dist/sdk/lifecycle/cli-input.d.ts +4 -0
  119. package/dist/sdk/lifecycle/cli-input.js +2 -0
  120. package/dist/sdk/lifecycle/close.js +1 -1
  121. package/dist/sdk/lifecycle/create.js +1 -1
  122. package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -1
  123. package/dist/sdk/lifecycle/reopen.js +1 -1
  124. package/dist/sdk/lifecycle/update-many.js +1 -1
  125. package/dist/sdk/lifecycle/update.js +2 -2
  126. package/dist/sdk/output/table-rows.d.ts +9 -1
  127. package/dist/sdk/output/table-rows.js +1 -1
  128. package/dist/sdk/public-surface.json +1 -1
  129. package/dist/sdk/query/history.d.ts +6 -0
  130. package/dist/sdk/query/history.js +1 -1
  131. package/dist/sdk/runtime/actions.js +1 -1
  132. package/dist/sdk/runtime/mutation-value-validation.d.ts +16 -0
  133. package/dist/sdk/runtime/mutation-value-validation.js +2 -0
  134. package/dist/sdk/runtime-input.js +1 -1
  135. package/dist/sdk/runtime-primitives.d.ts +1 -0
  136. package/dist/sdk/runtime-primitives.js +1 -1
  137. package/dist/sdk/runtime.d.ts +14 -0
  138. package/dist/sdk/runtime.js +1 -1
  139. package/dist/sdk/structured-mutations.js +1 -1
  140. package/dist/sdk/test/command-resolution.d.ts +5 -0
  141. package/dist/sdk/test/command-resolution.js +3 -0
  142. package/dist/sdk/test/execution.js +2 -2
  143. package/dist/sdk/workspace-transaction-gc.js +1 -1
  144. package/dist/sdk/workspace-transaction.d.ts +54 -0
  145. package/dist/sdk/workspace-transaction.js +2 -2
  146. package/docs/COMMANDS.md +33 -1
  147. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +24 -2
  148. package/docs/SDK.md +165 -0
  149. package/docs/TESTING.md +36 -2
  150. package/docs/generated/FLAG_LEXICON_BUDGETS.md +1 -1
  151. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +6 -3
  152. package/marketplace.json +1 -1
  153. package/package.json +1 -1
  154. package/packages/pm-beads/package.json +1 -1
  155. package/packages/pm-calendar/package.json +1 -1
  156. package/packages/pm-command-kit/package.json +1 -1
  157. package/packages/pm-digital-twin/package.json +1 -1
  158. package/packages/pm-governance-audit/package.json +1 -1
  159. package/packages/pm-guide-shell/package.json +1 -1
  160. package/packages/pm-kanban/package.json +1 -1
  161. package/packages/pm-lifecycle-hooks/package.json +1 -1
  162. package/packages/pm-linked-test-adapters/package.json +1 -1
  163. package/packages/pm-search-advanced/package.json +1 -1
  164. package/packages/pm-templates/package.json +1 -1
  165. package/packages/pm-todos/package.json +1 -1
  166. package/packages/pm-vcs/package.json +1 -1
  167. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  168. package/plugins/pm-claude/package.json +1 -1
  169. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  170. package/plugins/pm-codex/package.json +1 -1
  171. package/plugins/pm-codex/plugin.json +1 -1
  172. package/runtime-dependencies.json +1 -1
  173. package/dist/cli-bundle/chunks/chunk-4D25HF3V.js +0 -2
  174. package/dist/cli-bundle/chunks/chunk-5PTMQBKJ.js +0 -30
  175. package/dist/cli-bundle/chunks/chunk-F26MRQZY.js +0 -6
  176. package/dist/cli-bundle/chunks/chunk-H434DKYU.js +0 -2
  177. package/dist/cli-bundle/chunks/chunk-O3LPT34G.js +0 -20
  178. package/dist/cli-bundle/chunks/chunk-Q55KZDNF.js +0 -2
  179. package/dist/cli-bundle/chunks/chunk-QQYLNHZK.js +0 -128
  180. package/dist/cli-bundle/chunks/chunk-SGFQQXFD.js +0 -2
  181. package/dist/cli-bundle/chunks/chunk-XERBUA6A.js +0 -2
  182. package/dist/cli-bundle/chunks/register-mutation-6HRXYASW.js +0 -20
  183. package/dist/cli-bundle/chunks/register-operations-4O3YOYXF.js +0 -2
  184. package/dist/cli-bundle/focused-chunks/chunk-HWD63G54.js +0 -2
  185. package/dist/cli-bundle/focused-chunks/chunk-J67PFM3O.js +0 -91
  186. package/dist/cli-bundle/focused-chunks/chunk-NLZUI234.js +0 -26
  187. package/dist/cli-bundle/focused-chunks/chunk-TAFMNTA5.js +0 -2
  188. package/dist/cli-bundle/focused-chunks/chunk-U4UBQBS7.js +0 -2
  189. package/dist/cli-bundle/focused-chunks/chunk-YC6NCPLK.js +0 -22
  190. package/dist/cli-bundle/focused-chunks/chunk-ZA6AEYIM.js +0 -2
@@ -1,2 +1,2 @@
1
- import{da as p,ea as i,fa as v,ga as _}from"./chunk-NNIYQHYT.js";import{za as h}from"./chunk-UHKN6TJM.js";import u from"node:fs/promises";import c from"node:path";(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]="846100a9-4314-5f7c-b892-fa16e09bee5b")}catch{}})();function f(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}function y(e){return e!=="invalid"&&e!=="unreadable"}function j(e){let t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))throw new SyntaxError("Invalid settings object");let r=t.extensions;if(r===void 0)return{enabled:[],disabled:[]};if(typeof r!="object"||r===null||Array.isArray(r))throw new SyntaxError("Invalid extensions settings");let n=r;if(n.enabled!==void 0&&(!Array.isArray(n.enabled)||!n.enabled.every(a=>typeof a=="string"))||n.disabled!==void 0&&(!Array.isArray(n.disabled)||!n.disabled.every(a=>typeof a=="string")))throw new SyntaxError("Invalid extension enablement lists");return{enabled:n.enabled??[],disabled:n.disabled??[]}}async function S(e){let t;try{t=await u.readFile(e,"utf8")}catch(r){return f(r)?{status:"absent",enabled:[],disabled:[]}:{status:"unreadable",enabled:[],disabled:[],error:{code:"settings_unreadable",path:e}}}try{return{status:"ok",...j(t)}}catch{return{status:"invalid",enabled:[],disabled:[],error:{code:"settings_invalid",path:e}}}}async function A(e){let t;try{t=await u.readFile(e,"utf8")}catch(r){if(f(r))try{if((await u.stat(c.dirname(e))).isDirectory())return{status:"absent",entries:[]}}catch(n){if(f(n))return{status:"absent",entries:[]}}return{status:"unreadable",entries:[],error:{code:"managed_state_unreadable",path:e}}}try{let r=JSON.parse(t),n=_(r);if(!n||typeof r!="object"||r===null||!Array.isArray(r.entries)||n.entries.length!==r.entries.length)throw new SyntaxError("Invalid managed extension state");return{status:"ok",entries:n.entries}}catch{return{status:"invalid",entries:[],error:{code:"managed_state_invalid",path:e}}}}async function I(e){try{return{directories:(await u.readdir(e,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).sort((t,r)=>t.localeCompare(r))}}catch(t){return f(t)?{directories:[]}:{directories:[],error:{code:"extensions_unreadable",path:e}}}}async function D(e){let t;try{t=await u.readFile(e,"utf8")}catch(r){return f(r)?{manifest:null,error:{code:"manifest_invalid",path:e}}:{manifest:null,error:{code:"manifest_unreadable",path:e}}}try{let r=v(JSON.parse(t));return r?{manifest:r}:{manifest:null,error:{code:"manifest_invalid",path:e}}}catch{return{manifest:null,error:{code:"manifest_invalid",path:e}}}}function M(e){let t=e.manifest?.name??e.directory,r=new Set(p(e.settings.enabled)),n=new Set(p(e.settings.disabled)),a=!y(e.settings.status)||!e.manifest?null:!n.has(t)&&(r.size===0||r.has(t)),o=y(e.managed.status)?e.managed.entries.some(d=>i(d.name)===i(t)||i(d.directory)===i(e.directory)):null;return{name:t,directory:e.directory,scope:e.scope,installed:!0,status:e.manifest?a===!1?"inactive":"installed":"malformed_manifest",configured_enabled:a,managed:o,runtime_active:null,...e.manifest?{version:e.manifest.version}:{}}}async function R(e){let t=e.scope??"project",r=t==="global"?h(e.cwd??process.cwd()):e.pmRoot,n=c.join(r,"extensions"),a=await S(c.join(r,"settings.json")),o=await A(c.join(n,".managed-extensions.json")),d=await I(n),l=[];for(let s of[a,o,d])s.error&&l.push(s.error);let m=e.name?.trim(),b=[];for(let s of d.directories){let x=c.join(n,s,"manifest.json"),g=await D(x);g.error&&l.push(g.error);let w=M({directory:s,scope:t,manifest:g.manifest,settings:a,managed:o});m&&![w.name,s].some(E=>i(E)===i(m))||b.push(w)}return m&&b.length===0&&l.every(s=>s.code!=="extensions_unreadable")&&b.push({name:m,directory:null,scope:t,installed:!1,status:"absent",configured_enabled:y(a.status)?!1:null,managed:y(o.status)?!1:null,runtime_active:null}),{scope:t,complete:l.length===0,settings_status:a.status,managed_state_status:o.status,extensions:b,errors:l}}export{R as a};
2
- //# sourceMappingURL=chunk-OQOEBWHU.js.map
1
+ import{ga as p,ha as i,ia as v,ja as _}from"./chunk-4BQD5SW2.js";import{za as h}from"./chunk-OH7WPD42.js";import u from"node:fs/promises";import c from"node:path";(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]="846100a9-4314-5f7c-b892-fa16e09bee5b")}catch{}})();function f(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}function y(e){return e!=="invalid"&&e!=="unreadable"}function j(e){let t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))throw new SyntaxError("Invalid settings object");let r=t.extensions;if(r===void 0)return{enabled:[],disabled:[]};if(typeof r!="object"||r===null||Array.isArray(r))throw new SyntaxError("Invalid extensions settings");let n=r;if(n.enabled!==void 0&&(!Array.isArray(n.enabled)||!n.enabled.every(a=>typeof a=="string"))||n.disabled!==void 0&&(!Array.isArray(n.disabled)||!n.disabled.every(a=>typeof a=="string")))throw new SyntaxError("Invalid extension enablement lists");return{enabled:n.enabled??[],disabled:n.disabled??[]}}async function S(e){let t;try{t=await u.readFile(e,"utf8")}catch(r){return f(r)?{status:"absent",enabled:[],disabled:[]}:{status:"unreadable",enabled:[],disabled:[],error:{code:"settings_unreadable",path:e}}}try{return{status:"ok",...j(t)}}catch{return{status:"invalid",enabled:[],disabled:[],error:{code:"settings_invalid",path:e}}}}async function A(e){let t;try{t=await u.readFile(e,"utf8")}catch(r){if(f(r))try{if((await u.stat(c.dirname(e))).isDirectory())return{status:"absent",entries:[]}}catch(n){if(f(n))return{status:"absent",entries:[]}}return{status:"unreadable",entries:[],error:{code:"managed_state_unreadable",path:e}}}try{let r=JSON.parse(t),n=_(r);if(!n||typeof r!="object"||r===null||!Array.isArray(r.entries)||n.entries.length!==r.entries.length)throw new SyntaxError("Invalid managed extension state");return{status:"ok",entries:n.entries}}catch{return{status:"invalid",entries:[],error:{code:"managed_state_invalid",path:e}}}}async function I(e){try{return{directories:(await u.readdir(e,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).sort((t,r)=>t.localeCompare(r))}}catch(t){return f(t)?{directories:[]}:{directories:[],error:{code:"extensions_unreadable",path:e}}}}async function D(e){let t;try{t=await u.readFile(e,"utf8")}catch(r){return f(r)?{manifest:null,error:{code:"manifest_invalid",path:e}}:{manifest:null,error:{code:"manifest_unreadable",path:e}}}try{let r=v(JSON.parse(t));return r?{manifest:r}:{manifest:null,error:{code:"manifest_invalid",path:e}}}catch{return{manifest:null,error:{code:"manifest_invalid",path:e}}}}function M(e){let t=e.manifest?.name??e.directory,r=new Set(p(e.settings.enabled)),n=new Set(p(e.settings.disabled)),a=!y(e.settings.status)||!e.manifest?null:!n.has(t)&&(r.size===0||r.has(t)),o=y(e.managed.status)?e.managed.entries.some(d=>i(d.name)===i(t)||i(d.directory)===i(e.directory)):null;return{name:t,directory:e.directory,scope:e.scope,installed:!0,status:e.manifest?a===!1?"inactive":"installed":"malformed_manifest",configured_enabled:a,managed:o,runtime_active:null,...e.manifest?{version:e.manifest.version}:{}}}async function R(e){let t=e.scope??"project",r=t==="global"?h(e.cwd??process.cwd()):e.pmRoot,n=c.join(r,"extensions"),a=await S(c.join(r,"settings.json")),o=await A(c.join(n,".managed-extensions.json")),d=await I(n),l=[];for(let s of[a,o,d])s.error&&l.push(s.error);let m=e.name?.trim(),b=[];for(let s of d.directories){let x=c.join(n,s,"manifest.json"),g=await D(x);g.error&&l.push(g.error);let w=M({directory:s,scope:t,manifest:g.manifest,settings:a,managed:o});m&&![w.name,s].some(E=>i(E)===i(m))||b.push(w)}return m&&b.length===0&&l.every(s=>s.code!=="extensions_unreadable")&&b.push({name:m,directory:null,scope:t,installed:!1,status:"absent",configured_enabled:y(a.status)?!1:null,managed:y(o.status)?!1:null,runtime_active:null}),{scope:t,complete:l.length===0,settings_status:a.status,managed_state_status:o.status,extensions:b,errors:l}}export{R as a};
2
+ //# sourceMappingURL=chunk-EHBGHX55.js.map
@@ -1,3 +1,3 @@
1
- import{a as k,c as I,d as A,e as _,k as T,m as C}from"./chunk-F26MRQZY.js";import{Db as b,Eb as v,Fb as R}from"./chunk-O3LPT34G.js";import{Ae as H,Of as f,Rf as g,Sc as x,Sf as a,hg as w}from"./chunk-QQYLNHZK.js";import{Kf as D,Nf as m,Of as y,Tc as E}from"./chunk-UHKN6TJM.js";import{A as c,C as p}from"./chunk-ONC4BBQP.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="631e56aa-4d7e-58b6-bbea-a0d320716b82")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="0bcdd63c-5fd3-585d-a6c5-9393029ef864")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="4dce4f19-071c-54a8-be0d-5975d9e3b34b")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="f330a0c5-a967-5383-9c27-efa4a39e0f0d")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="a178bd8b-fc53-5633-84d5-621b61930581")}catch{}})();function O(t,e){if(typeof t!="string")return;let o=Number.parseInt(t,10);if(!/^\d+$/.test(t.trim())||!Number.isSafeInteger(o))throw new p(`history-compact ${e} must be a non-negative integer.`,c.USAGE);return o}async function S(t,e,o){let r=f(o),n=Date.now(),i=await x(a(e,"ids")),l=i===void 0?void 0:H(i),d=O(e.allOver,"--all-over"),u=O(e.minEntries,"--min-entries");if(e.closed===!0&&e.allStreams===!0)throw new p("history-compact: --closed and --all-streams are mutually exclusive; pick one lifecycle scope.",c.USAGE);let s=e.closed===!0?"closed":e.allStreams===!0?"all-streams":void 0;if((l!==void 0||d!==void 0||s!==void 0)&&typeof e.before=="string")throw new p("history-compact: --before applies only in single-id mode (bulk mode always compacts full streams).",c.USAGE);if(I(t,{ids:l,allOver:d,scope:s}),t!==void 0&&u!==void 0)throw new p("history-compact: --min-entries applies only in bulk mode (single-id mode compacts the named stream).",c.USAGE);if(t===void 0){let h=await A({ids:l,scope:s,allOver:d,minEntries:u,dryRun:e.dryRun===!0,author:a(e,"author"),message:a(e,"message"),force:!!e.force},r);m(h,r),h.totals.items_errored>0&&(process.exitCode=c.GENERIC_FAILURE)}else{let h=await k(t,{before:a(e,"before"),dryRun:e.dryRun===!0,author:a(e,"author"),message:a(e,"message"),force:!!e.force},r);m(h,r)}r.profile&&y(`profile:command=history-compact took_ms=${Date.now()-n}`)}async function N(t,e,o,r){let n=f(r),i=Date.now(),l=await C(t,e,{author:a(o,"author"),message:a(o,"message"),force:!!o.force},n);await w(n,l),m(l,n),n.profile&&y(`profile:command=restore took_ms=${Date.now()-i}`)}async function B(t,e){let o=f(e),r=await T({verify:a(t,"verify"),output:a(t,"output"),hashAlgorithm:a(t,"hashAlgorithm")},o);"format"in r?(E(r),o.quiet||D(`${JSON.stringify(r,null,2)}
1
+ import{a as k,c as I,d as A,e as _,k as T,m as C}from"./chunk-34MP7WKK.js";import{Ab as v,Bb as R,zb as b}from"./chunk-OOD2A7AF.js";import{Ge as H,Uf as f,Wc as x,Xf as g,Yf as a,ng as w}from"./chunk-42BHHNTL.js";import{Mf as D,Pf as m,Qf as y,Tc as E}from"./chunk-OH7WPD42.js";import{A as c,C as p}from"./chunk-RZQNFHXO.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="631e56aa-4d7e-58b6-bbea-a0d320716b82")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="0bcdd63c-5fd3-585d-a6c5-9393029ef864")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="4dce4f19-071c-54a8-be0d-5975d9e3b34b")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="f330a0c5-a967-5383-9c27-efa4a39e0f0d")}catch{}})();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="a178bd8b-fc53-5633-84d5-621b61930581")}catch{}})();function O(t,e){if(typeof t!="string")return;let o=Number.parseInt(t,10);if(!/^\d+$/.test(t.trim())||!Number.isSafeInteger(o))throw new p(`history-compact ${e} must be a non-negative integer.`,c.USAGE);return o}async function S(t,e,o){let r=f(o),n=Date.now(),i=await x(a(e,"ids")),l=i===void 0?void 0:H(i),d=O(e.allOver,"--all-over"),u=O(e.minEntries,"--min-entries");if(e.closed===!0&&e.allStreams===!0)throw new p("history-compact: --closed and --all-streams are mutually exclusive; pick one lifecycle scope.",c.USAGE);let s=e.closed===!0?"closed":e.allStreams===!0?"all-streams":void 0;if((l!==void 0||d!==void 0||s!==void 0)&&typeof e.before=="string")throw new p("history-compact: --before applies only in single-id mode (bulk mode always compacts full streams).",c.USAGE);if(I(t,{ids:l,allOver:d,scope:s}),t!==void 0&&u!==void 0)throw new p("history-compact: --min-entries applies only in bulk mode (single-id mode compacts the named stream).",c.USAGE);if(t===void 0){let h=await A({ids:l,scope:s,allOver:d,minEntries:u,dryRun:e.dryRun===!0,author:a(e,"author"),message:a(e,"message"),force:!!e.force},r);m(h,r),h.totals.items_errored>0&&(process.exitCode=c.GENERIC_FAILURE)}else{let h=await k(t,{before:a(e,"before"),dryRun:e.dryRun===!0,author:a(e,"author"),message:a(e,"message"),force:!!e.force},r);m(h,r)}r.profile&&y(`profile:command=history-compact took_ms=${Date.now()-n}`)}async function N(t,e,o,r){let n=f(r),i=Date.now(),l=await C(t,e,{author:a(o,"author"),message:a(o,"message"),force:!!o.force},n);await w(n,l),m(l,n),n.profile&&y(`profile:command=restore took_ms=${Date.now()-i}`)}async function B(t,e){let o=f(e),r=await T({verify:a(t,"verify"),output:a(t,"output"),hashAlgorithm:a(t,"hashAlgorithm")},o);"format"in r?(E(r),o.quiet||D(`${JSON.stringify(r,null,2)}
2
2
  `)):m(r,o),"ok"in r&&!r.ok&&(process.exitCode=c.GENERIC_FAILURE)}function Z(t,e){t.command(e?"attest":"history-attest",{hidden:!e}).summary("Export or verify history proof.").option("--verify <file>","Compare retained streams with a detached JSON proof").option("--output <file>","Create a proof file and return a compact receipt").option("--hash-algorithm <name>","Bundle digest algorithm: sha256 (default) or sha512").description("Export exact-byte history commitments, or verify an independently retained proof without tracker writes.").action(B),t.command("restore",{hidden:!e}).summary("Restore a version.").argument("<id>","Item id").argument("<target>","Restore target timestamp or version number").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership/lock override").description("Restore an item to an earlier timestamp or version.").action(N),t.command(e?"redact":"history-redact",{hidden:!e}).summary("Redact sensitive values.").argument("<id>","Item id").option("--literal <value>","Literal string to redact (repeatable)",g).option("--regex <value>","Regex pattern to redact (repeatable; accepts /pattern/flags or raw pattern)",g).option("--replacement <value>",'Replacement string (default: "[redacted]")').option("--dry-run","Preview redaction impact without writing item/history files").option("--author <value>","Mutation author").option("--message <value>","Audit history message for the redaction marker entry").option("--force","Force ownership/lock override").description("Redact sensitive literals/patterns from an item history stream and recompute hashes.").action(async(o,r,n)=>{let i=f(n),l=Date.now(),d=Array.isArray(r.literal)?r.literal:void 0,u=Array.isArray(r.regex)?r.regex:void 0,s=await _(o,{literal:d,regex:u,replacement:a(r,"replacement"),dryRun:r.dryRun===!0,author:a(r,"author"),message:a(r,"message"),force:!!r.force},i);s.changed&&!s.dry_run&&await w(i,s),m(s,i),i.profile&&y(`profile:command=history-redact took_ms=${Date.now()-l}`)}),t.command(e?"repair":"history-repair",{hidden:!e}).summary("Repair drift.").argument("[id]","Item id (omit with --all)").option("--salvage-tail","Recover invalid tail; requires verified prefix").option("--all","Scan every stream for drift and repair each drifted stream in one audited pass").option("--dry-run","Preview the re-anchor impact without writing the history file").option("--normalize-provenance","Remove invalid provenance; return aggregate-only evidence").option("--author <value>","Mutation author").option("--message <value>","Audit history message for the repair marker entry").option("--force","Force ownership/lock override").description("Re-anchor a drifted item history chain (recompute hashes, reconcile with the on-disk item) and record an audit marker. Use --all to repair every drifted stream.").action(async(o,r,n)=>{let i=f(n),l=Date.now(),d=r.all===!0;v(o,d);let u={dryRun:r.dryRun===!0,author:a(r,"author"),message:a(r,"message"),force:!!r.force,normalizeProvenance:r.normalizeProvenance===!0,salvageTail:r.salvageTail===!0};if(d){let s=await R(u,i);m(s,i),s.totals.failed>0&&(process.exitCode=c.GENERIC_FAILURE)}else{let s=await b(o,u,i);m(s,i)}i.profile&&y(`profile:command=history-repair took_ms=${Date.now()-l}`)}),t.command(e?"compact":"history-compact",{hidden:!e}).summary("Compact streams.").argument("[id]","Item id (omit when using a bulk selector)").option("--before <value>","Compact entries strictly before this version number or ISO timestamp (single-id mode only)").option("--ids <value>","Bulk IDs: comma/newline text, - stdin, or @path file").option("--all-over <n>","Bulk: compact every stream with more than N entries").option("--closed","Bulk: compact only closed (terminal) items' streams").option("--all-streams","Bulk: compact every history stream regardless of lifecycle state").option("--min-entries <n>","Bulk: skip streams with at most N entries (already compact; default 3)").option("--dry-run","Preview compaction impact without writing the history file").option("--author <value>","Mutation author").option("--message <value>","Audit history message for the compaction marker entry").option("--force","Force ownership/lock override").description("Compact item history streams into a synthetic baseline plus retained tail entries. Pass an item id for one stream, or a bulk selector (--ids/--all-over/--closed/--all-streams) to compact many.").action(S)}export{Z as a};
3
- //# sourceMappingURL=chunk-2XUDAQK5.js.map
3
+ //# sourceMappingURL=chunk-GRABKNFL.js.map
@@ -0,0 +1,2 @@
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 +1,8 @@
1
- import{Ei as V,Rf as W,Se as U,bf as $,oh as H,pa as B,ui as L,xa as E,z as G,zi as P}from"./chunk-UHKN6TJM.js";import{d as K}from"./chunk-ER7RLJW5.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-ONC4BBQP.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(`
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
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
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
4
 
5
5
  `:""}${p}
6
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-CRW6PVQK.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-34OQP43K.js.map
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
@@ -1,2 +1,2 @@
1
- import{b as a}from"./chunk-VS565KBX.js";import{A as l,C as d}from"./chunk-ONC4BBQP.js";import{execFile as g}from"node:child_process";import{promisify as m}from"node:util";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="e57ef62f-fd40-5a33-9816-e24d8dba4d1d")}catch{}})();var p=m(g);async function k(t,r){if(r.length===0)return[];let i;try{let e=p("git",["check-ignore","--verbose","-z","--stdin"],{cwd:t,env:a(),timeout:1e4}),n=e.child.stdin;n!==null&&(n.on("error",()=>{e.child.kill()}),n.end(`${r.join("\0")}\0`)),{stdout:i}=await e}catch(e){if(typeof e=="object"&&e!==null&&"code"in e&&e.code===1)return[];throw new d("Git could not verify ignore rules for merge artifacts; no automatic settlement is safe until that check succeeds.",l.CONFLICT,{code:"merge_settlement_review_required",reason:"ignore_check_unavailable",nextSteps:["Check Git configuration and ignore-file readability, then retry pm merge reconcile --stage --dry-run."]})}let o=i.split("\0"),c=[];for(let e=0;e+3<o.length;e+=4){let[n,f,s,u]=o.slice(e,e+4);s.startsWith("!")||c.push({path:u,source:n,line:Number(f),pattern:s})}return c}export{k as a};
2
- //# sourceMappingURL=chunk-57YPOOED.js.map
1
+ import{b as a}from"./chunk-VS565KBX.js";import{A as l,C as d}from"./chunk-RZQNFHXO.js";import{execFile as g}from"node:child_process";import{promisify as m}from"node:util";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="e57ef62f-fd40-5a33-9816-e24d8dba4d1d")}catch{}})();var p=m(g);async function k(t,r){if(r.length===0)return[];let i;try{let e=p("git",["check-ignore","--verbose","-z","--stdin"],{cwd:t,env:a(),timeout:1e4}),n=e.child.stdin;n!==null&&(n.on("error",()=>{e.child.kill()}),n.end(`${r.join("\0")}\0`)),{stdout:i}=await e}catch(e){if(typeof e=="object"&&e!==null&&"code"in e&&e.code===1)return[];throw new d("Git could not verify ignore rules for merge artifacts; no automatic settlement is safe until that check succeeds.",l.CONFLICT,{code:"merge_settlement_review_required",reason:"ignore_check_unavailable",nextSteps:["Check Git configuration and ignore-file readability, then retry pm merge reconcile --stage --dry-run."]})}let o=i.split("\0"),c=[];for(let e=0;e+3<o.length;e+=4){let[n,f,s,u]=o.slice(e,e+4);s.startsWith("!")||c.push({path:u,source:n,line:Number(f),pattern:s})}return c}export{k as a};
2
+ //# sourceMappingURL=chunk-LWW4F4G2.js.map
@@ -0,0 +1,2 @@
1
+ import{yc as o}from"./chunk-VHLAVTJN.js";import{ed as d}from"./chunk-42BHHNTL.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]="41b0b451-a696-5d06-a19d-df1d6b28963c")}catch{}})();function i(e,t,n){return o(e,d(t),n)}export{i as a};
2
+ //# sourceMappingURL=chunk-MVL27TAH.js.map