@unbrained/pm-cli 2026.9.21 → 2026.9.23

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 (255) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +27 -1
  3. package/dist/cli/commander-usage.d.ts +5 -1
  4. package/dist/cli/commander-usage.js +2 -2
  5. package/dist/cli/commands/annotations/comments.d.ts +2 -0
  6. package/dist/cli/commands/{comments.js → annotations/comments.js} +1 -1
  7. package/dist/cli/commands/{docs.d.ts → annotations/docs.d.ts} +2 -2
  8. package/dist/cli/commands/{docs.js → annotations/docs.js} +1 -1
  9. package/dist/cli/commands/{files.d.ts → annotations/files.d.ts} +2 -2
  10. package/dist/cli/commands/{files.js → annotations/files.js} +1 -1
  11. package/dist/cli/commands/annotations/learnings.d.ts +2 -0
  12. package/dist/cli/commands/{learnings.js → annotations/learnings.js} +1 -1
  13. package/dist/cli/commands/annotations/notes.d.ts +2 -0
  14. package/dist/cli/commands/{notes.js → annotations/notes.js} +1 -1
  15. package/dist/cli/commands/extension/extension.d.ts +6 -0
  16. package/dist/cli/commands/{extension.js → extension/extension.js} +1 -1
  17. package/dist/cli/commands/{gc.d.ts → governance/gc.d.ts} +2 -2
  18. package/dist/cli/commands/{gc.js → governance/gc.js} +1 -1
  19. package/dist/cli/commands/governance/health.d.ts +6 -0
  20. package/dist/cli/commands/{deps.js → governance/health.js} +2 -2
  21. package/dist/cli/commands/governance/telemetry.d.ts +6 -0
  22. package/dist/cli/commands/{telemetry.js → governance/telemetry.js} +1 -1
  23. package/dist/cli/commands/governance/validate.d.ts +9 -0
  24. package/dist/cli/commands/governance/validate.js +2 -0
  25. package/dist/cli/commands/history/activity.d.ts +6 -0
  26. package/dist/cli/commands/{activity.js → history/activity.js} +1 -1
  27. package/dist/cli/commands/history/history-compact.d.ts +7 -0
  28. package/dist/cli/commands/{history-compact.js → history/history-compact.js} +1 -1
  29. package/dist/cli/commands/{history-redact.d.ts → history/history-redact.d.ts} +2 -2
  30. package/dist/cli/commands/history/history-redact.js +2 -0
  31. package/dist/cli/commands/{history-repair.d.ts → history/history-repair.d.ts} +2 -2
  32. package/dist/cli/commands/{history-repair.js → history/history-repair.js} +1 -1
  33. package/dist/cli/commands/history/history.d.ts +2 -0
  34. package/dist/cli/commands/{history.js → history/history.js} +1 -1
  35. package/dist/cli/commands/history/restore.d.ts +6 -0
  36. package/dist/cli/commands/history/restore.js +2 -0
  37. package/dist/cli/commands/lifecycle/append.d.ts +2 -0
  38. package/dist/cli/commands/{append.js → lifecycle/append.js} +1 -1
  39. package/dist/cli/commands/lifecycle/claim.d.ts +2 -0
  40. package/dist/cli/commands/{claim.js → lifecycle/claim.js} +1 -1
  41. package/dist/cli/commands/lifecycle/close-many.d.ts +2 -0
  42. package/dist/cli/commands/{close-many.js → lifecycle/close-many.js} +1 -1
  43. package/dist/cli/commands/lifecycle/close.d.ts +6 -0
  44. package/dist/cli/commands/lifecycle/close.js +2 -0
  45. package/dist/cli/commands/lifecycle/copy.d.ts +6 -0
  46. package/dist/cli/commands/lifecycle/copy.js +2 -0
  47. package/dist/cli/commands/lifecycle/create.d.ts +6 -0
  48. package/dist/cli/commands/{create.js → lifecycle/create.js} +1 -1
  49. package/dist/cli/commands/lifecycle/delete.d.ts +6 -0
  50. package/dist/cli/commands/{delete.js → lifecycle/delete.js} +1 -1
  51. package/dist/cli/commands/lifecycle/focus.d.ts +6 -0
  52. package/dist/cli/commands/lifecycle/focus.js +2 -0
  53. package/dist/cli/commands/lifecycle/plan.d.ts +6 -0
  54. package/dist/cli/commands/{plan.js → lifecycle/plan.js} +1 -1
  55. package/dist/cli/commands/lifecycle/update-many.d.ts +2 -0
  56. package/dist/cli/commands/lifecycle/update-many.js +2 -0
  57. package/dist/cli/commands/lifecycle/update.d.ts +6 -0
  58. package/dist/cli/commands/{copy.js → lifecycle/update.js} +2 -2
  59. package/dist/cli/commands/query/aggregate.d.ts +2 -0
  60. package/dist/cli/commands/{aggregate.js → query/aggregate.js} +1 -1
  61. package/dist/cli/commands/query/context.d.ts +6 -0
  62. package/dist/cli/commands/{focus.js → query/context.js} +2 -2
  63. package/dist/cli/commands/{deps.d.ts → query/deps.d.ts} +2 -2
  64. package/dist/cli/commands/query/deps.js +2 -0
  65. package/dist/cli/commands/query/duplicates.d.ts +6 -0
  66. package/dist/cli/commands/{duplicates.js → query/duplicates.js} +1 -1
  67. package/dist/cli/commands/{eval.d.ts → query/eval.d.ts} +2 -2
  68. package/dist/cli/commands/{eval.js → query/eval.js} +1 -1
  69. package/dist/cli/commands/query/get.d.ts +6 -0
  70. package/dist/cli/commands/{get.js → query/get.js} +1 -1
  71. package/dist/cli/commands/{graph.d.ts → query/graph.d.ts} +2 -2
  72. package/dist/cli/commands/{graph.js → query/graph.js} +1 -1
  73. package/dist/cli/commands/{list.d.ts → query/list.d.ts} +2 -2
  74. package/dist/cli/commands/{list.js → query/list.js} +1 -1
  75. package/dist/cli/commands/{next.d.ts → query/next.d.ts} +2 -2
  76. package/dist/cli/commands/{next.js → query/next.js} +1 -1
  77. package/dist/cli/commands/query/search.d.ts +6 -0
  78. package/dist/cli/commands/{search.js → query/search.js} +1 -1
  79. package/dist/cli/commands/query/stats.d.ts +6 -0
  80. package/dist/cli/commands/{stats.js → query/stats.js} +1 -1
  81. package/dist/cli/commands/{test-all.d.ts → test/test-all.d.ts} +2 -2
  82. package/dist/cli/commands/{test-all.js → test/test-all.js} +1 -1
  83. package/dist/cli/commands/{test-runs.d.ts → test/test-runs.d.ts} +2 -2
  84. package/dist/cli/commands/{test-runs.js → test/test-runs.js} +1 -1
  85. package/dist/cli/commands/{test.d.ts → test/test.d.ts} +2 -2
  86. package/dist/cli/commands/{test.js → test/test.js} +1 -1
  87. package/dist/cli/commands/{config.d.ts → workspace/config.d.ts} +2 -2
  88. package/dist/cli/commands/{config.js → workspace/config.js} +1 -1
  89. package/dist/cli/commands/workspace/contracts.d.ts +2 -0
  90. package/dist/cli/commands/{contracts.js → workspace/contracts.js} +1 -1
  91. package/dist/cli/commands/{init.d.ts → workspace/init.d.ts} +2 -2
  92. package/dist/cli/commands/{update.js → workspace/init.js} +2 -2
  93. package/dist/cli/commands/workspace/merge.d.ts +8 -0
  94. package/dist/cli/commands/workspace/merge.js +2 -0
  95. package/dist/cli/commands/{profile.d.ts → workspace/profile.d.ts} +2 -2
  96. package/dist/cli/commands/{profile.js → workspace/profile.js} +1 -1
  97. package/dist/cli/commands/workspace/schema.d.ts +7 -0
  98. package/dist/cli/commands/workspace/schema.js +2 -0
  99. package/dist/cli/commands/workspace/upgrade.d.ts +2 -0
  100. package/dist/cli/commands/{update-many.js → workspace/upgrade.js} +2 -2
  101. package/dist/cli/register-annotations.js +1 -1
  102. package/dist/cli/register-history-activity.js +1 -1
  103. package/dist/cli/register-history-maintenance.js +1 -1
  104. package/dist/cli/register-list-query.js +1 -1
  105. package/dist/cli/register-mutation.js +1 -1
  106. package/dist/cli/register-operations.js +1 -1
  107. package/dist/cli/register-setup.js +1 -1
  108. package/dist/cli/schema/registration.js +1 -1
  109. package/dist/cli/stats-analytics-json.d.ts +1 -1
  110. package/dist/cli/stats-analytics-json.js +1 -1
  111. package/dist/cli-bundle/bundle-manifest.json +154 -154
  112. package/dist/cli-bundle/chunks/{chunk-2QLXN6HZ.js → chunk-6WBR6GMW.js} +26 -26
  113. package/dist/cli-bundle/chunks/{chunk-JBJUOOJI.js → chunk-7IABMUB6.js} +6 -6
  114. package/dist/cli-bundle/chunks/{chunk-7YUYLYJQ.js → chunk-E6ZES2X7.js} +6 -6
  115. package/dist/cli-bundle/chunks/{chunk-2UNYUB4A.js → chunk-KOUT5SAA.js} +2 -2
  116. package/dist/cli-bundle/chunks/{chunk-NHRB3L5T.js → chunk-NBGSRFZE.js} +2 -2
  117. package/dist/cli-bundle/chunks/{chunk-K7RWRJLT.js → chunk-OBTHQ6UX.js} +2 -2
  118. package/dist/cli-bundle/chunks/{chunk-GRHSNUQO.js → chunk-PFWCAI4X.js} +2 -2
  119. package/dist/cli-bundle/chunks/chunk-SGFQQXFD.js +2 -0
  120. package/dist/cli-bundle/chunks/{chunk-HAFSMFJK.js → chunk-SXRMM72R.js} +3 -3
  121. package/dist/cli-bundle/chunks/{chunk-SDLBF4PY.js → chunk-VO7DHENB.js} +2 -2
  122. package/dist/cli-bundle/chunks/{chunk-QZTS23BV.js → chunk-WBB5B7G5.js} +2 -2
  123. package/dist/cli-bundle/chunks/{chunk-FBWAECBI.js → chunk-ZSVINTXT.js} +3 -3
  124. package/dist/cli-bundle/chunks/{chunk-4SI67A2F.js → chunk-ZWSWR2GX.js} +2 -2
  125. package/dist/cli-bundle/chunks/{register-list-query-5V43MYPN.js → register-list-query-IFPQ4YRD.js} +2 -2
  126. package/dist/cli-bundle/chunks/register-mutation-C3O7OSXW.js +20 -0
  127. package/dist/cli-bundle/chunks/{register-operations-LJU5H2CU.js → register-operations-LGO7DBZ7.js} +2 -2
  128. package/dist/cli-bundle/chunks/{register-setup-HJUNGYBB.js → register-setup-4EW2PPZD.js} +2 -2
  129. package/dist/cli-bundle/focused-chunks/{chunk-UIS5FVHH.js → chunk-3JAEZ7WI.js} +49 -49
  130. package/dist/cli-bundle/focused-chunks/{chunk-6MNKQKT6.js → chunk-6CWR2QFM.js} +2 -2
  131. package/dist/cli-bundle/focused-chunks/{chunk-HYPK5OPA.js → chunk-BKXYQQDT.js} +2 -2
  132. package/dist/cli-bundle/focused-chunks/{chunk-N6KI3LWF.js → chunk-BQSKFRL2.js} +2 -2
  133. package/dist/cli-bundle/focused-chunks/{chunk-PC6ZZVNP.js → chunk-BULUJEOL.js} +3 -3
  134. package/dist/cli-bundle/focused-chunks/{chunk-L6L4XCLY.js → chunk-E5AOEXF5.js} +2 -2
  135. package/dist/cli-bundle/focused-chunks/{chunk-3XPBKIV6.js → chunk-FIQYVDLL.js} +12 -12
  136. package/dist/cli-bundle/focused-chunks/{chunk-FXAZPSU6.js → chunk-HJA6OHWT.js} +2 -2
  137. package/dist/cli-bundle/focused-chunks/{chunk-DPBTIFW7.js → chunk-KMNH4G6Y.js} +2 -2
  138. package/dist/cli-bundle/focused-chunks/{chunk-RQL5WLNZ.js → chunk-L554BKFH.js} +2 -2
  139. package/dist/cli-bundle/focused-chunks/{chunk-ISEOBALS.js → chunk-LZOEUNHR.js} +2 -2
  140. package/dist/cli-bundle/focused-chunks/{chunk-U2SB2BMM.js → chunk-N2JYYEHM.js} +2 -2
  141. package/dist/cli-bundle/focused-chunks/{chunk-5BLRMUMK.js → chunk-PIHQNL32.js} +3 -3
  142. package/dist/cli-bundle/focused-chunks/{chunk-IA5CCSBB.js → chunk-QREDJ77O.js} +2 -2
  143. package/dist/cli-bundle/focused-chunks/{chunk-DRNXMOSV.js → chunk-S5JYIFFS.js} +2 -2
  144. package/dist/cli-bundle/focused-chunks/{chunk-K5ZCBC6Y.js → chunk-YE6F5HGF.js} +2 -2
  145. package/dist/cli-bundle/main.js +18 -18
  146. package/dist/cli-bundle/sdk-authoring.js +1 -1
  147. package/dist/cli-bundle/sdk-contracts.js +1 -1
  148. package/dist/cli-bundle/sdk-core.js +3 -3
  149. package/dist/cli-bundle/sdk-governance.js +1 -1
  150. package/dist/cli-bundle/sdk-graph.js +1 -1
  151. package/dist/cli-bundle/sdk-merge.js +38 -38
  152. package/dist/cli-bundle/sdk-query.js +1 -1
  153. package/dist/cli-bundle/sdk-runtime.js +1 -1
  154. package/dist/cli-bundle/sdk-testing.js +1 -1
  155. package/dist/cli-bundle/sdk.js +1 -1
  156. package/dist/core/config/positional-value.d.ts +0 -2
  157. package/dist/core/config/positional-value.js +1 -1
  158. package/dist/core/history/history-diff.js +1 -1
  159. package/dist/core/schema/type-workflows.d.ts +1 -1
  160. package/dist/core/schema/type-workflows.js +1 -1
  161. package/dist/core/search/eval.d.ts +1 -1
  162. package/dist/core/search/eval.js +1 -1
  163. package/dist/core/shared/item-metadata-contract.d.ts +0 -4
  164. package/dist/core/shared/item-metadata-contract.js +1 -1
  165. package/dist/sdk/cli-contracts/commander-types.d.ts +11 -11
  166. package/dist/sdk/cli-contracts/commander-types.js +1 -1
  167. package/dist/sdk/extension/shared.d.ts +2 -2
  168. package/dist/sdk/extension/shared.js +1 -1
  169. package/dist/sdk/governance/upgrade.d.ts +2 -0
  170. package/dist/sdk/governance/upgrade.js +2 -2
  171. package/dist/sdk/pagination.js +1 -1
  172. package/dist/sdk/public-surface.json +1 -1
  173. package/dist/sdk/query/search-contracts.d.ts +0 -1
  174. package/dist/sdk/query/search-contracts.js +1 -1
  175. package/dist/sdk/schema.d.ts +8 -4
  176. package/dist/sdk/schema.js +1 -1
  177. package/docs/ARCHITECTURE.md +31 -4
  178. package/docs/BUILD_AND_RELEASE_ACCEPTANCE.md +50 -1
  179. package/docs/COMMANDS.md +1 -1
  180. package/docs/EXTENSIONS.md +1 -1
  181. package/docs/QUALITY_EVIDENCE.md +70 -0
  182. package/docs/READ_OUTPUT_CONTRACTS.md +1 -1
  183. package/docs/RELEASING.md +7 -1
  184. package/docs/SDK_CONTEXT_INTEGRITY_PRIMITIVES.md +1 -1
  185. package/docs/TESTING.md +8 -0
  186. package/marketplace.json +2 -2
  187. package/package.json +12 -5
  188. package/packages/pm-beads/package.json +1 -1
  189. package/packages/pm-calendar/package.json +1 -1
  190. package/packages/pm-command-kit/package.json +1 -1
  191. package/packages/pm-digital-twin/package.json +1 -1
  192. package/packages/pm-governance-audit/package.json +1 -1
  193. package/packages/pm-guide-shell/package.json +1 -1
  194. package/packages/pm-kanban/package.json +1 -1
  195. package/packages/pm-lifecycle-hooks/package.json +1 -1
  196. package/packages/pm-linked-test-adapters/package.json +1 -1
  197. package/packages/pm-search-advanced/package.json +1 -1
  198. package/packages/pm-templates/package.json +1 -1
  199. package/packages/pm-todos/package.json +1 -1
  200. package/packages/pm-vcs/package.json +1 -1
  201. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  202. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  203. package/scripts/build-lease.mjs +27 -0
  204. package/dist/cli/commands/activity.d.ts +0 -6
  205. package/dist/cli/commands/aggregate.d.ts +0 -2
  206. package/dist/cli/commands/append.d.ts +0 -2
  207. package/dist/cli/commands/claim.d.ts +0 -2
  208. package/dist/cli/commands/close-many.d.ts +0 -2
  209. package/dist/cli/commands/close.d.ts +0 -6
  210. package/dist/cli/commands/close.js +0 -2
  211. package/dist/cli/commands/comments.d.ts +0 -2
  212. package/dist/cli/commands/context.d.ts +0 -6
  213. package/dist/cli/commands/context.js +0 -2
  214. package/dist/cli/commands/contracts.d.ts +0 -2
  215. package/dist/cli/commands/copy.d.ts +0 -6
  216. package/dist/cli/commands/create.d.ts +0 -6
  217. package/dist/cli/commands/delete.d.ts +0 -6
  218. package/dist/cli/commands/duplicates.d.ts +0 -6
  219. package/dist/cli/commands/extension.d.ts +0 -6
  220. package/dist/cli/commands/focus.d.ts +0 -6
  221. package/dist/cli/commands/get.d.ts +0 -6
  222. package/dist/cli/commands/health.d.ts +0 -6
  223. package/dist/cli/commands/health.js +0 -2
  224. package/dist/cli/commands/history-compact.d.ts +0 -7
  225. package/dist/cli/commands/history-redact.js +0 -2
  226. package/dist/cli/commands/history.d.ts +0 -2
  227. package/dist/cli/commands/index.d.ts +0 -55
  228. package/dist/cli/commands/index.js +0 -2
  229. package/dist/cli/commands/init-agent-guidance.d.ts +0 -6
  230. package/dist/cli/commands/init-agent-guidance.js +0 -2
  231. package/dist/cli/commands/init.js +0 -2
  232. package/dist/cli/commands/learnings.d.ts +0 -2
  233. package/dist/cli/commands/lifecycle-transitions.d.ts +0 -2
  234. package/dist/cli/commands/lifecycle-transitions.js +0 -2
  235. package/dist/cli/commands/merge.d.ts +0 -8
  236. package/dist/cli/commands/merge.js +0 -2
  237. package/dist/cli/commands/notes.d.ts +0 -2
  238. package/dist/cli/commands/plan.d.ts +0 -6
  239. package/dist/cli/commands/restore.d.ts +0 -6
  240. package/dist/cli/commands/restore.js +0 -2
  241. package/dist/cli/commands/scheduling-shortcuts.d.ts +0 -6
  242. package/dist/cli/commands/scheduling-shortcuts.js +0 -2
  243. package/dist/cli/commands/schema.d.ts +0 -7
  244. package/dist/cli/commands/schema.js +0 -2
  245. package/dist/cli/commands/search.d.ts +0 -6
  246. package/dist/cli/commands/stats.d.ts +0 -6
  247. package/dist/cli/commands/telemetry.d.ts +0 -6
  248. package/dist/cli/commands/update-many.d.ts +0 -2
  249. package/dist/cli/commands/update.d.ts +0 -6
  250. package/dist/cli/commands/upgrade.d.ts +0 -2
  251. package/dist/cli/commands/upgrade.js +0 -2
  252. package/dist/cli/commands/validate.d.ts +0 -9
  253. package/dist/cli/commands/validate.js +0 -2
  254. package/dist/cli-bundle/chunks/chunk-T3AMFUCN.js +0 -2
  255. package/dist/cli-bundle/chunks/register-mutation-DXES37MA.js +0 -20
