@unbrained/pm-cli 2026.11.2 → 2026.11.4

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 (242) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +24 -0
  3. package/dist/cli/error-guidance.d.ts +23 -35
  4. package/dist/cli/error-guidance.js +4 -3
  5. package/dist/cli/expected-revisions.d.ts +55 -0
  6. package/dist/cli/expected-revisions.js +2 -0
  7. package/dist/cli/main.js +2 -2
  8. package/dist/cli/runtime/field-route-retry.d.ts +15 -0
  9. package/dist/cli/runtime/field-route-retry.js +2 -0
  10. package/dist/cli/runtime/invocation-options.js +1 -1
  11. package/dist/cli-bundle/bundle-manifest.json +1 -1
  12. package/dist/cli-bundle/chunks/{chunk-3A4NVHYS.js → chunk-2GW662DP.js} +2 -2
  13. package/dist/cli-bundle/chunks/chunk-3OXQGGRD.js +115 -0
  14. package/dist/cli-bundle/chunks/chunk-5BVZ32G7.js +2 -0
  15. package/dist/cli-bundle/chunks/chunk-5S6RT5LX.js +9 -0
  16. package/dist/cli-bundle/chunks/chunk-5Z6LWFDL.js +31 -0
  17. package/dist/cli-bundle/chunks/{chunk-RGHLQGEX.js → chunk-6T2V3UIK.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-JRXD7SIL.js → chunk-7PGNAHNW.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-7RCI7AAA.js +20 -0
  20. package/dist/cli-bundle/chunks/chunk-AQ5UHHQS.js +2 -0
  21. package/dist/cli-bundle/chunks/chunk-BK2XAQVC.js +2 -0
  22. package/dist/cli-bundle/chunks/{chunk-ABFFRQRO.js → chunk-BRIPGUAO.js} +2 -2
  23. package/dist/cli-bundle/chunks/chunk-BWAXA6S4.js +6 -0
  24. package/dist/cli-bundle/chunks/{chunk-HOGKWJU5.js → chunk-CERNIZLB.js} +66 -66
  25. package/dist/cli-bundle/chunks/chunk-DSCFJTHB.js +122 -0
  26. package/dist/cli-bundle/chunks/{chunk-VEOFWE32.js → chunk-L4BKTPJ6.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-NGRPD3ZO.js → chunk-NPEDFOVQ.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-J3JM36EH.js → chunk-O4ZLEN4T.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-533L6D2N.js → chunk-ODMJ3HIB.js} +3 -3
  30. package/dist/cli-bundle/chunks/{chunk-KJLGBLR3.js → chunk-QN7VCOUU.js} +2 -2
  31. package/dist/cli-bundle/chunks/chunk-QQHMNUZT.js +2 -0
  32. package/dist/cli-bundle/chunks/{chunk-D52QQ7LP.js → chunk-RSAN2YUU.js} +2 -2
  33. package/dist/cli-bundle/chunks/chunk-SRDO2NJU.js +2 -0
  34. package/dist/cli-bundle/chunks/chunk-T56MB6SF.js +2 -0
  35. package/dist/cli-bundle/chunks/chunk-TX2W6G37.js +3 -0
  36. package/dist/cli-bundle/chunks/{chunk-GK2CHAT3.js → chunk-UJMQP2HP.js} +2 -2
  37. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-IEJ2QOW3.js → indexed-receipt-blobs-I6RQGD6Y.js} +2 -2
  38. package/dist/cli-bundle/chunks/item-revision-UAZOBP2Q.js +2 -0
  39. package/dist/cli-bundle/chunks/item-transaction-N5F4LXYV.js +2 -0
  40. package/dist/cli-bundle/chunks/mutation-admission-QZQI2NN5.js +2 -0
  41. package/dist/cli-bundle/chunks/{register-list-query-NZTK3AXA.js → register-list-query-P3NOKQUA.js} +2 -2
  42. package/dist/cli-bundle/chunks/{register-mutation-2OFAMOVH.js → register-mutation-A6I5K5N6.js} +2 -2
  43. package/dist/cli-bundle/chunks/register-operations-SPKB3TNM.js +2 -0
  44. package/dist/cli-bundle/chunks/register-setup-ZZRHJ4IS.js +2 -0
  45. package/dist/cli-bundle/chunks/{settlement-hook-UTCEZBFT.js → settlement-hook-JHXLUBEN.js} +2 -2
  46. package/dist/cli-bundle/chunks/{stage-VLI4OBVX.js → stage-L3T725DS.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/chunk-5NGNO54M.js +44 -0
  48. package/dist/cli-bundle/focused-chunks/{chunk-PCCZ72C3.js → chunk-A2246ZM7.js} +54 -54
  49. package/dist/cli-bundle/focused-chunks/chunk-B6U44WPW.js +2 -0
  50. package/dist/cli-bundle/focused-chunks/chunk-BAW3DGQO.js +91 -0
  51. package/dist/cli-bundle/focused-chunks/chunk-BHNY3KPJ.js +2 -0
  52. package/dist/cli-bundle/focused-chunks/chunk-C3O6JJPO.js +2 -0
  53. package/dist/cli-bundle/focused-chunks/{chunk-745IDMTD.js → chunk-C7UX2ZI3.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/chunk-CBG67HUP.js +23 -0
  55. package/dist/cli-bundle/focused-chunks/{chunk-NJFMG3IK.js → chunk-CO2DNPH7.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/chunk-CXTDEQ3N.js +8 -0
  57. package/dist/cli-bundle/focused-chunks/chunk-FEPE2CE4.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-FFO7RBLN.js +2 -0
  59. package/dist/cli-bundle/focused-chunks/{chunk-QNXXOFLQ.js → chunk-FXFDVM5O.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-QVFE5LIX.js → chunk-G6ERMFJ5.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/chunk-I5LGPUWH.js +2 -0
  62. package/dist/cli-bundle/focused-chunks/{chunk-MQVBWFJF.js → chunk-IDAYTYNN.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/chunk-J3YOATXR.js +80 -0
  64. package/dist/cli-bundle/focused-chunks/{chunk-3UD6F2KQ.js → chunk-J6FDCAMH.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/chunk-J7M52SCZ.js +2 -0
  66. package/dist/cli-bundle/focused-chunks/chunk-JQS7TYQ6.js +12 -0
  67. package/dist/cli-bundle/focused-chunks/chunk-MEJKELWC.js +26 -0
  68. package/dist/cli-bundle/focused-chunks/chunk-PMKR4MJI.js +2 -0
  69. package/dist/cli-bundle/focused-chunks/chunk-PNPYQDHU.js +2 -0
  70. package/dist/cli-bundle/focused-chunks/chunk-Q4OIRSKL.js +2 -0
  71. package/dist/cli-bundle/focused-chunks/{chunk-I4Z2SCV5.js → chunk-QEVJ3Y67.js} +2 -2
  72. package/dist/cli-bundle/focused-chunks/{chunk-Q23K6WLV.js → chunk-SDLIUZEL.js} +2 -2
  73. package/dist/cli-bundle/focused-chunks/chunk-TFYTTDAK.js +2 -0
  74. package/dist/cli-bundle/focused-chunks/chunk-W3CSX6GI.js +3 -0
  75. package/dist/cli-bundle/focused-chunks/{chunk-B6OOKKOX.js → chunk-Y5GOUUYJ.js} +3 -3
  76. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-FT3KF6VJ.js → indexed-receipt-blobs-7XGVHYAO.js} +2 -2
  77. package/dist/cli-bundle/focused-chunks/item-revision-L6GVT42D.js +2 -0
  78. package/dist/cli-bundle/focused-chunks/item-transaction-GYGP264N.js +2 -0
  79. package/dist/cli-bundle/focused-chunks/mutation-admission-UWTH56OD.js +2 -0
  80. package/dist/cli-bundle/focused-chunks/{settlement-hook-KMIBD4F2.js → settlement-hook-H56537UV.js} +2 -2
  81. package/dist/cli-bundle/focused-chunks/{stage-6B3O2GZ6.js → stage-WRSNJ7VI.js} +2 -2
  82. package/dist/cli-bundle/main.js +30 -29
  83. package/dist/cli-bundle/sdk-authoring.js +1 -1
  84. package/dist/cli-bundle/sdk-contracts.js +5 -5
  85. package/dist/cli-bundle/sdk-core.js +1 -1
  86. package/dist/cli-bundle/sdk-governance.js +1 -1
  87. package/dist/cli-bundle/sdk-graph.js +1 -1
  88. package/dist/cli-bundle/sdk-merge.js +57 -57
  89. package/dist/cli-bundle/sdk-query.js +1 -1
  90. package/dist/cli-bundle/sdk-runtime.js +1 -1
  91. package/dist/cli-bundle/sdk-testing.js +1 -1
  92. package/dist/cli-bundle/sdk.js +11 -11
  93. package/dist/core/config/positional-value.d.ts +1 -1
  94. package/dist/core/config/positional-value.js +1 -1
  95. package/dist/core/extensions/extension-hook-runtime.js +1 -1
  96. package/dist/core/extensions/item-fields.d.ts +1 -1
  97. package/dist/core/extensions/item-fields.js +1 -1
  98. package/dist/core/extensions/reserved-host-flags.js +1 -1
  99. package/dist/core/history/history-rewrite.js +1 -1
  100. package/dist/core/schema/runtime-field-values.d.ts +30 -0
  101. package/dist/core/schema/runtime-field-values.js +1 -1
  102. package/dist/core/sentry/helpers.js +1 -1
  103. package/dist/core/sentry/instrument.js +1 -1
  104. package/dist/core/shared/command-types.d.ts +7 -0
  105. package/dist/core/shared/error-details.d.ts +98 -0
  106. package/dist/core/shared/error-details.js +2 -0
  107. package/dist/core/shared/errors.d.ts +37 -0
  108. package/dist/core/shared/errors.js +1 -1
  109. package/dist/core/store/item-mutation-precondition.d.ts +70 -6
  110. package/dist/core/store/item-mutation-precondition.js +1 -1
  111. package/dist/core/store/item-store.js +1 -1
  112. package/dist/core/store/settings-validator.js +1 -1
  113. package/dist/core/store/settings.js +1 -1
  114. package/dist/mcp/server.js +2 -2
  115. package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -1
  116. package/dist/sdk/cli-contracts/completeness.js +1 -1
  117. package/dist/sdk/cli-contracts/enum-contracts.d.ts +11 -0
  118. package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
  119. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  120. package/dist/sdk/cli-contracts/registration-helpers.js +1 -1
  121. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  122. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  123. package/dist/sdk/cli-program.js +1 -1
  124. package/dist/sdk/config.d.ts +1 -1
  125. package/dist/sdk/config.js +1 -1
  126. package/dist/sdk/environment/project-runtime-compatibility.js +1 -1
  127. package/dist/sdk/errors.d.ts +6 -2
  128. package/dist/sdk/errors.js +1 -1
  129. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  130. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  131. package/dist/sdk/governance/validate.js +1 -1
  132. package/dist/sdk/history/salvage.js +3 -3
  133. package/dist/sdk/history-compact.d.ts +7 -1
  134. package/dist/sdk/history-compact.js +1 -1
  135. package/dist/sdk/history-repair.d.ts +2 -1
  136. package/dist/sdk/history-repair.js +1 -1
  137. package/dist/sdk/index.d.ts +4 -1
  138. package/dist/sdk/index.js +1 -1
  139. package/dist/sdk/lifecycle/checkpoint-rollback.d.ts +10 -2
  140. package/dist/sdk/lifecycle/checkpoint-rollback.js +1 -1
  141. package/dist/sdk/lifecycle/claim.js +1 -1
  142. package/dist/sdk/lifecycle/close-many.d.ts +11 -2
  143. package/dist/sdk/lifecycle/close-many.js +1 -1
  144. package/dist/sdk/lifecycle/close.d.ts +15 -0
  145. package/dist/sdk/lifecycle/close.js +1 -1
  146. package/dist/sdk/lifecycle/core-field-recovery.d.ts +26 -0
  147. package/dist/sdk/lifecycle/core-field-recovery.js +1 -1
  148. package/dist/sdk/lifecycle/create.js +1 -1
  149. package/dist/sdk/lifecycle/item-revision.d.ts +162 -0
  150. package/dist/sdk/lifecycle/item-revision.js +2 -0
  151. package/dist/sdk/lifecycle/restore.js +1 -1
  152. package/dist/sdk/lifecycle/start-blockers.d.ts +52 -0
  153. package/dist/sdk/lifecycle/start-blockers.js +2 -0
  154. package/dist/sdk/lifecycle/task-composition.d.ts +11 -0
  155. package/dist/sdk/lifecycle/task-composition.js +1 -1
  156. package/dist/sdk/lifecycle/update-many.d.ts +11 -2
  157. package/dist/sdk/lifecycle/update-many.js +1 -1
  158. package/dist/sdk/lifecycle/update.js +2 -2
  159. package/dist/sdk/public-surface.json +1 -1
  160. package/dist/sdk/query/declared-blockers.d.ts +16 -0
  161. package/dist/sdk/query/declared-blockers.js +2 -0
  162. package/dist/sdk/query/get.d.ts +7 -0
  163. package/dist/sdk/query/get.js +1 -1
  164. package/dist/sdk/query/projection-contracts.js +1 -1
  165. package/dist/sdk/runtime-input.d.ts +12 -0
  166. package/dist/sdk/runtime-input.js +1 -1
  167. package/dist/sdk/runtime.d.ts +11 -1
  168. package/dist/sdk/runtime.js +1 -1
  169. package/dist/sdk/structured-mutations.js +1 -1
  170. package/dist/sdk/test/batch.js +2 -2
  171. package/dist/sdk/test/entry.d.ts +5 -0
  172. package/dist/sdk/test/entry.js +2 -2
  173. package/dist/sdk/test/execution.d.ts +1 -2
  174. package/dist/sdk/test/execution.js +2 -2
  175. package/dist/sdk/test/linked-command-detection.d.ts +10 -0
  176. package/dist/sdk/test/linked-command-detection.js +1 -1
  177. package/dist/sdk/test/update.d.ts +2 -0
  178. package/dist/sdk/test/update.js +1 -1
  179. package/dist/sdk/workspace-transaction.d.ts +17 -6
  180. package/dist/sdk/workspace-transaction.js +1 -1
  181. package/dist/types.d.ts +6 -0
  182. package/dist/types.js +1 -1
  183. package/docs/COMMANDS.md +91 -0
  184. package/docs/CONFIGURATION.md +1 -0
  185. package/docs/EXTENSIONS.md +2 -2
  186. package/docs/LINKED_TEST_EDITS.md +38 -5
  187. package/docs/SDK.md +185 -1
  188. package/docs/agent-task-token-baseline.json +1 -1
  189. package/docs/generated/FLAG_LEXICON_BUDGETS.md +111 -111
  190. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +15 -3
  191. package/marketplace.json +1 -1
  192. package/package.json +1 -1
  193. package/packages/pm-beads/package.json +1 -1
  194. package/packages/pm-calendar/package.json +1 -1
  195. package/packages/pm-command-kit/package.json +1 -1
  196. package/packages/pm-digital-twin/package.json +1 -1
  197. package/packages/pm-governance-audit/package.json +1 -1
  198. package/packages/pm-guide-shell/package.json +1 -1
  199. package/packages/pm-kanban/package.json +1 -1
  200. package/packages/pm-lifecycle-hooks/package.json +1 -1
  201. package/packages/pm-linked-test-adapters/package.json +1 -1
  202. package/packages/pm-search-advanced/package.json +1 -1
  203. package/packages/pm-templates/package.json +1 -1
  204. package/packages/pm-todos/package.json +1 -1
  205. package/packages/pm-vcs/package.json +1 -1
  206. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  207. package/plugins/pm-claude/package.json +1 -1
  208. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  209. package/plugins/pm-codex/package.json +1 -1
  210. package/plugins/pm-codex/plugin.json +1 -1
  211. package/runtime-dependencies.json +1 -1
  212. package/dist/cli-bundle/chunks/chunk-3ZQQVJT2.js +0 -20
  213. package/dist/cli-bundle/chunks/chunk-4HW253W2.js +0 -2
  214. package/dist/cli-bundle/chunks/chunk-4OELCF3O.js +0 -2
  215. package/dist/cli-bundle/chunks/chunk-BFZUJ5QP.js +0 -115
  216. package/dist/cli-bundle/chunks/chunk-DAZFCSDV.js +0 -2
  217. package/dist/cli-bundle/chunks/chunk-EN27ZQSV.js +0 -2
  218. package/dist/cli-bundle/chunks/chunk-K46GDAKX.js +0 -6
  219. package/dist/cli-bundle/chunks/chunk-OJR2YGXF.js +0 -31
  220. package/dist/cli-bundle/chunks/chunk-QHHFXNSQ.js +0 -3
  221. package/dist/cli-bundle/chunks/chunk-ZNWDYDFF.js +0 -129
  222. package/dist/cli-bundle/chunks/item-transaction-JHPBH6N7.js +0 -2
  223. package/dist/cli-bundle/chunks/mutation-admission-QUNQZCZ5.js +0 -2
  224. package/dist/cli-bundle/chunks/register-operations-RFMM5KZ6.js +0 -2
  225. package/dist/cli-bundle/chunks/register-setup-6B6Q7M5L.js +0 -2
  226. package/dist/cli-bundle/focused-chunks/chunk-4NVPDZLX.js +0 -12
  227. package/dist/cli-bundle/focused-chunks/chunk-4UUE3YXZ.js +0 -2
  228. package/dist/cli-bundle/focused-chunks/chunk-5UDDRPYR.js +0 -8
  229. package/dist/cli-bundle/focused-chunks/chunk-AK2CI2GI.js +0 -2
  230. package/dist/cli-bundle/focused-chunks/chunk-EJJWOFP5.js +0 -91
  231. package/dist/cli-bundle/focused-chunks/chunk-FUGYXUUL.js +0 -80
  232. package/dist/cli-bundle/focused-chunks/chunk-HMXVTWIV.js +0 -3
  233. package/dist/cli-bundle/focused-chunks/chunk-JLN5CFYM.js +0 -2
  234. package/dist/cli-bundle/focused-chunks/chunk-K4FMZB4Y.js +0 -23
  235. package/dist/cli-bundle/focused-chunks/chunk-PF553UVP.js +0 -44
  236. package/dist/cli-bundle/focused-chunks/chunk-RUCG6UWN.js +0 -2
  237. package/dist/cli-bundle/focused-chunks/chunk-SGWYNU7T.js +0 -2
  238. package/dist/cli-bundle/focused-chunks/chunk-TGS5RXBY.js +0 -26
  239. package/dist/cli-bundle/focused-chunks/chunk-WD43E7RU.js +0 -2
  240. package/dist/cli-bundle/focused-chunks/chunk-YM4AMP7H.js +0 -2
  241. package/dist/cli-bundle/focused-chunks/item-transaction-F4SN7TXJ.js +0 -2
  242. package/dist/cli-bundle/focused-chunks/mutation-admission-7R2FXJ5O.js +0 -2
@@ -0,0 +1,2 @@
1
+ import{H as h}from"./chunk-MEJKELWC.js";import{A as l,m as y,z as f}from"./chunk-G6ERMFJ5.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]="4e02447f-3fb0-5f7c-9512-be2b348fd082")}catch{}})();var d=new Set(y),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 b(e){return typeof e!="string"?null:h(e)}function w(e){try{return structuredClone(e)}catch{return e}}function A(e){let t=e.trim(),n=t.indexOf("=");if(n<=0)throw new l(`--field entries must use name=value syntax, received: ${e}`,f.USAGE);let i=t.slice(0,n).trim(),r=t.slice(n+1);return{key:i,value:r}}function E(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 l(`--field ${t}=... must be valid JSON ${n}`,f.USAGE)}function x(e,t,n){if(t==="string")return n;if(t==="number"){let i=n.trim();if(i.length===0)throw new l(`--field ${e}=... must be a number`,f.USAGE);let r=Number(i);if(!Number.isFinite(r))throw new l(`--field ${e}=... must be a number`,f.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 l(`--field ${e}=... must be one of true|false|1|0|yes|no`,f.USAGE)}return t==="string_array"?n.split(/[\n,|]/u).map(i=>i.trim()).filter(i=>i.length>0):E(n,e,t)}function p(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),o=b(i.type);if(!r||!o)continue;let s=t.get(r);if(s&&s.type!==o)throw new l(`Extension item field "${r}" is declared with conflicting types: ${s.type}, ${o}`,f.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:o})}return t}function _(e){if(u.has(e))throw new l(`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(", ")}.`,f.USAGE,{code:"extension_item_field_reserved",nextSteps:["Rename the extension item field, preferably with an extension-specific prefix."]})}function U(e){return[...p(e).keys()].sort((t,n)=>t.localeCompare(n))}function j(e,t,n,i){if(!e||e.length===0)return{};let r=p(t),o={};for(let s of e){let{key:a,value:m}=A(s),c=r.get(a);if(!c)throw $(a,r,n,i);_(c.name),o[c.name]=x(c.name,c.type,m)}return o}function $(e,t,n,i){if(u.has(e)){let s=n?.(e)??{recovery:{provided_fields:[e]},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."]};return new l(`--field ${e} is a core item field, not an extension field`,f.USAGE,{code:"core_item_field_requires_dedicated_flag",field:e,...s})}let r=i?.(e);if(r!==void 0){let s=r.recovery?.suggested_flags?.[0];return new l(s===void 0?`--field ${e} is a project-schema field, not an extension field`:`--field ${e} is a project-schema field; set it with its declared flag ${s}`,f.USAGE,{code:"project_schema_field_requires_declared_flag",field:e,changed:!1,...r})}let o=[...t.keys()].sort((s,a)=>s.localeCompare(a));return new l(`--field ${e} is not declared by an active extension item-field registration`,f.USAGE,{code:"extension_item_field_unknown",field:e,recovery:{provided_fields:[e]},nextSteps:o.length>0?[`Use one of the declared fields: ${o.join(", ")}`]:["Activate an extension that calls registerItemFields before setting extension fields."]})}function S(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 v(e,t){return!t||t.length===0?!0:t.some(n=>Object.is(n,e))}function D(e,t,n={}){if(t){p(t);for(let i of t.item_fields)for(let r of i.fields){let o=g(r.name);if(!o)continue;_(o),!(o in e)&&!n.skipDefaultFields?.has(o)&&Object.prototype.hasOwnProperty.call(r,"default")&&(e[o]=w(r.default));let s=e[o];if(s===void 0)continue;let a=b(r.type);if(a&&!S(s,a))throw new TypeError(`Item field "${o}" must be of type ${a}`);let m=Array.isArray(r.values)?r.values:void 0;if(!v(s,m))throw new TypeError(`Item field "${o}" must match one of the configured allowed values`)}}}export{u as a,U as b,j as c,D as d};
2
+ //# sourceMappingURL=chunk-FFO7RBLN.js.map
@@ -1,6 +1,6 @@
1
- import{c as T}from"./chunk-NJFMG3IK.js";import{a,d as I}from"./chunk-Q23K6WLV.js";import{Y as w,j as g,k as v,l as E}from"./chunk-TGS5RXBY.js";import{A as u,C as m,m as k,z as f}from"./chunk-QVFE5LIX.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-CO2DNPH7.js";import{a,d as I}from"./chunk-SDLIUZEL.js";import{Z as w,j as g,k as v,l as E}from"./chunk-MEJKELWC.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-QNXXOFLQ.js.map
6
+ //# sourceMappingURL=chunk-FXFDVM5O.js.map
@@ -1,3 +1,3 @@
1
- (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]="937c31e4-62a2-5815-8c7b-3640688b43b9")}catch{}})();var b=["commands","renderers","hooks","schema","importers","search","parser","preflight","services"],x=2,v=Object.freeze({migration:"schema",validation:"schema"}),F=Object.freeze({version:2,capabilities:[...b],legacy_aliases:{...v}}),M=["off","warn","enforce"],P=["off","warn","enforce"],U=["none","restricted","strict"],Y=["block","warn"],q=["commands.override","commands.handler","hooks.beforecommand","hooks.beforemutation","hooks.aftercommand","hooks.onwrite","hooks.onread","hooks.onindex","schema.flags","schema.itemfields","schema.itemtypes","schema.relationshipkinds","schema.migrations","schema.profiles","parser.override","preflight.override","services.override","renderers.override","importers.importer","importers.exporter","search.provider","search.vectorstore","services.assuranceprovider"],W=["output_format","error_format","help_format","lock_acquire","lock_release","history_append","item_store_write","item_store_delete","context_relevance","command_result"];function m(){return{mode:"off",trust_mode:"off",require_provenance:!1,trusted_extensions:[],default_sandbox_profile:"none",allowed_extensions:[],blocked_extensions:[],allowed_capabilities:[],blocked_capabilities:[],allowed_surfaces:[],blocked_surfaces:[],allowed_commands:[],blocked_commands:[],allowed_actions:[],blocked_actions:[],allowed_services:[],blocked_services:[],extension_overrides:[]}}(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]="3d6df465-e82e-57d8-a687-6c2e720c99c1")}catch{}})();var E=["goal","objective","value","impact","outcome","why_now","parent","reviewer","risk","confidence","sprint","release","blocked_by","blocked_reason","unblock_note","reporter","severity","environment","repro_steps","resolution","expected_result","actual_result"],T=["id","title","description","type","pm_format_version","source_type","type_options","status","priority","tags","created_at","updated_at","deadline","reminders","events","closed_at","completed_at","assignee","claim_principal","source_owner","author","estimated_minutes","acceptance_criteria","design","external_ref","definition_of_ready","order",...E,"affected_version","fixed_version","component","regression","customer_impact","dependencies","comments","notes","learnings","files","tests","test_runs","docs","close_reason","duplicate_of","plan_mode","plan_scope","plan_harness","plan_resume_context","plan_validation","plan_decisions","plan_discoveries","plan_steps"],k=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]="426ae308-83c5-5c99-bb0d-c63e9c890570")}catch{}})();var I=Object.freeze([{id:"draft",roles:["draft"]},{id:"open",roles:["active","default_open"]},{id:"in_progress",aliases:["in-progress"],roles:["active"]},{id:"blocked",roles:["blocked"]},{id:"closed",roles:["terminal","terminal_done","default_close"]},{id:"canceled",aliases:["cancelled"],roles:["terminal","terminal_canceled","default_cancel"]}]),O=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),G=".agents/pm",z="settings.json";var N=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],A=["decisions","events","reminders","milestones","meetings","plans"],$=[...N,...A],V={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},D={minimal:{ownership_enforcement:"none",create_mode_default:"progressive",close_validation_default:"off",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!1,duplicate_detection_mode:"off",duplicate_detection_threshold:.8,duplicate_detection_limit:3},default:{ownership_enforcement:"warn",create_mode_default:"progressive",close_validation_default:"warn",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3},strict:{ownership_enforcement:"strict",create_mode_default:"strict",close_validation_default:"strict",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"strict",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3}},S=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],f={blocked_reason:["no active blocker because work is closed","work is closed"],resolution:["closed with implementation evidence","closed with verification evidence","work completed and recorded","work is closed"],actual_result:["closed and recorded","work completed","work completed and recorded"]};function h(e){return e?[...e]:void 0}var J={version:1,id_prefix:"pm-",ids:{token_length:4},author_default:"",agent_identity:{probes_enabled:!0,identity_vocabulary:{version:1,aliases:{}},harness_signals:[]},mutation_guard:{require_attributed_author:!1,secret_guard:"advise",stale_in_progress_hours:72},item_format:"toon",locks:{ttl_seconds:1800,wait_ms:3e3},checkpoints:{retention_days:14},output:{default_format:"toon"},ux:{deprecation_hints:!0},history:{missing_stream:"auto_create",compact_policy:{enabled:!1,max_entries:500,trigger:"health_warn"}},validation:{sprint_release_format:"warn",parent_reference:"warn",metadata_profile:"core",metadata_required_fields:[],lifecycle_stale_blocker_reason_patterns:[...S],lifecycle_closure_like_blocked_reason_patterns:[...f.blocked_reason],lifecycle_closure_like_resolution_patterns:[...f.resolution],lifecycle_closure_like_actual_result_patterns:[...f.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...D.minimal},workflow:{definition_of_done:[]},testing:{record_results_to_items:!1,allow_untrusted_linked_tests:!1},telemetry:{enabled:!0,first_run_prompt_completed:!1,capture_level:"redacted",endpoint:"https://pm-cli.unbrained.dev/v1/events",installation_id:"",retention_days:365},agent_guidance:{prompt_completed:!1,declined:!1,declined_at:"",template_version:1,last_checked_files:[]},item_types:{definitions:[]},schema:{version:1,files:{types:"schema/types.json",statuses:"schema/statuses.json",fields:"schema/fields.json",workflows:"schema/workflows.json"},statuses:I.map(e=>({...e,aliases:h(e.aliases),roles:h(e.roles)})),fields:[],workflow:{...O},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:m()},search:{score_threshold:0,hybrid_semantic_weight:.7,max_results:50,embedding_model:"",embedding_batch_size:32,embedding_timeout_ms:3e4,scanner_max_batch_retries:3,provider:"",default_mode:"auto",mutation_refresh_policy:"semantic_configured",query_expansion:{enabled:!1,provider:""},rerank:{enabled:!1,model:"",top_k:20}},providers:{openai:{base_url:"",api_key:"",model:""},ollama:{base_url:"",model:""}},context:{default_depth:"brief",activity_limit:10,stale_threshold_days:7,next_ranking_policy:"priority_floor",sections:{hierarchy:!0,activity:!0,progress:!0,recently_created:!0,unparented:!0,blockers:!0,files:!0,workload:!0,staleness:!0,tests:!0}},vector_store:{adapter:"",collection_name:"pm_items",qdrant:{url:"",api_key:""},lancedb:{path:""}}},Q={metadata:{},body:""},y={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},Z=Object.freeze({unknown_command:"usage",unknown_option:"usage",missing_required_option:"usage",missing_required_argument:"usage",invalid_command_usage:"usage",linked_test_value_not_quoted:"usage",invalid_argument_value:"validation",health_findings:"validation",validation_findings:"validation",close_through_update:"validation",no_update_fields:"validation",unsupported_update_option:"validation",tracker_not_initialized:"validation",item_not_found:"validation",ownership_conflict:"conflict",lock_conflict:"conflict",terminal_state_conflict:"conflict",dependency_failed:"runtime",init_gitignore_unwritable:"runtime",merge_git_config_unwritable:"runtime",command_failed:"runtime",unknown_error:"runtime"});(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]="59ace77e-9dc1-59e8-aa2e-ee7364e04773")}catch{}})();var u=class extends Error{exitCode;code;context;constructor(t,o,i={}){super(t),this.name="PmCliError",this.exitCode=o,this.context=i,this.code=i.code}};import*as r from"node:fs/promises";import{constants as p}from"node:fs";import c from"node:path";import R from"node:crypto";(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]="3792f1fd-ed9d-5252-887d-e4517a55fb9c")}catch{}})();var C=[10,25,50,100];async function w(e){await r.mkdir(e,{recursive:!0})}async function ne(e){try{return await r.access(e),!0}catch{return!1}}function g(e){return L(e)||l(e,"ENOTDIR")}function L(e){return l(e,"ENOENT")}async function ae(e){try{return await r.readFile(e,"utf8")}catch(t){if(g(t))return null;throw t}}async function le(e,t){let o=await r.open(e,p.O_RDONLY|p.O_NOFOLLOW|p.O_NONBLOCK);try{if(!(await o.stat()).isFile())throw t;return await o.readFile("utf8")}finally{await o.close()}}function ce(e){let t=e?.replaceAll(c.sep,"/"),o=t!==void 0&&!c.posix.isAbsolute(t)&&!c.win32.isAbsolute(t)&&!t.split("/").includes(".."),i=o?t.split("/")[0]:void 0,s={"settings.json":"settings",runtime:"runtime",schema:"schema",history:"history",transactions:"transactions"},n=i===void 0?"tracker_storage":Object.hasOwn(s,i)?s[i]:"tracker_storage",d=o&&t.length>0&&t.length<=160&&t.split("/").every(a=>a!=="."&&/^[a-zA-Z0-9_.-]+$/u.test(a)),_=d?t:`${n} (entry name redacted)`;return new u(`Transaction preview requires regular files and directories. Inspect ${_} relative to the selected tracker root.`,y.USAGE,{code:"transaction_preview_non_regular_file",preview_storage:{storage_area:n,...d?{relative_entry:t}:{},entry_redacted:!d},required:"regular files and directories within the configured tracker storage",why:"Preview does not follow linked entries or read special files.",nextSteps:[`Inspect ${_} within the selected tracker for links, directories used as files, or special files; do not follow link targets.`,"Restore the intended regular files and directories, then retry the original dry-run command."]})}async function de(e,t,o={}){let i=c.dirname(e);o.createParentDirectories!==!1&&await w(i);let s=c.join(i,`.${c.basename(e)}.${process.pid}.${Date.now()}.${R.randomBytes(4).toString("hex")}.tmp`);await r.writeFile(s,t,"utf8");try{await r.rename(s,e)}catch(n){if(process.platform==="win32"&&(l(n,"EPERM")||l(n,"EBUSY"))){let d=n;for(let _ of C){await new Promise(a=>setTimeout(a,_));try{await r.rename(s,e);return}catch(a){if(d=a,!l(a,"EPERM")&&!l(a,"EBUSY"))break}}try{await r.unlink(s)}catch{}throw d}if(l(n,"EXDEV")){try{await r.copyFile(s,e)}finally{try{await r.unlink(s)}catch{}}return}try{await r.unlink(s)}catch{}throw n}}async function _e(e,t){let o=c.dirname(e);await w(o);let i=await r.open(e,"a");try{await i.writeFile(`${t}
1
+ (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]="937c31e4-62a2-5815-8c7b-3640688b43b9")}catch{}})();var b=["commands","renderers","hooks","schema","importers","search","parser","preflight","services"],x=2,v=Object.freeze({migration:"schema",validation:"schema"}),F=Object.freeze({version:2,capabilities:[...b],legacy_aliases:{...v}}),M=["off","warn","enforce"],P=["off","warn","enforce"],U=["none","restricted","strict"],Y=["block","warn"],q=["commands.override","commands.handler","hooks.beforecommand","hooks.beforemutation","hooks.aftercommand","hooks.onwrite","hooks.onread","hooks.onindex","schema.flags","schema.itemfields","schema.itemtypes","schema.relationshipkinds","schema.migrations","schema.profiles","parser.override","preflight.override","services.override","renderers.override","importers.importer","importers.exporter","search.provider","search.vectorstore","services.assuranceprovider"],W=["output_format","error_format","help_format","lock_acquire","lock_release","history_append","item_store_write","item_store_delete","context_relevance","command_result"];function m(){return{mode:"off",trust_mode:"off",require_provenance:!1,trusted_extensions:[],default_sandbox_profile:"none",allowed_extensions:[],blocked_extensions:[],allowed_capabilities:[],blocked_capabilities:[],allowed_surfaces:[],blocked_surfaces:[],allowed_commands:[],blocked_commands:[],allowed_actions:[],blocked_actions:[],allowed_services:[],blocked_services:[],extension_overrides:[]}}(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]="3d6df465-e82e-57d8-a687-6c2e720c99c1")}catch{}})();var E=["goal","objective","value","impact","outcome","why_now","parent","reviewer","risk","confidence","sprint","release","blocked_by","blocked_reason","unblock_note","reporter","severity","environment","repro_steps","resolution","expected_result","actual_result"],T=["id","title","description","type","pm_format_version","source_type","type_options","status","priority","tags","created_at","updated_at","deadline","reminders","events","closed_at","completed_at","assignee","claim_principal","source_owner","author","estimated_minutes","acceptance_criteria","design","external_ref","definition_of_ready","order",...E,"affected_version","fixed_version","component","regression","customer_impact","dependencies","comments","notes","learnings","files","tests","test_runs","docs","close_reason","duplicate_of","plan_mode","plan_scope","plan_harness","plan_resume_context","plan_validation","plan_decisions","plan_discoveries","plan_steps"],k=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]="426ae308-83c5-5c99-bb0d-c63e9c890570")}catch{}})();var I=Object.freeze([{id:"draft",roles:["draft"]},{id:"open",roles:["active","default_open"]},{id:"in_progress",aliases:["in-progress"],roles:["active"]},{id:"blocked",roles:["blocked"]},{id:"closed",roles:["terminal","terminal_done","default_close"]},{id:"canceled",aliases:["cancelled"],roles:["terminal","terminal_canceled","default_cancel"]}]),O=Object.freeze({draft_status:"draft",open_status:"open",in_progress_status:"in_progress",blocked_status:"blocked",close_status:"closed",canceled_status:"canceled"}),G=".agents/pm",z="settings.json";var N=["","epics","features","tasks","chores","issues","schema","history","search","extensions","locks"],A=["decisions","events","reminders","milestones","meetings","plans"],$=[...N,...A],V={Epic:"epics",Feature:"features",Task:"tasks",Chore:"chores",Issue:"issues",Decision:"decisions",Event:"events",Reminder:"reminders",Milestone:"milestones",Meeting:"meetings",Plan:"plans"},D={minimal:{ownership_enforcement:"none",create_mode_default:"progressive",close_validation_default:"off",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!1,duplicate_detection_mode:"off",duplicate_detection_threshold:.8,duplicate_detection_limit:3},default:{ownership_enforcement:"warn",create_mode_default:"progressive",close_validation_default:"warn",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"core",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3},strict:{ownership_enforcement:"strict",create_mode_default:"strict",close_validation_default:"strict",require_close_reason:!0,parent_reference:"strict_error",metadata_profile:"strict",force_required_for_stale_lock:!0,duplicate_detection_mode:"strict",duplicate_detection_threshold:.8,duplicate_detection_limit:3}},S=["no active blocker","ready for planned execution sequencing","work completed","work is closed"],f={blocked_reason:["no active blocker because work is closed","work is closed"],resolution:["closed with implementation evidence","closed with verification evidence","work completed and recorded","work is closed"],actual_result:["closed and recorded","work completed","work completed and recorded"]};function h(e){return e?[...e]:void 0}var J={version:1,id_prefix:"pm-",ids:{token_length:4},author_default:"",agent_identity:{probes_enabled:!0,identity_vocabulary:{version:1,aliases:{}},harness_signals:[]},mutation_guard:{require_attributed_author:!1,secret_guard:"advise",stale_in_progress_hours:72},item_format:"toon",locks:{ttl_seconds:1800,wait_ms:3e3},checkpoints:{retention_days:14},output:{default_format:"toon"},ux:{deprecation_hints:!0},history:{missing_stream:"auto_create",compact_policy:{enabled:!1,max_entries:500,trigger:"health_warn"}},validation:{sprint_release_format:"warn",parent_reference:"warn",metadata_profile:"core",metadata_required_fields:[],lifecycle_stale_blocker_reason_patterns:[...S],lifecycle_closure_like_blocked_reason_patterns:[...f.blocked_reason],lifecycle_closure_like_resolution_patterns:[...f.resolution],lifecycle_closure_like_actual_result_patterns:[...f.actual_result],estimate_defaults_by_type:{}},governance:{preset:"minimal",...D.minimal},workflow:{definition_of_done:[]},testing:{record_results_to_items:!1,allow_untrusted_linked_tests:!1},telemetry:{enabled:!0,first_run_prompt_completed:!1,capture_level:"redacted",endpoint:"https://pm-cli.unbrained.dev/v1/events",installation_id:"",retention_days:365},agent_guidance:{prompt_completed:!1,declined:!1,declined_at:"",template_version:1,last_checked_files:[]},item_types:{definitions:[]},schema:{version:1,files:{types:"schema/types.json",statuses:"schema/statuses.json",fields:"schema/fields.json",workflows:"schema/workflows.json"},statuses:I.map(e=>({...e,aliases:h(e.aliases),roles:h(e.roles)})),fields:[],workflow:{...O},unknown_field_policy:"allow"},extensions:{enabled:[],disabled:[],policy:m()},search:{score_threshold:0,hybrid_semantic_weight:.7,max_results:50,embedding_model:"",embedding_batch_size:32,embedding_timeout_ms:3e4,scanner_max_batch_retries:3,provider:"",default_mode:"auto",mutation_refresh_policy:"semantic_configured",query_expansion:{enabled:!1,provider:""},rerank:{enabled:!1,model:"",top_k:20}},providers:{openai:{base_url:"",api_key:"",model:""},ollama:{base_url:"",model:""}},context:{default_depth:"brief",activity_limit:10,stale_threshold_days:7,next_ranking_policy:"priority_floor",sections:{hierarchy:!0,activity:!0,progress:!0,recently_created:!0,unparented:!0,blockers:!0,files:!0,workload:!0,staleness:!0,tests:!0}},vector_store:{adapter:"",collection_name:"pm_items",qdrant:{url:"",api_key:""},lancedb:{path:""}}},Q={metadata:{},body:""},y={SUCCESS:0,GENERIC_FAILURE:1,USAGE:2,NOT_FOUND:3,CONFLICT:4,DEPENDENCY_FAILED:5,NO_EFFECT:6,PARTIAL_EFFECT:7},Z=Object.freeze({unknown_command:"usage",unknown_option:"usage",missing_required_option:"usage",missing_required_argument:"usage",invalid_command_usage:"usage",linked_test_value_not_quoted:"usage",invalid_argument_value:"validation",health_findings:"validation",validation_findings:"validation",close_through_update:"validation",no_update_fields:"validation",unsupported_update_option:"validation",tracker_not_initialized:"validation",item_not_found:"validation",ownership_conflict:"conflict",lock_conflict:"conflict",terminal_state_conflict:"conflict",dependency_failed:"runtime",init_gitignore_unwritable:"runtime",merge_git_config_unwritable:"runtime",command_failed:"runtime",unknown_error:"runtime"});(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]="9896afd0-b833-5b30-b047-4881891d3976")}catch{}})();var u=class extends Error{exitCode;code;context;constructor(t,o,i={}){super(t),this.name="PmCliError",this.exitCode=o,this.context=i,this.code=i.code}};import*as r from"node:fs/promises";import{constants as p}from"node:fs";import c from"node:path";import R from"node:crypto";(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]="3792f1fd-ed9d-5252-887d-e4517a55fb9c")}catch{}})();var C=[10,25,50,100];async function w(e){await r.mkdir(e,{recursive:!0})}async function ne(e){try{return await r.access(e),!0}catch{return!1}}function g(e){return L(e)||l(e,"ENOTDIR")}function L(e){return l(e,"ENOENT")}async function ae(e){try{return await r.readFile(e,"utf8")}catch(t){if(g(t))return null;throw t}}async function le(e,t){let o=await r.open(e,p.O_RDONLY|p.O_NOFOLLOW|p.O_NONBLOCK);try{if(!(await o.stat()).isFile())throw t;return await o.readFile("utf8")}finally{await o.close()}}function ce(e){let t=e?.replaceAll(c.sep,"/"),o=t!==void 0&&!c.posix.isAbsolute(t)&&!c.win32.isAbsolute(t)&&!t.split("/").includes(".."),i=o?t.split("/")[0]:void 0,s={"settings.json":"settings",runtime:"runtime",schema:"schema",history:"history",transactions:"transactions"},n=i===void 0?"tracker_storage":Object.hasOwn(s,i)?s[i]:"tracker_storage",d=o&&t.length>0&&t.length<=160&&t.split("/").every(a=>a!=="."&&/^[a-zA-Z0-9_.-]+$/u.test(a)),_=d?t:`${n} (entry name redacted)`;return new u(`Transaction preview requires regular files and directories. Inspect ${_} relative to the selected tracker root.`,y.USAGE,{code:"transaction_preview_non_regular_file",preview_storage:{storage_area:n,...d?{relative_entry:t}:{},entry_redacted:!d},required:"regular files and directories within the configured tracker storage",why:"Preview does not follow linked entries or read special files.",nextSteps:[`Inspect ${_} within the selected tracker for links, directories used as files, or special files; do not follow link targets.`,"Restore the intended regular files and directories, then retry the original dry-run command."]})}async function de(e,t,o={}){let i=c.dirname(e);o.createParentDirectories!==!1&&await w(i);let s=c.join(i,`.${c.basename(e)}.${process.pid}.${Date.now()}.${R.randomBytes(4).toString("hex")}.tmp`);await r.writeFile(s,t,"utf8");try{await r.rename(s,e)}catch(n){if(process.platform==="win32"&&(l(n,"EPERM")||l(n,"EBUSY"))){let d=n;for(let _ of C){await new Promise(a=>setTimeout(a,_));try{await r.rename(s,e);return}catch(a){if(d=a,!l(a,"EPERM")&&!l(a,"EBUSY"))break}}try{await r.unlink(s)}catch{}throw d}if(l(n,"EXDEV")){try{await r.copyFile(s,e)}finally{try{await r.unlink(s)}catch{}}return}try{await r.unlink(s)}catch{}throw n}}async function _e(e,t){let o=c.dirname(e);await w(o);let i=await r.open(e,"a");try{await i.writeFile(`${t}
2
2
  `,"utf8")}finally{await i.close()}}async function ue(e){try{await r.unlink(e)}catch(t){if(!g(t))throw t}}function l(e,t){return typeof e=="object"&&e!==null&&"code"in e&&e.code===t}export{b as a,x as b,v as c,F as d,M as e,P as f,U as g,Y as h,q as i,W as j,m as k,E as l,k as m,I as n,O as o,G as p,z as q,N as r,$ as s,V as t,D as u,S as v,f as w,J as x,Q as y,y as z,u as A,w as B,ne as C,g as D,L as E,ae as F,le as G,ce as H,de as I,_e as J,ue as K};
3
- //# sourceMappingURL=chunk-QVFE5LIX.js.map
3
+ //# sourceMappingURL=chunk-G6ERMFJ5.js.map
@@ -0,0 +1,2 @@
1
+ (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]="bfaa3455-3237-5c98-8ef4-b353ce9530fe")}catch{}})();var n=Object.freeze({rows:10,paths:5,samples:10,path_depth:8,visited_paths:1e4});export{n as a};
2
+ //# sourceMappingURL=chunk-I5LGPUWH.js.map
@@ -1,4 +1,4 @@
1
- import{A as u,E as p,z as h}from"./chunk-QVFE5LIX.js";import{readFile as b,realpath as y,stat as _,writeFile as $}from"node:fs/promises";import l from"node:path";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="38df9536-d87a-52ac-958d-091a17c9da9c")}catch{}})();var d="# pm-cli:runtime-cache:start",f="# pm-cli:runtime-cache:end",E=".agents/pm";async function m(n){let e=l.resolve(n),t=[];for(;;)try{let i=await y(e);if(!(await _(i)).isDirectory())throw Object.assign(new Error("Initialization path ancestry must be a directory."),{code:"ENOTDIR"});return l.join(i,...t)}catch(i){if(!p(i)||l.dirname(e)===e)throw i;t.unshift(l.basename(e)),e=l.dirname(e)}}var R=["runtime/","search/","locks/","transactions/","checkpoints/"],T=["search/eval-queries.json"];async function w(n){try{return await n()}catch(e){throw e instanceof Error&&"code"in e&&typeof e.code=="string"&&["EACCES","EPERM","EROFS"].includes(e.code)?new u("The workspace .gitignore is not writable.",h.GENERIC_FAILURE,{code:"init_gitignore_unwritable",reason:e.code.toLowerCase(),required:"Grant the current user read and write access to the workspace .gitignore before initialization.",why:"pm init must publish its managed runtime-cache ignore fence without replacing unrelated entries.",nextSteps:["Grant read and write access to the workspace .gitignore and rerun pm init.","If the workspace is intentionally read-only, initialize pm in a writable workspace or clone."]}):e}}function I(n){let e=n.split(l.sep).join("/").replace(/^\.\/+/,""),t=e.length;for(;t>0&&e[t-1]==="/";)t-=1;return e.slice(0,t)}function k(n){let e=n.replaceAll("\\","/");return l.isAbsolute(n)||e===".."||e.startsWith("../")}function G(n=E){let e=I(n);if(/[\r\n]/u.test(e))throw new u("A tracker path containing a line break cannot be represented safely in .gitignore.",h.USAGE,{code:"invalid_argument_value",required:"a tracker path without line breaks",nextSteps:["Choose a tracker path without carriage returns or newlines and rerun pm init."]});let t=e.replace(/[\\*?[\]#! \t]/gu,"\\$&");return[d,...R.map(i=>i==="search/"?`${t}/${i}*`:`${t}/${i}`),...T.map(i=>`!${t}/${i}`),f].join(`
1
+ import{A as u,E as p,z as h}from"./chunk-G6ERMFJ5.js";import{readFile as b,realpath as y,stat as _,writeFile as $}from"node:fs/promises";import l from"node:path";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new n.Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="38df9536-d87a-52ac-958d-091a17c9da9c")}catch{}})();var d="# pm-cli:runtime-cache:start",f="# pm-cli:runtime-cache:end",E=".agents/pm";async function m(n){let e=l.resolve(n),t=[];for(;;)try{let i=await y(e);if(!(await _(i)).isDirectory())throw Object.assign(new Error("Initialization path ancestry must be a directory."),{code:"ENOTDIR"});return l.join(i,...t)}catch(i){if(!p(i)||l.dirname(e)===e)throw i;t.unshift(l.basename(e)),e=l.dirname(e)}}var R=["runtime/","search/","locks/","transactions/","checkpoints/"],T=["search/eval-queries.json"];async function w(n){try{return await n()}catch(e){throw e instanceof Error&&"code"in e&&typeof e.code=="string"&&["EACCES","EPERM","EROFS"].includes(e.code)?new u("The workspace .gitignore is not writable.",h.GENERIC_FAILURE,{code:"init_gitignore_unwritable",reason:e.code.toLowerCase(),required:"Grant the current user read and write access to the workspace .gitignore before initialization.",why:"pm init must publish its managed runtime-cache ignore fence without replacing unrelated entries.",nextSteps:["Grant read and write access to the workspace .gitignore and rerun pm init.","If the workspace is intentionally read-only, initialize pm in a writable workspace or clone."]}):e}}function I(n){let e=n.split(l.sep).join("/").replace(/^\.\/+/,""),t=e.length;for(;t>0&&e[t-1]==="/";)t-=1;return e.slice(0,t)}function k(n){let e=n.replaceAll("\\","/");return l.isAbsolute(n)||e===".."||e.startsWith("../")}function G(n=E){let e=I(n);if(/[\r\n]/u.test(e))throw new u("A tracker path containing a line break cannot be represented safely in .gitignore.",h.USAGE,{code:"invalid_argument_value",required:"a tracker path without line breaks",nextSteps:["Choose a tracker path without carriage returns or newlines and rerun pm init."]});let t=e.replace(/[\\*?[\]#! \t]/gu,"\\$&");return[d,...R.map(i=>i==="search/"?`${t}/${i}*`:`${t}/${i}`),...T.map(i=>`!${t}/${i}`),f].join(`
2
2
  `)}function O(n,e,t){let i=e.replace(/[\\*?[\]#! \t]/gu,"\\$&"),o=[...new Set([e,i])].flatMap(s=>R.flatMap(c=>[`${s}/${c}`,`!${s}/${c}`])),a=[],r=!1;for(let s of n)o.some(c=>s.startsWith(c))?(r||a.push(...t),r=!0):a.push(s);return r||a.push(...t),a}function P(n){let e=[],t=-1,i=0,o=0;for(let a of n.split(`
3
3
  `)){let r=a.endsWith("\r")?a.slice(0,-1):a;r===d?(t=o,i=o+a.length+1):r===f&&t>=0&&(e.push({index:t,end:o+r.length,lines:n.slice(i,o).split(/\r?\n/u).filter(s=>s.length>0)}),t=-1),o+=a.length+1}return e}function v(n,e){let t=n.includes(`\r
4
4
  `)?`\r
@@ -6,4 +6,4 @@ import{A as u,E as p,z as h}from"./chunk-QVFE5LIX.js";import{readFile as b,realp
6
6
  `,i=G(e).split(`
7
7
  `).slice(1,-1),o=P(n),a=o.flatMap(c=>c.lines),r=[d,...O(a,e,i),f].join(t);if(o.length===0){let c=n.length===0?"":n.endsWith(`
8
8
  `)?t:`${t}${t}`;return`${n}${c}${r}${t}`}let s=n;for(let[c,g]of[...o.entries()].reverse())s=`${s.slice(0,g.index)}${c===0?r:""}${s.slice(g.end)}`;return s}async function S(n,e={}){let t=l.join(n,".gitignore"),i=E;if(e.pmRoot!==void 0){let r=I(l.relative(await m(n),await m(e.pmRoot)));if(k(r))return{path:t,changed:!1};i=r}let o="";try{o=await w(()=>b(t,"utf8"))}catch(r){if(!(r instanceof Error&&"code"in r&&p(r)))throw r}let a=v(o,i);return a===o?{path:t,changed:!1}:(await w(()=>$(t,a,"utf8")),{path:t,changed:!0})}export{R as a,k as b,S as c};
9
- //# sourceMappingURL=chunk-MQVBWFJF.js.map
9
+ //# sourceMappingURL=chunk-IDAYTYNN.js.map