@unbrained/pm-cli 2026.10.27 → 2026.10.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +41 -0
  3. package/dist/cli/commander-usage.js +2 -2
  4. package/dist/cli/commands/lifecycle/append.d.ts +4 -0
  5. package/dist/cli/commands/lifecycle/append.js +1 -1
  6. package/dist/cli/commands/lifecycle/create.d.ts +4 -0
  7. package/dist/cli/commands/lifecycle/create.js +1 -1
  8. package/dist/cli/commands/lifecycle/plan.d.ts +3 -0
  9. package/dist/cli/commands/lifecycle/plan.js +1 -1
  10. package/dist/cli/commands/lifecycle/update-many.d.ts +4 -0
  11. package/dist/cli/commands/lifecycle/update-many.js +1 -1
  12. package/dist/cli/commands/lifecycle/update.d.ts +4 -0
  13. package/dist/cli/commands/lifecycle/update.js +1 -1
  14. package/dist/cli/error-guidance.js +2 -2
  15. package/dist/cli/help-content.js +2 -2
  16. package/dist/cli/register-list-query.js +3 -3
  17. package/dist/cli-bundle/bundle-manifest.json +1 -1
  18. package/dist/cli-bundle/chunks/chunk-34MP7WKK.js +6 -0
  19. package/dist/cli-bundle/chunks/{chunk-25MTQAHX.js → chunk-3KMYHYJV.js} +2 -2
  20. package/dist/cli-bundle/chunks/chunk-42BHHNTL.js +128 -0
  21. package/dist/cli-bundle/chunks/{chunk-NNIYQHYT.js → chunk-4BQD5SW2.js} +46 -46
  22. package/dist/cli-bundle/chunks/{chunk-OQOEBWHU.js → chunk-EHBGHX55.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-2XUDAQK5.js → chunk-GRABKNFL.js} +2 -2
  24. package/dist/cli-bundle/chunks/chunk-I5O3XZOA.js +2 -0
  25. package/dist/cli-bundle/chunks/{chunk-34OQP43K.js → chunk-LEIVUGDH.js} +3 -3
  26. package/dist/cli-bundle/chunks/{chunk-57YPOOED.js → chunk-LWW4F4G2.js} +2 -2
  27. package/dist/cli-bundle/chunks/chunk-MVL27TAH.js +2 -0
  28. package/dist/cli-bundle/chunks/{chunk-UHKN6TJM.js → chunk-OH7WPD42.js} +44 -44
  29. package/dist/cli-bundle/chunks/chunk-OOD2A7AF.js +20 -0
  30. package/dist/cli-bundle/chunks/chunk-Q5V7P6NM.js +2 -0
  31. package/dist/cli-bundle/chunks/chunk-QLPFYBXN.js +2 -0
  32. package/dist/cli-bundle/chunks/{chunk-ONC4BBQP.js → chunk-RZQNFHXO.js} +2 -2
  33. package/dist/cli-bundle/chunks/chunk-S2U7ECUJ.js +2 -0
  34. package/dist/cli-bundle/chunks/{chunk-32QK43XG.js → chunk-SA5NYLPE.js} +2 -2
  35. package/dist/cli-bundle/chunks/{chunk-ER7RLJW5.js → chunk-TH5KPAN4.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-EKV5GP6P.js → chunk-UUQX3PFD.js} +57 -57
  37. package/dist/cli-bundle/chunks/chunk-VHLAVTJN.js +31 -0
  38. package/dist/cli-bundle/chunks/{chunk-HIX2OMEZ.js → chunk-XAOVJG52.js} +2 -2
  39. package/dist/cli-bundle/chunks/chunk-XPQ4RTSF.js +2 -0
  40. package/dist/cli-bundle/chunks/{chunk-X5TMR7KC.js → chunk-Y6NC3X3E.js} +2 -2
  41. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-63WYG2PY.js → indexed-receipt-blobs-LHLE7PSG.js} +2 -2
  42. package/dist/cli-bundle/chunks/item-transaction-WIOBZW4E.js +2 -0
  43. package/dist/cli-bundle/chunks/{mutation-admission-L3A6FSZ7.js → mutation-admission-TRGAVS7N.js} +2 -2
  44. package/dist/cli-bundle/chunks/{register-list-query-YSQ7UTFI.js → register-list-query-BH4F6M7Z.js} +6 -6
  45. package/dist/cli-bundle/chunks/register-mutation-5V2NANIS.js +20 -0
  46. package/dist/cli-bundle/chunks/register-operations-XSFRMUFX.js +2 -0
  47. package/dist/cli-bundle/chunks/{register-setup-3WAXNDMY.js → register-setup-QPWSVHFZ.js} +2 -2
  48. package/dist/cli-bundle/chunks/{settlement-hook-CRW6PVQK.js → settlement-hook-MN3Y7LVX.js} +2 -2
  49. package/dist/cli-bundle/chunks/{stage-I46WD4EN.js → stage-RTB6RAAO.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/chunk-2V6NMNYN.js +26 -0
  51. package/dist/cli-bundle/focused-chunks/{chunk-YW5GHQN2.js → chunk-3SRX77ES.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-YLVHHWHN.js → chunk-4PW5XWVI.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-ZH7GTEWL.js → chunk-ASHGXMX4.js} +3 -3
  54. package/dist/cli-bundle/focused-chunks/{chunk-XK3XMZM4.js → chunk-BCIUAEWX.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-KTXU5WU6.js → chunk-BPE6JTKL.js} +3 -3
  56. package/dist/cli-bundle/focused-chunks/{chunk-MVY6JDIH.js → chunk-CKBN2D42.js} +11 -11
  57. package/dist/cli-bundle/focused-chunks/chunk-FRFNGMAK.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-I642DXOT.js +22 -0
  59. package/dist/cli-bundle/focused-chunks/chunk-K7DKG5HM.js +91 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-NMQBXU7N.js +44 -0
  61. package/dist/cli-bundle/focused-chunks/{chunk-WDKZB3V6.js → chunk-PGM3ENGZ.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-R2MTHS2H.js → chunk-POJPJX64.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{chunk-YQKLKRMW.js → chunk-QFNV4JTA.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/{chunk-4TXZBGOR.js → chunk-QVJCQMZY.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/chunk-R2TPPPVU.js +2 -0
  66. package/dist/cli-bundle/focused-chunks/{chunk-B266DDBJ.js → chunk-RGQEJFXO.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/{chunk-BH7RE2ZY.js → chunk-RKPUQDWF.js} +2 -2
  68. package/dist/cli-bundle/focused-chunks/chunk-RYEZSZJ7.js +2 -0
  69. package/dist/cli-bundle/focused-chunks/{chunk-E5C24MCV.js → chunk-S23ZUASN.js} +2 -2
  70. package/dist/cli-bundle/focused-chunks/{chunk-SYL73MEI.js → chunk-SAT7IAEB.js} +3 -3
  71. package/dist/cli-bundle/focused-chunks/{chunk-TGUOEOKP.js → chunk-VFWCSQAG.js} +2 -2
  72. package/dist/cli-bundle/focused-chunks/chunk-VJVJ2ZX2.js +2 -0
  73. package/dist/cli-bundle/focused-chunks/{chunk-Y57A4ZDI.js → chunk-YQUZL2CK.js} +54 -54
  74. package/dist/cli-bundle/focused-chunks/{chunk-SM2KGD4J.js → chunk-YU7QOYYV.js} +18 -18
  75. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-GAFC52LQ.js → indexed-receipt-blobs-VK2363JB.js} +2 -2
  76. package/dist/cli-bundle/focused-chunks/item-transaction-ZFDKJIP7.js +2 -0
  77. package/dist/cli-bundle/focused-chunks/{mutation-admission-ENBFMV2X.js → mutation-admission-7VUODEPJ.js} +2 -2
  78. package/dist/cli-bundle/focused-chunks/{settlement-hook-PUYJJDFL.js → settlement-hook-OK6A7PG2.js} +2 -2
  79. package/dist/cli-bundle/focused-chunks/{stage-MAWZTM2H.js → stage-S5RP5SZH.js} +2 -2
  80. package/dist/cli-bundle/main.js +21 -21
  81. package/dist/cli-bundle/sdk-authoring.js +1 -1
  82. package/dist/cli-bundle/sdk-contracts.js +2 -2
  83. package/dist/cli-bundle/sdk-core.js +1 -42
  84. package/dist/cli-bundle/sdk-governance.js +1 -1
  85. package/dist/cli-bundle/sdk-graph.js +1 -1
  86. package/dist/cli-bundle/sdk-merge.js +61 -61
  87. package/dist/cli-bundle/sdk-query.js +1 -1
  88. package/dist/cli-bundle/sdk-runtime.js +1 -1
  89. package/dist/cli-bundle/sdk-testing.js +1 -1
  90. package/dist/cli-bundle/sdk.js +11 -11
  91. package/dist/core/history/operation-contract.d.ts +2 -2
  92. package/dist/core/history/operation-contract.js +1 -1
  93. package/dist/core/item/literal-mutation-input.d.ts +12 -0
  94. package/dist/core/item/literal-mutation-input.js +2 -0
  95. package/dist/core/item/parse.d.ts +2 -0
  96. package/dist/core/item/parse.js +2 -2
  97. package/dist/core/item/priority.js +1 -1
  98. package/dist/core/output/output.js +2 -2
  99. package/dist/core/shared/errors.d.ts +2 -0
  100. package/dist/core/shared/errors.js +1 -1
  101. package/dist/core/store/item-store.js +1 -1
  102. package/dist/sdk/agent/command-recovery.d.ts +5 -0
  103. package/dist/sdk/agent/command-recovery.js +1 -1
  104. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  105. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  106. package/dist/sdk/cli-contracts/registration-helpers.js +1 -1
  107. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  108. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  109. package/dist/sdk/command-line.d.ts +6 -0
  110. package/dist/sdk/command-line.js +1 -1
  111. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  112. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  113. package/dist/sdk/index.d.ts +1 -1
  114. package/dist/sdk/index.js +1 -1
  115. package/dist/sdk/item-transaction.d.ts +33 -2
  116. package/dist/sdk/item-transaction.js +1 -1
  117. package/dist/sdk/lifecycle/append.js +1 -1
  118. package/dist/sdk/lifecycle/cli-input.d.ts +4 -0
  119. package/dist/sdk/lifecycle/cli-input.js +2 -0
  120. package/dist/sdk/lifecycle/close.js +1 -1
  121. package/dist/sdk/lifecycle/create.js +1 -1
  122. package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -1
  123. package/dist/sdk/lifecycle/reopen.js +1 -1
  124. package/dist/sdk/lifecycle/update-many.js +1 -1
  125. package/dist/sdk/lifecycle/update.js +2 -2
  126. package/dist/sdk/output/table-rows.d.ts +9 -1
  127. package/dist/sdk/output/table-rows.js +1 -1
  128. package/dist/sdk/public-surface.json +1 -1
  129. package/dist/sdk/query/history.d.ts +6 -0
  130. package/dist/sdk/query/history.js +1 -1
  131. package/dist/sdk/runtime/actions.js +1 -1
  132. package/dist/sdk/runtime/mutation-value-validation.d.ts +16 -0
  133. package/dist/sdk/runtime/mutation-value-validation.js +2 -0
  134. package/dist/sdk/runtime-input.js +1 -1
  135. package/dist/sdk/runtime-primitives.d.ts +1 -0
  136. package/dist/sdk/runtime-primitives.js +1 -1
  137. package/dist/sdk/runtime.d.ts +14 -0
  138. package/dist/sdk/runtime.js +1 -1
  139. package/dist/sdk/structured-mutations.js +1 -1
  140. package/dist/sdk/test/command-resolution.d.ts +5 -0
  141. package/dist/sdk/test/command-resolution.js +3 -0
  142. package/dist/sdk/test/execution.js +2 -2
  143. package/dist/sdk/workspace-transaction-gc.js +1 -1
  144. package/dist/sdk/workspace-transaction.d.ts +54 -0
  145. package/dist/sdk/workspace-transaction.js +2 -2
  146. package/docs/COMMANDS.md +33 -1
  147. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +24 -2
  148. package/docs/SDK.md +165 -0
  149. package/docs/TESTING.md +36 -2
  150. package/docs/generated/FLAG_LEXICON_BUDGETS.md +1 -1
  151. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +6 -3
  152. package/marketplace.json +1 -1
  153. package/package.json +1 -1
  154. package/packages/pm-beads/package.json +1 -1
  155. package/packages/pm-calendar/package.json +1 -1
  156. package/packages/pm-command-kit/package.json +1 -1
  157. package/packages/pm-digital-twin/package.json +1 -1
  158. package/packages/pm-governance-audit/package.json +1 -1
  159. package/packages/pm-guide-shell/package.json +1 -1
  160. package/packages/pm-kanban/package.json +1 -1
  161. package/packages/pm-lifecycle-hooks/package.json +1 -1
  162. package/packages/pm-linked-test-adapters/package.json +1 -1
  163. package/packages/pm-search-advanced/package.json +1 -1
  164. package/packages/pm-templates/package.json +1 -1
  165. package/packages/pm-todos/package.json +1 -1
  166. package/packages/pm-vcs/package.json +1 -1
  167. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  168. package/plugins/pm-claude/package.json +1 -1
  169. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  170. package/plugins/pm-codex/package.json +1 -1
  171. package/plugins/pm-codex/plugin.json +1 -1
  172. package/runtime-dependencies.json +1 -1
  173. package/dist/cli-bundle/chunks/chunk-4D25HF3V.js +0 -2
  174. package/dist/cli-bundle/chunks/chunk-5PTMQBKJ.js +0 -30
  175. package/dist/cli-bundle/chunks/chunk-F26MRQZY.js +0 -6
  176. package/dist/cli-bundle/chunks/chunk-H434DKYU.js +0 -2
  177. package/dist/cli-bundle/chunks/chunk-O3LPT34G.js +0 -20
  178. package/dist/cli-bundle/chunks/chunk-Q55KZDNF.js +0 -2
  179. package/dist/cli-bundle/chunks/chunk-QQYLNHZK.js +0 -128
  180. package/dist/cli-bundle/chunks/chunk-SGFQQXFD.js +0 -2
  181. package/dist/cli-bundle/chunks/chunk-XERBUA6A.js +0 -2
  182. package/dist/cli-bundle/chunks/register-mutation-6HRXYASW.js +0 -20
  183. package/dist/cli-bundle/chunks/register-operations-4O3YOYXF.js +0 -2
  184. package/dist/cli-bundle/focused-chunks/chunk-HWD63G54.js +0 -2
  185. package/dist/cli-bundle/focused-chunks/chunk-J67PFM3O.js +0 -91
  186. package/dist/cli-bundle/focused-chunks/chunk-NLZUI234.js +0 -26
  187. package/dist/cli-bundle/focused-chunks/chunk-TAFMNTA5.js +0 -2
  188. package/dist/cli-bundle/focused-chunks/chunk-U4UBQBS7.js +0 -2
  189. package/dist/cli-bundle/focused-chunks/chunk-YC6NCPLK.js +0 -22
  190. package/dist/cli-bundle/focused-chunks/chunk-ZA6AEYIM.js +0 -2
@@ -1,2 +1,2 @@
1
- import{G as h}from"./chunk-NLZUI234.js";import{l as b,y as l,z as f}from"./chunk-KTXU5WU6.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="300b6741-40eb-5bb1-bb0a-bb144d15946e")}catch{}})();var d=new Set(b),u=Object.freeze({get size(){return d.size},has(e){return d.has(e)},entries(){return d.entries()},keys(){return d.keys()},values(){return d.values()},forEach(e,t){d.forEach(n=>e.call(t,n,n,u))},[Symbol.iterator](){return d.values()}});function g(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}function w(e){return typeof e!="string"?null:h(e)}function E(e){try{return structuredClone(e)}catch{return e}}function x(e){let t=e.trim(),n=t.indexOf("=");if(n<=0)throw new f(`--field entries must use name=value syntax, received: ${e}`,l.USAGE);let i=t.slice(0,n).trim(),r=t.slice(n+1);return{key:i,value:r}}function S(e,t,n){try{let i=JSON.parse(e);if(n==="array"&&Array.isArray(i)||n==="object"&&typeof i=="object"&&i!==null&&!Array.isArray(i))return i}catch{}throw new f(`--field ${t}=... must be valid JSON ${n}`,l.USAGE)}function F(e,t,n){if(t==="string")return n;if(t==="number"){let i=n.trim();if(i.length===0)throw new f(`--field ${e}=... must be a number`,l.USAGE);let r=Number(i);if(!Number.isFinite(r))throw new f(`--field ${e}=... must be a number`,l.USAGE);return r}if(t==="boolean"){let i=n.trim().toLowerCase();if(i==="true"||i==="1"||i==="yes")return!0;if(i==="false"||i==="0"||i==="no")return!1;throw new f(`--field ${e}=... must be one of true|false|1|0|yes|no`,l.USAGE)}return t==="string_array"?n.split(/[\n,|]/u).map(i=>i.trim()).filter(i=>i.length>0):S(n,e,t)}function y(e){let t=new Map;if(!e)return t;for(let n of e.item_fields)for(let i of n.fields){let r=g(i.name),s=w(i.type);if(!r||!s)continue;let o=t.get(r);if(o&&o.type!==s)throw new f(`Extension item field "${r}" is declared with conflicting types: ${o.type}, ${s}`,l.USAGE,{code:"extension_item_field_type_conflict",nextSteps:["Make every active extension declaration for this field use the same type."]});t.set(r,{name:r,type:s})}return t}function A(e){if(u.has(e))throw new f(`Extension item field "${e}" collides with built-in item metadata "${e}"; rename the extension field with an extension-specific prefix. Reserved fields: ${[...u].sort((t,n)=>t.localeCompare(n)).join(", ")}.`,l.USAGE,{code:"extension_item_field_reserved",nextSteps:["Rename the extension item field, preferably with an extension-specific prefix."]})}function D(e){return[...y(e).keys()].sort((t,n)=>t.localeCompare(n))}function U(e,t,n){if(!e||e.length===0)return{};let i=y(t),r={};for(let s of e){let{key:o,value:c}=x(s),a=i.get(o);if(!a){if(u.has(o)){let m=n?.(o)??{recovery:{provided_fields:[o]},nextSteps:["Core metadata has no generic --field mutation path. Use the owning lifecycle, evidence, or importer API; inspect pm update <id> --help for declared mutation flags."]};throw new f(`--field ${o} is a core item field, not an extension field`,l.USAGE,{code:"core_item_field_requires_dedicated_flag",field:o,...m})}let p=[...i.keys()].sort((m,_)=>m.localeCompare(_));throw new f(`--field ${o} is not declared by an active extension item-field registration`,l.USAGE,{code:"extension_item_field_unknown",field:o,recovery:{provided_fields:[o]},nextSteps:p.length>0?[`Use one of the declared fields: ${p.join(", ")}`]:["Activate an extension that calls registerItemFields before setting extension fields."]})}A(a.name),r[a.name]=F(a.name,a.type,c)}return r}function I(e,t){return t==="string"?typeof e=="string":t==="number"?typeof e=="number"&&Number.isFinite(e):t==="boolean"?typeof e=="boolean":t==="array"?Array.isArray(e):t==="string_array"?Array.isArray(e)&&e.every(n=>typeof n=="string"):typeof e=="object"&&e!==null&&!Array.isArray(e)}function $(e,t){return!t||t.length===0?!0:t.some(n=>Object.is(n,e))}function G(e,t,n={}){if(t){y(t);for(let i of t.item_fields)for(let r of i.fields){let s=g(r.name);if(!s)continue;A(s),!(s in e)&&!n.skipDefaultFields?.has(s)&&Object.prototype.hasOwnProperty.call(r,"default")&&(e[s]=E(r.default));let o=e[s];if(o===void 0)continue;let c=w(r.type);if(c&&!I(o,c))throw new TypeError(`Item field "${s}" must be of type ${c}`);let a=Array.isArray(r.values)?r.values:void 0;if(!$(o,a))throw new TypeError(`Item field "${s}" must match one of the configured allowed values`)}}}export{u as a,D as b,U as c,G as d};
2
- //# sourceMappingURL=chunk-YW5GHQN2.js.map
1
+ import{G as h}from"./chunk-2V6NMNYN.js";import{A as f,m as b,z as l}from"./chunk-BPE6JTKL.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="300b6741-40eb-5bb1-bb0a-bb144d15946e")}catch{}})();var d=new Set(b),u=Object.freeze({get size(){return d.size},has(e){return d.has(e)},entries(){return d.entries()},keys(){return d.keys()},values(){return d.values()},forEach(e,t){d.forEach(n=>e.call(t,n,n,u))},[Symbol.iterator](){return d.values()}});function g(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}function w(e){return typeof e!="string"?null:h(e)}function E(e){try{return structuredClone(e)}catch{return e}}function x(e){let t=e.trim(),n=t.indexOf("=");if(n<=0)throw new f(`--field entries must use name=value syntax, received: ${e}`,l.USAGE);let i=t.slice(0,n).trim(),r=t.slice(n+1);return{key:i,value:r}}function S(e,t,n){try{let i=JSON.parse(e);if(n==="array"&&Array.isArray(i)||n==="object"&&typeof i=="object"&&i!==null&&!Array.isArray(i))return i}catch{}throw new f(`--field ${t}=... must be valid JSON ${n}`,l.USAGE)}function F(e,t,n){if(t==="string")return n;if(t==="number"){let i=n.trim();if(i.length===0)throw new f(`--field ${e}=... must be a number`,l.USAGE);let r=Number(i);if(!Number.isFinite(r))throw new f(`--field ${e}=... must be a number`,l.USAGE);return r}if(t==="boolean"){let i=n.trim().toLowerCase();if(i==="true"||i==="1"||i==="yes")return!0;if(i==="false"||i==="0"||i==="no")return!1;throw new f(`--field ${e}=... must be one of true|false|1|0|yes|no`,l.USAGE)}return t==="string_array"?n.split(/[\n,|]/u).map(i=>i.trim()).filter(i=>i.length>0):S(n,e,t)}function y(e){let t=new Map;if(!e)return t;for(let n of e.item_fields)for(let i of n.fields){let r=g(i.name),s=w(i.type);if(!r||!s)continue;let o=t.get(r);if(o&&o.type!==s)throw new f(`Extension item field "${r}" is declared with conflicting types: ${o.type}, ${s}`,l.USAGE,{code:"extension_item_field_type_conflict",nextSteps:["Make every active extension declaration for this field use the same type."]});t.set(r,{name:r,type:s})}return t}function A(e){if(u.has(e))throw new f(`Extension item field "${e}" collides with built-in item metadata "${e}"; rename the extension field with an extension-specific prefix. Reserved fields: ${[...u].sort((t,n)=>t.localeCompare(n)).join(", ")}.`,l.USAGE,{code:"extension_item_field_reserved",nextSteps:["Rename the extension item field, preferably with an extension-specific prefix."]})}function D(e){return[...y(e).keys()].sort((t,n)=>t.localeCompare(n))}function U(e,t,n){if(!e||e.length===0)return{};let i=y(t),r={};for(let s of e){let{key:o,value:c}=x(s),a=i.get(o);if(!a){if(u.has(o)){let m=n?.(o)??{recovery:{provided_fields:[o]},nextSteps:["Core metadata has no generic --field mutation path. Use the owning lifecycle, evidence, or importer API; inspect pm update <id> --help for declared mutation flags."]};throw new f(`--field ${o} is a core item field, not an extension field`,l.USAGE,{code:"core_item_field_requires_dedicated_flag",field:o,...m})}let p=[...i.keys()].sort((m,_)=>m.localeCompare(_));throw new f(`--field ${o} is not declared by an active extension item-field registration`,l.USAGE,{code:"extension_item_field_unknown",field:o,recovery:{provided_fields:[o]},nextSteps:p.length>0?[`Use one of the declared fields: ${p.join(", ")}`]:["Activate an extension that calls registerItemFields before setting extension fields."]})}A(a.name),r[a.name]=F(a.name,a.type,c)}return r}function I(e,t){return t==="string"?typeof e=="string":t==="number"?typeof e=="number"&&Number.isFinite(e):t==="boolean"?typeof e=="boolean":t==="array"?Array.isArray(e):t==="string_array"?Array.isArray(e)&&e.every(n=>typeof n=="string"):typeof e=="object"&&e!==null&&!Array.isArray(e)}function $(e,t){return!t||t.length===0?!0:t.some(n=>Object.is(n,e))}function G(e,t,n={}){if(t){y(t);for(let i of t.item_fields)for(let r of i.fields){let s=g(r.name);if(!s)continue;A(s),!(s in e)&&!n.skipDefaultFields?.has(s)&&Object.prototype.hasOwnProperty.call(r,"default")&&(e[s]=E(r.default));let o=e[s];if(o===void 0)continue;let c=w(r.type);if(c&&!I(o,c))throw new TypeError(`Item field "${s}" must be of type ${c}`);let a=Array.isArray(r.values)?r.values:void 0;if(!$(o,a))throw new TypeError(`Item field "${s}" must match one of the configured allowed values`)}}}export{u as a,D as b,U as c,G as d};
2
+ //# sourceMappingURL=chunk-3SRX77ES.js.map
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="6fd537c2-9d10-5a26-81a9-ac931151017b")}catch{}})();var s=["append","cancel","claim","close","comment_add","comment_edit","comment_delete","create","delete","docs_add","docs_remove","files_add","files_remove","files_discover","history_author_acknowledge","history_compact","history_compact_baseline","history_redact","history_repair","history_salvage","import","improvement_observe","learning_add","learning_edit","learning_delete","normalize","note_add","note_edit","note_delete","plan_create_metadata","plan_create_initial_step","plan_add_step","plan_reorder_step","plan_remove_step","plan_link_step","plan_unlink_step","plan_append_decision","plan_append_discovery","plan_append_validation","plan_resume","plan_approve","plan_materialize","plan_update_step","plan_complete_step","plan_block_step","policy_approve","policy_refused","release","reopen","restore","schema_migration","schema_migration_reference","test_run_track","tests_add","tests_remove","tests_update","update","update_audit","update_ownership_bypass","workspace_snapshot_restore","extension_migrations_apply","merge_reconcile"],n=["history:author-acknowledge","settings:write","init:type_preset","templates:save","profile:apply-types","profile:apply-statuses","profile:apply-fields","profile:apply-config","schema:add-type","schema:remove-type","schema:add-status","schema:remove-status","schema:add-field","schema:remove-field","schema:apply-preset","schema:infer-types","schema:policy-put","schema:policy-remove","schema:policy-mode","assurance:bundle:apply","assurance:gate:verdict","telemetry:install_id","telemetry:first_run_prompt","telemetry:clear","item_format:auto_select_default"],r={"init:type-preset":"init:type_preset"},o=["^config:(?:set|unset):[a-z][a-z0-9_.:-]*$","^assurance:(?:measurement|invariant|gate):(?:put|remove)$","^schema_(?:rename_type|rename_status|remap_status|rename_field|remove_type|remove_status|remove_field)(?:_compensate)?$","^extension:[a-z][a-z0-9_-]*:[a-z][a-z0-9_]*$"],d={version:1,item:s,workspace:n,aliases:r,patterns:o,read_policy:"preserve_original_operation",custom_operation_grammar:"extension:<package_name>:<snake_case_operation>",legacy_custom_operation_grammar:"lowercase segments separated by underscore, hyphen, colon, or dot; optional opaque colon-suffixed retry key",excluded_surfaces:["json_patch","on_write_hook","telemetry_span"]},l=new Set([...s,...n]),c=o.map(e=>new RegExp(e,"u"));function i(e){return Object.hasOwn(r,e)?r[e]:e}function m(e){let a=i(e);if(l.has(a)||c.some(t=>t.test(a)))return a;throw new TypeError("Undeclared history operation; use a native contract identity or extension:<package_name>:<snake_case_operation>.")}function u(e){let a=i(e),t=a.indexOf(":"),p=t<0?a:a.slice(0,t),_=t<0||t<a.length-1&&!/[\s\p{C}]/u.test(a.slice(t+1));if(/^[a-z][a-z0-9]*(?:[_.-][a-z0-9]+)*$/u.test(p)&&_)return a;throw new TypeError("History operation must use lowercase alphanumeric segments with an optional non-whitespace colon-suffixed retry key.")}export{s as a,n as b,r as c,o as d,d as e,i as f,m as g,u as h};
2
- //# sourceMappingURL=chunk-YLVHHWHN.js.map
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="7e894d1f-fe1a-53f2-9a29-4e9846a9f986")}catch{}})();var s=["append","cancel","claim","close","comment_add","comment_edit","comment_delete","create","delete","docs_add","docs_remove","files_add","files_remove","files_discover","history_author_acknowledge","history_compact","history_compact_baseline","history_redact","history_repair","history_salvage","import","improvement_observe","learning_add","learning_edit","learning_delete","normalize","note_add","note_edit","note_delete","plan_create_metadata","plan_create_initial_step","plan_add_step","plan_reorder_step","plan_remove_step","plan_link_step","plan_unlink_step","plan_append_decision","plan_append_discovery","plan_append_validation","plan_resume","plan_approve","plan_materialize","plan_update_step","plan_complete_step","plan_block_step","policy_approve","policy_refused","release","reopen","restore","schema_migration","schema_migration_reference","test_run_track","tests_add","tests_remove","tests_update","update","update_audit","update_ownership_bypass","workspace_snapshot_restore","extension_migrations_apply","merge_reconcile"],n=["history:author-acknowledge","settings:write","init:type_preset","templates:save","profile:apply-types","profile:apply-statuses","profile:apply-fields","profile:apply-config","schema:add-type","schema:remove-type","schema:add-status","schema:remove-status","schema:add-field","schema:remove-field","schema:apply-preset","schema:infer-types","schema:policy-put","schema:policy-remove","schema:policy-mode","assurance:bundle:apply","assurance:gate:verdict","telemetry:install_id","telemetry:first_run_prompt","telemetry:clear","item_format:auto_select_default","transaction_abandon"],r={"init:type-preset":"init:type_preset"},o=["^config:(?:set|unset):[a-z][a-z0-9_.:-]*$","^assurance:(?:measurement|invariant|gate):(?:put|remove)$","^schema_(?:rename_type|rename_status|remap_status|rename_field|remove_type|remove_status|remove_field)(?:_compensate)?$","^extension:[a-z][a-z0-9_-]*:[a-z][a-z0-9_]*$"],d={version:1,item:s,workspace:n,aliases:r,patterns:o,read_policy:"preserve_original_operation",custom_operation_grammar:"extension:<package_name>:<snake_case_operation>",legacy_custom_operation_grammar:"lowercase segments separated by underscore, hyphen, colon, or dot; optional opaque colon-suffixed retry key",excluded_surfaces:["json_patch","on_write_hook","telemetry_span"]},l=new Set([...s,...n]),c=o.map(e=>new RegExp(e,"u"));function i(e){return Object.hasOwn(r,e)?r[e]:e}function m(e){let a=i(e);if(l.has(a)||c.some(t=>t.test(a)))return a;throw new TypeError("Undeclared history operation; use a native contract identity or extension:<package_name>:<snake_case_operation>.")}function u(e){let a=i(e),t=a.indexOf(":"),p=t<0?a:a.slice(0,t),_=t<0||t<a.length-1&&!/[\s\p{C}]/u.test(a.slice(t+1));if(/^[a-z][a-z0-9]*(?:[_.-][a-z0-9]+)*$/u.test(p)&&_)return a;throw new TypeError("History operation must use lowercase alphanumeric segments with an optional non-whitespace colon-suffixed retry key.")}export{s as a,n as b,r as c,o as d,d as e,i as f,m as g,u as h};
2
+ //# sourceMappingURL=chunk-4PW5XWVI.js.map