@@ -1,8 +1,8 @@
1
- import{P as le,Wa as pe,l as ae}from"./chunk-SDLBF4PY.js";import{Fa as fe,n as R}from"./chunk-2QLXN6HZ.js";import{$ as C,$b as Q,Hb as H,Lb as L,Mb as K,Pb as q,Q as b,Qb as U,R as B,Ub as V,Vb as z,Wb as W,Xb as G,Yb as Y,Zb as X,_b as J,ac as Z,bc as ee,cc as re,dc as te,dj as de,ej as me,fj as ce,jc as ne,kc as oe,qb as v,qc as ie,ub as x,vb as D,xi as se}from"./chunk-JBJUOOJI.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="c06f3fb3-4b1f-5fdb-a9ce-bce8f88704aa")}catch{}})();function Ir(r){return r}function Mr(r){return r}function Ce(r,e){for(let t of e.commands??[])r.registerCommand(t);for(let[t,n]of Object.entries(e.commandOverrides??{}))r.registerCommand(t,n);for(let[t,n]of Object.entries(e.flags??{}))r.registerFlags(t,n);for(let[t,n]of Object.entries(e.parsers??{}))r.registerParser(t,n);for(let[t,n]of Object.entries(e.renderers??{}))if(typeof n=="function")r.registerRenderer(t,n);else{let{run:s,...o}=n;r.registerRenderer(t,s,o)}for(let[t,n]of Object.entries(e.services??{}))r.registerService(t,n)}function Re(r,e){for(let o of e.preflights??[])r.registerPreflight(o);let t=e.itemTypes??[];t.length>0&&r.registerItemTypes(t);let n=e.itemFields??[];n.length>0&&r.registerItemFields(n);let s=e.relationshipKinds??[];s.length>0&&r.registerRelationshipKinds(s);for(let o of e.migrations??[])r.registerMigration(o);for(let o of e.profiles??[])r.registerProfile(o)}function Ne(r,e){for(let t of e.searchProviders??[])r.registerSearchProvider(t);for(let t of e.vectorStoreAdapters??[])r.registerVectorStoreAdapter(t);for(let t of e.assuranceProviders??[])r.registerAssuranceMeasurementProvider(t);for(let t of e.importers??[])r.registerImporter(t.name,t.importer,t.options);for(let t of e.exporters??[])r.registerExporter(t.name,t.exporter,t.options)}function Se(r,e){for(let t of e.beforeCommand??[])r.hooks.beforeCommand(t);for(let t of e.beforeMutation??[])r.hooks.beforeMutation(t);for(let t of e.afterCommand??[])r.hooks.afterCommand(t);for(let t of e.onWrite??[])r.hooks.onWrite(t);for(let t of e.onRead??[])r.hooks.onRead(t);for(let t of e.onIndex??[])r.hooks.onIndex(t)}function Oe(r){let t={activate:async n=>{Ce(n,r),Re(n,r),Ne(n,r),Se(n,r.hooks??{}),await r.activate?.(n)}};return r.manifest&&(t.manifest=r.manifest),r.deactivate&&(t.deactivate=r.deactivate),t}function h(r){let e=r.flatMap(t=>t??[]);return e.length>0?e:void 0}function _(r){let e=Object.assign({},...r.map(t=>t??{}));return Object.keys(e).length>0?e:void 0}function Ae(r){let e={};for(let t of r)for(let[n,s]of Object.entries(t??{}))e[n]=[...e[n]??[],...s];return Object.keys(e).length>0?e:void 0}var Fe=["beforeCommand","beforeMutation","afterCommand","onWrite","onRead","onIndex"];function Pe(r,e,t){let n=e.map(o=>o?.[t]),s=h(n);if(s!==void 0){let o=r;o[t]=s}}function Te(r){let e={};for(let t of Fe)Pe(e,r,t);return Object.keys(e).length>0?e:void 0}function jr(...r){let e={},t=(i,a)=>{a!==void 0&&(e[i]=a)};t("commands",h(r.map(i=>i.commands))),t("commandOverrides",_(r.map(i=>i.commandOverrides))),t("flags",Ae(r.map(i=>i.flags))),t("parsers",_(r.map(i=>i.parsers))),t("renderers",_(r.map(i=>i.renderers))),t("services",_(r.map(i=>i.services))),t("preflights",h(r.map(i=>i.preflights))),t("itemTypes",h(r.map(i=>i.itemTypes))),t("itemFields",h(r.map(i=>i.itemFields))),t("relationshipKinds",h(r.map(i=>i.relationshipKinds))),t("migrations",h(r.map(i=>i.migrations))),t("profiles",h(r.map(i=>i.profiles))),t("searchProviders",h(r.map(i=>i.searchProviders))),t("vectorStoreAdapters",h(r.map(i=>i.vectorStoreAdapters))),t("assuranceProviders",h(r.map(i=>i.assuranceProviders))),t("importers",h(r.map(i=>i.importers))),t("exporters",h(r.map(i=>i.exporters))),t("hooks",Te(r.map(i=>i.hooks)));let n;for(let i of r)i.manifest&&(n=i.manifest);t("manifest",n);let s=r.some(i=>i.activate);t("activate",s?async i=>{for(let a of r)a.activate&&await a.activate(i)}:void 0);let o=r.some(i=>i.deactivate);return t("deactivate",o?async()=>{let i=[];for(let a of[...r].reverse())if(a.deactivate)try{await a.deactivate()}catch(d){i.push(d)}if(i.length>0)throw i.length>1?new AggregateError(i,"Multiple extension blueprint deactivate hooks failed."):i[0]}:void 0),e}var Ie=[["commands","commands"],["commandOverrides","commands"],["flags","schema"],["itemTypes","schema"],["itemFields","schema"],["relationshipKinds","schema"],["migrations","schema"],["profiles","schema"],["parsers","parser"],["renderers","renderers"],["services","services"],["preflights","preflight"],["searchProviders","search"],["vectorStoreAdapters","search"],["assuranceProviders","services"],["importers","importers"],["exporters","importers"]];function $(r){return r?Array.isArray(r)?r.length>0:Object.keys(r).length>0:!1}function N(r){let e=new Set;for(let[s,o]of Ie)$(r[s])&&e.add(o);(r.commands??[]).filter(w).some(s=>s.flags!==void 0)&&e.add("schema");let t=[...r.importers??[],...r.exporters??[]].filter(w);t.some(s=>s?.options?.flags!==void 0)&&e.add("schema"),t.some(s=>typeof s=="object")&&e.add("commands");let n=r.hooks??{};return[n.beforeCommand,n.beforeMutation,n.afterCommand,n.onWrite,n.onRead,n.onIndex].some($)&&e.add("hooks"),[...e].sort((s,o)=>s.localeCompare(o))}var Me=[["beforeCommand","before_command"],["beforeMutation","before_mutation"],["afterCommand","after_command"],["onWrite","on_write"],["onRead","on_read"],["onIndex","on_index"]];function l(r){return[...new Set(r)].sort((e,t)=>e.localeCompare(t))}function w(r){return r!=null}function S(r){return v(`${r.name} import`)}function O(r){return v(`${r.name} export`)}function je(r,e,t){return[...r.map(n=>v(n.name)),...e.filter(n=>n.options!==void 0).map(S),...t.filter(n=>n.options!==void 0).map(O)]}function Be(r,e,t,n){return[...Object.keys(r.flags??{}).map(s=>v(s)),...e.filter(s=>s.flags!==void 0).map(s=>v(s.name)),...t.filter(s=>s.options?.flags!==void 0).map(S),...n.filter(s=>s.options?.flags!==void 0).map(O)]}function De(r){return Me.filter(([e])=>(r[e]?.length??0)>0).map(([,e])=>e)}function He(r){let e=Object.entries(r??{}).filter(([,t])=>typeof t!="function"&&((t.commands?.length??0)>0||t.resultDiscriminator!==void 0)).map(([t,n])=>{let s=n;return{format:t,commands:l((s.commands??[]).map(o=>v(o))),result_discriminator:s.resultDiscriminator!==void 0}}).sort((t,n)=>t.format.localeCompare(n.format));return e.length>0?{renderer_ownership:e}:{}}function Le(r){return!r||r.length===0?{}:{assurance_providers:l(r.map(e=>e.id))}}function Ke(r,e,t){return{item_types:l((r.itemTypes??[]).map(n=>n.name)),item_fields:l((r.itemFields??[]).map(n=>n.name)),...(r.relationshipKinds?.length??0)>0?{relationship_kinds:l(r.relationshipKinds.map(n=>n.kind))}:{},migrations:l((r.migrations??[]).flatMap(n=>typeof n.id=="string"?[n.id]:[])),profiles:l((r.profiles??[]).map(n=>n.name)),importers:l(e.map(n=>v(n.name))),exporters:l(t.map(n=>v(n.name))),search_providers:l((r.searchProviders??[]).map(n=>n.name)),vector_store_adapters:l((r.vectorStoreAdapters??[]).map(n=>n.name)),...Le(r.assuranceProviders),parser_overrides:l(Object.keys(r.parsers??{}).map(n=>v(n))),service_overrides:l(Object.keys(r.services??{}).map(n=>String(n).trim().toLowerCase())),renderer_overrides:l(Object.keys(r.renderers??{}).map(n=>String(n).trim().toLowerCase())),...He(r.renderers),preflight_overrides:(r.preflights??[]).length,preflight_ownership:(r.preflights??[]).map(n=>({commands:[...n.commands??[]]}))}}function qe(r){let e=(r.commands??[]).filter(w),t=(r.importers??[]).filter(w),n=(r.exporters??[]).filter(w),s=t.map(S),o=n.map(O),i=je(e,t,n),a=Be(r,e,t,n),d=r.hooks??{},c=Ke(r,t,n);return{capabilities:N(r),commands:l(i),command_overrides:l(Object.keys(r.commandOverrides??{}).map(E=>v(E))),command_handlers:l([...i,...s,...o]),hooks:De(d),flag_commands:l(a),...c}}var Ue=["commands","commandOverrides","flags","parsers","renderers","services","preflights","itemTypes","itemFields","relationshipKinds","migrations","profiles","searchProviders","vectorStoreAdapters","assuranceProviders","importers","exporters"];function Ve(r){return(r.itemFields??[]).filter(e=>typeof e?.name=="string"&&se.has(e.name.trim())).map(e=>({code:"reserved_item_field",severity:"error",message:`Item field "${e.name}" collides with reserved item metadata; rename it with an extension-specific prefix before publishing.`,field:e.name}))}function ze(r){return[...Object.values(r.flags??{}).flat(),...(r.commands??[]).flatMap(t=>t.flags??[]),...(r.importers??[]).flatMap(t=>t.options?.flags??[]),...(r.exporters??[]).flatMap(t=>t.options?.flags??[])].flatMap(t=>{if(typeof t?.long!="string"&&typeof t?.short!="string")return[];let n=L(t.long,t.short);if(n===null)return[];let{token:s,failure:o}=n;return[{code:o,severity:"error",message:`Flag "${s}" ${K(s,o)}.`,field:s}]})}function ge(r){let e=new Set;for(let t of r){let n=D(t)??x(t);n!==null&&e.add(n)}return[...e].sort((t,n)=>t.localeCompare(n))}function We(r,e){let t=[];if(e===null)return r.length>0&&t.push({code:"manifest_capabilities_absent",severity:"warning",message:`Blueprint exercises ${r.length===1?"capability":"capabilities"} [${r.join(", ")}] but declares none; set capabilities to deriveExtensionCapabilities(blueprint) so the manifest grant matches.`}),t;let n=new Set(e),s=new Set(r);for(let o of r)n.has(o)||t.push({code:"capability_undeclared",severity:"error",message:`Blueprint exercises capability "${o}" but it is absent from the declared capabilities; activation throws extension_capability_missing \u2014 add "${o}" to the manifest capabilities.`,capability:o});for(let o of e)s.has(o)||t.push({code:"capability_unused",severity:"warning",message:`Capability "${o}" is declared but no blueprint surface exercises it; drop it to keep the manifest least-privilege (pm package doctor reports this as extension_capability_unused).`,capability:o});return t}function Ge(r){let e=[],t=new Map;for(let s of r.commands??[]){let o=v(s.name);t.set(o,(t.get(o)??0)+1)}for(let[s,o]of t)o>1&&e.push({code:"duplicate_command",severity:"warning",message:`Command "${s}" is declared ${o} times in commands; the later registration shadows the earlier one at dispatch.`,command:s});let n=new Set(Object.keys(r.commandOverrides??{}).map(s=>v(s)));for(let s of t.keys())n.has(s)&&e.push({code:"command_override_conflict",severity:"warning",message:`Command "${s}" is declared both as a new command definition and as a command override; register one or the other.`,command:s});return e}function Ye(r){let e=[];for(let t of Ue)t in r&&!$(r[t])&&e.push({code:"empty_surface",severity:"warning",message:`Blueprint field "${t}" is present but empty; remove it or populate it.`,field:t});if("hooks"in r){let t=r.hooks??{};[t.beforeCommand,t.beforeMutation,t.afterCommand,t.onWrite,t.onRead,t.onIndex].some($)||e.push({code:"empty_surface",severity:"warning",message:'Blueprint field "hooks" is present but registers no lifecycle hooks; remove it or populate it.',field:"hooks"})}return e}function k(r,e={}){let t=N(r),n=e.declaredCapabilities??r.manifest?.capabilities,s=Array.isArray(n)?ge(n):null,o=[...We(t,s),...Ge(r),...ze(r),...Ve(r),...Ye(r)];return{ok:o.every(i=>i.severity!=="error"),findings:o,used:t,declared:s}}function ve(r,e){let{additionalCapabilities:t,...n}=e,s=Array.isArray(t)?ge(t):[],o=[...new Set([...N(r),...s])].sort((i,a)=>i.localeCompare(a));return{...n,capabilities:o}}function Br(r,e){let t=ve(r,e);return{module:Oe({...r,manifest:t}),manifest:t}}function ue(r,e){if(r.status==="absent"||r.status==="ok")return null;let t=`${r.kind}_${r.status}`,n="";switch(t){case"pm_min_version_invalid":n=`pm_min_version "${r.required}" is not a valid version; the extension is treated as incompatible and the loader skips it.`;break;case"pm_min_version_unchecked":n=`pm_min_version "${r.required}" could not be compared against pm ${e}; compatibility is unverified.`;break;case"pm_min_version_unmet":n=`Requires pm >= ${r.required} but the target is pm ${e}; the loader skips the extension.`;break;case"pm_max_version_invalid":n=`pm_max_version "${r.required}" is not a valid inclusive upper bound (version ranges are not allowed); the extension is treated as incompatible and the loader skips it.`;break;case"pm_max_version_unchecked":n=`pm_max_version "${r.required}" could not be compared against pm ${e}; compatibility is unverified.`;break;case"pm_max_version_exceeded":n=`Allows pm <= ${r.required} but the target is pm ${e}; the loader skips the extension.`;break;case"pm_max_version_exceeded_warn":n=`Target pm ${e} is newer than pm_max_version ${r.required}, but the "warn" exceeded mode lets it load with a warning.`;break}return{code:t,severity:r.allowed?"warning":"error",constraint:r.kind,required:r.required,current:e,message:n}}function A(r,e){let t=q(r.pm_min_version,e.pmVersion),n=U(r.pm_max_version,e.pmVersion,e.pmMaxVersionExceededMode??"block"),o=H(r).findings.map(c=>({code:c.code,severity:"warning",constraint:"manifest",required:c.code==="manifest_unknown_key"?c.path:"pm_min_version",current:e.pmVersion,path:c.path,...c.suggested_key?{suggested_key:c.suggested_key}:{},message:c.message})),i=[],a=ue(t,e.pmVersion);a!==null&&i.push(a);let d=ue(n,e.pmVersion);return d!==null&&i.push(d),{compatible:t.allowed&&n.allowed,findings:[...o,...i],pmVersion:e.pmVersion}}var Xe=new Set(["capability_undeclared","capability_unused","manifest_capabilities_absent"]);function he(r,e={}){let t=k(r,{declaredCapabilities:e.declaredCapabilities}),n=e.identity?ve(r,e.identity):null,s=e.target?A(n??r.manifest??{},e.target):null,a=[...(n!==null&&e.declaredCapabilities===void 0?t.findings.filter(d=>!Xe.has(d.code)):t.findings).map(d=>({source:"blueprint",severity:d.severity,code:d.code,message:d.message})),...(s?.findings??[]).map(d=>({source:"compatibility",severity:d.severity,code:d.code,message:d.message}))];return{ok:a.every(d=>d.severity!=="error"),capabilities:t.used,blueprint:t,manifest:n,compatibility:s,findings:a}}(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="fa9e95e5-7782-509d-96af-093a47daaed7")}catch{}})();function g(r,e){return r.name??e??""}var Je={before_command:"beforeCommand",before_mutation:"beforeMutation",after_command:"afterCommand",on_read:"onRead",on_write:"onWrite",on_index:"onIndex"},F={before_command:"beforeCommand",after_command:"afterCommand",on_read:"onRead",on_write:"onWrite",on_index:"onIndex"};function p(r){return r.trim().toLowerCase()}function ye(r){return p(r).replaceAll("-","_")}function u(r){return r?` from extension "${r}"`:""}function f(r){return[...new Set(r)].sort((e,t)=>e.localeCompare(t))}function y(r){if(typeof r!="string")throw new Error('A command name string is required. Pass it via the options object, e.g. runRegisteredCommandForTest(activation, { command: "my command" }) \u2014 positional command arguments are not supported.');return r.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0).join(" ")}function m(r){return r.length>0?r.join(", "):"(none)"}function be(r,e,t){let n=new Set(r??[]),s=f(e.filter(o=>!n.has(o)));if(s.length>0)throw new Error(`Expected package manifest ${t} to include ${s.join(", ")}; available: ${m(f(r??[]))}`)}function we(r){let e=new Set;for(let t of r)typeof t.long=="string"&&t.long.trim().length>0&&e.add(t.long.trim()),typeof t.short=="string"&&t.short.trim().length>0&&e.add(t.short.trim());return e}function P(r){let e=b(r);if(!e)return{};let t=b(e.manifest);if(t)return t;let n=b(e.default),s=b(n?.manifest);return s||(n&&typeof e.default!="function"&&("name"in n||"capabilities"in n)?n:typeof r!="function"&&("name"in e||"capabilities"in e)?e:{})}function T(r,e){return e??(typeof r.name=="string"&&r.name.trim().length>0?r.name.trim():"test-extension")}function Ee(r,e){return Array.isArray(e.capabilities)?[...e.capabilities]:Array.isArray(r.capabilities)?r.capabilities.filter(t=>typeof t=="string"):[]}function xe(r,e,t){return{disabled_by_flag:!1,roots:{global:"",project:""},configured_enabled:[],configured_disabled:[],discovered:[],effective:[],warnings:[],policy:t.policy,failed:[],loaded:[{layer:t.layer,directory:"",manifest_path:"",name:t.name,version:typeof e.version=="string"?e.version:"0.0.0",entry:typeof e.entry=="string"?e.entry:"./index.js",priority:typeof e.priority=="number"?e.priority:0,entry_path:"",capabilities:t.capabilities,manifest_version:typeof e.manifest_version=="number"?e.manifest_version:void 0,pm_min_version:typeof e.pm_min_version=="string"?e.pm_min_version:void 0,pm_max_version:typeof e.pm_max_version=="string"?e.pm_max_version:void 0,engines:e.engines,trusted:e.trusted,provenance:e.provenance,sandbox_profile:e.sandbox_profile,permissions:e.permissions,activation:e.activation,module:r}]}}async function Qe(r,e={}){let t=P(r);return oe(xe(r,t,{name:T(t,e.name),layer:e.layer??"project",capabilities:Ee(t,e),policy:e.policy??C()}))}async function Ze(r,e={}){let t=P(r);return ne(xe(r,t,{name:T(t,e.name),layer:e.layer??"project",capabilities:Ee(t,{}),policy:C()}),e.activation,e.deactivateTimeoutMs===void 0?{}:{deactivate_timeout_ms:e.deactivateTimeoutMs})}async function I(r,e){let t=y(e.command);if(t.length===0)throw new Error("Expected command name must be a non-empty string");if(!r.handlers.some(a=>a.command===t)){let a=f(r.handlers.map(d=>d.command));throw new Error(`Expected a registered command handler for "${t}" to invoke. Available command handlers: ${m(a)}`)}if(e.sdk!==void 0&&e.sdkFactory!==void 0)throw new TypeError("runRegisteredCommandForTest accepts sdk or sdkFactory, not both");let s=e.pmRoot??"",o={json:!0,quiet:!0,noPager:!0,...e.global},i=e.sdk??e.sdkFactory?.({pmRoot:s,global:o})??(s.length>0?ae(s,new pe({pmRoot:s})):void 0);return J(r,{command:t,args:e.args?[...e.args]:[],options:e.options?{...e.options}:{},global:o,pm_root:s,...i===void 0?{}:{sdk:i}})}async function er(r,e){if((r.beforeMutation?.length??0)===0)throw new Error("Expected a registered before_mutation hook to invoke");await z(r,e.context)}async function rr(r,e){let t=e.kind;if(t==="before_mutation")throw new Error("Invoke before_mutation hooks with runRegisteredMutationGuardForTest so denials and failures retain fail-closed semantics.");if((r[F[t]]?.length??0)===0){let n=f(Object.keys(F).filter(s=>(r[F[s]]?.length??0)>0));throw new Error(`Expected a registered "${t}" hook to invoke. Hook kinds with registrations: ${m(n)}`)}switch(e.kind){case"before_command":return V(r,e.context);case"after_command":return W(r,e.context);case"on_read":return Y(r,e.context);case"on_write":return G(r,e.context);case"on_index":return X(r,e.context)}}async function tr(r,e){let t=y(e.command);if(!r.overrides.some(n=>n.command===t))throw new Error(`Expected a registered parser override for command "${t}" to invoke. Available parser override commands: ${m(f(r.overrides.map(n=>n.command)))}`);return Q(r,e)}async function nr(r,e){if(r.overrides.length===0)throw new Error("Expected a registered preflight override to invoke, but none are registered.");return Z(r,e)}async function or(r,e){let t=y(e.command);if(!r.overrides.some(n=>n.command===t))throw new Error(`Expected a registered command override for command "${t}" to invoke. Available command override commands: ${m(f(r.overrides.map(n=>n.command)))}`);return re(r,e)}async function ir(r,e){if(!r.overrides.some(t=>t.format===e.format))throw new Error(`Expected a registered renderer override for format "${e.format}" to invoke. Available renderer override formats: ${m(f(r.overrides.map(t=>t.format)))}`);return te(r,e)}async function sr(r,e){if(!r.overrides.some(t=>t.service===e.service))throw new Error(`Expected a registered service override for service "${e.service}" to invoke. Available service override services: ${m(f(r.overrides.map(t=>t.service)))}`);return ee(r,e)}var ar={query:["query"],embed:["embed"],embedBatch:["embedBatch","embed_batch"],queryExpansion:["queryExpansion","query_expansion"],rerank:["rerank"]};async function dr(r,e){let t=de(r,e.provider);if(!t){let o=f(r.search_providers.map(i=>i.definition.name));throw new Error(`Expected a registered search provider "${e.provider}" to invoke. Available search providers: ${m(o)}`)}let n=t.runtime_definition,s=ar[e.operation].map(o=>n[o]).find(o=>typeof o=="function");if(typeof s!="function")throw new Error(`Registered search provider "${e.provider}" does not implement the "${e.operation}" operation.`);return await s(e.context)}async function mr(r,e){let t=me(r,e.adapter);if(!t){let s=f(r.vector_store_adapters.map(o=>o.definition.name));throw new Error(`Expected a registered vector store adapter "${e.adapter}" to invoke. Available vector store adapters: ${m(s)}`)}let n=t.runtime_definition[e.operation];if(typeof n!="function")throw new Error(`Registered vector store adapter "${e.adapter}" does not implement the "${e.operation}" operation.`);return await n(e.context)}async function cr(r,e){let t=ke(r,{migration:e.migration,extensionName:e.extensionName}),n=ce(t).run;if(typeof n!="function")throw new Error(`Registered migration "${e.migration}" does not implement a run function to invoke.`);let s=t.definition.status,o={id:t.definition.id,command:"migration",layer:t.layer,extension:t.name,pm_root:e.pmRoot??"",status:(typeof s=="string"?s.trim().toLowerCase():"")||"pending"};return await n(o)}async function fr(r,e){let t=_e(r.registrations,{importer:e.importer,extensionName:e.extensionName});return I(r.commands,{command:`${t.importer} import`,args:e.args,options:e.options,global:e.global,pmRoot:e.pmRoot})}async function lr(r,e){let t=$e(r.registrations,{exporter:e.exporter,extensionName:e.extensionName});return I(r.commands,{command:`${t.exporter} export`,args:e.args,options:e.options,global:e.global,pmRoot:e.pmRoot})}function Qr(r,e={}){let t=e.deactivated??1;if(r.deactivated!==t)throw new Error(`Expected ${t} extension${t===1?"":"s"} to deactivate cleanly, but ${r.deactivated} did.`);let n=e.failed??0;if(r.failed.length!==n){let s=r.failed.map(o=>`${o.layer}:${o.name} (${o.error})`).join(", ");throw new Error(`Expected ${n} teardown failure${n===1?"":"s"}, but observed ${r.failed.length}${s.length>0?`: ${s}`:""}.`)}return r}function Zr(r,e){if(e.packageName!==void 0&&r.package_name!==e.packageName)throw new Error(`Expected package manifest package_name to be "${e.packageName}"; received "${r.package_name??"(none)"}"`);if(e.aliases!==void 0&&be(r.aliases,e.aliases,"aliases"),e.resources!==void 0)for(let[t,n]of Object.entries(e.resources))be(r.resources[t],n,`pm.${t}`);return r}function pr(r,e){let t=y(g(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.commands.filter(i=>i.command===t),s=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!s){let i=r.commands.map(d=>d.command).sort((d,c)=>d.localeCompare(c)),a=e.extensionName?` from extension "${e.extensionName}"`:"";throw new Error(`Expected extension command "${t}"${a} to be registered. Available commands: ${m(i)}`)}if(e.action!==void 0&&s.action!==e.action)throw new Error(`Expected extension command "${t}" action "${e.action}", received "${s.action}"`);if(e.arguments!==void 0){let i=(s.arguments??[]).map(d=>d.name),a=e.arguments.filter(d=>!i.includes(d));if(a.length>0)throw new Error(`Expected extension command "${t}" arguments ${m(e.arguments)}; missing ${m(a)}; available ${m(i)}`)}let o=r.flags.filter(i=>i.target_command===t&&(e.extensionName===void 0||i.name===e.extensionName)).flatMap(i=>i.flags);if(e.flags!==void 0){let i=we(o),a=e.flags.filter(d=>!i.has(d));if(a.length>0)throw new Error(`Expected extension command "${t}" flags ${m(e.flags)}; missing ${m(a)}; available ${m([...i].sort((d,c)=>d.localeCompare(c)))}`)}return{command:s,flags:o}}function ur(r,e){let t=y(g(e,e.targetCommand));if(t.length===0)throw new Error("Expected target command name must be a non-empty string");let n=r.flags.filter(o=>o.target_command===t),s;if(e.extensionName)s=n.find(o=>o.name===e.extensionName);else if(n.length===1)s=n[0];else if(n.length>1){let o=f(n.map(i=>i.name));throw new Error(`Expected flags for target command "${t}" matched multiple extensions: ${m(o)}. Specify extensionName to choose one registration.`)}if(!s){let o=f(r.flags.map(a=>a.target_command)),i=f(n.map(a=>a.name));throw new Error(`Expected flags for target command "${t}"${u(e.extensionName)} to be registered. Available flag target commands: ${m(o)}; matching extensions: ${m(i)}`)}if(e.flags!==void 0){let o=we(s.flags),i=e.flags.filter(a=>!o.has(a));if(i.length>0)throw new Error(`Expected flags for target command "${t}" to include ${m(e.flags)}; missing ${m(i)}; available ${m([...o].sort((a,d)=>a.localeCompare(d)))}`)}return s}function gr(r,e){let t=Je[e.kind],n=r[t]??[],s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(n.map(i=>i.name));throw new Error(`Expected a "${e.kind}" hook${u(e.extensionName)} to be registered. Available "${e.kind}" hooks: ${m(o)}`)}return s}function vr(r,e){let t=p(g(e,e.provider));if(t.length===0)throw new Error("Expected search provider name must be a non-empty string");let n=r.search_providers.filter(o=>p(o.definition.name)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.search_providers.map(i=>i.definition.name));throw new Error(`Expected search provider "${t}"${u(e.extensionName)} to be registered. Available search providers: ${m(o)}`)}return s}function hr(r,e){let t=p(g(e,e.adapter));if(t.length===0)throw new Error("Expected vector store adapter name must be a non-empty string");let n=r.vector_store_adapters.filter(o=>p(o.definition.name)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.vector_store_adapters.map(i=>i.definition.name));throw new Error(`Expected vector store adapter "${t}"${u(e.extensionName)} to be registered. Available vector store adapters: ${m(o)}`)}return s}function _e(r,e){let t=p(g(e,e.importer));if(t.length===0)throw new Error("Expected importer name must be a non-empty string");let n=r.importers.filter(o=>p(o.importer)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.importers.map(i=>i.importer));throw new Error(`Expected importer "${t}"${u(e.extensionName)} to be registered. Available importers: ${m(o)}`)}return s}function $e(r,e){let t=p(g(e,e.exporter));if(t.length===0)throw new Error("Expected exporter name must be a non-empty string");let n=r.exporters.filter(o=>p(o.exporter)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.exporters.map(i=>i.exporter));throw new Error(`Expected exporter "${t}"${u(e.extensionName)} to be registered. Available exporters: ${m(o)}`)}return s}function yr(r,e){let t=p(g(e,e.field));if(t.length===0)throw new Error("Expected item field name must be a non-empty string");let s=r.item_fields.filter(o=>e.extensionName===void 0||o.name===e.extensionName).map(o=>({registration:o,field:o.fields.find(i=>p(i.name)===t)})).filter(o=>o.field!==void 0).find(o=>e.type===void 0||o.field.type===e.type);if(!s){let o=f(r.item_fields.flatMap(i=>i.fields.map(a=>`${a.name}:${a.type}`)));throw new Error(`Expected item field "${t}"${u(e.extensionName)} to be registered. Available item fields: ${m(o)}`)}return s}function br(r,e){let t=p(g(e,e.itemType));if(t.length===0)throw new Error("Expected item type name must be a non-empty string");let s=r.item_types.filter(o=>e.extensionName===void 0||o.name===e.extensionName).map(o=>({registration:o,itemType:o.types.find(i=>p(i.name)===t)})).filter(o=>o.itemType!==void 0).find(o=>e.folder===void 0||o.itemType.folder===e.folder);if(!s){let o=f(r.item_types.flatMap(i=>i.types.map(a=>`${a.name}:${a.folder}`)));throw new Error(`Expected item type "${t}"${u(e.extensionName)} to be registered. Available item types: ${m(o)}`)}return s}function wr(r,e){let t=ye(g(e,e.profile));if(t.length===0)throw new Error("Expected profile name must be a non-empty string");let n=r.profiles.filter(s=>e.extensionName===void 0||s.name===e.extensionName).find(s=>ye(s.profile.name)===t);if(!n){let s=f(r.profiles.map(o=>o.profile.name));throw new Error(`Expected profile "${t}"${u(e.extensionName)} to be registered. Available profiles: ${m(s)}`)}return{registration:n,profile:n.profile}}function Er(r,e){let t=y(g(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.overrides.filter(o=>o.command===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.command));throw new Error(`Expected command override "${t}"${u(e.extensionName)} to be registered. Available command overrides: ${m(o)}`)}return s}function xr(r,e){let t=y(g(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.overrides.filter(o=>o.command===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.command));throw new Error(`Expected parser override "${t}"${u(e.extensionName)} to be registered. Available parser overrides: ${m(o)}`)}return s}function _r(r,e={}){let t=e.extensionName?r.overrides.find(n=>n.name===e.extensionName):r.overrides[0];if(!t){let n=f(r.overrides.map(s=>s.name));throw new Error(`Expected a preflight override${u(e.extensionName)} to be registered. Available preflight overrides: ${m(n)}`)}return t}function $r(r,e){let t=p(g(e,e.format));if(t.length===0)throw new Error("Expected renderer format must be a non-empty string");let n=r.overrides.filter(o=>o.format===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.format));throw new Error(`Expected renderer override "${t}"${u(e.extensionName)} to be registered. Available renderer overrides: ${m(o)}`)}return s}function kr(r,e){let t=p(g(e,e.service));if(t.length===0)throw new Error("Expected service name must be a non-empty string");let n=r.overrides.filter(o=>p(o.service)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.service));throw new Error(`Expected service override "${t}"${u(e.extensionName)} to be registered. Available service overrides: ${m(o)}`)}return s}function ke(r,e){let t=p(g(e,e.migration));if(t.length===0)throw new Error("Expected migration id must be a non-empty string");let n=r.migrations.filter(a=>(e.extensionName===void 0||a.name===e.extensionName)&&typeof a.definition.id=="string"&&p(a.definition.id)===t),s=n.find(a=>e.mandatory===void 0||(a.definition.mandatory??!1)===e.mandatory);if(s)return s;let o=n[0];if(o!==void 0)throw new Error(`Expected migration "${t}"${u(e.extensionName)} to have mandatory=${e.mandatory}, but it is mandatory=${o.definition.mandatory??!1}.`);let i=f(r.migrations.map(a=>`${typeof a.definition.id=="string"&&a.definition.id.trim().length>0?a.definition.id.trim():"(unnamed)"}:${a.definition.mandatory===!0}`));throw new Error(`Expected migration "${t}"${u(e.extensionName)} to be registered. Available migrations: ${m(i)}`)}function Cr(r,e){let t=(d,c)=>{let E=new Set;for(let M of d){let j=x(M);if(j===null)throw new Error(`Expected ${c} capability "${M}" to be a known extension capability. Use canonical capability names (see manifest.capabilities).`);E.add(j)}return E},n=[...t(e.declared,"declared")].sort((d,c)=>d.localeCompare(c)),s=t(e.allowUnused??[],"allowUnused"),o=ie(r,{extensionName:e.extensionName}),i=new Set(o),a=n.filter(d=>!i.has(d)&&!s.has(d));if(a.length>0){let d=u(e.extensionName);throw new Error(`Expected every declared capability${d} to be exercised, but [${a.join(", ")}] ${a.length===1?"is":"are"} declared yet never registered against. Remove ${a.length===1?"it":"them"} from manifest.capabilities for least privilege, or pass allowUnused for capabilities registered only behind a runtime flag.`)}return{declared:n,used:o,unused:a}}function et(r,e={}){let t=k(r,e);if(!t.ok){let n=t.findings.filter(s=>s.severity==="error");throw new Error(`Extension blueprint failed preflight with ${n.length} ${n.length===1?"error":"errors"}:
1
+ import{P as le,Wa as pe,l as ae}from"./chunk-VO7DHENB.js";import{Fa as fe,n as R}from"./chunk-6WBR6GMW.js";import{$ as C,$b as Q,Hb as H,Lb as L,Mb as K,Pb as q,Q as b,Qb as U,R as B,Ub as V,Vb as z,Wb as W,Xb as G,Yb as Y,Zb as X,_b as J,ac as Z,bc as ee,cc as re,dc as te,dj as de,ej as me,fj as ce,jc as ne,kc as oe,qb as v,qc as ie,ub as x,vb as D,xi as se}from"./chunk-7IABMUB6.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="c06f3fb3-4b1f-5fdb-a9ce-bce8f88704aa")}catch{}})();function Ir(r){return r}function Mr(r){return r}function Ce(r,e){for(let t of e.commands??[])r.registerCommand(t);for(let[t,n]of Object.entries(e.commandOverrides??{}))r.registerCommand(t,n);for(let[t,n]of Object.entries(e.flags??{}))r.registerFlags(t,n);for(let[t,n]of Object.entries(e.parsers??{}))r.registerParser(t,n);for(let[t,n]of Object.entries(e.renderers??{}))if(typeof n=="function")r.registerRenderer(t,n);else{let{run:s,...o}=n;r.registerRenderer(t,s,o)}for(let[t,n]of Object.entries(e.services??{}))r.registerService(t,n)}function Re(r,e){for(let o of e.preflights??[])r.registerPreflight(o);let t=e.itemTypes??[];t.length>0&&r.registerItemTypes(t);let n=e.itemFields??[];n.length>0&&r.registerItemFields(n);let s=e.relationshipKinds??[];s.length>0&&r.registerRelationshipKinds(s);for(let o of e.migrations??[])r.registerMigration(o);for(let o of e.profiles??[])r.registerProfile(o)}function Ne(r,e){for(let t of e.searchProviders??[])r.registerSearchProvider(t);for(let t of e.vectorStoreAdapters??[])r.registerVectorStoreAdapter(t);for(let t of e.assuranceProviders??[])r.registerAssuranceMeasurementProvider(t);for(let t of e.importers??[])r.registerImporter(t.name,t.importer,t.options);for(let t of e.exporters??[])r.registerExporter(t.name,t.exporter,t.options)}function Se(r,e){for(let t of e.beforeCommand??[])r.hooks.beforeCommand(t);for(let t of e.beforeMutation??[])r.hooks.beforeMutation(t);for(let t of e.afterCommand??[])r.hooks.afterCommand(t);for(let t of e.onWrite??[])r.hooks.onWrite(t);for(let t of e.onRead??[])r.hooks.onRead(t);for(let t of e.onIndex??[])r.hooks.onIndex(t)}function Oe(r){let t={activate:async n=>{Ce(n,r),Re(n,r),Ne(n,r),Se(n,r.hooks??{}),await r.activate?.(n)}};return r.manifest&&(t.manifest=r.manifest),r.deactivate&&(t.deactivate=r.deactivate),t}function h(r){let e=r.flatMap(t=>t??[]);return e.length>0?e:void 0}function _(r){let e=Object.assign({},...r.map(t=>t??{}));return Object.keys(e).length>0?e:void 0}function Ae(r){let e={};for(let t of r)for(let[n,s]of Object.entries(t??{}))e[n]=[...e[n]??[],...s];return Object.keys(e).length>0?e:void 0}var Fe=["beforeCommand","beforeMutation","afterCommand","onWrite","onRead","onIndex"];function Pe(r,e,t){let n=e.map(o=>o?.[t]),s=h(n);if(s!==void 0){let o=r;o[t]=s}}function Te(r){let e={};for(let t of Fe)Pe(e,r,t);return Object.keys(e).length>0?e:void 0}function jr(...r){let e={},t=(i,a)=>{a!==void 0&&(e[i]=a)};t("commands",h(r.map(i=>i.commands))),t("commandOverrides",_(r.map(i=>i.commandOverrides))),t("flags",Ae(r.map(i=>i.flags))),t("parsers",_(r.map(i=>i.parsers))),t("renderers",_(r.map(i=>i.renderers))),t("services",_(r.map(i=>i.services))),t("preflights",h(r.map(i=>i.preflights))),t("itemTypes",h(r.map(i=>i.itemTypes))),t("itemFields",h(r.map(i=>i.itemFields))),t("relationshipKinds",h(r.map(i=>i.relationshipKinds))),t("migrations",h(r.map(i=>i.migrations))),t("profiles",h(r.map(i=>i.profiles))),t("searchProviders",h(r.map(i=>i.searchProviders))),t("vectorStoreAdapters",h(r.map(i=>i.vectorStoreAdapters))),t("assuranceProviders",h(r.map(i=>i.assuranceProviders))),t("importers",h(r.map(i=>i.importers))),t("exporters",h(r.map(i=>i.exporters))),t("hooks",Te(r.map(i=>i.hooks)));let n;for(let i of r)i.manifest&&(n=i.manifest);t("manifest",n);let s=r.some(i=>i.activate);t("activate",s?async i=>{for(let a of r)a.activate&&await a.activate(i)}:void 0);let o=r.some(i=>i.deactivate);return t("deactivate",o?async()=>{let i=[];for(let a of[...r].reverse())if(a.deactivate)try{await a.deactivate()}catch(d){i.push(d)}if(i.length>0)throw i.length>1?new AggregateError(i,"Multiple extension blueprint deactivate hooks failed."):i[0]}:void 0),e}var Ie=[["commands","commands"],["commandOverrides","commands"],["flags","schema"],["itemTypes","schema"],["itemFields","schema"],["relationshipKinds","schema"],["migrations","schema"],["profiles","schema"],["parsers","parser"],["renderers","renderers"],["services","services"],["preflights","preflight"],["searchProviders","search"],["vectorStoreAdapters","search"],["assuranceProviders","services"],["importers","importers"],["exporters","importers"]];function $(r){return r?Array.isArray(r)?r.length>0:Object.keys(r).length>0:!1}function N(r){let e=new Set;for(let[s,o]of Ie)$(r[s])&&e.add(o);(r.commands??[]).filter(w).some(s=>s.flags!==void 0)&&e.add("schema");let t=[...r.importers??[],...r.exporters??[]].filter(w);t.some(s=>s?.options?.flags!==void 0)&&e.add("schema"),t.some(s=>typeof s=="object")&&e.add("commands");let n=r.hooks??{};return[n.beforeCommand,n.beforeMutation,n.afterCommand,n.onWrite,n.onRead,n.onIndex].some($)&&e.add("hooks"),[...e].sort((s,o)=>s.localeCompare(o))}var Me=[["beforeCommand","before_command"],["beforeMutation","before_mutation"],["afterCommand","after_command"],["onWrite","on_write"],["onRead","on_read"],["onIndex","on_index"]];function l(r){return[...new Set(r)].sort((e,t)=>e.localeCompare(t))}function w(r){return r!=null}function S(r){return v(`${r.name} import`)}function O(r){return v(`${r.name} export`)}function je(r,e,t){return[...r.map(n=>v(n.name)),...e.filter(n=>n.options!==void 0).map(S),...t.filter(n=>n.options!==void 0).map(O)]}function Be(r,e,t,n){return[...Object.keys(r.flags??{}).map(s=>v(s)),...e.filter(s=>s.flags!==void 0).map(s=>v(s.name)),...t.filter(s=>s.options?.flags!==void 0).map(S),...n.filter(s=>s.options?.flags!==void 0).map(O)]}function De(r){return Me.filter(([e])=>(r[e]?.length??0)>0).map(([,e])=>e)}function He(r){let e=Object.entries(r??{}).filter(([,t])=>typeof t!="function"&&((t.commands?.length??0)>0||t.resultDiscriminator!==void 0)).map(([t,n])=>{let s=n;return{format:t,commands:l((s.commands??[]).map(o=>v(o))),result_discriminator:s.resultDiscriminator!==void 0}}).sort((t,n)=>t.format.localeCompare(n.format));return e.length>0?{renderer_ownership:e}:{}}function Le(r){return!r||r.length===0?{}:{assurance_providers:l(r.map(e=>e.id))}}function Ke(r,e,t){return{item_types:l((r.itemTypes??[]).map(n=>n.name)),item_fields:l((r.itemFields??[]).map(n=>n.name)),...(r.relationshipKinds?.length??0)>0?{relationship_kinds:l(r.relationshipKinds.map(n=>n.kind))}:{},migrations:l((r.migrations??[]).flatMap(n=>typeof n.id=="string"?[n.id]:[])),profiles:l((r.profiles??[]).map(n=>n.name)),importers:l(e.map(n=>v(n.name))),exporters:l(t.map(n=>v(n.name))),search_providers:l((r.searchProviders??[]).map(n=>n.name)),vector_store_adapters:l((r.vectorStoreAdapters??[]).map(n=>n.name)),...Le(r.assuranceProviders),parser_overrides:l(Object.keys(r.parsers??{}).map(n=>v(n))),service_overrides:l(Object.keys(r.services??{}).map(n=>String(n).trim().toLowerCase())),renderer_overrides:l(Object.keys(r.renderers??{}).map(n=>String(n).trim().toLowerCase())),...He(r.renderers),preflight_overrides:(r.preflights??[]).length,preflight_ownership:(r.preflights??[]).map(n=>({commands:[...n.commands??[]]}))}}function qe(r){let e=(r.commands??[]).filter(w),t=(r.importers??[]).filter(w),n=(r.exporters??[]).filter(w),s=t.map(S),o=n.map(O),i=je(e,t,n),a=Be(r,e,t,n),d=r.hooks??{},c=Ke(r,t,n);return{capabilities:N(r),commands:l(i),command_overrides:l(Object.keys(r.commandOverrides??{}).map(E=>v(E))),command_handlers:l([...i,...s,...o]),hooks:De(d),flag_commands:l(a),...c}}var Ue=["commands","commandOverrides","flags","parsers","renderers","services","preflights","itemTypes","itemFields","relationshipKinds","migrations","profiles","searchProviders","vectorStoreAdapters","assuranceProviders","importers","exporters"];function Ve(r){return(r.itemFields??[]).filter(e=>typeof e?.name=="string"&&se.has(e.name.trim())).map(e=>({code:"reserved_item_field",severity:"error",message:`Item field "${e.name}" collides with reserved item metadata; rename it with an extension-specific prefix before publishing.`,field:e.name}))}function ze(r){return[...Object.values(r.flags??{}).flat(),...(r.commands??[]).flatMap(t=>t.flags??[]),...(r.importers??[]).flatMap(t=>t.options?.flags??[]),...(r.exporters??[]).flatMap(t=>t.options?.flags??[])].flatMap(t=>{if(typeof t?.long!="string"&&typeof t?.short!="string")return[];let n=L(t.long,t.short);if(n===null)return[];let{token:s,failure:o}=n;return[{code:o,severity:"error",message:`Flag "${s}" ${K(s,o)}.`,field:s}]})}function ge(r){let e=new Set;for(let t of r){let n=D(t)??x(t);n!==null&&e.add(n)}return[...e].sort((t,n)=>t.localeCompare(n))}function We(r,e){let t=[];if(e===null)return r.length>0&&t.push({code:"manifest_capabilities_absent",severity:"warning",message:`Blueprint exercises ${r.length===1?"capability":"capabilities"} [${r.join(", ")}] but declares none; set capabilities to deriveExtensionCapabilities(blueprint) so the manifest grant matches.`}),t;let n=new Set(e),s=new Set(r);for(let o of r)n.has(o)||t.push({code:"capability_undeclared",severity:"error",message:`Blueprint exercises capability "${o}" but it is absent from the declared capabilities; activation throws extension_capability_missing \u2014 add "${o}" to the manifest capabilities.`,capability:o});for(let o of e)s.has(o)||t.push({code:"capability_unused",severity:"warning",message:`Capability "${o}" is declared but no blueprint surface exercises it; drop it to keep the manifest least-privilege (pm package doctor reports this as extension_capability_unused).`,capability:o});return t}function Ge(r){let e=[],t=new Map;for(let s of r.commands??[]){let o=v(s.name);t.set(o,(t.get(o)??0)+1)}for(let[s,o]of t)o>1&&e.push({code:"duplicate_command",severity:"warning",message:`Command "${s}" is declared ${o} times in commands; the later registration shadows the earlier one at dispatch.`,command:s});let n=new Set(Object.keys(r.commandOverrides??{}).map(s=>v(s)));for(let s of t.keys())n.has(s)&&e.push({code:"command_override_conflict",severity:"warning",message:`Command "${s}" is declared both as a new command definition and as a command override; register one or the other.`,command:s});return e}function Ye(r){let e=[];for(let t of Ue)t in r&&!$(r[t])&&e.push({code:"empty_surface",severity:"warning",message:`Blueprint field "${t}" is present but empty; remove it or populate it.`,field:t});if("hooks"in r){let t=r.hooks??{};[t.beforeCommand,t.beforeMutation,t.afterCommand,t.onWrite,t.onRead,t.onIndex].some($)||e.push({code:"empty_surface",severity:"warning",message:'Blueprint field "hooks" is present but registers no lifecycle hooks; remove it or populate it.',field:"hooks"})}return e}function k(r,e={}){let t=N(r),n=e.declaredCapabilities??r.manifest?.capabilities,s=Array.isArray(n)?ge(n):null,o=[...We(t,s),...Ge(r),...ze(r),...Ve(r),...Ye(r)];return{ok:o.every(i=>i.severity!=="error"),findings:o,used:t,declared:s}}function ve(r,e){let{additionalCapabilities:t,...n}=e,s=Array.isArray(t)?ge(t):[],o=[...new Set([...N(r),...s])].sort((i,a)=>i.localeCompare(a));return{...n,capabilities:o}}function Br(r,e){let t=ve(r,e);return{module:Oe({...r,manifest:t}),manifest:t}}function ue(r,e){if(r.status==="absent"||r.status==="ok")return null;let t=`${r.kind}_${r.status}`,n="";switch(t){case"pm_min_version_invalid":n=`pm_min_version "${r.required}" is not a valid version; the extension is treated as incompatible and the loader skips it.`;break;case"pm_min_version_unchecked":n=`pm_min_version "${r.required}" could not be compared against pm ${e}; compatibility is unverified.`;break;case"pm_min_version_unmet":n=`Requires pm >= ${r.required} but the target is pm ${e}; the loader skips the extension.`;break;case"pm_max_version_invalid":n=`pm_max_version "${r.required}" is not a valid inclusive upper bound (version ranges are not allowed); the extension is treated as incompatible and the loader skips it.`;break;case"pm_max_version_unchecked":n=`pm_max_version "${r.required}" could not be compared against pm ${e}; compatibility is unverified.`;break;case"pm_max_version_exceeded":n=`Allows pm <= ${r.required} but the target is pm ${e}; the loader skips the extension.`;break;case"pm_max_version_exceeded_warn":n=`Target pm ${e} is newer than pm_max_version ${r.required}, but the "warn" exceeded mode lets it load with a warning.`;break}return{code:t,severity:r.allowed?"warning":"error",constraint:r.kind,required:r.required,current:e,message:n}}function A(r,e){let t=q(r.pm_min_version,e.pmVersion),n=U(r.pm_max_version,e.pmVersion,e.pmMaxVersionExceededMode??"block"),o=H(r).findings.map(c=>({code:c.code,severity:"warning",constraint:"manifest",required:c.code==="manifest_unknown_key"?c.path:"pm_min_version",current:e.pmVersion,path:c.path,...c.suggested_key?{suggested_key:c.suggested_key}:{},message:c.message})),i=[],a=ue(t,e.pmVersion);a!==null&&i.push(a);let d=ue(n,e.pmVersion);return d!==null&&i.push(d),{compatible:t.allowed&&n.allowed,findings:[...o,...i],pmVersion:e.pmVersion}}var Xe=new Set(["capability_undeclared","capability_unused","manifest_capabilities_absent"]);function he(r,e={}){let t=k(r,{declaredCapabilities:e.declaredCapabilities}),n=e.identity?ve(r,e.identity):null,s=e.target?A(n??r.manifest??{},e.target):null,a=[...(n!==null&&e.declaredCapabilities===void 0?t.findings.filter(d=>!Xe.has(d.code)):t.findings).map(d=>({source:"blueprint",severity:d.severity,code:d.code,message:d.message})),...(s?.findings??[]).map(d=>({source:"compatibility",severity:d.severity,code:d.code,message:d.message}))];return{ok:a.every(d=>d.severity!=="error"),capabilities:t.used,blueprint:t,manifest:n,compatibility:s,findings:a}}(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new r.Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="fa9e95e5-7782-509d-96af-093a47daaed7")}catch{}})();function g(r,e){return r.name??e??""}var Je={before_command:"beforeCommand",before_mutation:"beforeMutation",after_command:"afterCommand",on_read:"onRead",on_write:"onWrite",on_index:"onIndex"},F={before_command:"beforeCommand",after_command:"afterCommand",on_read:"onRead",on_write:"onWrite",on_index:"onIndex"};function p(r){return r.trim().toLowerCase()}function ye(r){return p(r).replaceAll("-","_")}function u(r){return r?` from extension "${r}"`:""}function f(r){return[...new Set(r)].sort((e,t)=>e.localeCompare(t))}function y(r){if(typeof r!="string")throw new Error('A command name string is required. Pass it via the options object, e.g. runRegisteredCommandForTest(activation, { command: "my command" }) \u2014 positional command arguments are not supported.');return r.trim().toLowerCase().split(/\s+/).filter(e=>e.length>0).join(" ")}function m(r){return r.length>0?r.join(", "):"(none)"}function be(r,e,t){let n=new Set(r??[]),s=f(e.filter(o=>!n.has(o)));if(s.length>0)throw new Error(`Expected package manifest ${t} to include ${s.join(", ")}; available: ${m(f(r??[]))}`)}function we(r){let e=new Set;for(let t of r)typeof t.long=="string"&&t.long.trim().length>0&&e.add(t.long.trim()),typeof t.short=="string"&&t.short.trim().length>0&&e.add(t.short.trim());return e}function P(r){let e=b(r);if(!e)return{};let t=b(e.manifest);if(t)return t;let n=b(e.default),s=b(n?.manifest);return s||(n&&typeof e.default!="function"&&("name"in n||"capabilities"in n)?n:typeof r!="function"&&("name"in e||"capabilities"in e)?e:{})}function T(r,e){return e??(typeof r.name=="string"&&r.name.trim().length>0?r.name.trim():"test-extension")}function Ee(r,e){return Array.isArray(e.capabilities)?[...e.capabilities]:Array.isArray(r.capabilities)?r.capabilities.filter(t=>typeof t=="string"):[]}function xe(r,e,t){return{disabled_by_flag:!1,roots:{global:"",project:""},configured_enabled:[],configured_disabled:[],discovered:[],effective:[],warnings:[],policy:t.policy,failed:[],loaded:[{layer:t.layer,directory:"",manifest_path:"",name:t.name,version:typeof e.version=="string"?e.version:"0.0.0",entry:typeof e.entry=="string"?e.entry:"./index.js",priority:typeof e.priority=="number"?e.priority:0,entry_path:"",capabilities:t.capabilities,manifest_version:typeof e.manifest_version=="number"?e.manifest_version:void 0,pm_min_version:typeof e.pm_min_version=="string"?e.pm_min_version:void 0,pm_max_version:typeof e.pm_max_version=="string"?e.pm_max_version:void 0,engines:e.engines,trusted:e.trusted,provenance:e.provenance,sandbox_profile:e.sandbox_profile,permissions:e.permissions,activation:e.activation,module:r}]}}async function Qe(r,e={}){let t=P(r);return oe(xe(r,t,{name:T(t,e.name),layer:e.layer??"project",capabilities:Ee(t,e),policy:e.policy??C()}))}async function Ze(r,e={}){let t=P(r);return ne(xe(r,t,{name:T(t,e.name),layer:e.layer??"project",capabilities:Ee(t,{}),policy:C()}),e.activation,e.deactivateTimeoutMs===void 0?{}:{deactivate_timeout_ms:e.deactivateTimeoutMs})}async function I(r,e){let t=y(e.command);if(t.length===0)throw new Error("Expected command name must be a non-empty string");if(!r.handlers.some(a=>a.command===t)){let a=f(r.handlers.map(d=>d.command));throw new Error(`Expected a registered command handler for "${t}" to invoke. Available command handlers: ${m(a)}`)}if(e.sdk!==void 0&&e.sdkFactory!==void 0)throw new TypeError("runRegisteredCommandForTest accepts sdk or sdkFactory, not both");let s=e.pmRoot??"",o={json:!0,quiet:!0,noPager:!0,...e.global},i=e.sdk??e.sdkFactory?.({pmRoot:s,global:o})??(s.length>0?ae(s,new pe({pmRoot:s})):void 0);return J(r,{command:t,args:e.args?[...e.args]:[],options:e.options?{...e.options}:{},global:o,pm_root:s,...i===void 0?{}:{sdk:i}})}async function er(r,e){if((r.beforeMutation?.length??0)===0)throw new Error("Expected a registered before_mutation hook to invoke");await z(r,e.context)}async function rr(r,e){let t=e.kind;if(t==="before_mutation")throw new Error("Invoke before_mutation hooks with runRegisteredMutationGuardForTest so denials and failures retain fail-closed semantics.");if((r[F[t]]?.length??0)===0){let n=f(Object.keys(F).filter(s=>(r[F[s]]?.length??0)>0));throw new Error(`Expected a registered "${t}" hook to invoke. Hook kinds with registrations: ${m(n)}`)}switch(e.kind){case"before_command":return V(r,e.context);case"after_command":return W(r,e.context);case"on_read":return Y(r,e.context);case"on_write":return G(r,e.context);case"on_index":return X(r,e.context)}}async function tr(r,e){let t=y(e.command);if(!r.overrides.some(n=>n.command===t))throw new Error(`Expected a registered parser override for command "${t}" to invoke. Available parser override commands: ${m(f(r.overrides.map(n=>n.command)))}`);return Q(r,e)}async function nr(r,e){if(r.overrides.length===0)throw new Error("Expected a registered preflight override to invoke, but none are registered.");return Z(r,e)}async function or(r,e){let t=y(e.command);if(!r.overrides.some(n=>n.command===t))throw new Error(`Expected a registered command override for command "${t}" to invoke. Available command override commands: ${m(f(r.overrides.map(n=>n.command)))}`);return re(r,e)}async function ir(r,e){if(!r.overrides.some(t=>t.format===e.format))throw new Error(`Expected a registered renderer override for format "${e.format}" to invoke. Available renderer override formats: ${m(f(r.overrides.map(t=>t.format)))}`);return te(r,e)}async function sr(r,e){if(!r.overrides.some(t=>t.service===e.service))throw new Error(`Expected a registered service override for service "${e.service}" to invoke. Available service override services: ${m(f(r.overrides.map(t=>t.service)))}`);return ee(r,e)}var ar={query:["query"],embed:["embed"],embedBatch:["embedBatch","embed_batch"],queryExpansion:["queryExpansion","query_expansion"],rerank:["rerank"]};async function dr(r,e){let t=de(r,e.provider);if(!t){let o=f(r.search_providers.map(i=>i.definition.name));throw new Error(`Expected a registered search provider "${e.provider}" to invoke. Available search providers: ${m(o)}`)}let n=t.runtime_definition,s=ar[e.operation].map(o=>n[o]).find(o=>typeof o=="function");if(typeof s!="function")throw new Error(`Registered search provider "${e.provider}" does not implement the "${e.operation}" operation.`);return await s(e.context)}async function mr(r,e){let t=me(r,e.adapter);if(!t){let s=f(r.vector_store_adapters.map(o=>o.definition.name));throw new Error(`Expected a registered vector store adapter "${e.adapter}" to invoke. Available vector store adapters: ${m(s)}`)}let n=t.runtime_definition[e.operation];if(typeof n!="function")throw new Error(`Registered vector store adapter "${e.adapter}" does not implement the "${e.operation}" operation.`);return await n(e.context)}async function cr(r,e){let t=ke(r,{migration:e.migration,extensionName:e.extensionName}),n=ce(t).run;if(typeof n!="function")throw new Error(`Registered migration "${e.migration}" does not implement a run function to invoke.`);let s=t.definition.status,o={id:t.definition.id,command:"migration",layer:t.layer,extension:t.name,pm_root:e.pmRoot??"",status:(typeof s=="string"?s.trim().toLowerCase():"")||"pending"};return await n(o)}async function fr(r,e){let t=_e(r.registrations,{importer:e.importer,extensionName:e.extensionName});return I(r.commands,{command:`${t.importer} import`,args:e.args,options:e.options,global:e.global,pmRoot:e.pmRoot})}async function lr(r,e){let t=$e(r.registrations,{exporter:e.exporter,extensionName:e.extensionName});return I(r.commands,{command:`${t.exporter} export`,args:e.args,options:e.options,global:e.global,pmRoot:e.pmRoot})}function Qr(r,e={}){let t=e.deactivated??1;if(r.deactivated!==t)throw new Error(`Expected ${t} extension${t===1?"":"s"} to deactivate cleanly, but ${r.deactivated} did.`);let n=e.failed??0;if(r.failed.length!==n){let s=r.failed.map(o=>`${o.layer}:${o.name} (${o.error})`).join(", ");throw new Error(`Expected ${n} teardown failure${n===1?"":"s"}, but observed ${r.failed.length}${s.length>0?`: ${s}`:""}.`)}return r}function Zr(r,e){if(e.packageName!==void 0&&r.package_name!==e.packageName)throw new Error(`Expected package manifest package_name to be "${e.packageName}"; received "${r.package_name??"(none)"}"`);if(e.aliases!==void 0&&be(r.aliases,e.aliases,"aliases"),e.resources!==void 0)for(let[t,n]of Object.entries(e.resources))be(r.resources[t],n,`pm.${t}`);return r}function pr(r,e){let t=y(g(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.commands.filter(i=>i.command===t),s=e.extensionName?n.find(i=>i.name===e.extensionName):n[0];if(!s){let i=r.commands.map(d=>d.command).sort((d,c)=>d.localeCompare(c)),a=e.extensionName?` from extension "${e.extensionName}"`:"";throw new Error(`Expected extension command "${t}"${a} to be registered. Available commands: ${m(i)}`)}if(e.action!==void 0&&s.action!==e.action)throw new Error(`Expected extension command "${t}" action "${e.action}", received "${s.action}"`);if(e.arguments!==void 0){let i=(s.arguments??[]).map(d=>d.name),a=e.arguments.filter(d=>!i.includes(d));if(a.length>0)throw new Error(`Expected extension command "${t}" arguments ${m(e.arguments)}; missing ${m(a)}; available ${m(i)}`)}let o=r.flags.filter(i=>i.target_command===t&&(e.extensionName===void 0||i.name===e.extensionName)).flatMap(i=>i.flags);if(e.flags!==void 0){let i=we(o),a=e.flags.filter(d=>!i.has(d));if(a.length>0)throw new Error(`Expected extension command "${t}" flags ${m(e.flags)}; missing ${m(a)}; available ${m([...i].sort((d,c)=>d.localeCompare(c)))}`)}return{command:s,flags:o}}function ur(r,e){let t=y(g(e,e.targetCommand));if(t.length===0)throw new Error("Expected target command name must be a non-empty string");let n=r.flags.filter(o=>o.target_command===t),s;if(e.extensionName)s=n.find(o=>o.name===e.extensionName);else if(n.length===1)s=n[0];else if(n.length>1){let o=f(n.map(i=>i.name));throw new Error(`Expected flags for target command "${t}" matched multiple extensions: ${m(o)}. Specify extensionName to choose one registration.`)}if(!s){let o=f(r.flags.map(a=>a.target_command)),i=f(n.map(a=>a.name));throw new Error(`Expected flags for target command "${t}"${u(e.extensionName)} to be registered. Available flag target commands: ${m(o)}; matching extensions: ${m(i)}`)}if(e.flags!==void 0){let o=we(s.flags),i=e.flags.filter(a=>!o.has(a));if(i.length>0)throw new Error(`Expected flags for target command "${t}" to include ${m(e.flags)}; missing ${m(i)}; available ${m([...o].sort((a,d)=>a.localeCompare(d)))}`)}return s}function gr(r,e){let t=Je[e.kind],n=r[t]??[],s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(n.map(i=>i.name));throw new Error(`Expected a "${e.kind}" hook${u(e.extensionName)} to be registered. Available "${e.kind}" hooks: ${m(o)}`)}return s}function vr(r,e){let t=p(g(e,e.provider));if(t.length===0)throw new Error("Expected search provider name must be a non-empty string");let n=r.search_providers.filter(o=>p(o.definition.name)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.search_providers.map(i=>i.definition.name));throw new Error(`Expected search provider "${t}"${u(e.extensionName)} to be registered. Available search providers: ${m(o)}`)}return s}function hr(r,e){let t=p(g(e,e.adapter));if(t.length===0)throw new Error("Expected vector store adapter name must be a non-empty string");let n=r.vector_store_adapters.filter(o=>p(o.definition.name)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.vector_store_adapters.map(i=>i.definition.name));throw new Error(`Expected vector store adapter "${t}"${u(e.extensionName)} to be registered. Available vector store adapters: ${m(o)}`)}return s}function _e(r,e){let t=p(g(e,e.importer));if(t.length===0)throw new Error("Expected importer name must be a non-empty string");let n=r.importers.filter(o=>p(o.importer)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.importers.map(i=>i.importer));throw new Error(`Expected importer "${t}"${u(e.extensionName)} to be registered. Available importers: ${m(o)}`)}return s}function $e(r,e){let t=p(g(e,e.exporter));if(t.length===0)throw new Error("Expected exporter name must be a non-empty string");let n=r.exporters.filter(o=>p(o.exporter)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.exporters.map(i=>i.exporter));throw new Error(`Expected exporter "${t}"${u(e.extensionName)} to be registered. Available exporters: ${m(o)}`)}return s}function yr(r,e){let t=p(g(e,e.field));if(t.length===0)throw new Error("Expected item field name must be a non-empty string");let s=r.item_fields.filter(o=>e.extensionName===void 0||o.name===e.extensionName).map(o=>({registration:o,field:o.fields.find(i=>p(i.name)===t)})).filter(o=>o.field!==void 0).find(o=>e.type===void 0||o.field.type===e.type);if(!s){let o=f(r.item_fields.flatMap(i=>i.fields.map(a=>`${a.name}:${a.type}`)));throw new Error(`Expected item field "${t}"${u(e.extensionName)} to be registered. Available item fields: ${m(o)}`)}return s}function br(r,e){let t=p(g(e,e.itemType));if(t.length===0)throw new Error("Expected item type name must be a non-empty string");let s=r.item_types.filter(o=>e.extensionName===void 0||o.name===e.extensionName).map(o=>({registration:o,itemType:o.types.find(i=>p(i.name)===t)})).filter(o=>o.itemType!==void 0).find(o=>e.folder===void 0||o.itemType.folder===e.folder);if(!s){let o=f(r.item_types.flatMap(i=>i.types.map(a=>`${a.name}:${a.folder}`)));throw new Error(`Expected item type "${t}"${u(e.extensionName)} to be registered. Available item types: ${m(o)}`)}return s}function wr(r,e){let t=ye(g(e,e.profile));if(t.length===0)throw new Error("Expected profile name must be a non-empty string");let n=r.profiles.filter(s=>e.extensionName===void 0||s.name===e.extensionName).find(s=>ye(s.profile.name)===t);if(!n){let s=f(r.profiles.map(o=>o.profile.name));throw new Error(`Expected profile "${t}"${u(e.extensionName)} to be registered. Available profiles: ${m(s)}`)}return{registration:n,profile:n.profile}}function Er(r,e){let t=y(g(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.overrides.filter(o=>o.command===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.command));throw new Error(`Expected command override "${t}"${u(e.extensionName)} to be registered. Available command overrides: ${m(o)}`)}return s}function xr(r,e){let t=y(g(e,e.command));if(t.length===0)throw new Error("Expected command name must be a non-empty string");let n=r.overrides.filter(o=>o.command===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.command));throw new Error(`Expected parser override "${t}"${u(e.extensionName)} to be registered. Available parser overrides: ${m(o)}`)}return s}function _r(r,e={}){let t=e.extensionName?r.overrides.find(n=>n.name===e.extensionName):r.overrides[0];if(!t){let n=f(r.overrides.map(s=>s.name));throw new Error(`Expected a preflight override${u(e.extensionName)} to be registered. Available preflight overrides: ${m(n)}`)}return t}function $r(r,e){let t=p(g(e,e.format));if(t.length===0)throw new Error("Expected renderer format must be a non-empty string");let n=r.overrides.filter(o=>o.format===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.format));throw new Error(`Expected renderer override "${t}"${u(e.extensionName)} to be registered. Available renderer overrides: ${m(o)}`)}return s}function kr(r,e){let t=p(g(e,e.service));if(t.length===0)throw new Error("Expected service name must be a non-empty string");let n=r.overrides.filter(o=>p(o.service)===t),s=e.extensionName?n.find(o=>o.name===e.extensionName):n[0];if(!s){let o=f(r.overrides.map(i=>i.service));throw new Error(`Expected service override "${t}"${u(e.extensionName)} to be registered. Available service overrides: ${m(o)}`)}return s}function ke(r,e){let t=p(g(e,e.migration));if(t.length===0)throw new Error("Expected migration id must be a non-empty string");let n=r.migrations.filter(a=>(e.extensionName===void 0||a.name===e.extensionName)&&typeof a.definition.id=="string"&&p(a.definition.id)===t),s=n.find(a=>e.mandatory===void 0||(a.definition.mandatory??!1)===e.mandatory);if(s)return s;let o=n[0];if(o!==void 0)throw new Error(`Expected migration "${t}"${u(e.extensionName)} to have mandatory=${e.mandatory}, but it is mandatory=${o.definition.mandatory??!1}.`);let i=f(r.migrations.map(a=>`${typeof a.definition.id=="string"&&a.definition.id.trim().length>0?a.definition.id.trim():"(unnamed)"}:${a.definition.mandatory===!0}`));throw new Error(`Expected migration "${t}"${u(e.extensionName)} to be registered. Available migrations: ${m(i)}`)}function Cr(r,e){let t=(d,c)=>{let E=new Set;for(let M of d){let j=x(M);if(j===null)throw new Error(`Expected ${c} capability "${M}" to be a known extension capability. Use canonical capability names (see manifest.capabilities).`);E.add(j)}return E},n=[...t(e.declared,"declared")].sort((d,c)=>d.localeCompare(c)),s=t(e.allowUnused??[],"allowUnused"),o=ie(r,{extensionName:e.extensionName}),i=new Set(o),a=n.filter(d=>!i.has(d)&&!s.has(d));if(a.length>0){let d=u(e.extensionName);throw new Error(`Expected every declared capability${d} to be exercised, but [${a.join(", ")}] ${a.length===1?"is":"are"} declared yet never registered against. Remove ${a.length===1?"it":"them"} from manifest.capabilities for least privilege, or pass allowUnused for capabilities registered only behind a runtime flag.`)}return{declared:n,used:o,unused:a}}function et(r,e={}){let t=k(r,e);if(!t.ok){let n=t.findings.filter(s=>s.severity==="error");throw new Error(`Extension blueprint failed preflight with ${n.length} ${n.length===1?"error":"errors"}:
2
2
  `+n.map(s=>` - [${s.code}] ${s.message}`).join(`
