@unbrained/pm-cli 2026.11.21 → 2026.11.22

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 (203) hide show
  1. package/.agents/skills/pm-developer/SKILL.md +1 -1
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/dist/cli/register-history-maintenance.js +2 -2
  4. package/dist/cli-bundle/bundle-manifest.json +1 -1
  5. package/dist/cli-bundle/chunks/chunk-3W47ZZ5T.js +9 -0
  6. package/dist/cli-bundle/chunks/{chunk-PJXKA4QU.js → chunk-4TB5D6HL.js} +37 -37
  7. package/dist/cli-bundle/chunks/{chunk-WELSVDPU.js → chunk-5ZMVLWE3.js} +2 -2
  8. package/dist/cli-bundle/chunks/chunk-6BBDEIKC.js +33 -0
  9. package/dist/cli-bundle/chunks/{chunk-JVGRFU5H.js → chunk-AR4NP5HI.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-XHJ3H5PL.js → chunk-B4PPFOPY.js} +3 -3
  11. package/dist/cli-bundle/chunks/{chunk-5647LU3A.js → chunk-B76TFRO2.js} +47 -45
  12. package/dist/cli-bundle/chunks/{chunk-YJEBK7HU.js → chunk-CAR2L5NW.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-D6ILFXZY.js → chunk-EIGUKEV6.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-XWHJIRNV.js → chunk-GTPCAJMZ.js} +2 -2
  15. package/dist/cli-bundle/chunks/chunk-GYP24M7W.js +2 -0
  16. package/dist/cli-bundle/chunks/{chunk-CASX6SFI.js → chunk-HC2OPETM.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-NCFCBKIP.js → chunk-HKUV74K3.js} +2 -2
  18. package/dist/cli-bundle/chunks/chunk-HXHYDO2R.js +115 -0
  19. package/dist/cli-bundle/chunks/{chunk-S6HB3WL2.js → chunk-J2LABXBL.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-BKSVHOWI.js → chunk-J52BEBSS.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-NT5AKFE5.js → chunk-OJTMGDON.js} +31 -31
  22. package/dist/cli-bundle/chunks/{chunk-SRVTCYAU.js → chunk-TC6XLIYO.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-AHQB7W2H.js → chunk-U7EL3AYA.js} +2 -2
  24. package/dist/cli-bundle/chunks/chunk-VQFWW4EF.js +6 -0
  25. package/dist/cli-bundle/chunks/{chunk-CIKGG34F.js → chunk-X6MIWTTT.js} +2 -2
  26. package/dist/cli-bundle/chunks/chunk-XC5Q2ZV7.js +2 -0
  27. package/dist/cli-bundle/chunks/{chunk-RMIRNYRG.js → chunk-XFHPKXAE.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-6QLEXRUG.js → chunk-YHVLVSEZ.js} +2 -2
  29. package/dist/cli-bundle/chunks/{item-revision-R5SZPJZ5.js → item-revision-4QBMZXKX.js} +2 -2
  30. package/dist/cli-bundle/chunks/item-transaction-QY3PUHEI.js +2 -0
  31. package/dist/cli-bundle/chunks/{mutation-actor-3TG636XG.js → mutation-actor-FWLYWJ37.js} +2 -2
  32. package/dist/cli-bundle/chunks/{mutation-admission-LICSDNNO.js → mutation-admission-7ZDCK3G2.js} +2 -2
  33. package/dist/cli-bundle/chunks/{register-list-query-SPGPS3OS.js → register-list-query-RR5KACJ3.js} +2 -2
  34. package/dist/cli-bundle/chunks/{register-mutation-WWVECKFQ.js → register-mutation-57AJQWFV.js} +2 -2
  35. package/dist/cli-bundle/chunks/{register-operations-L6HFJNWD.js → register-operations-RKWST7CU.js} +2 -2
  36. package/dist/cli-bundle/chunks/{register-setup-K7UFG5TD.js → register-setup-CMI23PC5.js} +2 -2
  37. package/dist/cli-bundle/chunks/{stage-57KH3KAC.js → stage-4KDVXC5Z.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/{chunk-YOAYY3HE.js → chunk-2ZD7275J.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-532WZV65.js → chunk-324AHXJO.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/chunk-3XSWH6QC.js +91 -0
  41. package/dist/cli-bundle/focused-chunks/{chunk-QGKLRXP7.js → chunk-4JZITIJB.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/{chunk-CU2BRAOX.js → chunk-4KTFKSS3.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/chunk-5C5TK3ET.js +78 -0
  44. package/dist/cli-bundle/focused-chunks/chunk-AKJYOZZP.js +2 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-MKM5NKD7.js → chunk-BRZV7BFV.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-RPE6IX26.js → chunk-HDEKFSOK.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-LNHUE4VV.js → chunk-IWOXAUDU.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-J63D6QST.js → chunk-ML3JHCC6.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-JMQJBZQ5.js → chunk-OPGOOP25.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/{chunk-XCJSHNXK.js → chunk-RE7ZWT7D.js} +3 -3
  51. package/dist/cli-bundle/focused-chunks/chunk-RKQNVYGF.js +3 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-WXMI4AV5.js → chunk-RQ252B6V.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-7A4QWNZX.js → chunk-URGHTTT3.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-IQK5NPMG.js → chunk-USPYKWQG.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/chunk-UWS3FC4D.js +102 -0
  56. package/dist/cli-bundle/focused-chunks/chunk-UXQGFGAT.js +44 -0
  57. package/dist/cli-bundle/focused-chunks/{chunk-UOC6257J.js → chunk-WZWXGDYY.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-NP72ZDXE.js → chunk-YKSLZPLT.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/chunk-ZWJTY4ID.js +2 -0
  60. package/dist/cli-bundle/focused-chunks/{item-revision-3V3UIP5X.js → item-revision-2O6MLPEX.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/item-transaction-GLACUTPL.js +2 -0
  62. package/dist/cli-bundle/focused-chunks/{mutation-actor-62HKR5IO.js → mutation-actor-TCYDPUGG.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{mutation-admission-X4PF2SG3.js → mutation-admission-LY73EJWM.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/{stage-O7T7CXBB.js → stage-DQ7RQQ52.js} +2 -2
  65. package/dist/cli-bundle/main.js +2 -2
  66. package/dist/cli-bundle/sdk-authoring.js +1 -1
  67. package/dist/cli-bundle/sdk-contracts.js +2 -2
  68. package/dist/cli-bundle/sdk-core.js +1 -1
  69. package/dist/cli-bundle/sdk-governance.js +1 -1
  70. package/dist/cli-bundle/sdk-graph.js +1 -1
  71. package/dist/cli-bundle/sdk-merge.js +70 -58
  72. package/dist/cli-bundle/sdk-query.js +1 -1
  73. package/dist/cli-bundle/sdk-runtime.js +1 -1
  74. package/dist/cli-bundle/sdk-testing.js +1 -1
  75. package/dist/cli-bundle/sdk.js +11 -11
  76. package/dist/core/diagnostics/remediation.js +1 -1
  77. package/dist/core/fs/atomic-create.js +1 -1
  78. package/dist/core/fs/file-glob.js +1 -1
  79. package/dist/core/history/bridge.js +2 -0
  80. package/dist/core/history/drift-scan.js +1 -1
  81. package/dist/core/history/history-rewrite.js +1 -1
  82. package/dist/core/history/history.d.ts +12 -0
  83. package/dist/core/history/history.js +2 -2
  84. package/dist/core/history/projection.js +1 -1
  85. package/dist/core/history/read.d.ts +9 -0
  86. package/dist/core/history/read.js +1 -1
  87. package/dist/core/history/replay.d.ts +46 -5
  88. package/dist/core/history/replay.js +2 -2
  89. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  90. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  91. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  92. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  93. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +2 -2
  94. package/dist/sdk/completion/fish.js +3 -2
  95. package/dist/sdk/completion/zsh.js +3 -2
  96. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  97. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  98. package/dist/sdk/governance/health/history-drift-remedies.js +2 -0
  99. package/dist/sdk/governance/health.js +2 -2
  100. package/dist/sdk/history/append-only-repair.d.ts +30 -0
  101. package/dist/sdk/history/append-only-repair.js +6 -0
  102. package/dist/sdk/history/maintenance.d.ts +8 -2
  103. package/dist/sdk/history/maintenance.js +1 -1
  104. package/dist/sdk/history/reanchor-refusal.js +2 -0
  105. package/dist/sdk/history/reseed.d.ts +15 -0
  106. package/dist/sdk/history/reseed.js +2 -0
  107. package/dist/sdk/history/salvage.d.ts +19 -8
  108. package/dist/sdk/history/salvage.js +5 -3
  109. package/dist/sdk/history-compact.js +1 -1
  110. package/dist/sdk/history-redact.js +1 -1
  111. package/dist/sdk/history-repair.d.ts +8 -2
  112. package/dist/sdk/history-repair.js +1 -1
  113. package/dist/sdk/index.d.ts +1 -1
  114. package/dist/sdk/item-transaction.d.ts +33 -1
  115. package/dist/sdk/item-transaction.js +1 -1
  116. package/dist/sdk/lifecycle/restore.js +1 -1
  117. package/dist/sdk/merge/three-way.d.ts +22 -3
  118. package/dist/sdk/merge/three-way.js +8 -2
  119. package/dist/sdk/public-surface.json +1 -1
  120. package/dist/sdk/runtime/actions.js +1 -1
  121. package/dist/sdk/runtime-input.d.ts +6 -2
  122. package/dist/sdk/runtime-input.js +1 -1
  123. package/dist/sdk/runtime-primitives.d.ts +1 -1
  124. package/dist/sdk/runtime-primitives.js +1 -1
  125. package/dist/sdk/runtime.d.ts +7 -0
  126. package/dist/sdk/runtime.js +1 -1
  127. package/dist/sdk/structured-mutations.d.ts +5 -5
  128. package/dist/sdk/structured-mutations.js +1 -1
  129. package/dist/sdk/transactions/item-finalization.js +2 -0
  130. package/dist/types.d.ts +20 -0
  131. package/dist/types.js +1 -1
  132. package/docs/AGENT_GUIDE.md +1 -1
  133. package/docs/AGENT_RUNTIME_PRIMITIVES.md +1 -1
  134. package/docs/COMMANDS.md +6 -2
  135. package/docs/HISTORY_RECOVERY.md +229 -5
  136. package/docs/README.md +2 -2
  137. package/docs/SDK.md +103 -4
  138. package/docs/SDK_CONTEXT_COORDINATION.md +3 -2
  139. package/marketplace.json +1 -1
  140. package/node_modules/tar/package.json +2 -3
  141. package/package.json +30 -2
  142. package/packages/pm-beads/package.json +1 -1
  143. package/packages/pm-calendar/package.json +1 -1
  144. package/packages/pm-command-kit/package.json +1 -1
  145. package/packages/pm-digital-twin/package.json +1 -1
  146. package/packages/pm-governance-audit/package.json +1 -1
  147. package/packages/pm-guide-shell/package.json +1 -1
  148. package/packages/pm-kanban/package.json +1 -1
  149. package/packages/pm-lifecycle-hooks/package.json +1 -1
  150. package/packages/pm-linked-test-adapters/package.json +1 -1
  151. package/packages/pm-search-advanced/package.json +1 -1
  152. package/packages/pm-templates/package.json +1 -1
  153. package/packages/pm-todos/package.json +1 -1
  154. package/packages/pm-vcs/package.json +1 -1
  155. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  156. package/plugins/pm-claude/package.json +1 -1
  157. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  158. package/plugins/pm-codex/package.json +1 -1
  159. package/plugins/pm-codex/plugin.json +1 -1
  160. package/runtime-dependencies.json +1 -1
  161. package/dist/cli-bundle/chunks/chunk-2DXRTIC6.js +0 -21
  162. package/dist/cli-bundle/chunks/chunk-IUIOTAF6.js +0 -9
  163. package/dist/cli-bundle/chunks/chunk-KVBIMFUG.js +0 -6
  164. package/dist/cli-bundle/chunks/chunk-RULHZRFN.js +0 -2
  165. package/dist/cli-bundle/chunks/chunk-SA4BNP3Q.js +0 -2
  166. package/dist/cli-bundle/chunks/chunk-YKJKQ7DM.js +0 -115
  167. package/dist/cli-bundle/chunks/item-transaction-7DFCG73I.js +0 -2
  168. package/dist/cli-bundle/focused-chunks/chunk-CWWKRI5P.js +0 -2
  169. package/dist/cli-bundle/focused-chunks/chunk-HGFNL5XI.js +0 -2
  170. package/dist/cli-bundle/focused-chunks/chunk-OSLQD5VH.js +0 -102
  171. package/dist/cli-bundle/focused-chunks/chunk-QSJW6NSQ.js +0 -66
  172. package/dist/cli-bundle/focused-chunks/chunk-SRDQSA6M.js +0 -91
  173. package/dist/cli-bundle/focused-chunks/chunk-URJ2E6AS.js +0 -3
  174. package/dist/cli-bundle/focused-chunks/chunk-XQQSSKJI.js +0 -44
  175. package/dist/cli-bundle/focused-chunks/item-transaction-HLBW7B3J.js +0 -2
  176. package/dist/sdk/agent/refusal-closure.js +0 -2
  177. package/dist/sdk/agent/refusal-reachability.js +0 -4
  178. package/dist/sdk/agent/task-transcript-contracts.js +0 -2
  179. package/dist/sdk/agent/tracker-preflight-contracts.js +0 -2
  180. package/dist/sdk/authoring.js +0 -2
  181. package/dist/sdk/compose.js +0 -2
  182. package/dist/sdk/contracts.js +0 -2
  183. package/dist/sdk/core-governance.js +0 -2
  184. package/dist/sdk/core.js +0 -2
  185. package/dist/sdk/corpus-shape.js +0 -2
  186. package/dist/sdk/define.js +0 -2
  187. package/dist/sdk/environment/agent-environment.js +0 -2
  188. package/dist/sdk/governance/artifact-ledgers.js +0 -2
  189. package/dist/sdk/governance/coverage-assurance.js +0 -2
  190. package/dist/sdk/governance/reliability.js +0 -2
  191. package/dist/sdk/governance.js +0 -2
  192. package/dist/sdk/graph/adapter.js +0 -2
  193. package/dist/sdk/graph/conformance.js +0 -2
  194. package/dist/sdk/graph/index.js +0 -2
  195. package/dist/sdk/graph.js +0 -2
  196. package/dist/sdk/index.js +0 -2
  197. package/dist/sdk/query.js +0 -2
  198. package/dist/sdk/relationship-migration.js +0 -2
  199. package/dist/sdk/testing.js +0 -8
  200. package/dist/sdk/workspace-recipe.js +0 -2
  201. package/docs/AGENT_PROVENANCE_ADR.md +0 -206
  202. package/docs/DEFECT_RECURRENCE.md +0 -257
  203. package/docs/PERFORMANCE.md +0 -204
@@ -1,4 +1,4 @@
1
- import{Ba as at,Bc as dt,Da as st,Rc as _t,Ta as ct,Tc as ut,Va as B,Xb as ee,a as j,ae as ft,b as A,d as p,de as F,fa as et,ga as tt,ge as mt,ha as rt,ia as nt,je as pt,lb as lt,ne as ht,oa as ot,oj as yt,pe as V,sj as gt,ta as it,th as oe,uh as ie,vc as te,xc as re,yc as ne,zd as z}from"./chunk-YKJKQ7DM.js";import{A as v,C as S,E as Qe,F as le,H as N,I as Ze,J as Oe,K as Z,v as Xe,y as _,z as Q}from"./chunk-KQIZ34SF.js";import wt from"node:fs/promises";import G from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="af606b47-d071-5724-b1e7-de4e1e5d7385")}catch{}})();var R="_workspace";function W(e){return G.join(e,"history",`${R}.jsonl`)}function Ce(e,t){return{metadata:{id:R,title:"Workspace state",description:"Audited singleton workspace document state.",type:"Chore",status:"open",priority:2,tags:["workspace-history"],created_at:t,updated_at:t,documents:e},body:""}}function U(e,t=e.length){let r=mt();for(let n of e.slice(0,t))r=ht(r,n.patch).document;return pt(r)}function K(e){return"documents"in e.metadata&&typeof e.metadata.documents=="object"&&e.metadata.documents!==null&&!Array.isArray(e.metadata.documents)?e.metadata.documents:{}}function J(e){throw new S(`Workspace history verification failed: ${e.join(", ")}`,v.CONFLICT,{code:"workspace_history_chain_invalid",reason:"workspace_history_chain_verification_failed",verification_errors:[...e],required:"Repair the _workspace history chain before reading, reconciling, restoring, or appending audited singleton state.",why:"Continuing against an unverifiable append-only stream could hide or compound workspace state corruption.",examples:["pm history _workspace --verify --json","pm validate --check-history-drift --fix-hints --json"],nextSteps:["Inspect the exact verification_errors and preserve the corrupt stream as evidence.","Use the history-drift remediation returned by validate before retrying the refused operation."],recovery:{recovery_mode:"compact",next_best_command:"pm history _workspace --verify --json"}})}function de(e,t){let r=G.resolve(t),n=G.relative(e,r).replaceAll("\\","/");if(n.length===0||n===".."||n.startsWith("../")||G.isAbsolute(n))throw new TypeError("Workspace history document path must stay inside the tracker root");return{documentPath:n,absolutePath:r}}async function Jn(e){let t=await F(W(e),R),r=V(t);r.ok||J(r.errors);let n=K(t.length===0?Q:U(t)),i=[],s=[],a=[],l=[];for(let f of Object.keys(n).sort()){let u;try{let w=de(e,G.resolve(e,f));if(u=await N(w.absolutePath),u===null){a.push(f);continue}let k=JSON.parse(u);(j(k)===j(n[f])?i:s).push(f)}catch{l.push(f)}}return{ok:s.length===0&&a.length===0&&l.length===0,document_count:Object.keys(n).length,matching_documents:i,mismatched_documents:s,missing_documents:a,unreadable_documents:l}}async function kt(e){let t=W(e.pmRoot),r=await F(t,R),n=V(r);n.ok||J(n.errors);let i=e.idempotencyKey===void 0?void 0:r.find(k=>k.op===`${e.op}:${e.idempotencyKey}`);if(i)return{entry:i,historyPath:t};let s=ee(),a=r.length===0?Q:U(r),l=K(a),f=l[e.documentPath];if(f!==void 0&&j(f)!==j(e.before))throw new S(`Workspace history state for "${e.documentPath}" changed outside the audited mutation path.`,v.CONFLICT,{code:"workspace_history_state_conflict",reason:"out_of_band_workspace_state",required:"Reconcile the singleton document with its matching _workspace history state before retrying the mutation.",why:"Accepting the write would make the append-only audit stream describe a state that was not actually observed.",examples:["pm history _workspace --verify","pm validate --check-history-drift --fix-hints"],nextSteps:["Review the version-control change that altered the singleton and preserve the intended document plus its matching workspace history.","Rerun the original mutation only after the on-disk singleton agrees with the latest audited workspace state."],recovery:{recovery_mode:"compact",next_best_command:"pm history _workspace --verify"}});let u=Ce({...l,[e.documentPath]:e.after},r.length===0?s:a.metadata.created_at),w=oe({nowIso:s,author:e.author,op:e.idempotencyKey===void 0?e.op:`${e.op}:${e.idempotencyKey}`,before:a,after:u,message:e.message});return await ie(t,w),{entry:w,historyPath:t}}async function Yn(e){let t=await z(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{return await kt(e)}finally{await t()}}async function Xn(e){let t=await z(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{let r=W(e.pmRoot),n=await F(r,R),i=V(n);i.ok||J(i.errors);let s=n.length===0?Q:U(n),a=oe({nowIso:ee(),author:e.author,op:e.op,before:s,after:s,message:e.message,context:e.context});return await ie(r,a),{entry:a,historyPath:r}}finally{await t()}}async function bt(e,t){if(t===e.raw)return!1;let r=t===null?null:JSON.parse(t),n=JSON.parse(e.raw);await Z(e.filePath,e.raw);try{(t!==null||e.recordCreation!==!1)&&await kt({pmRoot:e.pmRoot,documentPath:G.relative(e.pmRoot,e.filePath).replaceAll("\\","/"),before:r,after:n,op:e.op,idempotencyKey:e.idempotencyKey,author:e.author,lockTtlSeconds:e.lockTtlSeconds,lockWaitMs:e.lockWaitMs,message:e.message})}catch(i){throw t===null?await wt.rm(e.filePath,{force:!0}):await Z(e.filePath,t),i}return!0}async function vt(e){let{documentPath:t}=de(e.pmRoot,e.filePath),r=await z(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{let n=await N(e.filePath);if(e.dryRun===!0||e.idempotencyKey!==void 0){let s=await F(W(e.pmRoot),R),a=V(s);a.ok||J(a.errors);let l=K(s.length===0?Q:U(s))[t];if(l!==void 0&&j(l)!==j(n===null?null:JSON.parse(n)))throw new S(`Workspace history state for "${t}" changed outside the audited mutation path.`,v.CONFLICT,{code:"workspace_history_state_conflict"});if(e.idempotencyKey!==void 0&&s.some(f=>f.op===`${e.op}:${e.idempotencyKey}`))return{changed:!1,result:void 0,replayed:!0}}let i=await e.mutate(n);return JSON.parse(i.raw),e.dryRun===!0?{changed:n!==i.raw,result:i.result}:{changed:await bt({...e,raw:i.raw},n),result:i.result}}finally{await r()}}async function Qn(e){let t=await z(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{return await bt(e,await N(e.filePath))}finally{await t()}}async function Zn(e){let t=e.authorizationDecision.trim();if(!t)throw new TypeError("Workspace history reconciliation requires an authorization decision");let r=await z(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{let{documentPath:n,absolutePath:i}=de(e.pmRoot,e.filePath),s=W(e.pmRoot),a=await F(s,R),l=V(a);l.ok||J(l.errors);let f=U(a),u=K(f);if(!Object.hasOwn(u,n))throw new TypeError(`Workspace history does not govern document ${n}`);let w=await N(i);if(w===null)throw new TypeError(`Workspace history document is missing: ${n}`);let k=JSON.parse(w);if(j(u[n])===j(k))return{changed:!1,historyPath:s};let x=ee(),X=oe({nowIso:x,author:e.author,op:e.op,before:f,after:Ce({...u,[n]:k},f.metadata.created_at),message:e.message,context:{reason:"out_of_band_workspace_state_reconciliation",document_path:n,authorization_decision:t}});return await ie(s,X),{changed:!0,entry:X,historyPath:s}}finally{await r()}}async function eo(e){let t=await z(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{let{documentPath:r,absolutePath:n}=de(e.pmRoot,e.filePath),i=await F(W(e.pmRoot),R),s=V(i);if(s.ok||J(s.errors),!Number.isInteger(e.targetVersion)||e.targetVersion<1||e.targetVersion>i.length)throw new TypeError(`Invalid workspace history target version: ${String(e.targetVersion)}`);let a=K(U(i,e.targetVersion))[r];if(a===void 0)throw new TypeError(`Workspace history version ${e.targetVersion} does not contain ${r}`);let l=await N(n),f=`${JSON.stringify(a,null,2)}
1
+ import{Ad as z,Aj as yt,Ba as at,Cc as dt,Da as st,Ej as gt,Fh as oe,Gh as ie,Sc as _t,Ta as ct,Uc as ut,Va as B,Yb as ee,a as j,b as A,be as ft,d as p,fa as et,ga as tt,ge as F,ha as rt,ia as nt,lb as lt,ne as mt,oa as ot,qe as pt,ta as it,ue as ht,wc as te,we as V,yc as re,zc as ne}from"./chunk-HXHYDO2R.js";import{A as v,C as S,E as Qe,F as le,H as N,I as Ze,J as Oe,K as Z,v as Xe,y as _,z as Q}from"./chunk-KQIZ34SF.js";import wt from"node:fs/promises";import G from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="af606b47-d071-5724-b1e7-de4e1e5d7385")}catch{}})();var R="_workspace";function W(e){return G.join(e,"history",`${R}.jsonl`)}function Ce(e,t){return{metadata:{id:R,title:"Workspace state",description:"Audited singleton workspace document state.",type:"Chore",status:"open",priority:2,tags:["workspace-history"],created_at:t,updated_at:t,documents:e},body:""}}function U(e,t=e.length){let r=mt();for(let n of e.slice(0,t))r=ht(r,n.patch).document;return pt(r)}function K(e){return"documents"in e.metadata&&typeof e.metadata.documents=="object"&&e.metadata.documents!==null&&!Array.isArray(e.metadata.documents)?e.metadata.documents:{}}function J(e){throw new S(`Workspace history verification failed: ${e.join(", ")}`,v.CONFLICT,{code:"workspace_history_chain_invalid",reason:"workspace_history_chain_verification_failed",verification_errors:[...e],required:"Repair the _workspace history chain before reading, reconciling, restoring, or appending audited singleton state.",why:"Continuing against an unverifiable append-only stream could hide or compound workspace state corruption.",examples:["pm history _workspace --verify --json","pm validate --check-history-drift --fix-hints --json"],nextSteps:["Inspect the exact verification_errors and preserve the corrupt stream as evidence.","Use the history-drift remediation returned by validate before retrying the refused operation."],recovery:{recovery_mode:"compact",next_best_command:"pm history _workspace --verify --json"}})}function de(e,t){let r=G.resolve(t),n=G.relative(e,r).replaceAll("\\","/");if(n.length===0||n===".."||n.startsWith("../")||G.isAbsolute(n))throw new TypeError("Workspace history document path must stay inside the tracker root");return{documentPath:n,absolutePath:r}}async function Jn(e){let t=await F(W(e),R),r=V(t);r.ok||J(r.errors);let n=K(t.length===0?Q:U(t)),i=[],s=[],a=[],l=[];for(let f of Object.keys(n).sort()){let u;try{let w=de(e,G.resolve(e,f));if(u=await N(w.absolutePath),u===null){a.push(f);continue}let k=JSON.parse(u);(j(k)===j(n[f])?i:s).push(f)}catch{l.push(f)}}return{ok:s.length===0&&a.length===0&&l.length===0,document_count:Object.keys(n).length,matching_documents:i,mismatched_documents:s,missing_documents:a,unreadable_documents:l}}async function kt(e){let t=W(e.pmRoot),r=await F(t,R),n=V(r);n.ok||J(n.errors);let i=e.idempotencyKey===void 0?void 0:r.find(k=>k.op===`${e.op}:${e.idempotencyKey}`);if(i)return{entry:i,historyPath:t};let s=ee(),a=r.length===0?Q:U(r),l=K(a),f=l[e.documentPath];if(f!==void 0&&j(f)!==j(e.before))throw new S(`Workspace history state for "${e.documentPath}" changed outside the audited mutation path.`,v.CONFLICT,{code:"workspace_history_state_conflict",reason:"out_of_band_workspace_state",required:"Reconcile the singleton document with its matching _workspace history state before retrying the mutation.",why:"Accepting the write would make the append-only audit stream describe a state that was not actually observed.",examples:["pm history _workspace --verify","pm validate --check-history-drift --fix-hints"],nextSteps:["Review the version-control change that altered the singleton and preserve the intended document plus its matching workspace history.","Rerun the original mutation only after the on-disk singleton agrees with the latest audited workspace state."],recovery:{recovery_mode:"compact",next_best_command:"pm history _workspace --verify"}});let u=Ce({...l,[e.documentPath]:e.after},r.length===0?s:a.metadata.created_at),w=oe({nowIso:s,author:e.author,op:e.idempotencyKey===void 0?e.op:`${e.op}:${e.idempotencyKey}`,before:a,after:u,message:e.message});return await ie(t,w),{entry:w,historyPath:t}}async function Yn(e){let t=await z(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{return await kt(e)}finally{await t()}}async function Xn(e){let t=await z(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{let r=W(e.pmRoot),n=await F(r,R),i=V(n);i.ok||J(i.errors);let s=n.length===0?Q:U(n),a=oe({nowIso:ee(),author:e.author,op:e.op,before:s,after:s,message:e.message,context:e.context});return await ie(r,a),{entry:a,historyPath:r}}finally{await t()}}async function bt(e,t){if(t===e.raw)return!1;let r=t===null?null:JSON.parse(t),n=JSON.parse(e.raw);await Z(e.filePath,e.raw);try{(t!==null||e.recordCreation!==!1)&&await kt({pmRoot:e.pmRoot,documentPath:G.relative(e.pmRoot,e.filePath).replaceAll("\\","/"),before:r,after:n,op:e.op,idempotencyKey:e.idempotencyKey,author:e.author,lockTtlSeconds:e.lockTtlSeconds,lockWaitMs:e.lockWaitMs,message:e.message})}catch(i){throw t===null?await wt.rm(e.filePath,{force:!0}):await Z(e.filePath,t),i}return!0}async function vt(e){let{documentPath:t}=de(e.pmRoot,e.filePath),r=await z(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{let n=await N(e.filePath);if(e.dryRun===!0||e.idempotencyKey!==void 0){let s=await F(W(e.pmRoot),R),a=V(s);a.ok||J(a.errors);let l=K(s.length===0?Q:U(s))[t];if(l!==void 0&&j(l)!==j(n===null?null:JSON.parse(n)))throw new S(`Workspace history state for "${t}" changed outside the audited mutation path.`,v.CONFLICT,{code:"workspace_history_state_conflict"});if(e.idempotencyKey!==void 0&&s.some(f=>f.op===`${e.op}:${e.idempotencyKey}`))return{changed:!1,result:void 0,replayed:!0}}let i=await e.mutate(n);return JSON.parse(i.raw),e.dryRun===!0?{changed:n!==i.raw,result:i.result}:{changed:await bt({...e,raw:i.raw},n),result:i.result}}finally{await r()}}async function Qn(e){let t=await z(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{return await bt(e,await N(e.filePath))}finally{await t()}}async function Zn(e){let t=e.authorizationDecision.trim();if(!t)throw new TypeError("Workspace history reconciliation requires an authorization decision");let r=await z(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{let{documentPath:n,absolutePath:i}=de(e.pmRoot,e.filePath),s=W(e.pmRoot),a=await F(s,R),l=V(a);l.ok||J(l.errors);let f=U(a),u=K(f);if(!Object.hasOwn(u,n))throw new TypeError(`Workspace history does not govern document ${n}`);let w=await N(i);if(w===null)throw new TypeError(`Workspace history document is missing: ${n}`);let k=JSON.parse(w);if(j(u[n])===j(k))return{changed:!1,historyPath:s};let x=ee(),X=oe({nowIso:x,author:e.author,op:e.op,before:f,after:Ce({...u,[n]:k},f.metadata.created_at),message:e.message,context:{reason:"out_of_band_workspace_state_reconciliation",document_path:n,authorization_decision:t}});return await ie(s,X),{changed:!0,entry:X,historyPath:s}}finally{await r()}}async function eo(e){let t=await z(e.pmRoot,"workspace-history",e.lockTtlSeconds,e.author,!1,!1,e.lockWaitMs);try{let{documentPath:r,absolutePath:n}=de(e.pmRoot,e.filePath),i=await F(W(e.pmRoot),R),s=V(i);if(s.ok||J(s.errors),!Number.isInteger(e.targetVersion)||e.targetVersion<1||e.targetVersion>i.length)throw new TypeError(`Invalid workspace history target version: ${String(e.targetVersion)}`);let a=K(U(i,e.targetVersion))[r];if(a===void 0)throw new TypeError(`Workspace history version ${e.targetVersion} does not contain ${r}`);let l=await N(n),f=`${JSON.stringify(a,null,2)}
2
2
  `;if(l===f)return{document_path:r,restored_from_version:e.targetVersion,changed:!1};let u=U(i),w=ee(),k=oe({nowIso:w,author:e.author,op:e.op,before:u,after:Ce({...K(u),[r]:a},u.metadata.created_at),message:e.message,context:{reason:"workspace_state_restore",document_path:r,restored_from_version:e.targetVersion,replaced_out_of_band_state:!0}});await Z(n,f);try{await ie(W(e.pmRoot),k)}catch(x){throw l===null?await wt.rm(n,{force:!0}):await Z(n,l),x}return{document_path:r,restored_from_version:e.targetVersion,changed:!0}}finally{await 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]="78651211-fe4b-564e-a872-23bf25265243")}catch{}})();var I={ok:!1,path:[]};function Ie(e,t){return{ok:!1,path:[e,...t.path]}}var c=e=>typeof e=="string"?{ok:!0,value:e}:I,h=e=>typeof e=="boolean"?{ok:!0,value:e}:I;function g(e={}){return t=>typeof t!="number"||!Number.isFinite(t)||e.int&&(!Number.isInteger(t)||!Number.isSafeInteger(t))||e.positive&&t<=0||typeof e.min=="number"&&t<e.min||typeof e.max=="number"&&t>e.max?I:{ok:!0,value:t}}function y(...e){return t=>typeof t=="string"&&e.includes(t)?{ok:!0,value:t}:I}function d(e,t){return r=>{if(!Array.isArray(r)||t!==void 0&&r.length>t)return I;let n=[];for(let[i,s]of r.entries()){let a=e(s);if(!a.ok)return Ie(String(i),a);n.push(a.value)}return{ok:!0,value:n}}}function Pe(e,t){return r=>typeof r=="string"&&r.length>0&&r.length<=e&&r===r.trim()&&(t===void 0||t.test(r))?{ok:!0,value:r}:I}function o(e){return t=>t===void 0?{ok:!0,value:void 0}:e(t)}function _e(e){return t=>{if(typeof t!="object"||t===null||Array.isArray(t))return I;let r={};for(let[n,i]of Object.entries(t)){let s=e(i);if(!s.ok)return Ie(n,s);r[n]=s.value}return{ok:!0,value:r}}}function m(e){return t=>{if(typeof t!="object"||t===null||Array.isArray(t))return I;let r=t,n={};for(let[i,s]of Object.entries(e)){let a=s(r[i]);if(!a.ok)return Ie(i,a);a.value!==void 0&&(n[i]=a.value)}return{ok:!0,value:n}}}var fr=m({key:c,values:d(c),required:o(h),aliases:o(d(c)),description:o(c)}),mr=m({command:y("create","update"),option:c,required:o(h),visible:o(h),enabled:o(h)}),pr=m({name:c,description:o(c),default_status:o(c),execution_role:o(y("agent","human","gate")),folder:o(c),aliases:o(d(c)),required_create_fields:o(d(c)),required_create_repeatables:o(d(c)),options:o(d(fr)),command_option_policies:o(d(mr))}),hr=m({id:c,aliases:o(d(c)),roles:o(d(y(...et))),description:o(c),order:o(g())}),yr=m({key:c,metadata_key:o(c),front_matter_key:o(c),cli_flag:o(c),cli_aliases:o(d(c)),description:o(c),type:o(y(...tt)),commands:o(d(y(...rt))),repeatable:o(h),required:o(h),required_on_create:o(h),required_types:o(d(c)),allow_unset:o(h)}),gr=e=>{if(!Array.isArray(e)||e.length!==2)return I;let[t,r]=e;return typeof t!="string"||typeof r!="string"?I:{ok:!0,value:[t,r]}},wr=m({type:c,allowed_transitions:d(gr)}),kr=o(m({version:o(g({int:!0})),files:o(m({types:o(c),statuses:o(c),fields:o(c),workflows:o(c)})),statuses:o(d(hr)),fields:o(d(yr)),workflow:o(m({draft_status:o(c),open_status:o(c),in_progress_status:o(c),blocked_status:o(c),close_status:o(c),canceled_status:o(c)})),type_workflows:o(d(wr)),unknown_field_policy:o(y(...nt))})),br=o(m({preset:o(y(...ot)),ownership_enforcement:o(y("none","warn","strict")),create_mode_default:o(y("progressive","strict")),close_validation_default:o(y("off","warn","strict")),require_close_reason:o(h),parent_reference:o(y("warn","strict_error")),metadata_profile:o(y("core","strict","custom")),force_required_for_stale_lock:o(h),create_default_type:o(c),workflow_enforcement:o(y("off","warn","strict")),start_blocker_enforcement:o(y("off","warn","strict")),duplicate_detection_mode:o(y("off","advisory","strict")),duplicate_detection_threshold:o(g({min:0,max:1})),duplicate_detection_limit:o(g({int:!0,min:0,max:20}))})),vr=m({name:c,disabled:o(h),require_trusted:o(h),require_provenance:o(h),sandbox_profile:o(y("none","restricted","strict")),allowed_capabilities:o(d(c)),blocked_capabilities:o(d(c)),allowed_surfaces:o(d(c)),blocked_surfaces:o(d(c)),allowed_commands:o(d(c)),blocked_commands:o(d(c)),allowed_actions:o(d(c)),blocked_actions:o(d(c)),allowed_services:o(d(c)),blocked_services:o(d(c))}),Ae=y("block","warn"),Sr=e=>typeof e=="string"?Ae(e):m({global:o(Ae),project:o(Ae)})(e),xr=o(m({mode:o(y("off","warn","enforce")),trust_mode:o(y("off","warn","enforce")),pm_max_version_exceeded_mode:o(Sr),require_provenance:o(h),trusted_extensions:o(d(c)),default_sandbox_profile:o(y("none","restricted","strict")),allowed_extensions:o(d(c)),blocked_extensions:o(d(c)),allowed_capabilities:o(d(c)),blocked_capabilities:o(d(c)),allowed_surfaces:o(d(c)),blocked_surfaces:o(d(c)),allowed_commands:o(d(c)),blocked_commands:o(d(c)),allowed_actions:o(d(c)),blocked_actions:o(d(c)),allowed_services:o(d(c)),blocked_services:o(d(c)),extension_overrides:o(d(vr))})),$=Pe(128),Er=m({harness:Pe(128,/^[a-z0-9]+(?:-[a-z0-9]+)*$/u),environment_keys:o(d($,64)),model_environment_keys:o(d($,64)),session_environment_keys:o(d($,64)),provenance_environment_keys:o(_e(d($,64))),provenance_resolvers:o(_e(y("ai_agent_version","claude_session_file"))),provenance_unavailable_dimensions:o(d($,64)),argv_markers:o(d($,64)),client_names:o(d($,64))}),St={version:g({int:!0}),id_prefix:c,ids:o(m({token_length:o(g({int:!0,min:4,max:12}))})),author_default:c,agent_identity:o(m({probes_enabled:o(h),identity_vocabulary:o(m({version:g({int:!0,positive:!0}),aliases:_e(Pe(128,/^[a-z0-9]+(?:-[a-z0-9]+)*$/u))})),harness_signals:d(Er)})),mutation_guard:o(m({require_attributed_author:o(h),secret_guard:o(y("off","advise","block")),stale_in_progress_hours:o(g({int:!0,positive:!0}))})),item_format:o(y("toon","json_markdown")),locks:m({ttl_seconds:g({int:!0}),wait_ms:o(g({int:!0,min:0}))}),checkpoints:o(m({retention_days:o(g({int:!0,positive:!0}))})),output:m({default_format:y("toon","json")}),ux:o(m({deprecation_hints:o(h)})),history:o(m({missing_stream:y("auto_create","strict_error"),compact_policy:o(m({enabled:o(h),max_entries:o(g({int:!0,positive:!0})),trigger:o(y("health_warn","auto"))}))})),validation:o(m({sprint_release_format:y("warn","strict_error"),parent_reference:o(y("warn","strict_error")),metadata_profile:o(y("core","strict","custom")),metadata_required_fields:o(d(c)),lifecycle_stale_blocker_reason_patterns:o(d(c)),lifecycle_closure_like_blocked_reason_patterns:o(d(c)),lifecycle_closure_like_resolution_patterns:o(d(c)),lifecycle_closure_like_actual_result_patterns:o(d(c)),estimate_defaults_by_type:o(_e(g({int:!0,positive:!0})))})),governance:br,workflow:o(m({definition_of_done:d(c)})),testing:o(m({record_results_to_items:h,allow_untrusted_linked_tests:o(h)})),telemetry:o(m({enabled:h,first_run_prompt_completed:o(h),capture_level:o(y("minimal","redacted","max")),endpoint:o(c),installation_id:o(c),retention_days:o(g({int:!0,positive:!0}))})),agent_guidance:o(m({prompt_completed:o(h),declined:o(h),declined_at:o(c),template_version:o(g({int:!0,positive:!0})),last_checked_files:o(d(c))})),item_types:o(m({definitions:d(pr)})),schema:kr,context:o(m({default_depth:o(y(...at)),activity_limit:o(g({int:!0,positive:!0})),stale_threshold_days:o(g({int:!0,positive:!0})),next_ranking_policy:o(y("priority_floor","weighted")),sections:o(m({hierarchy:o(h),activity:o(h),progress:o(h),recently_created:o(h),unparented:o(h),blockers:o(h),files:o(h),workload:o(h),staleness:o(h),tests:o(h)}))})),extensions:m({enabled:d(c),disabled:d(c),policy:xr}),search:m({score_threshold:g(),hybrid_semantic_weight:o(g()),max_results:g({int:!0}),embedding_model:c,embedding_corpus_max_characters:o(g()),embedding_batch_size:g({int:!0}),embedding_timeout_ms:o(g({int:!0})),scanner_max_batch_retries:g({int:!0}),provider:o(c),default_mode:o(y("auto","keyword","semantic","hybrid")),corpus_fields:o(d(c)),mutation_refresh_policy:o(y("cache_only","semantic_configured","semantic_auto")),query_expansion:o(m({enabled:o(h),provider:o(c)})),rerank:o(m({enabled:o(h),model:o(c),top_k:o(g({int:!0,positive:!0}))})),bm25:o(m({k1:o(g()),b:o(g())}))}),providers:m({openai:m({base_url:c,api_key:c,model:c}),ollama:m({base_url:c,model:c})}),vector_store:m({adapter:o(c),collection_name:o(c),qdrant:m({url:c,api_key:c}),lancedb:m({path:c})})},Tr=m(St),xt=Object.freeze(Object.keys(St));function ue(e){let t=Tr(e);return t.ok?{success:!0,data:t.value}:{success:!1,path:t.path.join(".")}}import{AsyncLocalStorage as jr}from"node:async_hooks";import{lstat as Nr,realpath as Dt}from"node:fs/promises";import Lt from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a0ca9902-540c-50fe-a4e2-9c234c4a01f3")}catch{}})();function fe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function je(e,t,r,n=[]){if(A(e,t)&&(n.length>0||fe(r)))return r;if(A(e,r)||A(t,r))return t;if((e===void 0||fe(e))&&fe(t)&&fe(r)){let i=e??{},s=new Set([...Object.keys(i),...Object.keys(t),...Object.keys(r)]);return Object.fromEntries([...s].flatMap(a=>{let l=je(Object.hasOwn(i,a)?i[a]:void 0,Object.hasOwn(t,a)?t[a]:void 0,Object.hasOwn(r,a)?r[a]:void 0,[...n,a]);return l===void 0?[]:[[a,l]]}))}throw new S(`Settings changed concurrently at ${n.join(".")||"<root>"}; read the latest settings and reapply the intended change.`,v.CONFLICT,{reason:"stale_settings_snapshot",required:"Read a fresh settings snapshot and reapply the intended change.",why:"Another writer changed the same setting after this snapshot was read.",examples:["pm config project export --json"],nextSteps:["Read the current settings, then retry the original config operation."]})}(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]="de43e8e6-d7ef-53cc-94b0-ccdf1c4f94a3")}catch{}})();var Or={Epic:2880,Feature:480,Story:480,Milestone:2880,Task:120,Issue:60,Bug:60,Chore:30,Decision:15,Plan:120},Et=120;function Ne(e){return typeof e=="number"&&Number.isFinite(e)&&e>0}function Ot(e){let t=new Map;for(let[r,n]of Object.entries(e))t.set(r.toLowerCase(),n);return t}var Cr=Ot(Or),Tt=new WeakMap;function Ar(e){let t=Tt.get(e);if(t)return t;let r=Ot(e);return Tt.set(e,r),r}function co(e,t){let r=(e??"").trim().toLowerCase();if(r.length===0)return Et;if(t){let i=Ar(t).get(r);if(Ne(i))return Math.floor(i)}let n=Cr.get(r);return Ne(n)?Math.floor(n):Et}function Re(e){let t={};if(e===null||typeof e!="object"||Array.isArray(e))return t;for(let[r,n]of Object.entries(e)){let i=r.trim();i.length===0||!Ne(n)||(t[i]=Math.floor(n))}return t}import{stat as Ir}from"node:fs/promises";(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]="78c79deb-5cf0-54fe-b98c-a0d5b3671ab2")}catch{}})();var me=new Map;function Ct(e){return[...new Set(e.map(t=>t.trim()).filter(t=>t.length>0))].sort((t,r)=>t.localeCompare(r))}async function Pr(e){try{let t=await Ir(e);return{path:e,mtime_ms:t.mtimeMs,size:t.size}}catch{return{path:e,mtime_ms:null,size:null}}}async function D(e){let t=Ct(e),r=await Promise.all(t.map(n=>Pr(n)));return r.sort((n,i)=>n.path.localeCompare(i.path)),r}function ae(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r+=1){let n=e[r],i=t[r];if(n.path!==i.path||n.mtime_ms!==i.mtime_ms||n.size!==i.size)return!1}return!0}function At(e){return me.get(e)}function pe(e,t){let r=Ct(t.tracked_paths),n=[...t.signatures].map(i=>({path:i.path,mtime_ms:i.mtime_ms,size:i.size})).sort((i,s)=>i.path.localeCompare(s.path));me.set(e,{tracked_paths:r,signatures:n,value:t.value})}function H(e){if(e){me.delete(e);return}me.clear()}(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]="6e01cb2d-2ff0-54f2-abdb-2d16f36487c1")}catch{}})();var Me=new jr;async function Po(e,t,r=()=>!0){let n=new Set([Lt.resolve(e)]);try{n.add(await Dt(e))}catch{}return Me.run([...Me.getStore()??[],[n,r]],t)}function Rr(e){let t=Lt.resolve(e);return Me.getStore()?.some(([r,n])=>r.has(t)&&n())??!1}var Dr="settings:write",qt=Symbol("pm.settings.persist_source"),Mt=Symbol("pm.settings.fallback_origin"),zt=Symbol("pm.settings.fallback_baseline"),Lr=128,qr=new Set(["off","advisory","strict"]);function It(e){return structuredClone(Xe[e])}function Mr(e){return e==="minimal"||e==="default"||e==="strict"||e==="custom"?e:_.governance.preset}var zr=new Set(it);function Ft(e){return zr.has(e)}function Pt(e,t){let r=typeof t.create_default_type=="string"?t.create_default_type.trim():void 0;return r&&r.length>0&&(e.create_default_type=r),(t.workflow_enforcement==="off"||t.workflow_enforcement==="warn"||t.workflow_enforcement==="strict")&&(e.workflow_enforcement=t.workflow_enforcement),Ft(t.start_blocker_enforcement)&&(e.start_blocker_enforcement=t.start_blocker_enforcement),t.require_close_reason===!1&&(e.require_close_reason=!1),e.duplicate_detection_mode=t.duplicate_detection_mode,e.duplicate_detection_threshold=t.duplicate_detection_threshold,e.duplicate_detection_limit=t.duplicate_detection_limit,e}function Fr(e){return e.preset==="custom"?Pt({preset:"custom",ownership_enforcement:e.ownership_enforcement,create_mode_default:e.create_mode_default,close_validation_default:e.close_validation_default,parent_reference:e.parent_reference,metadata_profile:e.metadata_profile,force_required_for_stale_lock:e.force_required_for_stale_lock},e):Pt({preset:e.preset},e)}function Vr(e){let t=typeof e.create_default_type=="string"?e.create_default_type.trim():void 0,r={};t&&t.length>0&&(r.create_default_type=t),(e.workflow_enforcement==="off"||e.workflow_enforcement==="warn"||e.workflow_enforcement==="strict")&&(r.workflow_enforcement=e.workflow_enforcement),Ft(e.start_blocker_enforcement)&&(r.start_blocker_enforcement=e.start_blocker_enforcement),typeof e.require_close_reason=="boolean"&&(r.require_close_reason=e.require_close_reason),qr.has(String(e.duplicate_detection_mode))&&(r.duplicate_detection_mode=e.duplicate_detection_mode);let n=e.duplicate_detection_threshold;[typeof n=="number",Number.isFinite(n),Number(n)>=0,Number(n)<=1].every(Boolean)&&(r.duplicate_detection_threshold=n);let i=e.duplicate_detection_limit;return[typeof i=="number",Number.isSafeInteger(i),Number(i)>=0,Number(i)<=20].every(Boolean)&&(r.duplicate_detection_limit=i),r}function Vt(e){let t=e.governance??{},r=Mr(t.preset),n=Vr(t);if(r==="custom"){let a=It("default"),l=n.require_close_reason??a.require_close_reason;return{preset:r,ownership_enforcement:t.ownership_enforcement??a.ownership_enforcement,create_mode_default:t.create_mode_default??a.create_mode_default,close_validation_default:t.close_validation_default??a.close_validation_default,parent_reference:t.parent_reference??a.parent_reference,metadata_profile:t.metadata_profile??a.metadata_profile,force_required_for_stale_lock:t.force_required_for_stale_lock??a.force_required_for_stale_lock,...n,require_close_reason:l,duplicate_detection_mode:n.duplicate_detection_mode??a.duplicate_detection_mode,duplicate_detection_threshold:n.duplicate_detection_threshold??a.duplicate_detection_threshold,duplicate_detection_limit:n.duplicate_detection_limit??a.duplicate_detection_limit}}let i=It(r),s=n.require_close_reason??i.require_close_reason;return{preset:r,...i,...n,require_close_reason:s}}function Ve(){return structuredClone(_)}function Wt(e){return e==="cache_only"||e==="semantic_configured"||e==="semantic_auto"?e:_.search.mutation_refresh_policy}function Ut(e){return e==="auto"||e==="keyword"||e==="semantic"||e==="hybrid"?e:"auto"}function $t(e){return typeof e=="boolean"?e:_.search.query_expansion.enabled}function Ht(e){return typeof e!="string"?_.search.query_expansion.provider:e.trim()}function Bt(e){return typeof e=="boolean"?e:_.search.rerank.enabled}function Gt(e){return typeof e!="string"?_.search.rerank.model:e.trim()}function Kt(e){return typeof e=="number"&&Number.isFinite(e)&&Number.isInteger(e)&&e>0?e:_.search.rerank.top_k}function Jt(e){if(typeof e!="string")return _.vector_store.collection_name;let t=e.trim().replaceAll(/[^a-zA-Z0-9_-]/g,"_").slice(0,Lr);return t.length>0?t:_.vector_store.collection_name}function De(e){return{present:Array.isArray(e),values:Array.isArray(e)?structuredClone(e):[]}}function Yt(e,t){let r=e.schema,n=De(r?.statuses),i=De(r?.fields),s=De(r?.type_workflows);return{persisted_settings:structuredClone(e),source_settings:structuredClone(e),has_source_item_type_definitions:Array.isArray(e.item_types?.definitions),source_item_type_definitions:Y(e.item_types?.definitions),has_source_schema_statuses:n.present,source_schema_statuses:n.values,has_source_schema_fields:i.present,source_schema_fields:i.values,has_source_schema_type_workflows:s.present,source_schema_type_workflows:s.values,runtime_item_type_definitions:Y(t.item_types?.definitions),runtime_schema_statuses:structuredClone(t.schema.statuses),runtime_schema_fields:structuredClone(t.schema.fields),runtime_schema_type_workflows:structuredClone(t.schema.type_workflows??[])}}function ge(e,t){Object.defineProperty(e,qt,{value:t,writable:!0,configurable:!0,enumerable:!1})}function We(e){let t=e[qt];if(!(!t||typeof t!="object"))return t}function jo(e){let t=We(e);if(t){let r=structuredClone(t);r.source_settings.item_format=e.item_format,ge(e,r)}}function he(e){let t=structuredClone(e.settings),r=We(e.settings);r&&ge(t,r);let n=Ue(e.settings);return n!==void 0&&Xt(t,n),{settings:t,metadata:{has_explicit_item_format:e.metadata.has_explicit_item_format},warnings:[...e.warnings]}}function Wr(e,t,r){let n=re(t);return[r,ne(e,n.files.types,te.types),ne(e,n.files.statuses,te.statuses),ne(e,n.files.fields,te.fields),ne(e,n.files.workflows,te.workflows)]}async function Ur(e,t,r){let n=await D(t);pe(e,{tracked_paths:t,signatures:n,value:he(r)})}async function $r(e,t,r){try{await Ur(e,t,r)}catch{H(e)}}function jt(e,t){return e.find(r=>r.path===t)}function Hr(e,t,r){for(let n of r){let i=jt(e,n),s=jt(t,n);if(!i||!s||!ae([i],[s]))return!1}return!0}async function Le(e,t,r,n,i){try{let s=await D(t);if(!Hr(n,s,i)){H(e);return}pe(e,{tracked_paths:t,signatures:s,value:he(r)})}catch{H(e)}}function Br(e,t){let r=re(e.schema),n=Y(e.item_types?.definitions);if(!t)return{item_type_definitions:n,schema_statuses:r.statuses,schema_fields:r.fields,schema_type_workflows:r.type_workflows};let i=r.type_workflows??[],s=A(n,t.runtime_item_type_definitions),a=A(r.statuses,t.runtime_schema_statuses),l=A(r.fields,t.runtime_schema_fields),f=A(i,t.runtime_schema_type_workflows);return{item_type_definitions:s?t.has_source_item_type_definitions?Y(t.source_item_type_definitions):[]:n,schema_statuses:a?t.has_source_schema_statuses?structuredClone(t.source_schema_statuses):[]:r.statuses,schema_fields:l?t.has_source_schema_fields?structuredClone(t.source_schema_fields):[]:r.fields,schema_type_workflows:f?t.has_source_schema_type_workflows?structuredClone(t.source_schema_type_workflows):void 0:r.type_workflows}}function Xt(e,t){Object.defineProperty(e,Mt,{value:t,writable:!0,configurable:!0,enumerable:!1})}function No(e){return Ue(e)!==void 0}function Ue(e){let t=e[Mt];return typeof t=="string"?t:void 0}function Gr(e){return e[zt]}function Kr(e,t){Object.defineProperty(e,zt,{value:t,writable:!0,configurable:!0,enumerable:!1})}function P(e){let t=Ve();return e!==void 0&&Xt(t,e),{settings:t,metadata:{has_explicit_item_format:!1},warnings:e?[e]:[]}}function Qt(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e.item_format;return t==="toon"||t==="json_markdown"}function ze(e){return[...new Set((e??[]).map(t=>t.trim()).filter(t=>t.length>0))].sort((t,r)=>t.localeCompare(r))}function Zt(e){let t=_.agent_guidance,r=e?.template_version;return{prompt_completed:e?.prompt_completed===!0,declined:e?.declined===!0,declined_at:typeof e?.declined_at=="string"?e.declined_at:t.declined_at,template_version:typeof r=="number"&&Number.isInteger(r)&&r>0?r:t.template_version,last_checked_files:ze(e?.last_checked_files??t.last_checked_files)}}function C(e){return[...new Set((e??[]).map(t=>t.trim().toLowerCase()).filter(t=>t.length>0))].sort((t,r)=>t.localeCompare(r))}function Jr(e){return e==="off"||e==="warn"||e==="enforce"?e:_.extensions.policy.mode}function Yr(e){return e==="off"||e==="warn"||e==="enforce"?e:_.extensions.policy.trust_mode}function er(e){return e==="none"||e==="restricted"||e==="strict"?e:_.extensions.policy.default_sandbox_profile}function Xr(e){let t=e.name.trim().toLowerCase();if(t.length===0)return null;let r={name:t};e.disabled===!0&&(r.disabled=!0),e.require_trusted===!0&&(r.require_trusted=!0),e.require_provenance===!0&&(r.require_provenance=!0),e.sandbox_profile!==void 0&&(r.sandbox_profile=er(e.sandbox_profile));let n=C(e.allowed_capabilities),i=C(e.blocked_capabilities),s=C(e.allowed_surfaces),a=C(e.blocked_surfaces),l=C(e.allowed_commands),f=C(e.blocked_commands),u=C(e.allowed_actions),w=C(e.blocked_actions),k=C(e.allowed_services),x=C(e.blocked_services);return n.length>0&&(r.allowed_capabilities=n),i.length>0&&(r.blocked_capabilities=i),s.length>0&&(r.allowed_surfaces=s),a.length>0&&(r.blocked_surfaces=a),l.length>0&&(r.allowed_commands=l),f.length>0&&(r.blocked_commands=f),u.length>0&&(r.allowed_actions=u),w.length>0&&(r.blocked_actions=w),k.length>0&&(r.allowed_services=k),x.length>0&&(r.blocked_services=x),r}function Qr(e){let t=new Map;for(let r of e??[]){let n=Xr(r);n&&t.set(n.name,n)}return[...t.values()].sort((r,n)=>r.name.localeCompare(n.name))}function qe(e){return e==="block"||e==="warn"?e:void 0}function Zr(e){if(typeof e=="string")return qe(e);if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let t=qe(e.global),r=qe(e.project);return t===void 0&&r===void 0?void 0:{...t!==void 0?{global:t}:{},...r!==void 0?{project:r}:{}}}}function T(e,t){return C(e?.[t]??_.extensions.policy[t])}function tr(e){let t=Zr(e?.pm_max_version_exceeded_mode);return{mode:Jr(e?.mode),trust_mode:Yr(e?.trust_mode),...t!==void 0?{pm_max_version_exceeded_mode:t}:{},require_provenance:e?.require_provenance===!0,trusted_extensions:T(e,"trusted_extensions"),default_sandbox_profile:er(e?.default_sandbox_profile),allowed_extensions:T(e,"allowed_extensions"),blocked_extensions:T(e,"blocked_extensions"),allowed_capabilities:T(e,"allowed_capabilities"),blocked_capabilities:T(e,"blocked_capabilities"),allowed_surfaces:T(e,"allowed_surfaces"),blocked_surfaces:T(e,"blocked_surfaces"),allowed_commands:T(e,"allowed_commands"),blocked_commands:T(e,"blocked_commands"),allowed_actions:T(e,"allowed_actions"),blocked_actions:T(e,"blocked_actions"),allowed_services:T(e,"allowed_services"),blocked_services:T(e,"blocked_services"),extension_overrides:Qr(e?.extension_overrides??_.extensions.policy.extension_overrides)}}function rr(e){return[...new Set((e??[]).map(t=>t.trim().toLowerCase().replaceAll("-","_")))].filter(t=>t.length>0).sort((t,r)=>t.localeCompare(r)).filter(t=>["author","acceptance_criteria","estimated_minutes","close_reason","reviewer","risk","confidence","sprint","release"].includes(t))}function L(e){return[...new Set((e??[]).map(t=>t.trim().toLowerCase()).filter(t=>t.length>0))].sort((t,r)=>t.localeCompare(r))}function b(e,t){return e===void 0?t:e}function O(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{}}function Fe(e){return Array.isArray(e)?e:[]}function en(e,t,r){return{...t.validation,...e.validation,parent_reference:r.parent_reference,metadata_profile:r.metadata_profile,metadata_required_fields:rr(e.validation?.metadata_required_fields),lifecycle_stale_blocker_reason_patterns:L(e.validation?.lifecycle_stale_blocker_reason_patterns??t.validation.lifecycle_stale_blocker_reason_patterns),lifecycle_closure_like_blocked_reason_patterns:L(e.validation?.lifecycle_closure_like_blocked_reason_patterns??t.validation.lifecycle_closure_like_blocked_reason_patterns),lifecycle_closure_like_resolution_patterns:L(e.validation?.lifecycle_closure_like_resolution_patterns??t.validation.lifecycle_closure_like_resolution_patterns),lifecycle_closure_like_actual_result_patterns:L(e.validation?.lifecycle_closure_like_actual_result_patterns??t.validation.lifecycle_closure_like_actual_result_patterns),estimate_defaults_by_type:Re(e.validation?.estimate_defaults_by_type)}}function tn(e,t){return{enabled:e.telemetry?.enabled??t.telemetry.enabled,first_run_prompt_completed:e.telemetry?.first_run_prompt_completed??t.telemetry.first_run_prompt_completed,capture_level:e.telemetry?.capture_level??t.telemetry.capture_level,endpoint:e.telemetry?.endpoint??t.telemetry.endpoint,installation_id:e.telemetry?.installation_id??t.telemetry.installation_id,retention_days:e.telemetry?.retention_days??t.telemetry.retention_days}}function rn(e,t){return{...t.search,...e.search,default_mode:Ut(e.search?.default_mode),mutation_refresh_policy:Wt(e.search?.mutation_refresh_policy),query_expansion:{...t.search.query_expansion,...e.search?.query_expansion,enabled:$t(e.search?.query_expansion?.enabled),provider:Ht(e.search?.query_expansion?.provider)},rerank:{...t.search.rerank,...e.search?.rerank,enabled:Bt(e.search?.rerank?.enabled),model:Gt(e.search?.rerank?.model),top_k:Kt(e.search?.rerank?.top_k)}}}function nn(e,t){return{adapter:e.vector_store.adapter??t.vector_store.adapter,collection_name:Jt(e.vector_store.collection_name),qdrant:{...t.vector_store.qdrant,...e.vector_store.qdrant},lancedb:{...t.vector_store.lancedb,...e.vector_store.lancedb}}}function on(e,t){return e.item_format==="json_markdown"?"toon":e.item_format??t.item_format}function an(e,t){return{default_depth:e.context?.default_depth??t.context.default_depth,activity_limit:e.context?.activity_limit??t.context.activity_limit,stale_threshold_days:e.context?.stale_threshold_days??t.context.stale_threshold_days,next_ranking_policy:e.context?.next_ranking_policy??t.context.next_ranking_policy,sections:{...t.context.sections,...e.context?.sections}}}function sn(e,t){return{openai:{...t.providers.openai,...e.providers.openai},ollama:{...t.providers.ollama,...e.providers.ollama}}}function Y(e){let t=(e??[]).map(n=>st(n)).filter(n=>n!==null),r=new Map;for(let n of t)r.set(n.name.toLowerCase(),n);return[...r.values()].sort((n,i)=>n.name.localeCompare(i.name))}function ye(e){let t=Ve(),r=Vt({governance:e.governance??{preset:"default"}});return{...t,...e,item_format:on(e,t),locks:{...t.locks,...e.locks},ids:{...t.ids,...e.ids},agent_identity:structuredClone(e.agent_identity??t.agent_identity),mutation_guard:{...t.mutation_guard,...e.mutation_guard},checkpoints:{...t.checkpoints,...e.checkpoints},output:{...t.output,...e.output},ux:{...t.ux,...e.ux},history:{...t.history,...e.history,compact_policy:{...t.history.compact_policy,...e.history?.compact_policy}},validation:en(e,t,r),governance:r,workflow:{definition_of_done:[...e.workflow?.definition_of_done??t.workflow.definition_of_done]},testing:{record_results_to_items:e.testing?.record_results_to_items??t.testing.record_results_to_items,allow_untrusted_linked_tests:e.testing?.allow_untrusted_linked_tests??t.testing.allow_untrusted_linked_tests},telemetry:tn(e,t),agent_guidance:Zt(e.agent_guidance??t.agent_guidance),item_types:{definitions:Y(e.item_types?.definitions)},schema:re(e.schema??t.schema),context:an(e,t),extensions:{enabled:[...e.extensions.enabled],disabled:[...e.extensions.disabled],policy:tr(e.extensions.policy??t.extensions.policy)},search:rn(e,t),providers:sn(e,t),vector_store:nn(e,t)}}function cn(e){e.agent_identity=p(e.agent_identity,["probes_enabled","identity_vocabulary","harness_signals"]);let t=e.agent_identity;Object.hasOwn(t,"identity_vocabulary")&&(t.identity_vocabulary=p(O(t.identity_vocabulary),["version","aliases"])),e.agent_identity.harness_signals=Fe(e.agent_identity.harness_signals).map(r=>p(O(r),["harness","environment_keys","model_environment_keys","session_environment_keys","provenance_environment_keys","provenance_resolvers","provenance_unavailable_dimensions","argv_markers","client_names"])),e.locks=p(e.locks,["ttl_seconds","wait_ms"]),e.ids=p(e.ids,["token_length"]),e.mutation_guard=p(e.mutation_guard,["require_attributed_author","secret_guard","stale_in_progress_hours"]),e.checkpoints=p(e.checkpoints,["retention_days"]),e.output=p(e.output,["default_format"]),e.ux=p(e.ux,["deprecation_hints"]),e.history=p(e.history,["missing_stream","compact_policy"]),e.validation=p(e.validation,["sprint_release_format","parent_reference","metadata_profile","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","estimate_defaults_by_type"]),e.governance=p(e.governance,["preset","ownership_enforcement","create_mode_default","close_validation_default","require_close_reason","parent_reference","metadata_profile","force_required_for_stale_lock","create_default_type","workflow_enforcement","duplicate_detection_mode","duplicate_detection_threshold","duplicate_detection_limit"]),e.workflow=p(e.workflow,["definition_of_done"]),e.testing=p(e.testing,["record_results_to_items","allow_untrusted_linked_tests"]),e.telemetry=p(e.telemetry,["enabled","first_run_prompt_completed","capture_level","endpoint","installation_id","retention_days"]),e.agent_guidance=p(e.agent_guidance,["prompt_completed","declined","declined_at","template_version","last_checked_files"]),e.item_types=p(e.item_types,["definitions"]),e.schema=p(e.schema,["version","files","statuses","fields","workflow","type_workflows","unknown_field_policy"]),e.schema.files=p(O(e.schema.files),["types","statuses","fields","workflows"]),e.schema.workflow=p(O(e.schema.workflow),["draft_status","open_status","in_progress_status","blocked_status","close_status","canceled_status"]),e.context=p(e.context,["default_depth","activity_limit","stale_threshold_days","next_ranking_policy","sections"]),e.context.sections=p(O(e.context.sections),["hierarchy","activity","progress","blockers","files","workload","staleness","tests"]),e.extensions=p(e.extensions,["enabled","disabled","policy"]),e.extensions.policy=p(O(e.extensions.policy),["mode","trust_mode","pm_max_version_exceeded_mode","require_provenance","trusted_extensions","default_sandbox_profile","allowed_extensions","blocked_extensions","allowed_capabilities","blocked_capabilities","allowed_surfaces","blocked_surfaces","allowed_commands","blocked_commands","allowed_actions","blocked_actions","allowed_services","blocked_services","extension_overrides"]),e.extensions.policy.extension_overrides=Fe(e.extensions.policy.extension_overrides).map(r=>p(O(r),["name","disabled","require_trusted","require_provenance","sandbox_profile","allowed_capabilities","blocked_capabilities","allowed_surfaces","blocked_surfaces","allowed_commands","blocked_commands","allowed_actions","blocked_actions","allowed_services","blocked_services"])),e.search=p(e.search,["score_threshold","hybrid_semantic_weight","max_results","embedding_model","embedding_corpus_max_characters","embedding_batch_size","embedding_timeout_ms","scanner_max_batch_retries","provider","default_mode","mutation_refresh_policy","query_expansion","rerank"]),e.search.query_expansion=p(O(e.search.query_expansion),["enabled","provider"]),e.search.rerank=p(O(e.search.rerank),["enabled","model","top_k"]),e.providers=p(e.providers,["openai","ollama"]),e.providers.openai=p(O(e.providers.openai),["base_url","api_key","model"]),e.providers.ollama=p(O(e.providers.ollama),["base_url","model"]),e.vector_store=p(e.vector_store,["adapter","collection_name","qdrant","lancedb"]),e.vector_store.qdrant=p(O(e.vector_store.qdrant),["url","api_key"]),e.vector_store.lancedb=p(O(e.vector_store.lancedb),["path"])}function ln(e){return{...e,locks:b(e.locks,_.locks),ids:b(e.ids,_.ids),agent_identity:b(e.agent_identity,_.agent_identity),mutation_guard:b(e.mutation_guard,_.mutation_guard),checkpoints:b(e.checkpoints,_.checkpoints),output:b(e.output,_.output),ux:b(e.ux,_.ux),history:b(e.history,_.history),validation:b(e.validation,_.validation),workflow:b(e.workflow,_.workflow),testing:b(e.testing,_.testing),telemetry:b(e.telemetry,_.telemetry),agent_guidance:b(e.agent_guidance,_.agent_guidance),item_types:b(e.item_types,_.item_types),schema:b(e.schema,_.schema),context:b(e.context,_.context),extensions:b(e.extensions,_.extensions),search:b(e.search,_.search),providers:b(e.providers,_.providers),vector_store:b(e.vector_store,_.vector_store)}}function dn(e,t){return{...e.validation,parent_reference:t.parent_reference,metadata_profile:t.metadata_profile,metadata_required_fields:rr(e.validation?.metadata_required_fields),lifecycle_stale_blocker_reason_patterns:L(e.validation?.lifecycle_stale_blocker_reason_patterns??_.validation.lifecycle_stale_blocker_reason_patterns),lifecycle_closure_like_blocked_reason_patterns:L(e.validation?.lifecycle_closure_like_blocked_reason_patterns??_.validation.lifecycle_closure_like_blocked_reason_patterns),lifecycle_closure_like_resolution_patterns:L(e.validation?.lifecycle_closure_like_resolution_patterns??_.validation.lifecycle_closure_like_resolution_patterns),lifecycle_closure_like_actual_result_patterns:L(e.validation?.lifecycle_closure_like_actual_result_patterns??_.validation.lifecycle_closure_like_actual_result_patterns),estimate_defaults_by_type:Re(e.validation?.estimate_defaults_by_type)}}function _n(e){return{..._.search,...e.search,default_mode:Ut(e.search?.default_mode),mutation_refresh_policy:Wt(e.search?.mutation_refresh_policy),query_expansion:{..._.search.query_expansion,...e.search?.query_expansion,enabled:$t(e.search?.query_expansion?.enabled),provider:Ht(e.search?.query_expansion?.provider)},rerank:{..._.search.rerank,...e.search?.rerank,enabled:Bt(e.search?.rerank?.enabled),model:Gt(e.search?.rerank?.model),top_k:Kt(e.search?.rerank?.top_k)}}}function un(e){return{default_depth:e.context?.default_depth??_.context.default_depth,activity_limit:e.context?.activity_limit??_.context.activity_limit,stale_threshold_days:e.context?.stale_threshold_days??_.context.stale_threshold_days,next_ranking_policy:e.context?.next_ranking_policy??_.context.next_ranking_policy,sections:{..._.context.sections,...e.context?.sections}}}function fn(e){return{...e.vector_store,adapter:e.vector_store?.adapter??_.vector_store.adapter,collection_name:Jt(e.vector_store?.collection_name),qdrant:{...e.vector_store?.qdrant},lancedb:{...e.vector_store?.lancedb}}}function mn(e,t,r,n){return{...e,item_format:"toon",validation:dn(e,t),governance:t,agent_guidance:Zt(e.agent_guidance),item_types:{definitions:n.item_type_definitions},schema:{...r,statuses:n.schema_statuses,fields:n.schema_fields,type_workflows:n.schema_type_workflows},search:_n(e),context:un(e),extensions:{enabled:ze(e.extensions?.enabled),disabled:ze(e.extensions?.disabled),policy:tr(e.extensions?.policy)},vector_store:fn(e)}}function nr(e,t){for(let r of Object.keys(t)){let n=Reflect.get(t,r),i=e[r];typeof n=="object"&&n!==null&&!Array.isArray(n)&&typeof i=="object"&&i!==null&&!Array.isArray(i)?nr(i,n):e[r]=structuredClone(n)}}function $e(e,t,r){let n=new Set([...Object.keys(t),...Object.keys(r)]);for(let i of n){let s=t[i],a=r[i];if(!A(s,a)){if(a===void 0){delete e[i];continue}if(typeof s=="object"&&s!==null&&!Array.isArray(s)&&typeof a=="object"&&a!==null&&!Array.isArray(a)){let l=e[i],f=typeof l=="object"&&l!==null&&!Array.isArray(l)?l:{};$e(f,s,a),Object.keys(f).length>0?e[i]=f:delete e[i];continue}e[i]=structuredClone(a)}}}var we=["version","id_prefix","ids","author_default","agent_identity","mutation_guard","item_format","locks","checkpoints","output","ux","history","validation","governance","workflow","testing","telemetry","agent_guidance","item_types","schema","context","extensions","search","providers","vector_store"];function Nt(e,t){let r=ln(e),n=Vt(r),i=re(r.schema),s=Br(r,t),a=mn(r,n,i,s),l=p({...a,governance:Fr(n)},we);return cn(l),l}function or(e,t={}){let r=t.source===void 0?t.persist_source:Yt(t.source.validated,ye(t.source.validated)),n=Nt(e,r);if(r){let i=ye(r.source_settings);i.item_types={definitions:structuredClone(r.runtime_item_type_definitions)},i.schema={...i.schema,statuses:structuredClone(r.runtime_schema_statuses),fields:structuredClone(r.runtime_schema_fields),type_workflows:structuredClone(r.runtime_schema_type_workflows)};let s=Nt(i,r);t.source!==void 0&&nr(s,t.source.validated);let a=structuredClone(t.source===void 0?r.source_settings:t.source.raw);return $e(a,s,n),`${JSON.stringify(p(a,we),null,2)}
3
3
  `}return`${JSON.stringify(n,null,2)}
4
4
  `}async function pn(e){let t;try{t=await Dt(e)}catch(l){if(le(l))return P();throw l}let r=B(t),n;try{n=await Nr(r)}catch(l){if(le(l))return P();throw l}if(!n.isFile())throw Oe("settings.json");let i;try{i=await Ze(r,Oe("settings.json"))}catch(l){if(le(l))return P();throw l}let s;try{s=JSON.parse(i)}catch{return P("settings_read_invalid_json")}let a=ue(s);return a.success?{settings:ye(a.data),metadata:{has_explicit_item_format:Qt(s)},warnings:a.data.item_format==="json_markdown"?["settings_item_format_legacy_json_markdown_coerced_to_toon"]:[]}:P("settings_read_invalid_schema")}async function ir(e){if(Rr(e))return pn(e);let t=B(e),r=[t];await gt({path:t,scope:"project"});let n=At(e);if(n){let u=await D(n.tracked_paths);if(ae(u,n.signatures))return he(n.value)}let i=await D([t]),s;try{s=await N(t)}catch{return P("settings_read_fs_error")}if(s===null){let u=P();return await Le(e,[t],u,i,[t]),u}let a=await D([t]);if(!ae(i,a))return H(e),ir(e);let l;try{l=JSON.parse(s)}catch{let u=P("settings_read_invalid_json");return await Le(e,[t],u,a,[t]),u}let f=ue(l);if(!f.success){let u=P("settings_read_invalid_schema");return await Le(e,[t],u,a,[t]),u}try{let u=ye(f.data),w=Wr(e,u.schema,t);r=w;let k=await D(w),x=await dt(e,u.schema),X=await D(w),Te={...u,item_types:{definitions:Y([...u.item_types.definitions,...Fe(x.type_definitions_from_file)])},schema:x.schema};ge(Te,Yt(f.data,Te));let Ye={settings:Te,metadata:{has_explicit_item_format:Qt(l)},warnings:[...f.data.item_format==="json_markdown"?["settings_item_format_legacy_json_markdown_coerced_to_toon"]:[],...x.warnings]};return ae(k,X)?pe(e,{tracked_paths:w,signatures:X,value:he(Ye)}):H(e),Ye}catch{let u=P("settings_read_merge_failed");return await $r(e,r,u),u}}function hn(e,t=[],r=null){let n=He(r)??{},i=t.filter(a=>!Object.hasOwn(n,a));if(i.length===0)return e;let s=JSON.parse(e);for(let a of i)Reflect.deleteProperty(s,a);return`${JSON.stringify(s,null,2)}
@@ -6,4 +6,4 @@ import{Ba as at,Bc as dt,Da as st,Rc as _t,Ta as ct,Tc as ut,Va as B,Xb as ee,a
6
6
  `}function Sn(e){try{return JSON.parse(e)}catch{throw new S("Existing settings.json is malformed; the settings write was refused.",v.USAGE,{code:"settings_write_invalid_existing_json",reason:"existing_settings_json_malformed",why:"Writing defaults over malformed settings could destroy intended project configuration.",nextSteps:["Repair the syntax in .agents/pm/settings.json, then retry the original command.","Run pm health to confirm the settings warning has cleared."]})}}async function Ro(e){return(await ir(e)).settings}async function Do(e,t,r=Dr,n={}){let i=n.assignedPaths??[];wn(i);let s=B(e),a=We(t),l=a?void 0:Ue(t),f=or(t,{persist_source:a}),u=JSON.parse(f),w=!1;try{if(await vt({pmRoot:e,filePath:s,mutate:k=>{let x=k===null?null:Sn(k);return k!==null&&n.skipIfStored?.(x)===!0?(w=!0,{raw:k,result:void 0}):l!==void 0&&k!==null?{raw:vn(x,u,l,i,Gr(t)),result:void 0}:{raw:a?`${JSON.stringify(p(je(a.persisted_settings,u,x),we),null,2)}
7
7
  `:hn(f,n.omitSections,x),result:void 0}},op:r,author:ft(void 0,t.author_default),lockTtlSeconds:t.locks.ttl_seconds,lockWaitMs:t.locks.wait_ms,recordCreation:!1}),w)return;a?ge(t,{...a,persisted_settings:structuredClone(u)}):l!==void 0&&Kr(t,structuredClone(u)),await yt({path:s,scope:"project",op:r})}finally{H(e)}}import sr from"node:fs";import se from"node:path";import{createRequire as xn}from"node:module";(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]="27729f1f-7de5-5907-943e-88b4b6093842")}catch{}})();var ce="@unbrained/pm-cli",En=new Set(["append","claim","changelog","close","close-many","close-task","comments","config","copy","create","dedupe-merge","delete","deps","docs","extension","event","events","files","focus","gc","history-author-acknowledge","history-compact","history-redact","history-repair","init","install","item","learnings","meet","merge","normalize","notes","package","packages","pause-task","plan","profile","reindex","release","remind","restore","schema","start-task","test","test-all","test-runs","test-runs-worker","telemetry","templates","twin","update","update-many","upgrade","vcs","workspace"]),cr=new Set(["--author","--expect-hash","--output-budget","--output-format","--output-include","--output-limit","--output-session","--path","--pm-path"]),Ge=/\b(\d{4})\.(\d{1,2})\.(\d{1,2})(?:-(\d+))?\b/u,Se="2026.8.31";function E(e,t){return e.some(r=>t.includes(r.split("=",1)[0]))}function Be(e,t){return["activate","adopt","adopt-all","deactivate","init","install","migrate","reload","uninstall"].includes(t[0]??"")||E(e,["--activate","--adopt","--adopt-all","--deactivate","--fix-managed-state","--init","--install","--output","--reload","--scaffold","--uninstall"])}var Tn={changelog:(e,t)=>{if(t[0]==="generate")return!E(e,["--check"]);let r=e.indexOf("export");return t[0]==="export"&&(E(e,["--output"])||r>=0&&e[r+1]!==void 0&&!e[r+1].startsWith("-"))},comments:e=>E(e,["--add","--delete","--edit","--file","--stdin"]),config:(e,t)=>(t[0]==="project"||t[0]==="global"?t[1]:t[0])==="set",deps:()=>!1,docs:e=>E(e,["--add","--add-glob","--migrate","--remove"]),duplicates:()=>!1,events:()=>!1,extension:Be,files:(e,t)=>E(e,["--add","--add-glob","--migrate","--remove"])||t[0]==="discover"&&E(e,["--apply"]),health:e=>!E(e,["--check-only","--no-refresh","--skip-vectors"]),learnings:e=>E(e,["--add","--delete","--edit","--file","--stdin"]),merge:(e,t)=>t[0]!=="report",notes:e=>E(e,["--add","--delete","--edit","--file","--stdin"]),package:Be,packages:Be,profile:(e,t)=>t[0]==="apply",schema:(e,t)=>["add-field","add-status","add-type","remove-field","remove-status","remove-type","remap-status","rename-field","rename-type"].includes(t[0]??"")&&!(E(e,["--infer"])&&!E(e,["--apply"])),telemetry:(e,t)=>t.slice(0,2).some(r=>["clear","flush"].includes(r)),templates:(e,t)=>t[0]==="save",test:e=>E(e,["--update","--update-index","--add","--add-json","--background","--measure","--remove","--resume","--run","--stop"]),validate:e=>E(e,["--auto-fix","--prune-missing"]),vcs:(e,t)=>["abandon","create","merge","propose","ref-create"].includes(t[0]??""),workspace:(e,t)=>t[0]==="snapshot"&&["create","delete","restore"].includes(t[1]??"")};function be(e){let t=e.match(Ge);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]??0)]:null}function q(e,t){let r=be(e),n=be(t);if(!r||!n)return null;for(let i=0;i<r.length;i+=1){let s=r[i]-n[i];if(s!==0)return Math.sign(s)}return 0}function ke(e){return q(e,Se)!==-1?3:2}function On(e,t){if(t===3)return e.filter(r=>r.history_epoch_compatible===!1).map(r=>({...r,declaration:r.declaration??r.version})).sort((r,n)=>q(r.version,n.version))[0]}function ve(e){try{let t=JSON.parse(sr.readFileSync(e,"utf8"));return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:null}catch{return null}}function Cn(e){let t=[...e.matchAll(/(<=|<)\s*v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/gu)].map(n=>({inclusive:n[1]==="<=",version:n[2]})),r=e.match(/\b\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?\s+-\s+v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/u);return r?[...t,{inclusive:!0,version:r[1]}]:t}function An(e){let t=e.split("||").map(r=>Cn(r));return{bounded:t.some(r=>r.length>0),compatible:t.some(r=>r.every(n=>{let i=q(Se,n.version);return i!==null&&(n.inclusive?i!==1:i===-1)}))}}function lr(e){return["dependencies","devDependencies","optionalDependencies","peerDependencies"].flatMap(t=>{let r=e[t];if(typeof r!="object"||r===null)return[];let n=r[ce];return typeof n=="string"?[n.trim()]:[]})}function In(e){return lr(e).flatMap(t=>{let r=/^[<!]/u.test(t)?void 0:t.match(Ge)?.[0];if(!r)return[];let n=/^(?:=|v)?\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?$/u.test(t),i=An(t);return[{version:r,constraint:n?"exact":i.bounded?"range":"minimum",...n?{}:{declaration:t},history_epoch_compatible:n?q(r,Se)!==-1:i.compatible}]})}function Pn(e){let t=ve(se.join(e,"package-lock.json"))?.packages;if(typeof t!="object"||t===null)return;let r=t["node_modules/@unbrained/pm-cli"];if(typeof r!="object"||r===null)return;let n=r.version;return typeof n=="string"?n:void 0}function jn(e,t){try{let r=sr.readFileSync(se.join(e,t),"utf8").split(/\r?\n/u),n=r.findIndex(a=>a.includes(ce));if(n<0)return;let i=r[n].match(/^\s*/u)[0].length,s=[r[n]];for(let a=n+1;a<r.length;a+=1){let l=r[a],f=l.trim(),u=l.match(/^\s*/u)[0].length;if(f.length>0&&u<=i)break;s.push(l)}return s.join(`
8
8
  `).match(/^\s*version(?::\s*|\s+)["']?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/mu)?.[1]??s[0].match(Ge)?.[0]}catch{return}}function dr(e){let t=[],r=ve(se.join(e,"package.json"));r&&t.push(...In(r).map(s=>({...s,source:"package.json"})));let n=ve(se.join(e,"node_modules","@unbrained","pm-cli","package.json"))?.version;typeof n=="string"&&be(n)&&t.push({version:n,source:"installed-package",constraint:"exact",history_epoch_compatible:ke(n)===3});let i=Pn(e);i&&be(i)&&t.push({version:i,source:"package-lock.json",constraint:"exact",history_epoch_compatible:ke(i)===3});for(let s of["pnpm-lock.yaml","yarn.lock"]){let a=jn(e,s);a&&t.push({version:a,source:s,constraint:"exact",history_epoch_compatible:ke(a)===3})}return t}function Nn(e,t){if(t<=1)return;let{minVersion:r,lt:n}=xn(import.meta.url)("semver"),i=lr(ve(se.join(e,"package.json"))??{}).find(a=>{try{let l=r(a);return l!==null&&n(l,"2026.10.10")}catch{return!1}}),s=i===void 0?dr(e).find(a=>q(a.version,"2026.10.10")===-1):{version:i,source:"package.json"};if(s)throw new S(`The project selects pm ${s.version}, which cannot safely refuse item format ${t}.`,v.CONFLICT,{code:"project_runtime_item_format_incompatible",reason:s.source,required:"Upgrade project pins, installed SDKs, CI hosts and Git merge drivers before writing guarded item formats.",nextSteps:["Use a pm runtime supporting the required item format throughout the project; preserve original item and history bytes, and never re-anchor history to satisfy an older host."]})}function $o(e,t){let r=ut(e);r<=_t||(Nn(ct(t),r),e.pm_format_version=r)}function _r(e){for(let t=0;t<e.length;t+=1){let r=e[t];if(cr.has(r)){t+=1;continue}if(!r.startsWith("-"))return{command:r.toLowerCase(),index:t}}}function Rn(e){let t=_r(e);if(!t||E(e,["--help","-h","--dry-run"]))return!1;let{command:r,index:n}=t,i=[];for(let a=n+1;a<e.length;a+=1){let l=e[a];if(cr.has(l)){a+=1;continue}l.startsWith("-")||i.push(l.toLowerCase())}let s=Tn[r];return s?s(e,i):En.has(r)}function Dn(e){let t=_r(e.argv)?.command,r=Rn(e.argv),n=dr(e.projectRoot).filter(w=>q(w.version,e.executingVersion)!==null).sort((w,k)=>q(k.version,w.version)),i=n[0],s=i!==void 0&&q(e.executingVersion,i.version)===-1,a=ke(e.executingVersion),l=On(n,a),f=r&&l!==void 0,u=s&&!r?{code:"project_runtime_stale_read",executing_version:e.executingVersion,project_version:i.version,source:i.source,message:"This read is using an older pm runtime than the project requires.",next_steps:[`Run the command through the project's installed ${ce} ${i.version}.`,"Install the project dependencies with its declared package manager if the local executable is missing."]}:void 0;return{compatible:!r||!s&&!f||e.allowStale===!0,executing_version:e.executingVersion,...i?{project_version:i.version,source:i.source}:{},...t?{command:t}:{},mutating:r,stale:s,history_epoch_incompatible:f,writer_item_hash_version:a,...l?{incompatible_project_version:l.declaration,incompatible_source:l.source}:{},...u?{warning:u}:{},override_applied:r&&(s||f)&&e.allowStale===!0}}function Ho(e){let t=Dn(e);if(t.compatible)return t;throw t.history_epoch_incompatible?new S(`pm ${t.executing_version} cannot write item-hash epoch ${t.writer_item_hash_version} into a project pinned to pm ${t.incompatible_project_version}.`,v.CONFLICT,{code:"project_runtime_history_epoch_incompatible",reason:t.incompatible_source,why:`The pinned runtime cannot read item_hash_version ${t.writer_item_hash_version}; allowing the write would break its health and validation gates.`,nextSteps:[`Upgrade the project's ${ce} pin to ${Se} or newer before mutating tracker history.`,"For an intentional coordinated migration only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]}):new S(`pm ${t.executing_version} cannot mutate a project pinned to newer pm ${t.project_version}.`,v.CONFLICT,{code:"project_runtime_stale_mutation",reason:t.source,why:"An older runtime can write storage, history, and merge contracts it does not understand.",nextSteps:[`Run this command through the project's installed ${ce} ${t.project_version}.`,"For an intentional recovery only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]})}import Je from"node:fs/promises";import xe from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="658ab1c3-da92-5af6-a170-85ed7befaad6")}catch{}})();function M(e,t){return typeof e=="object"&&e!==null&&"code"in e&&e.code===t}function ur(e){let t=["--pm-path",e,"init","--defaults","--agent-guidance","skip"];return{suggested_retry:lt(t),suggested_retry_args:t}}function Ee(e){return new S(`Tracker root is not a directory at ${e}.`,v.USAGE,{code:"tracker_root_not_directory",reason:"not_a_directory",resolved_path:e,nextSteps:["Pass a tracker directory, usually <workspace>/.agents/pm, rather than a file path."]})}function Ke(e){return new S(`Tracker root is not readable at ${e}.`,v.GENERIC_FAILURE,{code:"tracker_root_unreadable",reason:"unreadable",resolved_path:e,nextSteps:["Grant read and directory-search permission to the tracker root, then retry."]})}async function Ln(e){let t=xe.resolve(e),r=xe.parse(t).root,n=xe.dirname(t);for(;n!==r;){let i;try{i=await Je.stat(n)}catch(s){if(M(s,"ENOTDIR"))throw Ee(e);if(!M(s,"ENOENT"))throw s;n=xe.dirname(n);continue}if(!i.isDirectory())throw Ee(e);return}}async function qn(e){let t;try{t=await Je.stat(e)}catch(r){throw M(r,"ENOENT")?(await Ln(e),new S(`Tracker is not initialized at ${e}. Tracker root does not exist. Run pm init first.`,v.NOT_FOUND,{code:"tracker_root_missing",reason:"missing",resolved_path:e,nextSteps:["Confirm the tracker root path or initialize it with the emitted retry."],recovery:ur(e)})):M(r,"ENOTDIR")?Ee(e):M(r,"EACCES")||M(r,"EPERM")?Ke(e):r}if(!t.isDirectory())throw Ee(e);if(process.platform!=="win32"&&((t.mode&292)===0||(t.mode&73)===0))throw Ke(e);try{await(await Je.opendir(e)).close()}catch(r){throw M(r,"EACCES")||M(r,"EPERM")?Ke(e):r}}async function ei(e){if(await qn(e),!await Qe(B(e)))throw new S(`Tracker is not initialized at ${e}. Run pm init first.`,v.NOT_FOUND,{code:"tracker_not_initialized",reason:"settings_missing",resolved_path:e,nextSteps:["Initialize the selected tracker root with the emitted retry."],recovery:ur(e)})}export{R as a,W as b,Jn as c,Yn as d,Xn as e,vt as f,Qn as g,Zn as h,eo as i,xt as j,ue as k,co as l,H as m,Po as n,Rr as o,Vt as p,jo as q,No as r,ye as s,or as t,ir as u,Ro as v,Do as w,Se as x,q as y,ke as z,dr as A,Nn as B,$o as C,Rn as D,Dn as E,Ho as F,ur as G,qn as H,ei as I};
9
- //# sourceMappingURL=chunk-6QLEXRUG.js.map
9
+ //# sourceMappingURL=chunk-YHVLVSEZ.js.map
@@ -1,2 +1,2 @@
1
- import{A as u,B as v,C as w,D as x,E as y,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-BKSVHOWI.js";import"./chunk-SRVTCYAU.js";import"./chunk-IB7UB5TE.js";import"./chunk-PJXKA4QU.js";import"./chunk-6QLEXRUG.js";import{wh as a,xh as b,yh as c,zh as d}from"./chunk-YKJKQ7DM.js";import"./chunk-KQIZ34SF.js";import"./chunk-XAWE4EAK.js";export{f as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,e as ITEM_REVISION_CONFLICT_CODE,w as assertExpectHashAdmissible,t as bindExpectedItemRevisions,c as bindItemRevisionScope,a as createItemRevisionScope,k as describeItemRevisionChanges,y as dispatchWithExpectedItemRevisions,q as enrichItemRevisionConflict,o as expectHashInvocationRewrittenError,x as expectHashRequiresMutationError,m as isItemRevisionConflict,u as isTrackerRevisionGuarded,l as itemRevisionConflictRowFields,d as itemRevisionScopeReceipt,v as itemRevisionUncheckedWarning,g as normalizeExpectedItemHash,h as parseExpectHashSpecs,i as readItemRevision,j as resolveExpectedItemRevisions,r as runWithBoundItemRevisionScope,b as runWithItemRevisionScope,p as scopeItemRevisionConflict,n as throwFirstItemRevisionConflict,s as withExpectedItemRevisions};
2
- //# sourceMappingURL=item-revision-R5SZPJZ5.js.map
1
+ import{A as u,B as v,C as w,D as x,E as y,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-J52BEBSS.js";import"./chunk-TC6XLIYO.js";import"./chunk-IB7UB5TE.js";import"./chunk-4TB5D6HL.js";import"./chunk-YHVLVSEZ.js";import{Ih as a,Jh as b,Kh as c,Lh as d}from"./chunk-HXHYDO2R.js";import"./chunk-KQIZ34SF.js";import"./chunk-XAWE4EAK.js";export{f as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,e as ITEM_REVISION_CONFLICT_CODE,w as assertExpectHashAdmissible,t as bindExpectedItemRevisions,c as bindItemRevisionScope,a as createItemRevisionScope,k as describeItemRevisionChanges,y as dispatchWithExpectedItemRevisions,q as enrichItemRevisionConflict,o as expectHashInvocationRewrittenError,x as expectHashRequiresMutationError,m as isItemRevisionConflict,u as isTrackerRevisionGuarded,l as itemRevisionConflictRowFields,d as itemRevisionScopeReceipt,v as itemRevisionUncheckedWarning,g as normalizeExpectedItemHash,h as parseExpectHashSpecs,i as readItemRevision,j as resolveExpectedItemRevisions,r as runWithBoundItemRevisionScope,b as runWithItemRevisionScope,p as scopeItemRevisionConflict,n as throwFirstItemRevisionConflict,s as withExpectedItemRevisions};
2
+ //# sourceMappingURL=item-revision-4QBMZXKX.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-GYP24M7W.js";import"./chunk-B76TFRO2.js";import"./chunk-U7EL3AYA.js";import"./chunk-VQFWW4EF.js";import"./chunk-OJTMGDON.js";import"./chunk-YR2KEBHP.js";import"./chunk-XC5Q2ZV7.js";import"./chunk-XFHPKXAE.js";import"./chunk-CAR2L5NW.js";import"./chunk-YMUSRWV4.js";import"./chunk-6BBDEIKC.js";import"./chunk-HKUV74K3.js";import"./chunk-3W47ZZ5T.js";import"./chunk-J52BEBSS.js";import"./chunk-TC6XLIYO.js";import"./chunk-IB7UB5TE.js";import"./chunk-4TB5D6HL.js";import"./chunk-YHVLVSEZ.js";import"./chunk-HXHYDO2R.js";import"./chunk-LQBWLNZJ.js";import"./chunk-SPPHDVZE.js";import"./chunk-KQIZ34SF.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-QY3PUHEI.js.map
@@ -1,2 +1,2 @@
1
- import{$d as r,Zd as t,_d as s}from"./chunk-YKJKQ7DM.js";import"./chunk-KQIZ34SF.js";import"./chunk-XAWE4EAK.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new o.Error().stack;e&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[e]="44d57a71-ac49-5db8-b461-ce985801bb3c")}catch{}})();function d(o){let e=s(o),n={...e.harness===void 0?{}:{harness:e.harness},...e.model===void 0?{}:{model:e.model},...e.model_source===void 0?{}:{model_source:e.model_source},...e.instance===void 0?{}:{instance:e.instance}};return Object.freeze({author:o,author_source:t(o),principal:r(o),...Object.keys(n).length===0?{}:{agent:Object.freeze(n)}})}export{d as resolveMutationActor};
2
- //# sourceMappingURL=mutation-actor-3TG636XG.js.map
1
+ import{$d as s,_d as t,ae as r}from"./chunk-HXHYDO2R.js";import"./chunk-KQIZ34SF.js";import"./chunk-XAWE4EAK.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new o.Error().stack;e&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[e]="44d57a71-ac49-5db8-b461-ce985801bb3c")}catch{}})();function d(o){let e=s(o),n={...e.harness===void 0?{}:{harness:e.harness},...e.model===void 0?{}:{model:e.model},...e.model_source===void 0?{}:{model_source:e.model_source},...e.instance===void 0?{}:{instance:e.instance}};return Object.freeze({author:o,author_source:t(o),principal:r(o),...Object.keys(n).length===0?{}:{agent:Object.freeze(n)}})}export{d as resolveMutationActor};
2
+ //# sourceMappingURL=mutation-actor-FWLYWJ37.js.map
@@ -1,2 +1,2 @@
1
- import{s as E,x as N}from"./chunk-RULHZRFN.js";import{Oa as y,Ua as C,wb as R,zb as A}from"./chunk-IUIOTAF6.js";import"./chunk-PJXKA4QU.js";import{v as O}from"./chunk-6QLEXRUG.js";import{Ec as h,Fc as w,Mc as T,Sa as g,gc as _}from"./chunk-YKJKQ7DM.js";import{C as f}from"./chunk-KQIZ34SF.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-LICSDNNO.js.map
1
+ import{s as E,x as N}from"./chunk-XC5Q2ZV7.js";import{Oa as y,Ua as C,wb as R,zb as A}from"./chunk-3W47ZZ5T.js";import"./chunk-4TB5D6HL.js";import{v as O}from"./chunk-YHVLVSEZ.js";import{Fc as h,Gc as w,Nc as T,Sa as g,hc as _}from"./chunk-HXHYDO2R.js";import{C as f}from"./chunk-KQIZ34SF.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-7ZDCK3G2.js.map
@@ -1,4 +1,4 @@
1
- import{a as ce}from"./chunk-XHJ3H5PL.js";import"./chunk-DEZPZOQ7.js";import{b as g,c as S,d as F}from"./chunk-JVGRFU5H.js";import{L as ie,P as ae,U as re,n as oe,u as D,w as ne}from"./chunk-KVBIMFUG.js";import{Gc as X,Ha as V,Ic as Y,Kc as Z,Lb as K,Nc as ee,Oc as te,Qc as se,Rc as le,Sc as de,U as Q,uc as W}from"./chunk-2DXRTIC6.js";import"./chunk-NCFCBKIP.js";import{Cc as v,Fc as s,Hc as l,Nc as L,Oc as $,Pc as M,Qc as B,Rc as N,Sc as U,Tc as P,Uc as z,Vc as H,Wc as J,d as G}from"./chunk-IUIOTAF6.js";import"./chunk-BKSVHOWI.js";import"./chunk-SRVTCYAU.js";import"./chunk-IB7UB5TE.js";import{Aa as T,za as R}from"./chunk-PJXKA4QU.js";import{v as q}from"./chunk-6QLEXRUG.js";import{A as j,Jg as A,Sa as C,Xg as h,ah as y,bh as p,ij as _,z as O}from"./chunk-YKJKQ7DM.js";import"./chunk-SPPHDVZE.js";import{A as c,C as u}from"./chunk-KQIZ34SF.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 ye(e,t){let o=v(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=z(e.stream);if(a&&!o.json)throw new u("--stream requires --json output mode.",c.USAGE);let n=P(e),r=await K(a&&e.full!==!0&&e.provenance!==!0?{...n,raw:!0,compact:!0}:n,o);a?B(r,n,o):y(r,o),o.profile&&p(`profile:command=activity took_ms=${Date.now()-i}`)}function E(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(ye)}(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]="689cbdf3-974b-5371-8722-91dbd4cca944")}catch{}})();function ve(e,t){return!t||t.size===0?!0:e==="context"?t.has("context")||t.has("ctx"):t.has(e)}function ue(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 k(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){G[t]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function pe(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 ge={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 be(e,t){let o=e.stream===!0,i=ue(e.format),a=i==="csv"||i==="table",n=i==="json"||i==="ndjson"||i==="toon"?k("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 we(e,t,o){if(o.listFormat==="csv"||o.listFormat==="table"){_(t);let i=t.items,a=o.listFormat==="csv"?R(i):T(i);!o.effectiveGlobal.quiet&&a.length>0&&h(`${a}
1
+ import{a as ce}from"./chunk-B4PPFOPY.js";import"./chunk-DEZPZOQ7.js";import{b as g,c as S,d as F}from"./chunk-AR4NP5HI.js";import{L as ie,P as ae,U as re,n as oe,u as D,w as ne}from"./chunk-VQFWW4EF.js";import{Gc as X,Ha as V,Ic as Y,Kc as Z,Lb as K,Nc as ee,Oc as te,Qc as se,Rc as le,Sc as de,U as Q,uc as W}from"./chunk-6BBDEIKC.js";import"./chunk-HKUV74K3.js";import{Cc as v,Fc as s,Hc as l,Nc as L,Oc as $,Pc as M,Qc as B,Rc as N,Sc as U,Tc as P,Uc as z,Vc as H,Wc as J,d as G}from"./chunk-3W47ZZ5T.js";import"./chunk-J52BEBSS.js";import"./chunk-TC6XLIYO.js";import"./chunk-IB7UB5TE.js";import{Aa as T,za as R}from"./chunk-4TB5D6HL.js";import{v as q}from"./chunk-YHVLVSEZ.js";import{A as j,Sa as C,Ug as A,gh as h,lh as y,mh as p,uj as _,z as O}from"./chunk-HXHYDO2R.js";import"./chunk-SPPHDVZE.js";import{A as c,C as u}from"./chunk-KQIZ34SF.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 ye(e,t){let o=v(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=z(e.stream);if(a&&!o.json)throw new u("--stream requires --json output mode.",c.USAGE);let n=P(e),r=await K(a&&e.full!==!0&&e.provenance!==!0?{...n,raw:!0,compact:!0}:n,o);a?B(r,n,o):y(r,o),o.profile&&p(`profile:command=activity took_ms=${Date.now()-i}`)}function E(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(ye)}(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]="689cbdf3-974b-5371-8722-91dbd4cca944")}catch{}})();function ve(e,t){return!t||t.size===0?!0:e==="context"?t.has("context")||t.has("ctx"):t.has(e)}function ue(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 k(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){G[t]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function pe(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 ge={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 be(e,t){let o=e.stream===!0,i=ue(e.format),a=i==="csv"||i==="table",n=i==="json"||i==="ndjson"||i==="toon"?k("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 we(e,t,o){if(o.listFormat==="csv"||o.listFormat==="table"){_(t);let i=t.items,a=o.listFormat==="csv"?R(i):T(i);!o.effectiveGlobal.quiet&&a.length>0&&h(`${a}
2
2
  `)}else if(o.listFormat==="ndjson"){_(t);let i=S(t.items);!o.effectiveGlobal.quiet&&i.length>0&&h(`${i}
3
3
  `)}else o.streamMode?M(e,t,o.effectiveGlobal):y(t,o.effectiveGlobal)}function I(e,t,o,i=[]){if(o.outputBudget===void 0)return A(e,t,i);let{outputBudget:a,...n}=A(e,{...t,outputBudget:o.outputBudget},i);return n}async function xe(e){let t=v(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(fe=>fe.ux.deprecation_hints)&&p(j(e.aliasContract));let a=I("list",e.options,o),n=L(a),r=_e(e,n),{effectiveName:d,effectiveStatus:m,effectiveDependencyBlocked:f,effectiveExcludeTerminal:w}=r;he(n,e.name),Object.assign(n,{projectionCommand:d}),w&&(n.excludeTerminal=!0),n.dependencyBlocked=f;let x=be(a,o),me=await Q(f?void 0:m,n,o);we("list",me,x),o.profile&&p(`profile:command=list took_ms=${Date.now()-i}`)}function _e(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?ge[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:m}=t,f=e.command(o,{hidden:m?.hidden===!0}).description(i);r&&f.option("--status <value>","Filter by status (repeatable or comma-separated; matches any; all selects every status)",s),o==="list"&&f.option("--all","Include every lifecycle status"),f.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)"),pe(f),f.action(async(w,x)=>{await xe({name:o,status:a,excludeTerminal:n,dependencyBlocked:d,options:w,actionCommand:x,aliasContract:m})}),l(f,"--tags <value>","Alias for --tag"),l(f,"--assignee_filter <value>","Alias for --assignee-filter"),l(f,"--tree_depth <n>","Alias for --tree-depth"),l(f,"--token_budget <n>","Alias for --token-budget"),l(f,"--filter-estimate-missing","Alias for --filter-estimates-missing")}async function Se(e,t){let o=v(t),i=Date.now(),a=await oe($(e),o);y(a,o),o.profile&&p(`profile:command=aggregate took_ms=${Date.now()-i}`)}async function Ie(e,t){let o=v(t),i=Date.now(),a=H(I("context",e,o)),n=await Y(a,o),r=W(a,o);if(r==="markdown")o.quiet||h(`${X(n)}
4
4
  `);else if(r==="ndjson"){_(n);let d=S([...n.high_level,...n.low_level,...n.blocked_fallback]);!o.quiet&&d.length>0&&h(`${d}
@@ -8,4 +8,4 @@ import{a as ce}from"./chunk-XHJ3H5PL.js";import"./chunk-DEZPZOQ7.js";import{b as
8
8
  `);return}for await(let a of le({...e,intervalMs:i}))o||h(`${F(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 Re(e){return e.cursor_mode==="row"?S(e.events):F(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=v(t),i=Date.now(),a=je(e,o.path);if(e.follow===!0){await Ce(a,e,o.quiet===!0);return}let n=await se(a);if(_(n),o.json){y(n,o),o.profile&&p(`profile:command=events took_ms=${Date.now()-i}`);return}let r=Re(n);!o.quiet&&r.length>0&&h(`${r}
10
10
  `),o.profile&&p(`profile:command=events took_ms=${Date.now()-i}`)}async function qe(e,t,o,i,a){let n=v(a),r=Date.now(),d=await V(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);y(d,n),n.profile&&p(`profile:command=graph took_ms=${Date.now()-r}`)}function Dt(e,t){let o=t?.commandFilter,i=n=>ve(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=O(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(Se)}if(i("context")){let n=e.command("context").alias("ctx").description("Show a token-efficient project context snapshot for next-work decisions.").option("--for <intent>",`Apply a declared context intent projection. ${g("context","--for")}`).option("--date <value>","Anchor date/time for agenda window calculations (ISO/date string or relative)").option("--from <value>","Agenda lower bound (ISO/date string or relative)").option("--to <value>","Agenda upper bound (ISO/date string or relative)").option("--past","Include past agenda entries in bounded windows").option("--type <value>","Filter by item type").option("--tag <value>","Filter by tag").option("--priority <value>","Filter by priority").option("--assignee <value>","Filter by assignee").option("--assignee-filter <value>","Filter assignee presence: assigned|unassigned").option("--sprint <value>","Filter by sprint").option("--release <value>","Filter by release").option("--parent <id>","Scope the snapshot to one item's subtree (the item plus all descendants)").option("--limit <n>","Limit focus and agenda rows per section").option("--after <cursor>","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(Ie)}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(Ae)}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");pe(n),n.action(De),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 (${ae}); default: search/eval-queries.json; errors show an example`).option("--format <value>","Eval output format override: json|toon").action(Fe),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(Ee);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(Oe);ce(n,!0),E(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")&&E(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(qe)}var Ft={resolveReadCommandOutputFormat:k,parseListFormat:ue};export{Ft as _testOnlyRegisterListQuery,Dt as registerListQueryCommands};
11
- //# sourceMappingURL=register-list-query-SPGPS3OS.js.map
11
+ //# sourceMappingURL=register-list-query-RR5KACJ3.js.map