@unbrained/pm-cli 2026.11.11 → 2026.11.13

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 (187) hide show
  1. package/.agents/skills/pm-test-audit/SKILL.md +2 -1
  2. package/.agents/skills/pm-user/references/ECOSYSTEM_PLANNING.md +2 -1
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/AGENTS.md +2 -2
  5. package/CHANGELOG.md +30 -0
  6. package/CONTRIBUTING.md +1 -1
  7. package/README.md +1 -1
  8. package/dist/cli/register-mutation.js +2 -2
  9. package/dist/cli/register-operations.js +1 -1
  10. package/dist/cli-bundle/bundle-manifest.json +1 -1
  11. package/dist/cli-bundle/chunks/{chunk-DIWTFDU7.js → chunk-36E4L2R4.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-ZJDYBXMC.js → chunk-4WD4CHVH.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-QCTA2UFR.js → chunk-5LG5YZYF.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-DV7WBAKQ.js → chunk-6UXBWMEM.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-ZSL6U53K.js → chunk-CO7RWLCM.js} +2 -2
  16. package/dist/cli-bundle/chunks/chunk-COTC2QOR.js +6 -0
  17. package/dist/cli-bundle/chunks/{chunk-XJUYJXHZ.js → chunk-FAYX6C7H.js} +2 -2
  18. package/dist/cli-bundle/chunks/chunk-GIAJX2QJ.js +9 -0
  19. package/dist/cli-bundle/chunks/{chunk-EBAHNZJT.js → chunk-GWVP23RZ.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-GOLQYO6M.js → chunk-GXGMMIZN.js} +47 -43
  21. package/dist/cli-bundle/chunks/{chunk-PZI6CR24.js → chunk-HQINCDF6.js} +47 -47
  22. package/dist/cli-bundle/chunks/{chunk-JESMEJTD.js → chunk-IYDIPXBO.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-SPERPX27.js → chunk-L4F4ZHGR.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-4RHXGQMK.js → chunk-LKVFPQNY.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-Z4YEH7VQ.js → chunk-O6PBQMD7.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-NIOOJ3AG.js → chunk-O6T24Z3M.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-L3SA3354.js → chunk-OQCVU2SG.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-FM375BHH.js → chunk-PUU5DXSV.js} +2 -2
  29. package/dist/cli-bundle/chunks/chunk-QSSENTXG.js +20 -0
  30. package/dist/cli-bundle/chunks/chunk-TCYIGAQG.js +31 -0
  31. package/dist/cli-bundle/chunks/chunk-UFZQPKQS.js +124 -0
  32. package/dist/cli-bundle/chunks/{chunk-WEAF3OY4.js → chunk-URWNUZQZ.js} +2 -2
  33. package/dist/cli-bundle/chunks/{chunk-5N3JMGXU.js → chunk-UYARS5XF.js} +2 -2
  34. package/dist/cli-bundle/chunks/{item-revision-LNIHK36Q.js → item-revision-G5OVYGZ5.js} +2 -2
  35. package/dist/cli-bundle/chunks/item-transaction-I2X2P4TW.js +2 -0
  36. package/dist/cli-bundle/chunks/{mutation-admission-WZY22LVH.js → mutation-admission-SET4KY73.js} +2 -2
  37. package/dist/cli-bundle/chunks/{register-list-query-DYGPLVRL.js → register-list-query-JNJY2D3N.js} +2 -2
  38. package/dist/cli-bundle/chunks/register-mutation-WTHZHPOP.js +20 -0
  39. package/dist/cli-bundle/chunks/register-operations-EZP3EG6A.js +2 -0
  40. package/dist/cli-bundle/chunks/{register-setup-G66U2WFV.js → register-setup-THFZP23A.js} +2 -2
  41. package/dist/cli-bundle/chunks/{stage-VIDXGF3T.js → stage-JXJILTYE.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/chunk-2ZPGEGTB.js +2 -0
  43. package/dist/cli-bundle/focused-chunks/{chunk-NSOXVVQX.js → chunk-3MB47JLT.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/{chunk-M5FZTPFA.js → chunk-4LFE3FQL.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/chunk-5KTOMFLR.js +44 -0
  46. package/dist/cli-bundle/focused-chunks/{chunk-MK7UQEE5.js → chunk-5NTLNE54.js} +18 -18
  47. package/dist/cli-bundle/focused-chunks/{chunk-P6KYUJD4.js → chunk-ADBFVDTG.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-AXPRCCYM.js → chunk-CSKDIMQP.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/chunk-FNIX62V6.js +3 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-3A6XMQZJ.js → chunk-IYV3IPRF.js} +53 -53
  51. package/dist/cli-bundle/focused-chunks/chunk-J3LQQP3N.js +26 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-JYWVRXLD.js → chunk-JR75B6HU.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-NP5C2TQM.js → chunk-Q3OA5OAK.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/chunk-QGQJBQCH.js +2 -0
  55. package/dist/cli-bundle/focused-chunks/{chunk-VVGXPF4W.js → chunk-RIMNSVFA.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-GBW2EAAG.js → chunk-TVJ2PHAK.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/{chunk-3SH3L3DB.js → chunk-VGFKTSGY.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/chunk-VGJDKDKA.js +2 -0
  59. package/dist/cli-bundle/focused-chunks/chunk-VGUQ4V47.js +82 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-VTOTZ5UC.js +91 -0
  61. package/dist/cli-bundle/focused-chunks/{chunk-NMU3QFAU.js → chunk-WFVZ7GGR.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-3FN4ON2Z.js → chunk-ZJF6ZA7B.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/chunk-ZOGEQFGH.js +2 -0
  64. package/dist/cli-bundle/focused-chunks/{item-revision-B3BIG66B.js → item-revision-IF7E7BVY.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{item-transaction-4JDWOXNB.js → item-transaction-5TFWIOXI.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/{mutation-admission-577MXOGD.js → mutation-admission-KELM46JF.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/{stage-EKYWEU2Y.js → stage-UAKMQTCI.js} +2 -2
  68. package/dist/cli-bundle/main.js +2 -2
  69. package/dist/cli-bundle/sdk-authoring.js +1 -1
  70. package/dist/cli-bundle/sdk-contracts.js +2 -2
  71. package/dist/cli-bundle/sdk-core.js +1 -1
  72. package/dist/cli-bundle/sdk-governance.js +1 -1
  73. package/dist/cli-bundle/sdk-graph.js +1 -1
  74. package/dist/cli-bundle/sdk-merge.js +57 -57
  75. package/dist/cli-bundle/sdk-query.js +1 -1
  76. package/dist/cli-bundle/sdk-runtime.js +1 -1
  77. package/dist/cli-bundle/sdk-testing.js +1 -1
  78. package/dist/cli-bundle/sdk.js +12 -12
  79. package/dist/core/history/history-rewrite.js +1 -1
  80. package/dist/core/item/parse.d.ts +13 -1
  81. package/dist/core/item/parse.js +4 -4
  82. package/dist/core/schema/runtime-field-values.js +1 -1
  83. package/dist/core/shared/author.js +2 -2
  84. package/dist/core/shared/secret-rules.d.ts +8 -2
  85. package/dist/core/shared/secret-rules.js +3 -3
  86. package/dist/core/shared/url-credentials.d.ts +33 -5
  87. package/dist/core/shared/url-credentials.js +1 -1
  88. package/dist/core/store/item-store.js +1 -1
  89. package/dist/sdk/agent/command-recovery.js +1 -1
  90. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
  91. package/dist/sdk/cli-contracts/completeness.js +1 -1
  92. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  93. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  94. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  95. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  96. package/dist/sdk/completion/bash.js +1 -1
  97. package/dist/sdk/completion/fish.js +3 -1
  98. package/dist/sdk/completion/zsh.js +3 -1
  99. package/dist/sdk/docs.d.ts +14 -2
  100. package/dist/sdk/docs.js +1 -1
  101. package/dist/sdk/files.d.ts +14 -2
  102. package/dist/sdk/files.js +1 -1
  103. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  104. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  105. package/dist/sdk/governance/boundary-fixtures.d.ts +25 -0
  106. package/dist/sdk/governance/boundary-fixtures.js +1 -1
  107. package/dist/sdk/governance/defect-recurrence.d.ts +8 -1
  108. package/dist/sdk/governance/defect-recurrence.js +2 -2
  109. package/dist/sdk/guide-topics.js +1 -1
  110. package/dist/sdk/index.d.ts +1 -1
  111. package/dist/sdk/index.js +1 -1
  112. package/dist/sdk/lifecycle/claim.js +1 -1
  113. package/dist/sdk/lifecycle/create.js +1 -1
  114. package/dist/sdk/lifecycle/dependency-removal.js +2 -0
  115. package/dist/sdk/lifecycle/restore.js +1 -1
  116. package/dist/sdk/lifecycle/start-blockers.d.ts +9 -0
  117. package/dist/sdk/lifecycle/start-blockers.js +1 -1
  118. package/dist/sdk/lifecycle/update.d.ts +10 -4
  119. package/dist/sdk/lifecycle/update.js +2 -2
  120. package/dist/sdk/linked-artifacts.d.ts +73 -3
  121. package/dist/sdk/linked-artifacts.js +2 -2
  122. package/dist/sdk/ownership-source.js +1 -1
  123. package/dist/sdk/public-surface.json +1 -1
  124. package/dist/sdk/runtime/actions.js +1 -1
  125. package/dist/sdk/test/command-args.js +1 -1
  126. package/dist/sdk/test/execution.d.ts +15 -3
  127. package/dist/sdk/test/execution.js +2 -2
  128. package/docs/AGENT_GUIDE.md +2 -2
  129. package/docs/AGENT_UX_CONTRACTS.md +7 -1
  130. package/docs/BUILD_AND_RELEASE_ACCEPTANCE.md +1 -1
  131. package/docs/COMMANDS.md +16 -9
  132. package/docs/CORPUS_SHAPES.md +1 -1
  133. package/docs/DEFECT_RECURRENCE.md +20 -1
  134. package/docs/MUTATION_INTEGRITY.md +56 -6
  135. package/docs/ONBOARDING.md +1 -1
  136. package/docs/README.md +6 -6
  137. package/docs/SDK.md +30 -0
  138. package/docs/SDK_CONTEXT_INTEGRITY.md +2 -0
  139. package/docs/TESTING.md +1 -1
  140. package/docs/generated/FLAG_LEXICON_BUDGETS.md +6 -6
  141. package/marketplace.json +1 -1
  142. package/package.json +8 -1
  143. package/packages/pm-beads/package.json +1 -1
  144. package/packages/pm-calendar/package.json +1 -1
  145. package/packages/pm-command-kit/package.json +1 -1
  146. package/packages/pm-digital-twin/package.json +1 -1
  147. package/packages/pm-governance-audit/package.json +1 -1
  148. package/packages/pm-guide-shell/package.json +1 -1
  149. package/packages/pm-kanban/package.json +1 -1
  150. package/packages/pm-lifecycle-hooks/package.json +1 -1
  151. package/packages/pm-linked-test-adapters/package.json +1 -1
  152. package/packages/pm-search-advanced/package.json +1 -1
  153. package/packages/pm-templates/package.json +1 -1
  154. package/packages/pm-todos/package.json +1 -1
  155. package/packages/pm-vcs/package.json +1 -1
  156. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  157. package/plugins/pm-claude/package.json +1 -1
  158. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  159. package/plugins/pm-codex/package.json +1 -1
  160. package/plugins/pm-codex/plugin.json +1 -1
  161. package/runtime-dependencies.json +1 -1
  162. package/dist/cli-bundle/chunks/chunk-GZ52WAY2.js +0 -124
  163. package/dist/cli-bundle/chunks/chunk-JLQ7O6UV.js +0 -20
  164. package/dist/cli-bundle/chunks/chunk-SVVFJPNW.js +0 -9
  165. package/dist/cli-bundle/chunks/chunk-WWW5WHHJ.js +0 -31
  166. package/dist/cli-bundle/chunks/chunk-XN2BRWDD.js +0 -6
  167. package/dist/cli-bundle/chunks/item-transaction-TMUYPSMR.js +0 -2
  168. package/dist/cli-bundle/chunks/register-mutation-MP5JCBAJ.js +0 -20
  169. package/dist/cli-bundle/chunks/register-operations-QEASK3EF.js +0 -2
  170. package/dist/cli-bundle/focused-chunks/chunk-2ZS3I5ZP.js +0 -2
  171. package/dist/cli-bundle/focused-chunks/chunk-33EK522E.js +0 -26
  172. package/dist/cli-bundle/focused-chunks/chunk-6ICHSVEY.js +0 -2
  173. package/dist/cli-bundle/focused-chunks/chunk-6TJXTKZD.js +0 -44
  174. package/dist/cli-bundle/focused-chunks/chunk-DW5S67LO.js +0 -2
  175. package/dist/cli-bundle/focused-chunks/chunk-HIKZYZ26.js +0 -82
  176. package/dist/cli-bundle/focused-chunks/chunk-NY65XTX7.js +0 -91
  177. package/dist/cli-bundle/focused-chunks/chunk-UCUESVFW.js +0 -2
  178. package/dist/cli-bundle/focused-chunks/chunk-V27M5UQH.js +0 -3
  179. package/docs/CONTEXT_ALGORITHM_PORTFOLIO.md +0 -167
  180. package/docs/DEVELOPMENT_DEPENDENCY_SECURITY.md +0 -246
  181. package/docs/PR_REVIEW_LOOP.md +0 -96
  182. package/docs/RELEASE_LEDGER_RECONCILIATION.md +0 -148
  183. package/docs/RELEASE_RELIABILITY.md +0 -147
  184. package/docs/RELEASING.md +0 -805
  185. package/docs/performance/corpus-shape-comparison.json +0 -1
  186. package/docs/performance/latest-scale-report.json +0 -1
  187. package/docs/performance/scale-100k-report.json +0 -1
@@ -1,8 +1,8 @@
1
- import{b as K}from"./chunk-IDAYTYNN.js";import{Ab as V,qb as H,va as U,vb as P,xb as L}from"./chunk-HIKZYZ26.js";import{Sd as W,_ as G,fe as $,ra as B,xa as E}from"./chunk-MK7UQEE5.js";import{a as X,b as y,c as q}from"./chunk-FOA7XKWP.js";import{A as v,C as S,E as j,F,I as N,z as w}from"./chunk-G6ERMFJ5.js";import{access as le,readFile as A,realpath as _}from"node:fs/promises";import{constants as ue}from"node:fs";import{execFile as me}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]="6d1f8e03-97b4-5d83-b85c-e47f39c07d48")}catch{}})();var se="PM_SOURCE_CONTEXT_ACCESS",ce="PM_ALLOW_SOURCE_CONTEXT_WRITES";function z(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}}(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 k=de(me),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 _(e);if(/(?:^|[\\/])bun-node-[^\\/]+[\\/]bun(?:\.exe)?$/iu.test(i))return;let{stdout:t}=await k(e,["--version"],{encoding:"utf8",windowsHide:!0,timeout:1e4});return t.trim()===r?i:void 0}async function ye(){let e=G(import.meta.url,["../../.."]),r=process.execPath,i=!1,t=await _(process.execPath),o=process.versions.bun,n=(process.env.PATH??"").split(c.delimiter).filter(a=>c.isAbsolute(a)).map(a=>c.join(a,o===void 0?c.basename(process.execPath):process.platform==="win32"?"bun.exe":"bun")),s=o===void 0?n:[process.env.npm_execpath??"",...n,t].filter(a=>c.isAbsolute(a)&&/^(?:bun|bun\.exe)$/iu.test(c.basename(a)));for(let a of s)try{if(await le(a,ue.X_OK),o!==void 0){let d=await he(a,o);if(d!==void 0){r=d,i=!0;break}continue}if(a!==t&&await _(a)===t){r=a;break}}catch{}if(o!==void 0&&!i)throw new v("Cannot install Bun merge drivers without a durable executable matching the current Bun version.",w.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 we(e){let r=e.explicitPath?.trim(),i=e.environment.PM_SOURCE_WORKSPACE_ROOT?.trim(),t=e.environment.PM_SOURCE_PM_PATH?.trim(),o=z(e.environment),n=!!(i&&t),s=r===void 0&&n&&(e.dryRun||o.source_writes_allowed);if(r!==void 0){let a=E(e.cwd,r);return{pm_root:a,workspace_start:a,source_coordinates_available:n,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:n?E(e.cwd,".agents/pm"):E(e.cwd),workspace_start:e.cwd,source_coordinates_available:n,source_context_selected:!1,source_policy:o}}async function ee(e){try{let{stdout:r}=await k("git",["rev-parse","--show-toplevel"],{cwd:e,env:y(),encoding:"utf8",windowsHide:!0,timeout:1e4});return await _(r.trim())}catch{return null}}async function te(e){let r=await ee(e);if(r===null)throw new v("pm merge install requires a git repository (merge drivers are git configuration).",w.USAGE);return r}function I(e,r){return c.relative(e,r).split(c.sep).join("/")}function J(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(L(r).filter(o=>o.constraint==="exact").some(o=>o.version!==i))return!1;let t=await ee(e);if(t!==null&&t!==await _(r)){let o=await Promise.all([t,r].map(async n=>{let s=await k("git",["rev-parse","--path-format=absolute","--git-common-dir"],{cwd:n,env:y(),timeout:1e4});return _(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 n=c.dirname(c.dirname(o.value)),s=JSON.parse(await A(c.join(n,"package.json"),"utf8")),a=typeof s.bin=="string"?s.bin:s.bin?.pm;return await ve(n,i,s.version)?s.name==="@unbrained/pm-cli"&&a==="dist/cli.js":!1}catch{return!1}}function O(e,r){let i=e.length>0?`${J(e)}/`:"",t=[`${h(`${i}**/*.toon`)} merge=pm-item-toon`,`${h(`${i}**/*.md`)} merge=pm-item-markdown`];for(let o of r){let n=J(o);t.push(`${h(`${i}${n}/*.toon`)} merge=pm-item-toon`),t.push(`${h(`${i}${n}/*.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),n=t===-1?o:o===-1?t:Math.min(t,o);if(n===-1)break;let s=n===o,a=s?x:T,d=s?Q:pe,u=e.indexOf(d,n+a.length),m=u===-1?e.length:u+d.length;r.push({start:n,end:m,closed:u!==-1,lines:e.slice(n+a.length,u===-1?m:u).split(`
1
+ import{b as K}from"./chunk-IDAYTYNN.js";import{Ab as V,qb as H,va as U,vb as P,xb as L}from"./chunk-VGUQ4V47.js";import{Yd as W,_ as G,le as $,ra as B,xa as E}from"./chunk-5NTLNE54.js";import{a as X,b as y,c as q}from"./chunk-FOA7XKWP.js";import{A as v,C as S,E as j,F,I as N,z as w}from"./chunk-G6ERMFJ5.js";import{access as le,readFile as A,realpath as _}from"node:fs/promises";import{constants as ue}from"node:fs";import{execFile as me}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]="6d1f8e03-97b4-5d83-b85c-e47f39c07d48")}catch{}})();var se="PM_SOURCE_CONTEXT_ACCESS",ce="PM_ALLOW_SOURCE_CONTEXT_WRITES";function z(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}}(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 k=de(me),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 _(e);if(/(?:^|[\\/])bun-node-[^\\/]+[\\/]bun(?:\.exe)?$/iu.test(i))return;let{stdout:t}=await k(e,["--version"],{encoding:"utf8",windowsHide:!0,timeout:1e4});return t.trim()===r?i:void 0}async function ye(){let e=G(import.meta.url,["../../.."]),r=process.execPath,i=!1,t=await _(process.execPath),o=process.versions.bun,n=(process.env.PATH??"").split(c.delimiter).filter(a=>c.isAbsolute(a)).map(a=>c.join(a,o===void 0?c.basename(process.execPath):process.platform==="win32"?"bun.exe":"bun")),s=o===void 0?n:[process.env.npm_execpath??"",...n,t].filter(a=>c.isAbsolute(a)&&/^(?:bun|bun\.exe)$/iu.test(c.basename(a)));for(let a of s)try{if(await le(a,ue.X_OK),o!==void 0){let d=await he(a,o);if(d!==void 0){r=d,i=!0;break}continue}if(a!==t&&await _(a)===t){r=a;break}}catch{}if(o!==void 0&&!i)throw new v("Cannot install Bun merge drivers without a durable executable matching the current Bun version.",w.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 we(e){let r=e.explicitPath?.trim(),i=e.environment.PM_SOURCE_WORKSPACE_ROOT?.trim(),t=e.environment.PM_SOURCE_PM_PATH?.trim(),o=z(e.environment),n=!!(i&&t),s=r===void 0&&n&&(e.dryRun||o.source_writes_allowed);if(r!==void 0){let a=E(e.cwd,r);return{pm_root:a,workspace_start:a,source_coordinates_available:n,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:n?E(e.cwd,".agents/pm"):E(e.cwd),workspace_start:e.cwd,source_coordinates_available:n,source_context_selected:!1,source_policy:o}}async function ee(e){try{let{stdout:r}=await k("git",["rev-parse","--show-toplevel"],{cwd:e,env:y(),encoding:"utf8",windowsHide:!0,timeout:1e4});return await _(r.trim())}catch{return null}}async function te(e){let r=await ee(e);if(r===null)throw new v("pm merge install requires a git repository (merge drivers are git configuration).",w.USAGE);return r}function I(e,r){return c.relative(e,r).split(c.sep).join("/")}function J(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(L(r).filter(o=>o.constraint==="exact").some(o=>o.version!==i))return!1;let t=await ee(e);if(t!==null&&t!==await _(r)){let o=await Promise.all([t,r].map(async n=>{let s=await k("git",["rev-parse","--path-format=absolute","--git-common-dir"],{cwd:n,env:y(),timeout:1e4});return _(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 n=c.dirname(c.dirname(o.value)),s=JSON.parse(await A(c.join(n,"package.json"),"utf8")),a=typeof s.bin=="string"?s.bin:s.bin?.pm;return await ve(n,i,s.version)?s.name==="@unbrained/pm-cli"&&a==="dist/cli.js":!1}catch{return!1}}function O(e,r){let i=e.length>0?`${J(e)}/`:"",t=[`${h(`${i}**/*.toon`)} merge=pm-item-toon`,`${h(`${i}**/*.md`)} merge=pm-item-markdown`];for(let o of r){let n=J(o);t.push(`${h(`${i}${n}/*.toon`)} merge=pm-item-toon`),t.push(`${h(`${i}${n}/*.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),n=t===-1?o:o===-1?t:Math.min(t,o);if(n===-1)break;let s=n===o,a=s?x:T,d=s?Q:pe,u=e.indexOf(d,n+a.length),m=u===-1?e.length:u+d.length;r.push({start:n,end:m,closed:u!==-1,lines:e.slice(n+a.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(n=>t.has(n)||n.startsWith(o)&&/^[^/]+\/\*\.(?:toon|md)" merge=pm-item-(?:toon|markdown)$/u.test(n.slice(o.length)))}async function ne(e,r,i,t){let o=c.join(e,".gitattributes"),n=t?null:(await k("git",["rev-parse","--absolute-git-dir"],{cwd:e,env:y(),encoding:"utf8",windowsHide:!0,timeout:1e4})).stdout.trim(),s=n===null?null:await $(n,ge,120,"merge-fence",!1,!0,5e3);try{let a=await F(o)??"",d=[x,...i,Q].join(`
3
3
  `),u=re(a),m=u.filter(p=>ie(p.lines,i,r));m.length===0&&r===".agents/pm"&&u.length===1&&u[0].lines.every(p=>!p.includes("/"))&&m.push(u[0]);let l;if(m.length>0){let p=m[0];l=a;for(let b of m.slice(1).reverse())l=`${l.slice(0,b.start)}${l.slice(b.end)}`;l=`${l.slice(0,p.start)}${d}${l.slice(p.end)}`}else{let p=a.trimEnd();l=`${p.length>0?`${p}
4
4
 
5
5
  `:""}${d}
6
6
  `}return l===a?{path:o,changed:!1}:(t||await N(o,l),{path:o,changed:!0})}finally{await s?.()}}function oe(e){let r=B(e,null);return[...new Set(Object.values(r.type_to_folder))].sort((i,t)=>i.localeCompare(t))}async function qe(e,r){let i=c.resolve(e),t=null,o="",n=i;for(let g=0;g<8;g+=1){let ae=c.join(n,".gitattributes");try{let C=await A(ae,"utf8");if(C.includes(x)||C.includes(T)){t=n,o=C;break}}catch{}let D=c.dirname(n);if(D===n)break;n=D}if(t===null)return{status:"not_installed",missing_patterns:[],stale_patterns:[],schema_scope:"project"};let s=c.join(t,".gitattributes"),a=I(t,i),d=re(o),u=O(a,r),m=d.filter(g=>ie(g.lines,u,a)),l=m.flatMap(g=>g.closed?g.lines:[]),p=new Set(l),b=new Set(u),f=u.filter(g=>!p.has(g)),M=l.filter(g=>!b.has(g));return{status:m.length!==1||!m[0].closed||f.length>0||M.length>0?"drift":"ok",path:s,missing_patterns:f,stale_patterns:M,schema_scope:"project"}}async function ze(e){let r=[],i=[];for(let t of Z){let o=`merge.${t.key}.driver`,n=` merge driver ${t.artifact} "%O" "%A" "%B"${t.itemPath===void 0?"":` --item-path ${t.itemPath}`}`;try{let{stdout:s}=await k("git",["config","--get",o],{cwd:e,env:y(),encoding:"utf8",windowsHide:!0,timeout:1e4}),a=s.trim();await _e(a,n,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 Je(e){let r;try{r=await te(c.resolve(e))}catch{return{status:"no_git"}}let i=I(r,c.resolve(e)),t=await P(e),o=U(void 0,t.author_default),n=await $(e,fe,t.locks.ttl_seconds,o,!1,H(t).force_required_for_stale_lock,t.locks.wait_ms);try{let s=c.join(r,".gitattributes"),a;try{a=await A(s,"utf8")}catch(l){if(l instanceof Error&&"code"in l&&j(l))return{status:"not_installed",path:s};throw l}if(!a.includes(x)&&!a.includes(T))return{status:"not_installed",path:s};let d=await P(e),u=oe(d),m=await ne(r,i,O(i,u),!1);return{status:m.changed?"refreshed":"unchanged",path:m.path}}finally{await n()}}async function Ye(e,r){let i=we({cwd:process.cwd(),explicitPath:r.path,dryRun:e.dryRun===!0,environment:process.env}),t=i.pm_root;await V(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 k("git",["rev-parse","--path-format=absolute","--git-common-dir"],{cwd:e,env:y(),timeout:1e4})).stdout.trim(),t=await $(i,"merge-driver-config",120,"merge-install",!1,!0,5e3);try{let o=await q(e),n;try{n=(await k("git",["config",o,"--null","--get-regexp","."],{cwd:e,env:y(),timeout:1e4})).stdout}catch(a){if(typeof a!="object"||a===null||!("code"in a)||a.code!==1)throw a;n=""}let s=new Map(n.split("\0").filter(Boolean).map(a=>{let d=a.indexOf(`
7
7
  `);return[a.slice(0,d),a.slice(d+1)]}));for(let a of r)s.get(a.key)!==a.value&&await X(e,[o,a.key,a.value])}finally{await t()}}async function ke(e){let r=c.resolve(e.pmRoot),i=c.resolve(e.workspaceRoot),t=e.dryRun===!0,o,n;try{[o,n]=await Promise.all([_(r),_(i)])}catch(f){throw new v(`Cannot resolve tracker root ${r} or workspace root ${i}: ${String(f)}`,w.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=I(n,o);if(K(s))throw new v(`Tracker root ${r} is outside the git repository ${i}; there is nothing to configure for this repository.`,w.USAGE);let a=await P(o),d=oe(a),u=O(s,d),m=[],l=await ye(),p=e.preCommitHook===!0?await import("./settlement-hook-H56537UV.js").then(async f=>({plan:await f.prepareMergeSettlementHook(n,`${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(n,m)}catch{throw new v(`Cannot install repository-local merge drivers in ${n}. Ensure the repository Git config is writable and no other Git process holds its lock, then retry.`,w.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 b=await ne(n,s,u,t);return p!==void 0&&!t&&await p.write(p.plan),{ok:!0,dry_run:t,workspace_root:n,pm_root:o,gitattributes:{path:b.path,changed:b.changed,patterns:u,schema_scope:"project"},git_config:m,...p===void 0?{}:{settlement_hook:{path:p.plan.path,changed:p.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:W()}}import{execFile as xe}from"node:child_process";import{promisify as Ee}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]="e57ef62f-fd40-5a33-9816-e24d8dba4d1d")}catch{}})();var $e=Ee(xe);async function nt(e,r){if(r.length===0)return[];let i;try{let n=$e("git",["check-ignore","--verbose","-z","--stdin"],{cwd:e,env:y(),timeout:1e4}),s=n.child.stdin;s!==null&&(s.on("error",()=>{n.child.kill()}),s.end(`${r.join("\0")}\0`)),{stdout:i}=await n}catch(n){if(typeof n=="object"&&n!==null&&"code"in n&&n.code===1)return[];throw new v("Git could not verify ignore rules for merge artifacts; no automatic settlement is safe until that check succeeds.",w.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 t=i.split("\0"),o=[];for(let n=0;n+3<t.length;n+=4){let[s,a,d,u]=t.slice(n,n+4);d.startsWith("!")||o.push({path:u,source:s,line:Number(a),pattern:d})}return o}export{se as a,ce as b,ee as c,oe as d,qe as e,ze as f,Je as g,Ye as h,ke as i,nt as j};
8
- //# sourceMappingURL=chunk-GBW2EAAG.js.map
8
+ //# sourceMappingURL=chunk-TVJ2PHAK.js.map
@@ -1,6 +1,6 @@
1
- import{c as T}from"./chunk-33EK522E.js";import{a,d as I}from"./chunk-HIKZYZ26.js";import{Z as w,j as g,k as v,l as E}from"./chunk-MK7UQEE5.js";import{A as u,C as m,m as k,z as f}from"./chunk-G6ERMFJ5.js";import C from"node:fs/promises";import p 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]="74b72dd8-0877-55a4-9c80-d043f19e1f96")}catch{}})();var P=["extensions","docs","examples","assets","prompts"],U=Object.freeze({extensions:Object.freeze([".agents/pm/extensions","extensions",".custom/pm-extensions",".custom/pm-extension"]),docs:Object.freeze(["docs","documentation"]),examples:Object.freeze(["examples","docs/examples"]),assets:Object.freeze(["assets",".agents/pm/assets"]),prompts:Object.freeze(["prompts",".agents/pm/prompts"])});function R(e){return P.includes(e)}function q(e,t){if(t==null)return[];let n=Array.isArray(t)?t:[t],r=[];for(let o of n){if(typeof o!="string"||o.trim().length===0)throw new u(`Package manifest field pm.${e} must contain string paths.`,f.USAGE);r.push(o.trim())}return[...new Set(r)].sort((o,i)=>o.localeCompare(i))}function G(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new u("Package manifest field pm must be an object.",f.USAGE);let t={},n=e;for(let[r,o]of Object.entries(n)){if(!R(r))continue;let i=q(r,o);i.length>0&&(t[r]=i)}return t}function c(e,t){let n=e[t];return typeof n=="string"&&n.trim().length>0?n.trim():void 0}function S(e){if(!Array.isArray(e))return;let t=e.map(n=>typeof n=="string"?n.trim():"").filter(n=>n.length>0);return t.length>0?[...new Set(t)].sort((n,r)=>n.localeCompare(r)):void 0}function x(e){if(typeof e=="string"&&e.trim().length>0)return e.trim();if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let t=e.url;return typeof t=="string"&&t.trim().length>0?t.trim():void 0}}function J(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={docs:c(t,"docs"),npm:c(t,"npm"),repository:c(t,"repository"),report:c(t,"report")};return Object.values(n).some(r=>typeof r=="string")?n:void 0}function K(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={image:c(t,"image"),video:c(t,"video")};return Object.values(n).some(r=>typeof r=="string")?n:void 0}function V(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={display_name:c(t,"display_name")??c(t,"displayName"),category:c(t,"category"),summary:c(t,"summary"),links:J(t.links),media:K(t.media),tags:S(t.tags)};return Object.values(n).some(r=>r!==void 0)?n:void 0}async function Y(e){let t=p.join(e,"package.json");if(!await m(t))return{source:"convention",resources:{}};let n;try{n=JSON.parse(await C.readFile(t,"utf8"))}catch(l){throw new u(`Failed to parse package manifest at "${t}": ${String(l)}`,f.USAGE)}if(typeof n!="object"||n===null||Array.isArray(n))throw new u(`Package manifest at "${t}" must be a JSON object.`,f.USAGE);let r=n,o=r.pm,i=o!=null,s=typeof o=="object"&&o!==null&&!Array.isArray(o)?o:{};return{source:i?"pm":"convention",package_json_path:t,package_name:typeof r.name=="string"?r.name:void 0,package_version:typeof r.version=="string"?r.version:void 0,package_private:r.private===!0,package_description:typeof r.description=="string"?r.description:void 0,package_keywords:S(r.keywords),package_homepage:typeof r.homepage=="string"?r.homepage:void 0,package_repository_url:x(r.repository),package_bugs_url:x(r.bugs),aliases:S(s.aliases),resources:G(o),catalog:V(s.catalog)}}async function j(e){if(!await m(e))return[];let t=await C.readdir(e,{withFileTypes:!0}),n=[];for(let r of t){if(!r.isDirectory())continue;let o=p.join(e,r.name);await m(p.join(o,"manifest.json"))&&n.push(o)}return n.sort((r,o)=>r.localeCompare(o))}async function he(e){if(await m(p.join(e,"manifest.json")))return[e];let t=(await Y(e)).resources.extensions??[],n=new Set;for(let r of t){if(r.includes("*")||r.startsWith("!"))throw new u(`Package extension entry "${r}" uses a glob/exclusion pattern. pm package installs currently require concrete extension paths or directories.`,f.USAGE);let o=p.resolve(e,r);if(!w(e,o))throw new u(`Package extension entry "${r}" resolves outside package root.`,f.USAGE);if(await m(p.join(o,"manifest.json"))){n.add(o);continue}for(let i of await j(o))n.add(i)}if(t.length===0)for(let r of U.extensions)for(let o of await j(p.join(e,r)))n.add(o);return[...n].sort((r,o)=>r.localeCompare(o))}(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]="3984f1ef-1703-5a83-a4fa-ec1cdc738572")}catch{}})();var D=[["commands","Commands"],["command_overrides","Command overrides"],["flag_commands","Flag commands"],["item_types","Item types"],["item_fields","Item fields"],["migrations","Migrations"],["profiles","Profiles"],["importers","Importers"],["exporters","Exporters"],["search_providers","Search providers"],["vector_store_adapters","Vector store adapters"],["assurance_providers","Assurance measurement providers"],["hooks","Lifecycle hooks"],["parser_overrides","Parser overrides"],["service_overrides","Service overrides"],["renderer_overrides","Renderer overrides"]];function A(e){return"#".repeat(e)}function $(e){if(!e.includes("`"))return`\`${e}\``;let t=0,n=0;for(let i of e)n=i==="`"?n+1:0,t=Math.max(t,n);let r="`".repeat(t+1),o=e.startsWith("`")||e.endsWith("`")?" ":"";return`${r}${o}${e}${o}${r}`}function B(e){return e.length===0?"Capabilities: _none registered_":`Capabilities: ${e.map($).join(", ")}`}function W(e,t,n){let r=[`${A(t)} ${e}`,""];return n.length===0?(r.push("_None._",""),r):(r.push(...n.map(o=>`- ${$(o)}`),""),r)}function H(e,t,n){return e===0&&!n?[]:[`${A(t)} Preflight overrides`,"",e>0?`- ${e} registered (this surface carries no per-entry identifier)`:"_None._",""]}function be(e,t={}){let n=t.headingLevel??2;if(!Number.isInteger(n)||n<1||n>6)throw new RangeError(`headingLevel must be an integer in [1, 6], received ${String(t.headingLevel)}`);let r=Math.min(n+1,6),o=t.includeEmpty===!0,i=t.title??"Extension surfaces",s=[`${A(n)} ${i}`,""];(o||e.capabilities.length>0)&&s.push(B(e.capabilities),"");for(let[l,d]of D){let y=e[l]??[];y.length===0&&!o||s.push(...W(d,r,y))}return s.push(...H(e.preflight_overrides,r,o)),!(e.preflight_overrides>0||D.some(([l])=>(e[l]?.length??0)>0))&&!o&&s.push("_This extension registers no surfaces._",""),`${s.join(`
1
+ import{c as T}from"./chunk-J3LQQP3N.js";import{a,d as I}from"./chunk-VGUQ4V47.js";import{Z as w,j as g,k as v,l as E}from"./chunk-5NTLNE54.js";import{A as u,C as m,m as k,z as f}from"./chunk-G6ERMFJ5.js";import C from"node:fs/promises";import p 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]="74b72dd8-0877-55a4-9c80-d043f19e1f96")}catch{}})();var P=["extensions","docs","examples","assets","prompts"],U=Object.freeze({extensions:Object.freeze([".agents/pm/extensions","extensions",".custom/pm-extensions",".custom/pm-extension"]),docs:Object.freeze(["docs","documentation"]),examples:Object.freeze(["examples","docs/examples"]),assets:Object.freeze(["assets",".agents/pm/assets"]),prompts:Object.freeze(["prompts",".agents/pm/prompts"])});function R(e){return P.includes(e)}function q(e,t){if(t==null)return[];let n=Array.isArray(t)?t:[t],r=[];for(let o of n){if(typeof o!="string"||o.trim().length===0)throw new u(`Package manifest field pm.${e} must contain string paths.`,f.USAGE);r.push(o.trim())}return[...new Set(r)].sort((o,i)=>o.localeCompare(i))}function G(e){if(e==null)return{};if(typeof e!="object"||Array.isArray(e))throw new u("Package manifest field pm must be an object.",f.USAGE);let t={},n=e;for(let[r,o]of Object.entries(n)){if(!R(r))continue;let i=q(r,o);i.length>0&&(t[r]=i)}return t}function c(e,t){let n=e[t];return typeof n=="string"&&n.trim().length>0?n.trim():void 0}function S(e){if(!Array.isArray(e))return;let t=e.map(n=>typeof n=="string"?n.trim():"").filter(n=>n.length>0);return t.length>0?[...new Set(t)].sort((n,r)=>n.localeCompare(r)):void 0}function x(e){if(typeof e=="string"&&e.trim().length>0)return e.trim();if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let t=e.url;return typeof t=="string"&&t.trim().length>0?t.trim():void 0}}function J(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={docs:c(t,"docs"),npm:c(t,"npm"),repository:c(t,"repository"),report:c(t,"report")};return Object.values(n).some(r=>typeof r=="string")?n:void 0}function K(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={image:c(t,"image"),video:c(t,"video")};return Object.values(n).some(r=>typeof r=="string")?n:void 0}function V(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e,n={display_name:c(t,"display_name")??c(t,"displayName"),category:c(t,"category"),summary:c(t,"summary"),links:J(t.links),media:K(t.media),tags:S(t.tags)};return Object.values(n).some(r=>r!==void 0)?n:void 0}async function Y(e){let t=p.join(e,"package.json");if(!await m(t))return{source:"convention",resources:{}};let n;try{n=JSON.parse(await C.readFile(t,"utf8"))}catch(l){throw new u(`Failed to parse package manifest at "${t}": ${String(l)}`,f.USAGE)}if(typeof n!="object"||n===null||Array.isArray(n))throw new u(`Package manifest at "${t}" must be a JSON object.`,f.USAGE);let r=n,o=r.pm,i=o!=null,s=typeof o=="object"&&o!==null&&!Array.isArray(o)?o:{};return{source:i?"pm":"convention",package_json_path:t,package_name:typeof r.name=="string"?r.name:void 0,package_version:typeof r.version=="string"?r.version:void 0,package_private:r.private===!0,package_description:typeof r.description=="string"?r.description:void 0,package_keywords:S(r.keywords),package_homepage:typeof r.homepage=="string"?r.homepage:void 0,package_repository_url:x(r.repository),package_bugs_url:x(r.bugs),aliases:S(s.aliases),resources:G(o),catalog:V(s.catalog)}}async function j(e){if(!await m(e))return[];let t=await C.readdir(e,{withFileTypes:!0}),n=[];for(let r of t){if(!r.isDirectory())continue;let o=p.join(e,r.name);await m(p.join(o,"manifest.json"))&&n.push(o)}return n.sort((r,o)=>r.localeCompare(o))}async function he(e){if(await m(p.join(e,"manifest.json")))return[e];let t=(await Y(e)).resources.extensions??[],n=new Set;for(let r of t){if(r.includes("*")||r.startsWith("!"))throw new u(`Package extension entry "${r}" uses a glob/exclusion pattern. pm package installs currently require concrete extension paths or directories.`,f.USAGE);let o=p.resolve(e,r);if(!w(e,o))throw new u(`Package extension entry "${r}" resolves outside package root.`,f.USAGE);if(await m(p.join(o,"manifest.json"))){n.add(o);continue}for(let i of await j(o))n.add(i)}if(t.length===0)for(let r of U.extensions)for(let o of await j(p.join(e,r)))n.add(o);return[...n].sort((r,o)=>r.localeCompare(o))}(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]="3984f1ef-1703-5a83-a4fa-ec1cdc738572")}catch{}})();var D=[["commands","Commands"],["command_overrides","Command overrides"],["flag_commands","Flag commands"],["item_types","Item types"],["item_fields","Item fields"],["migrations","Migrations"],["profiles","Profiles"],["importers","Importers"],["exporters","Exporters"],["search_providers","Search providers"],["vector_store_adapters","Vector store adapters"],["assurance_providers","Assurance measurement providers"],["hooks","Lifecycle hooks"],["parser_overrides","Parser overrides"],["service_overrides","Service overrides"],["renderer_overrides","Renderer overrides"]];function A(e){return"#".repeat(e)}function $(e){if(!e.includes("`"))return`\`${e}\``;let t=0,n=0;for(let i of e)n=i==="`"?n+1:0,t=Math.max(t,n);let r="`".repeat(t+1),o=e.startsWith("`")||e.endsWith("`")?" ":"";return`${r}${o}${e}${o}${r}`}function B(e){return e.length===0?"Capabilities: _none registered_":`Capabilities: ${e.map($).join(", ")}`}function W(e,t,n){let r=[`${A(t)} ${e}`,""];return n.length===0?(r.push("_None._",""),r):(r.push(...n.map(o=>`- ${$(o)}`),""),r)}function H(e,t,n){return e===0&&!n?[]:[`${A(t)} Preflight overrides`,"",e>0?`- ${e} registered (this surface carries no per-entry identifier)`:"_None._",""]}function be(e,t={}){let n=t.headingLevel??2;if(!Number.isInteger(n)||n<1||n>6)throw new RangeError(`headingLevel must be an integer in [1, 6], received ${String(t.headingLevel)}`);let r=Math.min(n+1,6),o=t.includeEmpty===!0,i=t.title??"Extension surfaces",s=[`${A(n)} ${i}`,""];(o||e.capabilities.length>0)&&s.push(B(e.capabilities),"");for(let[l,d]of D){let y=e[l]??[];y.length===0&&!o||s.push(...W(d,r,y))}return s.push(...H(e.preflight_overrides,r,o)),!(e.preflight_overrides>0||D.some(([l])=>(e[l]?.length??0)>0))&&!o&&s.push("_This extension registers no surfaces._",""),`${s.join(`
2
2
  `).trimEnd()}
3
3
  `}(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]="abb182c9-6d6c-5be4-a2ad-c91b00a098d0")}catch{}})();var X=["agile","ops","research"],Q={agile:[{name:"Story",description:"User-facing outcome or capability slice expressed from a stakeholder perspective.",defaultStatus:"open",folder:"stories",aliases:["user-story"]},{name:"Spike",description:"Time-boxed investigation used to reduce uncertainty before implementation.",defaultStatus:"open",folder:"spikes",aliases:["research-spike"]}],ops:[{name:"Incident",description:"Operational disruption, degradation, or support escalation with recovery tracking.",defaultStatus:"open",folder:"incidents",aliases:["outage"]},{name:"Runbook",description:"Repeatable operational procedure, diagnostic path, or response playbook.",defaultStatus:"open",folder:"runbooks",aliases:["playbook"]}],research:[{name:"Experiment",description:"Validated-learning activity with hypothesis, method, and outcome tracking.",defaultStatus:"open",folder:"experiments",aliases:["study"]},{name:"Hypothesis",description:"Testable claim or assumption that should be supported, rejected, or refined.",defaultStatus:"open",folder:"hypotheses",aliases:["assumption"]}]};function Se(e){if(e===void 0)return;let t=e.trim().toLowerCase().replaceAll("-","_");if(t.length===0)throw new Error("Type preset name must not be empty.");if(t==="agile"||t==="ops"||t==="research")return t;throw new Error(`Invalid type preset "${e}". Allowed: ${X.join(", ")}.`)}function Ae(e){return Q[e].map(t=>T(t))}(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]="1abceae0-299e-5fff-aa8c-46c015115571")}catch{}})();var Z=new Set(v),ee=new Set(E),F=new Set([...k.filter(e=>e!=="severity"),"id","title","type","status","priority","tags","assignee","parent","description","body","created_at","updated_at","closed_at","completed_at","author","deadline","estimate","sprint","release","risk","confidence","reviewer","resolution","expected","actual"]),te=["create","update"];function z(e){if(typeof e!="string")return"";let t=e.trim().toLowerCase().replaceAll(/[\s_]+/g,"-");return t.startsWith("--")?t.slice(2):t}function N(e){return e.replaceAll("_","-")}function re(e,t){let n=new Set;for(let r of e){let o=z(r);o.length>0&&o!==t&&n.add(o)}return[...n].sort((r,o)=>r.localeCompare(o))}function ne(e){let t=new Set;for(let n of e??[]){let r=n.trim();r.length>0&&t.add(r)}return[...t].sort((n,r)=>n.localeCompare(r))}function oe(e){let t=new Set,n=[];for(let r of e??[]){let o=r.trim().toLowerCase();if(o.length!==0){if(!ee.has(o))throw new Error(`Invalid field command "${r}". Allowed: ${E.join(", ")}.`);t.has(o)||(t.add(o),n.push(o))}}return e===void 0||n.length===0?[...te]:n}function je(e){let t=a(e.key);if(t.length===0)throw new Error("Field key must not be empty.");if(t.includes(","))throw new Error(`Field key "${t}" must not contain commas: commas separate field names in list flags such as --unset and --fields.`);if(F.has(t))throw new Error(`Cannot define custom field "${t}": custom schema field "${t}" collides with built-in item metadata "${t}". Rename the custom field with a project-specific prefix. Reserved fields: ${[...F].sort((b,M)=>b.localeCompare(M)).join(", ")}.`);let n=typeof e.type=="string"&&e.type.trim().length>0?e.type.trim().toLowerCase():"string";if(!Z.has(n))throw new Error(`Invalid field type "${e.type}". Allowed: ${v.join(", ")}.`);let r=n,o=oe(e.commands),i=z(e.cliFlag),s=i.length>0&&i!==N(t)?i:void 0,l=s??N(t),d=re(e.aliases??[],l),y=[l,...d].find(b=>b.includes(","));if(y!==void 0)throw new Error(`Field flag "${y}" must not contain commas.`);let _=e.description?.trim();return{key:t,type:r,commands:o,description:_&&_.length>0?_:void 0,cliFlag:s,cliAliases:d,required:e.required===!0,requiredOnCreate:e.requiredOnCreate===!0,allowUnset:e.allowUnset!==!1,requiredTypes:ne(e.requiredTypes)}}function ie(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.fields))return t.fields;if(Array.isArray(t.definitions))return t.definitions}function se(e){let t=ie(e);if(!t)return[];let n=[];for(let r of t){if(typeof r!="object"||r===null||Array.isArray(r))continue;let o=r;typeof o.key!="string"||o.key.trim().length===0||n.push(o)}return n}function Ce(e){if(e==null||e.trim().length===0)return{fields:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/fields.json contains invalid JSON.")}return{fields:se(t)}}function De(e){return`${JSON.stringify({fields:e.fields},null,2)}
4
4
  `}function $e(e,t){let n=e.fields.find(s=>a(s.key)===t.key),r=n!==void 0,o=e.fields.filter(s=>a(s.key)!==t.key),i={...n,key:t.key,type:t.type,commands:[...t.commands]};return O(i,"description",t.description),O(i,"cli_flag",t.cliFlag),t.cliAliases.length>0?i.cli_aliases=[...t.cliAliases]:delete i.cli_aliases,L(i,"required",t.required),L(i,"required_on_create",t.requiredOnCreate),t.allowUnset===!1?i.allow_unset=!1:delete i.allow_unset,t.requiredTypes.length>0?i.required_types=[...t.requiredTypes]:delete i.required_types,o.push(i),o.sort((s,l)=>a(s.key).localeCompare(a(l.key))),{file:{fields:o},definition:i,replaced:r}}function Fe(e,t){let n=a(t);if(n.length===0)throw new Error("Field key must not be empty.");let r=[],o=e.fields.filter(i=>a(i.key)===n?(r.push(i),!1):!0);return r.length===0?{file:{fields:o},removed:!1}:{file:{fields:o},removed:!0,definition:r[0]}}function O(e,t,n){let r=e;n!==void 0&&n.length>0?r[t]=n:delete r[t]}function L(e,t,n){let r=e;n?r[t]=!0:delete r[t]}(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]="b1e4c04e-0ade-5d24-95e3-b8dca3832c5a")}catch{}})();var ae=new Set(g),h=new Set(I.map(e=>a(e.id)).filter(e=>e.length>0));function le(e){let t=new Set;for(let n of e){let r=a(n);r.length>0&&t.add(r)}return[...t].sort((n,r)=>n.localeCompare(r))}function Pe(e){let t=a(e.id);if(t.length===0)throw new Error("Status id must not be empty.");if(h.has(t))throw new Error(`Cannot add-status the built-in status "${t}". Built-in statuses are reserved: ${[...h].join(", ")}.`);let n;if(e.roles!==void 0){n=[];let s=new Set;for(let l of e.roles){let d=typeof l=="string"?l.trim().toLowerCase():"";if(d.length!==0){if(!ae.has(d))throw new Error(`Invalid status role "${l}". Allowed roles: ${g.join(", ")}.`);s.has(d)||(s.add(d),n.push(d))}}if(n.length===0)throw new Error(`Status role must include at least one lifecycle role. Allowed roles: ${g.join(", ")}.`)}let r=e.aliases===void 0?void 0:le(e.aliases).filter(s=>s!==t),o=e.description?.trim(),i=typeof e.order=="number"&&Number.isFinite(e.order)?Math.trunc(e.order):void 0;return{id:t,roles:n,aliases:r,description:o&&o.length>0?o:void 0,order:i}}function de(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.statuses))return t.statuses;if(Array.isArray(t.definitions))return t.definitions}function ce(e){let t=de(e);if(!t)return[];let n=[];for(let r of t){if(typeof r!="object"||r===null||Array.isArray(r))continue;let o=r;typeof o.id!="string"||o.id.trim().length===0||n.push(o)}return n}function Ue(e){if(e==null||e.trim().length===0)return{statuses:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/statuses.json contains invalid JSON.")}return{statuses:ce(t)}}function Re(e){return`${JSON.stringify({statuses:e.statuses},null,2)}
5
5
  `}function qe(e,t,n){let r=e.statuses.slice(),o=r.findIndex(l=>a(l.id)===t.id),i=o>=0?r[o]:n,s={...i,id:t.id};return t.roles!==void 0&&(t.roles.length>0?s.roles=[...t.roles]:s.roles!==void 0&&delete s.roles),t.aliases!==void 0&&(t.aliases.length>0?s.aliases=[...t.aliases]:s.aliases!==void 0&&delete s.aliases),t.description!==void 0&&(s.description=t.description),t.order!==void 0&&(s.order=t.order),o>=0?r[o]=s:r.push(s),{file:{statuses:r},definition:s,replaced:i!==void 0}}function Ge(e,t){let n=a(t);if(n.length===0)throw new Error("Status id must not be empty.");if(h.has(n))throw new Error(`Cannot remove built-in status "${n}". Built-in statuses are reserved: ${[...h].join(", ")}.`);let r=e.statuses.slice(),o=r.findIndex(s=>a(s.id)===n);if(o<0)return{file:{statuses:r},removed:!1};let[i]=r.splice(o,1);return{file:{statuses:r},removed:!0,definition:i}}function Je(e,t){let n=[e.id,...e.aliases??[]];for(let r of n){let o=a(r);if(o.length===0)continue;let i=t.get(o);if(i!==void 0&&i!==e.id)throw new Error(`Status token "${o}" already belongs to status "${i}". Choose a different id/alias to avoid shadowing it.`)}}export{P as a,U as b,Y as c,he as d,X as e,Q as f,Se as g,Ae as h,je as i,Ce as j,De as k,$e as l,Fe as m,h as n,Pe as o,Ue as p,Re as q,qe as r,Ge as s,Je as t,be as u};
6
- //# sourceMappingURL=chunk-3SH3L3DB.js.map
6
+ //# sourceMappingURL=chunk-VGFKTSGY.js.map
@@ -0,0 +1,2 @@
1
+ import{ca as l}from"./chunk-FNIX62V6.js";import{lb as r}from"./chunk-ZOGEQFGH.js";import{sb as n,ud as S,vd as N,xd as E}from"./chunk-5NTLNE54.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]="0f5adf98-dc8e-5fa6-a14a-5c9b588b5569")}catch{}})();var u=new Set(["--author","--expect-hash","--follow","--help","--lean","--token-accounting","--output-include","--output-limit","--output-budget","--output-format","--output-session","--output-cursor","--output-row-contract","--no-changed-fields","--no-extensions","--no-pager","--pm-path","--profile","--quiet","--interval-ms"]),p=new Set([...S,...N]),I=new Set(["--brief","--format","--full","--full-changed-fields","--id-only","--no-truncate","--stream"]),d=new Set(["--body-file","--file","--stdin-json"]),m=new Set(["--global","--local","--project"]),P=new Set(["--activity-limit","--default-depth","--section-activity","--section-blockers","--section-files","--section-hierarchy","--section-progress","--section-staleness","--section-tests","--section-workload","--stale-threshold-days"]),f=new Set(["action","fullChangedFields","idOnly","path","pmExecutable","timeoutMs"]),M=new Set(["configAction","id","name","query","reason","subcommand","target","text"]),G={assurance:{id:"<id>",kind:"<kind>",preset:"[kind]|[id]",subcommand:"<action>"},event:{title:"<title>"},files:{lookupPath:"lookup <path...>"},meet:{title:"<title>"},"item-reopen":{id:"<id>",reason:"<reason>"},merge:{subcommand:"<subcommand>"},remind:{title:"<title>"},workspace:{name:"<name>",subcommand:"snapshot",snapshotAction:"<snapshot-action>",target:"<target>"}},F={append:{"--text":"body"},assurance:{"--tree":"treeId","--owner":"owner","--apply":"apply","--enforcement":"enforcement"},init:{"--id-prefix":"idPrefix","--no-merge-fence":"mergeFence","--workspace":"workspace"},create:{"--no-inherit-focus":"inheritFocus","--ac":"acceptanceCriteria","--estimated-minutes":"estimate","--file":"linkedFile","--test":"linkedTest","--expected":"expectedResult","--actual":"actualResult"},plan:{"--no-inherit-focus":"inheritFocus"},update:{"--ac":"acceptanceCriteria","--estimated-minutes":"estimate","--file":"linkedFile","--test":"linkedTest","--expected":"expectedResult","--actual":"actualResult"},"update-many":{"--ac":"acceptanceCriteria","--estimated-minutes":"estimate","--file":"linkedFile","--test":"linkedTest","--expected":"expectedResult","--actual":"actualResult"},files:{"--note":"addNote","--full-history":"full"},docs:{"--note":"addNote","--full-history":"full"},test:{"--full-history":"full"},comments:{"--full-history":"full"},notes:{"--file":"text","--full-history":"full"},learnings:{"--file":"text","--full-history":"full"},gc:{"--scope":"gcScope"},contracts:{"--action":"contractAction"},schema:{"--no-allow-unset":"allowUnset","--type":"fieldTypeScope"},"history-author-acknowledge":{"--event":"historyEvent","--all-actionable":"allActionable"},"extension-init":{"--capability":"capability"},"package-init":{"--capability":"capability"},"extension-install":{"--gh":"github"},"package-install":{"--gh":"github"},"extension-adopt":{"--gh":"github"},"package-adopt":{"--gh":"github"},extension:{"--gh":"github","--scaffold":"init"},package:{"--gh":"github","--scaffold":"init"},install:{"--gh":"github"}},D={"--pm-path":"path"},c={stats:{"--analytics":["measurements","metric","measurementLimit","observe","improvementDirection","measurementSource","measurementItem","measurementRevision","author","message","provenanceCoverage","fleetAttribution","since","eventLimit","minimumSample"]}};function h(T){return T.startsWith("extension-")?`extension ${T.slice(10)}`:T.startsWith("package-")?`package ${T.slice(8)}`:T.startsWith("item-")?`item ${T.slice(5)}`:T}function R(T,e){let t=F[T]?.[e]??D[e];return t!==void 0?t:e.replace(/^--/,"").replaceAll("_","-").replace(/-([a-z])/g,(i,_)=>_.toUpperCase())}function g(T){let e=new Set;return T.filter(({flag:t})=>!t.startsWith("--")||e.has(t)?!1:(e.add(t),!0))}function y(T,e){return e.find(({aliases:t})=>t?.includes(T))?.flag}function U(T,e,t,i){let _=c[T]?.[e.flag];if(_!==void 0&&_.every(A=>i.has(A)))return{surface:"cli",input:e.flag,counterpart:_[0],disposition:"shared",reason:"The validated CLI JSON object fans out across strict SDK parameters."};let O=R(T,e.flag);if(i.has(O))return{surface:"cli",input:e.flag,counterpart:O,disposition:"shared",reason:"The CLI flag maps directly to a strict SDK action parameter."};let C=y(e.flag,t);if(C!==void 0){let A=R(T,C);if(i.has(A))return{surface:"cli",input:e.flag,counterpart:A,disposition:"compatibility_alias",reason:`Compatibility spelling for ${C}.`}}return u.has(e.flag)?{surface:"cli",input:e.flag,disposition:"cli_transport",reason:"CLI process transport is supplied by the in-process SDK host."}:I.has(e.flag)?{surface:"cli",input:e.flag,disposition:"cli_presentation",reason:"CLI rendering or mutation projection does not alter the SDK result envelope."}:d.has(e.flag)?{surface:"cli",input:e.flag,disposition:"cli_adapter",reason:"Local file or stdin adaptation is a CLI boundary concern."}:P.has(e.flag)?{surface:"cli",input:e.flag,counterpart:"key",disposition:"compatibility_alias",reason:"CLI config shorthand normalizes to the SDK configAction/key/value contract."}:m.has(e.flag)?{surface:"cli",input:e.flag,counterpart:"scope",disposition:"cli_scope_selector",reason:"Mutually exclusive CLI scope switches normalize to the SDK scope parameter."}:{surface:"cli",input:e.flag,counterpart:O,disposition:"unclassified",reason:"The CLI flag has no strict SDK parameter or approved boundary classification."}}function b(T,e,t){let i=Object.entries(c[T]??{}).find(([C,A])=>A.includes(e)&&t.some(({input:o,disposition:s})=>o===C&&s==="shared"));if(i!==void 0)return{surface:"sdk",input:e,counterpart:i[0],disposition:"shared",reason:"The strict SDK parameter is reachable through the validated CLI JSON object."};let _=t.find(({counterpart:C,disposition:A})=>C===e&&(A==="shared"||A==="compatibility_alias"||A==="cli_scope_selector"));if(_!==void 0)return{surface:"sdk",input:e,counterpart:_.input,disposition:"shared",reason:"The strict SDK parameter is reachable from the CLI contract."};let O=G[T]?.[e];return O!==void 0?{surface:"sdk",input:e,counterpart:O,disposition:"shared",reason:"The strict SDK parameter maps to a canonical CLI positional argument."}:f.has(e)?{surface:"sdk",input:e,disposition:"sdk_transport",reason:"The SDK host supplies in-process transport and workspace selection."}:M.has(e)?{surface:"sdk",input:e,disposition:"cli_positional",reason:"The CLI accepts this SDK parameter as a positional command argument."}:{surface:"sdk",input:e,disposition:"sdk_native",reason:"The typed SDK exposes this structured input without a canonical CLI long flag."}}function v(T={}){let e=T.actions??n,t=T.resolveFlags??r,i=T.resolveParameters??l;return e.map(_=>{let O=h(_),C=g(t(O)).filter(({flag:a})=>E(_)!==void 0||!p.has(a)),A=new Set(i(_)??[]),o=C.map(a=>U(_,a,C,A)),s=[...A].sort((a,L)=>a.localeCompare(L)).map(a=>b(_,a,o));return{action:_,command:O,cli:o,sdk:s,unclassified:[...o,...s].filter(({disposition:a})=>a==="unclassified")}})}(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]="62489699-d1d6-505e-8a23-53922081c6e7")}catch{}})();export{v as a};
2
+ //# sourceMappingURL=chunk-VGJDKDKA.js.map