3
3
  `))}return t}function rt(r,e={}){let t=le(r),n=t.findings.filter(s=>s.severity==="error"||e.strict===!0&&s.severity==="warning");if(n.length>0)throw new Error(`Project profile "${t.profile}" failed lint with ${n.length} ${n.length===1?"issue":"issues"}:
4
4
  `+n.map(s=>` - ${s.severity} [${s.code}] ${s.message}`).join(`
5
5
  `));return t}function tt(r,e){let t=Array.isArray(r.capabilities)?r.capabilities:[],n=k(e,{declaredCapabilities:t}),s=n.declared,o=new Set(s),i=new Set(n.used),a=n.used.filter(c=>!o.has(c)),d=s.filter(c=>!i.has(c));if(a.length>0||d.length>0){let c=[];throw a.length>0&&c.push(`missing [${a.join(", ")}] (the blueprint registers ${a.length===1?"a surface":"surfaces"} requiring ${a.length===1?"it":"them"}; activation throws extension_capability_missing)`),d.length>0&&c.push(`unused [${d.join(", ")}] (declared but no surface exercises ${d.length===1?"it":"them"}; drop for least privilege)`),new Error(`Manifest capabilities do not match the blueprint: ${c.join("; ")}. Set capabilities to synthesizeExtensionManifest(blueprint, identity).capabilities to stay in sync.`)}return{used:n.used,declared:s,missing:a,unused:d,findings:n.findings}}function nt(r,e){let t=A(r,e),n=t.findings.filter(s=>s.severity==="error");if(n.length>0)throw new Error(`Extension manifest is not compatible with pm ${t.pmVersion}: ${n.map(s=>s.message).join("; ")}`);return t}function ot(r,e={}){let t=he(r,e);if(!t.ok){let n=t.findings.filter(s=>s.severity==="error");throw new Error(`Extension failed preflight with ${n.length} ${n.length===1?"error":"errors"}:
