@unbrained/pm-cli 2026.10.26 → 2026.10.28

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 (159) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +39 -1
  3. package/dist/cli/commander-usage.js +2 -2
  4. package/dist/cli/error-guidance.js +2 -2
  5. package/dist/cli/register-list-query.js +5 -5
  6. package/dist/cli-bundle/bundle-manifest.json +1 -1
  7. package/dist/cli-bundle/chunks/chunk-2J7I54MQ.js +2 -0
  8. package/dist/cli-bundle/chunks/{chunk-25MTQAHX.js → chunk-3KMYHYJV.js} +2 -2
  9. package/dist/cli-bundle/chunks/chunk-7V37RC2L.js +114 -0
  10. package/dist/cli-bundle/chunks/chunk-AHVN4GHF.js +31 -0
  11. package/dist/cli-bundle/chunks/{chunk-VS2IIV3F.js → chunk-CS7QDSUX.js} +28 -28
  12. package/dist/cli-bundle/chunks/{chunk-T7T4WLUY.js → chunk-CXUQEZDX.js} +3 -3
  13. package/dist/cli-bundle/chunks/{chunk-ZT64RDMF.js → chunk-D3AIQZXF.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-7UDQAINZ.js → chunk-D6P6IBPN.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-TGOG5BFM.js → chunk-DKLEDWVW.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-MWCG25PO.js → chunk-DM3PICGU.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-Y42DYMZX.js → chunk-E5QBZ4HI.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-XAIR53QZ.js → chunk-JESLOJD7.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-57YPOOED.js → chunk-LWW4F4G2.js} +2 -2
  20. package/dist/cli-bundle/chunks/chunk-PQLRKFPZ.js +20 -0
  21. package/dist/cli-bundle/chunks/{chunk-ONC4BBQP.js → chunk-RZQNFHXO.js} +2 -2
  22. package/dist/cli-bundle/chunks/chunk-SPPHDVZE.js +2 -0
  23. package/dist/cli-bundle/chunks/{chunk-ER7RLJW5.js → chunk-TH5KPAN4.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-OCDRHIVQ.js → chunk-XHONSCLJ.js} +6 -6
  25. package/dist/cli-bundle/chunks/{chunk-NGKTROAO.js → chunk-YUBUNECD.js} +42 -42
  26. package/dist/cli-bundle/chunks/{chunk-Z35XAHUN.js → chunk-YYD5MNAV.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-UF6EXZSP.js → chunk-ZX3XMTZG.js} +2 -2
  28. package/dist/cli-bundle/chunks/indexed-receipt-blobs-LHLE7PSG.js +4 -0
  29. package/dist/cli-bundle/chunks/{mutation-admission-VTNV6JV2.js → mutation-admission-GKDKHRTZ.js} +2 -2
  30. package/dist/cli-bundle/chunks/{register-list-query-LZDWUZS4.js → register-list-query-MHJJUM6M.js} +9 -9
  31. package/dist/cli-bundle/chunks/{register-mutation-M2A7PH42.js → register-mutation-SN425O3R.js} +2 -2
  32. package/dist/cli-bundle/chunks/{register-operations-E7P2JTXM.js → register-operations-EYUIUGPW.js} +2 -2
  33. package/dist/cli-bundle/chunks/{register-setup-DOV7KGSH.js → register-setup-WUZ2ZSMY.js} +2 -2
  34. package/dist/cli-bundle/chunks/{settlement-hook-SVD6CO7U.js → settlement-hook-MN3Y7LVX.js} +2 -2
  35. package/dist/cli-bundle/chunks/{stage-LYLEOAQB.js → stage-2FYJGGG3.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/chunk-3EHVI673.js +2 -0
  37. package/dist/cli-bundle/focused-chunks/chunk-46WLWK73.js +2 -0
  38. package/dist/cli-bundle/focused-chunks/{chunk-E5C24MCV.js → chunk-4GN2ZPT5.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-NLZUI234.js → chunk-6L4KKRK7.js} +18 -18
  40. package/dist/cli-bundle/focused-chunks/{chunk-D5YQ4KAE.js → chunk-6VDRAJYX.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{chunk-KTXU5WU6.js → chunk-7SZPZOIC.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/{chunk-YQKLKRMW.js → chunk-B4ZQJEMT.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/{chunk-NE27VCU7.js → chunk-BZSACRVX.js} +3 -3
  44. package/dist/cli-bundle/focused-chunks/{chunk-ADSBGYLW.js → chunk-C2GLO7HU.js} +55 -55
  45. package/dist/cli-bundle/focused-chunks/{chunk-UP765R2V.js → chunk-DRN4W3YJ.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/chunk-EGN2HFRU.js +2 -0
  47. package/dist/cli-bundle/focused-chunks/{chunk-CSCZYSNZ.js → chunk-F6UQJJYB.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-I7H3XF25.js → chunk-I4X6AKOO.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/chunk-IQKLJFJE.js +79 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-KERJNFXY.js → chunk-JTCGDODH.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-IF6C43IP.js → chunk-L5GX2FGZ.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-PK5FJIVA.js → chunk-LPWZERVD.js} +11 -11
  53. package/dist/cli-bundle/focused-chunks/{chunk-YW5GHQN2.js → chunk-ML5JIUM6.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-BL77VCRB.js → chunk-OASYSUOH.js} +16 -16
  55. package/dist/cli-bundle/focused-chunks/{chunk-BH7RE2ZY.js → chunk-ON5WFDCG.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-WDWHUJQW.js → chunk-QUPGBO2L.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/{chunk-226XKW3W.js → chunk-R3EA3SDW.js} +3 -3
  58. package/dist/cli-bundle/focused-chunks/{chunk-B266DDBJ.js → chunk-TUN4M757.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{chunk-YTEC2EPM.js → chunk-Z26ZPQH6.js} +3 -3
  60. package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-5H6RMRTK.js +4 -0
  61. package/dist/cli-bundle/focused-chunks/{mutation-admission-L42E3U5U.js → mutation-admission-TM3SVU2O.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{settlement-hook-3CADO4XZ.js → settlement-hook-LBVWWSCF.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{stage-TUQHWU7N.js → stage-7ZBRX2Q2.js} +2 -2
  64. package/dist/cli-bundle/main.js +21 -21
  65. package/dist/cli-bundle/sdk-authoring.js +1 -1
  66. package/dist/cli-bundle/sdk-contracts.js +2 -2
  67. package/dist/cli-bundle/sdk-core.js +34 -33
  68. package/dist/cli-bundle/sdk-governance.js +1 -1
  69. package/dist/cli-bundle/sdk-graph.js +1 -1
  70. package/dist/cli-bundle/sdk-merge.js +57 -57
  71. package/dist/cli-bundle/sdk-query.js +1 -1
  72. package/dist/cli-bundle/sdk-runtime.js +1 -1
  73. package/dist/cli-bundle/sdk-testing.js +1 -1
  74. package/dist/cli-bundle/sdk.js +11 -11
  75. package/dist/core/history/event-index.d.ts +6 -0
  76. package/dist/core/history/event-index.js +7 -6
  77. package/dist/core/history/read.d.ts +3 -1
  78. package/dist/core/history/read.js +1 -1
  79. package/dist/core/item/priority.js +1 -1
  80. package/dist/core/shared/errors.d.ts +2 -0
  81. package/dist/core/shared/errors.js +1 -1
  82. package/dist/core/store/item-store.js +1 -1
  83. package/dist/mcp/tool-definitions.js +1 -1
  84. package/dist/sdk/agent/command-recovery.d.ts +5 -0
  85. package/dist/sdk/agent/command-recovery.js +1 -1
  86. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  87. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  88. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  89. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  90. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  91. package/dist/sdk/command-line.d.ts +6 -0
  92. package/dist/sdk/command-line.js +1 -1
  93. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  94. package/dist/sdk/index.d.ts +1 -1
  95. package/dist/sdk/index.js +1 -1
  96. package/dist/sdk/lifecycle/close.js +1 -1
  97. package/dist/sdk/lifecycle/create.js +1 -1
  98. package/dist/sdk/lifecycle/update-many.js +1 -1
  99. package/dist/sdk/lifecycle/update.js +1 -1
  100. package/dist/sdk/merge/indexed-receipt-blobs.d.ts +3 -1
  101. package/dist/sdk/merge/indexed-receipt-blobs.js +2 -2
  102. package/dist/sdk/merge/receipt-file-boundary.d.ts +2 -0
  103. package/dist/sdk/merge/receipt-file-boundary.js +1 -1
  104. package/dist/sdk/merge/receipts.js +2 -2
  105. package/dist/sdk/mutation-events.d.ts +6 -0
  106. package/dist/sdk/mutation-events.js +1 -1
  107. package/dist/sdk/public-surface.json +1 -1
  108. package/dist/sdk/query/history.d.ts +4 -0
  109. package/dist/sdk/query/history.js +1 -1
  110. package/dist/sdk/runtime/actions.js +1 -1
  111. package/dist/sdk/runtime-extended-actions.js +1 -1
  112. package/dist/sdk/runtime.js +1 -1
  113. package/dist/sdk/test/command-resolution.d.ts +5 -0
  114. package/dist/sdk/test/command-resolution.js +3 -0
  115. package/dist/sdk/test/execution.js +3 -3
  116. package/dist/sdk/test/receipt-index-snapshot.d.ts +2 -0
  117. package/dist/sdk/test/receipt-index-snapshot.js +2 -0
  118. package/dist/sdk/test/workspace-snapshot.d.ts +1 -1
  119. package/dist/sdk/test/workspace-snapshot.js +1 -1
  120. package/docs/COMMANDS.md +28 -1
  121. package/docs/PERFORMANCE.md +21 -6
  122. package/docs/RELEASING.md +11 -0
  123. package/docs/SDK.md +40 -0
  124. package/docs/SDK_CONTEXT_COORDINATION.md +35 -4
  125. package/docs/TESTING.md +42 -3
  126. package/docs/generated/FLAG_LEXICON_BUDGETS.md +2 -2
  127. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +4 -3
  128. package/marketplace.json +1 -1
  129. package/package.json +1 -1
  130. package/packages/pm-beads/package.json +1 -1
  131. package/packages/pm-calendar/package.json +1 -1
  132. package/packages/pm-command-kit/package.json +1 -1
  133. package/packages/pm-digital-twin/package.json +1 -1
  134. package/packages/pm-governance-audit/package.json +1 -1
  135. package/packages/pm-guide-shell/package.json +1 -1
  136. package/packages/pm-kanban/package.json +1 -1
  137. package/packages/pm-lifecycle-hooks/package.json +1 -1
  138. package/packages/pm-linked-test-adapters/package.json +1 -1
  139. package/packages/pm-search-advanced/package.json +1 -1
  140. package/packages/pm-templates/package.json +1 -1
  141. package/packages/pm-todos/package.json +1 -1
  142. package/packages/pm-vcs/package.json +1 -1
  143. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  144. package/plugins/pm-claude/package.json +1 -1
  145. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  146. package/plugins/pm-codex/package.json +1 -1
  147. package/plugins/pm-codex/plugin.json +1 -1
  148. package/runtime-dependencies.json +1 -1
  149. package/dist/cli-bundle/chunks/chunk-N6FTEILW.js +0 -20
  150. package/dist/cli-bundle/chunks/chunk-OUDR2HWR.js +0 -113
  151. package/dist/cli-bundle/chunks/chunk-RUKSEZE7.js +0 -2
  152. package/dist/cli-bundle/chunks/chunk-YJBIPNDL.js +0 -2
  153. package/dist/cli-bundle/chunks/chunk-ZLVFUZI4.js +0 -30
  154. package/dist/cli-bundle/chunks/indexed-receipt-blobs-NWQIDTH7.js +0 -4
  155. package/dist/cli-bundle/focused-chunks/chunk-ABMNYWV6.js +0 -2
  156. package/dist/cli-bundle/focused-chunks/chunk-NFN2P4TW.js +0 -2
  157. package/dist/cli-bundle/focused-chunks/chunk-UHWTPOM4.js +0 -78
  158. package/dist/cli-bundle/focused-chunks/chunk-VVRXF4JO.js +0 -2
  159. package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-YFDNGHCM.js +0 -4
@@ -0,0 +1,4 @@
1
+ import{b as E}from"./chunk-ON5WFDCG.js";import{b as I}from"./chunk-FOA7XKWP.js";import"./chunk-7SZPZOIC.js";import{execFile as O}from"node:child_process";import{realpath as v}from"node:fs/promises";import b from"node:path";import{promisify as M}from"node:util";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new n.Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="5d2c2c37-5ff2-5dab-84f1-55a7fa8d5a27")}catch{}})();var w=M(O),x="[a-f0-9]{40}(?:[a-f0-9]{24})?",N=new RegExp(`^100(?:644|755) (${x}) 0$`,"u"),R=new RegExp(`^(${x}) blob (\\d+)$`,"u");async function _(n,o,a){let t=w("git",n,{...a,encoding:"buffer"}),e=t.child.stdin;return e!==null&&(e.on("error",()=>{t.child.kill()}),e.end(`${o.join(`
2
+ `)}
3
+ `)),(await t).stdout}function B(n,o){let a=new Map;for(let t of n.split("\0")){let e=t.indexOf(" "),i=t.slice(e+1),r=N.exec(t.slice(0,e));r!==null&&o.has(i)&&a.set(i,r[1])}return a}function D(n,o,a){let t=[],e=[],i=0;for(let r of n.trimEnd().split(/\r?\n/u)){let s=R.exec(r);if(s===null||!o.has(s[1]))continue;let c=Number(s[2]);!Number.isSafeInteger(c)||c>a||(e.length>0&&i+c+128>a&&(t.push(e),e=[],i=0),e.push({id:s[1],size:c}),i+=c+128)}return e.length>0&&t.push(e),t}function S(n,o,a){let t=0;for(let{id:e,size:i}of o){let r=n.indexOf(10,t)+1;if(r===0||n.subarray(t,r-1).toString("ascii")!==`${e} blob ${i}`||n[r+i]!==10)throw new Error("Invalid indexed receipt batch framing");a.set(e,n.subarray(r,r+i).toString("utf8")),t=r+i+1}if(t!==n.length)throw new Error("Unexpected indexed receipt batch data")}async function k(n,o,a,t,e,i={}){let r=I();r.GIT_NO_REPLACE_OBJECTS="1",e===void 0&&process.env.GIT_INDEX_FILE!==void 0&&(r.GIT_INDEX_FILE=b.resolve(process.env.GIT_INDEX_FILE));let s={cwd:n,env:r,windowsHide:!0,timeout:1e4,maxBuffer:t+256};try{let c=(await w("git",["rev-parse","--show-toplevel"],{...s,encoding:"utf8"})).stdout.trim(),[g,y]=await Promise.all([v(c),v(e??o)]),d=b.relative(g,e===void 0?y:b.resolve(e)).replaceAll("\\","/");if(E(d))return new Map;s.cwd=g;let m=new Map(a.map(f=>[`${d}/${f}`,f])),T=(await w("git",["ls-files","--stage","-z","--",`:(literal)${d}/`],{...s,encoding:"utf8"})).stdout,p=B(T,new Set(m.keys()));if(p.size===0)return new Map;let u=new Set(p.values()),$=(await _(["cat-file","--batch-check"],[...u],s)).toString("utf8"),l=new Map;for(let f of D($,u,t))S(await _(["cat-file","--batch"],f.map(h=>h.id),s),f,l);if(i.failOnReadError&&l.size!==u.size)throw new Error("Unable to read every indexed receipt blob");return new Map([...p].filter(([,f])=>l.has(f)).map(([f,h])=>[m.get(f),l.get(h)]))}catch(c){if(i.failOnReadError)throw c;return new Map}}export{k as readIndexedReceiptBlobs};
4
+ //# sourceMappingURL=indexed-receipt-blobs-5H6RMRTK.js.map
@@ -1,2 +1,2 @@
1
- import{b as E,g as N}from"./chunk-IF6C43IP.js";import"./chunk-KERJNFXY.js";import{N as y,Q as C}from"./chunk-YTEC2EPM.js";import"./chunk-BL77VCRB.js";import"./chunk-E5C24MCV.js";import{Ca as h,Ia as w}from"./chunk-ABMNYWV6.js";import"./chunk-NE27VCU7.js";import{_a as A,g as R}from"./chunk-UHWTPOM4.js";import"./chunk-YW5GHQN2.js";import{l as T,m as O}from"./chunk-B266DDBJ.js";import"./chunk-YLVHHWHN.js";import"./chunk-AK2CI2GI.js";import{a as g,wa as _}from"./chunk-NLZUI234.js";import{z as f}from"./chunk-KTXU5WU6.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="d19ff816-7570-5e8a-a4de-ad2ca48f0df0")}catch{}})();function b(t,o,r,a=!1){let d=[...r].map(n=>({candidate:n,distance:g(o,n,3)})).filter(n=>n.distance!==null).sort((n,i)=>n.distance-i.distance||n.candidate.localeCompare(i.candidate))[0]?.candidate,s=a?`Put mutation fields under options (options.${o}).`:d?`Did you mean "${d}"?`:"Use the declared command options or the field option for registered item fields.";throw new f(`Unknown ${t} ${a?"argument":"option"} "${o}". ${s} No changes were made.`,2,{code:"invalid_argument_value",reason:"unknown_mutation_option",changed:!1,field:o,required:s,nextSteps:[s]})}async function j(t,o,r,a,d){if(E(o))return;let s=t==="create"?y:C,n=(t==="create"?h:w).map(({flag:e})=>e.slice(2).replace(/-([a-z])/gu,(m,v)=>v.toUpperCase())),i=new Set([...s.flatMap(e=>[e.target,...e.keys]),...n]),l=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor"];for(let e of["author","message","force","fullChangedFields","idOnly",...l])i.add(e);let S=new Set(["action","options","path","cwd","author","force","noExtensions","no_extensions","fullChangedFields","idOnly",...l,...d,...t==="update"?["id"]:[]]);for(let e of Object.keys(o))S.has(e)||b(t,e,i,i.has(e));let u=o.options;if(u!==void 0&&!N(u))throw new f("Mutation options must be an object. No changes were made.",2,{code:"invalid_argument_value",changed:!1});let c=[...new Set([...Object.keys(u??{}),...Object.keys(r)])].filter(e=>!i.has(e));if(c.length===0)return;let p=T((await A(_(process.cwd(),a))).schema).command_to_fields.get(t)??[];for(let e of p)i.add(O(e));for(let e of c)p.some(m=>R({[e]:!0},m)===!0)||b(t,e,i)}export{j as assertNativeMutationOptions};
2
- //# sourceMappingURL=mutation-admission-L42E3U5U.js.map
1
+ import{b as E,g as N}from"./chunk-L5GX2FGZ.js";import"./chunk-JTCGDODH.js";import{N as y,Q as C}from"./chunk-Z26ZPQH6.js";import"./chunk-OASYSUOH.js";import"./chunk-4GN2ZPT5.js";import{Ca as h,Ia as w}from"./chunk-46WLWK73.js";import"./chunk-BZSACRVX.js";import{_a as A,g as R}from"./chunk-IQKLJFJE.js";import"./chunk-ML5JIUM6.js";import{l as T,m as O}from"./chunk-TUN4M757.js";import"./chunk-YLVHHWHN.js";import"./chunk-AK2CI2GI.js";import{a as g,wa as _}from"./chunk-6L4KKRK7.js";import{z as f}from"./chunk-7SZPZOIC.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="d19ff816-7570-5e8a-a4de-ad2ca48f0df0")}catch{}})();function b(t,o,r,a=!1){let d=[...r].map(n=>({candidate:n,distance:g(o,n,3)})).filter(n=>n.distance!==null).sort((n,i)=>n.distance-i.distance||n.candidate.localeCompare(i.candidate))[0]?.candidate,s=a?`Put mutation fields under options (options.${o}).`:d?`Did you mean "${d}"?`:"Use the declared command options or the field option for registered item fields.";throw new f(`Unknown ${t} ${a?"argument":"option"} "${o}". ${s} No changes were made.`,2,{code:"invalid_argument_value",reason:"unknown_mutation_option",changed:!1,field:o,required:s,nextSteps:[s]})}async function j(t,o,r,a,d){if(E(o))return;let s=t==="create"?y:C,n=(t==="create"?h:w).map(({flag:e})=>e.slice(2).replace(/-([a-z])/gu,(m,v)=>v.toUpperCase())),i=new Set([...s.flatMap(e=>[e.target,...e.keys]),...n]),l=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor"];for(let e of["author","message","force","fullChangedFields","idOnly",...l])i.add(e);let S=new Set(["action","options","path","cwd","author","force","noExtensions","no_extensions","fullChangedFields","idOnly",...l,...d,...t==="update"?["id"]:[]]);for(let e of Object.keys(o))S.has(e)||b(t,e,i,i.has(e));let u=o.options;if(u!==void 0&&!N(u))throw new f("Mutation options must be an object. No changes were made.",2,{code:"invalid_argument_value",changed:!1});let c=[...new Set([...Object.keys(u??{}),...Object.keys(r)])].filter(e=>!i.has(e));if(c.length===0)return;let p=T((await A(_(process.cwd(),a))).schema).command_to_fields.get(t)??[];for(let e of p)i.add(O(e));for(let e of c)p.some(m=>R({[e]:!0},m)===!0)||b(t,e,i)}export{j as assertNativeMutationOptions};
2
+ //# sourceMappingURL=mutation-admission-TM3SVU2O.js.map
@@ -1,7 +1,7 @@
1
- import{a as d}from"./chunk-VVRXF4JO.js";import{b as l}from"./chunk-FOA7XKWP.js";import{D as c,H as p,y as s,z as m}from"./chunk-KTXU5WU6.js";import{execFile as f}from"node:child_process";import{chmod as h,lstat as u}from"node:fs/promises";import{promisify as w}from"node:util";(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]="5b6eab08-f707-586f-bb05-484bd9160551")}catch{}})();var y=w(f),g=`#!/bin/sh
1
+ import{b as d}from"./chunk-EGN2HFRU.js";import{b as l}from"./chunk-FOA7XKWP.js";import{D as c,H as p,y as s,z as m}from"./chunk-7SZPZOIC.js";import{execFile as f}from"node:child_process";import{chmod as h,lstat as u}from"node:fs/promises";import{promisify as w}from"node:util";(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]="5b6eab08-f707-586f-bb05-484bd9160551")}catch{}})();var y=w(f),g=`#!/bin/sh
2
2
  # pm-cli:lossless-merge-settlement:v1
