@unbrained/pm-cli 2026.12.2 → 2026.12.3

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 (157) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli/commander-usage.js +4 -4
  3. package/dist/cli/expected-revisions.js +1 -1
  4. package/dist/cli/extension-command-help.js +4 -4
  5. package/dist/cli/main.js +5 -5
  6. package/dist/cli/runtime/invocation-rewrites.js +1 -1
  7. package/dist/cli/runtime-field-commands.js +2 -0
  8. package/dist/cli-bundle/bundle-manifest.json +1 -1
  9. package/dist/cli-bundle/chunks/chunk-3ESBFEQC.js +2 -0
  10. package/dist/cli-bundle/chunks/chunk-46AZP5QW.js +2 -0
  11. package/dist/cli-bundle/chunks/{chunk-OBPO6V7H.js → chunk-5WTBF4M4.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-3KEMIPKG.js → chunk-6TOZQ5BQ.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-4YYFY33T.js → chunk-AHVOEE7F.js} +2 -2
  14. package/dist/cli-bundle/chunks/chunk-CQHB3ZZH.js +2 -0
  15. package/dist/cli-bundle/chunks/chunk-DZPOS3YT.js +2 -0
  16. package/dist/cli-bundle/chunks/{chunk-ROTEELDL.js → chunk-E5ADC3HT.js} +65 -65
  17. package/dist/cli-bundle/chunks/{chunk-SY5C3U32.js → chunk-E5HO7HWP.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-3HKPVOAN.js → chunk-EDJ3KR2H.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-TKUG2X24.js → chunk-FWQNWPIV.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-7NAO7I75.js → chunk-H4U3LEOD.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-MZZ4ZJ5Z.js → chunk-HNMED75Y.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-SDXCJZKB.js → chunk-HPCMM74Q.js} +22 -22
  23. package/dist/cli-bundle/chunks/{chunk-WSEIEDEK.js → chunk-ITM4AMVM.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-Q6K7HWZ7.js → chunk-IW4A3I4N.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-7V65VACG.js → chunk-JJ73G5UT.js} +2 -2
  26. package/dist/cli-bundle/chunks/chunk-L4HMFRHB.js +2 -0
  27. package/dist/cli-bundle/chunks/{chunk-GOEQXVOI.js → chunk-LTQWPQ7H.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-UNBW2LF3.js → chunk-MRT3ADO4.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-ZL6J6JYT.js → chunk-PBMLIV74.js} +2 -2
  30. package/dist/cli-bundle/chunks/{chunk-G6TARHFK.js → chunk-PJMGWJKU.js} +2 -2
  31. package/dist/cli-bundle/chunks/chunk-Q2HMDV56.js +9 -0
  32. package/dist/cli-bundle/chunks/{chunk-OXC5KBIQ.js → chunk-RRBNCL63.js} +2 -2
  33. package/dist/cli-bundle/chunks/{chunk-CBUC4X7Q.js → chunk-TDOF7BKO.js} +3 -3
  34. package/dist/cli-bundle/chunks/chunk-UXEZXGAD.js +113 -0
  35. package/dist/cli-bundle/chunks/{chunk-PCDTWL6V.js → chunk-W7HA65EO.js} +2 -2
  36. package/dist/cli-bundle/chunks/{chunk-I4SPJQQI.js → chunk-XGNUDSCG.js} +3 -3
  37. package/dist/cli-bundle/chunks/{chunk-AHV3CSQG.js → chunk-XKJ5NWQ7.js} +2 -2
  38. package/dist/cli-bundle/chunks/{field-option-collisions-BBGTV7AD.js → field-option-collisions-DXKTKW6J.js} +2 -2
  39. package/dist/cli-bundle/chunks/item-revision-DXEF4XBU.js +2 -0
  40. package/dist/cli-bundle/chunks/item-transaction-EANA7V4W.js +2 -0
  41. package/dist/cli-bundle/chunks/{linked-resource-value-list-ZBIY4H23.js → linked-resource-value-list-5JRGUDUB.js} +2 -2
  42. package/dist/cli-bundle/chunks/{mutation-actor-NHN33ITJ.js → mutation-actor-S5G7FMNG.js} +2 -2
  43. package/dist/cli-bundle/chunks/{mutation-admission-PGKJTCG6.js → mutation-admission-HQVNPOXV.js} +2 -2
  44. package/dist/cli-bundle/chunks/{register-list-query-7S5QWDTI.js → register-list-query-SQF5PSJ4.js} +2 -2
  45. package/dist/cli-bundle/chunks/{register-mutation-EK6DVIQK.js → register-mutation-4AQ4CEBL.js} +2 -2
  46. package/dist/cli-bundle/chunks/{register-operations-6MURXE4V.js → register-operations-76P7OM4P.js} +2 -2
  47. package/dist/cli-bundle/chunks/{register-setup-RW26X3GJ.js → register-setup-T6OEOZK3.js} +2 -2
  48. package/dist/cli-bundle/chunks/{stage-4ZCF74G4.js → stage-KUICZHSF.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-4SCFAWAW.js → chunk-3LHBKFPD.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/chunk-4DDXERKN.js +2 -0
  51. package/dist/cli-bundle/focused-chunks/{chunk-JPZGC3W4.js → chunk-4YU75CWI.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-TXTPAFHJ.js → chunk-5JQVPQMN.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-KNBGHCIP.js → chunk-5Z4DXYBZ.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/chunk-7DOP5HEZ.js +44 -0
  55. package/dist/cli-bundle/focused-chunks/{chunk-TR22GU7M.js → chunk-AX4RBJ7B.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-7A6SEZEY.js → chunk-BEHQCHQV.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/chunk-BUIF6CMZ.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-E2IWEJL5.js +3 -0
  59. package/dist/cli-bundle/focused-chunks/chunk-GBU7GKNJ.js +2 -0
  60. package/dist/cli-bundle/focused-chunks/{chunk-EQCQTYKO.js → chunk-K35KTBDZ.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{chunk-VQIC3UZB.js → chunk-KNST4PGF.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-P2H3GTJK.js → chunk-L2XJB5PK.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/chunk-L6NOGC4N.js +100 -0
  64. package/dist/cli-bundle/focused-chunks/{chunk-VK3IE3TS.js → chunk-LWIIDPAV.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-6IY5CVGJ.js → chunk-M54BMYG4.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/{chunk-6BKT6XQN.js → chunk-NEK7RX3N.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/{chunk-BHNBPCHP.js → chunk-OKGWIW6C.js} +2 -2
  68. package/dist/cli-bundle/focused-chunks/{chunk-2DGKVXFT.js → chunk-RFDSSOTZ.js} +2 -2
  69. package/dist/cli-bundle/focused-chunks/chunk-SSX5YBDC.js +2 -0
  70. package/dist/cli-bundle/focused-chunks/{chunk-OG57ESZK.js → chunk-TIEQVIFN.js} +2 -2
  71. package/dist/cli-bundle/focused-chunks/{chunk-3COWDIPX.js → chunk-VEUBDQDP.js} +2 -2
  72. package/dist/cli-bundle/focused-chunks/{chunk-2UWKU2BQ.js → chunk-WDHNPNHX.js} +3 -3
  73. package/dist/cli-bundle/focused-chunks/{field-option-collisions-2C6DLUC4.js → field-option-collisions-32X7FP3H.js} +2 -2
  74. package/dist/cli-bundle/focused-chunks/item-revision-GUYSVVQD.js +2 -0
  75. package/dist/cli-bundle/focused-chunks/{item-transaction-LQLQLZE7.js → item-transaction-MLKHZPL7.js} +2 -2
  76. package/dist/cli-bundle/focused-chunks/{mutation-actor-DJMZUIZI.js → mutation-actor-RDZJTRW2.js} +2 -2
  77. package/dist/cli-bundle/focused-chunks/{mutation-admission-SDWQVVHN.js → mutation-admission-IQB6XL75.js} +2 -2
  78. package/dist/cli-bundle/focused-chunks/{stage-QBZIK3T5.js → stage-AA7LORZ2.js} +2 -2
  79. package/dist/cli-bundle/main.js +27 -27
  80. package/dist/cli-bundle/sdk-authoring.js +1 -1
  81. package/dist/cli-bundle/sdk-contracts.js +1 -1
  82. package/dist/cli-bundle/sdk-core.js +1 -1
  83. package/dist/cli-bundle/sdk-governance.js +1 -1
  84. package/dist/cli-bundle/sdk-graph.js +1 -1
  85. package/dist/cli-bundle/sdk-merge.js +63 -63
  86. package/dist/cli-bundle/sdk-query.js +1 -1
  87. package/dist/cli-bundle/sdk-runtime.js +1 -1
  88. package/dist/cli-bundle/sdk-testing.js +1 -1
  89. package/dist/cli-bundle/sdk.js +9 -9
  90. package/dist/core/extensions/loader.d.ts +8 -0
  91. package/dist/core/extensions/loader.js +1 -1
  92. package/dist/core/item/actionability.js +1 -1
  93. package/dist/core/output/output.js +16 -16
  94. package/dist/mcp/server.js +1 -1
  95. package/dist/sdk/cli-contracts/enum-contracts.d.ts +25 -1
  96. package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
  97. package/dist/sdk/cli-contracts/flag-contracts.d.ts +1 -1
  98. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  99. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  100. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  101. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  102. package/dist/sdk/context-intent-contracts.js +1 -1
  103. package/dist/sdk/lifecycle/expect-hash-admission.d.ts +27 -8
  104. package/dist/sdk/lifecycle/expect-hash-admission.js +1 -1
  105. package/dist/sdk/lifecycle/item-revision.d.ts +12 -4
  106. package/dist/sdk/lifecycle/item-revision.js +1 -1
  107. package/dist/sdk/output-projection.d.ts +1 -1
  108. package/dist/sdk/output-projection.js +1 -1
  109. package/dist/sdk/public-surface.json +1 -1
  110. package/dist/sdk/read-output/surfaces.js +1 -1
  111. package/dist/sdk/runtime/schema.js +1 -1
  112. package/dist/sdk/runtime-input.d.ts +6 -0
  113. package/dist/sdk/runtime-input.js +1 -1
  114. package/dist/sdk/runtime-primitives.d.ts +1 -1
  115. package/dist/sdk/runtime-primitives.js +1 -1
  116. package/dist/sdk/runtime.js +1 -1
  117. package/docs/COMMANDS.md +23 -5
  118. package/docs/EXTENSIONS.md +1 -1
  119. package/docs/SDK.md +15 -2
  120. package/marketplace.json +1 -1
  121. package/package.json +1 -1
  122. package/packages/pm-beads/package.json +1 -1
  123. package/packages/pm-calendar/package.json +1 -1
  124. package/packages/pm-command-kit/package.json +1 -1
  125. package/packages/pm-digital-twin/package.json +1 -1
  126. package/packages/pm-governance-audit/package.json +1 -1
  127. package/packages/pm-guide-shell/package.json +1 -1
  128. package/packages/pm-kanban/package.json +1 -1
  129. package/packages/pm-lifecycle-hooks/package.json +1 -1
  130. package/packages/pm-linked-test-adapters/package.json +1 -1
  131. package/packages/pm-search-advanced/package.json +1 -1
  132. package/packages/pm-templates/package.json +1 -1
  133. package/packages/pm-todos/package.json +1 -1
  134. package/packages/pm-vcs/package.json +1 -1
  135. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  136. package/plugins/pm-claude/package.json +1 -1
  137. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  138. package/plugins/pm-codex/package.json +1 -1
  139. package/plugins/pm-codex/plugin.json +1 -1
  140. package/runtime-dependencies.json +1 -1
  141. package/dist/cli-bundle/chunks/chunk-A5ZEMOVR.js +0 -2
  142. package/dist/cli-bundle/chunks/chunk-C6WM6ZN4.js +0 -9
  143. package/dist/cli-bundle/chunks/chunk-HZZLSBIJ.js +0 -2
  144. package/dist/cli-bundle/chunks/chunk-L2ZSSMYY.js +0 -2
  145. package/dist/cli-bundle/chunks/chunk-NRQCBUYD.js +0 -113
  146. package/dist/cli-bundle/chunks/chunk-QDV7S2QS.js +0 -2
  147. package/dist/cli-bundle/chunks/chunk-V2S4XAX3.js +0 -2
  148. package/dist/cli-bundle/chunks/item-revision-3LENTXYF.js +0 -2
  149. package/dist/cli-bundle/chunks/item-transaction-56J5OCHA.js +0 -2
  150. package/dist/cli-bundle/focused-chunks/chunk-HTDYNY4L.js +0 -2
  151. package/dist/cli-bundle/focused-chunks/chunk-J72TRWR5.js +0 -44
  152. package/dist/cli-bundle/focused-chunks/chunk-N64AC5G6.js +0 -100
  153. package/dist/cli-bundle/focused-chunks/chunk-QZRYGYTI.js +0 -2
  154. package/dist/cli-bundle/focused-chunks/chunk-SQMOF65W.js +0 -2
  155. package/dist/cli-bundle/focused-chunks/chunk-T3ILWAEV.js +0 -2
  156. package/dist/cli-bundle/focused-chunks/chunk-W4JMV7GF.js +0 -3
  157. package/dist/cli-bundle/focused-chunks/item-revision-723XCQPS.js +0 -2
@@ -1,3 +1,3 @@
1
- import{a as A,c as b,d as C,e as E,k as S,m as x}from"./chunk-SY5C3U32.js";import{lb as w,mb as R,nb as k}from"./chunk-ZL6J6JYT.js";import{Ka as v,pa as p,sa as g,ta as a}from"./chunk-C6WM6ZN4.js";import{_ as O,kd as B}from"./chunk-CBUC4X7Q.js";import{Ke as H,Pe as u,Qe as y,ah as I}from"./chunk-NRQCBUYD.js";import{A as c,C as f}from"./chunk-K672XXGQ.js";function _(r,e){if(typeof r!="string")return;let o=Number.parseInt(r,10);if(!/^\d+$/.test(r.trim())||!Number.isSafeInteger(o))throw new f(`history-compact ${e} must be a non-negative integer.`,c.USAGE);return o}async function D(r,e,o){let t=p(o),s=Date.now(),i=await O(a(e,"ids")),l=i===void 0?void 0:B(i),m=_(e.allOver,"--all-over"),d=_(e.minEntries,"--min-entries");if(e.closed===!0&&e.allStreams===!0)throw new f("history-compact: --closed and --all-streams are mutually exclusive; pick one lifecycle scope.",c.USAGE);let n=e.closed===!0?"closed":e.allStreams===!0?"all-streams":void 0;if((l!==void 0||m!==void 0||n!==void 0)&&typeof e.before=="string")throw new f("history-compact: --before applies only in single-id mode (bulk mode always compacts full streams).",c.USAGE);if(b(r,{ids:l,allOver:m,scope:n}),r!==void 0&&d!==void 0)throw new f("history-compact: --min-entries applies only in bulk mode (single-id mode compacts the named stream).",c.USAGE);if(r===void 0){let h=await C({ids:l,scope:n,allOver:m,minEntries:d,dryRun:e.dryRun===!0,author:a(e,"author"),message:a(e,"message"),force:!!e.force},t);u(h,t),h.totals.items_errored>0&&(process.exitCode=c.GENERIC_FAILURE)}else{let h=await A(r,{before:a(e,"before"),dryRun:e.dryRun===!0,author:a(e,"author"),message:a(e,"message"),force:!!e.force},t);u(h,t)}t.profile&&y(`profile:command=history-compact took_ms=${Date.now()-s}`)}async function N(r,e,o,t){let s=p(t),i=Date.now(),l=await x(r,e,{author:a(o,"author"),message:a(o,"message"),force:!!o.force},s);await v(s,l),u(l,s),s.profile&&y(`profile:command=restore took_ms=${Date.now()-i}`)}async function F(r,e){let o=p(e),t=await S({verify:a(r,"verify"),output:a(r,"output"),hashAlgorithm:a(r,"hashAlgorithm")},o);"format"in t?(I(t),o.quiet||H(`${JSON.stringify(t,null,2)}
1
+ import{a as A,c as b,d as C,e as E,k as S,m as x}from"./chunk-E5HO7HWP.js";import{lb as w,mb as R,nb as k}from"./chunk-PBMLIV74.js";import{Ka as v,pa as p,sa as g,ta as a}from"./chunk-Q2HMDV56.js";import{_ as O,kd as B}from"./chunk-TDOF7BKO.js";import{Ne as H,Se as u,Te as y,eh as I}from"./chunk-UXEZXGAD.js";import{A as c,C as f}from"./chunk-K672XXGQ.js";function _(r,e){if(typeof r!="string")return;let o=Number.parseInt(r,10);if(!/^\d+$/.test(r.trim())||!Number.isSafeInteger(o))throw new f(`history-compact ${e} must be a non-negative integer.`,c.USAGE);return o}async function D(r,e,o){let t=p(o),s=Date.now(),i=await O(a(e,"ids")),l=i===void 0?void 0:B(i),m=_(e.allOver,"--all-over"),d=_(e.minEntries,"--min-entries");if(e.closed===!0&&e.allStreams===!0)throw new f("history-compact: --closed and --all-streams are mutually exclusive; pick one lifecycle scope.",c.USAGE);let n=e.closed===!0?"closed":e.allStreams===!0?"all-streams":void 0;if((l!==void 0||m!==void 0||n!==void 0)&&typeof e.before=="string")throw new f("history-compact: --before applies only in single-id mode (bulk mode always compacts full streams).",c.USAGE);if(b(r,{ids:l,allOver:m,scope:n}),r!==void 0&&d!==void 0)throw new f("history-compact: --min-entries applies only in bulk mode (single-id mode compacts the named stream).",c.USAGE);if(r===void 0){let h=await C({ids:l,scope:n,allOver:m,minEntries:d,dryRun:e.dryRun===!0,author:a(e,"author"),message:a(e,"message"),force:!!e.force},t);u(h,t),h.totals.items_errored>0&&(process.exitCode=c.GENERIC_FAILURE)}else{let h=await A(r,{before:a(e,"before"),dryRun:e.dryRun===!0,author:a(e,"author"),message:a(e,"message"),force:!!e.force},t);u(h,t)}t.profile&&y(`profile:command=history-compact took_ms=${Date.now()-s}`)}async function N(r,e,o,t){let s=p(t),i=Date.now(),l=await x(r,e,{author:a(o,"author"),message:a(o,"message"),force:!!o.force},s);await v(s,l),u(l,s),s.profile&&y(`profile:command=restore took_ms=${Date.now()-i}`)}async function F(r,e){let o=p(e),t=await S({verify:a(r,"verify"),output:a(r,"output"),hashAlgorithm:a(r,"hashAlgorithm")},o);"format"in t?(I(t),o.quiet||H(`${JSON.stringify(t,null,2)}
2
2
  `)):u(t,o),"ok"in t&&!t.ok&&(process.exitCode=c.GENERIC_FAILURE)}function ee(r,e){r.command(e?"attest":"history-attest",{hidden:!e}).summary("Export or verify history proof.").option("--verify <file>","Compare retained streams with a detached JSON proof").option("--output <file>","Create a proof file and return a compact receipt").option("--hash-algorithm <name>","Bundle digest algorithm: sha256 (default) or sha512").description("Export exact-byte history commitments, or verify an independently retained proof without tracker writes.").action(F),r.command("restore",{hidden:!e}).summary("Restore a version.").argument("<id>","Item id").argument("<target>","Restore target timestamp or version number").option("--author <value>","Mutation author").option("--message <value>","History message").option("--force","Force ownership/lock override").description("Restore an item to an earlier timestamp or version.").action(N),r.command(e?"redact":"history-redact",{hidden:!e}).summary("Redact sensitive values.").argument("<id>","Item id").option("--literal <value>","Literal; repeatable",g).option("--regex <value>","Raw RegExp source (repeatable; e.g. /var/[a-z]+) or /pattern/flags. Leading-slash input is a literal only when the final unescaped slash is followed by supported JavaScript flag letters or nothing.",g).option("--replacement <value>",'Default: "[redacted]"').option("--dry-run","Preview; no item/history edits").option("--author <value>","Author").option("--message <value>","Audit marker message").option("--force","Override owner/lock").description("Redact and reseal item history.").action(async(o,t,s)=>{let i=p(s),l=Date.now(),m=Array.isArray(t.literal)?t.literal:void 0,d=Array.isArray(t.regex)?t.regex:void 0,n=await E(o,{literal:m,regex:d,replacement:a(t,"replacement"),dryRun:t.dryRun===!0,author:a(t,"author"),message:a(t,"message"),force:!!t.force},i);n.changed&&!n.dry_run&&await v(i,n),u(n,i),i.profile&&y(`profile:command=history-redact took_ms=${Date.now()-l}`)}),r.command(e?"repair":"history-repair",{hidden:!e}).summary("Repair drift.").argument("[id]","Item id (omit with --all)").option("--salvage-tail","Recover invalid tail; requires verified prefix").option("--append-only","Bridge breaks; never rewrite entries").option("--all","Scan every stream for drift and repair each drifted stream in one audited pass").option("--dry-run","Preview the re-anchor impact without writing the history file").option("--normalize-provenance","Remove invalid provenance; return aggregate-only evidence").option("--author <value>","Mutation author").option("--message <value>","Audit history message for the repair marker entry").option("--force","Force ownership/lock override").description("Re-anchor a drifted item history chain (recompute hashes, reconcile with the on-disk item) and record an audit marker. Use --all to repair every drifted stream.").action(async(o,t,s)=>{let i=p(s),l=Date.now(),m=t.all===!0;R(o,m);let d={dryRun:t.dryRun===!0,author:a(t,"author"),message:a(t,"message"),force:!!t.force,normalizeProvenance:t.normalizeProvenance===!0,salvageTail:t.salvageTail===!0,appendOnly:t.appendOnly===!0};if(m){let n=await k(d,i);u(n,i),n.totals.failed>0&&(process.exitCode=c.GENERIC_FAILURE)}else{let n=await w(o,d,i);u(n,i)}i.profile&&y(`profile:command=history-repair took_ms=${Date.now()-l}`)}),r.command(e?"compact":"history-compact",{hidden:!e}).summary("Compact streams.").argument("[id]","Item id (omit when using a bulk selector)").option("--before <value>","Compact entries strictly before this version number or ISO timestamp (single-id mode only)").option("--ids <value>","Bulk IDs: comma/newline text, - stdin, or @path file").option("--all-over <n>","Bulk: compact every stream with more than N entries").option("--closed","Bulk: compact only closed (terminal) items' streams").option("--all-streams","Bulk: compact every history stream regardless of lifecycle state").option("--min-entries <n>","Bulk: skip streams with at most N entries (already compact; default 3)").option("--dry-run","Preview compaction impact without writing the history file").option("--author <value>","Mutation author").option("--message <value>","Audit history message for the compaction marker entry").option("--force","Force ownership/lock override").description("Compact item history streams into a synthetic baseline plus retained tail entries. Pass an item id for one stream, or a bulk selector (--ids/--all-over/--closed/--all-streams) to compact many.").action(D)}export{ee as a};
3
- //# sourceMappingURL=chunk-PCDTWL6V.js.map
3
+ //# sourceMappingURL=chunk-W7HA65EO.js.map
@@ -1,3 +1,3 @@
1
- import{H as V,ea as W}from"./chunk-TE6FBDHP.js";import{A as p,C as m}from"./chunk-K672XXGQ.js";import De from"node:crypto";function Le(e){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return e.toString();if(e===void 0)return"undefined";if(typeof e=="symbol")return e.toString();if(typeof e=="function")return`[function:${e.name||"anonymous"}]`}function Pe(e){let t=Object.keys(e).sort(),n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=b(o))}return n}function b(e){let t=Le(e);if(t!==void 0)return t;if(Array.isArray(e))return e.map(r=>b(r));if(e instanceof Date)return e.toISOString();let n=e;if(typeof n.toJSON=="function"){let r=n.toJSON();if(r!==e)return b(r)}return Pe(e)}function _(e){return JSON.stringify(b(e))}function B(e,t,n,r){for(let o=0;o<t.length;o+=1)if(!n.has(o)&&r(e,t[o]))return n.add(o),!0;return!1}function Ue(e,t){if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.toString()===t.toString()}function Fe(e,t){if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}function ve(e,t){if(!(e instanceof Set||t instanceof Set))return;if(!(e instanceof Set&&t instanceof Set)||e.size!==t.size)return!1;let n=[...t],r=new Set;for(let o of e)if(!B(o,n,r,E))return!1;return!0}function je(e,t){if(!(e instanceof Map||t instanceof Map))return;if(!(e instanceof Map&&t instanceof Map)||e.size!==t.size)return!1;let n=[...t.entries()],r=new Set;for(let[o,i]of e.entries())if(!B([o,i],n,r,([a,c],[u,l])=>E(a,u)&&E(c,l)))return!1;return!0}function He(e,t){if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,r)=>E(n,t[r]))}function Ge(e,t){let n=Object.keys(e).sort((o,i)=>o.localeCompare(i)),r=Object.keys(t).sort((o,i)=>o.localeCompare(i));if(n.length!==r.length)return!1;for(let o=0;o<n.length;o+=1){let i=n[o];if(i!==r[o]||!E(e[i],t[i]))return!1}return!0}var ze=[Ue,Fe,ve,je,He];function E(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;for(let n of ze){let r=n(e,t);if(r!==void 0)return r}return Ge(e,t)}function Mn(e){return De.createHash("sha256").update(e,"utf8").digest("hex")}function Tn(e,t){let n={};for(let o of t){let i=e[o];i!==void 0&&(n[o]=i)}let r=Object.keys(e).filter(o=>!t.includes(o)).sort((o,i)=>o.localeCompare(i));for(let o of r){let i=e[o];i!==void 0&&(n[o]=i)}return n}var qe=[["history-redact","history redact"],["history-repair","history repair"],["history-compact","history compact"],["activity","history activity"],["restore","history restore"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-tqel"})),Ve=[...["next","focus"].map(e=>({alias:e,canonical:`context ${e}`,owner:"pm-kcs4"})),...["stats","health","validate","gc","telemetry","eval","test-all"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-6apl"})),...["normalize","reindex"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-3i9q8g"})),{alias:"events",canonical:"history events",owner:"pm-3i9q8g"}].map(e=>({...e,canonical_argv:e.canonical.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap"})),We=[["update-many","update many"],["close-many","close many"],["delete","close delete"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-ik19"})),Be=[...Ve,...We,...["init","config","schema","profile"].map(e=>({alias:e,canonical:`workspace ${e}`,canonical_argv:["workspace",e],lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-npr3"})),...[...["comments","notes","learnings","files","docs","deps","append","test"].map(e=>[e,`item ${e}`,"pm-yql1"]),["test-runs-worker","item test worker","pm-lp4j"],...["statuses","tags","types"].map(e=>[`completion-${e}`,`completion ${e}`,"pm-szdc"]),["history-author-acknowledge","history acknowledge","pm-djyvbk"],["copy","item copy","pm-m6g87m"],["merge","workspace merge","pm-m6g87m"],["duplicates","item duplicates","pm-fmy9ih"],["dedupe-audit","item duplicates audit","pm-fmy9ih"],["dedupe-merge","item duplicates merge","pm-fmy9ih"],["comments-audit","item audit-comments","pm-fmy9ih"],["search-advanced","search advanced","pm-wfskfn"],...["meet","event","remind"].map(e=>[e,`calendar ${e}`,"pm-o3fh"])].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:n}))],R=[{alias:"history-attest",canonical:"history attest",canonical_argv:["history","attest"],lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-3z0k"},...qe,...Be,...["discover","lookup"].map(e=>({alias:`files ${e}`,canonical:`item files ${e}`,canonical_argv:["item","files",e],lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-yql1"}))];function In(e){let t;for(let n of R)n.canonical_argv.length<=(t?.canonical_argv.length??0)||n.canonical_argv.every((r,o)=>r===(o===0&&e[o]==="ctx"?"context":e[o]))&&(t=n);return t}function Ze(e){let t=e.trim().replace(/\s+/gu," ");return R.find(n=>n.canonical===t.replace(/^ctx /u,"context "))?.alias??t}function kn(e){return Ze(e)}var Z=[...R,...[["ctx","context"],["packages","package"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:[t],lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-pbyu"})),...[["start-task","claim","--start"],["pause-task","release","--pause"],["close-task","close","--release-assignment"]].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:[t,n],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-eq4x"})),{alias:"tests",canonical:"item test",canonical_argv:["item","test"],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-u4t9gp"},...[["fetch","get"],["read","get"],["show","get"],["view","get"],["comment","comments"],["note","notes"],["learning","learnings"]].map(([e,t])=>({alias:e,canonical:["comments","notes","learnings"].includes(t)?`item ${t}`:t,canonical_argv:["comments","notes","learnings"].includes(t)?["item",t]:[t],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-pbyu"})),...[["extension scaffold","extension init"],["package scaffold","package init"],["packages scaffold","package init"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-ya7x55"})),...[["extension list","package inventory"],["package list","package inventory"],["packages list","package inventory"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-gh1777"})),{alias:"list-all",canonical:"list",canonical_argv:["list","--all"],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"},...[["list-draft","draft"],["list-open","open"],["list-in-progress","in_progress"],["list-blocked","blocked"],["list-closed","closed"],["list-canceled","canceled"]].map(([e,t])=>({alias:e,canonical:"list",canonical_argv:["list","--status",t],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"})),...[["extension","package"],["install","package install"],["upgrade","package upgrade"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-tnud"}))],Nn=Object.fromEntries(Z.filter(e=>e.registration==="bootstrap").map(e=>[e.alias,e.canonical]));function Dn(e){let t=e.trim().toLowerCase();return Z.find(n=>n.alias===t)}function Ln(e){return`Deprecated command \`${e.alias}\`; use \`pm ${e.canonical_argv.join(" ")}\`.`}var Ke="PM_COMMAND_SHELL",Xe=new Map([["posix","posix"],["sh","posix"],["bash","posix"],["zsh","posix"],["cmd","cmd"],["cmd.exe","cmd"],["powershell","powershell"],["pwsh","powershell"]]),X=(e=process.platform,t=process.env)=>{let n=t[Ke]?.trim().toLowerCase(),r=n===void 0?void 0:Xe.get(n);return r!==void 0?r:e==="win32"?"cmd":"posix"},I=e=>{let t='"',n=0;for(let r of e){if(r==="\\"){n+=1;continue}t+="\\".repeat(r==='"'?n*2+1:n),t+=r,n=0}return`${t}${"\\".repeat(n*2)}"`},K=new Set(["(",")","!","^",'"',"<",">","&","|"]),k=e=>{let t="";for(let n=0;n<e.length;n+=1){let r=e[n];if(K.has(r)){t+=`^${r}`;continue}t+=r,r==="%"&&!K.has(e.charAt(n+1))&&(t+="^")}return t},Ye=/["%]/u,Je=/\r\n|[\r\n]/gu,Qe=e=>{let t=e.replace(Je," "),n=I(t);return Ye.test(t)?k(n):n},et=/['\u2018\u2019\u201A\u201B]/gu,N=e=>e.replace(et,"$&$&"),tt=e=>`'${N(e)}'`,nt={posix:/^(?!=)[A-Za-z0-9._:/@=-]+$/u,cmd:/^[A-Za-z0-9._:/\\@=-]+$/u,powershell:/^(?!--$)[A-Za-z0-9._:/\\=-][A-Za-z0-9._:/\\@=-]*$/u},rt=(e,t=process.platform,n)=>{let r=n??X(t);return nt[r].test(e)?e:r==="cmd"?Qe(e):r==="powershell"?tt(e):it(e)},ot=/!|[\r\n]|\\$/u,it=e=>ot.test(e)?`'${e.replaceAll("'","'\\''")}'`:`"${e.replace(/(["\\$`])/g,"\\$1")}"`,Un=(e,t=process.platform,n)=>{let r=n??X(t),o=e.map(i=>rt(i,t,r)).join(" ");return o.length>0?`pm ${o}`:"pm"};import{AsyncLocalStorage as st}from"node:async_hooks";var te="[redacted]",at=/%\^?40/giu,O=/@|%\^?40/iu;function ne(e,t=e.length){let n=-1;for(let r of e.matchAll(at)){if(r.index>t)break;n=r.index}return n}function ct(e,t){if(/[\t\n\r]/u.test(e)||!/(?:^|[^A-Za-z0-9+.-])(?:https?|wss?|ftp)$/iu.test(e.slice(0,t)))return!1;let n=t+1;for(;e[n]==="/"||e[n]==="\\";)n+=1;let r=e.indexOf("/",n)-n;if(r<0)return!1;let o=n+r;return!/[:@%]/u.test(e.slice(n,o))&&!/[:%]|[/\\][/\\]/u.test(e.slice(o))}function re(e){let t=Math.max(e.lastIndexOf("@"),ne(e)),n=e.indexOf(":");if(t<0||n<0||n>t)return;let r=n+1;for(;r<t&&r<n+3&&(e[r]==="/"||e[r]==="\\");)r+=1;return r===t||ct(e,n)?void 0:[r,t]}function ut(e){return e.length<=fe&&de.test(e)&&Number(e.slice(e.lastIndexOf(":")+1))<=65535}function lt(e){let t=e.indexOf(":");if(t<0)return!0;if(!/(?:^|[^A-Za-z0-9+.-])(?:https?|wss?|ftp)$/iu.test(e.slice(0,t)))return!1;let n=t+1;for(;e[n]==="/"||e[n]==="\\";)n+=1;let r=e.indexOf("/",n);if(r<0)return!1;let o=e.slice(n,r);return/[@%]/u.test(o)||o.includes(":")&&!ut(o)?!1:!/[:%]|[/\\][/\\]/u.test(e.slice(r))}function dt(e){let t=[0];if(!/\s/u.test(e))return t;let n=!0,r=0;for(let o of e.matchAll(/\S+/gu)){let i=o[0];/[\t\r\n]/u.test(e.slice(r,o.index))&&(n=!1),n&&o.index>0&&Ft(i)&&(re(e.slice(t.at(-1),o.index))===void 0?t.push(o.index):n=!1),n&&=lt(i),r=o.index+i.length}return t}function L(e){if(!O.test(e))return[];let t=dt(e),n=[];return t.forEach((r,o)=>{let i=re(e.slice(r,t[o+1]));i&&n.push([r+i[0],r+i[1]])}),n}function P(e){let t=[],n=0;for(let[r,o]of L(e))t.push(e.slice(n,r),te),n=o;return n===0?e:`${t.join("")}${e.slice(n)}`}function oe(e){return P(e)}var ie=["author","assignee","claim_principal"];function zn(e){let t={...e};for(let n of ie)typeof t[n]=="string"&&(t[n]=oe(t[n]));return t}function se(e,t){if(!(typeof e!="string"||L(e.trim()).length===0))throw new m(`${t} must not carry URL credentials: an identity is a name, never a credential.`,p.USAGE,{code:"invalid_argument_value",field:t,required:`Set ${t} to a plain name such as agent-a, with no URL userinfo (no user, password or token before the host).`,nextSteps:[`Rerun with ${t} set to a plain name.`],url_credentials_rejected:{source:t}})}function qn(e,t){return se(e,t),e}var ft=[["comments","author"],["notes","author"],["learnings","author"],["dependencies","author"],["plan_decisions","author"],["plan_discoveries","author"],["plan_steps","owner"],["tests","provenance","author"],["tests","updated_by"]],pt=4;function D(e,t,n=0){if(typeof e=="string"){se(e,t);return}if(!(n>=pt||typeof e!="object"||e===null))for(let r of Object.values(e))D(r,t,n+1)}function mt(e,t){let n=e;for(let r of t){if(typeof n!="object"||n===null||Array.isArray(n))return;n=n[r]}return n}function ae(e){let t=e;for(let n of ie)D(t[n],n);for(let[n,...r]of ft){let o=t[n];Array.isArray(o)&&o.forEach((i,s)=>{D(mt(i,r),`${n}[${s}].${r.join(".")}`)})}}function Vn(e){return typeof e=="string"?oe(e):e}var x=6,gt=65536,ce={carried:!1,fragments:new Set,fragmentLength:x,shortSpellings:[]},U=new st;function ue(e){let t=e.toLowerCase();if(t.length===e.length)return t;let n="";for(let r of e){let o=r.toLowerCase();n+=o.length===r.length?o:r}return n}function ht(e){let t=I(`${e}@`),n=[e,e.replaceAll(/(["\\$`])/gu,"\\$1"),e.replaceAll("'","'\\''"),t.slice(1,-2),k(t).slice(2,-3),N(e)];return[...n,...n.map(r=>JSON.stringify(r).slice(1,-1))]}function yt(e){let t=e.indexOf(":");return t>=0&&t<e.length-1?t+1:0}function _t(e,t){return e.slice(t[0]+yt(e.slice(t[0],t[1])),t[1])}function St(e){let t=new Set,n=!1;for(let r of e)for(let[o,i]of L(r)){n=!0;for(let s of ht(_t(r,[o,i])))t.add(ue(s))}return{carried:n,spellings:[...t]}}function At(e){let{carried:t,spellings:n}=St(e),r=n.reduce((c,u)=>c+Math.max(0,u.length-x+1)+1,0),o=Math.max(1,Math.ceil(r/gt)),i=Math.max(x,o),s=new Set,a=new Set;for(let c of n){if(c.length<i){(c.length>=x||/\s/u.test(c))&&a.add(c);continue}for(let u=0;u+i<=c.length;u+=o)s.add(c.slice(u,u+i));s.add(c.slice(-i))}return{carried:t,fragments:s,fragmentLength:i,shortSpellings:[...a]}}function Et(e,t){let n=ue(e),r=new Uint8Array(e.length),o=!1,i=t.fragmentLength;for(let a=0;a+i<=n.length;a+=1)t.fragments.has(n.slice(a,a+i))&&(r.fill(1,a,a+i),o=!0);for(let a of t.shortSpellings)for(let c=n.indexOf(a);c>=0;c=n.indexOf(a,c+1))r.fill(1,c,c+a.length),o=!0;if(!o)return e;let s="";for(let a=0;a<e.length;a+=1)r[a]?(a===0||!r[a-1])&&(s+=te):s+=e[a];return s}function Wn(e,t){return U.run(At(e),t)}function Bn(){return(U.getStore()??ce).carried}var bt=16,le=512,de=/^(?:(?:[A-Za-z0-9-]+\.)+[A-Za-z0-9-]+|localhost):\d+$/iu,fe=260,xt={'"':'"',"'":"'","`":"`","<":">","(":")","[":"]"},Ot=new Set(["http","https","ws","wss","ftp","file"]);function Y(e,t=!1){let n=Rt(e);if(n<0)return;let r=j(e,n);if(n-r<2)return;let o=xt[e[r-1]??""],i=Ot.has(e.slice(r,n).toLowerCase()),s=n+1;for(;s<e.length&&(e[s]==="/"||e[s]==="\\");)s+=1;if(s===e.length)return{kind:"pending",closer:o,special:i};let a=F(e.slice(s),o);if(a.startsWith("[")||i&&/[/\\?#]/u.test(a)||v(a,o)>=0)return;let c=It(a,t);return c===void 0?void 0:{kind:c,closer:o,special:i}}var wt=new Set([")","]"]),$t="'\\''",Ct="'\\\\''";function F(e,t){return t==="'"?J(e.replaceAll(Ct,"_____").replaceAll($t,"____")):t==='"'?J(e):e}function pe(e,t){let n=t;for(;e[n]==="\\";)n+=1;return n}function Mt(e,t,n){let r=(n-t)%2===1;if(e[n]==='"')return r?n:-1;if(e[n]!=="^")return-1;if(e[n+1]==='"')return r?n+1:-1;let o=pe(e,n+1);return e[o]==='"'&&(o-n-1)%2===1?o:-1}function J(e){let t=[],n=0;for(let r=e.indexOf("\\");r>=0;r=e.indexOf("\\",r)){let o=pe(e,r),i=Mt(e,r,o);i>=0&&(t.push(e.slice(n,r),"_".repeat(i+1-r)),n=i+1),r=i>=0?i+1:o}return n===0?e:`${t.join("")}${e.slice(n)}`}function v(e,t){if(t===void 0)return-1;if(!wt.has(t))return Tt(e,t);let n=e.length;for(;n>0&&/[.,;:!?*_~`]/u.test(e[n-1]);)n-=1;return n>0&&e[n-1]===t?n-1:-1}function Tt(e,t){for(let n=e.indexOf(t);n>=0;n=e.indexOf(t,n+1)){if(t==="'"&&e[n+1]==="'"){n+=1;continue}let r=0;for(;n-r>0&&e[n-r-1]==="\\";)r+=1;if(r%2===0)return n}return-1}function Rt(e){let t=-1;for(let n=e.length-2;n>=0;n-=1){if(e[n]!==":"||e[n+1]!=="/"&&e[n+1]!=="\\")continue;let r=j(e,n);if(r===0||/[=?&#"'`(<[{,]/u.test(e[r-1]))return n;t=n}return t}function j(e,t){let n=t;for(;n>0&&/[A-Za-z0-9+.-]/u.test(e[n-1]);)n-=1;return n}function It(e,t){return e.includes(":")?!t&&e.length<=fe&&de.test(e)?void 0:"user":O.test(e)?void 0:"label"}function kt(e,t,n,r=-1){let o=Math.min(e.length,t+le),i=t,s=r,a=n.kind==="user",c=!1;for(let u=0;u<bt&&i<o;u+=1){let l=me(e,i,o);if(l===void 0)break;let d=Lt(e.slice(l[0],Math.min(l[1],o+3)),o-l[0],n);if(d.startsUrl)break;Nt(d,a,c)&&(s=l[1]);let f=/[\t\r\n]/u.test(e[l[1]]??"");if(a||=d.colon||d.trailingColon&&f,c||=d.trailingColon,d.endsAuthority)break;i=l[1]}return s}function Nt(e,t,n){return e.separator?t||e.colonBeforeSeparator||n&&(e.hasPath||e.closedByOpener):!1}function me(e,t,n){let r=t;for(;r<n&&/\s/u.test(e[r]);)r+=1;if(r===n)return;let o=r;for(;o<e.length&&!/\s/u.test(e[o]);)o+=1;return[r,o]}function Q(e){let t=e.indexOf(":");return t>=0&&t<e.length-1&&!Dt.test(e)}var Dt=/^\d{1,2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:Z|[AaPp][Mm])?[.,;:!?)]*$/u;function Lt(e,t,n){let r=F(e,n.closer),o=n.special?r.search(/[/\\?#]/u):-1,i=o<0?r:r.slice(0,o),s=v(i,n.closer),a=r.search(/:[/\\]/u),c=s<0?i:i.slice(0,s),u=Math.min(c.length,t)-1,l=u<0?-1:Math.max(c.lastIndexOf("@",u),ne(c,u));return{startsUrl:a>=0&&s<0&&ge(r.slice(0,a+1)),separator:l>=0,colonBeforeSeparator:l>0&&(Q(c.slice(0,l))||c[l-1]===":"),colon:Q(c),trailingColon:c.endsWith(":"),hasPath:s<0&&l>=0&&/[/\\]/u.test(r.slice(l+1)),closedByOpener:s>=0,endsAuthority:o>=0||s>=0}}function ge(e){let t=j(e,e.length-1);return t<e.length-2&&/[A-Za-z]/u.test(e[t])&&(t===0||t===1&&/["'`(<[]/u.test(e[0]))}function Pt(e,t,n){let r=Y(t,/[\t\r\n]/u.test(e.charAt(n)));if(r?.kind!=="pending")return r===void 0?void 0:{opening:r,from:n,seed:-1,final:!1};let o=me(e,n,Math.min(e.length,n+le));if(o===void 0)return;let i=F(e.slice(o[0],o[1]),r.closer),s=/^[/\\]*/u.exec(i)[0],a=i.slice(s.length),c=r.special?a.split(/[/\\?#]/u,1)[0]:a,u=v(c,r.closer),l=`${s}${u<0?c:c.slice(0,u)}`,d=O.test(l),f=d?{...r,kind:"user"}:Y(`${t}${l}`);if(f===void 0||f.kind==="pending")return;let g=d?o[1]:-1;return{opening:f,from:o[1],seed:g,final:l.length<i.length}}function Ut(e){if(!/:[/\\]/u.test(e))return e;let t=/\S+/gu,n="",r=0;for(let o=t.exec(e);o!==null;o=t.exec(e)){let i=Pt(e,o[0],o.index+o[0].length);if(i===void 0)continue;let s=i.final?i.seed:kt(e,i.from,i.opening,i.seed);s!==-1&&(n+=`${e.slice(r,o.index)}${P(e.slice(o.index,s))}`,r=s,t.lastIndex=s)}return r===0?e:`${n}${e.slice(r)}`}function Ft(e){let t=e.search(/:[/\\]/u);return t>=0&&ge(e.slice(0,t+1))}function Zn(e){let t=U.getStore()??ce,n=ee(e);return t.carried?ee(Et(n,t)):n}function ee(e){return O.test(e)?Ut(e).replaceAll(/\S+/gu,P):e}import vt from"node:crypto";import{AsyncLocalStorage as jt}from"node:async_hooks";var w=new jt,he=1024;function Ht(e){let t=Date.parse(e.clock);if(!Number.isFinite(t))throw new Error(`Invalid reproducible workspace clock: ${e.clock}`);if(!Number.isSafeInteger(e.tickMs)||e.tickMs<0)throw new Error("Reproducible workspace tickMs must be a non-negative integer");if(e.seed.trim().length===0)throw new Error("Reproducible workspace seed must not be empty");return{...e,clock:new Date(t).toISOString()}}function Gt(e){let n={...Ht(e),clockReads:0,tokenReads:0};return r=>w.run(n,r)}async function Jn(e,t){return Gt(e)(t)}function Qn(){return w.getStore()!==void 0}function ye(){let e=w.getStore();if(e===void 0)return;let t=new Date(Date.parse(e.clock)+e.clockReads*e.tickMs).toISOString();return e.clockReads+=1,t}function er(e){let t=w.getStore();if(t===void 0)return;if(!Number.isSafeInteger(e)||e<0||e>he)throw new Error(`Reproducible token length must be an integer between 0 and ${he}`);let n="";for(;n.length<e;){let r=vt.createHash("sha256").update(`${t.seed}\0${t.tokenReads}`).digest();t.tokenReads+=1;for(let o of r)if(n+=(o%36).toString(36),n.length===e)break}return n}var zt=/^([+-]?)(\d+)([hdwm])$/i,qt=/^[+-]?\d+[hdwm](?:[+-]\d+[hdwm])+$/i,Vt=/^(\d{4})(\d{2})(\d{2})$/,Wt=/^(\d{4})(\d{2})(\d{2})(?:[T\s]?)(\d{2})(\d{2})(\d{2})?([.,]\d{1,3})?(Z|[+-]\d{2}:?\d{2})?$/i,Bt=/^(\d{4}-\d{2}-\d{2})[T\s](\d{2})-(\d{2})(?:-(\d{2}))?([.,]\d{1,3})?(Z|[+-]\d{2}:?\d{2})?$/i,Zt=/^(\d{4}-\d{2}-\d{2})[T\s](\d{2})(\d{2})(\d{2})?([.,]\d{1,3})?(Z|[+-]\d{2}:?\d{2})?$/i,Kt=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|[+-](\d{2}):(\d{2}))$/i;function sr(){return ye()??new Date().toISOString()}function ar(e){return Number.isFinite(Date.parse(e))}function z(e){let t=Kt.exec(e);if(!t||!Number.isFinite(Date.parse(e)))return!1;let[,n,r,o,i,s,a,c,u]=t,[l,d,f,g,h,y]=[n,r,o,i,s,a].map(Number);return d>=1&&d<=12&&f>=1&&f<=q(l,d-1)&&g<=23&&h<=59&&y<=59&&(c===void 0||Number(c)<=23)&&(u===void 0||Number(u)<=59)}function cr(e){let t=/\.(\d+)(?:Z|[+-]\d{2}:\d{2})$/iu.exec(e)?.[1];return z(e)&&(t===void 0||/^\d{0,3}0*$/u.test(t))}var Xt=1e4,$=new Map;function _e(e){let t=$.get(e);if(t!==void 0)return t;let n=Date.parse(e);return $.size>=Xt&&V($),$.set(e,n),n}function A(e,t){let n=_e(e),r=_e(t);return Number.isFinite(n)&&Number.isFinite(r)&&n!==r?n-r:e.localeCompare(t)}function ur(e,t){return!(t.deadlineBefore&&(!e.deadline||A(e.deadline,t.deadlineBefore)>0)||t.deadlineAfter&&(!e.deadline||A(e.deadline,t.deadlineAfter)<0)||t.updatedAfter&&A(e.updated_at,t.updatedAfter)<0||t.updatedBefore&&A(e.updated_at,t.updatedBefore)>0||t.createdAfter&&A(e.created_at,t.createdAfter)<0||t.createdBefore&&A(e.created_at,t.createdBefore)>0)}function H(e){return e?`.${e.slice(1).padEnd(3,"0").slice(0,3)}`:""}function G(e){if(!e)return"";if(e.toUpperCase()==="Z")return"Z";let t=/^([+-]\d{2})(\d{2})$/.exec(e);return t?`${t[1]}:${t[2]}`:e}function Yt(e,t,n){n&&n!==t&&(e.includes(n)||e.push(n))}function Jt(e){let t=[],n=u=>Yt(t,e,u),r=Vt.exec(e);if(r){let[,u,l,d]=r;n(`${u}-${l}-${d}`)}let o=Wt.exec(e);if(o){let[,u,l,d,f,g,h,y,ke]=o,Ne=h?`:${h}`:"";n(`${u}-${l}-${d}T${f}:${g}${Ne}${H(y)}${G(ke)}`)}let i=Bt.exec(e);if(i){let[,u,l,d,f,g,h]=i,y=f?`:${f}`:"";n(`${u}T${l}:${d}${y}${H(g)}${G(h)}`)}let s=Zt.exec(e);if(s){let[,u,l,d,f,g,h]=s,y=f?`:${f}`:"";n(`${u}T${l}:${d}${y}${H(g)}${G(h)}`)}let a=10,c=e.slice(0,a);if(en(c)){let u=a;for(;u<e.length&&tn(e[u]);)u+=1;u<e.length&&n(`${c}T${e.slice(u)}`)}return t}function Qt(e){let t=Date.parse(e);if(Number.isFinite(t))return t;for(let n of Jt(e)){let r=Date.parse(n);if(Number.isFinite(r))return r}return Number.NaN}function en(e){if(e.length!==10)return!1;for(let t=0;t<e.length;t+=1){let n=e[t];if(t===4||t===7){if(n!=="-")return!1;continue}let r=n.charCodeAt(0);if(r<48||r>57)return!1}return!0}function tn(e){return e?e===" "||e===" "||e===`
2
- `||e==="\r"||e==="\f"||e==="\v":!1}function q(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}var nn=["January","February","March","April","May","June","July","August","September","October","November","December"],rn=/^(\d{4})-(\d{2})-(\d{2})/,on=/^(\d{4})(\d{2})(\d{2})(?:[T ]?\d{2}|$)/;function sn(e,t,n){let r=rn.exec(t)??on.exec(t);if(!r)return;let o=Number.parseInt(r[1],10),i=Number.parseInt(r[2],10),s=Number.parseInt(r[3],10),a=n?.trim()||"deadline";if(i<1||i>12)throw new m(`Invalid ${a} value "${e}". Month "${r[2]}" is out of range \u2014 use a month between 01 and 12.`,p.USAGE,{field:a,value:e});let c=q(o,i-1);if(s<1||s>c)throw new m(`Invalid ${a} value "${e}". ${nn[i-1]} ${o} has ${c} days, so day "${r[3]}" does not exist. Use a real YYYY-MM-DD calendar date.`,p.USAGE,{field:a,value:e})}function an(e,t){let n=new Date(e.getTime()),r=n.getUTCDate(),o=n.getUTCMonth()+t,i=n.getUTCFullYear()+Math.floor(o/12),s=(o%12+12)%12,a=Math.min(r,q(i,s));return n.setUTCFullYear(i,s,a),n}function lr(e,t=new Date,n="deadline"){let r=e.trim();if(r.toLowerCase()==="now")return t.toISOString();let o=zt.exec(r);if(o){let s=o[1]==="-"?-1:1,a=Number.parseInt(o[2],10)*s,c=o[3].toLowerCase();if(c==="m")return an(t,a).toISOString();let u=c==="h"?3600*1e3:c==="d"?1440*60*1e3:10080*60*1e3;return new Date(t.getTime()+a*u).toISOString()}sn(e,r,n);let i=Qt(r);if(!Number.isFinite(i)){let s=n.trim().length>0?n.trim():"deadline",a=qt.test(r)?"Compound relative expressions like +3d+1h are not supported; use a single relative token (for example +3d) or an ISO/date string.":'Use ISO/date string input, "now", or relative +6h/-6h/+1d/-1d/+2w/-2w/+6m/-6m.';throw new m(`Invalid ${s} value "${e}". ${a}`,p.USAGE,{field:s,value:e})}return new Date(i).toISOString()}function cn(e){let t=e.trim();return t.startsWith("-")&&!t.startsWith("--")}var Se=/[\s|,=<>[\]]/u;function un(e){let t=e.trim();if(cn(t))return t.length===2&&!Se.test(t[1])?void 0:"is not a short flag: a short flag is one dash and one character";let n=t.replace(/^--/u,"");if(n.length===0)return"is empty";if(n.startsWith("-"))return"starts with three dashes";if(n.endsWith("-")||n.includes("--"))return"has an empty segment between hyphens, which the option parser cannot turn into an option key";let r=Se.exec(n)?.[0];if(r!==void 0)return/\s/u.test(r)?"contains whitespace, which the option parser reads as a break between two flags":`contains ${JSON.stringify(r)}, which the option parser reads as ${r==="|"||r===","?"a break between two flags":r==="="?"the start of an attached value":"a value placeholder"}`}var ln=new Set(["-h","help"]);function Ae(e){let t=e.trim();return un(t)===void 0&&!ln.has(t.replace(/^--/u,""))}var dn=16;function C(e){let t=e.trim().replaceAll(/[^A-Za-z0-9]+/g," ").split(/\s+/).filter(o=>o.length>0).map(o=>o.toLowerCase());if(t.length===0)return e;let[n,...r]=t;return`${n}${r.map(o=>`${o.slice(0,1).toUpperCase()}${o.slice(1)}`).join("")}`}function Ar(e,t,n=new Set,r){if(Oe(e,t,r))return;let o=we(e,t,n,r),i=M(e);return[C(e.cli_flag),...i].find(a=>!o.has(a)&&xe(a,i,o))}function xe(e,t,n){for(let r of t){if(r===e)break;if(n.has(r))return!1}return!0}function Oe(e,t,n){return t.definitions.some(r=>r!==e&&r.metadata_key===e.metadata_key&&(n===void 0||r.commands.includes(n)))}function we(e,t,n,r){return new Set([...n,...t.definitions.filter(o=>o!==e&&(r===void 0||o.commands.includes(r))).flatMap(o=>M(o))])}function $e(e){return e.replace(/^-+/u,"").startsWith("no-")}function fn(e){return e.startsWith("-")?e:`--${e}`}function Er(e,t,n,r){if(Oe(e,t,r))return;let o=we(e,t,n.options,r),i=M(e);return[e.cli_flag,...e.cli_aliases].find(s=>{if(!Ae(s))return!1;let a=Ce(s);return $e(s)||n.flags.has(fn(s))||o.has(a)?!1:xe(a,i,o)})}function Ce(e){return e.replace(/^-+/u,"").replace(/^no-/u,"").split("-").reduce((t,n)=>`${t}${n.charAt(0).toUpperCase()}${n.slice(1)}`)}function M(e){return[...new Set([W(e),C(e.key),C(e.cli_flag),...e.cli_aliases.map(t=>C(t)),...[e.cli_flag,...e.cli_aliases].filter(t=>!$e(t)).map(t=>Ce(t))])]}function Me(e,t){for(let n of M(t)){if(!Object.hasOwn(e,n))continue;let r=e[n];if(r!==void 0)return r}}function Te(e){return Array.isArray(e)?e.flatMap(t=>Te(t)).map(t=>t.trim()).filter(t=>t.length>0):typeof e=="string"?e.split(/[,\n|]/).map(t=>t.trim()).filter(t=>t.length>0):e==null?[]:[String(e).trim()].filter(t=>t.length>0)}function Ee(e,t){if(typeof e=="boolean")return e;if(typeof e=="number"){if(e===1)return!0;if(e===0)return!1}if(typeof e=="string"){let n=e.trim().toLowerCase();if(n==="true"||n==="1"||n==="yes")return!0;if(n==="false"||n==="0"||n==="no")return!1}throw new m(`${t} must be one of true|false|1|0|yes|no`,p.USAGE)}function be(e,t){if(typeof e=="number"&&Number.isFinite(e))return e;let n=typeof e=="string"?e.trim():String(e),r=Number(n);if(!Number.isFinite(r))throw new m(`${t} must be a number`,p.USAGE);return r}function pn(e,t,n){let r=typeof e=="string"?(()=>{try{return JSON.parse(e)}catch{return}})():e;if(n==="array"&&Array.isArray(r)||n==="object"&&typeof r=="object"&&r!==null&&!Array.isArray(r))return r;throw new m(`${t} must be valid JSON ${n}`,p.USAGE)}function mn(e,t){return t===void 0?!0:t==="array"?Array.isArray(e):t==="object"?typeof e=="object"&&e!==null&&!Array.isArray(e):typeof e===t}function gn(e,t,n){if(t.const!==void 0&&_(e)!==_(t.const))return`${n} must equal ${_(t.const)}`;if(t.enum!==void 0&&!t.enum.some(r=>_(r)===_(e)))return`${n} must be one of ${t.enum.map(r=>_(r)).join("|")}`;if(!mn(e,t.type))return`${n} must match configured type ${String(t.type)}`;if(typeof e=="string"){if(t.min_length!==void 0&&e.length<t.min_length)return`${n} must contain at least ${t.min_length} characters`;if(t.format==="date-time"&&!z(e))return`${n} must be an RFC 3339 date-time`}}function hn(e,t,n,r){if(Array.isArray(e)){if(t.min_items!==void 0&&e.length<t.min_items)return`${n} must contain at least ${t.min_items} items`;if(t.items)for(let[o,i]of e.entries()){let s=T(i,t.items,`${n}[${o}]`,r+1);if(s)return s}}}function yn(e,t,n,r){if(typeof e!="object"||e===null||Array.isArray(e))return;let o=e;for(let i of t.required??[])if(!Object.hasOwn(o,i))return`${n}.${i} is required`;for(let[i,s]of Object.entries(o)){let a=t.properties?.[i];if(!a){if(t.additional_properties===!1)return`${n}.${i} is not allowed`;continue}let c=T(s,a,`${n}.${i}`,r+1);if(c)return c}}function T(e,t,n,r=0){if(r>dn)return`${n} value schema exceeds maximum depth`;let o=gn(e,t,n);if(o)return o;let i=hn(e,t,n,r);if(i)return i;let s=yn(e,t,n,r);if(s)return s;if(!t.one_of)return;let a=0;for(let c of t.one_of)if(T(e,c,n,r+1)===void 0&&(a+=1,a>1))break;return a===1?void 0:`${n} must match exactly one configured schema variant`}function S(e,t,n){if(!e.value_schema||t===void 0)return t;let r=T(t,e.value_schema,n);if(r)throw new m(r,p.USAGE);return t}function _n(e,t,n,r){let o=r==="option"&&Array.isArray(t)?t[t.length-1]:t;if(o!==void 0)return S(e,pn(o,n,e.type),n)}function Re(e,t,n,r="option"){let o=n??`--${e.cli_flag}`;if(e.type==="array"||e.type==="object")return _n(e,t,o,r);if(e.repeatable||e.type==="string_array"){let s=Te(t);return e.type==="number"?S(e,s.map(a=>be(a,o)),o):e.type==="boolean"?S(e,s.map(a=>Ee(a,o)),o):S(e,s,o)}let i=Array.isArray(t)?t[t.length-1]:t;if(i!==void 0)return e.type==="number"?S(e,be(i,o),o):e.type==="boolean"?S(e,Ee(i,o),o):S(e,typeof i=="string"?i:String(i),o)}function Sn(e,t){return!e.required&&!e.required_on_create?!1:e.required_types.length===0?!0:t?e.required_types.map(n=>n.toLowerCase()).includes(t.trim().toLowerCase()):!1}function br(e,t,n){let r={},o=[];for(let i of t.command_to_fields.get("create")??[]){let s=Me(e,i);if(s===void 0){Sn(i,n)&&o.push(`--${i.cli_flag}`);continue}r[i.metadata_key]=Re(i,s)}return{values:r,missing_required_flags:[...new Set(o)].sort((i,s)=>i.localeCompare(s))}}function xr(e,t,n=["update"]){let r={},o=(n??["update"]).flatMap(s=>t.command_to_fields.get(s)??[]),i=new Set;for(let s of o){let a=Me(e,s);a!==void 0&&(i.has(s.metadata_key)||(i.add(s.metadata_key),r[s.metadata_key]=Re(s,a)))}return ae(r),r}var wr={include:"--output-include",amount:"--output-limit",cost:"--output-budget",encoding:"--output-format"},$r=Object.freeze(["--output-session","--output-cursor","--output-row-contract"]),Ie=["list","context","search","get","next","health","deps","graph","history","activity","validate","events","contracts","comments","notes","learnings","files","docs","stats","aggregate","duplicates","package-catalog","package-manage","comments-audit","assurance"];var An=Object.freeze([{flag:"--json"},{flag:"--lean"},{flag:"--token-accounting"},{flag:"--output-include",value_name:"fields",extension_command_availability:"read_output"},{flag:"--output-limit",value_name:"count",extension_command_availability:"read_output"},{flag:"--output-budget",value_name:"tokens",extension_command_availability:"read_output"},{flag:"--output-format",value_name:"toon|json"},{flag:"--output-session",value_name:"state",extension_command_availability:"read_output"},{flag:"--output-cursor",value_name:"cursor",extension_command_availability:"read_output"},{flag:"--output-row-contract",extension_command_availability:"read_output"},{flag:"--quiet"},{flag:"--no-changed-fields"},{flag:"--full-changed-fields"},{flag:"--id-only"},{flag:"--pm-path",aliases:["--path"],discovery_value_name:"path"},{flag:"--no-extensions",extension_command_availability:"never"},{flag:"--no-pager"},{flag:"--profile"},{flag:"--help",short:"-h"},{flag:"--author",value_name:"id"},{flag:"--expect-hash",value_name:"revision",repeatable:!0}]),Mr=new Set(An.flatMap(e=>[e.flag,...e.aliases??[],...e.short===void 0?[]:[e.short]]));var En={list:{include:["--brief","--compact","--fields","--full"],amount:["--after","--limit","--no-truncate"],cost:["--token-budget"],encoding:["--format","--stream"]},context:{include:["--fields","--section"],amount:["--after","--depth","--limit"],cost:["--token-budget"],encoding:["--format"]},search:{include:["--compact","--fields","--full"],amount:["--after","--limit"],cost:["--token-budget"],encoding:["--format"]},get:{include:["--fields","--full"],amount:["--depth"],cost:["--token-budget"],encoding:["--format"]},next:{amount:["--blocked-limit","--limit"],encoding:["--format"]},health:{include:["--brief","--check-only","--full","--summary"]},deps:{include:["--collapse","--full","--summary"],amount:["--edge-limit","--max-depth","--node-limit"],cost:["--token-budget"],encoding:["--format"]},graph:{include:["--full","--summary"],amount:["--after","--limit","--max-depth","--max-paths"]},history:{include:["--compact","--full"],amount:["--limit"],encoding:["--format"]},activity:{include:["--compact","--full"],amount:["--limit","--unbounded","--after"],encoding:["--stream"]},validate:{include:["--counts","--full"]},events:{include:["--full"],amount:["--limit"],encoding:["--follow"]},contracts:{include:["--full","--summary"]},comments:{amount:["--limit"]},notes:{amount:["--limit"]},learnings:{amount:["--limit"]},files:{amount:["--limit","--no-truncate","--offset"]},docs:{},stats:{},aggregate:{},duplicates:{amount:["--limit"]},"package-catalog":{},"package-manage":{},"comments-audit":{},assurance:{}},bn=new Set(["--collapse","--fields","--section"]),xn=Object.freeze({"--after":"--after retains cursor-position semantics; use --output-limit <n> separately to bound returned rows.","--check-only":"--check-only retains health side-effect semantics; --output-include does not suppress vector refresh.","--collapse":"--collapse retains dependency grouping semantics; --output-include does not replace it.","--depth":"--depth retains traversal or detail-depth semantics; --output-limit does not replace it.","--follow":"--follow retains event-tail semantics; --output-format does not enable following.","--max-depth":"--max-depth retains graph traversal-depth semantics; --output-limit does not replace it.","--max-paths":"--max-paths retains graph path-search semantics; use --output-limit separately to bound returned rows.","--no-truncate":"--no-truncate is a compatibility alias; prefer --output-limit unbounded --output-budget unbounded.","--offset":"--offset retains positional pagination semantics; use --output-limit separately to bound returned rows.","--stream":"--stream retains command streaming semantics; --output-format selects only static result encoding.","--unbounded":"--unbounded is a compatibility alias; prefer --output-limit unbounded."});function On(e){return e.slice(2).replaceAll("-","_")}var wn=new Set(["package manage","packages manage","package-manage"]);function Ir(e,t={}){let r=e==="package catalog"||e==="packages catalog"||e==="package-catalog"||(e==="package"||e==="packages"||e==="extension")&&(t.catalog===!0||t.target==="catalog"||t.action==="catalog")?"package-catalog":wn.has(e)?"package-manage":e.split(" ")[0],o=r.startsWith("list-")?"list":r==="ctx"?"context":r;return Ie.includes(o)?o:void 0}function kr(e){return new Map((En[e]?.include??[]).filter(t=>!bn.has(t)&&xn[t]===void 0).map(t=>[On(t),$n(t)]))}function $n(e){return e.slice(2).replace(/-([a-z])/gu,(t,n)=>n.toUpperCase())}export{_ as a,E as b,Mn as c,Tn as d,qe as e,Ve as f,We as g,Be as h,R as i,In as j,Ze as k,kn as l,Z as m,Nn as n,Dn as o,Ln as p,Ke as q,X as r,I as s,Qe as t,tt as u,rt as v,it as w,Un as x,te as y,P as z,oe as A,zn as B,se as C,qn as D,ae as E,Vn as F,Wn as G,Bn as H,Zn as I,An as J,Mr as K,Ht as L,Gt as M,Jn as N,Qn as O,er as P,sr as Q,ar as R,z as S,cr as T,A as U,ur as V,lr as W,cn as X,un as Y,Ae as Z,Ar as _,fn as $,Er as aa,Ce as ba,M as ca,Me as da,Re as ea,Sn as fa,br as ga,xr as ha,wr as ia,$r as ja,Ie as ka,En as la,bn as ma,xn as na,On as oa,Ir as pa,kr as qa,$n as ra};
3
- //# sourceMappingURL=chunk-I4SPJQQI.js.map
1
+ import{H as V,ea as W}from"./chunk-TE6FBDHP.js";import{A as p,C as m}from"./chunk-K672XXGQ.js";import De from"node:crypto";function Le(e){if(e===null)return null;if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return e.toString();if(e===void 0)return"undefined";if(typeof e=="symbol")return e.toString();if(typeof e=="function")return`[function:${e.name||"anonymous"}]`}function Pe(e){let t=Object.keys(e).sort(),n={};for(let r of t){let o=e[r];o!==void 0&&(n[r]=b(o))}return n}function b(e){let t=Le(e);if(t!==void 0)return t;if(Array.isArray(e))return e.map(r=>b(r));if(e instanceof Date)return e.toISOString();let n=e;if(typeof n.toJSON=="function"){let r=n.toJSON();if(r!==e)return b(r)}return Pe(e)}function _(e){return JSON.stringify(b(e))}function B(e,t,n,r){for(let o=0;o<t.length;o+=1)if(!n.has(o)&&r(e,t[o]))return n.add(o),!0;return!1}function Ue(e,t){if(e instanceof RegExp||t instanceof RegExp)return e instanceof RegExp&&t instanceof RegExp&&e.toString()===t.toString()}function Fe(e,t){if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime()}function ve(e,t){if(!(e instanceof Set||t instanceof Set))return;if(!(e instanceof Set&&t instanceof Set)||e.size!==t.size)return!1;let n=[...t],r=new Set;for(let o of e)if(!B(o,n,r,E))return!1;return!0}function je(e,t){if(!(e instanceof Map||t instanceof Map))return;if(!(e instanceof Map&&t instanceof Map)||e.size!==t.size)return!1;let n=[...t.entries()],r=new Set;for(let[o,i]of e.entries())if(!B([o,i],n,r,([a,c],[u,l])=>E(a,u)&&E(c,l)))return!1;return!0}function Ge(e,t){if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((n,r)=>E(n,t[r]))}function He(e,t){let n=Object.keys(e).sort((o,i)=>o.localeCompare(i)),r=Object.keys(t).sort((o,i)=>o.localeCompare(i));if(n.length!==r.length)return!1;for(let o=0;o<n.length;o+=1){let i=n[o];if(i!==r[o]||!E(e[i],t[i]))return!1}return!0}var ze=[Ue,Fe,ve,je,Ge];function E(e,t){if(Object.is(e,t))return!0;if(e===null||t===null||typeof e!="object"||typeof t!="object")return!1;for(let n of ze){let r=n(e,t);if(r!==void 0)return r}return He(e,t)}function Tn(e){return De.createHash("sha256").update(e,"utf8").digest("hex")}function Rn(e,t){let n={};for(let o of t){let i=e[o];i!==void 0&&(n[o]=i)}let r=Object.keys(e).filter(o=>!t.includes(o)).sort((o,i)=>o.localeCompare(i));for(let o of r){let i=e[o];i!==void 0&&(n[o]=i)}return n}var qe=[["history-redact","history redact"],["history-repair","history repair"],["history-compact","history compact"],["activity","history activity"],["restore","history restore"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-tqel"})),Ve=[...["next","focus"].map(e=>({alias:e,canonical:`context ${e}`,owner:"pm-kcs4"})),...["stats","health","validate","gc","telemetry","eval","test-all"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-6apl"})),...["normalize","reindex"].map(e=>({alias:e,canonical:`ops ${e}`,owner:"pm-3i9q8g"})),{alias:"events",canonical:"history events",owner:"pm-3i9q8g"}].map(e=>({...e,canonical_argv:e.canonical.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap"})),We=[["update-many","update many"],["close-many","close many"],["delete","close delete"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-ik19"})),Be=[...Ve,...We,...["init","config","schema","profile"].map(e=>({alias:e,canonical:`workspace ${e}`,canonical_argv:["workspace",e],lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-npr3"})),...[...["comments","notes","learnings","files","docs","deps","append","test"].map(e=>[e,`item ${e}`,"pm-yql1"]),["test-runs-worker","item test worker","pm-lp4j"],...["statuses","tags","types"].map(e=>[`completion-${e}`,`completion ${e}`,"pm-szdc"]),["history-author-acknowledge","history acknowledge","pm-djyvbk"],["copy","item copy","pm-m6g87m"],["merge","workspace merge","pm-m6g87m"],["duplicates","item duplicates","pm-fmy9ih"],["dedupe-audit","item duplicates audit","pm-fmy9ih"],["dedupe-merge","item duplicates merge","pm-fmy9ih"],["comments-audit","item audit-comments","pm-fmy9ih"],["search-advanced","search advanced","pm-wfskfn"],...["meet","event","remind"].map(e=>[e,`calendar ${e}`,"pm-o3fh"])].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:n}))],R=[{alias:"history-attest",canonical:"history attest",canonical_argv:["history","attest"],lifecycle:"permanent",hidden:!0,registration:"commander",owner:"pm-3z0k"},...qe,...Be,...["discover","lookup"].map(e=>({alias:`files ${e}`,canonical:`item files ${e}`,canonical_argv:["item","files",e],lifecycle:"permanent",hidden:!0,registration:"bootstrap",owner:"pm-yql1"}))];function kn(e){let t;for(let n of R)n.canonical_argv.length<=(t?.canonical_argv.length??0)||n.canonical_argv.every((r,o)=>r===(o===0&&e[o]==="ctx"?"context":e[o]))&&(t=n);return t}function Ke(e){let t=e.trim().replace(/\s+/gu," ");return R.find(n=>n.canonical===t.replace(/^ctx /u,"context "))?.alias??t}function Nn(e){return Ke(e)}var K=[...R,...[["ctx","context"],["packages","package"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:[t],lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-pbyu"})),...[["start-task","claim","--start"],["pause-task","release","--pause"],["close-task","close","--release-assignment"]].map(([e,t,n])=>({alias:e,canonical:t,canonical_argv:[t,n],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-eq4x"})),{alias:"tests",canonical:"item test",canonical_argv:["item","test"],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-u4t9gp"},...[["fetch","get"],["read","get"],["show","get"],["view","get"],["comment","comments"],["note","notes"],["learning","learnings"]].map(([e,t])=>({alias:e,canonical:["comments","notes","learnings"].includes(t)?`item ${t}`:t,canonical_argv:["comments","notes","learnings"].includes(t)?["item",t]:[t],lifecycle:"permanent",hidden:!1,registration:"bootstrap",owner:"pm-pbyu"})),...[["extension scaffold","extension init"],["package scaffold","package init"],["packages scaffold","package init"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-ya7x55"})),...[["extension list","package inventory"],["package list","package inventory"],["packages list","package inventory"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"permanent",hidden:!1,registration:"commander",owner:"pm-gh1777"})),{alias:"list-all",canonical:"list",canonical_argv:["list","--all"],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"},...[["list-draft","draft"],["list-open","open"],["list-in-progress","in_progress"],["list-blocked","blocked"],["list-closed","closed"],["list-canceled","canceled"]].map(([e,t])=>({alias:e,canonical:"list",canonical_argv:["list","--status",t],lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-pfqi"})),...[["extension","package"],["install","package install"],["upgrade","package upgrade"]].map(([e,t])=>({alias:e,canonical:t,canonical_argv:t.split(" "),lifecycle:"deprecated",hidden:!0,registration:"commander",owner:"pm-tnud"}))],Dn=Object.fromEntries(K.filter(e=>e.registration==="bootstrap").map(e=>[e.alias,e.canonical]));function Ln(e){let t=e.trim().toLowerCase();return K.find(n=>n.alias===t)}function Pn(e){return`Deprecated command \`${e.alias}\`; use \`pm ${e.canonical_argv.join(" ")}\`.`}var Ze="PM_COMMAND_SHELL",Xe=new Map([["posix","posix"],["sh","posix"],["bash","posix"],["zsh","posix"],["cmd","cmd"],["cmd.exe","cmd"],["powershell","powershell"],["pwsh","powershell"]]),X=(e=process.platform,t=process.env)=>{let n=t[Ze]?.trim().toLowerCase(),r=n===void 0?void 0:Xe.get(n);return r!==void 0?r:e==="win32"?"cmd":"posix"},I=e=>{let t='"',n=0;for(let r of e){if(r==="\\"){n+=1;continue}t+="\\".repeat(r==='"'?n*2+1:n),t+=r,n=0}return`${t}${"\\".repeat(n*2)}"`},Z=new Set(["(",")","!","^",'"',"<",">","&","|"]),k=e=>{let t="";for(let n=0;n<e.length;n+=1){let r=e[n];if(Z.has(r)){t+=`^${r}`;continue}t+=r,r==="%"&&!Z.has(e.charAt(n+1))&&(t+="^")}return t},Ye=/["%]/u,Je=/\r\n|[\r\n]/gu,Qe=e=>{let t=e.replace(Je," "),n=I(t);return Ye.test(t)?k(n):n},et=/['\u2018\u2019\u201A\u201B]/gu,N=e=>e.replace(et,"$&$&"),tt=e=>`'${N(e)}'`,nt={posix:/^(?!=)[A-Za-z0-9._:/@=-]+$/u,cmd:/^[A-Za-z0-9._:/\\@=-]+$/u,powershell:/^(?!--$)[A-Za-z0-9._:/\\=-][A-Za-z0-9._:/\\@=-]*$/u},rt=(e,t=process.platform,n)=>{let r=n??X(t);return nt[r].test(e)?e:r==="cmd"?Qe(e):r==="powershell"?tt(e):it(e)},ot=/!|[\r\n]|\\$/u,it=e=>ot.test(e)?`'${e.replaceAll("'","'\\''")}'`:`"${e.replace(/(["\\$`])/g,"\\$1")}"`,Fn=(e,t=process.platform,n)=>{let r=n??X(t),o=e.map(i=>rt(i,t,r)).join(" ");return o.length>0?`pm ${o}`:"pm"};import{AsyncLocalStorage as st}from"node:async_hooks";var te="[redacted]",at=/%\^?40/giu,O=/@|%\^?40/iu;function ne(e,t=e.length){let n=-1;for(let r of e.matchAll(at)){if(r.index>t)break;n=r.index}return n}function ct(e,t){if(/[\t\n\r]/u.test(e)||!/(?:^|[^A-Za-z0-9+.-])(?:https?|wss?|ftp)$/iu.test(e.slice(0,t)))return!1;let n=t+1;for(;e[n]==="/"||e[n]==="\\";)n+=1;let r=e.indexOf("/",n)-n;if(r<0)return!1;let o=n+r;return!/[:@%]/u.test(e.slice(n,o))&&!/[:%]|[/\\][/\\]/u.test(e.slice(o))}function re(e){let t=Math.max(e.lastIndexOf("@"),ne(e)),n=e.indexOf(":");if(t<0||n<0||n>t)return;let r=n+1;for(;r<t&&r<n+3&&(e[r]==="/"||e[r]==="\\");)r+=1;return r===t||ct(e,n)?void 0:[r,t]}function ut(e){return e.length<=fe&&de.test(e)&&Number(e.slice(e.lastIndexOf(":")+1))<=65535}function lt(e){let t=e.indexOf(":");if(t<0)return!0;if(!/(?:^|[^A-Za-z0-9+.-])(?:https?|wss?|ftp)$/iu.test(e.slice(0,t)))return!1;let n=t+1;for(;e[n]==="/"||e[n]==="\\";)n+=1;let r=e.indexOf("/",n);if(r<0)return!1;let o=e.slice(n,r);return/[@%]/u.test(o)||o.includes(":")&&!ut(o)?!1:!/[:%]|[/\\][/\\]/u.test(e.slice(r))}function dt(e){let t=[0];if(!/\s/u.test(e))return t;let n=!0,r=0;for(let o of e.matchAll(/\S+/gu)){let i=o[0];/[\t\r\n]/u.test(e.slice(r,o.index))&&(n=!1),n&&o.index>0&&Ft(i)&&(re(e.slice(t.at(-1),o.index))===void 0?t.push(o.index):n=!1),n&&=lt(i),r=o.index+i.length}return t}function L(e){if(!O.test(e))return[];let t=dt(e),n=[];return t.forEach((r,o)=>{let i=re(e.slice(r,t[o+1]));i&&n.push([r+i[0],r+i[1]])}),n}function P(e){let t=[],n=0;for(let[r,o]of L(e))t.push(e.slice(n,r),te),n=o;return n===0?e:`${t.join("")}${e.slice(n)}`}function oe(e){return P(e)}var ie=["author","assignee","claim_principal"];function qn(e){let t={...e};for(let n of ie)typeof t[n]=="string"&&(t[n]=oe(t[n]));return t}function se(e,t){if(!(typeof e!="string"||L(e.trim()).length===0))throw new m(`${t} must not carry URL credentials: an identity is a name, never a credential.`,p.USAGE,{code:"invalid_argument_value",field:t,required:`Set ${t} to a plain name such as agent-a, with no URL userinfo (no user, password or token before the host).`,nextSteps:[`Rerun with ${t} set to a plain name.`],url_credentials_rejected:{source:t}})}function Vn(e,t){return se(e,t),e}var ft=[["comments","author"],["notes","author"],["learnings","author"],["dependencies","author"],["plan_decisions","author"],["plan_discoveries","author"],["plan_steps","owner"],["tests","provenance","author"],["tests","updated_by"]],pt=4;function D(e,t,n=0){if(typeof e=="string"){se(e,t);return}if(!(n>=pt||typeof e!="object"||e===null))for(let r of Object.values(e))D(r,t,n+1)}function mt(e,t){let n=e;for(let r of t){if(typeof n!="object"||n===null||Array.isArray(n))return;n=n[r]}return n}function ae(e){let t=e;for(let n of ie)D(t[n],n);for(let[n,...r]of ft){let o=t[n];Array.isArray(o)&&o.forEach((i,s)=>{D(mt(i,r),`${n}[${s}].${r.join(".")}`)})}}function Wn(e){return typeof e=="string"?oe(e):e}var x=6,gt=65536,ce={carried:!1,fragments:new Set,fragmentLength:x,shortSpellings:[]},U=new st;function ue(e){let t=e.toLowerCase();if(t.length===e.length)return t;let n="";for(let r of e){let o=r.toLowerCase();n+=o.length===r.length?o:r}return n}function ht(e){let t=I(`${e}@`),n=[e,e.replaceAll(/(["\\$`])/gu,"\\$1"),e.replaceAll("'","'\\''"),t.slice(1,-2),k(t).slice(2,-3),N(e)];return[...n,...n.map(r=>JSON.stringify(r).slice(1,-1))]}function yt(e){let t=e.indexOf(":");return t>=0&&t<e.length-1?t+1:0}function _t(e,t){return e.slice(t[0]+yt(e.slice(t[0],t[1])),t[1])}function St(e){let t=new Set,n=!1;for(let r of e)for(let[o,i]of L(r)){n=!0;for(let s of ht(_t(r,[o,i])))t.add(ue(s))}return{carried:n,spellings:[...t]}}function At(e){let{carried:t,spellings:n}=St(e),r=n.reduce((c,u)=>c+Math.max(0,u.length-x+1)+1,0),o=Math.max(1,Math.ceil(r/gt)),i=Math.max(x,o),s=new Set,a=new Set;for(let c of n){if(c.length<i){(c.length>=x||/\s/u.test(c))&&a.add(c);continue}for(let u=0;u+i<=c.length;u+=o)s.add(c.slice(u,u+i));s.add(c.slice(-i))}return{carried:t,fragments:s,fragmentLength:i,shortSpellings:[...a]}}function Et(e,t){let n=ue(e),r=new Uint8Array(e.length),o=!1,i=t.fragmentLength;for(let a=0;a+i<=n.length;a+=1)t.fragments.has(n.slice(a,a+i))&&(r.fill(1,a,a+i),o=!0);for(let a of t.shortSpellings)for(let c=n.indexOf(a);c>=0;c=n.indexOf(a,c+1))r.fill(1,c,c+a.length),o=!0;if(!o)return e;let s="";for(let a=0;a<e.length;a+=1)r[a]?(a===0||!r[a-1])&&(s+=te):s+=e[a];return s}function Bn(e,t){return U.run(At(e),t)}function Kn(){return(U.getStore()??ce).carried}var bt=16,le=512,de=/^(?:(?:[A-Za-z0-9-]+\.)+[A-Za-z0-9-]+|localhost):\d+$/iu,fe=260,xt={'"':'"',"'":"'","`":"`","<":">","(":")","[":"]"},Ot=new Set(["http","https","ws","wss","ftp","file"]);function Y(e,t=!1){let n=Rt(e);if(n<0)return;let r=j(e,n);if(n-r<2)return;let o=xt[e[r-1]??""],i=Ot.has(e.slice(r,n).toLowerCase()),s=n+1;for(;s<e.length&&(e[s]==="/"||e[s]==="\\");)s+=1;if(s===e.length)return{kind:"pending",closer:o,special:i};let a=F(e.slice(s),o);if(a.startsWith("[")||i&&/[/\\?#]/u.test(a)||v(a,o)>=0)return;let c=It(a,t);return c===void 0?void 0:{kind:c,closer:o,special:i}}var wt=new Set([")","]"]),$t="'\\''",Ct="'\\\\''";function F(e,t){return t==="'"?J(e.replaceAll(Ct,"_____").replaceAll($t,"____")):t==='"'?J(e):e}function pe(e,t){let n=t;for(;e[n]==="\\";)n+=1;return n}function Mt(e,t,n){let r=(n-t)%2===1;if(e[n]==='"')return r?n:-1;if(e[n]!=="^")return-1;if(e[n+1]==='"')return r?n+1:-1;let o=pe(e,n+1);return e[o]==='"'&&(o-n-1)%2===1?o:-1}function J(e){let t=[],n=0;for(let r=e.indexOf("\\");r>=0;r=e.indexOf("\\",r)){let o=pe(e,r),i=Mt(e,r,o);i>=0&&(t.push(e.slice(n,r),"_".repeat(i+1-r)),n=i+1),r=i>=0?i+1:o}return n===0?e:`${t.join("")}${e.slice(n)}`}function v(e,t){if(t===void 0)return-1;if(!wt.has(t))return Tt(e,t);let n=e.length;for(;n>0&&/[.,;:!?*_~`]/u.test(e[n-1]);)n-=1;return n>0&&e[n-1]===t?n-1:-1}function Tt(e,t){for(let n=e.indexOf(t);n>=0;n=e.indexOf(t,n+1)){if(t==="'"&&e[n+1]==="'"){n+=1;continue}let r=0;for(;n-r>0&&e[n-r-1]==="\\";)r+=1;if(r%2===0)return n}return-1}function Rt(e){let t=-1;for(let n=e.length-2;n>=0;n-=1){if(e[n]!==":"||e[n+1]!=="/"&&e[n+1]!=="\\")continue;let r=j(e,n);if(r===0||/[=?&#"'`(<[{,]/u.test(e[r-1]))return n;t=n}return t}function j(e,t){let n=t;for(;n>0&&/[A-Za-z0-9+.-]/u.test(e[n-1]);)n-=1;return n}function It(e,t){return e.includes(":")?!t&&e.length<=fe&&de.test(e)?void 0:"user":O.test(e)?void 0:"label"}function kt(e,t,n,r=-1){let o=Math.min(e.length,t+le),i=t,s=r,a=n.kind==="user",c=!1;for(let u=0;u<bt&&i<o;u+=1){let l=me(e,i,o);if(l===void 0)break;let d=Lt(e.slice(l[0],Math.min(l[1],o+3)),o-l[0],n);if(d.startsUrl)break;Nt(d,a,c)&&(s=l[1]);let f=/[\t\r\n]/u.test(e[l[1]]??"");if(a||=d.colon||d.trailingColon&&f,c||=d.trailingColon,d.endsAuthority)break;i=l[1]}return s}function Nt(e,t,n){return e.separator?t||e.colonBeforeSeparator||n&&(e.hasPath||e.closedByOpener):!1}function me(e,t,n){let r=t;for(;r<n&&/\s/u.test(e[r]);)r+=1;if(r===n)return;let o=r;for(;o<e.length&&!/\s/u.test(e[o]);)o+=1;return[r,o]}function Q(e){let t=e.indexOf(":");return t>=0&&t<e.length-1&&!Dt.test(e)}var Dt=/^\d{1,2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:Z|[AaPp][Mm])?[.,;:!?)]*$/u;function Lt(e,t,n){let r=F(e,n.closer),o=n.special?r.search(/[/\\?#]/u):-1,i=o<0?r:r.slice(0,o),s=v(i,n.closer),a=r.search(/:[/\\]/u),c=s<0?i:i.slice(0,s),u=Math.min(c.length,t)-1,l=u<0?-1:Math.max(c.lastIndexOf("@",u),ne(c,u));return{startsUrl:a>=0&&s<0&&ge(r.slice(0,a+1)),separator:l>=0,colonBeforeSeparator:l>0&&(Q(c.slice(0,l))||c[l-1]===":"),colon:Q(c),trailingColon:c.endsWith(":"),hasPath:s<0&&l>=0&&/[/\\]/u.test(r.slice(l+1)),closedByOpener:s>=0,endsAuthority:o>=0||s>=0}}function ge(e){let t=j(e,e.length-1);return t<e.length-2&&/[A-Za-z]/u.test(e[t])&&(t===0||t===1&&/["'`(<[]/u.test(e[0]))}function Pt(e,t,n){let r=Y(t,/[\t\r\n]/u.test(e.charAt(n)));if(r?.kind!=="pending")return r===void 0?void 0:{opening:r,from:n,seed:-1,final:!1};let o=me(e,n,Math.min(e.length,n+le));if(o===void 0)return;let i=F(e.slice(o[0],o[1]),r.closer),s=/^[/\\]*/u.exec(i)[0],a=i.slice(s.length),c=r.special?a.split(/[/\\?#]/u,1)[0]:a,u=v(c,r.closer),l=`${s}${u<0?c:c.slice(0,u)}`,d=O.test(l),f=d?{...r,kind:"user"}:Y(`${t}${l}`);if(f===void 0||f.kind==="pending")return;let g=d?o[1]:-1;return{opening:f,from:o[1],seed:g,final:l.length<i.length}}function Ut(e){if(!/:[/\\]/u.test(e))return e;let t=/\S+/gu,n="",r=0;for(let o=t.exec(e);o!==null;o=t.exec(e)){let i=Pt(e,o[0],o.index+o[0].length);if(i===void 0)continue;let s=i.final?i.seed:kt(e,i.from,i.opening,i.seed);s!==-1&&(n+=`${e.slice(r,o.index)}${P(e.slice(o.index,s))}`,r=s,t.lastIndex=s)}return r===0?e:`${n}${e.slice(r)}`}function Ft(e){let t=e.search(/:[/\\]/u);return t>=0&&ge(e.slice(0,t+1))}function Zn(e){let t=U.getStore()??ce,n=ee(e);return t.carried?ee(Et(n,t)):n}function ee(e){return O.test(e)?Ut(e).replaceAll(/\S+/gu,P):e}import vt from"node:crypto";import{AsyncLocalStorage as jt}from"node:async_hooks";var w=new jt,he=1024;function Gt(e){let t=Date.parse(e.clock);if(!Number.isFinite(t))throw new Error(`Invalid reproducible workspace clock: ${e.clock}`);if(!Number.isSafeInteger(e.tickMs)||e.tickMs<0)throw new Error("Reproducible workspace tickMs must be a non-negative integer");if(e.seed.trim().length===0)throw new Error("Reproducible workspace seed must not be empty");return{...e,clock:new Date(t).toISOString()}}function Ht(e){let n={...Gt(e),clockReads:0,tokenReads:0};return r=>w.run(n,r)}async function Qn(e,t){return Ht(e)(t)}function er(){return w.getStore()!==void 0}function ye(){let e=w.getStore();if(e===void 0)return;let t=new Date(Date.parse(e.clock)+e.clockReads*e.tickMs).toISOString();return e.clockReads+=1,t}function tr(e){let t=w.getStore();if(t===void 0)return;if(!Number.isSafeInteger(e)||e<0||e>he)throw new Error(`Reproducible token length must be an integer between 0 and ${he}`);let n="";for(;n.length<e;){let r=vt.createHash("sha256").update(`${t.seed}\0${t.tokenReads}`).digest();t.tokenReads+=1;for(let o of r)if(n+=(o%36).toString(36),n.length===e)break}return n}var zt=/^([+-]?)(\d+)([hdwm])$/i,qt=/^[+-]?\d+[hdwm](?:[+-]\d+[hdwm])+$/i,Vt=/^(\d{4})(\d{2})(\d{2})$/,Wt=/^(\d{4})(\d{2})(\d{2})(?:[T\s]?)(\d{2})(\d{2})(\d{2})?([.,]\d{1,3})?(Z|[+-]\d{2}:?\d{2})?$/i,Bt=/^(\d{4}-\d{2}-\d{2})[T\s](\d{2})-(\d{2})(?:-(\d{2}))?([.,]\d{1,3})?(Z|[+-]\d{2}:?\d{2})?$/i,Kt=/^(\d{4}-\d{2}-\d{2})[T\s](\d{2})(\d{2})(\d{2})?([.,]\d{1,3})?(Z|[+-]\d{2}:?\d{2})?$/i,Zt=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|[+-](\d{2}):(\d{2}))$/i;function ar(){return ye()??new Date().toISOString()}function cr(e){return Number.isFinite(Date.parse(e))}function z(e){let t=Zt.exec(e);if(!t||!Number.isFinite(Date.parse(e)))return!1;let[,n,r,o,i,s,a,c,u]=t,[l,d,f,g,h,y]=[n,r,o,i,s,a].map(Number);return d>=1&&d<=12&&f>=1&&f<=q(l,d-1)&&g<=23&&h<=59&&y<=59&&(c===void 0||Number(c)<=23)&&(u===void 0||Number(u)<=59)}function ur(e){let t=/\.(\d+)(?:Z|[+-]\d{2}:\d{2})$/iu.exec(e)?.[1];return z(e)&&(t===void 0||/^\d{0,3}0*$/u.test(t))}var Xt=1e4,$=new Map;function _e(e){let t=$.get(e);if(t!==void 0)return t;let n=Date.parse(e);return $.size>=Xt&&V($),$.set(e,n),n}function A(e,t){let n=_e(e),r=_e(t);return Number.isFinite(n)&&Number.isFinite(r)&&n!==r?n-r:e.localeCompare(t)}function lr(e,t){return!(t.deadlineBefore&&(!e.deadline||A(e.deadline,t.deadlineBefore)>0)||t.deadlineAfter&&(!e.deadline||A(e.deadline,t.deadlineAfter)<0)||t.updatedAfter&&A(e.updated_at,t.updatedAfter)<0||t.updatedBefore&&A(e.updated_at,t.updatedBefore)>0||t.createdAfter&&A(e.created_at,t.createdAfter)<0||t.createdBefore&&A(e.created_at,t.createdBefore)>0)}function G(e){return e?`.${e.slice(1).padEnd(3,"0").slice(0,3)}`:""}function H(e){if(!e)return"";if(e.toUpperCase()==="Z")return"Z";let t=/^([+-]\d{2})(\d{2})$/.exec(e);return t?`${t[1]}:${t[2]}`:e}function Yt(e,t,n){n&&n!==t&&(e.includes(n)||e.push(n))}function Jt(e){let t=[],n=u=>Yt(t,e,u),r=Vt.exec(e);if(r){let[,u,l,d]=r;n(`${u}-${l}-${d}`)}let o=Wt.exec(e);if(o){let[,u,l,d,f,g,h,y,ke]=o,Ne=h?`:${h}`:"";n(`${u}-${l}-${d}T${f}:${g}${Ne}${G(y)}${H(ke)}`)}let i=Bt.exec(e);if(i){let[,u,l,d,f,g,h]=i,y=f?`:${f}`:"";n(`${u}T${l}:${d}${y}${G(g)}${H(h)}`)}let s=Kt.exec(e);if(s){let[,u,l,d,f,g,h]=s,y=f?`:${f}`:"";n(`${u}T${l}:${d}${y}${G(g)}${H(h)}`)}let a=10,c=e.slice(0,a);if(en(c)){let u=a;for(;u<e.length&&tn(e[u]);)u+=1;u<e.length&&n(`${c}T${e.slice(u)}`)}return t}function Qt(e){let t=Date.parse(e);if(Number.isFinite(t))return t;for(let n of Jt(e)){let r=Date.parse(n);if(Number.isFinite(r))return r}return Number.NaN}function en(e){if(e.length!==10)return!1;for(let t=0;t<e.length;t+=1){let n=e[t];if(t===4||t===7){if(n!=="-")return!1;continue}let r=n.charCodeAt(0);if(r<48||r>57)return!1}return!0}function tn(e){return e?e===" "||e===" "||e===`
2
+ `||e==="\r"||e==="\f"||e==="\v":!1}function q(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}var nn=["January","February","March","April","May","June","July","August","September","October","November","December"],rn=/^(\d{4})-(\d{2})-(\d{2})/,on=/^(\d{4})(\d{2})(\d{2})(?:[T ]?\d{2}|$)/;function sn(e,t,n){let r=rn.exec(t)??on.exec(t);if(!r)return;let o=Number.parseInt(r[1],10),i=Number.parseInt(r[2],10),s=Number.parseInt(r[3],10),a=n?.trim()||"deadline";if(i<1||i>12)throw new m(`Invalid ${a} value "${e}". Month "${r[2]}" is out of range \u2014 use a month between 01 and 12.`,p.USAGE,{field:a,value:e});let c=q(o,i-1);if(s<1||s>c)throw new m(`Invalid ${a} value "${e}". ${nn[i-1]} ${o} has ${c} days, so day "${r[3]}" does not exist. Use a real YYYY-MM-DD calendar date.`,p.USAGE,{field:a,value:e})}function an(e,t){let n=new Date(e.getTime()),r=n.getUTCDate(),o=n.getUTCMonth()+t,i=n.getUTCFullYear()+Math.floor(o/12),s=(o%12+12)%12,a=Math.min(r,q(i,s));return n.setUTCFullYear(i,s,a),n}function dr(e,t=new Date,n="deadline"){let r=e.trim();if(r.toLowerCase()==="now")return t.toISOString();let o=zt.exec(r);if(o){let s=o[1]==="-"?-1:1,a=Number.parseInt(o[2],10)*s,c=o[3].toLowerCase();if(c==="m")return an(t,a).toISOString();let u=c==="h"?3600*1e3:c==="d"?1440*60*1e3:10080*60*1e3;return new Date(t.getTime()+a*u).toISOString()}sn(e,r,n);let i=Qt(r);if(!Number.isFinite(i)){let s=n.trim().length>0?n.trim():"deadline",a=qt.test(r)?"Compound relative expressions like +3d+1h are not supported; use a single relative token (for example +3d) or an ISO/date string.":'Use ISO/date string input, "now", or relative +6h/-6h/+1d/-1d/+2w/-2w/+6m/-6m.';throw new m(`Invalid ${s} value "${e}". ${a}`,p.USAGE,{field:s,value:e})}return new Date(i).toISOString()}function cn(e){let t=e.trim();return t.startsWith("-")&&!t.startsWith("--")}var Se=/[\s|,=<>[\]]/u;function un(e){let t=e.trim();if(cn(t))return t.length===2&&!Se.test(t[1])?void 0:"is not a short flag: a short flag is one dash and one character";let n=t.replace(/^--/u,"");if(n.length===0)return"is empty";if(n.startsWith("-"))return"starts with three dashes";if(n.endsWith("-")||n.includes("--"))return"has an empty segment between hyphens, which the option parser cannot turn into an option key";let r=Se.exec(n)?.[0];if(r!==void 0)return/\s/u.test(r)?"contains whitespace, which the option parser reads as a break between two flags":`contains ${JSON.stringify(r)}, which the option parser reads as ${r==="|"||r===","?"a break between two flags":r==="="?"the start of an attached value":"a value placeholder"}`}var ln=new Set(["-h","help"]);function Ae(e){let t=e.trim();return un(t)===void 0&&!ln.has(t.replace(/^--/u,""))}var dn=16;function C(e){let t=e.trim().replaceAll(/[^A-Za-z0-9]+/g," ").split(/\s+/).filter(o=>o.length>0).map(o=>o.toLowerCase());if(t.length===0)return e;let[n,...r]=t;return`${n}${r.map(o=>`${o.slice(0,1).toUpperCase()}${o.slice(1)}`).join("")}`}function Er(e,t,n=new Set,r){if(Oe(e,t,r))return;let o=we(e,t,n,r),i=M(e);return[C(e.cli_flag),...i].find(a=>!o.has(a)&&xe(a,i,o))}function xe(e,t,n){for(let r of t){if(r===e)break;if(n.has(r))return!1}return!0}function Oe(e,t,n){return t.definitions.some(r=>r!==e&&r.metadata_key===e.metadata_key&&(n===void 0||r.commands.includes(n)))}function we(e,t,n,r){return new Set([...n,...t.definitions.filter(o=>o!==e&&(r===void 0||o.commands.includes(r))).flatMap(o=>M(o))])}function $e(e){return e.replace(/^-+/u,"").startsWith("no-")}function fn(e){return e.startsWith("-")?e:`--${e}`}function br(e,t,n,r){if(Oe(e,t,r))return;let o=we(e,t,n.options,r),i=M(e);return[e.cli_flag,...e.cli_aliases].find(s=>{if(!Ae(s))return!1;let a=Ce(s);return $e(s)||n.flags.has(fn(s))||o.has(a)?!1:xe(a,i,o)})}function Ce(e){return e.replace(/^-+/u,"").replace(/^no-/u,"").split("-").reduce((t,n)=>`${t}${n.charAt(0).toUpperCase()}${n.slice(1)}`)}function M(e){return[...new Set([W(e),C(e.key),C(e.cli_flag),...e.cli_aliases.map(t=>C(t)),...[e.cli_flag,...e.cli_aliases].filter(t=>!$e(t)).map(t=>Ce(t))])]}function Me(e,t){for(let n of M(t)){if(!Object.hasOwn(e,n))continue;let r=e[n];if(r!==void 0)return r}}function Te(e){return Array.isArray(e)?e.flatMap(t=>Te(t)).map(t=>t.trim()).filter(t=>t.length>0):typeof e=="string"?e.split(/[,\n|]/).map(t=>t.trim()).filter(t=>t.length>0):e==null?[]:[String(e).trim()].filter(t=>t.length>0)}function Ee(e,t){if(typeof e=="boolean")return e;if(typeof e=="number"){if(e===1)return!0;if(e===0)return!1}if(typeof e=="string"){let n=e.trim().toLowerCase();if(n==="true"||n==="1"||n==="yes")return!0;if(n==="false"||n==="0"||n==="no")return!1}throw new m(`${t} must be one of true|false|1|0|yes|no`,p.USAGE)}function be(e,t){if(typeof e=="number"&&Number.isFinite(e))return e;let n=typeof e=="string"?e.trim():String(e),r=Number(n);if(!Number.isFinite(r))throw new m(`${t} must be a number`,p.USAGE);return r}function pn(e,t,n){let r=typeof e=="string"?(()=>{try{return JSON.parse(e)}catch{return}})():e;if(n==="array"&&Array.isArray(r)||n==="object"&&typeof r=="object"&&r!==null&&!Array.isArray(r))return r;throw new m(`${t} must be valid JSON ${n}`,p.USAGE)}function mn(e,t){return t===void 0?!0:t==="array"?Array.isArray(e):t==="object"?typeof e=="object"&&e!==null&&!Array.isArray(e):typeof e===t}function gn(e,t,n){if(t.const!==void 0&&_(e)!==_(t.const))return`${n} must equal ${_(t.const)}`;if(t.enum!==void 0&&!t.enum.some(r=>_(r)===_(e)))return`${n} must be one of ${t.enum.map(r=>_(r)).join("|")}`;if(!mn(e,t.type))return`${n} must match configured type ${String(t.type)}`;if(typeof e=="string"){if(t.min_length!==void 0&&e.length<t.min_length)return`${n} must contain at least ${t.min_length} characters`;if(t.format==="date-time"&&!z(e))return`${n} must be an RFC 3339 date-time`}}function hn(e,t,n,r){if(Array.isArray(e)){if(t.min_items!==void 0&&e.length<t.min_items)return`${n} must contain at least ${t.min_items} items`;if(t.items)for(let[o,i]of e.entries()){let s=T(i,t.items,`${n}[${o}]`,r+1);if(s)return s}}}function yn(e,t,n,r){if(typeof e!="object"||e===null||Array.isArray(e))return;let o=e;for(let i of t.required??[])if(!Object.hasOwn(o,i))return`${n}.${i} is required`;for(let[i,s]of Object.entries(o)){let a=t.properties?.[i];if(!a){if(t.additional_properties===!1)return`${n}.${i} is not allowed`;continue}let c=T(s,a,`${n}.${i}`,r+1);if(c)return c}}function T(e,t,n,r=0){if(r>dn)return`${n} value schema exceeds maximum depth`;let o=gn(e,t,n);if(o)return o;let i=hn(e,t,n,r);if(i)return i;let s=yn(e,t,n,r);if(s)return s;if(!t.one_of)return;let a=0;for(let c of t.one_of)if(T(e,c,n,r+1)===void 0&&(a+=1,a>1))break;return a===1?void 0:`${n} must match exactly one configured schema variant`}function S(e,t,n){if(!e.value_schema||t===void 0)return t;let r=T(t,e.value_schema,n);if(r)throw new m(r,p.USAGE);return t}function _n(e,t,n,r){let o=r==="option"&&Array.isArray(t)?t[t.length-1]:t;if(o!==void 0)return S(e,pn(o,n,e.type),n)}function Re(e,t,n,r="option"){let o=n??`--${e.cli_flag}`;if(e.type==="array"||e.type==="object")return _n(e,t,o,r);if(e.repeatable||e.type==="string_array"){let s=Te(t);return e.type==="number"?S(e,s.map(a=>be(a,o)),o):e.type==="boolean"?S(e,s.map(a=>Ee(a,o)),o):S(e,s,o)}let i=Array.isArray(t)?t[t.length-1]:t;if(i!==void 0)return e.type==="number"?S(e,be(i,o),o):e.type==="boolean"?S(e,Ee(i,o),o):S(e,typeof i=="string"?i:String(i),o)}function Sn(e,t){return!e.required&&!e.required_on_create?!1:e.required_types.length===0?!0:t?e.required_types.map(n=>n.toLowerCase()).includes(t.trim().toLowerCase()):!1}function xr(e,t,n){let r={},o=[];for(let i of t.command_to_fields.get("create")??[]){let s=Me(e,i);if(s===void 0){Sn(i,n)&&o.push(`--${i.cli_flag}`);continue}r[i.metadata_key]=Re(i,s)}return{values:r,missing_required_flags:[...new Set(o)].sort((i,s)=>i.localeCompare(s))}}function Or(e,t,n=["update"]){let r={},o=(n??["update"]).flatMap(s=>t.command_to_fields.get(s)??[]),i=new Set;for(let s of o){let a=Me(e,s);a!==void 0&&(i.has(s.metadata_key)||(i.add(s.metadata_key),r[s.metadata_key]=Re(s,a)))}return ae(r),r}var $r={include:"--output-include",amount:"--output-limit",cost:"--output-budget",encoding:"--output-format"},Cr=Object.freeze(["--output-session","--output-cursor","--output-row-contract"]),Ie=["list","context","search","get","next","health","deps","graph","history","activity","validate","events","contracts","comments","notes","learnings","files","docs","stats","aggregate","duplicates","package-catalog","package-manage","comments-audit","assurance"];var An=Object.freeze([{flag:"--json"},{flag:"--lean"},{flag:"--token-accounting"},{flag:"--output-include",value_name:"fields",extension_command_availability:"read_output"},{flag:"--output-limit",value_name:"count",extension_command_availability:"read_output"},{flag:"--output-budget",value_name:"tokens",extension_command_availability:"read_output"},{flag:"--output-format",value_name:"toon|json"},{flag:"--output-session",value_name:"state",extension_command_availability:"read_output"},{flag:"--output-cursor",value_name:"cursor",extension_command_availability:"read_output"},{flag:"--output-row-contract",extension_command_availability:"read_output"},{flag:"--quiet"},{flag:"--no-changed-fields"},{flag:"--full-changed-fields"},{flag:"--id-only"},{flag:"--pm-path",aliases:["--path"],discovery_value_name:"path"},{flag:"--no-extensions",extension_command_availability:"never"},{flag:"--no-pager"},{flag:"--profile"},{flag:"--help",short:"-h"},{flag:"--author",value_name:"id"},{flag:"--expect-hash",value_name:"revision",repeatable:!0}]),Tr=new Set(An.flatMap(e=>[e.flag,...e.aliases??[],...e.short===void 0?[]:[e.short]]));var En={list:{include:["--brief","--compact","--fields","--full"],amount:["--after","--limit","--no-truncate"],cost:["--token-budget"],encoding:["--format","--stream"]},context:{include:["--fields","--section"],amount:["--after","--depth","--limit"],cost:["--token-budget"],encoding:["--format"]},search:{include:["--compact","--fields","--full"],amount:["--after","--limit"],cost:["--token-budget"],encoding:["--format"]},get:{include:["--fields","--full"],amount:["--depth"],cost:["--token-budget"],encoding:["--format"]},next:{amount:["--blocked-limit","--limit"],encoding:["--format"]},health:{include:["--brief","--check-only","--full","--summary"]},deps:{include:["--collapse","--full","--summary"],amount:["--edge-limit","--max-depth","--node-limit"],cost:["--token-budget"],encoding:["--format"]},graph:{include:["--full","--summary"],amount:["--after","--limit","--max-depth","--max-paths"]},history:{include:["--compact","--full"],amount:["--limit"],encoding:["--format"]},activity:{include:["--compact","--full"],amount:["--limit","--unbounded","--after"],encoding:["--stream"]},validate:{include:["--counts","--full"]},events:{include:["--full"],amount:["--limit"],encoding:["--follow"]},contracts:{include:["--full","--summary"]},comments:{amount:["--limit"]},notes:{amount:["--limit"]},learnings:{amount:["--limit"]},files:{amount:["--limit","--no-truncate","--offset"]},docs:{},stats:{},aggregate:{},duplicates:{amount:["--limit"]},"package-catalog":{},"package-manage":{},"comments-audit":{},assurance:{}},bn=new Set(["--collapse","--fields","--section"]),xn=Object.freeze({"--after":"--after retains cursor-position semantics; use --output-limit <n> separately to bound returned rows.","--check-only":"--check-only retains health side-effect semantics; --output-include does not suppress vector refresh.","--collapse":"--collapse retains dependency grouping semantics; --output-include does not replace it.","--depth":"--depth retains traversal or detail-depth semantics; --output-limit does not replace it.","--follow":"--follow retains event-tail semantics; --output-format does not enable following.","--max-depth":"--max-depth retains graph traversal-depth semantics; --output-limit does not replace it.","--max-paths":"--max-paths retains graph path-search semantics; use --output-limit separately to bound returned rows.","--no-truncate":"--no-truncate is a compatibility alias; prefer --output-limit unbounded --output-budget unbounded.","--offset":"--offset retains positional pagination semantics; use --output-limit separately to bound returned rows.","--stream":"--stream retains command streaming semantics; --output-format selects only static result encoding.","--unbounded":"--unbounded is a compatibility alias; prefer --output-limit unbounded."});function On(e){return e.slice(2).replaceAll("-","_")}var wn=new Set(["package catalog","packages catalog","extension catalog","extension-catalog","package-catalog"]),$n=new Set(["package manage","packages manage","package-manage"]);function kr(e,t={}){let r=wn.has(e)||(e==="package"||e==="packages"||e==="extension")&&(t.catalog===!0||t.target==="catalog"||t.action==="catalog")?"package-catalog":$n.has(e)?"package-manage":e.split(" ")[0],o=r.startsWith("list-")?"list":r==="ctx"?"context":r;return Ie.includes(o)?o:void 0}function Nr(e){return new Map((En[e]?.include??[]).filter(t=>!bn.has(t)&&xn[t]===void 0).map(t=>[On(t),Cn(t)]))}function Cn(e){return e.slice(2).replace(/-([a-z])/gu,(t,n)=>n.toUpperCase())}export{_ as a,E as b,Tn as c,Rn as d,qe as e,Ve as f,We as g,Be as h,R as i,kn as j,Ke as k,Nn as l,K as m,Dn as n,Ln as o,Pn as p,Ze as q,X as r,I as s,Qe as t,tt as u,rt as v,it as w,Fn as x,te as y,P as z,oe as A,qn as B,se as C,Vn as D,ae as E,Wn as F,Bn as G,Kn as H,Zn as I,An as J,Tr as K,Gt as L,Ht as M,Qn as N,er as O,tr as P,ar as Q,cr as R,z as S,ur as T,A as U,lr as V,dr as W,cn as X,un as Y,Ae as Z,Er as _,fn as $,br as aa,Ce as ba,M as ca,Me as da,Re as ea,Sn as fa,xr as ga,Or as ha,$r as ia,Cr as ja,Ie as ka,En as la,bn as ma,xn as na,On as oa,wn as pa,kr as qa,Nr as ra,Cn as sa};
3
+ //# sourceMappingURL=chunk-XGNUDSCG.js.map
@@ -1,2 +1,2 @@
1
- import{fa as s,ga as u,mb as g}from"./chunk-CBUC4X7Q.js";import{H as x,u as h}from"./chunk-OXC5KBIQ.js";import{Xg as w}from"./chunk-NRQCBUYD.js";import{g as I,o as y,u as i}from"./chunk-GSLOAEY2.js";import{A as d,C as p,E as l}from"./chunk-K672XXGQ.js";async function D(r){let t=y(process.cwd(),r);await x(t);let o=await h(t),a=I(o,w());return{pmRoot:t,settings:o,typeRegistry:a}}async function S(r,t,o,a){i(r,s(t));let e=await g(r,t,o.id_prefix,o.item_format,a);if(e)return{id:e.id,historyPath:i(r,e.id),located:e};let m=u(t,o.id_prefix),n=s(t),v=m===n?[m]:[m,n];for(let c of v){let f=i(r,c);if(await l(f))return{id:c,historyPath:f,located:null}}throw new p(`Item ${t} not found`,d.NOT_FOUND)}export{D as a,S as b};
2
- //# sourceMappingURL=chunk-AHV3CSQG.js.map
1
+ import{fa as s,ga as u,mb as g}from"./chunk-TDOF7BKO.js";import{H as x,u as h}from"./chunk-RRBNCL63.js";import{$g as w}from"./chunk-UXEZXGAD.js";import{g as I,o as y,u as i}from"./chunk-GSLOAEY2.js";import{A as d,C as p,E as l}from"./chunk-K672XXGQ.js";async function D(r){let t=y(process.cwd(),r);await x(t);let o=await h(t),a=I(o,w());return{pmRoot:t,settings:o,typeRegistry:a}}async function S(r,t,o,a){i(r,s(t));let e=await g(r,t,o.id_prefix,o.item_format,a);if(e)return{id:e.id,historyPath:i(r,e.id),located:e};let m=u(t,o.id_prefix),n=s(t),v=m===n?[m]:[m,n];for(let c of v){let f=i(r,c);if(await l(f))return{id:c,historyPath:f,located:null}}throw new p(`Item ${t} not found`,d.NOT_FOUND)}export{D as a,S as b};
2
+ //# sourceMappingURL=chunk-XKJ5NWQ7.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d,e,f,g,h,i}from"./chunk-WSEIEDEK.js";import"./chunk-A5ZEMOVR.js";import"./chunk-I4SPJQQI.js";import"./chunk-TE6FBDHP.js";import"./chunk-K672XXGQ.js";import"./chunk-XAWE4EAK.js";export{i as assertFieldDefinitionOptionsAvailable,h as assertFieldOptionsAvailable,e as describeFieldFlagSpellingDefectLine,f as describeFieldOptionCollision,d as resolveAddFieldFlagSpellingDefects,b as resolveAddFieldOptionCollisions,c as resolveFieldFlagSpellingDefects,a as resolveFieldOptionCollisions,g as scanFieldOptionCollisions};
2
- //# sourceMappingURL=field-option-collisions-BBGTV7AD.js.map
1
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-ITM4AMVM.js";import"./chunk-3ESBFEQC.js";import"./chunk-XGNUDSCG.js";import"./chunk-TE6FBDHP.js";import"./chunk-K672XXGQ.js";import"./chunk-XAWE4EAK.js";export{i as assertFieldDefinitionOptionsAvailable,h as assertFieldOptionsAvailable,e as describeFieldFlagSpellingDefectLine,f as describeFieldOptionCollision,d as resolveAddFieldFlagSpellingDefects,b as resolveAddFieldOptionCollisions,c as resolveFieldFlagSpellingDefects,a as resolveFieldOptionCollisions,g as scanFieldOptionCollisions};
2
+ //# sourceMappingURL=field-option-collisions-DXKTKW6J.js.map
@@ -0,0 +1,2 @@
1
+ import{A as u,B as v,C as w,D as x,E as y,F as z,G as A,a as e,b 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-CQHB3ZZH.js";import"./chunk-XKJ5NWQ7.js";import"./chunk-PZA7QECY.js";import"./chunk-TDOF7BKO.js";import"./chunk-RRBNCL63.js";import"./chunk-3AZOATC2.js";import{nf as a,of as b,pf as c,qf as d}from"./chunk-UXEZXGAD.js";import"./chunk-GSLOAEY2.js";import"./chunk-3ESBFEQC.js";import"./chunk-XGNUDSCG.js";import"./chunk-TE6FBDHP.js";import"./chunk-K672XXGQ.js";import"./chunk-XAWE4EAK.js";export{h as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,g as ITEM_REVISION_CONFLICT_CODE,y as assertExpectHashAdmissible,v as bindExpectedItemRevisions,c as bindItemRevisionScope,a as createItemRevisionScope,m as describeItemRevisionChanges,A as dispatchWithExpectedItemRevisions,s as enrichItemRevisionConflict,f as expectHashAdmissionCondition,q as expectHashInvocationRewrittenError,z as expectHashRequiresMutationError,e as isExpectHashAdmissibleAction,o as isItemRevisionConflict,w as isTrackerRevisionGuarded,n as itemRevisionConflictRowFields,d as itemRevisionScopeReceipt,x as itemRevisionUncheckedWarning,i as normalizeExpectedItemHash,j as parseExpectHashSpecs,k as readItemRevision,l as resolveExpectedItemRevisions,t as runWithBoundItemRevisionScope,b as runWithItemRevisionScope,r as scopeItemRevisionConflict,p as throwFirstItemRevisionConflict,u as withExpectedItemRevisions};
2
+ //# sourceMappingURL=item-revision-DXEF4XBU.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-MRT3ADO4.js";import"./chunk-E5ADC3HT.js";import"./chunk-PJMGWJKU.js";import"./chunk-E5HO7HWP.js";import"./chunk-HPCMM74Q.js";import"./chunk-PBMLIV74.js";import"./chunk-X5D5YUHR.js";import"./chunk-4QA5O64H.js";import"./chunk-L4HMFRHB.js";import"./chunk-LTQWPQ7H.js";import"./chunk-JJ73G5UT.js";import"./chunk-EDJ3KR2H.js";import"./chunk-6H36ZHMI.js";import"./chunk-IW4A3I4N.js";import"./chunk-OGVSGXQX.js";import"./chunk-AA52P34H.js";import"./chunk-Q2HMDV56.js";import"./chunk-CQHB3ZZH.js";import"./chunk-XKJ5NWQ7.js";import"./chunk-PZA7QECY.js";import"./chunk-TDOF7BKO.js";import"./chunk-RRBNCL63.js";import"./chunk-3AZOATC2.js";import"./chunk-UXEZXGAD.js";import"./chunk-GSLOAEY2.js";import"./chunk-ITM4AMVM.js";import"./chunk-3ESBFEQC.js";import"./chunk-XGNUDSCG.js";import"./chunk-TE6FBDHP.js";import"./chunk-K672XXGQ.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-EANA7V4W.js.map
@@ -1,2 +1,2 @@
1
- import"./chunk-5EFS7K7Y.js";import"./chunk-SLFRSZK6.js";import{f as l}from"./chunk-MZZ4ZJ5Z.js";import{fa as h}from"./chunk-GOEQXVOI.js";import"./chunk-7V65VACG.js";import"./chunk-3HKPVOAN.js";import"./chunk-6H36ZHMI.js";import"./chunk-Q6K7HWZ7.js";import"./chunk-OGVSGXQX.js";import"./chunk-AA52P34H.js";import{sa as A}from"./chunk-C6WM6ZN4.js";import"./chunk-QDV7S2QS.js";import"./chunk-AHV3CSQG.js";import"./chunk-PZA7QECY.js";import"./chunk-CBUC4X7Q.js";import"./chunk-OXC5KBIQ.js";import"./chunk-3AZOATC2.js";import"./chunk-NRQCBUYD.js";import"./chunk-GSLOAEY2.js";import"./chunk-WSEIEDEK.js";import"./chunk-A5ZEMOVR.js";import{j as p}from"./chunk-I4SPJQQI.js";import"./chunk-TE6FBDHP.js";import"./chunk-K672XXGQ.js";import"./chunk-XAWE4EAK.js";var O=new Set(["files","docs","test"]);function x(e){return{name:e.long??e.short,value:e.required?"required":e.optional?"optional":"none",repeatable:e.parseArg===A}}function E(e){let n=[];for(let t=e;t;t=t.parent)n.push(...t.options);return n}function _(e){let n={};for(let t of E(e)){let r=x(t);for(let o of[t.long,t.short])o&&!Object.hasOwn(n,o)&&(n[o]=r)}return n}function y(e,n,t){let r=p(n.slice(l([...n])))?.canonical_argv,o=e;for(let i of r??[t])o=o?.commands.find(s=>s.name()===i);return o}function f(e){return e.length>1&&e.startsWith("-")}var m=new Set(["--add","--add-glob","--remove"]),w=/^[^\s,=:`]+$/u,R=/[[\]()]/u;function L(e,n,t){if(e==="test")return t.every(o=>h(n,o))?"exact":"decline";let r=o=>!f(o)&&w.test(o)&&(e!=="docs"||!R.test(o));return m.has(n)&&t.every(r)?"exact":"ambiguous"}function V(e){return e.trim()==="-"||/^--?[^=\s]+=\s*-\s*$/u.test(e)||/^--stdin(?:-json)?(?:=|$)/u.test(e)}function S(e,n,t){let r=e[n],o=r.startsWith("--")?r.indexOf("="):-1,i=o>=0?r.slice(0,o):r,s=Object.hasOwn(t,i)?t[i]:void 0;if(!s)return;let d=r.slice(o+1);if(o>=0)return s.value==="none"||f(d)?void 0:{end:n,spelling:i,arity:s,value:d};if(s.value==="none")return{end:n,spelling:i,arity:s};let u=e[n+1];return s.value==="required"?u===void 0||f(u)?void 0:{end:n+1,spelling:i,arity:s,value:u}:u!==void 0&&!f(u)?{end:n+1,spelling:i,arity:s,value:u}:{end:n,spelling:i,arity:s}}function C(e,n){let t=l([...n]);if(t===void 0)return;let r=p(n.slice(t));return(r?.alias??n[t])===e?t+(r?.canonical_argv.length??1):void 0}function T(e,n){let t=[];for(let r=n+1;r<e.length&&!f(e[r])&&e[r]!=="-";r+=1)t.push(r);return t}var I={test:new Set(["--add","--add-json","--remove","--remove-index"]),files:m,docs:m};function U(e,n,t,r){if(!(t.idAt!==void 0||e[n]==="-"||r.has(e[n])))return t.idAt=n,n}function b(e,n,t,r,o){let i=n[t]==="--"?void 0:S(n,t,r);if(!i)return;let s=i.arity.repeatable&&i.value!==void 0?T(n,i.end):[];if(s.length===0||o.idAt===void 0)return i.value!==void 0&&I[e]?.has(i.arity.name)&&(o.exact&&=L(e,i.arity.name,[i.value])==="exact"),i.end;let d=L(e,i.arity.name,[i.value,...s.map(u=>n[u])]);if(d!=="decline")return o.exact&&=d==="exact",o.extras.push(...s.map(u=>({at:u,flag:i.spelling}))),s.at(-1)}function g(e,n,t,r,o){let i={extras:[],exact:!0};for(let s=t;s<n.length;s+=1){let d=f(n[s])?b(e,n,s,r,i):U(n,s,i,o);if(d===void 0)return;s=d}return i}function M(e,n){let t=l([...e]);for(let r=0;r<t;r+=1){let o=f(e[r])?S(e,r,n):void 0;if(!o)return!1;r=o.end}return!0}function F(e,n,t,r=new Set){if(e===void 0||!O.has(e))return;let o=C(e,n),i=o===void 0||!M(n,t)?void 0:g(e,n,o,t,r);if(i?.idAt===void 0||i.extras.length===0)return;let s=new Map(i.extras.map(({at:a,flag:c})=>[a,c])),d=n.flatMap((a,c)=>s.has(c)?[s.get(c),a]:[a]),u=n.some(V);return{itemId:n[i.idAt],flags:[...new Set(i.extras.map(({flag:a})=>a))],extraValues:i.extras.map(({at:a})=>n[a]),...i.exact&&!u?{retryArgs:d}:{},...u?{readsStdin:!0}:{}}}function P(e,n,t){if(e===void 0||!O.has(e))return;let r=y(n,t,e);if(!r)return;let o=new Set(r.commands.flatMap(i=>[i.name(),...i.aliases()]));return F(e,t,_(r),o)}export{O as LINKED_RESOURCE_VALUE_LIST_COMMANDS,y as findInvokedCommand,_ as readCommandOptionArity,F as resolveLinkedResourceValueListRecovery,P as resolveUsageValueListRecovery};
2
- //# sourceMappingURL=linked-resource-value-list-ZBIY4H23.js.map
1
+ import"./chunk-5EFS7K7Y.js";import"./chunk-SLFRSZK6.js";import{f as l}from"./chunk-HNMED75Y.js";import{fa as h}from"./chunk-LTQWPQ7H.js";import"./chunk-JJ73G5UT.js";import"./chunk-EDJ3KR2H.js";import"./chunk-6H36ZHMI.js";import"./chunk-IW4A3I4N.js";import"./chunk-OGVSGXQX.js";import"./chunk-AA52P34H.js";import{sa as A}from"./chunk-Q2HMDV56.js";import"./chunk-CQHB3ZZH.js";import"./chunk-XKJ5NWQ7.js";import"./chunk-PZA7QECY.js";import"./chunk-TDOF7BKO.js";import"./chunk-RRBNCL63.js";import"./chunk-3AZOATC2.js";import"./chunk-UXEZXGAD.js";import"./chunk-GSLOAEY2.js";import"./chunk-ITM4AMVM.js";import"./chunk-3ESBFEQC.js";import{j as p}from"./chunk-XGNUDSCG.js";import"./chunk-TE6FBDHP.js";import"./chunk-K672XXGQ.js";import"./chunk-XAWE4EAK.js";var O=new Set(["files","docs","test"]);function x(e){return{name:e.long??e.short,value:e.required?"required":e.optional?"optional":"none",repeatable:e.parseArg===A}}function E(e){let n=[];for(let t=e;t;t=t.parent)n.push(...t.options);return n}function _(e){let n={};for(let t of E(e)){let r=x(t);for(let o of[t.long,t.short])o&&!Object.hasOwn(n,o)&&(n[o]=r)}return n}function y(e,n,t){let r=p(n.slice(l([...n])))?.canonical_argv,o=e;for(let i of r??[t])o=o?.commands.find(s=>s.name()===i);return o}function f(e){return e.length>1&&e.startsWith("-")}var m=new Set(["--add","--add-glob","--remove"]),w=/^[^\s,=:`]+$/u,R=/[[\]()]/u;function L(e,n,t){if(e==="test")return t.every(o=>h(n,o))?"exact":"decline";let r=o=>!f(o)&&w.test(o)&&(e!=="docs"||!R.test(o));return m.has(n)&&t.every(r)?"exact":"ambiguous"}function V(e){return e.trim()==="-"||/^--?[^=\s]+=\s*-\s*$/u.test(e)||/^--stdin(?:-json)?(?:=|$)/u.test(e)}function S(e,n,t){let r=e[n],o=r.startsWith("--")?r.indexOf("="):-1,i=o>=0?r.slice(0,o):r,s=Object.hasOwn(t,i)?t[i]:void 0;if(!s)return;let d=r.slice(o+1);if(o>=0)return s.value==="none"||f(d)?void 0:{end:n,spelling:i,arity:s,value:d};if(s.value==="none")return{end:n,spelling:i,arity:s};let u=e[n+1];return s.value==="required"?u===void 0||f(u)?void 0:{end:n+1,spelling:i,arity:s,value:u}:u!==void 0&&!f(u)?{end:n+1,spelling:i,arity:s,value:u}:{end:n,spelling:i,arity:s}}function C(e,n){let t=l([...n]);if(t===void 0)return;let r=p(n.slice(t));return(r?.alias??n[t])===e?t+(r?.canonical_argv.length??1):void 0}function T(e,n){let t=[];for(let r=n+1;r<e.length&&!f(e[r])&&e[r]!=="-";r+=1)t.push(r);return t}var I={test:new Set(["--add","--add-json","--remove","--remove-index"]),files:m,docs:m};function U(e,n,t,r){if(!(t.idAt!==void 0||e[n]==="-"||r.has(e[n])))return t.idAt=n,n}function b(e,n,t,r,o){let i=n[t]==="--"?void 0:S(n,t,r);if(!i)return;let s=i.arity.repeatable&&i.value!==void 0?T(n,i.end):[];if(s.length===0||o.idAt===void 0)return i.value!==void 0&&I[e]?.has(i.arity.name)&&(o.exact&&=L(e,i.arity.name,[i.value])==="exact"),i.end;let d=L(e,i.arity.name,[i.value,...s.map(u=>n[u])]);if(d!=="decline")return o.exact&&=d==="exact",o.extras.push(...s.map(u=>({at:u,flag:i.spelling}))),s.at(-1)}function g(e,n,t,r,o){let i={extras:[],exact:!0};for(let s=t;s<n.length;s+=1){let d=f(n[s])?b(e,n,s,r,i):U(n,s,i,o);if(d===void 0)return;s=d}return i}function M(e,n){let t=l([...e]);for(let r=0;r<t;r+=1){let o=f(e[r])?S(e,r,n):void 0;if(!o)return!1;r=o.end}return!0}function F(e,n,t,r=new Set){if(e===void 0||!O.has(e))return;let o=C(e,n),i=o===void 0||!M(n,t)?void 0:g(e,n,o,t,r);if(i?.idAt===void 0||i.extras.length===0)return;let s=new Map(i.extras.map(({at:a,flag:c})=>[a,c])),d=n.flatMap((a,c)=>s.has(c)?[s.get(c),a]:[a]),u=n.some(V);return{itemId:n[i.idAt],flags:[...new Set(i.extras.map(({flag:a})=>a))],extraValues:i.extras.map(({at:a})=>n[a]),...i.exact&&!u?{retryArgs:d}:{},...u?{readsStdin:!0}:{}}}function P(e,n,t){if(e===void 0||!O.has(e))return;let r=y(n,t,e);if(!r)return;let o=new Set(r.commands.flatMap(i=>[i.name(),...i.aliases()]));return F(e,t,_(r),o)}export{O as LINKED_RESOURCE_VALUE_LIST_COMMANDS,y as findInvokedCommand,_ as readCommandOptionArity,F as resolveLinkedResourceValueListRecovery,P as resolveUsageValueListRecovery};
2
+ //# sourceMappingURL=linked-resource-value-list-5JRGUDUB.js.map
@@ -1,2 +1,2 @@
1
- import{Fb as t,Gb as r,Hb as s}from"./chunk-NRQCBUYD.js";import"./chunk-GSLOAEY2.js";import"./chunk-I4SPJQQI.js";import"./chunk-TE6FBDHP.js";import"./chunk-K672XXGQ.js";import"./chunk-XAWE4EAK.js";function c(n){let e=r(n),o={...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:n,author_source:t(n),principal:s(n),...Object.keys(o).length===0?{}:{agent:Object.freeze(o)}})}export{c as resolveMutationActor};
2
- //# sourceMappingURL=mutation-actor-NHN33ITJ.js.map
1
+ import{Ib as t,Jb as r,Kb as s}from"./chunk-UXEZXGAD.js";import"./chunk-GSLOAEY2.js";import"./chunk-XGNUDSCG.js";import"./chunk-TE6FBDHP.js";import"./chunk-K672XXGQ.js";import"./chunk-XAWE4EAK.js";function c(n){let e=r(n),o={...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:n,author_source:t(n),principal:s(n),...Object.keys(o).length===0?{}:{agent:Object.freeze(o)}})}export{c as resolveMutationActor};
2
+ //# sourceMappingURL=mutation-actor-S5G7FMNG.js.map
@@ -1,2 +1,2 @@
1
- import{P as y,s as _,x as f}from"./chunk-L2ZSSMYY.js";import{a as A,j as L,m as M}from"./chunk-C6WM6ZN4.js";import"./chunk-CBUC4X7Q.js";import{u as E}from"./chunk-OXC5KBIQ.js";import"./chunk-3AZOATC2.js";import{ja as S}from"./chunk-NRQCBUYD.js";import{o as w}from"./chunk-GSLOAEY2.js";import{L as R,Xa as N,bb as b}from"./chunk-A5ZEMOVR.js";import{da as C}from"./chunk-I4SPJQQI.js";import{da as T,ea as g}from"./chunk-TE6FBDHP.js";import{C as m}from"./chunk-K672XXGQ.js";import"./chunk-XAWE4EAK.js";function l(e,t,n,i=!1){let s=[...n].map(o=>({candidate:o,distance:S(t,o,3)})).filter(o=>o.distance!==null).sort((o,d)=>o.distance-d.distance||o.candidate.localeCompare(d.candidate))[0]?.candidate,a=i?`Put mutation fields under options (options.${t}).`:s?`Did you mean "${s}"?`:"Use the declared command options or the field option for registered item fields.";throw new m(`Unknown ${e} ${i?"argument":"option"} "${t}". ${a} No changes were made.`,2,{code:"invalid_argument_value",reason:"unknown_mutation_option",changed:!1,field:t,required:a,nextSteps:[a]})}var p=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor"];function $(e){let t=e==="create"?L:M,i=(e==="create"?N:b).map(({flag:s})=>s.slice(2).replace(/-([a-z])/gu,(a,o)=>o.toUpperCase()));return new Set([...t.flatMap(s=>[s.target,...s.keys]),...i,"author","message","force","fullChangedFields","idOnly",...p])}function F(e){if(e!==void 0&&!f(e))throw new m("Mutation options must be an object. No changes were made.",2,{code:"invalid_argument_value",changed:!1})}async function v(e,t){let i=T((await E(w(process.cwd(),t))).schema).command_to_fields.get(e)??[];return{targets:i.map(s=>g(s)),reads:s=>i.some(a=>C({[s]:!0},a)===!0)}}async function h(e,t,n,i,s,a=(o,d)=>l(e,o,d)){let o=[...n].filter(r=>!i.has(r));if(o.length===0)return;let d=await v(t,s);for(let r of d.targets)i.add(r);for(let r of o)d.reads(r)||a(r,i)}async function ee(e,t,n,i,s){if(_(t))return;let a=$(e),o=new Set(["action","options","path","cwd","author","force","noExtensions","no_extensions","fullChangedFields","idOnly",...p,...s,...e==="update"?["id"]:[]]);for(let r of Object.keys(t))o.has(r)||l(e,r,a,a.has(r));let d=t.options;F(d),await h(e,e,new Set([...Object.keys(d??{}),...Object.keys(n)]),a,i)}var I=new Set([...y].filter(e=>e!=="filterStatus"&&(e.startsWith("filter")||e==="ids"||e==="limit"||e==="offset"))),k=e=>e.replace(/_([a-z])/gu,(t,n)=>n.toUpperCase()),O=new Map([["for","Bound the selection with list.limit."],["tokenBudget","Bound the selection with list.limit."],["token_budget","Bound the selection with list.limit."],["all",'State the status selection as filterStatus: "all" beside the list record.'],["status","State the status selection as filterStatus beside the list record."]]),K=["compact","brief","fields","includeBody","full"];async function U(e,t){let n=K.filter(s=>Object.hasOwn(e,s));if(n.length===0)return;let i=await v("list",t);for(let s of n)i.reads(s)&&c(`update-many "list.${s}" is not read beside this selection.`,`list.${s}`,"The bulk selection clears this list option, so the schema field's filter under that name is not applied; select the rows another way.")}var j=["excludeTerminal","lifecycleBucket","dependencyBlocked"];function P(){let e=R.map(({flag:n})=>n.replace(/^--(?:no-)?/u,"").replace(/-([a-z])/gu,(i,s)=>s.toUpperCase())),t=new Set([...e,...A.flatMap(n=>n.keys),"filterEstimateMissing",...j]);for(let n of O.keys())t.delete(n);return t}function c(e,t,n,i="unknown_mutation_option"){throw new m(`${e} ${n} No changes were made.`,2,{code:"invalid_argument_value",reason:i,changed:!1,field:t,required:n,nextSteps:[n]})}function D(){let e=$("update");e.delete("id");for(let t of e)/File$|^stdin/u.test(t)&&e.delete(t);return e.add("documentAnnotationSnapshot"),e}function B(e){for(let t of["list","update"]){let n=e[t];n!=null&&!f(n)&&c(`update-many "${t}" must be an object.`,t,`Pass ${t} as an object, or omit it.`,"invalid_mutation_option_value")}}async function x(e,t,n){Object.hasOwn(e,"id")&&l("update-many list","id",new Set(["ids"])),Object.hasOwn(e,"status")&&c('update-many "list.status" is not read beside this selection.',"list.status",O.get("status"));let i=[...t].find(s=>I.has(s));i!==void 0&&c(`update-many "${i}" is not read beside this selection.`,i,`Put the selection inside list, or drop the list record; a flat "${i}" beside it is not read.`),await U(e,n),await h("update-many list","list",Object.keys(e),P(),n,(s,a)=>{let o=O.get(s);o===void 0&&l("update-many list",s,a),c(`update-many "list.${s}" is not read beside this selection.`,`list.${s}`,o)})}function Y(e,t,n){for(let i of e)t.has(i)||(n.has(i)&&c(`Unknown update-many option "${i}".`,i,`Put update fields inside update (update.${i}); beside a nested update record an outer key selects rows or controls the run.`),l("update-many",i,t))}async function te(e,t,n){if(_(e))return;let i=e.options;F(i);let s=D(),a=new Set([...y,"author","message","force","fullChangedFields","idOnly",...p]),o=new Set([...s,...a]),d=new Set(["action","options","path","cwd","author","noExtensions","no_extensions","fullChangedFields","idOnly",...p]);for(let u of Object.keys(e))d.has(u)||l("update-many",u,o,o.has(u));let r=new Set([...Object.keys(i??{}),...Object.keys(t)].map(u=>p.includes(k(u))?k(u):u));if(B(t),f(t.list)&&await x(t.list,r,n),!f(t.update)){await h("update-many","update_many",r,o,n);return}Y(r,a,s),await h("update-many","update_many",Object.keys(t.update),s,n)}export{ee as assertNativeMutationOptions,te as assertNativeUpdateManyOptions};
2
- //# sourceMappingURL=mutation-admission-PGKJTCG6.js.map
1
+ import{Q as y,s as _,x as f}from"./chunk-L4HMFRHB.js";import{a as A,j as L,m as M}from"./chunk-Q2HMDV56.js";import"./chunk-TDOF7BKO.js";import{u as E}from"./chunk-RRBNCL63.js";import"./chunk-3AZOATC2.js";import{ma as S}from"./chunk-UXEZXGAD.js";import{o as w}from"./chunk-GSLOAEY2.js";import{L as R,Xa as N,bb as b}from"./chunk-3ESBFEQC.js";import{da as C}from"./chunk-XGNUDSCG.js";import{da as T,ea as g}from"./chunk-TE6FBDHP.js";import{C as m}from"./chunk-K672XXGQ.js";import"./chunk-XAWE4EAK.js";function l(e,t,n,i=!1){let s=[...n].map(o=>({candidate:o,distance:S(t,o,3)})).filter(o=>o.distance!==null).sort((o,d)=>o.distance-d.distance||o.candidate.localeCompare(d.candidate))[0]?.candidate,a=i?`Put mutation fields under options (options.${t}).`:s?`Did you mean "${s}"?`:"Use the declared command options or the field option for registered item fields.";throw new m(`Unknown ${e} ${i?"argument":"option"} "${t}". ${a} No changes were made.`,2,{code:"invalid_argument_value",reason:"unknown_mutation_option",changed:!1,field:t,required:a,nextSteps:[a]})}var p=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor"];function $(e){let t=e==="create"?L:M,i=(e==="create"?N:b).map(({flag:s})=>s.slice(2).replace(/-([a-z])/gu,(a,o)=>o.toUpperCase()));return new Set([...t.flatMap(s=>[s.target,...s.keys]),...i,"author","message","force","fullChangedFields","idOnly",...p])}function F(e){if(e!==void 0&&!f(e))throw new m("Mutation options must be an object. No changes were made.",2,{code:"invalid_argument_value",changed:!1})}async function v(e,t){let i=T((await E(w(process.cwd(),t))).schema).command_to_fields.get(e)??[];return{targets:i.map(s=>g(s)),reads:s=>i.some(a=>C({[s]:!0},a)===!0)}}async function h(e,t,n,i,s,a=(o,d)=>l(e,o,d)){let o=[...n].filter(r=>!i.has(r));if(o.length===0)return;let d=await v(t,s);for(let r of d.targets)i.add(r);for(let r of o)d.reads(r)||a(r,i)}async function ee(e,t,n,i,s){if(_(t))return;let a=$(e),o=new Set(["action","options","path","cwd","author","force","noExtensions","no_extensions","fullChangedFields","idOnly",...p,...s,...e==="update"?["id"]:[]]);for(let r of Object.keys(t))o.has(r)||l(e,r,a,a.has(r));let d=t.options;F(d),await h(e,e,new Set([...Object.keys(d??{}),...Object.keys(n)]),a,i)}var I=new Set([...y].filter(e=>e!=="filterStatus"&&(e.startsWith("filter")||e==="ids"||e==="limit"||e==="offset"))),k=e=>e.replace(/_([a-z])/gu,(t,n)=>n.toUpperCase()),O=new Map([["for","Bound the selection with list.limit."],["tokenBudget","Bound the selection with list.limit."],["token_budget","Bound the selection with list.limit."],["all",'State the status selection as filterStatus: "all" beside the list record.'],["status","State the status selection as filterStatus beside the list record."]]),K=["compact","brief","fields","includeBody","full"];async function U(e,t){let n=K.filter(s=>Object.hasOwn(e,s));if(n.length===0)return;let i=await v("list",t);for(let s of n)i.reads(s)&&c(`update-many "list.${s}" is not read beside this selection.`,`list.${s}`,"The bulk selection clears this list option, so the schema field's filter under that name is not applied; select the rows another way.")}var j=["excludeTerminal","lifecycleBucket","dependencyBlocked"];function P(){let e=R.map(({flag:n})=>n.replace(/^--(?:no-)?/u,"").replace(/-([a-z])/gu,(i,s)=>s.toUpperCase())),t=new Set([...e,...A.flatMap(n=>n.keys),"filterEstimateMissing",...j]);for(let n of O.keys())t.delete(n);return t}function c(e,t,n,i="unknown_mutation_option"){throw new m(`${e} ${n} No changes were made.`,2,{code:"invalid_argument_value",reason:i,changed:!1,field:t,required:n,nextSteps:[n]})}function D(){let e=$("update");e.delete("id");for(let t of e)/File$|^stdin/u.test(t)&&e.delete(t);return e.add("documentAnnotationSnapshot"),e}function B(e){for(let t of["list","update"]){let n=e[t];n!=null&&!f(n)&&c(`update-many "${t}" must be an object.`,t,`Pass ${t} as an object, or omit it.`,"invalid_mutation_option_value")}}async function x(e,t,n){Object.hasOwn(e,"id")&&l("update-many list","id",new Set(["ids"])),Object.hasOwn(e,"status")&&c('update-many "list.status" is not read beside this selection.',"list.status",O.get("status"));let i=[...t].find(s=>I.has(s));i!==void 0&&c(`update-many "${i}" is not read beside this selection.`,i,`Put the selection inside list, or drop the list record; a flat "${i}" beside it is not read.`),await U(e,n),await h("update-many list","list",Object.keys(e),P(),n,(s,a)=>{let o=O.get(s);o===void 0&&l("update-many list",s,a),c(`update-many "list.${s}" is not read beside this selection.`,`list.${s}`,o)})}function Y(e,t,n){for(let i of e)t.has(i)||(n.has(i)&&c(`Unknown update-many option "${i}".`,i,`Put update fields inside update (update.${i}); beside a nested update record an outer key selects rows or controls the run.`),l("update-many",i,t))}async function te(e,t,n){if(_(e))return;let i=e.options;F(i);let s=D(),a=new Set([...y,"author","message","force","fullChangedFields","idOnly",...p]),o=new Set([...s,...a]),d=new Set(["action","options","path","cwd","author","noExtensions","no_extensions","fullChangedFields","idOnly",...p]);for(let u of Object.keys(e))d.has(u)||l("update-many",u,o,o.has(u));let r=new Set([...Object.keys(i??{}),...Object.keys(t)].map(u=>p.includes(k(u))?k(u):u));if(B(t),f(t.list)&&await x(t.list,r,n),!f(t.update)){await h("update-many","update_many",r,o,n);return}Y(r,a,s),await h("update-many","update_many",Object.keys(t.update),s,n)}export{ee as assertNativeMutationOptions,te as assertNativeUpdateManyOptions};
2
+ //# sourceMappingURL=mutation-admission-HQVNPOXV.js.map
@@ -1,4 +1,4 @@
1
- import{a as ce}from"./chunk-PCDTWL6V.js";import"./chunk-SLFRSZK6.js";import{b as g,c as _,d as O}from"./chunk-4YYFY33T.js";import{L as ie,P as re,U as ae,n as oe,u as I,w as ne}from"./chunk-SY5C3U32.js";import{Ha as V,Hc as X,Jc as Y,Lc as Z,Mb as K,Oc as ee,Pc as te,Rc as se,Sc as le,Tc as de,U as Q,vc as W}from"./chunk-ZL6J6JYT.js";import"./chunk-3HKPVOAN.js";import"./chunk-6H36ZHMI.js";import{Aa as $,Ba as M,Ca as B,Da as N,Ea as T,Fa as U,Ga as P,Ha as z,Ia as H,Ja as J,pa as y,sa as s,ua as l}from"./chunk-C6WM6ZN4.js";import"./chunk-QDV7S2QS.js";import"./chunk-AHV3CSQG.js";import"./chunk-PZA7QECY.js";import{va as R,wa as q}from"./chunk-CBUC4X7Q.js";import{u as G}from"./chunk-OXC5KBIQ.js";import"./chunk-3AZOATC2.js";import{Ke as v,Pe as h,Qe as u,ah as k,we as F}from"./chunk-NRQCBUYD.js";import{o as D}from"./chunk-GSLOAEY2.js";import{e as L}from"./chunk-A5ZEMOVR.js";import{o as j,p as E}from"./chunk-I4SPJQQI.js";import"./chunk-TE6FBDHP.js";import{A as c,C as f}from"./chunk-K672XXGQ.js";import"./chunk-XAWE4EAK.js";async function ye(e,i){let t=y(i),n=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(d=>d===!0).length>1)throw new f("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.",c.USAGE);let r=z(e.stream);if(r&&!t.json)throw new f("--stream requires --json output mode.",c.USAGE);let o=P(e),a=await K(r&&e.full!==!0&&e.provenance!==!0?{...o,raw:!0,compact:!0}:o,t);r?N(a,o,t):h(a,t),t.profile&&u(`profile:command=activity took_ms=${Date.now()-n}`)}function C(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 ve(e,i){return!i||i.size===0?!0:e==="context"?i.has("context")||i.has("ctx"):i.has(e)}function ue(e){return new f(`List --format must be one of ${e?"json":"csv|table|json|ndjson|toon"}`,c.USAGE,{field:"format"})}function pe(e,i=!1){if(e===void 0)return;if(typeof e!="string")throw ue(i);let t=e.trim().toLowerCase();if(t==="csv"||t==="table"||t==="json"||t==="ndjson"||t==="toon")return t;throw ue(i)}function S(e,i,t,n=!1){if(i===void 0)return t;if(typeof i!="string")throw new f(`${e} --format must be one of ${n?"json|ndjson|toon":"json|toon"}`,c.USAGE);let r=i.trim().toLowerCase();if(r!=="json"&&(r!=="ndjson"||!n)&&r!=="toon")throw new f(`${e} --format must be one of ${n?"json|ndjson|toon":"json|toon"}`,c.USAGE);if(t.json===!0&&r==="toon")throw new f(`${e} cannot combine --json with --format toon`,c.USAGE);return{...t,json:r==="json"||r==="ndjson"}}function ge(e,i){L[i]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function me(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 be={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 we(e,i){let t=e.stream===!0,n=pe(e.format,t),r=n==="csv"||n==="table",o=n==="json"||n==="ndjson"||n==="toon"?S("List",e.format,i,!0):i;if(t&&!o.json)throw new f("--stream requires --json output mode.",c.USAGE);if((r||n==="ndjson")&&t)throw new f("--format csv|table|ndjson cannot be combined with --stream.",c.USAGE);return{streamMode:t,listFormat:n,effectiveGlobal:o}}function xe(e,i,t){if(t.listFormat==="csv"||t.listFormat==="table"){k(i);let n=i.items,r=t.listFormat==="csv"?R(n):q(n);!t.effectiveGlobal.quiet&&r.length>0&&v(`${r}
1
+ import{a as ce}from"./chunk-W7HA65EO.js";import"./chunk-SLFRSZK6.js";import{b as g,c as _,d as O}from"./chunk-AHVOEE7F.js";import{L as ie,P as re,U as ae,n as oe,u as I,w as ne}from"./chunk-E5HO7HWP.js";import{Ha as V,Hc as X,Jc as Y,Lc as Z,Mb as K,Oc as ee,Pc as te,Rc as se,Sc as le,Tc as de,U as Q,vc as W}from"./chunk-PBMLIV74.js";import"./chunk-EDJ3KR2H.js";import"./chunk-6H36ZHMI.js";import{Aa as $,Ba as M,Ca as B,Da as N,Ea as T,Fa as U,Ga as P,Ha as z,Ia as H,Ja as J,pa as y,sa as s,ua as l}from"./chunk-Q2HMDV56.js";import"./chunk-CQHB3ZZH.js";import"./chunk-XKJ5NWQ7.js";import"./chunk-PZA7QECY.js";import{va as R,wa as q}from"./chunk-TDOF7BKO.js";import{u as G}from"./chunk-RRBNCL63.js";import"./chunk-3AZOATC2.js";import{Ne as v,Se as h,Te as u,eh as k,ze as F}from"./chunk-UXEZXGAD.js";import{o as D}from"./chunk-GSLOAEY2.js";import{e as L}from"./chunk-3ESBFEQC.js";import{o as j,p as E}from"./chunk-XGNUDSCG.js";import"./chunk-TE6FBDHP.js";import{A as c,C as f}from"./chunk-K672XXGQ.js";import"./chunk-XAWE4EAK.js";async function ye(e,i){let t=y(i),n=Date.now();if([e.raw,e.compact,e.full,e.provenance].filter(d=>d===!0).length>1)throw new f("Activity projection options are mutually exclusive. Use --raw, --compact, --provenance, or --full.",c.USAGE);let r=z(e.stream);if(r&&!t.json)throw new f("--stream requires --json output mode.",c.USAGE);let o=P(e),a=await K(r&&e.full!==!0&&e.provenance!==!0?{...o,raw:!0,compact:!0}:o,t);r?N(a,o,t):h(a,t),t.profile&&u(`profile:command=activity took_ms=${Date.now()-n}`)}function C(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 ve(e,i){return!i||i.size===0?!0:e==="context"?i.has("context")||i.has("ctx"):i.has(e)}function ue(e){return new f(`List --format must be one of ${e?"json":"csv|table|json|ndjson|toon"}`,c.USAGE,{field:"format"})}function pe(e,i=!1){if(e===void 0)return;if(typeof e!="string")throw ue(i);let t=e.trim().toLowerCase();if(t==="csv"||t==="table"||t==="json"||t==="ndjson"||t==="toon")return t;throw ue(i)}function S(e,i,t,n=!1){if(i===void 0)return t;if(typeof i!="string")throw new f(`${e} --format must be one of ${n?"json|ndjson|toon":"json|toon"}`,c.USAGE);let r=i.trim().toLowerCase();if(r!=="json"&&(r!=="ndjson"||!n)&&r!=="toon")throw new f(`${e} --format must be one of ${n?"json|ndjson|toon":"json|toon"}`,c.USAGE);if(t.json===!0&&r==="toon")throw new f(`${e} cannot combine --json with --format toon`,c.USAGE);return{...t,json:r==="json"||r==="ndjson"}}function ge(e,i){L[i]==="brief"&&e.includeBody!==!0&&e.compact!==!0&&e.brief!==!0&&e.full!==!0&&e.fields===void 0&&(e.brief=!0)}function me(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 be={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 we(e,i){let t=e.stream===!0,n=pe(e.format,t),r=n==="csv"||n==="table",o=n==="json"||n==="ndjson"||n==="toon"?S("List",e.format,i,!0):i;if(t&&!o.json)throw new f("--stream requires --json output mode.",c.USAGE);if((r||n==="ndjson")&&t)throw new f("--format csv|table|ndjson cannot be combined with --stream.",c.USAGE);return{streamMode:t,listFormat:n,effectiveGlobal:o}}function xe(e,i,t){if(t.listFormat==="csv"||t.listFormat==="table"){k(i);let n=i.items,r=t.listFormat==="csv"?R(n):q(n);!t.effectiveGlobal.quiet&&r.length>0&&v(`${r}
2
2
  `)}else if(t.listFormat==="ndjson"){k(i);let n=_(i.items);!t.effectiveGlobal.quiet&&n.length>0&&v(`${n}
3
3
  `)}else t.streamMode?B(e,i,t.effectiveGlobal):h(i,t.effectiveGlobal)}function A(e,i,t,n=[]){if(t.outputBudget===void 0)return F(e,i,n);let{outputBudget:r,...o}=F(e,{...i,outputBudget:t.outputBudget},n);return o}async function ke(e){let i=y(e.actionCommand),t=e.aliasContract?{...i,command:e.aliasContract.canonical}:i,n=Date.now();e.aliasContract?.lifecycle==="deprecated"&&await G(D(process.cwd(),t.path)).then(he=>he.ux.deprecation_hints)&&u(E(e.aliasContract));let r=A("list",e.options,t),o=$(r),a=Se(e,o),{effectiveName:d,effectiveStatus:p,effectiveDependencyBlocked:m,effectiveExcludeTerminal:w}=a;ge(o,e.name),Object.assign(o,{projectionCommand:d}),w&&(o.excludeTerminal=!0),o.dependencyBlocked=m;let x=we(r,t),fe=await Q(m?void 0:p,o,t);xe("list",fe,x),t.profile&&u(`profile:command=list took_ms=${Date.now()-n}`)}function Se(e,i){let t=e.name,n=e.status,r=e.dependencyBlocked===!0,o=e.excludeTerminal===!0,a=i.status?.trim().toLowerCase(),d=e.name==="list"&&a!==void 0?be[a]:void 0;return e.name==="list"&&(e.options.all===!0||a==="all"?(t="list-all",o=!1,i.status=void 0):a!==void 0&&d!==void 0&&(t=d.name,n=a,r=d.dependencyBlocked,o=!1,i.status=void 0)),(t==="list-open"||t==="list-in-progress")&&(i.lifecycleBucket=t==="list-open"?"open":"in_progress",n=void 0),{effectiveName:t,effectiveStatus:n,effectiveDependencyBlocked:r,effectiveExcludeTerminal:o}}function _e(e,i){let{name:t,description:n,status:r,excludeTerminal:o,allowStatusFilter:a,dependencyBlocked:d,aliasContract:p}=i,m=e.command(t,{hidden:p?.hidden===!0}).description(n);a&&m.option("--status <value>","Filter by status (repeatable or comma-separated; matches any; all selects every status)",s),t==="list"&&m.option("--all","Include every lifecycle status"),m.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(t,"--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)"),me(m),m.action(async(w,x)=>{await ke({name:t,status:r,excludeTerminal:o,dependencyBlocked:d,options:w,actionCommand:x,aliasContract:p})}),l(m,"--tags <value>","Alias for --tag"),l(m,"--assignee_filter <value>","Alias for --assignee-filter"),l(m,"--tree_depth <n>","Alias for --tree-depth"),l(m,"--token_budget <n>","Alias for --token-budget"),l(m,"--filter-estimate-missing","Alias for --filter-estimates-missing")}async function Ae(e,i){let t=y(i),n=Date.now(),r=await oe(M(e),t);h(r,t),t.profile&&u(`profile:command=aggregate took_ms=${Date.now()-n}`)}async function Fe(e,i){let t=y(i),n=Date.now(),r=H(A("context",e,t)),o=await Y(r,t),a=W(r,t);if(a==="markdown")t.quiet||v(`${X(o)}
4
4
  `);else if(a==="ndjson"){k(o);let d=_([...o.high_level,...o.low_level,...o.blocked_fallback]);!t.quiet&&d.length>0&&v(`${d}
@@ -8,4 +8,4 @@ import{a as ce}from"./chunk-PCDTWL6V.js";import"./chunk-SLFRSZK6.js";import{b as
8
8
  `);return}for await(let r of le({...e,intervalMs:n}))t||v(`${O(r.events,{count:r.count,has_more:r.has_more,next_cursor:r.next_cursor??null,source:r.source,integrity:r.integrity,...r.verified_streams===void 0?{}:{verified_streams:r.verified_streams},heartbeat:r.count===0})}
9
9
  `)}function qe(e){return e.cursor_mode==="row"?_(e.events):O(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 Ge(e,i){let t=y(i),n=Date.now(),r=De(e,t.path);if(e.follow===!0){await Re(r,e,t.quiet===!0);return}let o=await se(r);if(k(o),t.json){h(o,t),t.profile&&u(`profile:command=events took_ms=${Date.now()-n}`);return}let a=qe(o);!t.quiet&&a.length>0&&v(`${a}
10
10
  `),t.profile&&u(`profile:command=events took_ms=${Date.now()-n}`)}async function Le(e,i,t,n,r){let o=y(r),a=Date.now(),d=await V(e,i,t,{...Array.isArray(n.kind)?{kind:n.kind}:{},maxDepth:typeof n.maxDepth=="string"?n.maxDepth:void 0,limit:typeof n.limit=="string"?n.limit:void 0,after:typeof n.after=="string"?n.after:void 0,direction:typeof n.direction=="string"?n.direction:void 0,maxPaths:typeof n.maxPaths=="string"?n.maxPaths:void 0,sample:typeof n.sample=="string"?n.sample:void 0,...Array.isArray(n.exemptIsolate)?{exemptIsolate:n.exemptIsolate}:{},...Array.isArray(n.exemptIsolateType)?{exemptIsolateType:n.exemptIsolateType}:{},saveBaseline:n.saveBaseline===!0,rebuild:n.rebuild===!0,clear:n.clear===!0,summary:n.summary===!0,full:n.full===!0},o);h(d,o),o.profile&&u(`profile:command=graph took_ms=${Date.now()-a}`)}function Ct(e,i){let t=i?.commandFilter,n=o=>ve(o,t),r=[{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 o of r)if(n(o.name)){let a=j(o.name);_e(e,{...o,...a?.registration==="commander"?{aliasContract:a}:{}})}if(n("aggregate")){let o=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(o,"--include_unparented","Alias for --include-unparented"),l(o,"--assignee_filter <value>","Alias for --assignee-filter"),o.action(Ae)}if(n("context")){let o=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(o,"--assignee_filter <value>","Alias for --assignee-filter"),l(o,"--max-items <n>","Alias for --limit"),l(o,"--explain_ranking","Alias for --explain-ranking"),l(o,"--token_budget <n>","Alias for --token-budget"),o.action(Fe)}if(n("next")){let o=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(o,"--assignee_filter <value>","Alias for --assignee-filter"),l(o,"--blocked_limit <n>","Alias for --blocked-limit"),l(o,"--ready_only","Alias for --ready-only"),l(o,"--explain_ranking","Alias for --explain-ranking"),l(o,"--token_budget <n>","Alias for --token-budget"),o.action(Ie)}if(n("search")){let o=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");me(o),o.action(Oe),l(o,"--tags <value>","Alias for --tag"),l(o,"--token_budget <n>","Alias for --token-budget")}if(n("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 (${re}); default: search/eval-queries.json; errors show an example`).option("--format <value>","Eval output format override: json|toon").action(Ce),n("get")){let o=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(je);l(o,"--tree_depth <n>","Alias for --tree-depth"),l(o,"--token_budget <n>","Alias for --token-budget")}if(n("history")){let o=e.command("history").enablePositionalOptions().argument("<id>","Item id").option("--limit <n>","Latest N; keeps order").option("--order <value>","oldest_first|newest_first").option("--compact","Summary (default newest_first)").option("--full","Patches (default oldest_first)").option("--provenance","Authors (default newest_first)").option("--provenance-summary","Count provenance completeness").option("--harness <value>","Harness (repeatable)",s).option("--agent-instance <value>","Instance (repeatable)",s).option("--provenance-filter <dimension=value>","Provenance (repeatable)",s).option("--diff","Before/after field diffs").option("--field <name>","Filter changed field; implies --diff").option("--verify","Verify full chain and replay").option("--strict-exit","With --verify, fail on integrity errors").option("--fail-on-warn","Alias for --strict-exit").option("--format <value>","Output: json|toon").description("Read history.").action(Ee);ce(o,!0),C(o.command("activity"))}n("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(Ge),n("activity")&&C(e.command("activity",{hidden:!0})),n("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(Le)}var jt={resolveReadCommandOutputFormat:S,parseListFormat:pe};export{jt as _testOnlyRegisterListQuery,Ct as registerListQueryCommands};
11
- //# sourceMappingURL=register-list-query-7S5QWDTI.js.map
11
+ //# sourceMappingURL=register-list-query-SQF5PSJ4.js.map