6
6
  `+n.map(s=>` - [${s.source}:${s.code}] ${s.message}`).join(`
7
7
  `))}return t}function Rr(r){if(!B(r))throw new Error("createExtensionTestHarness received a module with no activate export. Pass the extension module (with an activate(api) function on the module or its default export) as the first argument, and options second.")}async function it(r,e={}){Rr(r);let t=P(r),n=T(t,e.name),s=e.layer??"project",o=await Qe(r,e);if(o.failed.length>0){let i=o.failed.map(a=>{let d=a.trace?.missing_capability,c=d?`${a.error}; missing capability "${d}"`:a.error;return`${a.layer}:${a.name} (${c})`}).join(", ");throw new Error(`createExtensionTestHarness could not activate the extension cleanly: ${i}. Declare the required capability in the manifest (or pass it via options.capabilities), or use activateExtensionForTest directly to inspect a failed activation.`)}return{module:r,name:n,layer:s,activation:o,activationSummary(i){return R(o,i)},renderMarkdown(i={}){let{extensionName:a,...d}=i??{};return fe(R(o,{extensionName:a}),d)},assertCommandContract(i){return pr(o.registrations,i)},assertFlags(i){return ur(o.registrations,i)},assertItemField(i){return yr(o.registrations,i)},assertItemType(i){return br(o.registrations,i)},assertProfile(i){return wr(o.registrations,i)},assertHook(i){return gr(o.hooks,i)},assertCommandOverride(i){return Er(o.commands,i)},assertParserOverride(i){return xr(o.parsers,i)},assertPreflightOverride(i){return _r(o.preflight,i)},assertRendererOverride(i){return $r(o.renderers,i)},assertServiceOverride(i){return kr(o.services,i)},assertSearchProvider(i){return vr(o.registrations,i)},assertVectorStoreAdapter(i){return hr(o.registrations,i)},assertImporter(i){return _e(o.registrations,i)},assertExporter(i){return $e(o.registrations,i)},assertMigration(i){return ke(o.registrations,i)},assertCapabilityUsage(i){return Cr(o,i)},runCommand(i){return I(o.commands,i)},runHook(i){return rr(o.hooks,i)},runMutationGuard(i){return er(o.hooks,i)},runCommandOverride(i){return or(o.commands,i)},runParserOverride(i){return tr(o.parsers,i)},runPreflightOverride(i){return nr(o.preflight,i)},runRendererOverride(i){return ir(o.renderers,i)},runServiceOverride(i){return sr(o.services,i)},runSearchProvider(i){return dr(o.registrations,i)},runVectorStoreAdapter(i){return mr(o.registrations,i)},runMigration(i){return cr(o.registrations,i)},runImporter(i){return fr(o,i)},runExporter(i){return lr(o,i)},deactivate(i={}){return Ze(r,{name:n,layer:s,activation:o,deactivateTimeoutMs:i.deactivateTimeoutMs})}}}export{Ir as a,Mr as b,Oe as c,jr as d,N as e,qe as f,k as g,ve as h,Br as i,A as j,he as k,Qe as l,Ze as m,I as n,er as o,rr as p,tr as q,nr as r,or as s,ir as t,sr as u,dr as v,mr as w,cr as x,fr as y,lr as z,Qr as A,Zr as B,pr as C,ur as D,gr as E,vr as F,hr as G,_e as H,$e as I,yr as J,br as K,wr as L,Er as M,xr as N,_r as O,$r as P,kr as Q,ke as R,Cr as S,et as T,rt as U,tt as V,nt as W,ot as X,it as Y};
8
- //# sourceMappingURL=chunk-4SI67A2F.js.map
8
+ //# sourceMappingURL=chunk-ZWSWR2GX.js.map
@@ -1,4 +1,4 @@
1
- import{b as g,c as I,d as D}from"./chunk-QZTS23BV.js";import{a as de}from"./chunk-FBWAECBI.js";import{L as ne,M as ie,R as ae,n as te,u as A,w as oe}from"./chunk-7YUYLYJQ.js";import{$a as Q,Gc as K,Sc as W,Uc as X,Wc as Y,Yb as V,Zc as Z,_c as ee,aa as q,ad as re,bd as se,cd as le,na as G}from"./chunk-GRHSNUQO.js";import"./chunk-DEZPZOQ7.js";import{$o as J,Ec as k,Ef as v,Fo as y,Hf as f,If as m,Io as s,Ko as d,Rj as R,Sj as T,So as L,To as $,Uo as M,Vo as B,Wo as U,Xo as N,Yo as z,Zo as P,_a as O,_o as H,ki as j,l as E,la as c,m as C,na as u,yf as S}from"./chunk-JBJUOOJI.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]="66954a3a-58cf-5f25-978d-88ef98747e89")}catch{}})();(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]="6f752b76-9eed-565b-b9ff-87ff80fddfc7")}catch{}})();async function fe(e,t){let o=y(t),i=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(l=>l===!0).length>1)throw new u("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.",c.USAGE);let a=P(e.stream);if(a&&!o.json)throw new u("--stream requires --json output mode.",c.USAGE);let n=z(e),r=await V(a&&e.full!==!0&&e.provenance!==!0?{...n,raw:!0,compact:!0}:n,o);a?B(r,n,o):f(r,o),o.profile&&m(`profile:command=activity took_ms=${Date.now()-i}`)}function F(e){e.option("--id <value>","Filter by item ID").option("--op <value>","Filter by history operation").option("--author <value>","Filter by history author").option("--from <value>","Lower timestamp bound (ISO/date string or relative)").option("--to <value>","Upper timestamp bound (ISO/date string or relative)").option("--limit <n>","Return only the latest n activity entries").option("--unbounded","Explicitly return every matching activity entry (disables the default bound)").option("--compact","Condensed output: show only id, op, ts, author, msg per entry").option("--raw","Show the legacy compact per-event stream instead of the item digest").option("--full","Show full activity entries with JSON Patch payloads").option("--provenance","Show patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--stream [mode]","Emit line-delimited JSON rows (requires --json). Optional mode: rows|ndjson|jsonl").description("Show recent activity across items.").action(fe)}(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]="39c0b4dd-b342-5d83-847b-877dddd414db")}catch{}})();(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]="90ac260a-3714-526b-b8b5-d6e1c6c3dbb1")}catch{}})();(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]="c191aa04-42d2-55f8-84e2-96065ad79303")}catch{}})();(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]="ad0e3edb-04f8-59cf-a70e-2412222f09ec")}catch{}})();(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]="897f8885-b931-542d-ba00-0568f85f9b08")}catch{}})();(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]="30891af9-b36f-58af-9b25-f9f0873d2af0")}catch{}})();(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]="dad271f5-0900-58fb-9361-06a2b181c101")}catch{}})();(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]="b25b75c4-b6d5-5d5c-a2de-f05e9086f0ed")}catch{}})();(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]="6ba28a92-6c86-5be0-b05b-98852a709139")}catch{}})();(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]="ac6d22dc-008e-58bb-933e-e8366cae0c87")}catch{}})();function ye(e,t){return!t||t.size===0?!0:e==="context"?t.has("context")||t.has("ctx"):t.has(e)}function ce(e){if(e===void 0)return;if(typeof e!="string")throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE);let t=e.trim().toLowerCase();if(t==="csv"||t==="table"||t==="json"||t==="ndjson"||t==="toon")return t;throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE)}function _(e,t,o,i=!1){if(t===void 0)return o;if(typeof t!="string")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);let a=t.trim().toLowerCase();if(a!=="json"&&(a!=="ndjson"||!i)&&a!=="toon")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);if(o.json===!0&&a==="toon")throw new u(`${e} cannot combine --json with --format toon`,c.USAGE);return{...o,json:a==="json"||a==="ndjson"}}function he(e,t){q[t]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function ue(e){e.option("--has-notes","Show only items that have notes").option("--has-learnings","Show only items that have learnings").option("--has-files","Show only items that have linked files").option("--has-docs","Show only items that have linked docs").option("--has-tests","Show only items that have linked tests").option("--has-comments","Show only items that have comments").option("--has-deps","Show only items that have dependencies").option("--has-body","Show only items that have a non-empty body").option("--has-linked-command","Show only items whose linked tests carry a runnable command").option("--no-notes","Show only items that have no notes").option("--no-learnings","Show only items that have no learnings").option("--no-files","Show only items that have no linked files").option("--filter-files-missing","Alias for --no-files").option("--no-docs","Show only items that have no linked docs").option("--filter-docs-missing","Alias for --no-docs").option("--no-tests","Show only items that have no linked tests").option("--no-comments","Show only items that have no comments").option("--no-deps","Show only items that have no dependencies").option("--empty-body","Show only items with an empty body").option("--no-linked-command","Show only items whose linked tests carry no runnable command").option("--filter-reviewer-missing","Show only items missing reviewer").option("--filter-risk-missing","Show only items missing risk").option("--filter-confidence-missing","Show only items missing confidence").option("--filter-sprint-missing","Show only items missing sprint").option("--filter-release-missing","Show only items missing release")}var ve={draft:{name:"list-draft",dependencyBlocked:!1},open:{name:"list-open",dependencyBlocked:!1},in_progress:{name:"list-in-progress",dependencyBlocked:!1},blocked:{name:"list-blocked",dependencyBlocked:!0},closed:{name:"list-closed",dependencyBlocked:!1},canceled:{name:"list-canceled",dependencyBlocked:!1}};function ge(e,t){let o=e.stream===!0,i=ce(e.format),a=i==="csv"||i==="table",n=i==="json"||i==="ndjson"||i==="toon"?_("List",e.format,t,!0):t;if(o&&!n.json)throw new u("--stream requires --json output mode.",c.USAGE);if((a||i==="ndjson")&&o)throw new u("--format csv|table|ndjson cannot be combined with --stream.",c.USAGE);return{streamMode:o,listFormat:i,effectiveGlobal:n}}function be(e,t,o){if(o.listFormat==="csv"||o.listFormat==="table"){k(t);let i=t.items,a=o.listFormat==="csv"?R(i):T(i);!o.effectiveGlobal.quiet&&a.length>0&&v(`${a}
1
+ import{b as g,c as I,d as D}from"./chunk-WBB5B7G5.js";import{a as de}from"./chunk-ZSVINTXT.js";import{L as ne,M as ie,R as ae,n as te,u as A,w as oe}from"./chunk-E6ZES2X7.js";import{$a as Q,Gc as K,Sc as W,Uc as X,Wc as Y,Yb as V,Zc as Z,_c as ee,aa as q,ad as re,bd as se,cd as le,na as G}from"./chunk-PFWCAI4X.js";import"./chunk-DEZPZOQ7.js";import{Ec as k,Ef as v,Eo as y,Hf as f,Ho as s,If as m,Jo as d,Rj as R,Ro as L,Sj as T,So as $,To as M,Uo as B,Vo as U,Wo as N,Xo as z,Yo as P,Zo as H,_a as O,_o as J,ki as j,l as E,la as c,m as C,na as u,yf as S}from"./chunk-7IABMUB6.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]="19d28e23-5337-5ec0-83e6-6e43b462ece7")}catch{}})();(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]="10ce695f-65e7-5ea4-bdd8-472ad9527506")}catch{}})();async function fe(e,t){let o=y(t),i=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(l=>l===!0).length>1)throw new u("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.",c.USAGE);let a=P(e.stream);if(a&&!o.json)throw new u("--stream requires --json output mode.",c.USAGE);let n=z(e),r=await V(a&&e.full!==!0&&e.provenance!==!0?{...n,raw:!0,compact:!0}:n,o);a?B(r,n,o):f(r,o),o.profile&&m(`profile:command=activity took_ms=${Date.now()-i}`)}function F(e){e.option("--id <value>","Filter by item ID").option("--op <value>","Filter by history operation").option("--author <value>","Filter by history author").option("--from <value>","Lower timestamp bound (ISO/date string or relative)").option("--to <value>","Upper timestamp bound (ISO/date string or relative)").option("--limit <n>","Return only the latest n activity entries").option("--unbounded","Explicitly return every matching activity entry (disables the default bound)").option("--compact","Condensed output: show only id, op, ts, author, msg per entry").option("--raw","Show the legacy compact per-event stream instead of the item digest").option("--full","Show full activity entries with JSON Patch payloads").option("--provenance","Show patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--stream [mode]","Emit line-delimited JSON rows (requires --json). Optional mode: rows|ndjson|jsonl").description("Show recent activity across items.").action(fe)}(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]="1a62fe05-4407-5e76-87fa-5109dcca5640")}catch{}})();(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]="25c5349b-60d7-505b-98b0-3ed19e44b791")}catch{}})();(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]="b40cde4c-ca5a-522d-a731-52503c7e4fe0")}catch{}})();(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]="9212f45c-798d-5774-87ce-bb7d6ff5514a")}catch{}})();(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]="deee1339-ac17-5ae9-8add-a9dd766d182e")}catch{}})();(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]="de0fbee0-0bcf-5a46-9013-f7f883d3d0a3")}catch{}})();(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]="b662e21b-a163-5834-8789-65243f4c7c9c")}catch{}})();(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]="5cc1722c-b797-5b95-a493-3925003ba72e")}catch{}})();(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]="35c679a2-9d47-51fa-8bd2-175a4ec48d6b")}catch{}})();(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]="09792b14-2cd8-5e06-ab88-0dc661dfdf96")}catch{}})();function ye(e,t){return!t||t.size===0?!0:e==="context"?t.has("context")||t.has("ctx"):t.has(e)}function ce(e){if(e===void 0)return;if(typeof e!="string")throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE);let t=e.trim().toLowerCase();if(t==="csv"||t==="table"||t==="json"||t==="ndjson"||t==="toon")return t;throw new u("List --format must be one of csv|table|json|ndjson|toon",c.USAGE)}function _(e,t,o,i=!1){if(t===void 0)return o;if(typeof t!="string")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);let a=t.trim().toLowerCase();if(a!=="json"&&(a!=="ndjson"||!i)&&a!=="toon")throw new u(`${e} --format must be one of ${i?"json|ndjson|toon":"json|toon"}`,c.USAGE);if(o.json===!0&&a==="toon")throw new u(`${e} cannot combine --json with --format toon`,c.USAGE);return{...o,json:a==="json"||a==="ndjson"}}function he(e,t){q[t]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function ue(e){e.option("--has-notes","Show only items that have notes").option("--has-learnings","Show only items that have learnings").option("--has-files","Show only items that have linked files").option("--has-docs","Show only items that have linked docs").option("--has-tests","Show only items that have linked tests").option("--has-comments","Show only items that have comments").option("--has-deps","Show only items that have dependencies").option("--has-body","Show only items that have a non-empty body").option("--has-linked-command","Show only items whose linked tests carry a runnable command").option("--no-notes","Show only items that have no notes").option("--no-learnings","Show only items that have no learnings").option("--no-files","Show only items that have no linked files").option("--filter-files-missing","Alias for --no-files").option("--no-docs","Show only items that have no linked docs").option("--filter-docs-missing","Alias for --no-docs").option("--no-tests","Show only items that have no linked tests").option("--no-comments","Show only items that have no comments").option("--no-deps","Show only items that have no dependencies").option("--empty-body","Show only items with an empty body").option("--no-linked-command","Show only items whose linked tests carry no runnable command").option("--filter-reviewer-missing","Show only items missing reviewer").option("--filter-risk-missing","Show only items missing risk").option("--filter-confidence-missing","Show only items missing confidence").option("--filter-sprint-missing","Show only items missing sprint").option("--filter-release-missing","Show only items missing release")}var ve={draft:{name:"list-draft",dependencyBlocked:!1},open:{name:"list-open",dependencyBlocked:!1},in_progress:{name:"list-in-progress",dependencyBlocked:!1},blocked:{name:"list-blocked",dependencyBlocked:!0},closed:{name:"list-closed",dependencyBlocked:!1},canceled:{name:"list-canceled",dependencyBlocked:!1}};function ge(e,t){let o=e.stream===!0,i=ce(e.format),a=i==="csv"||i==="table",n=i==="json"||i==="ndjson"||i==="toon"?_("List",e.format,t,!0):t;if(o&&!n.json)throw new u("--stream requires --json output mode.",c.USAGE);if((a||i==="ndjson")&&o)throw new u("--format csv|table|ndjson cannot be combined with --stream.",c.USAGE);return{streamMode:o,listFormat:i,effectiveGlobal:n}}function be(e,t,o){if(o.listFormat==="csv"||o.listFormat==="table"){k(t);let i=t.items,a=o.listFormat==="csv"?R(i):T(i);!o.effectiveGlobal.quiet&&a.length>0&&v(`${a}
2
2
  `)}else if(o.listFormat==="ndjson"){k(t);let i=I(t.items);!o.effectiveGlobal.quiet&&i.length>0&&v(`${i}
