@unbrained/pm-cli 2026.11.2 → 2026.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +24 -0
  3. package/dist/cli/error-guidance.d.ts +23 -35
  4. package/dist/cli/error-guidance.js +4 -3
  5. package/dist/cli/expected-revisions.d.ts +55 -0
  6. package/dist/cli/expected-revisions.js +2 -0
  7. package/dist/cli/main.js +2 -2
  8. package/dist/cli/runtime/field-route-retry.d.ts +15 -0
  9. package/dist/cli/runtime/field-route-retry.js +2 -0
  10. package/dist/cli/runtime/invocation-options.js +1 -1
  11. package/dist/cli-bundle/bundle-manifest.json +1 -1
  12. package/dist/cli-bundle/chunks/{chunk-3A4NVHYS.js → chunk-2GW662DP.js} +2 -2
  13. package/dist/cli-bundle/chunks/chunk-3OXQGGRD.js +115 -0
  14. package/dist/cli-bundle/chunks/chunk-5BVZ32G7.js +2 -0
  15. package/dist/cli-bundle/chunks/chunk-5S6RT5LX.js +9 -0
  16. package/dist/cli-bundle/chunks/chunk-5Z6LWFDL.js +31 -0
  17. package/dist/cli-bundle/chunks/{chunk-RGHLQGEX.js → chunk-6T2V3UIK.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-JRXD7SIL.js → chunk-7PGNAHNW.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-7RCI7AAA.js +20 -0
  20. package/dist/cli-bundle/chunks/chunk-AQ5UHHQS.js +2 -0
  21. package/dist/cli-bundle/chunks/chunk-BK2XAQVC.js +2 -0
  22. package/dist/cli-bundle/chunks/{chunk-ABFFRQRO.js → chunk-BRIPGUAO.js} +2 -2
  23. package/dist/cli-bundle/chunks/chunk-BWAXA6S4.js +6 -0
  24. package/dist/cli-bundle/chunks/{chunk-HOGKWJU5.js → chunk-CERNIZLB.js} +66 -66
  25. package/dist/cli-bundle/chunks/chunk-DSCFJTHB.js +122 -0
  26. package/dist/cli-bundle/chunks/{chunk-VEOFWE32.js → chunk-L4BKTPJ6.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-NGRPD3ZO.js → chunk-NPEDFOVQ.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-J3JM36EH.js → chunk-O4ZLEN4T.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-533L6D2N.js → chunk-ODMJ3HIB.js} +3 -3
  30. package/dist/cli-bundle/chunks/{chunk-KJLGBLR3.js → chunk-QN7VCOUU.js} +2 -2
  31. package/dist/cli-bundle/chunks/chunk-QQHMNUZT.js +2 -0
  32. package/dist/cli-bundle/chunks/{chunk-D52QQ7LP.js → chunk-RSAN2YUU.js} +2 -2
  33. package/dist/cli-bundle/chunks/chunk-SRDO2NJU.js +2 -0
  34. package/dist/cli-bundle/chunks/chunk-T56MB6SF.js +2 -0
  35. package/dist/cli-bundle/chunks/chunk-TX2W6G37.js +3 -0
  36. package/dist/cli-bundle/chunks/{chunk-GK2CHAT3.js → chunk-UJMQP2HP.js} +2 -2
  37. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-IEJ2QOW3.js → indexed-receipt-blobs-I6RQGD6Y.js} +2 -2
  38. package/dist/cli-bundle/chunks/item-revision-UAZOBP2Q.js +2 -0
  39. package/dist/cli-bundle/chunks/item-transaction-N5F4LXYV.js +2 -0
  40. package/dist/cli-bundle/chunks/mutation-admission-QZQI2NN5.js +2 -0
  41. package/dist/cli-bundle/chunks/{register-list-query-NZTK3AXA.js → register-list-query-P3NOKQUA.js} +2 -2
  42. package/dist/cli-bundle/chunks/{register-mutation-2OFAMOVH.js → register-mutation-A6I5K5N6.js} +2 -2
  43. package/dist/cli-bundle/chunks/register-operations-SPKB3TNM.js +2 -0
  44. package/dist/cli-bundle/chunks/register-setup-ZZRHJ4IS.js +2 -0
  45. package/dist/cli-bundle/chunks/{settlement-hook-UTCEZBFT.js → settlement-hook-JHXLUBEN.js} +2 -2
  46. package/dist/cli-bundle/chunks/{stage-VLI4OBVX.js → stage-L3T725DS.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/chunk-5NGNO54M.js +44 -0
  48. package/dist/cli-bundle/focused-chunks/{chunk-PCCZ72C3.js → chunk-A2246ZM7.js} +54 -54
  49. package/dist/cli-bundle/focused-chunks/chunk-B6U44WPW.js +2 -0
  50. package/dist/cli-bundle/focused-chunks/chunk-BAW3DGQO.js +91 -0
  51. package/dist/cli-bundle/focused-chunks/chunk-BHNY3KPJ.js +2 -0
  52. package/dist/cli-bundle/focused-chunks/chunk-C3O6JJPO.js +2 -0
  53. package/dist/cli-bundle/focused-chunks/{chunk-745IDMTD.js → chunk-C7UX2ZI3.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/chunk-CBG67HUP.js +23 -0
  55. package/dist/cli-bundle/focused-chunks/{chunk-NJFMG3IK.js → chunk-CO2DNPH7.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/chunk-CXTDEQ3N.js +8 -0
  57. package/dist/cli-bundle/focused-chunks/chunk-FEPE2CE4.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-FFO7RBLN.js +2 -0
  59. package/dist/cli-bundle/focused-chunks/{chunk-QNXXOFLQ.js → chunk-FXFDVM5O.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-QVFE5LIX.js → chunk-G6ERMFJ5.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/chunk-I5LGPUWH.js +2 -0
  62. package/dist/cli-bundle/focused-chunks/{chunk-MQVBWFJF.js → chunk-IDAYTYNN.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/chunk-J3YOATXR.js +80 -0
  64. package/dist/cli-bundle/focused-chunks/{chunk-3UD6F2KQ.js → chunk-J6FDCAMH.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/chunk-J7M52SCZ.js +2 -0
  66. package/dist/cli-bundle/focused-chunks/chunk-JQS7TYQ6.js +12 -0
  67. package/dist/cli-bundle/focused-chunks/chunk-MEJKELWC.js +26 -0
  68. package/dist/cli-bundle/focused-chunks/chunk-PMKR4MJI.js +2 -0
  69. package/dist/cli-bundle/focused-chunks/chunk-PNPYQDHU.js +2 -0
  70. package/dist/cli-bundle/focused-chunks/chunk-Q4OIRSKL.js +2 -0
  71. package/dist/cli-bundle/focused-chunks/{chunk-I4Z2SCV5.js → chunk-QEVJ3Y67.js} +2 -2
  72. package/dist/cli-bundle/focused-chunks/{chunk-Q23K6WLV.js → chunk-SDLIUZEL.js} +2 -2
  73. package/dist/cli-bundle/focused-chunks/chunk-TFYTTDAK.js +2 -0
  74. package/dist/cli-bundle/focused-chunks/chunk-W3CSX6GI.js +3 -0
  75. package/dist/cli-bundle/focused-chunks/{chunk-B6OOKKOX.js → chunk-Y5GOUUYJ.js} +3 -3
  76. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-FT3KF6VJ.js → indexed-receipt-blobs-7XGVHYAO.js} +2 -2
  77. package/dist/cli-bundle/focused-chunks/item-revision-L6GVT42D.js +2 -0
  78. package/dist/cli-bundle/focused-chunks/item-transaction-GYGP264N.js +2 -0
  79. package/dist/cli-bundle/focused-chunks/mutation-admission-UWTH56OD.js +2 -0
  80. package/dist/cli-bundle/focused-chunks/{settlement-hook-KMIBD4F2.js → settlement-hook-H56537UV.js} +2 -2
  81. package/dist/cli-bundle/focused-chunks/{stage-6B3O2GZ6.js → stage-WRSNJ7VI.js} +2 -2
  82. package/dist/cli-bundle/main.js +30 -29
  83. package/dist/cli-bundle/sdk-authoring.js +1 -1
  84. package/dist/cli-bundle/sdk-contracts.js +5 -5
  85. package/dist/cli-bundle/sdk-core.js +1 -1
  86. package/dist/cli-bundle/sdk-governance.js +1 -1
  87. package/dist/cli-bundle/sdk-graph.js +1 -1
  88. package/dist/cli-bundle/sdk-merge.js +57 -57
  89. package/dist/cli-bundle/sdk-query.js +1 -1
  90. package/dist/cli-bundle/sdk-runtime.js +1 -1
  91. package/dist/cli-bundle/sdk-testing.js +1 -1
  92. package/dist/cli-bundle/sdk.js +11 -11
  93. package/dist/core/config/positional-value.d.ts +1 -1
  94. package/dist/core/config/positional-value.js +1 -1
  95. package/dist/core/extensions/extension-hook-runtime.js +1 -1
  96. package/dist/core/extensions/item-fields.d.ts +1 -1
  97. package/dist/core/extensions/item-fields.js +1 -1
  98. package/dist/core/extensions/reserved-host-flags.js +1 -1
  99. package/dist/core/history/history-rewrite.js +1 -1
  100. package/dist/core/schema/runtime-field-values.d.ts +30 -0
  101. package/dist/core/schema/runtime-field-values.js +1 -1
  102. package/dist/core/sentry/helpers.js +1 -1
  103. package/dist/core/sentry/instrument.js +1 -1
  104. package/dist/core/shared/command-types.d.ts +7 -0
  105. package/dist/core/shared/error-details.d.ts +98 -0
  106. package/dist/core/shared/error-details.js +2 -0
  107. package/dist/core/shared/errors.d.ts +37 -0
  108. package/dist/core/shared/errors.js +1 -1
  109. package/dist/core/store/item-mutation-precondition.d.ts +70 -6
  110. package/dist/core/store/item-mutation-precondition.js +1 -1
  111. package/dist/core/store/item-store.js +1 -1
  112. package/dist/core/store/settings-validator.js +1 -1
  113. package/dist/core/store/settings.js +1 -1
  114. package/dist/mcp/server.js +2 -2
  115. package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -1
  116. package/dist/sdk/cli-contracts/completeness.js +1 -1
  117. package/dist/sdk/cli-contracts/enum-contracts.d.ts +11 -0
  118. package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
  119. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  120. package/dist/sdk/cli-contracts/registration-helpers.js +1 -1
  121. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  122. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  123. package/dist/sdk/cli-program.js +1 -1
  124. package/dist/sdk/config.d.ts +1 -1
  125. package/dist/sdk/config.js +1 -1
  126. package/dist/sdk/environment/project-runtime-compatibility.js +1 -1
  127. package/dist/sdk/errors.d.ts +6 -2
  128. package/dist/sdk/errors.js +1 -1
  129. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  130. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  131. package/dist/sdk/governance/validate.js +1 -1
  132. package/dist/sdk/history/salvage.js +3 -3
  133. package/dist/sdk/history-compact.d.ts +7 -1
  134. package/dist/sdk/history-compact.js +1 -1
  135. package/dist/sdk/history-repair.d.ts +2 -1
  136. package/dist/sdk/history-repair.js +1 -1
  137. package/dist/sdk/index.d.ts +4 -1
  138. package/dist/sdk/index.js +1 -1
  139. package/dist/sdk/lifecycle/checkpoint-rollback.d.ts +10 -2
  140. package/dist/sdk/lifecycle/checkpoint-rollback.js +1 -1
  141. package/dist/sdk/lifecycle/claim.js +1 -1
  142. package/dist/sdk/lifecycle/close-many.d.ts +11 -2
  143. package/dist/sdk/lifecycle/close-many.js +1 -1
  144. package/dist/sdk/lifecycle/close.d.ts +15 -0
  145. package/dist/sdk/lifecycle/close.js +1 -1
  146. package/dist/sdk/lifecycle/core-field-recovery.d.ts +26 -0
  147. package/dist/sdk/lifecycle/core-field-recovery.js +1 -1
  148. package/dist/sdk/lifecycle/create.js +1 -1
  149. package/dist/sdk/lifecycle/item-revision.d.ts +162 -0
  150. package/dist/sdk/lifecycle/item-revision.js +2 -0
  151. package/dist/sdk/lifecycle/restore.js +1 -1
  152. package/dist/sdk/lifecycle/start-blockers.d.ts +52 -0
  153. package/dist/sdk/lifecycle/start-blockers.js +2 -0
  154. package/dist/sdk/lifecycle/task-composition.d.ts +11 -0
  155. package/dist/sdk/lifecycle/task-composition.js +1 -1
  156. package/dist/sdk/lifecycle/update-many.d.ts +11 -2
  157. package/dist/sdk/lifecycle/update-many.js +1 -1
  158. package/dist/sdk/lifecycle/update.js +2 -2
  159. package/dist/sdk/public-surface.json +1 -1
  160. package/dist/sdk/query/declared-blockers.d.ts +16 -0
  161. package/dist/sdk/query/declared-blockers.js +2 -0
  162. package/dist/sdk/query/get.d.ts +7 -0
  163. package/dist/sdk/query/get.js +1 -1
  164. package/dist/sdk/query/projection-contracts.js +1 -1
  165. package/dist/sdk/runtime-input.d.ts +12 -0
  166. package/dist/sdk/runtime-input.js +1 -1
  167. package/dist/sdk/runtime.d.ts +11 -1
  168. package/dist/sdk/runtime.js +1 -1
  169. package/dist/sdk/structured-mutations.js +1 -1
  170. package/dist/sdk/test/batch.js +2 -2
  171. package/dist/sdk/test/entry.d.ts +5 -0
  172. package/dist/sdk/test/entry.js +2 -2
  173. package/dist/sdk/test/execution.d.ts +1 -2
  174. package/dist/sdk/test/execution.js +2 -2
  175. package/dist/sdk/test/linked-command-detection.d.ts +10 -0
  176. package/dist/sdk/test/linked-command-detection.js +1 -1
  177. package/dist/sdk/test/update.d.ts +2 -0
  178. package/dist/sdk/test/update.js +1 -1
  179. package/dist/sdk/workspace-transaction.d.ts +17 -6
  180. package/dist/sdk/workspace-transaction.js +1 -1
  181. package/dist/types.d.ts +6 -0
  182. package/dist/types.js +1 -1
  183. package/docs/COMMANDS.md +91 -0
  184. package/docs/CONFIGURATION.md +1 -0
  185. package/docs/EXTENSIONS.md +2 -2
  186. package/docs/LINKED_TEST_EDITS.md +38 -5
  187. package/docs/SDK.md +185 -1
  188. package/docs/agent-task-token-baseline.json +1 -1
  189. package/docs/generated/FLAG_LEXICON_BUDGETS.md +111 -111
  190. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +15 -3
  191. package/marketplace.json +1 -1
  192. package/package.json +1 -1
  193. package/packages/pm-beads/package.json +1 -1
  194. package/packages/pm-calendar/package.json +1 -1
  195. package/packages/pm-command-kit/package.json +1 -1
  196. package/packages/pm-digital-twin/package.json +1 -1
  197. package/packages/pm-governance-audit/package.json +1 -1
  198. package/packages/pm-guide-shell/package.json +1 -1
  199. package/packages/pm-kanban/package.json +1 -1
  200. package/packages/pm-lifecycle-hooks/package.json +1 -1
  201. package/packages/pm-linked-test-adapters/package.json +1 -1
  202. package/packages/pm-search-advanced/package.json +1 -1
  203. package/packages/pm-templates/package.json +1 -1
  204. package/packages/pm-todos/package.json +1 -1
  205. package/packages/pm-vcs/package.json +1 -1
  206. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  207. package/plugins/pm-claude/package.json +1 -1
  208. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  209. package/plugins/pm-codex/package.json +1 -1
  210. package/plugins/pm-codex/plugin.json +1 -1
  211. package/runtime-dependencies.json +1 -1
  212. package/dist/cli-bundle/chunks/chunk-3ZQQVJT2.js +0 -20
  213. package/dist/cli-bundle/chunks/chunk-4HW253W2.js +0 -2
  214. package/dist/cli-bundle/chunks/chunk-4OELCF3O.js +0 -2
  215. package/dist/cli-bundle/chunks/chunk-BFZUJ5QP.js +0 -115
  216. package/dist/cli-bundle/chunks/chunk-DAZFCSDV.js +0 -2
  217. package/dist/cli-bundle/chunks/chunk-EN27ZQSV.js +0 -2
  218. package/dist/cli-bundle/chunks/chunk-K46GDAKX.js +0 -6
  219. package/dist/cli-bundle/chunks/chunk-OJR2YGXF.js +0 -31
  220. package/dist/cli-bundle/chunks/chunk-QHHFXNSQ.js +0 -3
  221. package/dist/cli-bundle/chunks/chunk-ZNWDYDFF.js +0 -129
  222. package/dist/cli-bundle/chunks/item-transaction-JHPBH6N7.js +0 -2
  223. package/dist/cli-bundle/chunks/mutation-admission-QUNQZCZ5.js +0 -2
  224. package/dist/cli-bundle/chunks/register-operations-RFMM5KZ6.js +0 -2
  225. package/dist/cli-bundle/chunks/register-setup-6B6Q7M5L.js +0 -2
  226. package/dist/cli-bundle/focused-chunks/chunk-4NVPDZLX.js +0 -12
  227. package/dist/cli-bundle/focused-chunks/chunk-4UUE3YXZ.js +0 -2
  228. package/dist/cli-bundle/focused-chunks/chunk-5UDDRPYR.js +0 -8
  229. package/dist/cli-bundle/focused-chunks/chunk-AK2CI2GI.js +0 -2
  230. package/dist/cli-bundle/focused-chunks/chunk-EJJWOFP5.js +0 -91
  231. package/dist/cli-bundle/focused-chunks/chunk-FUGYXUUL.js +0 -80
  232. package/dist/cli-bundle/focused-chunks/chunk-HMXVTWIV.js +0 -3
  233. package/dist/cli-bundle/focused-chunks/chunk-JLN5CFYM.js +0 -2
  234. package/dist/cli-bundle/focused-chunks/chunk-K4FMZB4Y.js +0 -23
  235. package/dist/cli-bundle/focused-chunks/chunk-PF553UVP.js +0 -44
  236. package/dist/cli-bundle/focused-chunks/chunk-RUCG6UWN.js +0 -2
  237. package/dist/cli-bundle/focused-chunks/chunk-SGWYNU7T.js +0 -2
  238. package/dist/cli-bundle/focused-chunks/chunk-TGS5RXBY.js +0 -26
  239. package/dist/cli-bundle/focused-chunks/chunk-WD43E7RU.js +0 -2
  240. package/dist/cli-bundle/focused-chunks/chunk-YM4AMP7H.js +0 -2
  241. package/dist/cli-bundle/focused-chunks/item-transaction-F4SN7TXJ.js +0 -2
  242. package/dist/cli-bundle/focused-chunks/mutation-admission-7R2FXJ5O.js +0 -2
@@ -0,0 +1,3 @@
1
+ import{Da as de,ka as _e}from"./chunk-6T2V3UIK.js";import{Fa as ie,N as te,Yc as ce,ga as C,oa as T}from"./chunk-DSCFJTHB.js";import{Fa as R,Ga as J,Na as k,Pa as Z,Qa as x,Qi as v,Td as ae,Ti as oe,Ui as se,Vc as ne,Vi as w,dc as re,ej as le,gb as ee,od as N,xa as O}from"./chunk-3OXQGGRD.js";import{A as s,C as l,E as G}from"./chunk-O4ZLEN4T.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]="544840da-22f5-5734-81ec-e12c5612545c")}catch{}})();var Fe=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u;function ue(e){let t=e?.trim();if(!t||t==="__proto__"||t.length>128)throw new Error("A legacy author must contain 1-128 characters.");return t}function Me(e){let t=e?.trim().toLowerCase();if(!t||!Fe.test(t))throw new Error("A canonical harness must be a lowercase dash-separated namespace.");return t}function Ve(e){return Object.fromEntries(Object.entries(e).sort(([t],[r])=>t.localeCompare(r)))}function Ke(e,t){let r=new Set;for(let n of(e??[]).slice(0,1e4)){let i=n.trim().slice(0,128);i.length===0||i.startsWith("harness:")||Object.hasOwn(t,i)||r.add(i)}return r.size}function Ye(e,t){let r=ue(t.legacy_author),n=Me(t.canonical_harness);if(r===n||r===`harness:${n}`||r.startsWith("harness:"))throw new Error(`The legacy author "${r}" is already canonical and must not be aliased.`);return e[r]===n?!1:(e[r]=n,!0)}function We(e,t){if(t.operation==="add")return Ye(e,t);if(t.operation==="remove"){let n=ue(t.legacy_author);return Object.hasOwn(e,n)?(delete e[n],!0):!1}if(t.operation==="clear"){let n=Object.keys(e).length>0;for(let i of Object.keys(e))delete e[i];return n}let r=t.operation;throw new Error(`Unsupported vocabulary operation: ${String(r)}`)}function $(e){return{version:e?.version??1,alias_count:Object.keys(e?.aliases??{}).length}}function fe(e,t){let r=e?.version??1,n={...e?.aliases},i=We(n,t),a={version:i?r+1:r,aliases:Ve(n)};return{vocabulary:a,preview:{operation:t.operation,changed:i,version_before:r,version_after:a.version,alias_count:Object.keys(a.aliases).length,residual_author_count:Ke(t.observed_authors,a.aliases)}}}(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]="68662c56-1f32-565f-a547-dbe120a36154")}catch{}})();var ge=new Set(["item_format"]),me=new Set(["definition_of_done","metadata_required_fields","lifecycle_stale_blocker_reason_patterns","lifecycle_closure_like_blocked_reason_patterns","lifecycle_closure_like_resolution_patterns","lifecycle_closure_like_actual_result_patterns"]),Be=new Set(["history_missing_stream_policy","sprint_release_format_policy","parent_reference_policy","metadata_validation_profile","governance_preset","governance_ownership_enforcement","governance_create_mode_default","governance_close_validation_default","governance_require_close_reason","governance_create_default_type","governance_workflow_enforcement","governance_start_blocker_enforcement","governance_parent_reference_policy","governance_metadata_validation_profile","governance_force_required_for_stale_lock","test_result_tracking","untrusted_linked_test_execution","telemetry_tracking","agent_identity_vocabulary"]),He=new Set(["governance_require_close_reason","governance_force_required_for_stale_lock","test_result_tracking","untrusted_linked_test_execution","telemetry_tracking"]),Qe={off:"disabled",on:"enabled",true:"enabled",false:"disabled",enabled:"enabled",disabled:"disabled"};function Xe(e){let t=e.trim().toLowerCase().replaceAll("-","_");if(ge.has(t)||me.has(t)||Be.has(t)||t==="context")return t}function Je(e){let t=e.trim().toLowerCase();return Qe[t]??e}function pe(e,t){let r=Xe(e);return r===void 0?{routable:!1,reason:`Unknown config key "${e}" cannot route a positional value.`}:r==="context"?{routable:!1,reason:"Config set context does not accept a positional value. Use --default-depth, --activity-limit, --stale-threshold-days, or --section-<name> flags."}:ge.has(r)?{routable:!0,flag:"format",value:t}:me.has(r)?{routable:!0,flag:"criterion",values:[t]}:{routable:!0,flag:"policy",value:He.has(r)?Je(t):t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="499ff311-4667-5035-8fb2-4854ee7ecdd7")}catch{}})();var E=[{key:"context_next_ranking_policy",path:"context.next_ranking_policy",kind:"string",choices:["priority_floor","weighted"],summary:"Ready-queue order for pm next with the built-in scorer: priority_floor (resume in-progress work, then priority tiers, relevance within a tier) or weighted (blended relevance order). An extension context_relevance scorer keeps its own order."},{key:"search_provider",path:"search.provider",kind:"string",summary:"Search embedding provider name (e.g. openai, ollama, or an extension provider)."},{key:"search_default_mode",path:"search.default_mode",kind:"string",choices:["auto","keyword","semantic","hybrid"],summary:"Mode a bare pm search runs in: auto (hybrid when semantic search is explicitly configured and runnable, else keyword), or a pinned keyword, semantic, or hybrid."},{key:"search_mutation_refresh_policy",path:"search.mutation_refresh_policy",kind:"string",choices:["cache_only","semantic_configured","semantic_auto"],summary:"Mutation-time search refresh policy: cache_only, semantic_configured, or semantic_auto."},{key:"search_query_expansion_enabled",path:"search.query_expansion.enabled",kind:"boolean",summary:"Enable or disable query expansion for semantic/hybrid search."},{key:"search_query_expansion_provider",path:"search.query_expansion.provider",kind:"string",summary:"Query expansion provider name (built-in openai/ollama or extension provider)."},{key:"search_rerank_enabled",path:"search.rerank.enabled",kind:"boolean",summary:"Enable or disable post-retrieval reranking for hybrid search."},{key:"search_rerank_model",path:"search.rerank.model",kind:"string",summary:"Rerank model name override used by built-in providers."},{key:"search_rerank_top_k",path:"search.rerank.top_k",kind:"integer",min:1,summary:"Number of top hybrid candidates to rerank when rerank is enabled."},{key:"search_embedding_model",path:"search.embedding_model",kind:"string",summary:"Default embedding model name (overrides provider-specific model when set)."},{key:"search_embedding_corpus_max_characters",path:"search.embedding_corpus_max_characters",kind:"integer",min:1,summary:"Maximum semantic corpus characters per item before truncation."},{key:"search_embedding_batch_size",path:"search.embedding_batch_size",kind:"integer",min:1,summary:"Number of items embedded per request batch."},{key:"search_embedding_timeout_ms",path:"search.embedding_timeout_ms",kind:"integer",min:1,summary:"Per-request embedding timeout in milliseconds."},{key:"search_score_threshold",path:"search.score_threshold",kind:"number",summary:"Minimum score for a hit to be returned (0 keeps all matches)."},{key:"search_hybrid_semantic_weight",path:"search.hybrid_semantic_weight",kind:"ratio",summary:"Hybrid mode semantic weight in [0, 1] (1-weight goes to keyword)."},{key:"search_max_results",path:"search.max_results",kind:"integer",min:1,summary:"Default upper bound on search hits when --limit is not supplied."},{key:"search_bm25_k1",path:"search.bm25.k1",kind:"number",min:0,summary:"Offline BM25 term-frequency saturation (k1); higher saturates repeated terms slower (default 1.2)."},{key:"search_bm25_b",path:"search.bm25.b",kind:"ratio",summary:"Offline BM25 document-length normalization (b) in [0, 1]; 0 disables, 1 fully normalizes (default 0.75)."},{key:"openai_base_url",path:"providers.openai.base_url",kind:"string",summary:"OpenAI-compatible API base URL (LM Studio/vLLM also use this)."},{key:"openai_api_key",path:"providers.openai.api_key",kind:"string",summary:"OpenAI-compatible API key."},{key:"openai_model",path:"providers.openai.model",kind:"string",summary:"OpenAI-compatible embedding model name."},{key:"ollama_base_url",path:"providers.ollama.base_url",kind:"string",summary:"Ollama API base URL (typically http://localhost:11434)."},{key:"ollama_model",path:"providers.ollama.model",kind:"string",summary:"Ollama embedding model name (e.g. nomic-embed-text)."},{key:"vector_store_adapter",path:"vector_store.adapter",kind:"string",summary:"Vector store adapter name (lancedb, qdrant, or an extension adapter)."},{key:"vector_store_collection_name",path:"vector_store.collection_name",kind:"string",non_empty:!0,summary:"Vector collection/table name shared by Qdrant and LanceDB adapters."},{key:"qdrant_url",path:"vector_store.qdrant.url",kind:"string",summary:"Qdrant HTTP API URL."},{key:"qdrant_api_key",path:"vector_store.qdrant.api_key",kind:"string",summary:"Qdrant API key (empty if running unauthenticated)."},{key:"lancedb_path",path:"vector_store.lancedb.path",kind:"string",summary:"LanceDB storage path (relative to pm root or absolute)."},{key:"id_prefix",path:"id_prefix",kind:"string",non_empty:!0,summary:'Prefix for generated item IDs (e.g. "pm" produces pm-xxxx).'},{key:"author_default",path:"author_default",kind:"string",non_empty:!0,summary:"Default author recorded on mutations when --author is not supplied."},{key:"agent_identity_probes_enabled",path:"agent_identity.probes_enabled",kind:"boolean",summary:"Allow privacy-bounded local harness provenance probes; no network or subprocess access is permitted."},{key:"mutation_guard_require_attributed_author",path:"mutation_guard.require_attributed_author",kind:"boolean",summary:"Reject mutations whose effective author resolves to unknown."},{key:"mutation_guard_secret_guard",path:"mutation_guard.secret_guard",kind:"string",choices:["off","advise","block"],summary:"Detect credential-shaped mutation content: off, advise, or block."},{key:"mutation_guard_stale_in_progress_hours",path:"mutation_guard.stale_in_progress_hours",kind:"integer",min:1,summary:"Age threshold for unclaimed in-progress work surfaced by health."},{key:"governance_duplicate_detection_mode",path:"governance.duplicate_detection_mode",kind:"string",choices:["off","advisory","strict"],summary:"Create/copy duplicate governance: off, advisory, or strict explicit-bypass enforcement."},{key:"governance_duplicate_detection_threshold",path:"governance.duplicate_detection_threshold",kind:"ratio",summary:"Minimum shared similarity score in [0, 1] for create/copy duplicate governance."},{key:"governance_duplicate_detection_limit",path:"governance.duplicate_detection_limit",kind:"integer",min:0,max:20,summary:"Maximum likely duplicates returned by create/copy governance (0-20)."},{key:"output_default_format",path:"output.default_format",kind:"string",choices:["toon","json"],summary:"Default output format for commands that support it: toon or json."},{key:"ux_deprecation_hints",path:"ux.deprecation_hints",kind:"boolean",summary:"Emit one stderr migration hint for deprecated command aliases."},{key:"locks_ttl_seconds",path:"locks.ttl_seconds",kind:"integer",min:1,summary:"Claim/lock time-to-live in seconds before a stale lock can be reclaimed."},{key:"locks_wait_ms",path:"locks.wait_ms",kind:"integer",min:0,summary:"Wait budget in milliseconds before a contended lock fails with lock_conflict; item-store mutations, restore and the hierarchy lock treat it as a no-progress window that each observed owner handoff restarts (120 s total cap), other locks as a fixed total; 0 fails fast. PM_LOCK_WAIT_MS overrides per invocation."},{key:"ids_token_length",path:"ids.token_length",kind:"integer",min:4,max:12,summary:"Random base36 token length for newly minted item ids (4-12, default 4). Raise it to shrink cross-branch id collision odds in concurrent multi-agent workflows (pm-pibw)."},{key:"checkpoints_retention_days",path:"checkpoints.retention_days",kind:"integer",min:1,summary:"Age in days above which pm gc --scope checkpoints prunes bulk-mutation rollback checkpoints."},{key:"schema_unknown_field_policy",path:"schema.unknown_field_policy",kind:"string",choices:["allow","warn","reject"],summary:"How item I/O handles metadata keys not in the field registry: allow, warn, or reject."},{key:"history_compact_policy_enabled",path:"history.compact_policy.enabled",kind:"boolean",summary:"Enable the history-compaction advisory: pm health warns on over-threshold streams."},{key:"history_compact_policy_max_entries",path:"history.compact_policy.max_entries",kind:"integer",min:1,summary:"Entry count above which a history stream is flagged (and the default pm history-compact --all-over threshold)."},{key:"history_compact_policy_trigger",path:"history.compact_policy.trigger",kind:"string",choices:["health_warn","auto"],summary:"History-compaction policy intent: health_warn (advisory only) or auto (scheduled sweeps expected)."}],Ze=new Map(E.flatMap(e=>[[e.key,e],[e.path.toLowerCase().replaceAll("-","_"),e]]));function ye(e){if(typeof e!="string")return;let t=e.trim().toLowerCase().replaceAll("-","_");if(t.length!==0)return Ze.get(t)}function xe(e,t){let r=t.trim().toLowerCase();return r==="true"||r==="1"||r==="yes"||r==="on"?{ok:!0,parsed:{descriptor:e,value:!0}}:r==="false"||r==="0"||r==="no"||r==="off"?{ok:!0,parsed:{descriptor:e,value:!1}}:{ok:!1,error:{message:`Config set ${e.key} requires a boolean value (true|false), got "${t}"`}}}function et(e,t,r){return e.non_empty===!0&&r.length===0?{ok:!1,error:{message:`Config set ${e.key} requires a non-empty value`}}:e.choices&&!e.choices.includes(r)?{ok:!1,error:{message:`Config set ${e.key} must be one of ${e.choices.join("|")}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:r}}}function tt(e,t,r){if(r.length===0)return{ok:!1,error:{message:`Config set ${e.key} requires a non-empty value`}};let n=Number(r);return Number.isFinite(n)?{ok:!0,value:n}:{ok:!1,error:{message:`Config set ${e.key} requires a finite number, got "${t}"`}}}function rt(e,t,r){return!Number.isInteger(r)||r<0?{ok:!1,error:{message:`Config set ${e.key} requires a non-negative integer, got "${t}"`}}:e.min!==void 0&&r<e.min?{ok:!1,error:{message:`Config set ${e.key} requires an integer >= ${e.min}, got "${t}" (the runtime silently ignores 0 here and falls back to the default)`}}:e.max!==void 0&&r>e.max?{ok:!1,error:{message:`Config set ${e.key} requires an integer <= ${e.max}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:r}}}function nt(e,t,r){return r<0||r>1?{ok:!1,error:{message:`Config set ${e.key} requires a number in [0, 1], got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:r}}}function at(e,t,r){return e.min!==void 0&&r<e.min?{ok:!1,error:{message:`Config set ${e.key} requires a number >= ${e.min}, got "${t}"`}}:{ok:!0,parsed:{descriptor:e,value:r}}}function he(e,t){if(typeof t!="string")return{ok:!1,error:{message:`Config set ${e.key} requires a string value`}};let r=t.trim();if(e.kind==="boolean")return xe(e,t);if(e.kind==="string")return et(e,t,r);let n=tt(e,t,r);return n.ok?e.kind==="integer"?rt(e,t,n.value):e.kind==="ratio"?nt(e,t,n.value):at(e,t,n.value):{ok:!1,error:n.error}}function D(e,t){let r=t.path.split("."),n=e;for(let i of r){if(typeof n!="object"||n===null)return null;let a=Object.getOwnPropertyDescriptor(n,i);if(!a||!Object.hasOwn(a,"value"))return null;n=a.value}return typeof n=="string"||typeof n=="number"||typeof n=="boolean"?n:null}function ve(e,t,r){let n=t.path.split(".");if(n.some(o=>o.length===0||["__proto__","constructor","prototype"].includes(o)))throw new Error("Unsafe settings path");let i=e;for(let o=0;o<n.length-1;o+=1){let _=n[o],d=Object.getOwnPropertyDescriptor(i,_)?.value;if(typeof d!="object"||d===null||Array.isArray(d)){let c={};Object.defineProperty(i,_,{value:c,writable:!0,enumerable:!0,configurable:!0}),i=c}else i=d}let a=n[n.length-1];return Object.getOwnPropertyDescriptor(i,a)?.value===r?!1:(Object.defineProperty(i,a,{value:r,writable:!0,enumerable:!0,configurable:!0}),!0)}(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]="9ce54ccd-1956-5fc0-994d-a43b5000e917")}catch{}})();var we=["project","global"],y={definition_of_done:["definition-of-done","definition_of_done"],item_format:["item-format","item_format"],history_missing_stream_policy:["history-missing-stream-policy","history_missing_stream_policy"],sprint_release_format_policy:["sprint-release-format-policy","sprint_release_format_policy"],parent_reference_policy:["parent-reference-policy","parent_reference_policy"],metadata_validation_profile:["metadata-validation-profile","metadata_validation_profile"],metadata_required_fields:["metadata-required-fields","metadata_required_fields"],lifecycle_stale_blocker_reason_patterns:["lifecycle-stale-blocker-reason-patterns","lifecycle_stale_blocker_reason_patterns"],lifecycle_closure_like_blocked_reason_patterns:["lifecycle-closure-like-blocked-reason-patterns","lifecycle_closure_like_blocked_reason_patterns"],lifecycle_closure_like_resolution_patterns:["lifecycle-closure-like-resolution-patterns","lifecycle_closure_like_resolution_patterns"],lifecycle_closure_like_actual_result_patterns:["lifecycle-closure-like-actual-result-patterns","lifecycle_closure_like_actual_result_patterns"],governance_preset:["governance-preset","governance_preset"],governance_ownership_enforcement:["governance-ownership-enforcement","governance_ownership_enforcement"],governance_create_mode_default:["governance-create-mode-default","governance_create_mode_default"],governance_close_validation_default:["governance-close-validation-default","governance_close_validation_default"],governance_require_close_reason:["governance-require-close-reason","governance_require_close_reason"],governance_create_default_type:["governance-create-default-type","governance_create_default_type"],governance_workflow_enforcement:["governance-workflow-enforcement","governance_workflow_enforcement"],governance_start_blocker_enforcement:["governance-start-blocker-enforcement","governance_start_blocker_enforcement"],governance_parent_reference_policy:["governance-parent-reference-policy","governance_parent_reference_policy"],governance_metadata_validation_profile:["governance-metadata-validation-profile","governance_metadata_validation_profile"],governance_force_required_for_stale_lock:["governance-force-required-for-stale-lock","governance_force_required_for_stale_lock"],test_result_tracking:["test-result-tracking","test_result_tracking"],untrusted_linked_test_execution:["untrusted-linked-test-execution","untrusted_linked_test_execution"],telemetry_tracking:["telemetry-tracking","telemetry_tracking"],agent_identity_vocabulary:["agent-identity-vocabulary","agent_identity_vocabulary"],context:["context"]},it=Object.keys(y).map(e=>y[e][0]),ot=Object.fromEntries(Object.keys(y).flatMap(e=>y[e].map(t=>[t,e]))),st={definition_of_done:"Definition of Done criteria list.",item_format:"Default item file format.",history_missing_stream_policy:"Missing history stream handling policy.",sprint_release_format_policy:"Sprint/release format validation policy.",parent_reference_policy:"Parent reference validation policy.",metadata_validation_profile:"Validate metadata profile policy (core|strict|custom).",metadata_required_fields:"Validate custom metadata required-fields list.",lifecycle_stale_blocker_reason_patterns:"Validate lifecycle stale-blocker reason substring patterns (criteria list).",lifecycle_closure_like_blocked_reason_patterns:"Validate lifecycle closure-like blocked_reason substring patterns (criteria list).",lifecycle_closure_like_resolution_patterns:"Validate lifecycle closure-like resolution substring patterns (criteria list).",lifecycle_closure_like_actual_result_patterns:"Validate lifecycle closure-like actual_result substring patterns (criteria list).",governance_preset:"Governance preset policy (minimal|default|strict|custom).",governance_ownership_enforcement:"Governance ownership enforcement policy (none|warn|strict).",governance_create_mode_default:"Governance default create mode (progressive|strict).",governance_close_validation_default:"Governance default close validation mode (off|warn|strict).",governance_require_close_reason:"Governance close-reason requirement policy (enabled|disabled).",governance_create_default_type:"Governance default item type for `pm create` when --type is omitted.",governance_workflow_enforcement:"Governance per-type transition enforcement mode (off|warn|strict).",governance_start_blocker_enforcement:"Governance admission for starting an item whose declared blocker is still open (off|warn|strict; strict by default).",governance_parent_reference_policy:"Governance parent reference policy (warn|strict_error).",governance_metadata_validation_profile:"Governance metadata validation profile (core|strict|custom).",governance_force_required_for_stale_lock:"Governance stale-lock force policy (enabled|disabled).",test_result_tracking:"Item-level linked test result persistence policy.",untrusted_linked_test_execution:"Permit an explicit per-run override for commands not trusted by this clone.",telemetry_tracking:"Telemetry usage reporting policy.",agent_identity_vocabulary:"Versioned exact legacy-author interpretation vocabulary (summary only).",context:"Context command settings (depth, section toggles, limits)."},lt=["lifecycle_stale_blocker_reason_patterns","lifecycle_closure_like_blocked_reason_patterns","lifecycle_closure_like_resolution_patterns","lifecycle_closure_like_actual_result_patterns"],ct=new Set(["metadata_required_fields",...lt]),_t=new Set(["test_result_tracking","untrusted_linked_test_execution","telemetry_tracking"]),dt=new Set(["governance_require_close_reason","governance_force_required_for_stale_lock"]),ut=new Set(["governance_ownership_enforcement","governance_create_mode_default","governance_close_validation_default"]),ft=new Set(["governance_parent_reference_policy","governance_metadata_validation_profile","governance_workflow_enforcement","governance_start_blocker_enforcement"]),gt=new Set(["governance_preset","governance_create_default_type"]),Ee=e=>ct.has(e),mt=e=>ut.has(e),pt=e=>ft.has(e),yt=e=>gt.has(e);function L(e){return e==="definition_of_done"||Ee(e)}function Ae(e){if(we.includes(e))return e;throw new l(`Invalid config scope "${e}". Allowed: ${we.join(", ")}`,s.USAGE)}function Se(e){if(e==="get"||e==="set"||e==="list"||e==="export")return e;throw te({command_path:"config",token:e.trim()||"<empty>",allowed:["export","get","list","set"],token_kind:"action"})}function qe(e){let t=ot[e];if(t)return t;let r=E.map(n=>n.key).join(", ");throw new l(`Invalid config key "${e}". Supported: ${it.join(", ")} (underscore variants also accepted). Nested leaf settings: ${r}.`,s.USAGE)}function Pe(e,t){let r=[...new Set((e??[]).map(n=>n.trim()).filter(n=>n.length>0))].sort((n,i)=>n.localeCompare(i));if(t){if(r.length>0)throw new l("Config set definition-of-done cannot combine --clear-criteria with --criterion values",s.USAGE);return[]}if(r.length===0)throw new l("Config set definition-of-done requires at least one non-empty --criterion value (or --clear-criteria to clear)",s.USAGE);return r}function Ie(e){let t=e?.trim().toLowerCase();if(t==="toon")return"toon";throw t==="json_markdown"?new l("Config set item-format no longer accepts json_markdown. Markdown item files are legacy read/migration input only.",s.USAGE):new l("Config set item-format requires --format toon",s.USAGE)}function F(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="auto_create"||t==="strict_error")return t;throw new l("Config set history-missing-stream-policy requires --policy with one of: auto_create, strict_error",s.USAGE)}function Ge(e){return M(e,"test-result-tracking")}function M(e,t){let r=e?.trim().toLowerCase().replaceAll("-","_");if(r==="enabled"||r==="disabled")return r;throw new l(`Config set ${t} requires --policy with one of: enabled, disabled`,s.USAGE)}function V(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="enabled"||t==="disabled")return t;throw new l("Config set telemetry-tracking requires --policy with one of: enabled, disabled",s.USAGE)}function S(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="core"||t==="strict"||t==="custom")return t;throw new l("Config set metadata-validation-profile requires --policy with one of: core, strict, custom",s.USAGE)}function K(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="minimal"||t==="default"||t==="strict"||t==="custom")return t;throw new l("Config set governance-preset requires --policy with one of: minimal, default, strict, custom",s.USAGE)}function Y(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="none"||t==="warn"||t==="strict")return t;throw new l("Config set governance-ownership-enforcement requires --policy with one of: none, warn, strict",s.USAGE)}function W(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="progressive"||t==="strict")return t;throw new l("Config set governance-create-mode-default requires --policy with one of: progressive, strict",s.USAGE)}function B(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="off"||t==="warn"||t==="strict")return t;if(t==="none"||t==="disabled")return"off";throw new l("Config set governance-close-validation-default requires --policy with one of: off, warn, strict",s.USAGE)}function A(e,t="governance-workflow-enforcement"){let r=typeof e=="string"?e.trim().toLowerCase().replaceAll("-","_"):void 0;if(r==="off"||r==="warn"||r==="strict")return r;if(r==="none"||r==="disabled")return"off";throw new l(`Config set ${t} requires one of: off, warn, strict`,s.USAGE)}function H(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="enabled"||t==="disabled")return t;throw new l("Config set governance-force-required-for-stale-lock requires --policy with one of: enabled, disabled",s.USAGE)}function Q(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="enabled"||t==="disabled")return t;throw new l("Config set governance-require-close-reason requires --policy with one of: enabled, disabled",s.USAGE)}var ht={test_result_tracking:"test-result-tracking",untrusted_linked_test_execution:"untrusted-linked-test-execution"},vt={governance_workflow_enforcement:"governance-workflow-enforcement",governance_start_blocker_enforcement:"governance-start-blocker-enforcement"};function U(e,t){let r=ht[e];if(r)return M(t,r);let n=vt[e];if(n)return A(t,n);switch(e){case"history_missing_stream_policy":return F(t);case"sprint_release_format_policy":return T(t);case"parent_reference_policy":case"governance_parent_reference_policy":return C(t);case"metadata_validation_profile":case"governance_metadata_validation_profile":return S(t);case"governance_preset":return K(t);case"governance_ownership_enforcement":return Y(t);case"governance_create_mode_default":return W(t);case"governance_close_validation_default":return B(t);case"governance_require_close_reason":return Q(t);case"governance_force_required_for_stale_lock":return H(t);case"telemetry_tracking":return V(t);default:return t.trim().toLowerCase().replaceAll("-","_")}}var be={author:"author",acceptance_criteria:"acceptance_criteria","acceptance-criteria":"acceptance_criteria",estimated_minutes:"estimated_minutes","estimated-minutes":"estimated_minutes",estimate:"estimated_minutes",close_reason:"close_reason","close-reason":"close_reason",reviewer:"reviewer",risk:"risk",confidence:"confidence",sprint:"sprint",release:"release"},wt=["author","acceptance_criteria","estimated_minutes","close_reason","reviewer","risk","confidence","sprint","release"];function Oe(e,t){let r=[...new Set((e??[]).map(a=>a.trim()).filter(a=>a.length>0))];if(t){if(r.length>0)throw new l("Config set metadata-required-fields cannot combine --clear-criteria with --criterion values",s.USAGE);return[]}if(r.length===0)throw new l("Config set metadata-required-fields requires at least one --criterion value (or --clear-criteria to clear)",s.USAGE);let n=r.map(a=>a.toLowerCase().replaceAll("-","_")),i=n.filter(a=>be[a]===void 0);if(i.length>0)throw new l(`Config set metadata-required-fields received unsupported values: ${i.join(", ")}. Supported values: ${wt.join(", ")}`,s.USAGE);return[...new Set(n.map(a=>be[a]))].sort((a,o)=>a.localeCompare(o))}function bt(e,t,r){let n=[...new Set((t??[]).map(i=>i.trim().toLowerCase()).filter(i=>i.length>0))].sort((i,a)=>i.localeCompare(a));if(r){if(n.length>0)throw new l(`Config set ${y[e][0]} cannot combine --clear-criteria with --criterion values`,s.USAGE);return[]}if(n.length===0)throw new l(`Config set ${y[e][0]} requires at least one --criterion value (or --clear-criteria to clear)`,s.USAGE);return n}function Re(e){return[...new Set(e)].sort((t,r)=>t.localeCompare(r))}function kt(e,t){if(e==="list"||e==="export"){if(typeof t=="string"&&t.trim().length>0)throw new l(`Config action "${e}" does not accept <key>`,s.USAGE);return}if(typeof t!="string"||t.trim().length===0)throw new l(`Config action "${e}" requires <key>`,s.USAGE);return qe(t)}function Ne(e){if(!e)throw new l("Config action requires <key>",s.USAGE)}var Ct={definition_of_done:e=>[...e.workflow.definition_of_done],item_format:e=>e.item_format,history_missing_stream_policy:e=>e.history.missing_stream,sprint_release_format_policy:e=>e.validation.sprint_release_format,parent_reference_policy:e=>e.validation.parent_reference,metadata_validation_profile:e=>e.validation.metadata_profile,metadata_required_fields:e=>[...e.validation.metadata_required_fields],lifecycle_stale_blocker_reason_patterns:e=>[...e.validation.lifecycle_stale_blocker_reason_patterns],lifecycle_closure_like_blocked_reason_patterns:e=>[...e.validation.lifecycle_closure_like_blocked_reason_patterns],lifecycle_closure_like_resolution_patterns:e=>[...e.validation.lifecycle_closure_like_resolution_patterns],lifecycle_closure_like_actual_result_patterns:e=>[...e.validation.lifecycle_closure_like_actual_result_patterns],governance_preset:e=>e.governance.preset,governance_ownership_enforcement:e=>e.governance.ownership_enforcement,governance_create_mode_default:e=>e.governance.create_mode_default,governance_close_validation_default:e=>e.governance.close_validation_default,governance_require_close_reason:e=>e.governance.require_close_reason?"enabled":"disabled",governance_create_default_type:e=>e.governance.create_default_type??"",governance_workflow_enforcement:e=>e.governance.workflow_enforcement??"off",governance_start_blocker_enforcement:e=>e.governance.start_blocker_enforcement??"strict",governance_parent_reference_policy:e=>e.governance.parent_reference,governance_metadata_validation_profile:e=>e.governance.metadata_profile,governance_force_required_for_stale_lock:e=>e.governance.force_required_for_stale_lock?"enabled":"disabled",test_result_tracking:e=>e.testing.record_results_to_items?"enabled":"disabled",untrusted_linked_test_execution:e=>e.testing.allow_untrusted_linked_tests?"enabled":"disabled",telemetry_tracking:e=>e.telemetry.enabled?"enabled":"disabled",agent_identity_vocabulary:e=>$(e.agent_identity?.identity_vocabulary),context:e=>({default_depth:e.context.default_depth,activity_limit:e.context.activity_limit,stale_threshold_days:e.context.stale_threshold_days,next_ranking_policy:e.context.next_ranking_policy,sections:{...e.context.sections}})};function X(e,t){return Ct[t](e)}function g(e,t){return t.length===0?e:{...e,warnings:t}}async function Et(e,t){let r=process.cwd(),n=e==="project"?k(r,t.path):Z(r),i=x(n);return e==="project"&&await le(n),{pmRoot:n,settingsPath:i}}function At(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(t==="true"||t==="enabled"||t==="on"||t==="1")return!0;if(t==="false"||t==="disabled"||t==="off"||t==="0")return!1;throw new l(`Context section toggle must be true|false|enabled|disabled, got "${e}"`,s.USAGE)}function ke(e,t){let r=e.trim(),n=Number(r);if(/^\d+$/u.test(r)&&Number.isSafeInteger(n)&&n>0)return n;throw new l(`Context ${t} must be a positive integer`,s.USAGE)}async function St(e,t,r,n,i){let a=!1,o=e.context,_=[];if(t.defaultDepth!==void 0){let c=t.defaultDepth.trim().toLowerCase();if(!O.includes(c))throw new l(`Context --default-depth must be one of ${O.join("|")}`,s.USAGE);_.push("context.default_depth"),o.default_depth!==c&&(o.default_depth=c,a=!0)}if(t.activityLimit!==void 0){let c=ke(t.activityLimit,"--activity-limit");_.push("context.activity_limit"),o.activity_limit!==c&&(o.activity_limit=c,a=!0)}if(t.staleThresholdDays!==void 0){let c=ke(t.staleThresholdDays,"--stale-threshold-days");_.push("context.stale_threshold_days"),o.stale_threshold_days!==c&&(o.stale_threshold_days=c,a=!0)}let d=[["hierarchy",t.sectionHierarchy],["activity",t.sectionActivity],["progress",t.sectionProgress],["blockers",t.sectionBlockers],["files",t.sectionFiles],["workload",t.sectionWorkload],["staleness",t.sectionStaleness],["tests",t.sectionTests]];for(let[c,h]of d){let p=At(h);if(p!==void 0){let m=c;_.push(`context.sections.${c}`),o.sections[m]!==p&&(o.sections[m]=p,a=!0)}}return(a||v(e))&&(await w(r.pmRoot,e,"config:set:context",{assignedPaths:_}),a=!0),g({scope:n,key:"context",context_settings:{default_depth:o.default_depth,activity_limit:o.activity_limit,stale_threshold_days:o.stale_threshold_days,next_ranking_policy:o.next_ranking_policy,sections:{...o.sections}},settings_path:r.settingsPath,changed:a},i)}function qt(e,t,r){if(r.value!==void 0&&r.value!==t)throw new l(`Config set ${e} received both positional value "${t}" and --value "${r.value}". Pass only one.`,s.USAGE);return{...r,value:t}}function Te(e,t,r,n,i,a){if(i===void 0)return a;if(e!=="set")throw new l(`Config action "${e}" does not accept a positional value. Only "set" takes <value>.`,s.USAGE);if(typeof t!="string"||t.trim().length===0)throw new l('Config action "set" requires <key> before a positional <value>.',s.USAGE);if(n)return qt(t,i,a);Ne(r);let o=pe(r,i);if(!o.routable)throw new l(o.reason,s.USAGE);if(o.flag==="criterion"){if(a.criterion!==void 0&&a.criterion.length>0)throw new l(`Config set ${t} received both positional value "${i}" and --criterion. Pass criteria via --criterion only when supplying more than one value.`,s.USAGE);return{...a,criterion:o.values}}if(o.flag==="format")return{...a,format:o.value};if(a.policy!==void 0&&U(r,a.policy)!==U(r,o.value))throw new l(`Config set ${t} received both positional value "${i}" and --policy "${a.policy}". Pass only one.`,s.USAGE);return{...a,policy:o.value}}function Pt(e){let t=Object.keys(y).map(n=>({key:n,aliases:y[n],value_kind:n==="context"||n==="agent_identity_vocabulary"?"object":L(n)?"string_array":"enum",set_flags:n==="context"?["--default-depth","--activity-limit","--stale-threshold-days","--section-<name>"]:n==="agent_identity_vocabulary"?["--policy","--value","--criterion"]:L(n)?["--criterion","--clear-criteria"]:n==="item_format"?["--format"]:["--policy"],summary:st[n],value:X(e.settings,n)})),r=E.map(n=>({key:n.key,canonical_key:n.key.replaceAll("_","-"),path:n.path,kind:n.kind,value:D(e.settings,n),summary:n.summary,...n.choices?{choices:[...n.choices]}:{},...n.min===void 0?{}:{min:n.min},...n.max===void 0?{}:{max:n.max}}));return g({scope:e.scope,keys:t,nested_settings:r,count:t.length,settings_path:e.target.settingsPath,changed:!1},e.warnings)}function It(e){let t=Object.fromEntries(Object.keys(y).map(r=>[r,X(e.settings,r)]));return g({scope:e.scope,values:t,settings_path:e.target.settingsPath,changed:!1},e.warnings)}function Gt(e,t){let r=X(e.settings,t),n={scope:e.scope,key:t,settings_path:e.target.settingsPath,changed:!1};return t==="item_format"?g({...n,format:e.settings.item_format,has_explicit_item_format:e.metadata.has_explicit_item_format},e.warnings):t==="context"?g({...n,context_settings:r},e.warnings):t==="agent_identity_vocabulary"?g({...n,identity_vocabulary:r},e.warnings):Array.isArray(r)?g({...n,criteria:r},e.warnings):g({...n,policy:r},e.warnings)}async function Ot(e,t,r,n){if(t==="get"){let _=D(e.settings,r);return g({scope:e.scope,key:r.key,nested_setting:{key:r.key,path:r.path,kind:r.kind,value:_},settings_path:e.target.settingsPath,changed:!1},e.warnings)}let i=n.value;if(typeof i!="string")throw new l(`Config set ${r.key} requires a value. Pass it positionally (\`pm config ${e.scope} set ${r.key} <value>\`) or via --value.`,s.USAGE);let a=he(r,i);if(!a.ok)throw new l(a.error.message,s.USAGE);let o=ve(e.settings,r,a.parsed.value)||v(e.settings);return o&&await w(e.target.pmRoot,e.settings,`config:set:${r.path}`,{assignedPaths:[r.path]}),g({scope:e.scope,key:r.key,nested_setting:{key:r.key,path:r.path,kind:r.kind,value:a.parsed.value},settings_path:e.target.settingsPath,changed:o},e.warnings)}async function u(e,t,r,n=[]){(t||v(e.settings))&&(await w(e.target.pmRoot,e.settings,r,{assignedPaths:n}),v(e.settings)&&(e.fallbackRepairWritten=!0))}function z(e,t,r){return e!==r||t!==r}function f(e,t,r,n){return g({scope:e.scope,key:t,policy:r,settings_path:e.target.settingsPath,changed:n},e.warnings)}function j(e,t,r,n){return g({scope:e.scope,key:t,criteria:r,settings_path:e.target.settingsPath,changed:n},e.warnings)}async function Ce(e,t,r){let n=R(t,N()),i=await ce(e,r,"config:set:item_format:migrate",n.type_to_folder,t.schema);return{target_format:i.target_format,scanned:i.scanned,migrated:i.migrated,removed:i.removed,warnings:i.warnings}}async function Rt(e,t){let r=Ie(t.format),n=e.settings.item_format!==r||!e.metadata.has_explicit_item_format,i;if(n){e.settings.item_format=r;let a={assignedPaths:["item_format"]};v(e.settings)?(await w(e.target.pmRoot,e.settings,"config:set:item_format",a),e.fallbackRepairWritten=!0,i=await Ce(e.target.pmRoot,await se(e.target.pmRoot),r)):(i=await Ce(e.target.pmRoot,e.settings,r),await w(e.target.pmRoot,e.settings,"config:set:item_format",a))}return g({scope:e.scope,key:"item_format",format:e.settings.item_format,has_explicit_item_format:!0,migration:i,settings_path:e.target.settingsPath,changed:n},e.warnings)}async function Nt(e,t,r){if(t==="history_missing_stream_policy"){let a=F(r.policy),o=e.settings.history.missing_stream!==a;return e.settings.history.missing_stream=a,await u(e,o,"config:set:history_missing_stream_policy",["history.missing_stream"]),f(e,t,e.settings.history.missing_stream,o)}if(t==="sprint_release_format_policy"){let a=T(r.policy),o=e.settings.validation.sprint_release_format!==a;return e.settings.validation.sprint_release_format=a,await u(e,o,"config:set:sprint_release_format_policy",["validation.sprint_release_format"]),f(e,t,e.settings.validation.sprint_release_format,o)}if(t==="parent_reference_policy"){let a=C(r.policy),o=e.settings.validation.parent_reference!==a||e.settings.governance.preset!=="custom"||e.settings.governance.parent_reference!==a;return e.settings.validation.parent_reference=a,e.settings.governance.preset="custom",e.settings.governance.parent_reference=a,await u(e,o,"config:set:parent_reference_policy",["validation.parent_reference","governance.preset","governance.parent_reference"]),f(e,t,e.settings.validation.parent_reference,o)}let n=S(r.policy),i=e.settings.validation.metadata_profile!==n||e.settings.governance.preset!=="custom"||e.settings.governance.metadata_profile!==n;return e.settings.validation.metadata_profile=n,e.settings.governance.preset="custom",e.settings.governance.metadata_profile=n,await u(e,i,"config:set:metadata_validation_profile",["validation.metadata_profile","governance.preset","governance.metadata_profile"]),f(e,t,e.settings.validation.metadata_profile,i)}async function Tt(e,t,r){if(t==="metadata_required_fields"){let o=Oe(r.criterion,r.clearCriteria),_=o.length!==e.settings.validation.metadata_required_fields.length||o.some((d,c)=>d!==e.settings.validation.metadata_required_fields[c]);return e.settings.validation.metadata_required_fields=o,await u(e,_,"config:set:metadata_required_fields",["validation.metadata_required_fields"]),j(e,t,[...e.settings.validation.metadata_required_fields],_)}let n={lifecycle_stale_blocker_reason_patterns:e.settings.validation.lifecycle_stale_blocker_reason_patterns,lifecycle_closure_like_blocked_reason_patterns:e.settings.validation.lifecycle_closure_like_blocked_reason_patterns,lifecycle_closure_like_resolution_patterns:e.settings.validation.lifecycle_closure_like_resolution_patterns,lifecycle_closure_like_actual_result_patterns:e.settings.validation.lifecycle_closure_like_actual_result_patterns}[t],i=bt(t,r.criterion,r.clearCriteria),a=i.length!==n.length||i.some((o,_)=>o!==n[_]);return n.splice(0,n.length,...i),await u(e,a,`config:set:${t}`,[`validation.${t}`]),j(e,t,[...n],a)}async function $t(e,t,r){if(t==="governance_preset"){let d=K(r.policy),c=e.settings.governance.preset!==d;return e.settings.governance.preset=d,await u(e,c,"config:set:governance_preset",["governance.preset"]),f(e,t,e.settings.governance.preset,c)}let n=typeof r.policy=="string",i=n?r.policy.trim():"";if(n&&i.length===0){let d=e.settings.governance.create_default_type!==void 0;return delete e.settings.governance.create_default_type,await u(e,d,"config:set:governance_create_default_type",["governance.create_default_type"]),f(e,t,e.settings.governance.create_default_type??"",d)}if(i.length===0)throw new l('Config set governance-create-default-type requires an item type value (or an empty value "" to clear it)',s.USAGE);let a=R(e.settings,N()),o=J(i,a);if(!o)throw new l(ie(i,a.types,ae(e.target.pmRoot,e.settings.schema)),s.USAGE);let _=e.settings.governance.create_default_type!==o;return e.settings.governance.create_default_type=o,await u(e,_,"config:set:governance_create_default_type",["governance.create_default_type"]),f(e,t,e.settings.governance.create_default_type,_)}async function Dt(e,t,r){if(t==="governance_ownership_enforcement"){let a=Y(r.policy),o=e.settings.governance.preset!=="custom"||e.settings.governance.ownership_enforcement!==a;return e.settings.governance.preset="custom",e.settings.governance.ownership_enforcement=a,await u(e,o,"config:set:governance_ownership_enforcement",["governance.preset","governance.ownership_enforcement"]),f(e,t,e.settings.governance.ownership_enforcement,o)}if(t==="governance_create_mode_default"){let a=W(r.policy),o=e.settings.governance.preset!=="custom"||e.settings.governance.create_mode_default!==a;return e.settings.governance.preset="custom",e.settings.governance.create_mode_default=a,await u(e,o,"config:set:governance_create_mode_default",["governance.preset","governance.create_mode_default"]),f(e,t,e.settings.governance.create_mode_default,o)}let n=B(r.policy),i=e.settings.governance.preset!=="custom"||e.settings.governance.close_validation_default!==n;return e.settings.governance.preset="custom",e.settings.governance.close_validation_default=n,await u(e,i,"config:set:governance_close_validation_default",["governance.preset","governance.close_validation_default"]),f(e,t,e.settings.governance.close_validation_default,i)}async function Lt(e,t,r){if(t==="governance_parent_reference_policy"){let a=C(r.policy),o=e.settings.governance.preset!=="custom"||z(e.settings.governance.parent_reference,e.settings.validation.parent_reference,a);return e.settings.governance.preset="custom",e.settings.governance.parent_reference=a,e.settings.validation.parent_reference=a,await u(e,o,"config:set:governance_parent_reference_policy",["governance.preset","governance.parent_reference","validation.parent_reference"]),f(e,t,e.settings.governance.parent_reference,o)}if(t==="governance_metadata_validation_profile"){let a=S(r.policy),o=e.settings.governance.preset!=="custom"||z(e.settings.governance.metadata_profile,e.settings.validation.metadata_profile,a);return e.settings.governance.preset="custom",e.settings.governance.metadata_profile=a,e.settings.validation.metadata_profile=a,await u(e,o,"config:set:governance_metadata_validation_profile",["governance.preset","governance.metadata_profile","validation.metadata_profile"]),f(e,t,e.settings.governance.metadata_profile,o)}if(t==="governance_start_blocker_enforcement"){let a=A(r.policy,"governance-start-blocker-enforcement"),o=(e.settings.governance.start_blocker_enforcement??"strict")!==a;return e.settings.governance.start_blocker_enforcement=a,await u(e,o,"config:set:governance_start_blocker_enforcement",["governance.start_blocker_enforcement"]),f(e,t,a,o)}let n=A(r.policy),i=(e.settings.governance.workflow_enforcement??"off")!==n;return e.settings.governance.workflow_enforcement=n,await u(e,i,"config:set:governance_workflow_enforcement",["governance.workflow_enforcement"]),f(e,t,e.settings.governance.workflow_enforcement,i)}async function Ut(e,t,r){if(t==="governance_require_close_reason"){let a=Q(r.policy)==="enabled",o=e.settings.governance.require_close_reason!==a;return e.settings.governance.require_close_reason=a,await u(e,o,"config:set:governance_require_close_reason",["governance.require_close_reason"]),f(e,t,e.settings.governance.require_close_reason?"enabled":"disabled",o)}let n=H(r.policy)==="enabled",i=e.settings.governance.preset!=="custom"||e.settings.governance.force_required_for_stale_lock!==n;return e.settings.governance.preset="custom",e.settings.governance.force_required_for_stale_lock=n,await u(e,i,"config:set:governance_force_required_for_stale_lock",["governance.preset","governance.force_required_for_stale_lock"]),f(e,t,e.settings.governance.force_required_for_stale_lock?"enabled":"disabled",i)}async function zt(e,t,r){if(t==="test_result_tracking"){let a=Ge(r.policy)==="enabled",o=e.settings.testing.record_results_to_items!==a;return e.settings.testing.record_results_to_items=a,await u(e,o,"config:set:test_result_tracking",["testing.record_results_to_items"]),f(e,t,e.settings.testing.record_results_to_items?"enabled":"disabled",o)}if(t==="untrusted_linked_test_execution"){let a=M(r.policy,"untrusted-linked-test-execution")==="enabled",o=e.settings.testing.allow_untrusted_linked_tests!==a;return e.settings.testing.allow_untrusted_linked_tests=a,await u(e,o,"config:set:untrusted_linked_test_execution",["testing.allow_untrusted_linked_tests"]),f(e,t,e.settings.testing.allow_untrusted_linked_tests?"enabled":"disabled",o)}let n=V(r.policy)==="enabled",i=e.settings.telemetry.enabled!==n||!e.settings.telemetry.first_run_prompt_completed;return e.settings.telemetry.enabled=n,e.settings.telemetry.first_run_prompt_completed=!0,await u(e,i,"config:set:telemetry_tracking",["telemetry.enabled","telemetry.first_run_prompt_completed"]),f(e,t,e.settings.telemetry.enabled?"enabled":"disabled",i)}async function jt(e,t,r){let n=Pe(r.criterion,r.clearCriteria),i=n.length!==e.settings.workflow.definition_of_done.length||n.some((a,o)=>a!==e.settings.workflow.definition_of_done[o]);return e.settings.workflow.definition_of_done=n,await u(e,i,"config:set:definition_of_done",["workflow.definition_of_done"]),j(e,t,[...e.settings.workflow.definition_of_done],i)}function Ft(e){let t=e?.trim().toLowerCase().replaceAll("_","-"),r=t?.startsWith("preview-")===!0,n=r?t.slice(8):t;if(n==="add"||n==="remove"||n==="clear")return{operation:n,dryRun:r};throw new l("Config set agent-identity-vocabulary requires --policy add|remove|clear|preview-add|preview-remove|preview-clear",s.USAGE)}function Mt(e,t){if(e==="add"){let r=t?.lastIndexOf("=")??-1;if(r<=0||r===t.length-1)throw new l('Config set agent-identity-vocabulary --policy add requires --value "<legacy-author>=<canonical-harness>"',s.USAGE);return{legacy_author:t.slice(0,r),canonical_harness:t.slice(r+1)}}if(e==="remove"){if(t===void 0)throw new l("Config set agent-identity-vocabulary --policy remove requires --value <legacy-author>",s.USAGE);return{legacy_author:t}}if(t!==void 0)throw new l("Config set agent-identity-vocabulary --policy clear does not accept --value",s.USAGE);return{}}async function Vt(e,t){let{operation:r,dryRun:n}=Ft(t.policy),i=Mt(r,t.value),a;try{a=fe(e.settings.agent_identity?.identity_vocabulary,{operation:r,...i,observed_authors:t.criterion})}catch(o){throw new l(o.message,s.USAGE)}return a.preview.changed&&!n&&(e.settings.agent_identity={...e.settings.agent_identity,identity_vocabulary:a.vocabulary},await u(e,!0,`config:set:agent_identity.identity_vocabulary:${r}:v${a.preview.version_after}`,["agent_identity"])),g({scope:e.scope,key:"agent_identity_vocabulary",identity_vocabulary:$(n?e.settings.agent_identity?.identity_vocabulary:a.vocabulary),vocabulary_mutation:a.preview,settings_path:e.target.settingsPath,changed:a.preview.changed&&!n},e.warnings)}async function Kt(e,t,r){let n=await Yt(e,t,r);return e.fallbackRepairWritten===!0?{...n,changed:!0}:n}async function Yt(e,t,r){if(r.clearCriteria===!0&&!L(t))throw new l("--clear-criteria is only supported with config set criteria-list keys",s.USAGE);return t==="item_format"?Rt(e,r):t==="context"?St(e.settings,r,e.target,e.scope,e.warnings):t==="agent_identity_vocabulary"?Vt(e,r):t==="definition_of_done"?jt(e,t,r):Ee(t)?Tt(e,t,r):_t.has(t)?zt(e,t,r):dt.has(t)?Ut(e,t,r):mt(t)?Dt(e,t,r):pt(t)?Lt(e,t,r):yt(t)?$t(e,t,r):Nt(e,t,r)}async function Pr(e,t,r,n,i,a){let o=Ae(e),_=Se(t),d=_==="get"||_==="set"?ye(r):void 0,c=d?void 0:kt(_,r),h=Te(_,r,c,d,a,n),p=await Et(o,i),{settings:m,metadata:ze,warnings:je}=await oe(p.pmRoot),b={scope:o,target:p,settings:m,metadata:ze,warnings:Re(je)};return d?Ot(b,_,d,h):_==="list"?Pt(b):_==="export"?It(b):(Ne(c),_==="get"?Gt(b,c):Kt(b,c,h))}var Ir={hasGovernanceValidationMirrorChange:z,applyPositionalValue:Te,normalizeAction:Se,normalizeCriteria:Pe,normalizeGovernanceCloseValidationDefault:B,normalizeGovernanceCreateModeDefault:W,normalizeGovernanceForceRequiredForStaleLockPolicy:H,normalizeGovernanceOwnershipEnforcement:Y,normalizeGovernancePreset:K,normalizeGovernanceRequireCloseReasonPolicy:Q,normalizeGovernanceWorkflowEnforcement:A,normalizeHistoryMissingStreamPolicy:F,normalizeItemFormat:Ie,normalizeKey:qe,normalizeMetadataRequiredFields:Oe,normalizePolicyForConflict:U,normalizeScope:Ae,normalizeTelemetryTrackingPolicy:V,normalizeTestResultTrackingPolicy:Ge,normalizeValidateMetadataProfile:S,normalizeWarnings:Re};import{execFile as Wt}from"node:child_process";import Bt from"node:path";import{promisify as Ht}from"node:util";(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]="7fe99df0-8454-5667-9205-0b861ba212d1")}catch{}})();var Qt=Ht(Wt),De="@unbrained/pm-cli",Xt="latest",Jt={global:["--global"],project:[]};function $e(e){let t=e.project===!0||e.local===!0||e.scope==="project",r=e.global===!0||e.scope==="global";if(t&&r)throw new l('Options "--project/--local" and "--global" are mutually exclusive.',s.USAGE);return r?"global":"project"}function P(e){return e.trim().toLowerCase()}function Le(e,t){let r=P(t);return[e.name,e.directory,e.source.input,e.source.location,e.source.package,e.source.repository,e.source.owner&&e.source.repo?`${e.source.owner}/${e.source.repo}`:void 0].some(n=>typeof n=="string"&&P(n)===r)}function Zt(e,t){let r=k(process.cwd(),t.path),n=ne(r,process.cwd());return{selected_root:e==="global"?n.global:n.project}}async function xt(e,t,r){try{let n=await Qt(e,t,{cwd:r?.cwd,encoding:"utf8"});return{stdout:n.stdout,stderr:n.stderr}}catch(n){let i=typeof n=="object"&&n!==null&&"stderr"in n?String(n.stderr??""):"",a=i.trim().length>0?i.trim():n instanceof Error?n.message:String(n);throw new l(`Command failed: ${e} ${t.join(" ")}
2
+ ${a}`,s.GENERIC_FAILURE)}}function I(e){return typeof e.tag=="string"&&e.tag.trim().length>0?e.tag.trim():Xt}function q(e){return typeof e.packageName=="string"&&e.packageName.trim().length>0?e.packageName.trim():De}async function er(e,t){let r=e.commandRunner??xt,n=q(e),i=I(e),a=`${n}@${i}`,o=["npm","install","-g",a];e.repair===!0&&o.push("--force");let _=re(import.meta.url,["../../.."]),d={requested:!0,status:"planned",package:n,target:a,command:o,before_version:_,...n===De?{migration_guidance:["Calendar scheduling commands are package-owned. If calendar is absent, run pm package install calendar --project; use pm calendar meet, pm calendar event, or pm calendar remind."]}:{},repair:e.repair===!0};if(t)return d;try{await r(o[0],o.slice(1));let c=await r("pm",["--version"]);return{...d,status:"updated",after_version:c.stdout.trim()||void 0}}catch(c){return{...d,status:"failed",error:c instanceof Error?c.message:String(c)}}}function tr(e){return Bt.isAbsolute(e)||e.startsWith(".")||e.startsWith("..")||e.startsWith("file:")}function rr(e,t){if(e.kind==="npm"){let r=e.input.startsWith("npm:")?e.input.slice(4).trim():e.input.trim();return!tr(r)&&e.package&&e.package.trim().length>0?`npm:${e.package.trim()}@${t}`:e.input.startsWith("npm:")?e.input:`npm:${e.input}`}return e.input}async function nr(e,t){let r=rr(e,t);return e.kind!=="local"||await G(r)?r:await G(e.location)?e.location:r}function ar(e,t,r,n){let i=["pm","package","install",t,r==="global"?"--global":"--project"];return e.kind==="github"&&n&&n.trim().length>0&&i.push("--ref",n.trim()),i}async function Ue(e,t){let r=Zt(e,t);return(await _e(r.selected_root)).state.entries.filter(n=>n.scope===e)}async function ir(e,t,r){let n=await Ue(e,t);return n.find(i=>Le(i,r.name))??n.find(i=>P(i.directory)===P(r.directory))}async function or(e,t,r,n,i){let a=I(t),o=await nr(e.source,a),_=ar(e.source,o,n,e.source.ref),d={name:e.name,directory:e.directory,scope:n,source:e.source,status:"planned",command:_,previous_version:e.manifest_version};if(i)return d;try{await de(o,{install:!0,project:n==="project",global:n==="global",ref:e.source.kind==="github"?e.source.ref:void 0},r);let c=await ir(n,r,e);return{...d,status:"updated",installed_version:c?.manifest_version}}catch(c){return{...d,status:"failed",error:c instanceof Error?c.message:String(c)}}}function sr(e,t,r,n){let i=[r?e.status:void 0,...t.map(a=>a.status)].filter(a=>typeof a=="string");return{requested_cli:r,requested_packages:n,planned:i.filter(a=>a==="planned").length,updated:i.filter(a=>a==="updated").length,skipped:i.filter(a=>a==="skipped").length,failed:i.filter(a=>a==="failed").length}}async function Lr(e,t,r){let n=typeof e=="string"&&e.trim().length>0?e.trim():void 0;if(t.cliOnly===!0&&t.packagesOnly===!0){let m=["package","upgrade",...n?[n]:[],"--packages-only","--dry-run",...Jt[$e(t)]];throw new l('Options "--cli-only" and "--packages-only" are mutually exclusive.',s.USAGE,{code:"package_upgrade_modes_mutually_exclusive",recovery:{suggested_retry:ee(m),suggested_retry_args:m}})}let i=$e(t),a=t.dryRun===!0;if(t.cliOnly===!0&&n)throw new l('A package target cannot be used with "--cli-only".',s.USAGE);let o=!(t.packagesOnly===!0||n),_=t.cliOnly!==!0,d=o?await er(t,a):{requested:!1,status:"skipped",package:q(t),target:`${q(t)}@${I(t)}`,command:["npm","install","-g",`${q(t)}@${I(t)}`],repair:t.repair===!0,reason:"not_requested"},c=_?await Ue(i,r):[];if(n&&(c=c.filter(m=>Le(m,n)),c.length===0))throw new l(`Managed package "${n}" was not found in ${i} scope.`,s.NOT_FOUND);let h=[];for(let m of c)h.push(await or(m,t,r,i,a));let p=sr(d,h,o,_);return{ok:p.failed===0,action:"upgrade",dry_run:a,scope:i,target:n,cli:d,packages:h,summary:p}}export{ye as a,he as b,D as c,ve as d,$ as e,fe as f,Pr as g,Ir as h,Lr as i};
3
+ //# sourceMappingURL=chunk-TX2W6G37.js.map
@@ -1,2 +1,2 @@
1
- import{b as a}from"./chunk-VS565KBX.js";import{A as l,C as d}from"./chunk-J3JM36EH.js";import{execFile as g}from"node:child_process";import{promisify as m}from"node:util";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="e57ef62f-fd40-5a33-9816-e24d8dba4d1d")}catch{}})();var p=m(g);async function k(t,r){if(r.length===0)return[];let i;try{let e=p("git",["check-ignore","--verbose","-z","--stdin"],{cwd:t,env:a(),timeout:1e4}),n=e.child.stdin;n!==null&&(n.on("error",()=>{e.child.kill()}),n.end(`${r.join("\0")}\0`)),{stdout:i}=await e}catch(e){if(typeof e=="object"&&e!==null&&"code"in e&&e.code===1)return[];throw new d("Git could not verify ignore rules for merge artifacts; no automatic settlement is safe until that check succeeds.",l.CONFLICT,{code:"merge_settlement_review_required",reason:"ignore_check_unavailable",nextSteps:["Check Git configuration and ignore-file readability, then retry pm merge reconcile --stage --dry-run."]})}let o=i.split("\0"),c=[];for(let e=0;e+3<o.length;e+=4){let[n,f,s,u]=o.slice(e,e+4);s.startsWith("!")||c.push({path:u,source:n,line:Number(f),pattern:s})}return c}export{k as a};
2
- //# sourceMappingURL=chunk-GK2CHAT3.js.map
1
+ import{b as a}from"./chunk-VS565KBX.js";import{A as l,C as d}from"./chunk-O4ZLEN4T.js";import{execFile as g}from"node:child_process";import{promisify as m}from"node:util";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new t.Error().stack;r&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[r]="e57ef62f-fd40-5a33-9816-e24d8dba4d1d")}catch{}})();var p=m(g);async function k(t,r){if(r.length===0)return[];let i;try{let e=p("git",["check-ignore","--verbose","-z","--stdin"],{cwd:t,env:a(),timeout:1e4}),n=e.child.stdin;n!==null&&(n.on("error",()=>{e.child.kill()}),n.end(`${r.join("\0")}\0`)),{stdout:i}=await e}catch(e){if(typeof e=="object"&&e!==null&&"code"in e&&e.code===1)return[];throw new d("Git could not verify ignore rules for merge artifacts; no automatic settlement is safe until that check succeeds.",l.CONFLICT,{code:"merge_settlement_review_required",reason:"ignore_check_unavailable",nextSteps:["Check Git configuration and ignore-file readability, then retry pm merge reconcile --stage --dry-run."]})}let o=i.split("\0"),c=[];for(let e=0;e+3<o.length;e+=4){let[n,f,s,u]=o.slice(e,e+4);s.startsWith("!")||c.push({path:u,source:n,line:Number(f),pattern:s})}return c}export{k as a};
2
+ //# sourceMappingURL=chunk-UJMQP2HP.js.map
@@ -1,4 +1,4 @@
1
- import{d as E}from"./chunk-D52QQ7LP.js";import{b as I}from"./chunk-VS565KBX.js";import"./chunk-J3JM36EH.js";import"./chunk-XAWE4EAK.js";import{execFile as O}from"node:child_process";import{realpath as v}from"node:fs/promises";import b from"node:path";import{promisify as M}from"node:util";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new n.Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="5d2c2c37-5ff2-5dab-84f1-55a7fa8d5a27")}catch{}})();var w=M(O),x="[a-f0-9]{40}(?:[a-f0-9]{24})?",N=new RegExp(`^100(?:644|755) (${x}) 0$`,"u"),R=new RegExp(`^(${x}) blob (\\d+)$`,"u");async function _(n,o,a){let t=w("git",n,{...a,encoding:"buffer"}),e=t.child.stdin;return e!==null&&(e.on("error",()=>{t.child.kill()}),e.end(`${o.join(`
1
+ import{d as E}from"./chunk-RSAN2YUU.js";import{b as I}from"./chunk-VS565KBX.js";import"./chunk-O4ZLEN4T.js";import"./chunk-XAWE4EAK.js";import{execFile as O}from"node:child_process";import{realpath as v}from"node:fs/promises";import b from"node:path";import{promisify as M}from"node:util";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new n.Error().stack;o&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[o]="5d2c2c37-5ff2-5dab-84f1-55a7fa8d5a27")}catch{}})();var w=M(O),x="[a-f0-9]{40}(?:[a-f0-9]{24})?",N=new RegExp(`^100(?:644|755) (${x}) 0$`,"u"),R=new RegExp(`^(${x}) blob (\\d+)$`,"u");async function _(n,o,a){let t=w("git",n,{...a,encoding:"buffer"}),e=t.child.stdin;return e!==null&&(e.on("error",()=>{t.child.kill()}),e.end(`${o.join(`
2
2
  `)}
3
3
  `)),(await t).stdout}function B(n,o){let a=new Map;for(let t of n.split("\0")){let e=t.indexOf(" "),i=t.slice(e+1),r=N.exec(t.slice(0,e));r!==null&&o.has(i)&&a.set(i,r[1])}return a}function D(n,o,a){let t=[],e=[],i=0;for(let r of n.trimEnd().split(/\r?\n/u)){let s=R.exec(r);if(s===null||!o.has(s[1]))continue;let c=Number(s[2]);!Number.isSafeInteger(c)||c>a||(e.length>0&&i+c+128>a&&(t.push(e),e=[],i=0),e.push({id:s[1],size:c}),i+=c+128)}return e.length>0&&t.push(e),t}function S(n,o,a){let t=0;for(let{id:e,size:i}of o){let r=n.indexOf(10,t)+1;if(r===0||n.subarray(t,r-1).toString("ascii")!==`${e} blob ${i}`||n[r+i]!==10)throw new Error("Invalid indexed receipt batch framing");a.set(e,n.subarray(r,r+i).toString("utf8")),t=r+i+1}if(t!==n.length)throw new Error("Unexpected indexed receipt batch data")}async function k(n,o,a,t,e,i={}){let r=I();r.GIT_NO_REPLACE_OBJECTS="1",e===void 0&&process.env.GIT_INDEX_FILE!==void 0&&(r.GIT_INDEX_FILE=b.resolve(process.env.GIT_INDEX_FILE));let s={cwd:n,env:r,windowsHide:!0,timeout:1e4,maxBuffer:t+256};try{let c=(await w("git",["rev-parse","--show-toplevel"],{...s,encoding:"utf8"})).stdout.trim(),[g,y]=await Promise.all([v(c),v(e??o)]),d=b.relative(g,e===void 0?y:b.resolve(e)).replaceAll("\\","/");if(E(d))return new Map;s.cwd=g;let m=new Map(a.map(f=>[`${d}/${f}`,f])),T=(await w("git",["ls-files","--stage","-z","--",`:(literal)${d}/`],{...s,encoding:"utf8"})).stdout,p=B(T,new Set(m.keys()));if(p.size===0)return new Map;let u=new Set(p.values()),$=(await _(["cat-file","--batch-check"],[...u],s)).toString("utf8"),l=new Map;for(let f of D($,u,t))S(await _(["cat-file","--batch"],f.map(h=>h.id),s),f,l);if(i.failOnReadError&&l.size!==u.size)throw new Error("Unable to read every indexed receipt blob");return new Map([...p].filter(([,f])=>l.has(f)).map(([f,h])=>[m.get(f),l.get(h)]))}catch(c){if(i.failOnReadError)throw c;return new Map}}export{k as readIndexedReceiptBlobs};
4
- //# sourceMappingURL=indexed-receipt-blobs-IEJ2QOW3.js.map
4
+ //# sourceMappingURL=indexed-receipt-blobs-I6RQGD6Y.js.map
@@ -0,0 +1,2 @@
1
+ import{A as u,B as v,C as w,k as e,l as f,m as g,n as h,o as i,p as j,q as k,r as l,s as m,t as n,u as o,v as p,w as q,x as r,y as s,z as t}from"./chunk-T56MB6SF.js";import"./chunk-BK2XAQVC.js";import"./chunk-IB7UB5TE.js";import{bb as a,cb as b,db as c,eb as d}from"./chunk-DSCFJTHB.js";import"./chunk-3OXQGGRD.js";import"./chunk-O4ZLEN4T.js";import"./chunk-XAWE4EAK.js";export{f as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,e as ITEM_REVISION_CONFLICT_CODE,u as assertExpectHashAdmissible,s as bindExpectedItemRevisions,c as bindItemRevisionScope,a as createItemRevisionScope,k as describeItemRevisionChanges,w as dispatchWithExpectedItemRevisions,p as enrichItemRevisionConflict,o as expectHashInvocationRewrittenError,v as expectHashRequiresMutationError,m as isItemRevisionConflict,l as itemRevisionConflictRowFields,d as itemRevisionScopeReceipt,t as itemRevisionUncheckedWarning,g as normalizeExpectedItemHash,h as parseExpectHashSpecs,i as readItemRevision,j as resolveExpectedItemRevisions,q as runWithBoundItemRevisionScope,b as runWithItemRevisionScope,n as throwFirstItemRevisionConflict,r as withExpectedItemRevisions};
2
+ //# sourceMappingURL=item-revision-UAZOBP2Q.js.map
@@ -0,0 +1,2 @@
1
+ import{i as a,j as b,k as c,l as d,m as e,n as f,o as g,p as h,q as i,r as j}from"./chunk-5BVZ32G7.js";import"./chunk-CERNIZLB.js";import"./chunk-TX2W6G37.js";import"./chunk-BWAXA6S4.js";import"./chunk-5Z6LWFDL.js";import"./chunk-UJMQP2HP.js";import"./chunk-QQHMNUZT.js";import"./chunk-6T2V3UIK.js";import"./chunk-ODMJ3HIB.js";import"./chunk-7RCI7AAA.js";import"./chunk-AQ5UHHQS.js";import"./chunk-5S6RT5LX.js";import"./chunk-T56MB6SF.js";import"./chunk-BK2XAQVC.js";import"./chunk-IB7UB5TE.js";import"./chunk-DSCFJTHB.js";import"./chunk-3OXQGGRD.js";import"./chunk-SPPHDVZE.js";import"./chunk-RSAN2YUU.js";import"./chunk-VS565KBX.js";import"./chunk-O4ZLEN4T.js";import"./chunk-XAWE4EAK.js";export{h as _testOnlyItemTransaction,j as abandonItemTransaction,f as buildItemCompletionMutations,g as commitItemCompletion,e as commitItemMutations,b as listUpsertKeyCandidates,c as loadGuardedRuntimeSchema,d as previewItemMutations,i as readItemTransaction,a as resolveTransactionSchema};
2
+ //# sourceMappingURL=item-transaction-N5F4LXYV.js.map
@@ -0,0 +1,2 @@
1
+ import{f as E,k as N}from"./chunk-QQHMNUZT.js";import{Ca as y,Ia as C,kb as R,nb as A}from"./chunk-5S6RT5LX.js";import"./chunk-DSCFJTHB.js";import{Na as g,Rb as _,Ui as O,Yd as h,Zd as w,de as T}from"./chunk-3OXQGGRD.js";import{C as f}from"./chunk-O4ZLEN4T.js";import"./chunk-XAWE4EAK.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="d19ff816-7570-5e8a-a4de-ad2ca48f0df0")}catch{}})();function b(t,o,r,a=!1){let d=[...r].map(n=>({candidate:n,distance:_(o,n,3)})).filter(n=>n.distance!==null).sort((n,i)=>n.distance-i.distance||n.candidate.localeCompare(i.candidate))[0]?.candidate,s=a?`Put mutation fields under options (options.${o}).`:d?`Did you mean "${d}"?`:"Use the declared command options or the field option for registered item fields.";throw new f(`Unknown ${t} ${a?"argument":"option"} "${o}". ${s} No changes were made.`,2,{code:"invalid_argument_value",reason:"unknown_mutation_option",changed:!1,field:o,required:s,nextSteps:[s]})}async function j(t,o,r,a,d){if(E(o))return;let s=t==="create"?R:A,n=(t==="create"?y:C).map(({flag:e})=>e.slice(2).replace(/-([a-z])/gu,(m,v)=>v.toUpperCase())),i=new Set([...s.flatMap(e=>[e.target,...e.keys]),...n]),l=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor"];for(let e of["author","message","force","fullChangedFields","idOnly",...l])i.add(e);let S=new Set(["action","options","path","cwd","author","force","noExtensions","no_extensions","fullChangedFields","idOnly",...l,...d,...t==="update"?["id"]:[]]);for(let e of Object.keys(o))S.has(e)||b(t,e,i,i.has(e));let u=o.options;if(u!==void 0&&!N(u))throw new f("Mutation options must be an object. No changes were made.",2,{code:"invalid_argument_value",changed:!1});let c=[...new Set([...Object.keys(u??{}),...Object.keys(r)])].filter(e=>!i.has(e));if(c.length===0)return;let p=h((await O(g(process.cwd(),a))).schema).command_to_fields.get(t)??[];for(let e of p)i.add(w(e));for(let e of c)p.some(m=>T({[e]:!0},m)===!0)||b(t,e,i)}export{j as assertNativeMutationOptions};
2
+ //# sourceMappingURL=mutation-admission-QZQI2NN5.js.map
@@ -1,4 +1,4 @@
1
- import{a as de}from"./chunk-JRXD7SIL.js";import"./chunk-DEZPZOQ7.js";import{b as g,c as I,d as D}from"./chunk-3A4NVHYS.js";import{L as ne,P as ie,U as ae,n as te,u as A,w as oe}from"./chunk-K46GDAKX.js";import{Kc as W,Mc as X,Oc as Y,Qa as Q,Qb as V,Rc as Z,Sc as ee,Uc as re,Vc as se,Wc as le,ba as J,yc as K}from"./chunk-3ZQQVJT2.js";import"./chunk-DAZFCSDV.js";import{Ag as P,Bg as z,Cg as H,ig as y,lg as s,ng as l,sa as T,ta as R,tg as G,ug as L,vg as M,wg as $,xg as N,yg as U,zg as B}from"./chunk-ZNWDYDFF.js";import"./chunk-SPPHDVZE.js";import"./chunk-IB7UB5TE.js";import{Kh as v,Ma as C,Nh as f,Oh as m,Pi as q,oh as _,qd as k,y as E,yh as j,z as O}from"./chunk-BFZUJ5QP.js";import{A as c,C as u}from"./chunk-J3JM36EH.js";import"./chunk-XAWE4EAK.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]="69ca287f-eeb9-5e65-a3ba-be47ab223c04")}catch{}})();async function fe(e,t){let o=y(t),i=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(d=>d===!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=B(e),r=await V(a&&e.full!==!0&&e.provenance!==!0?{...n,raw:!0,compact:!0}:n,o);a?$(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>","Inclusive lower time bound (ISO or relative)").option("--to <value>","Exclusive upper time bound (ISO or relative)").option("--limit <n>","Maximum activity rows").option("--after <cursor>","Continue a fixed-window page").option("--unbounded","Return every matching row").option("--compact","Show compact event rows").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 provenance counts").option("--harness <value>","Filter by harness (repeatable)",s).option("--agent-instance <value>","Filter by agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter exact provenance values (repeatable)",s).option("--stream [mode]","Emit line-delimited JSON rows (requires --json): 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]="a63ccc7d-cf2a-590e-875e-050bf56f56d0")}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 S(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){j[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"?S("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"?T(i):R(i);!o.effectiveGlobal.quiet&&a.length>0&&v(`${a}
1
+ import{a as de}from"./chunk-7PGNAHNW.js";import"./chunk-DEZPZOQ7.js";import{b as g,c as I,d as D}from"./chunk-2GW662DP.js";import{L as ne,P as ie,U as ae,n as te,u as A,w as oe}from"./chunk-BWAXA6S4.js";import{Bc as W,Dc as X,Fc as Y,Ha as Q,Hb as V,Ic as Z,Jc as ee,Lc as re,Mc as se,Nc as le,U as J,pc as K}from"./chunk-7RCI7AAA.js";import"./chunk-AQ5UHHQS.js";import{Ac as U,Bc as B,Cc as P,Dc as z,Ec as H,kc as y,nc as s,pc as l,vc as G,wc as L,xc as M,yc as $,zc as N}from"./chunk-5S6RT5LX.js";import"./chunk-T56MB6SF.js";import"./chunk-BK2XAQVC.js";import"./chunk-IB7UB5TE.js";import{ta as T,ua as R}from"./chunk-DSCFJTHB.js";import{Dh as j,Na as C,Ph as v,Sh as f,Th as m,Ui as q,td as k,th as _,y as E,z as O}from"./chunk-3OXQGGRD.js";import"./chunk-SPPHDVZE.js";import{A as c,C as u}from"./chunk-O4ZLEN4T.js";import"./chunk-XAWE4EAK.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]="69ca287f-eeb9-5e65-a3ba-be47ab223c04")}catch{}})();async function fe(e,t){let o=y(t),i=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(d=>d===!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=B(e),r=await V(a&&e.full!==!0&&e.provenance!==!0?{...n,raw:!0,compact:!0}:n,o);a?$(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>","Inclusive lower time bound (ISO or relative)").option("--to <value>","Exclusive upper time bound (ISO or relative)").option("--limit <n>","Maximum activity rows").option("--after <cursor>","Continue a fixed-window page").option("--unbounded","Return every matching row").option("--compact","Show compact event rows").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 provenance counts").option("--harness <value>","Filter by harness (repeatable)",s).option("--agent-instance <value>","Filter by agent instance (repeatable)",s).option("--provenance-filter <dimension=value>","Filter exact provenance values (repeatable)",s).option("--stream [mode]","Emit line-delimited JSON rows (requires --json): 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]="a63ccc7d-cf2a-590e-875e-050bf56f56d0")}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 S(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){j[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"?S("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"?T(i):R(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 q(C(process.cwd(),o.path)).then(me=>me.ux.deprecation_hints)&&m(O(e.aliasContract));let a=_("list",e.options),n=G(a),r=xe(e,n),{effectiveName:d,effectiveStatus:h,effectiveDependencyBlocked:p,effectiveExcludeTerminal:w}=r;he(n,e.name),Object.assign(n,{projectionCommand:d}),w&&(n.excludeTerminal=!0),n.dependencyBlocked=p;let x=ge(a,o),pe=await J(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(),d=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&&d!==void 0&&(o=d.name,i=r,a=d.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:d,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>","Query next_cursor; output_cursor uses --output-cursor").option("--no-truncate","Disable default token cap; explicit --limit and --output-budget apply").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","Brief rows: id, status, type, title and leading sort field (priority by default; excludes --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:d,options:w,actionCommand:x,aliasContract:h})}),l(p,"--tags <value>","Alias for --tag"),l(p,"--assignee_filter <value>","Alias for --assignee-filter"),l(p,"--tree_depth <n>","Alias for --tree-depth"),l(p,"--token_budget <n>","Alias for --token-budget"),l(p,"--filter-estimate-missing","Alias for --filter-estimates-missing")}async function _e(e,t){let o=y(t),i=Date.now(),a=await te(L(e),o);f(a,o),o.profile&&m(`profile:command=aggregate took_ms=${Date.now()-i}`)}async function Se(e,t){let o=y(t),i=Date.now(),a=z(_("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 d=I([...n.high_level,...n.low_level,...n.blocked_fallback]);!o.quiet&&d.length>0&&v(`${d}
@@ -8,4 +8,4 @@ import{a as de}from"./chunk-JRXD7SIL.js";import"./chunk-DEZPZOQ7.js";import{b as
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,integrity:a.integrity,...a.verified_streams===void 0?{}:{verified_streams:a.verified_streams},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,integrity:e.integrity,...e.verified_streams===void 0?{}:{verified_streams:e.verified_streams},...e.provenance_summary===void 0?{}:{provenance_summary:e.provenance_summary}})}async function Te(e,t){let o=y(t),i=Date.now(),a=Oe(e,o.path);if(e.follow===!0){await Ce(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 Re(e,t,o,i,a){let n=y(a),r=Date.now(),d=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(d,n),n.profile&&m(`profile:command=graph took_ms=${Date.now()-r}`)}function At(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");l(n,"--include_unparented","Alias for --include-unparented"),l(n,"--assignee_filter <value>","Alias for --assignee-filter"),n.action(_e)}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>","Query next_cursor; output_cursor uses --output-cursor").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>","Complete JSON/TOON response token ceiling").option("--no-extension-health","Omit the installed extension health summary").option("--no-tags","Omit tag arrays from context focus rows");l(n,"--assignee_filter <value>","Alias for --assignee-filter"),l(n,"--max-items <n>","Alias for --limit"),l(n,"--explain_ranking","Alias for --explain-ranking"),l(n,"--token_budget <n>","Alias for --token-budget"),n.action(Se)}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");l(n,"--assignee_filter <value>","Alias for --assignee-filter"),l(n,"--blocked_limit <n>","Alias for --blocked-limit"),l(n,"--ready_only","Alias for --ready-only"),l(n,"--explain_ranking","Alias for --explain-ranking"),l(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>","Query next_cursor; output_cursor uses --output-cursor");ue(n),n.action(Ae),l(n,"--tags <value>","Alias for --tag"),l(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>","brief|standard|deep|full (default: standard)").option("--full","Full details and children for any type; excludes --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);l(n,"--tree_depth <n>","Alias for --tree-depth"),l(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; keeps order").option("--order <value>","oldest_first|newest_first").option("--compact","Summary (default newest_first)").option("--full","Patches (default oldest_first)").option("--provenance","Authors (default newest_first)").option("--provenance-summary","Count provenance completeness").option("--harness <value>","Harness (repeatable)",s).option("--agent-instance <value>","Instance (repeatable)",s).option("--provenance-filter <dimension=value>","Provenance (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("Read history.").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>","Cursors: batch trailer (default) or per-row").option("--full","Include each complete authoritative history entry").option("--verify","Verify selected authoritative history chains").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","Follow committed events as NDJSON").option("--interval-ms <n>","Empty-read delay while following (minimum: 10ms; default: 250ms)").description("Read mutation events as NDJSON with resumable cursors.").action(Te),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(Re)}var Dt={resolveReadCommandOutputFormat:S,parseListFormat:ce};export{Dt as _testOnlyRegisterListQuery,At as registerListQueryCommands};
11
- //# sourceMappingURL=register-list-query-NZTK3AXA.js.map
11
+ //# sourceMappingURL=register-list-query-P3NOKQUA.js.map