3
3
  `;async function I(e,t){let r=(await y("git",["rev-parse","--path-format=absolute","--git-path","hooks/pre-commit"],{cwd:e,env:l(),timeout:1e4})).stdout.trim(),o,i=!1;try{o=await d(r,65536)??"",i=process.platform==="win32"||((await u(r)).mode&73)!==0}catch(a){if(!c(a))throw a}if(o!==void 0&&!o.startsWith(g))throw new m("The pre-commit hook already exists and is not owned by pm; it was preserved.",s.CONFLICT,{code:"merge_settlement_hook_conflict",recovery:{suggested_retry:"pm merge install --dry-run"},nextSteps:["Integrate pm merge reconcile --stage into your existing hook after reviewing its policy, or keep manual settlement. pm never replaces an existing unowned hook."]});let n=`${g}merge_head=$(git rev-parse --git-path MERGE_HEAD) || exit 1
4
4
  [ -f "$merge_head" ] || exit 0
5
5
  exec ${t} merge reconcile --stage
6
6
  `;return{path:r,changed:o!==n||!i,content:n}}async function H(e){e.changed&&(await p(e.path,e.content),await h(e.path,493))}export{I as prepareMergeSettlementHook,H as writeMergeSettlementHook};
7
- //# sourceMappingURL=settlement-hook-3CADO4XZ.js.map
7
+ //# sourceMappingURL=settlement-hook-LBVWWSCF.js.map
@@ -1,2 +1,2 @@
1
- import{c as w,j as y}from"./chunk-226XKW3W.js";import{b as g}from"./chunk-BH7RE2ZY.js";import"./chunk-GHQVM6K6.js";import"./chunk-UHWTPOM4.js";import"./chunk-B266DDBJ.js";import"./chunk-YLVHHWHN.js";import{wa as h}from"./chunk-NLZUI234.js";import{b as u}from"./chunk-FOA7XKWP.js";import{y as d,z as f}from"./chunk-KTXU5WU6.js";import{execFile as _}from"node:child_process";import{realpath as b}from"node:fs/promises";import l from"node:path";import{promisify as x}from"node:util";(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]="7f4b2fc8-c9c6-51ff-a345-b76b8abdacf4")}catch{}})();var R=x(_);function c(e){return new f(`Automatic merge settlement refused: ${e}`,d.CONFLICT,{code:"merge_settlement_review_required",recovery:{suggested_retry:"pm merge reconcile --dry-run"},nextSteps:["Inspect receipts, repair streams and Git changes. Resolve competing values or unrelated drift explicitly, then run pm merge reconcile and stage the reviewed artifacts manually."]})}async function $(e){let t=process.env.GIT_INDEX_FILE;if(t===void 0)return;let a=(await e(["rev-parse","--path-format=absolute","--git-path","index"])).stdout.trim();if(l.resolve(t)!==l.resolve(a))throw c("an alternate Git index requires explicit manual settlement")}async function I(e,t){if(t.length===0)return[];let a=t.map(s=>`:(literal)${s}`),o=new Set((await e(["ls-files","--cached","-z","--",...a])).stdout.split("\0")),i=t.filter(s=>!o.has(s)).map(s=>`:(literal)${s}`);if(i.length>0&&(await e(["diff","--cached","--name-only","--diff-filter=D","-z","--",...i])).stdout.length>0)throw c("a receipt has a staged deletion that requires explicit review");return i}async function G(e){let{git:t,preview:a,paths:o,newReceiptPathspecs:i}=e,s=!1;try{i.length>0&&(s=!0,await t(["add","--",...i]));let n=await e.apply();if(!n.ok||JSON.stringify(n.receipts.summaries)!==JSON.stringify(a.receipts.summaries)||n.repair.streams.some(p=>!a.repair.streams.some(m=>m.id===p.id)))throw c("reconciliation changed or did not finish; inspect the audit artifacts before staging");return o.length>0&&await t(["add","--",...o.map(p=>`:(literal)${p}`)]),{...n,staged_paths:o,guidance:["Lossless reconciliation artifacts are staged for the merge commit. Review git diff --cached before committing."]}}catch(n){throw s&&await t(["reset","--quiet","--",...i]),n}}function k(e){if(e.repair.totals.failed>0||e.receipts.missing_history_references_after>0||e.receipts.summaries.some(t=>t.conflict_fields.length>0)||e.repair.streams.some(t=>t.merge_receipt_proof?.trusted!==!0)||e.validation.checks.some(t=>t.name!=="history_drift"&&t.status!=="ok"))throw c("only fully authenticated receipt-backed repairs without discarded values can be staged")}async function S(e){try{return{...e,path:await b(h(process.cwd(),e.path))}}catch{throw c("the tracker root cannot be resolved")}}async function F(e){let{preview:t}=e;k(t);let{path:a}=await S(e.global),o=await w(a);if(o===null)throw c("a Git workspace is required");let i=r=>R("git",r,{cwd:o,env:u(),timeout:1e4});if(await $(i),(await i(["ls-files","--unmerged","-z"])).stdout.length>0)throw c("Git still has unresolved paths");let s=[...new Set([...[...new Set([...t.repair.streams.map(r=>r.id),...t.receipts.summaries.map(r=>r.item_id)])].map(r=>l.join(a,"history",`${r}.jsonl`)),...t.receipts.summaries.map(r=>l.join(a,"merge-receipts",`${r.receipt_id}.json`))])].map(r=>l.relative(o,r).replaceAll("\\","/"));if(s.some(g))throw c("reconciliation artifacts must belong to this Git workspace");let n=await y(o,s);if(n.length>0)throw new f(`Automatic merge settlement refused: required artifacts are ignored by Git: ${n.map(r=>`${r.path} (${r.source}:${r.line}: ${r.pattern})`).join(", ")}. Remove or narrow the owning ignore rules because merge receipts must travel with the commit.`,d.CONFLICT,{code:"merge_settlement_review_required",reason:"ignored_merge_artifacts",paths:n.map(r=>r.path),nextSteps:["Remove or narrow the named ignore rules, preserve receipt and history files, then retry pm merge reconcile --stage --dry-run before applying pm merge reconcile --stage. Do not force-add ignored proof as a substitute for fixing the shared policy."]});let p=s.map(r=>`:(literal)${r}`),m=t.receipts.summaries.map(r=>l.relative(o,l.join(a,"merge-receipts",`${r.receipt_id}.json`)).replaceAll("\\","/"));if(p.length>0)try{await i(["diff","--quiet","--",...p])}catch{throw c("reconciliation paths have unstaged edits or Git cannot verify their index state")}let v=await I(i,m);return e.dryRun?{...t,staged_paths:[]}:G({...e,git:i,paths:s,newReceiptPathspecs:v})}export{S as resolveMergeSettlementGlobal,F as stageLosslessMergeReconciliation};
2
- //# sourceMappingURL=stage-TUQHWU7N.js.map
1
+ import{c as w,j as y}from"./chunk-R3EA3SDW.js";import{b as g}from"./chunk-ON5WFDCG.js";import"./chunk-GHQVM6K6.js";import"./chunk-IQKLJFJE.js";import"./chunk-TUN4M757.js";import"./chunk-YLVHHWHN.js";import{wa as h}from"./chunk-6L4KKRK7.js";import{b as u}from"./chunk-FOA7XKWP.js";import{y as d,z as f}from"./chunk-7SZPZOIC.js";import{execFile as _}from"node:child_process";import{realpath as b}from"node:fs/promises";import l from"node:path";import{promisify as x}from"node:util";(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]="7f4b2fc8-c9c6-51ff-a345-b76b8abdacf4")}catch{}})();var R=x(_);function c(e){return new f(`Automatic merge settlement refused: ${e}`,d.CONFLICT,{code:"merge_settlement_review_required",recovery:{suggested_retry:"pm merge reconcile --dry-run"},nextSteps:["Inspect receipts, repair streams and Git changes. Resolve competing values or unrelated drift explicitly, then run pm merge reconcile and stage the reviewed artifacts manually."]})}async function $(e){let t=process.env.GIT_INDEX_FILE;if(t===void 0)return;let a=(await e(["rev-parse","--path-format=absolute","--git-path","index"])).stdout.trim();if(l.resolve(t)!==l.resolve(a))throw c("an alternate Git index requires explicit manual settlement")}async function I(e,t){if(t.length===0)return[];let a=t.map(s=>`:(literal)${s}`),o=new Set((await e(["ls-files","--cached","-z","--",...a])).stdout.split("\0")),i=t.filter(s=>!o.has(s)).map(s=>`:(literal)${s}`);if(i.length>0&&(await e(["diff","--cached","--name-only","--diff-filter=D","-z","--",...i])).stdout.length>0)throw c("a receipt has a staged deletion that requires explicit review");return i}async function G(e){let{git:t,preview:a,paths:o,newReceiptPathspecs:i}=e,s=!1;try{i.length>0&&(s=!0,await t(["add","--",...i]));let n=await e.apply();if(!n.ok||JSON.stringify(n.receipts.summaries)!==JSON.stringify(a.receipts.summaries)||n.repair.streams.some(p=>!a.repair.streams.some(m=>m.id===p.id)))throw c("reconciliation changed or did not finish; inspect the audit artifacts before staging");return o.length>0&&await t(["add","--",...o.map(p=>`:(literal)${p}`)]),{...n,staged_paths:o,guidance:["Lossless reconciliation artifacts are staged for the merge commit. Review git diff --cached before committing."]}}catch(n){throw s&&await t(["reset","--quiet","--",...i]),n}}function k(e){if(e.repair.totals.failed>0||e.receipts.missing_history_references_after>0||e.receipts.summaries.some(t=>t.conflict_fields.length>0)||e.repair.streams.some(t=>t.merge_receipt_proof?.trusted!==!0)||e.validation.checks.some(t=>t.name!=="history_drift"&&t.status!=="ok"))throw c("only fully authenticated receipt-backed repairs without discarded values can be staged")}async function S(e){try{return{...e,path:await b(h(process.cwd(),e.path))}}catch{throw c("the tracker root cannot be resolved")}}async function F(e){let{preview:t}=e;k(t);let{path:a}=await S(e.global),o=await w(a);if(o===null)throw c("a Git workspace is required");let i=r=>R("git",r,{cwd:o,env:u(),timeout:1e4});if(await $(i),(await i(["ls-files","--unmerged","-z"])).stdout.length>0)throw c("Git still has unresolved paths");let s=[...new Set([...[...new Set([...t.repair.streams.map(r=>r.id),...t.receipts.summaries.map(r=>r.item_id)])].map(r=>l.join(a,"history",`${r}.jsonl`)),...t.receipts.summaries.map(r=>l.join(a,"merge-receipts",`${r.receipt_id}.json`))])].map(r=>l.relative(o,r).replaceAll("\\","/"));if(s.some(g))throw c("reconciliation artifacts must belong to this Git workspace");let n=await y(o,s);if(n.length>0)throw new f(`Automatic merge settlement refused: required artifacts are ignored by Git: ${n.map(r=>`${r.path} (${r.source}:${r.line}: ${r.pattern})`).join(", ")}. Remove or narrow the owning ignore rules because merge receipts must travel with the commit.`,d.CONFLICT,{code:"merge_settlement_review_required",reason:"ignored_merge_artifacts",paths:n.map(r=>r.path),nextSteps:["Remove or narrow the named ignore rules, preserve receipt and history files, then retry pm merge reconcile --stage --dry-run before applying pm merge reconcile --stage. Do not force-add ignored proof as a substitute for fixing the shared policy."]});let p=s.map(r=>`:(literal)${r}`),m=t.receipts.summaries.map(r=>l.relative(o,l.join(a,"merge-receipts",`${r.receipt_id}.json`)).replaceAll("\\","/"));if(p.length>0)try{await i(["diff","--quiet","--",...p])}catch{throw c("reconciliation paths have unstaged edits or Git cannot verify their index state")}let v=await I(i,m);return e.dryRun?{...t,staged_paths:[]}:G({...e,git:i,paths:s,newReceiptPathspecs:v})}export{S as resolveMergeSettlementGlobal,F as stageLosslessMergeReconciliation};
2
+ //# sourceMappingURL=stage-7ZBRX2Q2.js.map