3
3
  `)}else o.streamMode?M(e,t,o.effectiveGlobal):f(t,o.effectiveGlobal)}async function we(e){let t=y(e.actionCommand),o=e.aliasContract?{...t,command:e.aliasContract.canonical}:t,i=Date.now();e.aliasContract?.lifecycle==="deprecated"&&await j(O(process.cwd(),o.path)).then(me=>me.ux.deprecation_hints)&&m(C(e.aliasContract));let a=S("list",e.options),n=L(a),r=xe(e,n),{effectiveName:l,effectiveStatus:h,effectiveDependencyBlocked:p,effectiveExcludeTerminal:w}=r;he(n,l),Object.assign(n,{projectionCommand:l}),w&&(n.excludeTerminal=!0),n.dependencyBlocked=p;let x=ge(a,o),pe=await G(p?void 0:h,n,o);be("list",pe,x),o.profile&&m(`profile:command=list took_ms=${Date.now()-i}`)}function xe(e,t){let o=e.name,i=e.status,a=e.dependencyBlocked===!0,n=e.excludeTerminal===!0,r=t.status?.trim().toLowerCase(),l=e.name==="list"&&r!==void 0?ve[r]:void 0;return e.name==="list"&&(e.options.all===!0||r==="all"?(o="list-all",n=!1,t.status=void 0):r!==void 0&&l!==void 0&&(o=l.name,i=r,a=l.dependencyBlocked,n=!1,t.status=void 0)),(o==="list-open"||o==="list-in-progress")&&(t.lifecycleBucket=o==="list-open"?"open":"in_progress",i=void 0),{effectiveName:o,effectiveStatus:i,effectiveDependencyBlocked:a,effectiveExcludeTerminal:n}}function ke(e,t){let{name:o,description:i,status:a,excludeTerminal:n,allowStatusFilter:r,dependencyBlocked:l,aliasContract:h}=t,p=e.command(o,{hidden:h?.hidden===!0}).description(i);r&&p.option("--status <value>","Filter by status (repeatable or comma-separated; matches any; all selects every status)",s),o==="list"&&p.option("--all","Include every lifecycle status"),p.option("--for <intent>",`Apply a declared context intent projection. ${g("list","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--type <value>","Filter by item type (repeatable or comma-separated; matches any)",s).option("--tag <value>","Filter by tag (repeatable or comma-separated; matches any)",s).option("--priority <value>","Filter by priority (repeatable or comma-separated; matches any)",s).option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--today","Filter to items updated since local midnight today").option("--recent","Filter to items updated in the last 7 days").option("--updated-after <value>","Updated since ISO timestamp or signed relative (-2h/-7d for past); use last-window ISO").option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--ids <value>","Filter by explicit item IDs (comma-separated or repeatable)").option("--assignee <value>","Filter by assignee",s).option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--parent <value>","Filter by parent item ID").option("--sprint <value>","Filter by sprint",s).option("--release <value>","Filter by release",s).option("--filter-ac-missing","Show only items missing acceptance_criteria").option("--filter-estimates-missing","Show only items missing estimated_minutes").option("--filter-resolution-missing","Show only terminal items missing resolution").option("--filter-metadata-missing","Show only items missing any tracked metadata (AC, estimate, or resolution)").option("--limit <n>","Alias for --output-limit; --output-budget may cap rows").option("--offset <n>","Skip the first n matching rows before limit is applied").option("--after <cursor>","Continue after an opaque next_cursor from a previous list response").option("--no-truncate","Return every matched row after the explicit status and field filters").option("--include-body","Include item body in each returned list row").option("--strict-read","Fail closed if any item document or item directory cannot be read").option("--compact","Render compact list projection fields (mutually exclusive with --brief/--full/--fields)").option("--brief","Ultra-compact output: id, status, type, title only (agent-optimized, mutually exclusive with --compact/--full/--fields)").option("--full","Render full list projection fields (mutually exclusive with --compact/--brief/--fields)").option("--fields <value>",`Render custom comma-separated list fields (mutually exclusive with --compact/--brief/--full). ${g(o,"--fields")}`).option("--sort <value>","Sort field: priority|deadline|updated_at|created_at|title|parent (aliases: updated, created)").option("--order <value>","Sort order: asc|desc (requires --sort)").option("--tree","Render rows in parent/child tree order").option("--tree-depth <n>","Maximum recursion depth with --tree (0 keeps root rows only)").option("--format <value>","Output render mode: csv|table (human export) or json|ndjson|toon (machine output override)").option("--stream","Emit line-delimited JSON rows (requires --json)"),ue(p),p.action(async(w,x)=>{await we({name:o,status:a,excludeTerminal:n,dependencyBlocked:l,options:w,actionCommand:x,aliasContract:h})}),d(p,"--tags <value>","Alias for --tag"),d(p,"--assignee_filter <value>","Alias for --assignee-filter"),d(p,"--tree_depth <n>","Alias for --tree-depth"),d(p,"--token_budget <n>","Alias for --token-budget"),d(p,"--filter-estimate-missing","Alias for --filter-estimates-missing")}async function Se(e,t){let o=y(t),i=Date.now(),a=await te($(e),o);f(a,o),o.profile&&m(`profile:command=aggregate took_ms=${Date.now()-i}`)}async function _e(e,t){let o=y(t),i=Date.now(),a=H(S("context",e)),n=await X(a,o),r=K(a,o);if(r==="markdown")o.quiet||v(`${W(n)}
4
4
  `);else if(r==="ndjson"){k(n);let l=I([...n.high_level,...n.low_level,...n.blocked_fallback]);!o.quiet&&l.length>0&&v(`${l}
@@ -8,4 +8,4 @@ import{b as g,c as I,d as D}from"./chunk-QZTS23BV.js";import{a as de}from"./chun
8
8
  `);return}for await(let a of se({...e,intervalMs:i}))o||v(`${D(a.events,{count:a.count,has_more:a.has_more,next_cursor:a.next_cursor??null,source:a.source,heartbeat:a.count===0})}
9
9
  `)}function je(e){return e.cursor_mode==="row"?I(e.events):D(e.events,{count:e.count,has_more:e.has_more,next_cursor:e.next_cursor??null,source:e.source,...e.provenance_summary===void 0?{}:{provenance_summary:e.provenance_summary}})}async function Re(e,t){let o=y(t),i=Date.now(),a=Ce(e,o.path);if(e.follow===!0){await Oe(a,e,o.quiet===!0);return}let n=await re(a);if(k(n),o.json){f(n,o),o.profile&&m(`profile:command=events took_ms=${Date.now()-i}`);return}let r=je(n);!o.quiet&&r.length>0&&v(`${r}
10
10
  `),o.profile&&m(`profile:command=events took_ms=${Date.now()-i}`)}async function Te(e,t,o,i,a){let n=y(a),r=Date.now(),l=await Q(e,t,o,{...Array.isArray(i.kind)?{kind:i.kind}:{},maxDepth:typeof i.maxDepth=="string"?i.maxDepth:void 0,limit:typeof i.limit=="string"?i.limit:void 0,after:typeof i.after=="string"?i.after:void 0,direction:typeof i.direction=="string"?i.direction:void 0,maxPaths:typeof i.maxPaths=="string"?i.maxPaths:void 0,sample:typeof i.sample=="string"?i.sample:void 0,...Array.isArray(i.exemptIsolate)?{exemptIsolate:i.exemptIsolate}:{},...Array.isArray(i.exemptIsolateType)?{exemptIsolateType:i.exemptIsolateType}:{},saveBaseline:i.saveBaseline===!0,rebuild:i.rebuild===!0,clear:i.clear===!0,summary:i.summary===!0,full:i.full===!0},n);f(l,n),n.profile&&m(`profile:command=graph took_ms=${Date.now()-r}`)}function Dt(e,t){let o=t?.commandFilter,i=n=>ye(n,o),a=[{name:"list",description:"List active items with optional lifecycle-status and project filters.",excludeTerminal:!0,allowStatusFilter:!0},{name:"list-all",description:"List all items with optional filters.",excludeTerminal:!1,allowStatusFilter:!0},{name:"list-draft",description:"List draft items with optional filters.",status:"draft"},{name:"list-open",description:"List open items with optional filters.",status:"open",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-in-progress",description:"List in-progress items with optional filters.",status:"in_progress",excludeTerminal:!1,allowStatusFilter:!1},{name:"list-blocked",description:"List blocked items (blocked status or open blocked_by dependencies, matching pm next) with optional filters.",dependencyBlocked:!0,excludeTerminal:!1,allowStatusFilter:!1},{name:"list-closed",description:"List closed items with optional filters.",status:"closed"},{name:"list-canceled",description:"List canceled items with optional filters.",status:"canceled"}];for(let n of a)if(i(n.name)){let r=E(n.name);ke(e,{...n,...r?.registration==="commander"?{aliasContract:r}:{}})}if(i("aggregate")){let n=e.command("aggregate").description("Group item counts and numeric measures.").option("--set-mode <value>","Set grouping: element (default)|tuple").option("--limit <value>","Group page size (default: 50)").option("--after <value>","Continue with next_after cursor").option("--group-by <value>","Fields: parent,type,priority,status,assignee,tags,sprint,release (comma-separated)").option("--count","Counts (default)").option("--completion","Status counts and completion_pct").option("--sum <field>","Group numeric sum").option("--avg <field>","Group numeric average").option("--include-unparented","Keep unparented group").option("--status <value>","Item status").option("--type <value>","Item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Latest deadline (ISO/date or relative)").option("--deadline-after <value>","Earliest deadline (ISO/date or relative)").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Assignee presence: assigned|unassigned").option("--parent <value>","Parent ID").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release");d(n,"--include_unparented","Alias for --include-unparented"),d(n,"--assignee_filter <value>","Alias for --assignee-filter"),n.action(Se)}if(i("context")){let n=e.command("context").alias("ctx").description("Show a token-efficient project context snapshot for next-work decisions.").option("--for <intent>",`Apply a declared context intent projection. ${g("context","--for")}`).option("--date <value>","Anchor date/time for agenda window calculations (ISO/date string or relative)").option("--from <value>","Agenda lower bound (ISO/date string or relative)").option("--to <value>","Agenda upper bound (ISO/date string or relative)").option("--past","Include past agenda entries in bounded windows").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <id>","Scope the snapshot to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit focus and agenda rows per section").option("--after <cursor>","Continue ranked focus after a next_cursor from a previous context response").option("--format <value>","Context output format override: markdown|toon|json|ndjson").option("--depth <value>","Context depth: brief|standard|deep|full (full = every section, no per-section cap)").option("--section <value...>","Include specific sections (repeatable; overrides --depth)").option("--fields <value>","Project focus rows to a comma-separated field subset (e.g. id,title,priority)").option("--activity-limit <n>","Limit recent activity entries (default: settings or 10)").option("--stale-threshold <value>","Staleness cutoff in days (e.g. 7 or 7d; default: settings or 7)").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked candidate ids").option("--token-budget <n>","Maximum estimated tokens spent on ranked focus rows").option("--no-extension-health","Omit the installed extension health summary").option("--no-tags","Omit tag arrays from context focus rows");d(n,"--assignee_filter <value>","Alias for --assignee-filter"),d(n,"--max-items <n>","Alias for --limit"),d(n,"--explain_ranking","Alias for --explain-ranking"),d(n,"--token_budget <n>","Alias for --token-budget"),n.action(_e)}if(i("next")){let n=e.command("next").description("Recommend the next actionable (unblocked, ready) work item with rationale + blocked companion.").option("--for <intent>",`Apply a declared context intent projection. ${g("next","--for")}`).option("--type <value>","Filter candidate items by type").option("--tag <value>","Filter candidate items by tag").option("--priority <value>","Filter candidate items by priority").option("--assignee <value>","Filter candidate items by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter candidate items by sprint").option("--release <value>","Filter candidate items by release").option("--parent <id>","Scope to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit ready rows (default: 5; non-positive falls back to default)").option("--blocked-limit <n>","Limit blocked rows (default: same as --limit)").option("--ready-only","Omit the blocked companion list").option("--include-decisions","Include human-gated Decision items in the claimable ready queue").option("--include-gates","Include outcome gates in the ready queue").option("--include-containers","Include containers with unfinished descendants in the ready queue").option("--format <value>","Next output format override: markdown|toon|json").option("--explain-ranking","Include the scorer model, per-signal contributions, and ranked ready ids").option("--token-budget <n>","Maximum estimated tokens spent on the ranked ready queue");d(n,"--assignee_filter <value>","Alias for --assignee-filter"),d(n,"--blocked_limit <n>","Alias for --blocked-limit"),d(n,"--ready_only","Alias for --ready-only"),d(n,"--explain_ranking","Alias for --explain-ranking"),d(n,"--token_budget <n>","Alias for --token-budget"),n.action(Ie)}if(i("search")){let n=e.command("search").argument("<keywords...>","Keyword query tokens").description("Search items with keyword, semantic, or hybrid retrieval. Inline field:value tokens (tag:/status:/type:/priority:) in the query are parsed as filters, e.g. 'auth tag:area:search status:open'.").option("--for <intent>",`Apply a declared context intent projection. ${g("search","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--mode <value>","Search mode: keyword|semantic|hybrid (default: auto)").option("--semantic","Shorthand for --mode semantic").option("--hybrid","Shorthand for --mode hybrid").option("--match-mode <value>","Token match mode: and|or|exact (default: or with all-terms ranking bonus; and = hard-require every token; exact = exact phrase)").option("--min-score <value>","Per-query minimum score threshold (finite number >= 0); overrides settings search.score_threshold for this query only").option("--count","Return only the count of matching items (post-filter/threshold, pre-limit); skips hit rows").option("--semantic-weight <value>","Override hybrid semantic weight for this query (0..1); invalid values fall back to settings").option("--include-linked","Include linked files, docs, and tests in the searchable corpus").option("--title-exact","Require exact normalized title match for the full query string").option("--phrase-exact","Require exact normalized phrase match in searchable text").option("--highlight","Emit per-field matched-text snippets (wrapped in \xAB\u2026\xBB) on each hit; off by default").option("--status <value>","Filter by status before query (all, open/closed/canceled aliases, or configured status id; CSV)").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--deadline-before <value>","Filter by deadline upper bound (ISO/date string or relative)").option("--deadline-after <value>","Filter by deadline lower bound (ISO/date string or relative)").option("--updated-after <value>",'Filter by updated_at lower bound: ISO timestamp or signed relative (e.g. "-2h"/"-7d" for the past)').option("--updated-before <value>","Filter by updated_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-after <value>","Filter by created_at lower bound: ISO timestamp or signed relative (-2h/+1d)").option("--created-before <value>","Filter by created_at upper bound: ISO timestamp or signed relative (-2h/+1d)").option("--assignee <value>","Filter by assignee").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <value>","Filter by parent item ID").option("--compact","Render compact search hits (default; mutually exclusive with --full/--fields)").option("--full","Render full search hits with nested item payloads (mutually exclusive with --compact/--fields)").option("--fields <value>",`Render custom comma-separated search hit fields (mutually exclusive with --compact/--full). ${g("search","--fields")}`).option("--format <value>","Search output format override: json|ndjson|toon").option("--limit <n>","Limit returned item count").option("--after <cursor>","Continue after an opaque next_cursor from a previous search response");ue(n),n.action(Ae),d(n,"--tags <value>","Alias for --tag"),d(n,"--token_budget <n>","Alias for --token-budget")}if(i("eval")&&e.command("eval").description("Evaluate search relevance against a curated golden-query set: reports nDCG@k, MRR@k, precision@k, and recall@k per query plus the macro average. Use --fail-under as a CI gate.").option("--mode <value>","Default retrieval mode for queries without their own: keyword|semantic|hybrid (default: keyword)").option("--k <n>","Metric cutoff @k (positive integer; default: 10)").option("--fail-under <value>","Exit non-zero when aggregate nDCG@k falls below this threshold (0..1); CI gate").option("--queries <path>",`Query JSON (${ie}); default: search/eval-queries.json; errors show an example`).option("--format <value>","Eval output format override: json|toon").action(De),i("get")){let n=e.command("get").argument("<id>","Item id").option("--for <intent>",`Apply a declared context intent projection. ${g("get","--for")}`).option("--token-budget <n>","Override the selected intent's maximum estimated output tokens").option("--depth <value>","Detail depth: brief|standard|deep|full (full aliases deep; default: standard)").option("--full","Explicit full item read; equivalent to --depth deep (mutually exclusive with --depth/--fields)").option("--fields <value>",`Render custom comma-separated item metadata fields. ${g("get","--fields")}`).option("--tree","Include descendants rooted at the requested item").option("--tree-depth <n>","Maximum subtree depth for --tree descendants").option("--at <version-or-timestamp>","Reconstruct a verified historical item state without mutating it").option("--format <value>","Get output format override: json|toon").description("Show item details by ID.").action(Fe);d(n,"--tree_depth <n>","Alias for --tree-depth"),d(n,"--token_budget <n>","Alias for --token-budget")}if(i("history")){let n=e.command("history").enablePositionalOptions().argument("<id>","Item id").option("--limit <n>","Latest n entries").option("--compact","Index, time, op, author, patch count, fields").option("--full","Full entries with JSON Patches").option("--provenance","Authors and provenance; no patches").option("--provenance-summary","Count provenance completeness").option("--harness <value>","Recorded/resolved harness (repeatable)",s).option("--agent-instance <value>","Agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Exact provenance match (repeatable)",s).option("--diff","Before/after field diffs").option("--field <name>","Filter changed field; implies --diff").option("--verify","Verify full chain and replay").option("--strict-exit","With --verify, fail on integrity errors").option("--fail-on-warn","Alias for --strict-exit").option("--format <value>","Output: json|toon").description("Show item history entries.").action(Ee);de(n,!0),F(n.command("activity"))}i("events")&&e.command("events").option("--since <cursor-or-timestamp>","Resume strictly after a durable cursor, or include events from an ISO timestamp").option("--type <value>","Filter by mutation operation (repeatable or comma-separated)",s).option("--author <value>","Filter by mutation author (repeatable or comma-separated)",s).option("--item <value>","Filter by item or workspace stream id (repeatable or comma-separated)",s).option("--limit <n>","Return at most 1,000 events (default: 100)").option("--cursor-mode <mode>","Cursor framing: batch emits one terminal trailer (default); row preserves one cursor per event").option("--full","Include each complete authoritative history entry").option("--provenance","Include patch-free author, harness, instance, and extensible provenance").option("--provenance-summary","Include bounded provenance completeness counts").option("--harness <value>","Filter by recorded or vocabulary-resolved harness (repeatable)",s).option("--agent-instance <value>","Filter by privacy-safe agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter by an exact declared provenance value (repeatable)",s).option("--follow","Continue emitting committed events as newline-delimited JSON").option("--interval-ms <n>","Empty-read delay while following (minimum: 10ms; default: 250ms)").description("Emit cursor-resumable committed mutation facts as newline-delimited JSON.").action(Re),i("activity")&&F(e.command("activity",{hidden:!0})),i("graph")&&e.command("graph").argument("<subcommand>","Graph query (ancestors, descendants, predecessors, successors, paths, impact, analyze, audit, communities, redundancy, dominators, slack, centrality, articulation, plan, index)").argument("[id]","Root item id (traversals, paths, impact, and dominators)").argument("[target]","Target item id (paths only)").option("--kind <value>","Restrict traversal to registered relationship kinds (repeatable or comma-separated)",s).option("--max-depth <value>","Maximum traversal depth (non-negative integer)").option("--limit <value>","Maximum returned rows per bounded collection").option("--after <value>","Resume a traversal after this previously returned node id").option("--direction <value>","Edge orientation for paths/impact (outgoing, incoming, or both)").option("--max-paths <value>","Maximum enumerated paths (paths only)").option("--sample <value>","Maximum evidence sample entries per audit finding (audit only)").option("--exempt-isolate <value>","Item ids treated as explicitly valid isolates by the audit (repeatable or comma-separated)",s).option("--exempt-isolate-type <value>","Item types whose active isolates are policy-valid for the audit (repeatable or comma-separated)",s).option("--save-baseline","Persist the audit census as the change-since-baseline comparison point (audit only)").option("--rebuild","Rebuild and warm the durable graph index (index only)").option("--clear","Delete the durable graph index (index only)").option("--summary","Return counts-first envelopes without row collections").option("--full","Return the complete graph row projection").description("Bounded workspace relationship-graph queries, analytics, and governance audit.").action(Te)}var Ft={resolveReadCommandOutputFormat:_,parseListFormat:ce};export{Ft as _testOnlyRegisterListQuery,Dt as registerListQueryCommands};
