@unbrained/pm-cli 2026.11.28 → 2026.11.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (196) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli/commander-usage.js +4 -4
  3. package/dist/cli/error-guidance.js +5 -5
  4. package/dist/cli/linked-resource-value-list.js +2 -0
  5. package/dist/cli-bundle/bundle-manifest.json +1 -1
  6. package/dist/cli-bundle/chunks/{chunk-O2WNNIKK.js → chunk-2SBTXR6C.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-YEMFOKFG.js → chunk-3AZOATC2.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-CATRDGAB.js → chunk-3TXEWHQX.js} +2 -2
  9. package/dist/cli-bundle/chunks/chunk-47ZS6RPL.js +2 -0
  10. package/dist/cli-bundle/chunks/{chunk-MGJMQSN4.js → chunk-4QA5O64H.js} +2 -2
  11. package/dist/cli-bundle/chunks/chunk-5EFS7K7Y.js +1 -0
  12. package/dist/cli-bundle/chunks/{chunk-E2LQ6LCJ.js → chunk-5PNOVDVO.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-OFIYA3PI.js → chunk-AOTI76Q6.js} +3 -3
  14. package/dist/cli-bundle/chunks/{chunk-TWRUA2NH.js → chunk-CCKM5YQM.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-CTM26LUE.js → chunk-DCWGM7CY.js} +2 -2
  16. package/dist/cli-bundle/chunks/chunk-FECZV72T.js +2 -0
  17. package/dist/cli-bundle/chunks/{chunk-O2SWNEBW.js → chunk-FR7ULTM4.js} +2 -2
  18. package/dist/cli-bundle/chunks/chunk-GSLOAEY2.js +2 -0
  19. package/dist/cli-bundle/chunks/{chunk-ZXERHBMA.js → chunk-HXQ3OHQR.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-T7RZPIOB.js → chunk-IGEFPHV7.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-FG4TNQQM.js → chunk-JPJNJHQW.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-6OIHST4I.js → chunk-K672XXGQ.js} +3 -3
  23. package/dist/cli-bundle/chunks/{chunk-CDUV7DFD.js → chunk-KCVSSONY.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-LMDIKSDZ.js → chunk-KXTKLDKD.js} +8 -8
  25. package/dist/cli-bundle/chunks/chunk-NHBG5ET3.js +2 -0
  26. package/dist/cli-bundle/chunks/chunk-NVYDPNQP.js +2 -0
  27. package/dist/cli-bundle/chunks/{chunk-C4O5TZY3.js → chunk-NZSXWIX7.js} +60 -60
  28. package/dist/cli-bundle/chunks/{chunk-KHFUHGL3.js → chunk-OGVSGXQX.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-LRGYV6QQ.js → chunk-Q4VZSMUL.js} +2 -2
  30. package/dist/cli-bundle/chunks/chunk-SJWIPGZW.js +113 -0
  31. package/dist/cli-bundle/chunks/chunk-TE6FBDHP.js +4 -0
  32. package/dist/cli-bundle/chunks/{chunk-Q6BGQRCB.js → chunk-TX74QJ4W.js} +2 -2
  33. package/dist/cli-bundle/chunks/chunk-TY55UX6M.js +10 -0
  34. package/dist/cli-bundle/chunks/chunk-USBTXMKS.js +2 -0
  35. package/dist/cli-bundle/chunks/chunk-VCXQ6A35.js +3 -0
  36. package/dist/cli-bundle/chunks/chunk-WFYE34TO.js +23 -0
  37. package/dist/cli-bundle/chunks/chunk-X5D5YUHR.js +2 -0
  38. package/dist/cli-bundle/chunks/chunk-YPMNXG2C.js +2 -0
  39. package/dist/cli-bundle/chunks/chunk-YVTALIN3.js +2 -0
  40. package/dist/cli-bundle/chunks/{chunk-JQYPSABI.js → chunk-Z7YL2SUM.js} +2 -2
  41. package/dist/cli-bundle/chunks/{chunk-T7UTG56V.js → chunk-ZA5NS3PL.js} +3 -3
  42. package/dist/cli-bundle/chunks/field-definition-losses-XKE4DRUA.js +2 -0
  43. package/dist/cli-bundle/chunks/{field-option-collisions-G4LQ2646.js → field-option-collisions-2F2Z7R7B.js} +2 -2
  44. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-H3MMNXXG.js → indexed-receipt-blobs-DR3FDHND.js} +2 -2
  45. package/dist/cli-bundle/chunks/{item-revision-O7L3AA2W.js → item-revision-UAF6L47R.js} +2 -2
  46. package/dist/cli-bundle/chunks/item-transaction-RJECL53Y.js +2 -0
  47. package/dist/cli-bundle/chunks/linked-resource-value-list-WXPPYUVQ.js +2 -0
  48. package/dist/cli-bundle/chunks/{mutation-actor-A45DFDEO.js → mutation-actor-UK3QNEEB.js} +2 -2
  49. package/dist/cli-bundle/chunks/mutation-admission-UTDYPFWP.js +2 -0
  50. package/dist/cli-bundle/chunks/{register-list-query-FCPGG2UT.js → register-list-query-DRA3CWHI.js} +2 -2
  51. package/dist/cli-bundle/chunks/{register-mutation-VD3JX23I.js → register-mutation-WO74VLEQ.js} +2 -2
  52. package/dist/cli-bundle/chunks/register-operations-CRBKH7WN.js +2 -0
  53. package/dist/cli-bundle/chunks/{register-setup-EWAZZWPL.js → register-setup-6V6NQB5C.js} +2 -2
  54. package/dist/cli-bundle/chunks/runtime-schema-OAIUNQRL.js +2 -0
  55. package/dist/cli-bundle/chunks/{settlement-hook-KWBOSRDZ.js → settlement-hook-BIVNGBZF.js} +2 -2
  56. package/dist/cli-bundle/chunks/{stage-UIDZMTE5.js → stage-DYEHGASU.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/chunk-26P6C6OO.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-2UUBS4BG.js +2 -0
  59. package/dist/cli-bundle/focused-chunks/{chunk-J4V3J5MC.js → chunk-4ER3VMST.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/chunk-4YBMHMBJ.js +2 -0
  61. package/dist/cli-bundle/focused-chunks/{chunk-Y7EC2L2G.js → chunk-62AMZMR4.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-OEMI52ZS.js → chunk-7G7JIXLL.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{chunk-YC3PFFDE.js → chunk-A3DORTXS.js} +57 -57
  64. package/dist/cli-bundle/focused-chunks/{chunk-AHCOSTL7.js → chunk-CWQLW4ZO.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-CQLOYNJY.js → chunk-FM5WQ6ZU.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/chunk-HXM7K6VH.js +100 -0
  67. package/dist/cli-bundle/focused-chunks/{chunk-7EKKUYN5.js → chunk-IIVDBAJM.js} +3 -3
  68. package/dist/cli-bundle/focused-chunks/{chunk-ZYHGQIQ7.js → chunk-IJ3T3W4U.js} +2 -2
  69. package/dist/cli-bundle/focused-chunks/{chunk-NGFDPEP7.js → chunk-IRYNVGKH.js} +3 -3
  70. package/dist/cli-bundle/focused-chunks/chunk-JFICNN4T.js +4 -0
  71. package/dist/cli-bundle/focused-chunks/chunk-KPASZGBL.js +2 -0
  72. package/dist/cli-bundle/focused-chunks/{chunk-YX75PQFO.js → chunk-L357ZAES.js} +2 -2
  73. package/dist/cli-bundle/focused-chunks/{chunk-HCWDMFWA.js → chunk-LWBZ7UGG.js} +2 -2
  74. package/dist/cli-bundle/focused-chunks/{chunk-JD45Y2BR.js → chunk-M57KDG7I.js} +2 -2
  75. package/dist/cli-bundle/focused-chunks/chunk-MZNV26XE.js +8 -0
  76. package/dist/cli-bundle/focused-chunks/chunk-NGHT2LNG.js +3 -0
  77. package/dist/cli-bundle/focused-chunks/chunk-NJTKGBSK.js +2 -0
  78. package/dist/cli-bundle/focused-chunks/{chunk-7P6OGPEG.js → chunk-P55AZPFN.js} +2 -2
  79. package/dist/cli-bundle/focused-chunks/chunk-RQYVX2T6.js +2 -0
  80. package/dist/cli-bundle/focused-chunks/{chunk-Q6JCMFGU.js → chunk-SXC3NVZI.js} +2 -2
  81. package/dist/cli-bundle/focused-chunks/chunk-TQQO42C2.js +44 -0
  82. package/dist/cli-bundle/focused-chunks/{chunk-VNU3IFBL.js → chunk-U35K7FSE.js} +2 -2
  83. package/dist/cli-bundle/focused-chunks/chunk-UQJ4PY2Y.js +2 -0
  84. package/dist/cli-bundle/focused-chunks/{chunk-XVCMYFQU.js → chunk-WAP3DF4B.js} +2 -2
  85. package/dist/cli-bundle/focused-chunks/{chunk-4SX2BN4V.js → chunk-XR6MLUVW.js} +2 -2
  86. package/dist/cli-bundle/focused-chunks/chunk-XR745UGE.js +4 -0
  87. package/dist/cli-bundle/focused-chunks/field-definition-losses-GGA6FUHD.js +2 -0
  88. package/dist/cli-bundle/focused-chunks/{field-option-collisions-63YQ2J3N.js → field-option-collisions-7TG7STO7.js} +2 -2
  89. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-PG2VJ3MB.js → indexed-receipt-blobs-EUYZJR5R.js} +2 -2
  90. package/dist/cli-bundle/focused-chunks/{item-revision-PV5O6F5Y.js → item-revision-J7EUGCHR.js} +2 -2
  91. package/dist/cli-bundle/focused-chunks/item-transaction-2IC2MLML.js +2 -0
  92. package/dist/cli-bundle/focused-chunks/{mutation-actor-2AAUJG2Z.js → mutation-actor-LJVF2HVD.js} +2 -2
  93. package/dist/cli-bundle/focused-chunks/mutation-admission-SLFAUONA.js +2 -0
  94. package/dist/cli-bundle/focused-chunks/runtime-schema-IDRXWCC4.js +2 -0
  95. package/dist/cli-bundle/focused-chunks/{settlement-hook-4MGRERCT.js → settlement-hook-Q6MJQKIE.js} +2 -2
  96. package/dist/cli-bundle/focused-chunks/{stage-56RYPMBK.js → stage-MWR73LTZ.js} +2 -2
  97. package/dist/cli-bundle/main.js +26 -26
  98. package/dist/cli-bundle/sdk-authoring.js +1 -1
  99. package/dist/cli-bundle/sdk-contracts.js +1 -1
  100. package/dist/cli-bundle/sdk-core.js +1 -1
  101. package/dist/cli-bundle/sdk-governance.js +1 -1
  102. package/dist/cli-bundle/sdk-graph.js +1 -1
  103. package/dist/cli-bundle/sdk-merge.js +63 -63
  104. package/dist/cli-bundle/sdk-query.js +1 -1
  105. package/dist/cli-bundle/sdk-runtime.js +1 -1
  106. package/dist/cli-bundle/sdk-testing.js +1 -1
  107. package/dist/cli-bundle/sdk.js +1 -1
  108. package/dist/core/extensions/item-fields.d.ts +18 -1
  109. package/dist/core/extensions/item-fields.js +1 -1
  110. package/dist/core/extensions/loader.js +1 -1
  111. package/dist/core/fs/fs-utils.d.ts +8 -0
  112. package/dist/core/fs/fs-utils.js +2 -2
  113. package/dist/core/item/item-type-inspection.js +2 -0
  114. package/dist/core/item/type-registry.js +1 -1
  115. package/dist/core/schema/runtime-schema.d.ts +19 -0
  116. package/dist/core/schema/runtime-schema.js +2 -2
  117. package/dist/core/shared/url-credentials.d.ts +4 -2
  118. package/dist/core/shared/url-credentials.js +1 -1
  119. package/dist/core/store/settings.d.ts +7 -0
  120. package/dist/core/store/settings.js +5 -5
  121. package/dist/sdk/context-intent-contracts.js +1 -1
  122. package/dist/sdk/extension-command-context.js +2 -2
  123. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  124. package/dist/sdk/governance/validate.js +1 -1
  125. package/dist/sdk/public-surface.json +1 -1
  126. package/dist/sdk/runtime/schema.js +1 -1
  127. package/dist/sdk/schema/field-definition-losses.js +1 -1
  128. package/dist/sdk/schema/schema-file-entry-losses.js +2 -0
  129. package/dist/sdk/test/execution.d.ts +9 -1
  130. package/dist/sdk/test/execution.js +4 -4
  131. package/docs/COMMANDS.md +3 -1
  132. package/docs/CONFIGURATION.md +23 -4
  133. package/docs/EXTENSIONS.md +1 -1
  134. package/docs/READ_OUTPUT_CONTRACTS.md +5 -0
  135. package/docs/SDK.md +19 -3
  136. package/docs/SDK_AUDITED_MUTATIONS.md +9 -0
  137. package/marketplace.json +1 -1
  138. package/node_modules/fast-json-patch/README.md +2 -2
  139. package/node_modules/fast-json-patch/dist/fast-json-patch.js +604 -818
  140. package/node_modules/fast-json-patch/dist/fast-json-patch.min.js +4 -8
  141. package/node_modules/fast-json-patch/package.json +14 -17
  142. package/package.json +2 -2
  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-2YD2AERA.js +0 -2
  163. package/dist/cli-bundle/chunks/chunk-54AQJTUH.js +0 -3
  164. package/dist/cli-bundle/chunks/chunk-56DKWGHE.js +0 -2
  165. package/dist/cli-bundle/chunks/chunk-56GUDMXN.js +0 -113
  166. package/dist/cli-bundle/chunks/chunk-5ECCMDSU.js +0 -2
  167. package/dist/cli-bundle/chunks/chunk-6RBD2AKU.js +0 -2
  168. package/dist/cli-bundle/chunks/chunk-D3I5AHNN.js +0 -2
  169. package/dist/cli-bundle/chunks/chunk-MO6PPUI6.js +0 -2
  170. package/dist/cli-bundle/chunks/chunk-RGE3XW3A.js +0 -2
  171. package/dist/cli-bundle/chunks/chunk-SP6CDM6B.js +0 -31
  172. package/dist/cli-bundle/chunks/chunk-WKDKBS4P.js +0 -4
  173. package/dist/cli-bundle/chunks/chunk-YLS2N4SN.js +0 -2
  174. package/dist/cli-bundle/chunks/field-definition-losses-JFMMMVTV.js +0 -2
  175. package/dist/cli-bundle/chunks/item-transaction-4XC74ULD.js +0 -2
  176. package/dist/cli-bundle/chunks/mutation-admission-SIUIMAEO.js +0 -2
  177. package/dist/cli-bundle/chunks/register-operations-KHJD4GFZ.js +0 -2
  178. package/dist/cli-bundle/chunks/runtime-schema-3RAXYNG5.js +0 -2
  179. package/dist/cli-bundle/focused-chunks/chunk-5MZXU6HB.js +0 -2
  180. package/dist/cli-bundle/focused-chunks/chunk-64DSKZJN.js +0 -100
  181. package/dist/cli-bundle/focused-chunks/chunk-A5B43EWU.js +0 -2
  182. package/dist/cli-bundle/focused-chunks/chunk-E4C6T3NL.js +0 -2
  183. package/dist/cli-bundle/focused-chunks/chunk-KMGI5GZP.js +0 -2
  184. package/dist/cli-bundle/focused-chunks/chunk-MSLRDKWL.js +0 -4
  185. package/dist/cli-bundle/focused-chunks/chunk-O33WUEAF.js +0 -3
  186. package/dist/cli-bundle/focused-chunks/chunk-RBOWKXFV.js +0 -8
  187. package/dist/cli-bundle/focused-chunks/chunk-TF57RHS2.js +0 -2
  188. package/dist/cli-bundle/focused-chunks/chunk-X5ZVPFK7.js +0 -4
  189. package/dist/cli-bundle/focused-chunks/chunk-Z4FWJGQG.js +0 -2
  190. package/dist/cli-bundle/focused-chunks/chunk-ZHHFOQSL.js +0 -44
  191. package/dist/cli-bundle/focused-chunks/chunk-ZUAPUBJK.js +0 -2
  192. package/dist/cli-bundle/focused-chunks/field-definition-losses-NUZO3JCP.js +0 -2
  193. package/dist/cli-bundle/focused-chunks/item-transaction-S5QXBGAT.js +0 -2
  194. package/dist/cli-bundle/focused-chunks/mutation-admission-X7HHNERR.js +0 -2
  195. package/dist/cli-bundle/focused-chunks/runtime-schema-5J2ONRNV.js +0 -2
  196. package/node_modules/fast-json-patch/webpack.config.js +0 -63
@@ -1,2 +1,2 @@
1
- import{b as W,c as j}from"./chunk-TF57RHS2.js";import{jb as V}from"./chunk-XVCMYFQU.js";import{D as $,E as D,K as q,U as G}from"./chunk-JD45Y2BR.js";import{q as F}from"./chunk-RBOWKXFV.js";import{Sd as U,ed as A,ia as R,kd as f,ld as T,md as _,nd as b,od as N,ra as y,rd as O,sc as S,sd as k,td as H,ud as L,vd as M,wd as P,xd as l}from"./chunk-64DSKZJN.js";import{D as E,E as C}from"./chunk-O33WUEAF.js";import{h as v,o as w,u as I}from"./chunk-A5B43EWU.js";import{A as d,y as g,z as m}from"./chunk-NGFDPEP7.js";var B="item_revision_conflict",ee=10,J=/^[0-9a-f]{64}$/u;function p(e,n){return new d(`Invalid expected revision ${JSON.stringify(e)}: ${n}.`,m.USAGE,{code:"expect_hash_invalid",value:e,required:"Pass the 64-character item_hash from pm get <id> --json, optionally as <id>=<item_hash>.",examples:["--expect-hash <item_hash>","--expect-hash pm-a1b2=<item_hash>"]})}function K(e){let n=typeof e=="string"?e.trim().toLowerCase():"";if(!J.test(n))throw p(String(e),"the revision is not a 64-character hexadecimal item_hash");return n}function te(e){return(e===void 0?[]:typeof e=="string"?[e]:e).flatMap(t=>{if(typeof t!="string")throw p(String(t),"expected a string");let i=t.split(",").map(o=>o.trim()).filter(o=>o.length>0);if(i.length===0)throw p(t,"the value is empty");let r=o=>C(t)===t?o:E;return i.map(o=>{let c=o.lastIndexOf("="),s=c===-1?void 0:o.slice(0,c).trim();if(s!==void 0&&s.length===0)throw p(r(o),"the item id before = is empty");let a=c===-1?o:o.slice(c+1);if(!J.test(a.trim().toLowerCase()))throw p(r(a),"the revision is not a 64-character hexadecimal item_hash");let h=K(a);return s===void 0?{itemHash:h}:{id:s,itemHash:h}})})}async function X(e,n){let t=await F(e),i=v(t,U()).type_to_folder,r=await $(e,n,t.id_prefix,t.item_format,i);if(r){let{document:o}=await D(r,{schema:t.schema});if(o.metadata.id!==await j(r.itemPath,r.id))throw new d(`Item file ${r.id} embeds the id ${o.metadata.id}; no revision can be bound to an item whose identity is in conflict.`,m.CONFLICT,{code:"item_identity_conflict",item_id:r.id,required:`Repair ${r.id}'s identity first (pm validate reports it; pm restore ${r.id} <version> recovers a recorded state), then read its item_hash again.`});return{id:o.metadata.id,document:o}}try{return{id:(await W(e,n,t,i)).id,document:g}}catch{throw await q(e,n,t.id_prefix,i)}}function x(e){return w(e.cwd??process.cwd(),e.pmRoot)}async function Te(e,n={}){let t=await X(x(n),e);return{id:t.id,item_hash:A(t.document)}}async function Y(e,n,t){let i=[];for(let r of n){let o=r.id??t;if(o===void 0||o.trim().length===0)throw new d("A bare expected revision needs an item to bind to.",m.USAGE,{code:"expect_hash_target_required",required:"This command has no single item argument; name each target as --expect-hash <id>=<item_hash>.",examples:["--expect-hash pm-a1b2=<item_hash>"]});i.push({id:(await X(e,o)).id,itemHash:r.itemHash})}return i}function ie(e){return[...new Set(e.patch.map(n=>{let t=n.path.split("/");return String(t[1]==="metadata"?t[2]:t[1])}))].sort()}async function ne(e,n,t){let i;try{i=await S(I(e,n),n)}catch{return}let r=-1;for(let s=i.length-1;s>=0;s-=1){let a=i[s];if(a.after_hash===t){r=s+1;break}if(a.before_hash===t){r=s;break}}if(r===-1)return{expected_revision_recorded:!1,changes_since:[],changes_since_omitted:0};let o=i.slice(r),c=o.slice(-ee);return{expected_revision_recorded:!0,changes_since:c.map(s=>({ts:s.ts,op:s.op,author:s.author,fields:ie(s)})),changes_since_omitted:o.length-c.length}}async function be(e,n){if(!u(e))return{};let t=await Q(e,n);return{error_code:B,expected_revision:String(t.context.expected_revision),current_revision:String(t.context.current_revision),details:t.context.details}}function u(e){return G(e)&&e.context.code===B}function Ne(e){let n=e.find(t=>u(t));if(n!==void 0)throw n}function Oe(){return new d("--expect-hash cannot guard an invocation an extension override rewrote: which item it writes is not provable.",m.USAGE,{code:"expect_hash_invocation_rewritten",required:"Run the command without the rewriting extension (--no-extensions), or drop --expect-hash.",why:"An extension parser or preflight override changed this invocation's tracker or arguments, and final dispatch, the extension SDK client and the guard do not share one rewritten view."})}function oe(e,n){if(n===void 0||!u(e)||typeof e.context.item_id!="string"||M(e))return e;let t=e.context.reason===k;if(!t&&e.context.reason!==O)return e;let i=P(l(e,new d(e.message,e.exitCode,{...e.context,...H(e.context.item_id,t,n)})));return i.stack=e.stack,i}async function Q(e,n,t){if(!L(e,n))return e;let i=oe(e,t);if(!u(i)||i.context.details!==void 0)return i;let r=i.context.item_id,o=i.context.expected_revision;if(typeof r!="string"||typeof o!="string")return i;let c;try{c=await ne(n,r,o)}catch{return i}if(c===void 0)return i;let s={expected_revision_recorded:c.expected_revision_recorded,changes_since:c.changes_since.map(h=>({ts:h.ts,op:h.op,author:h.author,fields:[...h.fields]})),changes_since_omitted:c.changes_since_omitted},a=l(i,new d(i.message,i.exitCode,{...i.context,details:s}));return a.stack=i.stack,a}async function Z(e,n,t){try{return{result:await T(e,n),...b(e)}}catch(i){throw e.pmRoot===void 0?i:await Q(i,e.pmRoot,t)}}function re(e){return e.cwd===void 0&&e.pmRoot===void 0?void 0:{scopeArgs:["--pm-path",x(e)]}}async function ke(e,n,t={}){return Z(await se(e,t),n,re(t))}async function se(e,n={}){let t=x(n),i=e.map(({id:o,itemHash:c})=>({id:o,itemHash:K(c)})),r=f();return _(r,t,await Y(t,i)),r}function He(e){let n=N(e);return n===void 0||n.length>0}function ce(e){return`expect_hash_unchecked:${e}:no_locked_write_reached_this_item`}var z=new Set(R);function ae(e,n={}){let t=e.trim().replace(/\s+/gu,"-"),i=z.has(t)?t:e;if(z.has(i)&&(!V(i)||i==="deps")&&!y.has(i))throw de(i);if((i==="test"||i==="test-all")&&n.background===!0)throw new d(`--expect-hash cannot guard ${i} --background: the worker runs in another process.`,m.USAGE,{code:"expect_hash_background_unsupported",required:`Run ${i} in the foreground to guard its result recording, or drop --expect-hash for a background run.`})}function de(e){return new d(`--expect-hash guards item writes, and ${e} is not a mutation.`,m.USAGE,{code:"expect_hash_requires_mutation",required:"Use --expect-hash (MCP/SDK expectHash) only on a command or action that writes items."})}function he(e,n){if(n.length===0||typeof e!="object"||e===null||Array.isArray(e))return e;let t=e,i=Array.isArray(t.warnings)?t.warnings:[];return{...t,warnings:[...i,...n.map(ce)]}}async function Le(e){let n=e.expectHash;if(n!==void 0&&typeof n!="string"&&!(Array.isArray(n)&&n.every(o=>typeof o=="string")))throw p(JSON.stringify(n)??String(n),"expected a string or an array of strings");let t=te(n);if(t.length===0)return e.run();ae(e.action,{background:e.background===!0||e.options?.background===!0});let i=f();_(i,e.pmRoot,await Y(e.pmRoot,t,e.defaultId));let r=await Z(i,e.run,e.invocation);return he(r.result,r.unchecked)}export{B as a,ee as b,K as c,te as d,Te as e,Y as f,ne as g,be as h,u as i,Ne as j,Oe as k,oe as l,Q as m,Z as n,ke as o,se as p,He as q,ce as r,ae as s,de as t,Le as u};
2
- //# sourceMappingURL=chunk-7P6OGPEG.js.map
1
+ import{b as W,c as j}from"./chunk-RQYVX2T6.js";import{jb as V}from"./chunk-WAP3DF4B.js";import{D as $,E as D,K as q,U as G}from"./chunk-M57KDG7I.js";import{r as F}from"./chunk-MZNV26XE.js";import{Sd as U,ed as A,ia as R,kd as f,ld as T,md as _,nd as b,od as N,ra as y,rd as O,sc as S,sd as k,td as H,ud as L,vd as M,wd as P,xd as l}from"./chunk-HXM7K6VH.js";import{D as E,E as C}from"./chunk-NGHT2LNG.js";import{g as v,n as w,t as I}from"./chunk-26P6C6OO.js";import{A as d,y as g,z as m}from"./chunk-IRYNVGKH.js";var B="item_revision_conflict",ee=10,J=/^[0-9a-f]{64}$/u;function p(e,n){return new d(`Invalid expected revision ${JSON.stringify(e)}: ${n}.`,m.USAGE,{code:"expect_hash_invalid",value:e,required:"Pass the 64-character item_hash from pm get <id> --json, optionally as <id>=<item_hash>.",examples:["--expect-hash <item_hash>","--expect-hash pm-a1b2=<item_hash>"]})}function K(e){let n=typeof e=="string"?e.trim().toLowerCase():"";if(!J.test(n))throw p(String(e),"the revision is not a 64-character hexadecimal item_hash");return n}function te(e){return(e===void 0?[]:typeof e=="string"?[e]:e).flatMap(t=>{if(typeof t!="string")throw p(String(t),"expected a string");let i=t.split(",").map(o=>o.trim()).filter(o=>o.length>0);if(i.length===0)throw p(t,"the value is empty");let r=o=>C(t)===t?o:E;return i.map(o=>{let c=o.lastIndexOf("="),s=c===-1?void 0:o.slice(0,c).trim();if(s!==void 0&&s.length===0)throw p(r(o),"the item id before = is empty");let a=c===-1?o:o.slice(c+1);if(!J.test(a.trim().toLowerCase()))throw p(r(a),"the revision is not a 64-character hexadecimal item_hash");let h=K(a);return s===void 0?{itemHash:h}:{id:s,itemHash:h}})})}async function X(e,n){let t=await F(e),i=v(t,U()).type_to_folder,r=await $(e,n,t.id_prefix,t.item_format,i);if(r){let{document:o}=await D(r,{schema:t.schema});if(o.metadata.id!==await j(r.itemPath,r.id))throw new d(`Item file ${r.id} embeds the id ${o.metadata.id}; no revision can be bound to an item whose identity is in conflict.`,m.CONFLICT,{code:"item_identity_conflict",item_id:r.id,required:`Repair ${r.id}'s identity first (pm validate reports it; pm restore ${r.id} <version> recovers a recorded state), then read its item_hash again.`});return{id:o.metadata.id,document:o}}try{return{id:(await W(e,n,t,i)).id,document:g}}catch{throw await q(e,n,t.id_prefix,i)}}function x(e){return w(e.cwd??process.cwd(),e.pmRoot)}async function Te(e,n={}){let t=await X(x(n),e);return{id:t.id,item_hash:A(t.document)}}async function Y(e,n,t){let i=[];for(let r of n){let o=r.id??t;if(o===void 0||o.trim().length===0)throw new d("A bare expected revision needs an item to bind to.",m.USAGE,{code:"expect_hash_target_required",required:"This command has no single item argument; name each target as --expect-hash <id>=<item_hash>.",examples:["--expect-hash pm-a1b2=<item_hash>"]});i.push({id:(await X(e,o)).id,itemHash:r.itemHash})}return i}function ie(e){return[...new Set(e.patch.map(n=>{let t=n.path.split("/");return String(t[1]==="metadata"?t[2]:t[1])}))].sort()}async function ne(e,n,t){let i;try{i=await S(I(e,n),n)}catch{return}let r=-1;for(let s=i.length-1;s>=0;s-=1){let a=i[s];if(a.after_hash===t){r=s+1;break}if(a.before_hash===t){r=s;break}}if(r===-1)return{expected_revision_recorded:!1,changes_since:[],changes_since_omitted:0};let o=i.slice(r),c=o.slice(-ee);return{expected_revision_recorded:!0,changes_since:c.map(s=>({ts:s.ts,op:s.op,author:s.author,fields:ie(s)})),changes_since_omitted:o.length-c.length}}async function be(e,n){if(!u(e))return{};let t=await Q(e,n);return{error_code:B,expected_revision:String(t.context.expected_revision),current_revision:String(t.context.current_revision),details:t.context.details}}function u(e){return G(e)&&e.context.code===B}function Ne(e){let n=e.find(t=>u(t));if(n!==void 0)throw n}function Oe(){return new d("--expect-hash cannot guard an invocation an extension override rewrote: which item it writes is not provable.",m.USAGE,{code:"expect_hash_invocation_rewritten",required:"Run the command without the rewriting extension (--no-extensions), or drop --expect-hash.",why:"An extension parser or preflight override changed this invocation's tracker or arguments, and final dispatch, the extension SDK client and the guard do not share one rewritten view."})}function oe(e,n){if(n===void 0||!u(e)||typeof e.context.item_id!="string"||M(e))return e;let t=e.context.reason===k;if(!t&&e.context.reason!==O)return e;let i=P(l(e,new d(e.message,e.exitCode,{...e.context,...H(e.context.item_id,t,n)})));return i.stack=e.stack,i}async function Q(e,n,t){if(!L(e,n))return e;let i=oe(e,t);if(!u(i)||i.context.details!==void 0)return i;let r=i.context.item_id,o=i.context.expected_revision;if(typeof r!="string"||typeof o!="string")return i;let c;try{c=await ne(n,r,o)}catch{return i}if(c===void 0)return i;let s={expected_revision_recorded:c.expected_revision_recorded,changes_since:c.changes_since.map(h=>({ts:h.ts,op:h.op,author:h.author,fields:[...h.fields]})),changes_since_omitted:c.changes_since_omitted},a=l(i,new d(i.message,i.exitCode,{...i.context,details:s}));return a.stack=i.stack,a}async function Z(e,n,t){try{return{result:await T(e,n),...b(e)}}catch(i){throw e.pmRoot===void 0?i:await Q(i,e.pmRoot,t)}}function re(e){return e.cwd===void 0&&e.pmRoot===void 0?void 0:{scopeArgs:["--pm-path",x(e)]}}async function ke(e,n,t={}){return Z(await se(e,t),n,re(t))}async function se(e,n={}){let t=x(n),i=e.map(({id:o,itemHash:c})=>({id:o,itemHash:K(c)})),r=f();return _(r,t,await Y(t,i)),r}function He(e){let n=N(e);return n===void 0||n.length>0}function ce(e){return`expect_hash_unchecked:${e}:no_locked_write_reached_this_item`}var z=new Set(R);function ae(e,n={}){let t=e.trim().replace(/\s+/gu,"-"),i=z.has(t)?t:e;if(z.has(i)&&(!V(i)||i==="deps")&&!y.has(i))throw de(i);if((i==="test"||i==="test-all")&&n.background===!0)throw new d(`--expect-hash cannot guard ${i} --background: the worker runs in another process.`,m.USAGE,{code:"expect_hash_background_unsupported",required:`Run ${i} in the foreground to guard its result recording, or drop --expect-hash for a background run.`})}function de(e){return new d(`--expect-hash guards item writes, and ${e} is not a mutation.`,m.USAGE,{code:"expect_hash_requires_mutation",required:"Use --expect-hash (MCP/SDK expectHash) only on a command or action that writes items."})}function he(e,n){if(n.length===0||typeof e!="object"||e===null||Array.isArray(e))return e;let t=e,i=Array.isArray(t.warnings)?t.warnings:[];return{...t,warnings:[...i,...n.map(ce)]}}async function Le(e){let n=e.expectHash;if(n!==void 0&&typeof n!="string"&&!(Array.isArray(n)&&n.every(o=>typeof o=="string")))throw p(JSON.stringify(n)??String(n),"expected a string or an array of strings");let t=te(n);if(t.length===0)return e.run();ae(e.action,{background:e.background===!0||e.options?.background===!0});let i=f();_(i,e.pmRoot,await Y(e.pmRoot,t,e.defaultId));let r=await Z(i,e.run,e.invocation);return he(r.result,r.unchecked)}export{B as a,ee as b,K as c,te as d,Te as e,Y as f,ne as g,be as h,u as i,Ne as j,Oe as k,oe as l,Q as m,Z as n,ke as o,se as p,He as q,ce as r,ae as s,de as t,Le as u};
2
+ //# sourceMappingURL=chunk-P55AZPFN.js.map
@@ -0,0 +1,2 @@
1
+ import{c as N,f as P}from"./chunk-FM5WQ6ZU.js";import{D as m,E as R,T as L,e as p,f as x}from"./chunk-M57KDG7I.js";import{r as v,x as E}from"./chunk-MZNV26XE.js";import{a as g,b as C}from"./chunk-X6CXWWNB.js";import{Sd as k,v as f}from"./chunk-HXM7K6VH.js";import{g as w,n as _,t as l}from"./chunk-26P6C6OO.js";import{ba as b}from"./chunk-JFICNN4T.js";import{A as s,C as I,z as c}from"./chunk-IRYNVGKH.js";async function X(t){let i=_(process.cwd(),t);await E(i);let r=await v(i),a=w(r,k());return{pmRoot:i,settings:r,typeRegistry:a}}async function j(t,i,r,a){l(t,p(i));let e=await m(t,i,r.id_prefix,r.item_format,a);if(e)return{id:e.id,historyPath:l(t,e.id),located:e};let o=x(i,r.id_prefix),n=p(i),d=o===n?[o]:[o,n];for(let u of d){let h=l(t,u);if(await I(h))return{id:u,historyPath:h,located:null}}throw new s(`Item ${i} not found`,c.NOT_FOUND)}import{readdir as T}from"node:fs/promises";import y from"node:path";function B(t,i){let r=new Map;for(let a of t){let e=a.external?a.id:i.get(a.id.toLowerCase())?.id??a.id;r.set(a.external?`external:${e}`:`local:${e.toLowerCase()}`,{...a,id:e})}return[...r.values()]}async function D(t,i){let r=y.basename(t),e=(await T(y.dirname(t)).catch(o=>{throw L("Cannot verify the blocker's physical file identity",{exitCode:c.GENERIC_FAILURE,context:{code:"blocker_identity_read_failed",required:"Restore access to the blocker item directory, then retry the item read."},cause:o})})).filter(o=>o.toLowerCase()===r.toLowerCase()).sort((o,n)=>+(n===r)-+(o===r)||o.localeCompare(n)).map(o=>y.parse(o).name)[0];if(e===void 0)throw new s(`Blocker canonical file disappeared during identity verification: ${i}`,c.CONFLICT,{code:"item_identity_conflict",required:"Restore the canonical blocker file and validate storage integrity before retrying the item read."});return e}async function te(t){let i=N(t.metadata);if(i.length===0)return[];let r=new Map([t.metadata.blocked_by,...(t.metadata.dependencies??[]).filter(e=>f(e.kind)==="blocked_by").map(e=>e.id)].filter(e=>typeof e=="string").map(e=>[e.trim().toLowerCase(),e.trim()])),a=new Map;for(let e of i){if(g(e)||!/^(?!\.{1,2}$)[^/\\:\0]+$/u.test(e)||t.metadata.dependencies?.some(d=>d.id.trim()===e&&f(d.kind)==="blocked_by"&&C(d.source_kind)))continue;let o=await m(t.pmRoot,r.get(e),t.settings.id_prefix,t.settings.item_format,t.typeToFolder);if(o===null)continue;let n=await R(o,{schema:t.settings.schema});if(o.id=await D(o.itemPath,o.id),n.document.metadata.id!==o.id)throw new s(`Blocker identity differs from its canonical file: ${o.id}`,c.CONFLICT,{code:"item_identity_conflict",required:"Restore the canonical blocker identity and validate storage integrity before retrying the item read."});a.set(e.toLowerCase(),n.document.metadata)}return B(P({blocked_by:t.metadata.blocked_by,dependencies:t.metadata.dependencies,updated_at:t.metadata.updated_at},a,b(t.settings.schema)),a)}export{X as a,j as b,D as c,te as d};
2
+ //# sourceMappingURL=chunk-RQYVX2T6.js.map
@@ -1,2 +1,2 @@
1
- import{ca as R}from"./chunk-VNU3IFBL.js";import{nb as r}from"./chunk-J4V3J5MC.js";import{Oe as S,Pe as N,Re as E,ia as a}from"./chunk-64DSKZJN.js";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"]),I=new Set([...S,...N]),p=new Set(["--brief","--format","--full","--full-changed-fields","--id-only","--no-truncate","--stream"]),P=new Set(["--body-file","--file","--stdin-json"]),m=new Set(["--global","--local","--project"]),d=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","--note-conflict":"noteConflict","--full-history":"full"},docs:{"--note":"addNote","--note-conflict":"noteConflict","--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 l(T,e){let t=F[T]?.[e]??D[e];return t!==void 0?t:e.replace(/^--/,"").replaceAll("_","-").replace(/-([a-z])/g,(O,_)=>_.toUpperCase())}function g(T){let e=new Set;return T.filter(({flag:t})=>!t.startsWith("--")||e.has(t)?!1:(e.add(t),!0))}function U(T,e){return e.find(({aliases:t})=>t?.includes(T))?.flag}function y(T,e,t,O){let _=c[T]?.[e.flag];if(_!==void 0&&_.every(A=>O.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 i=l(T,e.flag);if(O.has(i))return{surface:"cli",input:e.flag,counterpart:i,disposition:"shared",reason:"The CLI flag maps directly to a strict SDK action parameter."};let C=U(e.flag,t);if(C!==void 0){let A=l(T,C);if(O.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."}:p.has(e.flag)?{surface:"cli",input:e.flag,disposition:"cli_presentation",reason:"CLI rendering or mutation projection does not alter the SDK result envelope."}:P.has(e.flag)?{surface:"cli",input:e.flag,disposition:"cli_adapter",reason:"Local file or stdin adaptation is a CLI boundary concern."}:d.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:i,disposition:"unclassified",reason:"The CLI flag has no strict SDK parameter or approved boundary classification."}}function b(T,e,t){let O=Object.entries(c[T]??{}).find(([C,A])=>A.includes(e)&&t.some(({input:o,disposition:s})=>o===C&&s==="shared"));if(O!==void 0)return{surface:"sdk",input:e,counterpart:O[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 i=G[T]?.[e];return i!==void 0?{surface:"sdk",input:e,counterpart:i,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 x(T={}){let e=T.actions??a,t=T.resolveFlags??r,O=T.resolveParameters??R;return e.map(_=>{let i=h(_),C=g(t(i)).filter(({flag:n})=>E(_)!==void 0||!I.has(n)),A=new Set(O(_)??[]),o=C.map(n=>y(_,n,C,A)),s=[...A].sort((n,L)=>n.localeCompare(L)).map(n=>b(_,n,o));return{action:_,command:i,cli:o,sdk:s,unclassified:[...o,...s].filter(({disposition:n})=>n==="unclassified")}})}export{x as a};
2
- //# sourceMappingURL=chunk-Q6JCMFGU.js.map
1
+ import{ca as R}from"./chunk-U35K7FSE.js";import{nb as r}from"./chunk-4ER3VMST.js";import{Oe as S,Pe as N,Re as E,ia as a}from"./chunk-HXM7K6VH.js";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"]),I=new Set([...S,...N]),p=new Set(["--brief","--format","--full","--full-changed-fields","--id-only","--no-truncate","--stream"]),P=new Set(["--body-file","--file","--stdin-json"]),m=new Set(["--global","--local","--project"]),d=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","--note-conflict":"noteConflict","--full-history":"full"},docs:{"--note":"addNote","--note-conflict":"noteConflict","--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 l(T,e){let t=F[T]?.[e]??D[e];return t!==void 0?t:e.replace(/^--/,"").replaceAll("_","-").replace(/-([a-z])/g,(O,_)=>_.toUpperCase())}function g(T){let e=new Set;return T.filter(({flag:t})=>!t.startsWith("--")||e.has(t)?!1:(e.add(t),!0))}function U(T,e){return e.find(({aliases:t})=>t?.includes(T))?.flag}function y(T,e,t,O){let _=c[T]?.[e.flag];if(_!==void 0&&_.every(A=>O.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 i=l(T,e.flag);if(O.has(i))return{surface:"cli",input:e.flag,counterpart:i,disposition:"shared",reason:"The CLI flag maps directly to a strict SDK action parameter."};let C=U(e.flag,t);if(C!==void 0){let A=l(T,C);if(O.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."}:p.has(e.flag)?{surface:"cli",input:e.flag,disposition:"cli_presentation",reason:"CLI rendering or mutation projection does not alter the SDK result envelope."}:P.has(e.flag)?{surface:"cli",input:e.flag,disposition:"cli_adapter",reason:"Local file or stdin adaptation is a CLI boundary concern."}:d.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:i,disposition:"unclassified",reason:"The CLI flag has no strict SDK parameter or approved boundary classification."}}function b(T,e,t){let O=Object.entries(c[T]??{}).find(([C,A])=>A.includes(e)&&t.some(({input:o,disposition:s})=>o===C&&s==="shared"));if(O!==void 0)return{surface:"sdk",input:e,counterpart:O[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 i=G[T]?.[e];return i!==void 0?{surface:"sdk",input:e,counterpart:i,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 x(T={}){let e=T.actions??a,t=T.resolveFlags??r,O=T.resolveParameters??R;return e.map(_=>{let i=h(_),C=g(t(i)).filter(({flag:n})=>E(_)!==void 0||!I.has(n)),A=new Set(O(_)??[]),o=C.map(n=>y(_,n,C,A)),s=[...A].sort((n,L)=>n.localeCompare(L)).map(n=>b(_,n,o));return{action:_,command:i,cli:o,sdk:s,unclassified:[...o,...s].filter(({disposition:n})=>n==="unclassified")}})}export{x as a};
2
+ //# sourceMappingURL=chunk-SXC3NVZI.js.map