11
- //# sourceMappingURL=register-list-query-5V43MYPN.js.map
11
+ //# sourceMappingURL=register-list-query-IFPQ4YRD.js.map
@@ -0,0 +1,20 @@
1
+ import{a as ne,c as bt,d as ae,f as wt,g as St,h as At}from"./chunk-NBGSRFZE.js";import{$ as Bt,A as mt,D as yt,E as gt,F as vt,W as Pt,X as Nt,Y as $t,Z as Ht,_ as Lt,aa as Ut,ba as Gt,ca as qt,da as te,ea as oe,fa as ie,s as et,t as st,u as lt,v as dt,w as Z,x as Q,y as ee,z as pt}from"./chunk-VO7DHENB.js";import"./chunk-SXRMM72R.js";import{a as ht}from"./chunk-ZSVINTXT.js";import"./chunk-E6ZES2X7.js";import"./chunk-SGFQQXFD.js";import{Oc as ct,Tc as ut,Va as Qe,ad as ft,lb as ot,tb as it,uc as Y,vb as nt,wb as at,xb as rt}from"./chunk-OBTHQ6UX.js";import{$ as Ie,C as J,R as M,U as Ae,V as ke,W as _e,X as xe,Y as Ce,_ as De,aa as Re,ba as Te,ca as Ee,da as Oe,ea as Fe,fa as Me,ga as Pe,ha as Ne,ia as $e,ja as He,ka as Le,la as Be,ma as Ue,na as Ge,oa as qe,pa as je,qa as Ve,ra as ze,sa as Je,ta as Ke,ua as We,va as Xe,wa as Ye}from"./chunk-6WBR6GMW.js";import{ua as tt,zb as X}from"./chunk-PFWCAI4X.js";import"./chunk-DEZPZOQ7.js";import{$o as b,Ao as I,Cj as q,Ef as h,Eo as y,Fj as j,Hd as he,Hf as f,Ho as d,If as v,Io as s,Ja as ve,Jo as w,Ko as R,No as P,Oo as K,Po as W,Qo as Ze,_a as D,_d as L,a as ye,ad as H,bj as C,bo as we,dh as B,jl as V,ki as U,la as p,na as m,oa as ge,qj as G,rj as be,to as z,wo as Se,xj as x}from"./chunk-7IABMUB6.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]="48b9050b-3290-55d6-82cc-b9d14cc33186")}catch{}})();(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]="f111051f-3880-5ff0-9138-5166cd8a93a9")}catch{}})();(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]="e599b2e9-fc63-5982-b7cf-ae208c127f62")}catch{}})();(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]="fd8685dd-856f-51b2-9bfa-f1df88acb070")}catch{}})();(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]="e972ba26-a7b8-5e91-9e63-21416be686eb")}catch{}})();(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]="a310e747-0cd7-5dff-b8a0-29d3c4ded9f3")}catch{}})();(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]="f27f4c13-4b15-5536-bc5a-b1f263fab5db")}catch{}})();(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]="529dd34d-5a81-504f-9641-28093d41d247")}catch{}})();(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]="6e6bec6b-9415-5f41-87e8-2d1248fba748")}catch{}})();(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]="fd91be06-efd5-5b43-895a-e47a1c144333")}catch{}})();(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]="5760feb1-435b-5b0e-b4ed-c22f6a955bed")}catch{}})();var T={};ye(T,{PROFILE_SUBCOMMANDS:()=>Pt,formatProfileApplyHuman:()=>qt,formatProfileLintHuman:()=>Gt,formatProfileListHuman:()=>Bt,formatProfileShowHuman:()=>Ut,runProfileApply:()=>Lt,runProfileLint:()=>Ht,runProfileList:()=>Nt,runProfileShow:()=>$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]="2d367793-8aa5-5a00-8c8c-60512a27f62a")}catch{}})();(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]="e8448334-e87d-5984-9e89-04e506e0a2a7")}catch{}})();(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]="898eb13c-9378-5c0f-b431-a4f7b1ab7339")}catch{}})();async function re(e){typeof e.description=="string"&&e.description.trim()==="-"&&(e.description=await x().resolveValue(e.description,"--description")??"")}(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]="4cbc230f-02ed-5a59-a76d-c141d9e0d687")}catch{}})();async function jt(e,t,o,i){let n=y(i),r=await pt(e,t,{status:typeof o.status=="string"?o.status:void 0,author:typeof o.author=="string"?o.author:n.author,message:typeof o.message=="string"?o.message:void 0,force:o.force===!0},n);await b(n,r),f(r,n)}async function Vt(e,t){let o=y(t),i=await x().resolveValue("-","--stdin-json");if(i===void 0||i.trim().length===0)throw new m("pm item mutate requires a non-empty JSON batch on stdin.",p.USAGE);let n=typeof e.transactionId=="string"?e.transactionId.trim():"";if(n.length===0)throw new m("pm item mutate requires --transaction-id <value>.",p.USAGE);let r=D(process.cwd(),o.path),a=await U(r),l=bt(i,{transactionId:n,idPrefix:a.id_prefix}),{mutations:c,references:u}=l,g=ne(e);if(e.dryRun===!0){f({transaction_id:n,dry_run:!0,mutation_count:c.length,mutations:c,references:u},o);return}let S=await wt({pmRoot:r,transactionId:n,author:B(typeof e.author=="string"?e.author:o.author,a.author_default),mutations:c,...g});f({...S,mutation_count:c.length,references:u},o)}function zt(e,t){return typeof e=="string"&&e.trim().length>0?e.trim():typeof t=="string"?t.trim():""}async function Jt(e,t,o,i){let n=y(i),r=typeof o.transactionId=="string"?o.transactionId.trim():"";if(r.length===0)throw new m("pm item complete requires --transaction-id <value>.",p.USAGE);let a=zt(t,o.reason);if(a.length===0)throw new m("pm item complete requires a close reason.",p.USAGE);let c=Object.fromEntries(["file","doc","test","comment","note","learning"].filter(_=>o[_]!==void 0).map(_=>[_,o[_]])),u=o.force===!0,{lockTtlSeconds:g,lockWaitMs:S}=ne(o),k={...typeof o.resolution=="string"?{resolution:o.resolution}:{},...typeof o.expectedResult=="string"?{expectedResult:o.expectedResult}:{},...typeof o.actualResult=="string"?{actualResult:o.actualResult}:{},...typeof o.completedAt=="string"?{completedAt:o.completedAt}:{},...typeof o.validateClose=="string"?{validateClose:o.validateClose}:{},...u?{force:!0}:{}},pe={id:e,reason:a,...Object.keys(c).length===0?{}:{evidence:c},...Object.keys(k).length===0?{}:{closeOptions:k},...u?{releaseOptions:{force:!0}}:{}};if(o.dryRun===!0){let _=St(pe);f({transaction_id:r,dry_run:!0,mutation_count:_.length,mutations:_},n);return}let fe=D(process.cwd(),n.path),me=await At({pmRoot:fe,transactionId:r,author:B(typeof o.author=="string"?o.author:n.author,(await U(fe)).author_default),...pe,lockTtlSeconds:g,lockWaitMs:S});f({...me,mutation_count:Object.keys(me.results).length},n)}function kt(e){let t=e.commands.find(o=>o.name()==="item")??e.command("item").description("Run item lifecycle operations.");t.command("reopen <id> <reason>").option("--status <value>","Active target status: open or in_progress").option("--message <value>","Human-readable recurrence history message").option("--force","Override ownership or stale-lock conflicts").option("--author <value>","Mutation author").description("Reopen terminal work with recurrence evidence.").action(jt),t.command("mutate").requiredOption("--transaction-id <value>","Stable idempotency key used to resume an interrupted batch").option("--stdin-json","Read the JSON mutation array from stdin",!0).option("--dry-run","Validate and preview the batch without writing").option("--create-compensation <mode>","Created-item compensation policy: close or delete","close").option("--lock-ttl-seconds <n>","Workspace transaction lock lifetime in seconds").option("--lock-wait-ms <n>","Maximum time to wait for the workspace transaction lock").option("--author <value>","Mutation author").description("Apply SDK-backed mutations atomically.").action(Vt),t.command("complete <id> [reason]").requiredOption("--transaction-id <value>","Stable idempotency key for the composed completion").option("--reason <value>","Close reason when omitted positionally").option("--file <value>","Linked file evidence",d).option("--doc <value>","Linked documentation evidence",d).option("--test <value>","Linked test evidence",d).option("--comment <value>","Evidence comment",d).option("--note <value>","Completion note",d).option("--learning <value>","Durable completion learning",d).option("--resolution <value>","Structured resolution evidence").option("--expected-result <value>","Expected result evidence").option("--actual-result <value>","Actual result evidence").option("--completed-at <value>","Actual completion time").option("--validate-close <mode>","Close validation: off, warn, or strict").option("--lock-ttl-seconds <n>","Workspace transaction lock lifetime in seconds").option("--lock-wait-ms <n>","Maximum time to wait for the workspace transaction lock").option("--dry-run","Validate and preview completion without writing").option("--force","Override lifecycle and ownership conflicts").option("--author <value>","Completion author").description("Close with evidence and release the claim.").action(Jt)}(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]="771083a4-6b0a-530d-b607-bf1c1010ff0e")}catch{}})();async function Kt(e,t){let o=y(t),i=Array.isArray(e.event)?e.event:[],n=await Qe(D(process.cwd(),o.path),{historyEvent:i,allActionable:e.allActionable===!0,dryRun:e.dryRun===!0,planFingerprint:s(e,"planFingerprint"),limit:e.limit,attributedAuthor:s(e,"attributedAuthor"),reviewer:s(e,"reviewer"),reason:s(e,"reason")});f(n,o)}function _t(e){e.command("history-author-acknowledge").option("--event <item-id:line>","Unknown-author event coordinate (repeatable)",d).option("--all-actionable","Select all actionable events").option("--dry-run","Preview a deterministic source-bound plan").option("--plan-fingerprint <sha256>","Apply the exact fingerprint returned by --dry-run").option("--limit <n>","Maximum coordinate rows returned in the plan").option("--attributed-author <value>","Reviewed principal attribution").option("--reviewer <value>","Disposition reviewer").option("--reason <value>","Review evidence").description("Append audited dispositions for immutable unknown-author events.").action(Kt)}(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]="53ca90df-8382-5cc2-8906-8491afe5101a")}catch{}})();(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]="e2514244-d31d-5ee4-b037-b9101f9a24e1")}catch{}})();(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]="10a4ed4d-39d3-5b7b-87b1-4a6f95f0f2ab")}catch{}})();(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]="796e71dc-4693-50da-bbb8-57b19ff0af95")}catch{}})();(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]="dc9822ba-df3c-5179-827e-ef2551786b14")}catch{}})();function se(e,t,o,i){if(t.trim().toLowerCase()!=="add"||!o?.trim())return;let n=s(i,"add")??s(i,"text")??s(i,"note")??s(i,"body")??s(i,"comment"),r=s(i,"file"),a=[e,o.trim()];n!==void 0?a.push("--add",n):i.stdin===!0?a.push("--stdin"):r!==void 0?a.push("--file",r):a.push("--add","-");let l=H(a),c=H([e,o.trim(),"--add","-"]);throw new m(`The positional token "add" was parsed as the item id, while "${o.trim()}" was parsed as annotation text. ${e} does not use an add subcommand.`,p.USAGE,{code:"annotation_transposed_subcommand",reason:"noun_verb_object_transposition",required:`Place the item id immediately after ${e}, then use --add for annotation text.`,examples:[...new Set([l,c])],recovery:{attempted_command:`pm ${e} add ${o.trim()}`,normalized_args:[e,"add",o.trim()],parsed_positionals:[{role:"transposed_subcommand",value:"add"},{role:"item_id",value:o.trim()}],suggested_retry:l}})}function xt(e,t,o){let i=o.flatMap(r=>{let a=s(t,r);return a===void 0?[]:[{alias:r,value:a}]});if([...new Set(i.map(({value:r})=>r))].length>1)throw new m(`Specify ${e} text with one alias or the same value across aliases: ${i.map(({alias:r})=>`--${r}`).join(", ")}`,p.USAGE,{code:"annotation_alias_conflict"});return i[0]?.value}function Wt(e,t){let o=typeof t.edit=="number"?t.edit:void 0,i=typeof t.delete=="number"?t.delete:void 0,n=xt("comment",t,["add","text","body","comment"]),r=typeof e=="string"?e:void 0,a=t.stdin===!0,l=s(t,"file");if(+(n!==void 0)+ +(r!==void 0)+Number(a)+ +(l!==void 0)>1)throw n!==void 0&&r!==void 0&&!a&&l===void 0?new m("Specify comment text either as positional [text] or with --add, not both",p.USAGE):new m("Specify comment text with exactly one source: positional [text], --add, --stdin, or --file",p.USAGE);let u=n??r;return{add:u,readFromStdin:a,readFromFile:l,editIndex:o,deleteIndex:i,isMutation:typeof u=="string"||a||l!==void 0||o!==void 0||i!==void 0}}function Ct(e,t,o){let i=xt(e,o,e==="note"?["add","text","note"]:["add","text"]),n=typeof t=="string"?t:void 0;if(i!==void 0&&n!==void 0)throw new m(`Specify ${e} text either as positional [text] or with --add, not both`,p.USAGE);let r=i??n,a=e==="note"?s(o,"addJson"):void 0,l=o.stdin===!0,c=s(o,"file"),u=typeof o.edit=="number"?o.edit:void 0,g=typeof o.delete=="number"?o.delete:void 0;return{add:r,addJson:a,readFromStdin:l,readFromFile:c,editIndex:u,deleteIndex:g,isMutation:typeof r=="string"||a!==void 0||l||c!==void 0||u!==void 0||g!==void 0}}async function Xt(e,t,o,i){let n=y(i),r=Date.now();se("comments",e,t,o);let a=Wt(t,o),l=await et(e,{add:a.add,stdin:a.readFromStdin,file:a.readFromFile,edit:a.editIndex,delete:a.deleteIndex,limit:s(o,"limit"),fullHistory:o.fullHistory===!0,ifAbsent:o.ifAbsent===!0,author:s(o,"author"),message:s(o,"message"),ownershipAppendBypass:o.ownershipAppendBypass===!0,force:!!o.force},n);a.isMutation&&l.changed!==!1&&await b(n,l),le("comments",l,n,r)}async function Yt(e,t,o,i){let n=y(i),r=Date.now();se("notes",e,t,o);let a=Ct("note",t,o),l=await vt(e,{add:a.add,addJson:a.addJson,stdin:a.readFromStdin,file:a.readFromFile,edit:a.editIndex,delete:a.deleteIndex,limit:s(o,"limit"),since:s(o,"since"),eventType:s(o,"eventType"),includeMeta:o.includeMeta===!0,fullHistory:o.fullHistory===!0,ifAbsent:o.ifAbsent===!0,author:s(o,"author"),message:s(o,"message"),ownershipAppendBypass:o.ownershipAppendBypass===!0,force:!!o.force},n);a.isMutation&&l.changed!==!1&&await b(n,l),le("notes",l,n,r)}async function Zt(e,t,o,i){let n=y(i),r=Date.now();se("learnings",e,t,o);let a=Ct("learning",t,o),l=await st(e,{add:a.add,stdin:a.readFromStdin,file:a.readFromFile,edit:a.editIndex,delete:a.deleteIndex,limit:s(o,"limit"),fullHistory:o.fullHistory===!0,ifAbsent:o.ifAbsent===!0,author:s(o,"author"),message:s(o,"message"),ownershipAppendBypass:o.ownershipAppendBypass===!0,force:!!o.force},n);a.isMutation&&l.changed!==!1&&await b(n,l),le("learnings",l,n,r)}function le(e,t,o,i){f(t,o),o.profile&&v(`profile:command=${e} took_ms=${Date.now()-i}`)}function Dt(e,t){let o=e.command("comments").argument("<id>","Item id").argument("[text]","Optional comment text shorthand (equivalent to --add)").option("--add <text>","Append comment text; use text=<value> for structured input or - for stdin").option("--stdin","Read comment text from stdin (supports multiline markdown)").option("--file <path>","Read comment text from a file or stdin (-)").option("--edit <index>","Replace one comment using positional text, --add, --stdin, or --file",t("--edit")).option("--delete <index>","Delete the comment at 1-based <index>",t("--delete")).option("--limit <n>","Return only latest n comments").option("--full-history","Return complete comment history instead of a bounded mutation receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Comment author; defaults to PM_AUTHOR or settings").option("--message <value>","History message").option("--force","Force ownership override").description("List, add, edit, or delete comments for an item.").action(Xt);w(o,"--body <text>","Alias for --add",!1),w(o,"--text <text>","Alias for --add",!1),w(o,"--comment <text>","Alias for --add",!1);let i=e.command("notes").argument("<id>","Item id").argument("[text]","Optional note text shorthand for --add").option("--add <text>","Add a text note (- reads stdin)").option("--note <text>","Alias for --add").option("--add-json <json>","Append a JSON event").option("--stdin","Read note text from stdin").option("--file <path>","Read note from file or stdin (-)").option("--edit <index>","Replace a 1-based note using the selected text input",t("--edit")).option("--delete <index>","Delete the note at 1-based <index>",t("--delete")).option("--limit <n>","Return only latest n notes").option("--since <timestamp>","Filter JSON events from this ISO time").option("--event-type <value>","Filter JSON events by top-level type").option("--include-meta","Include count and truncation metadata").option("--full-history","Return complete note history instead of a bounded receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Author; defaults to PM_AUTHOR/settings").option("--message <value>","History message").option("--force","Force ownership override").description("Manage merge-safe text notes and JSON context events.").action(Yt);w(i,"--text <text>","Alias for --add",!1);let n=e.command("learnings").argument("<id>","Item id").argument("[text]","Optional learning text shorthand for --add").option("--add <text>","Append learning text; use text=<value> or - for stdin").option("--stdin","Read learning text from stdin").option("--file <path>","Read learning text from a file or stdin (-)").option("--edit <index>","Replace one learning using positional text, --add, --stdin, or --file",t("--edit")).option("--delete <index>","Delete the learning at 1-based <index>",t("--delete")).option("--limit <n>","Return only latest n learnings").option("--full-history","Return complete learning history instead of a bounded receipt").option("--if-absent","Append only when resolved author and text are absent").option("--author [value]","Learning author (optional; falls back to PM_AUTHOR/settings)").option("--message <value>","History message").option("--force","Force ownership override").description("List, add, edit, or delete learnings for an item.").action(Zt);w(n,"--text <text>","Alias for --add",!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]="2cac3cd9-887c-56e0-a197-cc36d2203c9e")}catch{}})();function de(e,t){return o=>{let i=Number(o);if(!Number.isInteger(i)||i<t)throw new m(`${e} must be an integer greater than or equal to ${t}.`,p.USAGE);return i}}async function Qt(e,t,o){let i=y(o);if(t.scope!==void 0&&t.scope!=="project"&&t.scope!=="global")throw new m("--scope must be either project or global.",p.USAGE);let n=await at({paths:e,scope:t.scope,limit:typeof t.limit=="number"?t.limit:void 0,offset:typeof t.offset=="number"?t.offset:void 0,noTruncate:t.noTruncate===!0,strictRead:t.strictRead===!0,explain:t.explain===!0,lineRange:typeof t.lines=="string"?it(t.lines):void 0,decisionDepth:typeof t.decisionDepth=="number"?t.decisionDepth:void 0},i);f(n,i)}function It(e){e.command("lookup").argument("<paths...>","Project-relative or absolute source paths").option("--scope <scope>","Restrict links to project or global scope").option("--limit <n>","Maximum referencing items to return",de("--limit",1)).option("--offset <n>","Number of referencing items to skip",de("--offset",0)).option("--no-truncate","Return every referencing item").option("--strict-read","Fail when any authoritative item cannot be read").option("--explain","Include ranked source-to-work rationale").option("--lines <start:end>","Attribute an inclusive source line range").option("--decision-depth <n>","Maximum governing-decision relationship depth",de("--decision-depth",1)).description("Find and explain pm items that govern requested source paths.").action(Qt)}(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]="89de1556-ed75-5c37-bc98-164490364567")}catch{}})();var eo=["add-","apply-","list-","remove-","show-"],to=new Set(["field","fields","help","status","statuses","type","types"]);function ce(e){let t=e.trim(),o=t.toLowerCase();return o.length===0?!1:t[0]===o[0]||to.has(o)||eo.some(i=>o.startsWith(i))}function N(e){if(e!=null){if(typeof e=="number"){if(!Number.isInteger(e))throw new m("--order must be a finite integer.",p.USAGE);return e}if(typeof e=="string"){if(e.trim().length===0)return;let t=Number(e);if(!Number.isInteger(t))throw new m("--order must be a finite integer.",p.USAGE);return t}throw new m("--order must be a finite integer.",p.USAGE)}}(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]="9e5f7e21-caa0-5a5c-9d38-36d834aba1e0")}catch{}})();function E(e){if(Array.isArray(e))return e;if(typeof e=="string")return[e]}var O={};ye(O,{SCHEMA_SUBCOMMANDS:()=>_e,_testOnlySchemaCommand:()=>Ye,formatSchemaAddFieldHuman:()=>Ve,formatSchemaAddStatusHuman:()=>Be,formatSchemaAddTypeHuman:()=>He,formatSchemaApplyPresetHuman:()=>We,formatSchemaEvolutionMigrationHuman:()=>ke,formatSchemaInferTypesHuman:()=>Xe,formatSchemaListFieldsHuman:()=>Je,formatSchemaListHuman:()=>Ge,formatSchemaRemoveFieldHuman:()=>ze,formatSchemaRemoveStatusHuman:()=>Ue,formatSchemaRemoveTypeHuman:()=>Le,formatSchemaShowFieldHuman:()=>Ke,formatSchemaShowHuman:()=>qe,formatSchemaShowStatusHuman:()=>je,runSchemaAddField:()=>Oe,runSchemaAddStatus:()=>De,runSchemaAddType:()=>xe,runSchemaApplyPreset:()=>Ne,runSchemaEvolutionMigration:()=>Ae,runSchemaInferTypes:()=>$e,runSchemaList:()=>Re,runSchemaListFields:()=>Me,runSchemaRemoveField:()=>Fe,runSchemaRemoveStatus:()=>Ie,runSchemaRemoveType:()=>Ce,runSchemaShow:()=>Te,runSchemaShowField:()=>Pe,runSchemaShowStatus:()=>Ee,runWorkflowPolicyAction:()=>M});(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]="a4b4d693-ba4c-529a-a5d4-8f6c874830ad")}catch{}})();(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]="cb103163-4289-5731-9e72-06b69adb3b81")}catch{}})();function oo(e,t){let o=t.normalizedSubcommand;return o!=="rename-type"&&o!=="rename-field"&&o!=="remap-status"?null:e.runSchemaEvolutionMigration({kind:o,from:t.typeName,to:s(t.options,"to"),...o==="rename-field"&&typeof t.options.type=="string"?{type:t.options.type}:{}},{migrationId:s(t.options,"migrationId")??s(t.options,"migration_id"),dryRun:t.options.dryRun===!0,author:t.author,force:t.force},t.globalOptions)}function io(e,t){let{normalizedSubcommand:o,typeName:i,globalOptions:n,author:r,force:a}=t;switch(o){case"list":return e.runSchemaList(n);case"show":return e.runSchemaShow(i,n);case"show-status":return e.runSchemaShowStatus(i,n);case"list-fields":return e.runSchemaListFields(n);case"show-field":return e.runSchemaShowField(i,n);case"remove-type":return e.runSchemaRemoveType(i,{author:r,force:a},n);case"remove-field":return e.runSchemaRemoveField(i,{author:r,force:a},n);case"remove-status":return e.runSchemaRemoveStatus(i,{author:r,force:a},n);case"apply-preset":return e.runSchemaApplyPreset(i,{author:r,force:a},n);default:return null}}async function no(e,t){let{normalizedSubcommand:o,typeName:i,options:n,globalOptions:r}=t,{author:a,force:l,description:c}=t,u=oo(e,t);if(u)return u;let g=io(e,t);if(g)return g;switch(o){case"add-field":return e.runSchemaAddField(i,{type:typeof n.type=="string"?n.type:void 0,commands:t.commands,description:c,cliFlag:typeof n.cliFlag=="string"?n.cliFlag:void 0,alias:t.aliases,required:!!n.required,requiredOnCreate:!!n.requiredOnCreate,allowUnset:n.allowUnset!==!1,requiredTypes:t.requiredTypes,author:a,force:l},r);case"add-status":return e.runSchemaAddStatus(i,{role:t.roles,alias:t.aliases,description:c,order:t.order,author:a,force:l},r);default:return n.infer===!0?e.runSchemaInferTypes({minCount:t.minCount,apply:!!n.apply,author:a,force:l},r):e.runSchemaAddType(i,{description:c,defaultStatus:t.defaultStatus,folder:typeof n.folder=="string"?n.folder:void 0,alias:t.aliases,author:a,force:l},r)}}function ao(e,t){if("migration_id"in t){h(`${e.formatSchemaEvolutionMigrationHuman(t)}
2
+ `);return}switch(t.action){case"list":h(`${e.formatSchemaListHuman(t)}
3
+ `);return;case"show":h(`${e.formatSchemaShowHuman(t)}
4
+ `);return;case"show-status":h(`${e.formatSchemaShowStatusHuman(t)}
5
+ `);return;case"list-fields":h(`${e.formatSchemaListFieldsHuman(t)}
6
+ `);return;case"show-field":h(`${e.formatSchemaShowFieldHuman(t)}
7
+ `);return;case"remove-type":h(`${e.formatSchemaRemoveTypeHuman(t)}
8
+ `);break;case"remove-field":h(`${e.formatSchemaRemoveFieldHuman(t)}
9
+ `);break;case"apply-preset":h(`${e.formatSchemaApplyPresetHuman(t)}
10
+ `);break;case"infer-types":h(`${e.formatSchemaInferTypesHuman(t)}
11
+ `);break;case"add-field":h(`${e.formatSchemaAddFieldHuman(t)}
12
+ `);break;case"add-status":h(`${e.formatSchemaAddStatusHuman(t)}
13
+ `);break;case"remove-status":h(`${e.formatSchemaRemoveStatusHuman(t)}
14
+ `);break;default:h(`${e.formatSchemaAddTypeHuman(t)}
15
+ `);break}t.warnings.length>0&&v(`schema ${t.action} warnings: ${P(t.warnings)}`)}function Rt(e){if(Array.isArray(e))return e.flatMap(t=>t.split(",")).map(t=>t.trim()).filter(t=>t.length>0)}async function ro(e,t,o,i){let n=y(i),r=Date.now(),{SCHEMA_SUBCOMMANDS:a}=O,l=(e??"").trim().toLowerCase(),c=t;if(so(l,a),!a.includes(l)&&c===void 0&&!ce(e)&&(c=e,l="add-type"),!a.includes(l))throw C({command_path:"schema",token:l,allowed:a});let u=he.find(g=>g===l);if(u)f(await M(u,t,{definition:o.definition,policy:s(o,"policy"),message:s(o,"message"),author:s(o,"author"),dryRun:o.dryRun===!0},n),n);else{let g=await no(O,{normalizedSubcommand:l,typeName:c,options:o,aliases:E(o.alias),roles:E(o.role),commands:Rt(o.commands),requiredTypes:Rt(o.requiredTypes),defaultStatus:s(o,"defaultStatus")??s(o,"default_status"),order:N(o.order),minCount:N(o.minCount),author:s(o,"author"),force:!!o.force,description:s(o,"description"),globalOptions:n});n.json===!0||n.defaultOutputFormat==="json"?f(g,n):n.quiet||ao(O,g)}n.profile&&v(`profile:command=schema took_ms=${Date.now()-r}`)}function so(e,t){if(!e)throw new m(`pm schema requires a subcommand. Allowed: ${t.join(", ")}`,p.USAGE,{code:"missing_required_argument",examples:["pm schema list","pm schema show Task","pm schema show-status open",'pm schema add-type Spike --description "Time-boxed investigation" --default-status open',"pm schema remove-type Spike","pm schema add-status review --role active --alias in_review","pm schema remove-status review","pm schema add-field severity_level --type string --commands create,update","pm schema list-fields","pm schema apply-preset agile","pm schema add-type --infer --min-count 10","pm schema rename-type Spike --to Experiment --migration-id spike-v2 --dry-run","pm schema rename-field severity --to impact --migration-id severity-v2","pm schema remap-status review --to verifying --migration-id review-v2"]})}function Tt(e){let t=e.command("schema").option("--definition <json>","Policy or proposed fields JSON").option("--policy <id>","Policy id for policy-approve").option("--message <text>","Audit rationale for a policy mutation").argument("[subcommand]","Required; schema verb (list/show, add/remove, rename/remap, policy-*), or custom type shorthand").argument("[name]","Definition/source name or item id; policy-mode: advise|refuse").option("--description <text>","Type, status, or field description").option("--default-status <status>","Default status for this type").option("--folder <dir>","Storage folder for items of this custom type").option("--alias <name>","Alias for the custom type, status, or field flag (repeatable, csv-friendly)",d).option("--role <value>","Lifecycle role for a custom status (repeatable): draft, active, blocked, terminal, terminal_done, terminal_canceled, default_open, default_close, default_cancel",d).option("--order <n>","Display/sort order for a custom status").optionsGroup("Field options (add-field):").option("--type <type>","Value type for a custom field (add-field): string, number, boolean, string_array, array, object").option("--commands <list>","Field commands (repeatable/csv): create, update, update_many, list, search, calendar, context",d).option("--cli-flag <flag>","Override the auto-derived CLI flag for a custom field (add-field)").option("--required","Mark a custom field as always required (add-field)").option("--required-on-create","Mark a custom field as required at create time (add-field)").option("--no-allow-unset","Disallow clearing a custom field via --unset (add-field)").option("--required-types <list>","Restrict a custom field's requirement to specific item types (add-field; repeatable, comma-friendly)",d).optionsGroup("Type inference and migration options:").option("--infer","Infer custom item types from title-prefix conventions (add-type; preview unless --apply)").option("--min-count <n>","Minimum items sharing a prefix for add-type --infer (default 10)").option("--apply","Register inferred types (add-type --infer); without it the command previews only").option("--to <name>","Target definition name for rename/remap migrations").option("--migration-id <id>","Stable idempotency key for a resumable schema migration").option("--dry-run","Preview schema changes without writes").option("--author <value>","Mutation author").option("--force","Force ownership/lock override").description("Manage types, statuses, fields, presets, and workflow policies.");w(t,"--default_status <status>","Alias for --default-status",!1),w(t,"--migration_id <id>","Alias for --migration-id",!1),t.action(ro)}(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]="3418cfe8-745d-5f3c-9d14-8293e7296875")}catch{}})();var lo=new Set(ge.map(e=>e.toLowerCase())),co=new Set(we.map(e=>e==="estimate"?"estimatedMinutes":e));async function uo(e,t,o,i,n){switch(t){case"list":return e.runProfileList();case"show":return e.runProfileShow(o);case"lint":return e.runProfileLint(o);default:return e.runProfileApply(o,{dryRun:i.dryRun===!0,author:typeof i.author=="string"?i.author:void 0,force:i.force===!0},n)}}function po(e,t){switch(t.action){case"list":h(`${e.formatProfileListHuman(t)}
16
+ `);return;case"show":h(`${e.formatProfileShowHuman(t)}
17
+ `);return;case"lint":h(`${e.formatProfileLintHuman(t)}
18
+ `);return;default:h(`${e.formatProfileApplyHuman(t)}
19
+ `),t.warnings.length>0&&v(`profile apply warnings: ${P(t.warnings)}`);break}}function fo(e){return t=>{let o=Number(t);if(!Number.isInteger(o)||o<1)throw new m(`${e} must be a positive integer (1-based index).`,p.USAGE);return o}}function Et(e,t){e.option("--filter-has-notes",`Select only items that have notes before ${t}`).option("--filter-no-notes",`Select only items that have no notes before ${t}`).option("--filter-has-learnings",`Select only items that have learnings before ${t}`).option("--filter-no-learnings",`Select only items that have no learnings before ${t}`).option("--filter-has-files",`Select only items that have linked files before ${t}`).option("--filter-no-files",`Select only items that have no linked files before ${t}`).option("--filter-has-docs",`Select only items that have linked docs before ${t}`).option("--filter-no-docs",`Select only items that have no linked docs before ${t}`).option("--filter-has-tests",`Select only items that have linked tests before ${t}`).option("--filter-no-tests",`Select only items that have no linked tests before ${t}`).option("--filter-has-comments",`Select only items that have comments before ${t}`).option("--filter-no-comments",`Select only items that have no comments before ${t}`).option("--filter-has-deps",`Select only items that have dependencies before ${t}`).option("--filter-no-deps",`Select only items that have no dependencies before ${t}`).option("--filter-has-body",`Select only items that have a non-empty body before ${t}`).option("--filter-empty-body",`Select only items with an empty body before ${t}`).option("--filter-has-linked-command",`Select only items whose linked tests carry a runnable command before ${t}`).option("--filter-no-linked-command",`Select only items whose linked tests carry no runnable command before ${t}`).option("--filter-reviewer-missing",`Select only items missing reviewer before ${t}`).option("--filter-risk-missing",`Select only items missing risk before ${t}`).option("--filter-confidence-missing",`Select only items missing confidence before ${t}`).option("--filter-sprint-missing",`Select only items missing sprint before ${t}`).option("--filter-release-missing",`Select only items missing release before ${t}`)}var mo=[["filterHasNotes","filterNoNotes","--filter-has-notes","--filter-no-notes"],["filterHasLearnings","filterNoLearnings","--filter-has-learnings","--filter-no-learnings"],["filterHasFiles","filterNoFiles","--filter-has-files","--filter-no-files"],["filterHasDocs","filterNoDocs","--filter-has-docs","--filter-no-docs"],["filterHasTests","filterNoTests","--filter-has-tests","--filter-no-tests"],["filterHasComments","filterNoComments","--filter-has-comments","--filter-no-comments"],["filterHasDeps","filterNoDeps","--filter-has-deps","--filter-no-deps"],["filterHasBody","filterEmptyBody","--filter-has-body","--filter-empty-body"],["filterHasLinkedCommand","filterNoLinkedCommand","--filter-has-linked-command","--filter-no-linked-command"]];function Ot(e){let t=o=>e[o]===!0?!0:void 0;for(let[o,i,n,r]of mo)if(e[o]===!0&&e[i]===!0)throw new m(`Cannot combine ${n} with ${r} for the same field.`,p.USAGE);return{filterReviewerMissing:t("filterReviewerMissing"),filterRiskMissing:t("filterRiskMissing"),filterConfidenceMissing:t("filterConfidenceMissing"),filterSprintMissing:t("filterSprintMissing"),filterReleaseMissing:t("filterReleaseMissing"),hasNotes:t("filterHasNotes"),hasLearnings:t("filterHasLearnings"),hasFiles:t("filterHasFiles"),hasDocs:t("filterHasDocs"),hasTests:t("filterHasTests"),hasComments:t("filterHasComments"),hasDeps:t("filterHasDeps"),hasBody:t("filterHasBody"),hasLinkedCommand:t("filterHasLinkedCommand"),noNotes:t("filterNoNotes"),noLearnings:t("filterNoLearnings"),noFiles:t("filterNoFiles"),noDocs:t("filterNoDocs"),noTests:t("filterNoTests"),noComments:t("filterNoComments"),noDeps:t("filterNoDeps"),emptyBody:t("filterEmptyBody"),noLinkedCommand:t("filterNoLinkedCommand")}}function ue(e,t){for(let o of t){let i=[],n=e.args,r=a=>(e.args!==n&&(i.length=0,n=e.args),i.push(a),i);o.required?e.requiredOption(o.option,o.description):o.repeatable?e.option(o.option,o.description,r):e.option(o.option,o.description);for(let a of o.aliasOptions??[])V(o.option,a.option)?w(e,a.option,a.description,o.repeatable===!0,o.repeatable?r:void 0):o.repeatable?e.option(a.option,a.description,r):e.option(a.option,a.description)}}function yo(e){let t=o=>typeof e[o]=="string"?e[o]:void 0;return{type:t("filterType"),tag:t("filterTag"),priority:t("filterPriority"),deadlineBefore:t("filterDeadlineBefore"),deadlineAfter:t("filterDeadlineAfter"),updatedAfter:t("filterUpdatedAfter"),updatedBefore:t("filterUpdatedBefore"),createdAfter:t("filterCreatedAfter"),createdBefore:t("filterCreatedBefore"),ids:t("ids"),assignee:t("filterAssignee"),assigneeFilter:t("filterAssigneeFilter")??t("filterAssignee_filter"),parent:t("filterParent"),sprint:t("filterSprint"),release:t("filterRelease"),filterAcMissing:e.filterAcMissing===!0?!0:void 0,filterEstimatesMissing:e.filterEstimatesMissing===!0||e.filterEstimateMissing===!0?!0:void 0,filterResolutionMissing:e.filterResolutionMissing===!0?!0:void 0,filterMetadataMissing:e.filterMetadataMissing===!0?!0:void 0,...Ot(e),limit:t("limit"),offset:t("offset"),includeBody:!0}}function F(...e){for(let t of e)if(typeof t=="string")return t}function go(e,t,o){return typeof t=="string"&&t.length>0?{positionalType:e,positionalTitle:t}:typeof e!="string"||e.length===0?{positionalType:void 0,positionalTitle:void 0}:typeof o.title=="string"&&o.title.trim().length>0&&o.type===void 0?{positionalType:e,positionalTitle:void 0}:{positionalType:void 0,positionalTitle:e}}function vo(e,t,o){if(e!==void 0||typeof t!="string"||t.length===0||o.title!==void 0||o.type!==void 0||!lo.has(t.trim().toLowerCase()))return;let i=t.trim();throw new m(`pm create needs a title \u2014 "${i}" looks like an item type, not a title. Use either: pm create ${i} "<title>" or pm create "<title>" --type ${i}.`,p.USAGE,{code:"create_positional_type_without_title",why:'Without this guard the single positional is used as the title and the type defaults to Task \u2014 so the command would silently create a Task literally titled "'+i+'".',examples:[`pm create ${i} "Wire up SSO for the agent harness"`,`pm create "Wire up SSO for the agent harness" --type ${i}`],nextSteps:[`Re-run with both type and title: pm create ${i} "<title>"`]})}var ho=["body","bodyFile","description","dep","depRemove","comment","note","learning","file","test","doc","reminder","event","typeOption","field","ids"];function $(e){let t=ho.flatMap(o=>{let i=e[o],n=typeof i=="string"&&i.trim()==="-"?1:Array.isArray(i)?i.filter(a=>typeof a=="string"&&a.trim()==="-").length:0,r=`--${o.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`)}`;return Array.from({length:n},()=>r)});if(e.stdinJson===!0&&t.unshift("--stdin-json"),t.length>1)throw new m(`Only one option may consume stdin per command invocation. Found: ${t.join(", ")}.`,p.USAGE)}function Ft(e,t,o){let i=[];t&&i.push("body"),o&&i.push("description"),be(e,i)}function Mt(e,t){return!t&&typeof e.description=="string"&&e.description.trim()==="-"}async function bo(e,t,o,i){let n=y(i),r=Date.now();$(o);let a=o.stdinJson===!0;if(a){let k=await x().resolveValue("-","--stdin-json");o=ae(k??"","create",o)}let l=go(e,t,o);vo(l.positionalType,l.positionalTitle,o),typeof l.positionalType=="string"&&l.positionalType.length>0&&o.type===void 0&&(o.type=l.positionalType),typeof l.positionalTitle=="string"&&l.positionalTitle.length>0&&o.title===void 0&&(o.title=l.positionalTitle);let c=Mt(o,a);a||await re(o);let u=typeof o.bodyFile=="string";u&&(o.body=await j(String(o.bodyFile),o.body!==void 0?String(o.body):void 0),delete o.bodyFile);let g=K(o,{requireType:!1});Ft(g,u,c),a&&G(g);let S=await ct(g,n);await b(n,S),f(S,n),n.profile&&v(`profile:command=create took_ms=${Date.now()-r}`)}function wo(e){return{type:s(e,"filterType"),tag:s(e,"filterTag"),priority:s(e,"filterPriority"),deadlineBefore:s(e,"filterDeadlineBefore"),deadlineAfter:s(e,"filterDeadlineAfter"),updatedAfter:s(e,"filterUpdatedAfter"),updatedBefore:s(e,"filterUpdatedBefore"),createdAfter:s(e,"filterCreatedAfter"),createdBefore:s(e,"filterCreatedBefore"),ids:s(e,"ids"),assignee:s(e,"filterAssignee"),assigneeFilter:F(e.filterAssigneeFilter,e.filterAssignee_filter),parent:s(e,"filterParent"),sprint:s(e,"filterSprint"),release:s(e,"filterRelease"),...Ot(e),limit:s(e,"limit"),offset:s(e,"offset")}}async function So(e,t){let o=y(t),i=Date.now();$(e),e.ids=await q(s(e,"ids"));let n=await dt({status:s(e,"filterStatus"),list:wo(e),reason:s(e,"reason"),completedAt:s(e,"completedAt"),resolution:s(e,"resolution"),expectedResult:F(e.expectedResult,e.expected_result,e.expected),actualResult:F(e.actualResult,e.actual_result,e.actual),validateClose:e.validateClose===!0?"warn":s(e,"validateClose"),author:s(e,"author"),message:s(e,"message"),force:!!e.force,dryRun:e.dryRun===!0?!0:void 0,rollback:s(e,"rollback"),checkpoint:e.checkpoint===!1?!1:void 0},o);await b(o,n),f(n,o),o.profile&&v(`profile:command=close-many took_ms=${Date.now()-i}`)}async function Ao(e,t){let o=y(t),i=Date.now();$(e),e.ids=await q(s(e,"ids"));let n=await gt({status:s(e,"filterStatus"),list:yo(e),update:W(Ze(e)),dryRun:e.dryRun===!0?!0:void 0,rollback:s(e,"rollback"),checkpoint:e.checkpoint===!1?!1:void 0},o);await b(o,n),f(await I("update-many",[],e,o,n),o),o.profile&&v(`profile:command=update-many took_ms=${Date.now()-i}`)}async function ko(e,t,o,i){let n=y(i),r=Date.now(),a=typeof o.reason=="string"&&o.reason.trim().length>0&&o.reason||typeof o.closeReason=="string"&&o.closeReason.trim().length>0&&o.closeReason||void 0,l=typeof t=="string"&&t.length>0?t:a,u=await(o.releaseAssignment===!0?ft:Y)(e,l,{author:s(o,"author"),message:s(o,"message"),validateClose:o.validateClose===!0?"warn":s(o,"validateClose"),force:!!o.force,duplicateOf:s(o,"duplicateOf"),completedAt:s(o,"completedAt"),resolution:s(o,"resolution"),expectedResult:F(o.expectedResult,o.expected_result,o.expected),actualResult:F(o.actualResult,o.actual_result,o.actual)},n);await b(n,u),f(u,n),n.profile&&v(`profile:command=close took_ms=${Date.now()-r}`)}function _o(e){let t={...e},o=[["blocked_by","blockedBy"],["resume_context","resumeContext"],["from_search","fromSearch"],["step_title","stepTitle"],["step_body","stepBody"],["step_owner","stepOwner"],["step_status","stepStatus"],["step_evidence","stepEvidence"],["step_blocked_reason","stepBlockedReason"],["step_replacement","stepReplacement"],["depends_on","dependsOn"],["link_kind","linkKind"],["link_note","linkNote"],["promote_to_item_dep","promoteToItemDep"],["allow_multiple_active","allowMultipleActive"],["decision_text","decisionText"],["decision_rationale","decisionRationale"],["decision_evidence","decisionEvidence"],["discovery_text","discoveryText"],["validation_text","validationText"],["validation_command","validationCommand"],["validation_expected","validationExpected"],["materialize_type","materializeType"],["materialize_parent","materializeParent"],["materialize_tags","materializeTags"]];for(let[n,r]of o)t[n]!==void 0&&t[r]===void 0&&(t[r]=t[n]);let i=K(t,{requireType:!1});return i.blockedBy=t.blockedBy,i}function xo(e,t){if(!e)throw new m(`pm plan requires a subcommand. Allowed: ${t.join(", ")}`,p.USAGE,{code:"missing_required_argument",examples:['pm plan create --title "Refactor lock retry"',"pm plan show pm-a1b2 --depth standard",'pm plan add-step pm-a1b2 --step-title "Read lock.ts"']});if(t.includes(e))return;throw C({command_path:"plan",token:e,allowed:t,examples:e==="list"||e==="ls"?["pm list --type Plan","pm list-all --type Plan"]:void 0,retry_command:e==="list"||e==="ls"?"pm list --type Plan":void 0})}function Co(e,t){if(e!=="reorder-step"||typeof t!="string")return;let o=Number.parseInt(t,10);if(!Number.isFinite(o))throw new m(`reorder-step requires an integer new order, got "${t}"`,p.USAGE);return o}async function Do(e,t,o,i,n,r){let a=y(r),l=Date.now(),c=(e??"").trim().toLowerCase();xo(c,mt);let u=_o(n),g=Co(c,i),S=c==="create"&&typeof t=="string"&&t.length>0&&u.title===void 0?void 0:t;S===void 0&&typeof t=="string"&&t.length>0&&(u.title=t);let k=await yt({subcommand:c,id:S,stepRef:o,reorderTo:g,options:u,global:a});await b(a,k),f(k,a),a.profile&&v(`profile:command=plan took_ms=${Date.now()-l}`)}async function Io(e,t,o){if(e!==void 0)throw new m("merge reconcile takes no positional arguments.",p.USAGE);let i=await ie({dryRun:t.dryRun===!0,force:t.force===!0,message:typeof t.message=="string"?t.message:void 0,author:o.author},o);f(i,o),i.ok||(process.exitCode=p.GENERIC_FAILURE)}async function Ro(e,t,o,i,n,r){if(e===void 0||t===void 0||o===void 0||i===void 0)throw new m("merge driver requires <artifact> <base> <ours> <theirs> (git supplies %O %A %B). Example: pm merge driver history %O %A %B",p.USAGE);let a=await oe({artifact:e,basePath:t,oursPath:o,theirsPath:i,outputPath:typeof n.output=="string"?n.output:void 0,itemPath:typeof n.itemPath=="string"?n.itemPath:void 0,prefer:typeof n.prefer=="string"?n.prefer:void 0},r);f(a,r),a.ok||(process.exitCode=p.GENERIC_FAILURE)}async function To(e,t,o,i,n,r,a){let l=y(a),c=Date.now();switch(e.trim().toLowerCase()){case"install":{if(t!==void 0)throw new m("merge install takes no positional arguments.",p.USAGE);let g=await J({dryRun:r.dryRun===!0},l);f(g,l);break}case"reconcile":await Io(t,r,l);break;case"report":{if(t!==void 0)throw new m("merge report takes no positional arguments.",p.USAGE);let g=await X({includeReconciled:r.includeReconciled===!0});f(g,l),g.ok||(process.exitCode=p.GENERIC_FAILURE);break}case"driver":await Ro(t,o,i,n,r,l);break;default:throw C({command_path:"merge",token:e,allowed:L,display_name:"merge"})}l.profile&&v(`profile:command=merge took_ms=${Date.now()-c}`)}async function Eo(e,t,o){let i=y(o),n=Date.now(),r=await Z(e,{title:s(t,"title"),author:s(t,"author"),message:s(t,"message"),allowDuplicate:t.allowDuplicate===!0},i);await b(i,r),f(r,i),i.profile&&v(`profile:command=copy took_ms=${Date.now()-n}`)}async function Oo(e,t,o){let i=y(o),n=Date.now(),r=await ee(e,{clear:t.clear===!0},i);f(r,i),i.profile&&v(`profile:command=focus took_ms=${Date.now()-n}`)}async function Fo(e,t,o){let i=y(o),n=Date.now();$(t);let r=t.stdinJson===!0;if(r){let g=await x().resolveValue("-","--stdin-json");t=ae(g??"","update",t)}let a=Mt(t,r);r||await re(t);let l=typeof t.bodyFile=="string";l&&(t.body=await j(String(t.bodyFile),t.body!==void 0?String(t.body):void 0),delete t.bodyFile);let c=W(t);Ft(c,l,a),r&&G(c);let u=await ut(e,c,i);await b(i,u),f(await I("update",[e],t,i,u),i),i.profile&&v(`profile:command=update took_ms=${Date.now()-n}`)}async function Mo(e,t,o){let i=y(o),n=Date.now(),r=await Q(e,{author:s(t,"author"),message:s(t,"message"),force:!!t.force,dryRun:t.dryRun===!0},i);r.dry_run!==!0&&await b(i,r),f(r,i),i.profile&&v(`profile:command=delete took_ms=${Date.now()-n}`)}function Po(e,t){let o=s(t,"body"),i=s(t,"text"),n=typeof e=="string"?e:void 0;if([o,i,n].filter(l=>l!==void 0).length>1)throw new m("Specify append text with exactly one source: positional [text], --body, or --text",p.USAGE);let a=o??i??n;if(a===void 0)throw new m("Missing append text. Provide it as positional [text], --body <value>, or --text <value> (use - for stdin).",p.USAGE);return a}async function No(e,t,o,i){let n=y(i),r=Date.now(),a=await lt(e,{body:Po(t,o),author:s(o,"author"),message:s(o,"message"),force:!!o.force},n);await b(n,a),f(a,n),n.profile&&v(`profile:command=append took_ms=${Date.now()-r}`)}async function $o(e,t,o,i){let n=y(i),r=Date.now(),{PROFILE_SUBCOMMANDS:a}=T,l=(e??"").trim().toLowerCase();if(!l)throw new m(`pm profile requires a subcommand. Allowed: ${a.join(", ")}`,p.USAGE,{code:"missing_required_argument",examples:["pm profile list","pm profile show agile","pm profile apply agile --dry-run","pm profile lint agile"]});if(!a.includes(l))throw C({command_path:"profile",token:l,allowed:a});let c=await uo(T,l,t,o,n);n.json===!0||n.defaultOutputFormat==="json"?f(c,n):n.quiet||po(T,c),c.action==="lint"&&!c.ok&&(process.exitCode=p.GENERIC_FAILURE),n.profile&&v(`profile:command=profile took_ms=${Date.now()-r}`)}function A(e,t){return E(e[t])??[]}async function Ho(e,t,o){let i=y(o),n=Date.now(),r=A(t,"add"),a=A(t,"addGlob"),l=A(t,"remove"),c=A(t,"migrate"),u=await nt(e,{add:r,addGlob:a,remove:l,migrate:c,note:s(t,"note"),list:!!t.list,appendStable:!!t.appendStable,validatePaths:!!t.validatePaths,author:s(t,"author"),message:s(t,"message"),force:!!t.force},i);(r.length>0||a.length>0||l.length>0||c.length>0)&&await b(i,u),f(await I("files",[e],t,i,u),i),i.profile&&v(`profile:command=files took_ms=${Date.now()-n}`)}async function Lo(e,t,o){let i=y(o),n=Date.now(),r={...o.optsWithGlobals(),...t},a=await rt(e,{apply:!!r.apply,note:s(r,"note"),appendStable:!!r.appendStable,author:s(r,"author"),message:s(r,"message"),force:!!r.force},i);a.changed&&await b(i,a),f(a,i),i.profile&&v(`profile:command=files.discover took_ms=${Date.now()-n}`)}async function Bo(e,t,o){let i=y(o),n=Date.now(),r=A(t,"add"),a=A(t,"addGlob"),l=A(t,"remove"),c=A(t,"migrate"),u=await ot(e,{add:r,addGlob:a,remove:l,migrate:c,note:s(t,"note"),list:!!t.list,validatePaths:!!t.validatePaths,author:s(t,"author"),message:s(t,"message"),force:!!t.force},i);(r.length>0||a.length>0||l.length>0||c.length>0)&&await b(i,u),f(await I("docs",[e],t,i,u),i),i.profile&&v(`profile:command=docs took_ms=${Date.now()-n}`)}async function Uo(e,t,o){let i=y(o),n=Date.now(),r=await tt(e,{format:t.format,maxDepth:s(t,"maxDepth"),collapse:t.collapse,summary:t.summary===!0,full:t.full===!0,nodeLimit:s(t,"nodeLimit"),edgeLimit:s(t,"edgeLimit"),tokenBudget:s(t,"tokenBudget"),cursor:s(t,"cursor"),direction:s(t,"direction"),...Array.isArray(t.kind)?{kind:t.kind}:{}},i);f(r,i),i.profile&&v(`profile:command=deps took_ms=${Date.now()-n}`)}function Mn(e,t={}){let o=e.command("create").argument("[type-or-title]",'Item title, or item type when a title follows (e.g. `pm create task "Fix bug"`)').argument("[title]","Item title when the first argument is an item type").description("Create a new project management item.");if(ue(o,z),o.option("--stdin-json","Read a full item JSON document from stdin; explicit flags override document values").option("--body-file <path>","Load body from a file or stdin (-); conflicts with --body").option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--allow-duplicate","Explicitly create even when strict similarity governance finds likely duplicates").action(bo),t.targetCommandName==="create")return;e.command("copy").argument("<id>","Source item id").option("--title <value>","Optional title override for the copied item").option("--author <value>","Mutation author").option("--message <value>","History message").option("--allow-duplicate","Explicitly copy even when strict similarity governance finds likely duplicates").description("Copy an item into a new item id while resetting lifecycle fields.").action(Eo),e.command("focus").argument("[id]","Item id to focus (omit to show current focus)").option("--clear","Clear the focused item").description("Set/clear/show the session focused item that new items default --parent to.").action(Oo);let i=e.command("update").argument("<id>","Item id").description("Update item fields and metadata.");ue(i,Se),i.option("--stdin-json","Read a full item JSON document from stdin; explicit flags override document values").option("--body-file <path>","Load body from a file or stdin (-); conflicts with --body").option("--replace-deps","Atomically replace dependency entries with the provided --dep values").option("--replace-tests","Atomically replace linked test entries with the provided --test values").option("--replace-files","Atomically replace linked file entries with the provided --file values").option("--replace-docs","Atomically replace linked doc entries with the provided --doc values").option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--force","Force ownership override"),i.action(Fo),kt(e);let n=e.command("update-many").description("Bulk-update matched items with dry-run plans and rollback checkpoints.").option("--filter-status <value>","Filter by status before applying updates").option("--filter-type <value>","Filter by item type before applying updates").option("--filter-tag <value>","Filter by tag before applying updates").option("--filter-priority <value>","Filter by priority before applying updates").option("--filter-deadline-before <value>","Filter by deadline upper bound before applying updates").option("--filter-deadline-after <value>","Filter by deadline lower bound before applying updates").option("--filter-updated-after <value>","Filter by updated_at lower bound before applying updates (ISO/relative)").option("--filter-updated-before <value>","Filter by updated_at upper bound before applying updates (ISO/relative)").option("--filter-created-after <value>","Filter by created_at lower bound before applying updates (ISO/relative)").option("--filter-created-before <value>","Filter by created_at upper bound before applying updates (ISO/relative)").option("--filter-assignee <value>","Filter by assignee before applying updates").option("--filter-assignee-filter <value>","Filter assignee presence: assigned|unassigned before applying updates").option("--filter-parent <value>","Filter by parent item ID before applying updates").option("--filter-sprint <value>","Filter by sprint before applying updates").option("--filter-release <value>","Filter by release before applying updates").option("--filter-ac-missing","Select only items missing acceptance_criteria (bulk backfill)").option("--filter-estimates-missing","Select only items missing estimated_minutes (bulk backfill)").option("--filter-resolution-missing","Select only terminal items missing resolution (bulk backfill)").option("--filter-metadata-missing","Select only items missing any tracked metadata (AC, estimate, or resolution)");Et(n,"applying updates"),n.option("--ids <value>","Explicit ID allowlist: comma/newline text, - stdin, or @path file").option("--limit <n>","Limit matched item count before apply/preview").option("--offset <n>","Skip first n matched rows before apply/preview").option("--dry-run","Preview per-item diffs and checkpoint intent without mutating").option("--rollback <value>","Rollback a prior update-many checkpoint ID").option("--no-checkpoint","Disable checkpoint creation during apply mode").option("--title, -t <value>","Set title").option("--description, -d <value>","Set description").option("--body, -b <value>","Set body (allow empty string)").option("--status, -s <value>","Set status (use close command for closed)").option("--priority, -p <value>","Set priority").option("--type <value>","Set type").option("--tags <value>","Set comma-separated tags (replaces existing). Use --add-tags / --remove-tags to mutate additively.").option("--add-tags <value>","Add tags additively without replacing existing (repeatable; CSV accepted)",d).option("--remove-tags <value>","Remove tags from the existing list (repeatable; CSV accepted)",d).option("--deadline <value>","Set deadline (ISO/date string or relative)").option("--estimate, --estimated-minutes <value>","Set estimated minutes").option("--acceptance-criteria <value>","Set acceptance criteria").option("--ac <value>","Alias for --acceptance-criteria").option("--add-ac <value>","Add one semicolon-free acceptance criterion without replacing the existing list (repeatable)",d).option("--remove-ac <value>","Remove one semicolon-free acceptance criterion by exact text match (repeatable)",d).option("--definition-of-ready <value>","Set definition of ready").option("--order <value>","Set planning order/rank integer").option("--rank <value>","Alias for --order").option("--goal <value>","Set goal identifier").option("--objective <value>","Set objective identifier").option("--value <value>","Set business value summary").option("--impact <value>","Set business impact summary").option("--outcome <value>","Set expected outcome summary").option("--why-now <value>","Set why-now rationale").option("--assignee <value>","Set assignee").option("--parent <value>","Set parent item ID").option("--reviewer <value>","Set reviewer").option("--risk <value>","Set risk level").option("--confidence <value>","Set confidence level").option("--sprint <value>","Set sprint identifier").option("--release <value>","Set release identifier").option("--blocked-by <value>","Set blocked-by item ID or reason").option("--blocked-reason <value>","Set blocked reason").option("--unblock-note <value>","Set unblock rationale note").option("--reporter <value>","Set issue reporter").option("--severity <value>","Set issue severity").option("--environment <value>","Set issue environment context").option("--repro-steps <value>","Set issue reproduction steps").option("--resolution <value>","Set issue resolution summary").option("--expected-result <value>","Set issue expected behavior").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Set issue observed behavior").option("--actual <value>","Short alias for --actual-result").option("--affected-version <value>","Set affected version identifier").option("--fixed-version <value>","Set fixed version identifier").option("--component <value>","Set issue component ownership").option("--regression [value]","Set regression marker; bare flag means true, or pass true|false|1|0").option("--customer-impact <value>","Set customer impact summary").option("--dep <value>","Add dependency entry id=<id>,kind=<kind>,author=<author>,created_at=<timestamp>",d).option("--dep-remove <value>","Remove dependency entries by id/kind/author/timestamp signature",d).option("--replace-deps","Atomically replace dependency entries with provided --dep values").option("--replace-tests","Atomically replace linked tests with provided --test values").option("--replace-files","Atomically replace linked files with provided --file values").option("--replace-docs","Atomically replace linked docs with provided --doc values").option("--comment <value>","Add comment seed author=<value>,created_at=<iso|now>,text=<value>",d).option("--note <value>","Add note seed author=<value>,created_at=<iso|now>,text=<value>",d).option("--learning <value>","Add learning seed author=<value>,created_at=<iso|now>,text=<value>",d).option("--file <value>","Add linked file path=<value>,scope=<project|global>,note=<text>",d).option("--test <value>","Add linked test command=<value>,path=<value>,scope=<project|global>",d).option("--doc <value>","Add linked doc path=<value>,scope=<project|global>,note=<text>",d).option("--reminder <value>","Add reminder entry at=<iso|relative>|date=<iso|relative>,text=<text>|title=<text>",d).option("--event <value>","Add event entry start=<iso|relative>,end=<iso|relative>,recur_*",d).option("--type-option <value>","Set type options key=value (repeatable)",d).option("--unset <field>","Clear scalar metadata field by name (repeatable)",d).option("--clear-deps","Clear dependency entries").option("--clear-comments","Clear comments").option("--clear-notes","Clear notes").option("--clear-learnings","Clear learnings").option("--clear-files","Clear linked files").option("--clear-tests","Clear linked tests").option("--clear-docs","Clear linked docs").option("--clear-reminders","Clear reminders").option("--clear-events","Clear events").option("--clear-type-options","Clear type options").option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override"),R(n,[["--filter-assignee_filter <value>","Alias for --filter-assignee-filter"],["--estimated_minutes <value>","Alias for --estimated-minutes"],["--acceptance_criteria <value>","Alias for --acceptance-criteria"],["--definition_of_ready <value>","Alias for --definition-of-ready"],["--why_now <value>","Alias for --why-now"],["--blocked_by <value>","Alias for --blocked-by"],["--blocked_reason <value>","Alias for --blocked-reason"],["--unblock_note <value>","Alias for --unblock-note"],["--repro_steps <value>","Alias for --repro-steps"],["--expected_result <value>","Alias for --expected-result"],["--actual_result <value>","Alias for --actual-result"],["--affected_version <value>","Alias for --affected-version"],["--fixed_version <value>","Alias for --fixed-version"],["--customer_impact <value>","Alias for --customer-impact"],["--filter-estimate-missing","Alias for --filter-estimates-missing"]],!1),R(n,[["--dep_remove <value>","Alias for --dep-remove"],["--type_option <value>","Alias for --type-option"],["--add_tags <value>","Alias for --add-tags"],["--remove_tags <value>","Alias for --remove-tags"],["--add_ac <value>","Alias for --add-ac"],["--remove_ac <value>","Alias for --remove-ac"]],!0),n.action(Ao);let r=e.command("close").option("--release-assignment","Release ownership after closure").argument("<id>","Item id").argument("[text]","Close reason text (alias: --reason)").option("-r, --reason <value>","Close reason text (alias for positional <text>)").option("--close-reason <value>","Close reason text (alias for positional <text>)").option("--completed-at <value>","Actual completion timestamp (ISO or relative), distinct from tracker close time").option("-d, --duplicate-of <id>","Close as a duplicate of the canonical item id and auto-fill duplicate closure metadata").option("--author <value>","Mutation author").option("-m, --message <value>","History message").option("--validate-close [mode]",'Validate closure metadata before close: "off", "warn", or "strict" (default: settings governance preset)').option("--resolution <value>","Closure resolution summary (checked by --validate-close strict)").option("--expected-result <value>","Expected outcome for closure validation").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Observed outcome for closure validation").option("--actual <value>","Short alias for --actual-result").option("--force","Force ownership override").description("Close an item. Close reason requirement follows governance.require_close_reason.");w(r,"--expected_result <value>","Alias for --expected-result",!1),w(r,"--actual_result <value>","Alias for --actual-result",!1),r.action(ko);let a=e.command("close-many").description("Bulk-close matched items with a shared reason and full runClose semantics (dry-run + rollback checkpoint).").option("--filter-status <value>","Filter by status before closing").option("--filter-type <value>","Filter by item type before closing").option("--filter-tag <value>","Filter by tag before closing").option("--filter-priority <value>","Filter by priority before closing").option("--filter-deadline-before <value>","Filter by deadline upper bound before closing").option("--filter-deadline-after <value>","Filter by deadline lower bound before closing").option("--filter-updated-after <value>","Filter by updated_at lower bound before closing (ISO/relative)").option("--filter-updated-before <value>","Filter by updated_at upper bound before closing (ISO/relative)").option("--filter-created-after <value>","Filter by created_at lower bound before closing (ISO/relative)").option("--filter-created-before <value>","Filter by created_at upper bound before closing (ISO/relative)").option("--filter-assignee <value>","Filter by assignee before closing").option("--filter-assignee-filter <value>","Filter assignee presence: assigned|unassigned before closing").option("--filter-parent <value>","Filter by parent item ID before closing").option("--filter-sprint <value>","Filter by sprint before closing").option("--filter-release <value>","Filter by release before closing");Et(a,"closing"),a.option("--ids <value>","Explicit ID allowlist: comma/newline text, - stdin, or @path file").option("--limit <n>","Limit matched item count before apply/preview").option("--offset <n>","Skip first n matched rows before apply/preview").option("--reason <value>","Shared close reason applied to matched items (required when governance.require_close_reason is enabled)").option("--completed-at <value>","Actual completion timestamp (ISO or relative) applied to every matched item").option("--resolution <value>","Shared closure resolution applied to every matched item (closure-validation field)").option("--expected-result <value>","Shared expected-result note (closure-validation field)").option("--expected <value>","Short alias for --expected-result").option("--actual-result <value>","Shared actual-result note (closure-validation field)").option("--actual <value>","Short alias for --actual-result").option("--validate-close [mode]",'Validate closure metadata per item: "off", "warn", or "strict" (default: settings governance preset)').option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Re-close already-terminal matches and override ownership").option("--dry-run","Preview matched items + per-item skip/active-child plan without mutating").option("--rollback <value>","Rollback a prior close-many checkpoint ID").option("--no-checkpoint","Disable checkpoint creation during apply mode"),w(a,"--filter-assignee_filter <value>","Alias for --filter-assignee-filter",!1),w(a,"--expected_result <value>","Alias for --expected-result",!1),w(a,"--actual_result <value>","Alias for --actual-result",!1),a.action(So),e.command("delete").argument("<id>","Item id").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").option("--dry-run","Preview the item file that would be deleted without mutating").description("Delete an item and record the change in history.").action(Mo),e.command("append").argument("<id>","Item id").argument("[text]","Body text; same as --body (- reads stdin)").option("--body <value>","Text to append to body (or - for stdin)").option("--text <value>","Alias for --body").option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override").description("Append text to an item's body. For concurrent writes, use pm notes.").action(No);let l=e.command("plan").description("Agent-optimized Plan item workflow: create, manage steps, link dependencies, approve, and materialize.").argument("[subcommand]","Required; Plan subcommand: create|show|add-step|update-step|complete-step|block-step|reorder-step|remove-step|link|unlink|decision|discovery|validation|resume|approve|materialize").argument("[id]","Plan id (required for non-create subcommands); for create this may be the positional title").argument("[step]","Step reference: stable id (plan-step-001) or order integer").argument("[new-order]","New order integer for reorder-step").option("--title <value>","Plan title").option("--description <value>","Plan description").option("--scope <value>","Short scope statement of the target change or investigation").option("--parent <value>","Parent pm item id").option("--related <value>","Related pm item ids (repeatable, csv-friendly)",d).option("--blocks <value>","Pm item ids this plan blocks (repeatable, csv-friendly)",d).option("--blocked-by <value>","Pm item ids that block this plan (repeatable, csv-friendly)",d).option("--harness <value>","Plan harness provenance: codex|claude-code|cursor|generic").option("--mode <value>","Plan mode: draft|research|review|approved|executing|paused|completed|superseded").option("--resume-context <value>","Compact context summary for a future stateless agent").option("--tags <value>","Comma-separated tags").option("--priority <value>","Priority 0-4").option("--body <value>","Plan item body").option("--claim","Claim the plan on create for the author").option("--from-search <value>","Record the search query that led to plan creation").option("--template <value>","Seed plan steps from a built-in template: bug-investigation|feature-implementation|refactoring-sprint").option("--step-title <value>","Step title for add-step / update-step").option("--step <value>","Step title (repeatable on create: each --step appends an ordered step; elsewhere a single value aliases --step-title)",d).option("--step-body <value>","Step body text").option("--step-owner <value>","Step owner").option("--step-status <value>","Step status: pending|in_progress|completed|blocked|skipped|superseded").option("--step-evidence <value>","Step evidence text (used by update-step/complete-step)").option("--step-blocked-reason <value>","Step blocked reason (required when blocking)").option("--step-replacement <value>","Replacement reference for a superseded step").option("--depends-on <value>","Pm item ids the step depends on (repeatable, csv-friendly)",d).option("--link <value>","Pm item id to link (repeatable, csv-friendly)",d).option("--link-kind <value>",`Link kind: ${ve.join("|")}`).option("--link-note <value>","Optional note for the link").option("--promote-to-item-dep","Also add the linked id as a top-level item dependency when linking").option("--allow-multiple-active","Allow multiple steps to be in_progress at once").option("--file <value>","Step linked file path=<value>[,scope=project|global,note=<text>] (repeatable)",d).option("--test <value>","Step linked test command=<value>[,path=<value>,note=<text>] (repeatable)",d).option("--doc <value>","Step linked doc path=<value>[,scope=project|global,note=<text>] (repeatable)",d).option("--decision-text <value>","Decision log entry text").option("--decision <value>","Alias for --decision-text").option("--decision-rationale <value>","Decision log entry rationale").option("--decision-evidence <value>","Decision log entry evidence").option("--discovery-text <value>","Discovery log entry text").option("--discovery <value>","Alias for --discovery-text").option("--validation-text <value>","Validation log entry text").option("--validation <value>","Alias for --validation-text").option("--validation-command <value>","Validation log entry command").option("--validation-expected <value>","Validation log entry expected outcome").option("--depth <value>","Show depth: brief|standard|deep (default: brief)").option("--fields <value>","Comma-separated field projection for show output").option("--steps <value>","Comma-separated step ids/orders for materialize").option("--materialize-type <value>","Item type for materialized steps (default: Task)").option("--materialize-parent <value>","Parent item id for materialized children (default: the plan)").option("--materialize-tags <value>","Comma-separated tags for materialized children").option("--field <name=value>","Custom field value forwarded to every materialized child (repeatable)",d).option("--author <value>","Mutation author").option("--message <value>","Mutation message").option("--force","Force ownership override");ue(l,z.filter(g=>co.has(g.target))),R(l,[["--resume_context <value>","Alias for --resume-context"],["--from_search <value>","Alias for --from-search"],["--step_title <value>","Alias for --step-title"],["--step_body <value>","Alias for --step-body"],["--step_owner <value>","Alias for --step-owner"],["--step_status <value>","Alias for --step-status"],["--step_evidence <value>","Alias for --step-evidence"],["--step_blocked_reason <value>","Alias for --step-blocked-reason"],["--step_replacement <value>","Alias for --step-replacement"],["--link_kind <value>","Alias for --link-kind"],["--link_note <value>","Alias for --link-note"],["--promote_to_item_dep","Alias for --promote-to-item-dep"],["--allow_multiple_active","Alias for --allow-multiple-active"],["--decision_text <value>","Alias for --decision-text"],["--decision_rationale <value>","Alias for --decision-rationale"],["--decision_evidence <value>","Alias for --decision-evidence"],["--discovery_text <value>","Alias for --discovery-text"],["--validation_text <value>","Alias for --validation-text"],["--validation_command <value>","Alias for --validation-command"],["--validation_expected <value>","Alias for --validation-expected"],["--materialize_type <value>","Alias for --materialize-type"],["--materialize_parent <value>","Alias for --materialize-parent"],["--materialize_tags <value>","Alias for --materialize-tags"]],!1),R(l,[["--blocked_by <value>","Alias for --blocked-by"],["--depends_on <value>","Alias for --depends-on"]],!0),l.action(Do),ht(e,!1),_t(e),e.command("merge").argument("<subcommand>",`Merge subcommand: ${L.join(", ")}`).argument("[artifact]",`driver only: artifact class to merge (${te.join(", ")})`).argument("[base]","driver only: common-ancestor file path (git %O)").argument("[ours]","driver only: current-branch file path (git %A)").argument("[theirs]","driver only: other-branch file path (git %B)").option("--dry-run","install/reconcile: preview changes without writing").option("--message <text>","reconcile only: audit message recorded on repaired history streams").option("--force","reconcile only: permit the underlying audited history ownership override").option("--include-reconciled","report only: include clone-local receipts already recorded in history").option("--output <path>","driver only: write the merged content to this path instead of the ours path").option("--item-path <path>","driver only: original repository-relative path supplied by git as %P").option("--prefer <side>","driver only: side that wins unresolvable conflicts (ours|theirs; default ours)").description("Install merge drivers, reconcile or report post-merge history, or run a field-aware driver.").action(To),Tt(e),e.command("profile").argument("[subcommand]","Required; Profile subcommand: list, show, apply, or lint").argument("[name]","Profile name for show/apply/lint: agile, ops, or research").option("--dry-run","Preview the apply diff without writing any files (apply)").option("--author <value>","Mutation author").option("--force","Force ownership/lock override").description("List, show, apply, and lint project profiles \u2014 archetype bundles of item types, statuses, fields, workflows, config, templates, and recommended packages.").action($o),Dt(e,fo);let u=e.command("files").description("Manage files linked to an item.");u.argument("<id>","Item id").option("--add <value>","Add linked file entry (CSV/markdown pairs or - for stdin)",d).option("--add-glob <value>","Add linked file entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)",d).option("--remove <value>","Remove linked file by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message",d).option("--migrate <value>","Migrate linked file paths in-place (from=<prefix>,to=<prefix>; repeatable)",d).option("--note <value>","Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--list","List linked files without mutating").option("--append-stable","Preserve existing linked-file order and append new links without full-array resorting").option("--validate-paths","Validate linked file paths for existence and file shape").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").action(Ho),u.command("discover").argument("<id>","Item id").option("--apply","Add discovered missing files to the item").option("--note <value>","Note to attach to discovered file links").option("--append-stable","Preserve existing linked-file order and append discovered links without full-array resorting").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Discover existing file paths referenced in item text and optionally link missing files.").action(Lo),It(u),e.command("docs").argument("<id>","Item id").option("--add <value>","Add linked doc entry (CSV/markdown pairs or - for stdin)",d).option("--add-glob <value>","Add linked doc entries from a glob (plain glob or pattern=<glob>,scope=<scope>,note=<text>; repeatable)",d).option("--remove <value>","Remove linked doc by path only (path=<value>, path:<value>, plain path, or - for stdin); does not accept note=/scope= \u2014 record removal context with --message",d).option("--migrate <value>","Migrate linked doc paths in-place (from=<prefix>,to=<prefix>; repeatable)",d).option("--note <value>","Note attached to every link added by --add/--add-glob in this invocation (embedded note= wins)").option("--list","List linked docs without mutating").option("--validate-paths","Validate linked doc paths for existence and file shape").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership override").description("Manage docs linked to an item.").action(Bo),e.command("deps").argument("<id>","Item id").option("--format <value>","Output format (tree, graph, or context)","tree").option("--max-depth <value>","Maximum dependency traversal depth (0 keeps only the root)").option("--collapse <value>","Collapse mode (none or repeated)","none").option("--summary","Return counts only without full tree/graph payload").option("--full","Return the complete dependency row projection").option("--node-limit <value>","Maximum nodes in context output").option("--edge-limit <value>","Maximum edges and missing-reference rows in context output").option("--token-budget <value>","Maximum estimated tokens in context output").option("--cursor <value>","Continue an equivalent context query").option("--direction <value>","Context traversal direction (outgoing, incoming, or both)").option("--kind <value>","Restrict context traversal to registered relationship kinds (repeatable or comma-separated)",d).description("Show dependency relationships for an item.").action(Uo)}export{ce as looksLikeSchemaSubcommandTypo,fo as parsePositiveIntOption,N as parseSchemaOrderOption,ue as registerCommanderOptionContracts,Mn as registerMutationCommands};
20
+ //# sourceMappingURL=register-mutation-C3O7OSXW.js.map