@unbrained/pm-cli 2026.11.24 → 2026.11.26

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 (207) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli/commander-usage.js +9 -9
  3. package/dist/cli/error-guidance.js +5 -5
  4. package/dist/cli/help-content.js +4 -4
  5. package/dist/cli/register-setup.js +1 -1
  6. package/dist/cli/runtime/selection.js +1 -1
  7. package/dist/cli-bundle/bundle-manifest.json +1 -1
  8. package/dist/cli-bundle/chunks/{chunk-WWTPNIC2.js → chunk-5AAIRHNE.js} +2 -2
  9. package/dist/cli-bundle/chunks/chunk-5BPDT7G2.js +2 -0
  10. package/dist/cli-bundle/chunks/{chunk-ZYCOM4MS.js → chunk-5FY2VHRF.js} +5 -5
  11. package/dist/cli-bundle/chunks/{chunk-YYT3MIRF.js → chunk-6OIHST4I.js} +1 -1
  12. package/dist/cli-bundle/chunks/chunk-7F3UFYZA.js +2 -0
  13. package/dist/cli-bundle/chunks/chunk-B2GM6KOM.js +2 -0
  14. package/dist/cli-bundle/chunks/chunk-BITDGTAX.js +2 -0
  15. package/dist/cli-bundle/chunks/{chunk-DQDRA3SW.js → chunk-CBBKXTJG.js} +2 -2
  16. package/dist/cli-bundle/chunks/chunk-DUJSME77.js +3 -0
  17. package/dist/cli-bundle/chunks/{chunk-37UDIJ2K.js → chunk-DYL2N3OC.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-VJSGUXGU.js → chunk-FWBR3OW7.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-GQXK4KKH.js +31 -0
  20. package/dist/cli-bundle/chunks/{chunk-ZOX4SWRL.js → chunk-HOLQZ56F.js} +2 -2
  21. package/dist/cli-bundle/chunks/chunk-HTGN24XM.js +3 -0
  22. package/dist/cli-bundle/chunks/{chunk-PW7U7WCE.js → chunk-IGW3RVJC.js} +2 -2
  23. package/dist/cli-bundle/chunks/chunk-KCRRTJ4X.js +125 -0
  24. package/dist/cli-bundle/chunks/{chunk-Z7MFVRDV.js → chunk-KES4VHU4.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-D6PDUKUG.js → chunk-KHFUHGL3.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-HNKK2UG6.js → chunk-LNZKNVMT.js} +3 -3
  27. package/dist/cli-bundle/chunks/{chunk-5DUP4AZA.js → chunk-MGJMQSN4.js} +2 -2
  28. package/dist/cli-bundle/chunks/chunk-MNFCJNQA.js +35 -0
  29. package/dist/cli-bundle/chunks/{chunk-PQUBVRV5.js → chunk-NDS4MXZX.js} +2 -2
  30. package/dist/cli-bundle/chunks/{chunk-TVIJ2VCU.js → chunk-PQSEEVOA.js} +6 -6
  31. package/dist/cli-bundle/chunks/chunk-QMM46SJM.js +4 -0
  32. package/dist/cli-bundle/chunks/chunk-RFK3ERYX.js +2 -0
  33. package/dist/cli-bundle/chunks/{chunk-7X253M6Z.js → chunk-SX76UGEY.js} +2 -2
  34. package/dist/cli-bundle/chunks/chunk-T3GJPXIZ.js +69 -0
  35. package/dist/cli-bundle/chunks/{chunk-FXJYZBWV.js → chunk-WZOJSHJT.js} +40 -40
  36. package/dist/cli-bundle/chunks/{chunk-23K6DQQY.js → chunk-XRCE4QNL.js} +2 -2
  37. package/dist/cli-bundle/chunks/{chunk-SSALO4DB.js → chunk-ZDL45VTB.js} +2 -2
  38. package/dist/cli-bundle/chunks/{field-option-collisions-W66HSWMK.js → field-option-collisions-CGRJEAPQ.js} +2 -2
  39. package/dist/cli-bundle/chunks/{indexed-receipt-blobs-BPYKN5Q7.js → indexed-receipt-blobs-H3MMNXXG.js} +2 -2
  40. package/dist/cli-bundle/chunks/{item-revision-D3LSBNIR.js → item-revision-FGDR5NSF.js} +2 -2
  41. package/dist/cli-bundle/chunks/item-transaction-C3KAMEYO.js +2 -0
  42. package/dist/cli-bundle/chunks/{mutation-actor-OKL3CQVX.js → mutation-actor-HGG47KXV.js} +2 -2
  43. package/dist/cli-bundle/chunks/mutation-admission-LLHIRY6O.js +2 -0
  44. package/dist/cli-bundle/chunks/{register-list-query-3LBV6CS2.js → register-list-query-EKSCZWEZ.js} +2 -2
  45. package/dist/cli-bundle/chunks/{register-mutation-72AGTMNE.js → register-mutation-ZIAOKKUJ.js} +2 -2
  46. package/dist/cli-bundle/chunks/{register-operations-XERFG2SH.js → register-operations-ECVBZ5FM.js} +2 -2
  47. package/dist/cli-bundle/chunks/register-setup-3QYD5H4H.js +2 -0
  48. package/dist/cli-bundle/chunks/{runtime-schema-JP2KBHBY.js → runtime-schema-Y4SHTEXL.js} +2 -2
  49. package/dist/cli-bundle/chunks/{settlement-hook-6MR32OOC.js → settlement-hook-ESAAEBRM.js} +2 -2
  50. package/dist/cli-bundle/chunks/{stage-T2LKWN7C.js → stage-RSCSUYEJ.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-LMU7DDOA.js → chunk-3BR5NWQI.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-46MP7IZN.js → chunk-3GQRWIT5.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-RIE3SJSE.js → chunk-4SX2BN4V.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-RLO2HCZT.js → chunk-AAB3ZR7Z.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/chunk-AVLB4L7M.js +44 -0
  56. package/dist/cli-bundle/focused-chunks/{chunk-B6BNHKUW.js → chunk-FQWKESMI.js} +58 -59
  57. package/dist/cli-bundle/focused-chunks/{chunk-GXP7Q4XM.js → chunk-FW5Q26HA.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/chunk-GQBWI4KA.js +2 -0
  59. package/dist/cli-bundle/focused-chunks/{chunk-3ELVASVA.js → chunk-IWEGGRRD.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-Z7W2RQIB.js → chunk-JUG3BAZZ.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/chunk-KEZ4VXYD.js +2 -0
  62. package/dist/cli-bundle/focused-chunks/{chunk-A6VEMCRR.js → chunk-NGFDPEP7.js} +1 -1
  63. package/dist/cli-bundle/focused-chunks/{chunk-SMMOZ3H3.js → chunk-NSFS3VWP.js} +37 -37
  64. package/dist/cli-bundle/focused-chunks/{chunk-OZOCEB2Q.js → chunk-NXUFVQ33.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-RIQUIHYU.js → chunk-OCKKIECS.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/{chunk-UVTUX54T.js → chunk-QNWNUQSJ.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/chunk-QSRXF6XS.js +15 -0
  68. package/dist/cli-bundle/focused-chunks/chunk-R6QFPHWW.js +3 -0
  69. package/dist/cli-bundle/focused-chunks/{chunk-24VRBNKE.js → chunk-RDELKGLS.js} +2 -2
  70. package/dist/cli-bundle/focused-chunks/chunk-RFJ3MEFP.js +27 -0
  71. package/dist/cli-bundle/focused-chunks/{chunk-C7WHWI7K.js → chunk-RMJKVQYE.js} +2 -2
  72. package/dist/cli-bundle/focused-chunks/{chunk-3OCDKITJ.js → chunk-TNVLDU7Z.js} +3 -3
  73. package/dist/cli-bundle/focused-chunks/chunk-UA2JNKMY.js +4 -0
  74. package/dist/cli-bundle/focused-chunks/chunk-VV2QF5IE.js +91 -0
  75. package/dist/cli-bundle/focused-chunks/{chunk-HL47UQZJ.js → chunk-WHHFPATO.js} +2 -2
  76. package/dist/cli-bundle/focused-chunks/{chunk-YD66IRSL.js → chunk-YNRW2FWB.js} +2 -2
  77. package/dist/cli-bundle/focused-chunks/{chunk-XDBHD4CY.js → chunk-YSZZSV6M.js} +3 -3
  78. package/dist/cli-bundle/focused-chunks/{field-option-collisions-UODPSV6W.js → field-option-collisions-WV6GPYYP.js} +2 -2
  79. package/dist/cli-bundle/focused-chunks/{indexed-receipt-blobs-EGEJMG3G.js → indexed-receipt-blobs-PG2VJ3MB.js} +2 -2
  80. package/dist/cli-bundle/focused-chunks/{item-revision-QH7RNBX4.js → item-revision-RPTXN7WW.js} +2 -2
  81. package/dist/cli-bundle/focused-chunks/{item-transaction-ZO72OINF.js → item-transaction-A6MVNPT7.js} +2 -2
  82. package/dist/cli-bundle/focused-chunks/{mutation-actor-PHVLKG4I.js → mutation-actor-6ZVW6OME.js} +2 -2
  83. package/dist/cli-bundle/focused-chunks/{mutation-admission-ZSG5OECH.js → mutation-admission-2DA4CINP.js} +2 -2
  84. package/dist/cli-bundle/focused-chunks/{runtime-schema-6RQMIDTN.js → runtime-schema-YXPYDD2C.js} +2 -2
  85. package/dist/cli-bundle/focused-chunks/{settlement-hook-FMLGKG7J.js → settlement-hook-4MGRERCT.js} +2 -2
  86. package/dist/cli-bundle/focused-chunks/{stage-AQMKRVX4.js → stage-RG3PKST7.js} +2 -2
  87. package/dist/cli-bundle/main.js +26 -26
  88. package/dist/cli-bundle/sdk-authoring.js +1 -1
  89. package/dist/cli-bundle/sdk-contracts.js +4 -4
  90. package/dist/cli-bundle/sdk-core.js +1 -1
  91. package/dist/cli-bundle/sdk-governance.js +1 -1
  92. package/dist/cli-bundle/sdk-graph.js +1 -1
  93. package/dist/cli-bundle/sdk-merge.js +63 -63
  94. package/dist/cli-bundle/sdk-query.js +1 -1
  95. package/dist/cli-bundle/sdk-runtime.js +1 -1
  96. package/dist/cli-bundle/sdk-testing.js +1 -1
  97. package/dist/cli-bundle/sdk.js +12 -12
  98. package/dist/core/reproducibility/context.d.ts +2 -0
  99. package/dist/core/reproducibility/context.js +1 -1
  100. package/dist/core/shared/command-line.d.ts +54 -4
  101. package/dist/core/shared/command-line.js +1 -1
  102. package/dist/core/shared/errors.d.ts +9 -0
  103. package/dist/core/shared/secret-rules.js +5 -5
  104. package/dist/core/shared/url-credentials.d.ts +16 -3
  105. package/dist/core/shared/url-credentials.js +1 -1
  106. package/dist/core/store/item-store.d.ts +26 -4
  107. package/dist/core/store/item-store.js +1 -1
  108. package/dist/sdk/cli-bootstrap.d.ts +17 -0
  109. package/dist/sdk/cli-bootstrap.js +1 -1
  110. package/dist/sdk/cli-contracts/command-aliases.js +1 -1
  111. package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
  112. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  113. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  114. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  115. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  116. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  117. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  118. package/dist/sdk/cli-contracts.d.ts +1 -1
  119. package/dist/sdk/cli-contracts.js +1 -1
  120. package/dist/sdk/command-line.d.ts +1 -1
  121. package/dist/sdk/command-line.js +1 -1
  122. package/dist/sdk/completion/shared.d.ts +1 -1
  123. package/dist/sdk/completion/shared.js +1 -1
  124. package/dist/sdk/context-intent-contracts.js +1 -1
  125. package/dist/sdk/extension/bundled-catalog.js +1 -1
  126. package/dist/sdk/extension/install-sources.js +5 -5
  127. package/dist/sdk/extension/listing-fields.d.ts +15 -0
  128. package/dist/sdk/extension/listing-fields.js +2 -0
  129. package/dist/sdk/extension/managed-update-status.js +1 -1
  130. package/dist/sdk/extension/npm-spec.d.ts +18 -0
  131. package/dist/sdk/extension/npm-spec.js +2 -0
  132. package/dist/sdk/extension/static-inventory.d.ts +53 -1
  133. package/dist/sdk/extension/static-inventory.js +1 -1
  134. package/dist/sdk/extension/update-check.js +1 -1
  135. package/dist/sdk/extension/update-observations.js +3 -0
  136. package/dist/sdk/extension/upgrade-hints.js +2 -0
  137. package/dist/sdk/extension.d.ts +2 -0
  138. package/dist/sdk/extension.js +1 -1
  139. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  140. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  141. package/dist/sdk/governance/tracked-runtime-cache.js +1 -1
  142. package/dist/sdk/governance/upgrade.d.ts +7 -2
  143. package/dist/sdk/governance/upgrade.js +2 -2
  144. package/dist/sdk/index.d.ts +1 -1
  145. package/dist/sdk/lifecycle/claim.d.ts +21 -1
  146. package/dist/sdk/lifecycle/claim.js +1 -1
  147. package/dist/sdk/lifecycle/task-composition.js +1 -1
  148. package/dist/sdk/ownership-source.d.ts +15 -1
  149. package/dist/sdk/ownership-source.js +1 -1
  150. package/dist/sdk/public-surface.json +1 -1
  151. package/dist/sdk/query/context.d.ts +20 -7
  152. package/dist/sdk/query/context.js +4 -2
  153. package/dist/sdk/runtime-input.js +1 -1
  154. package/dist/sdk/runtime-primitives.d.ts +1 -1
  155. package/dist/sdk/testing.d.ts +20 -2
  156. package/docs/AGENT_GUIDE.md +2 -2
  157. package/docs/COMMANDS.md +19 -1
  158. package/docs/CONFIGURATION.md +1 -0
  159. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +6 -0
  160. package/docs/EXTENSION_LIFECYCLE.md +72 -2
  161. package/docs/MUTATION_INTEGRITY.md +97 -8
  162. package/docs/SDK.md +61 -5
  163. package/docs/WORKSPACE_POSITION_AND_LIFECYCLE.md +17 -4
  164. package/marketplace.json +1 -1
  165. package/package.json +1 -1
  166. package/packages/pm-beads/package.json +1 -1
  167. package/packages/pm-calendar/package.json +1 -1
  168. package/packages/pm-command-kit/package.json +1 -1
  169. package/packages/pm-digital-twin/package.json +1 -1
  170. package/packages/pm-governance-audit/package.json +1 -1
  171. package/packages/pm-guide-shell/package.json +1 -1
  172. package/packages/pm-kanban/package.json +1 -1
  173. package/packages/pm-lifecycle-hooks/package.json +1 -1
  174. package/packages/pm-linked-test-adapters/package.json +1 -1
  175. package/packages/pm-search-advanced/package.json +1 -1
  176. package/packages/pm-templates/package.json +1 -1
  177. package/packages/pm-todos/package.json +1 -1
  178. package/packages/pm-vcs/package.json +1 -1
  179. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  180. package/plugins/pm-claude/package.json +1 -1
  181. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  182. package/plugins/pm-codex/package.json +1 -1
  183. package/plugins/pm-codex/plugin.json +1 -1
  184. package/runtime-dependencies.json +1 -1
  185. package/dist/cli-bundle/chunks/chunk-7IROAPWI.js +0 -3
  186. package/dist/cli-bundle/chunks/chunk-7VRFEURZ.js +0 -33
  187. package/dist/cli-bundle/chunks/chunk-AWB5KBJS.js +0 -2
  188. package/dist/cli-bundle/chunks/chunk-I2OJ5B4A.js +0 -2
  189. package/dist/cli-bundle/chunks/chunk-I3BFCKZR.js +0 -2
  190. package/dist/cli-bundle/chunks/chunk-MXUSC5RS.js +0 -31
  191. package/dist/cli-bundle/chunks/chunk-PLIUU37C.js +0 -3
  192. package/dist/cli-bundle/chunks/chunk-STOOTHZZ.js +0 -2
  193. package/dist/cli-bundle/chunks/chunk-TKRY22SO.js +0 -2
  194. package/dist/cli-bundle/chunks/chunk-XFADNMGD.js +0 -2
  195. package/dist/cli-bundle/chunks/chunk-YOPTAIBD.js +0 -125
  196. package/dist/cli-bundle/chunks/chunk-YW2HBHRO.js +0 -70
  197. package/dist/cli-bundle/chunks/item-transaction-M6NTBYH3.js +0 -2
  198. package/dist/cli-bundle/chunks/mutation-admission-EKPEOZMF.js +0 -2
  199. package/dist/cli-bundle/chunks/register-setup-W22L34Z4.js +0 -2
  200. package/dist/cli-bundle/focused-chunks/chunk-3GT4A3ZN.js +0 -44
  201. package/dist/cli-bundle/focused-chunks/chunk-3Z7MCUJM.js +0 -3
  202. package/dist/cli-bundle/focused-chunks/chunk-5LDBS6MS.js +0 -91
  203. package/dist/cli-bundle/focused-chunks/chunk-EUQGZPGO.js +0 -2
  204. package/dist/cli-bundle/focused-chunks/chunk-FDZPRJXJ.js +0 -27
  205. package/dist/cli-bundle/focused-chunks/chunk-LMFIAQ2V.js +0 -2
  206. package/dist/cli-bundle/focused-chunks/chunk-Q2HY44LV.js +0 -13
  207. package/dist/cli-bundle/focused-chunks/chunk-REFMQY47.js +0 -2
@@ -1,2 +1,2 @@
1
- import{normalizeUniqueStringList as U}from"./string-lists.js";import{PM_EXPECT_HASH_ACTIONS as W,PM_TOOL_ACTIONS as h}from"./enum-contracts.js";import{TOOL_CREATE_OPTION_CONTRACTS as K,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS as E,TOOL_UPDATE_OPTION_CONTRACTS as Y,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS as j,TOOL_CONTEXT_OPTION_CONTRACTS as G,TOOL_ACTIVITY_OPTION_CONTRACTS as H,TOOL_LIST_FILTER_OPTION_CONTRACTS as $,TOOL_AGGREGATE_OPTION_CONTRACTS as B,TOOL_SEARCH_FILTER_OPTION_CONTRACTS as z,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS as J}from"./tool-option-contracts.js";import{PM_TOOL_PARAMETER_PROPERTIES as R,PM_TOOL_PARAMETER_METADATA as V,PM_TOOL_ACTION_SCOPED_PARAMETER_PROPERTIES as X,PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA as Z,PLAN_ACTION_PARAMETER_PROPERTIES as _,PLAN_ACTION_PARAMETER_METADATA as g}from"./tool-parameter-tables.js";import{toUniqueFlagContracts as Q,withFlagAliasMetadata as ee}from"./flag-contracts.js";import{resolveReadOutputSurface as te}from"../read-output-contracts.js";import{CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS as re,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS as oe}from"./commander-mutation-options.js";const ae={...X,"history-attest":{verify:{type:"object",additionalProperties:!0},output:{not:{}}}},f={...R,pause:{type:"boolean"},handoff:{type:"string"},releaseAssignment:{type:"boolean"},hashAlgorithm:{type:"string",enum:["sha256","sha512"]}},u={...V,pause:{description:"Return work to its configured open status before releasing ownership."},handoff:{description:"Release into a configured non-terminal queue with a required evidence message."},releaseAssignment:{description:"Release assignment after recording closure evidence."},hashAlgorithm:{description:"Digest for detached history bundles; defaults to sha256."}},ne=["json","quiet","profile","noExtensions","noPager","tokenAccounting","path","pmExecutable","timeoutMs"],ie=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor","outputRowContract"],se=new Set(["action","cwd","options",...Object.keys(f).filter(e=>e!=="severity")]);function ke(e){const t=e.trim().toLowerCase();let r="";for(let o=0;o<t.length;o+=1){const a=t[o];if(a!=="-"&&a!=="_"){r+=a;continue}let n=o+1;for(;t[n]==="-"||t[n]==="_";)n+=1;const i=t[n];if(i!==void 0&&(i>="a"&&i<="z"||i>="0"&&i<="9")){r+=i.toUpperCase(),o=n;continue}r+=t.slice(o,n),o=n-1}return se.has(r)?{field:e,property:r,owner:"mcp_tool_input",nested_path:r==="expectHash"?`options.field (${e}=<value>)`:`options.${r}`}:void 0}const le={create:["fullChangedFields","idOnly"],copy:["fullChangedFields","idOnly"],update:["fullChangedFields","idOnly"],"item-reopen":["fullChangedFields","idOnly"],close:["fullChangedFields","idOnly"],claim:["fullChangedFields","idOnly"],release:["fullChangedFields","idOnly"],"start-task":["fullChangedFields","idOnly"],"pause-task":["fullChangedFields","idOnly"],"close-task":["fullChangedFields","idOnly"],restore:["fullChangedFields","idOnly"],append:["fullChangedFields"],"update-many":["fullChangedFields"],"close-many":["fullChangedFields"],assurance:["fullChangedFields","idOnly"]},de=["createMode","status","deadline","estimate","acceptanceCriteria","definitionOfReady","order","rank","goal","objective","value","impact","outcome","whyNow","assignee","reviewer","risk","confidence","sprint","release","blockedReason","unblockNote","reporter","severity","environment","reproSteps","resolution","expectedResult","actualResult","affectedVersion","fixedVersion","component","regression","customerImpact","comment","note","learning","reminder","event","typeOption"],ce=Object.freeze({"close-many":["list","expected_result","expected","actual_result","actual","validate_close","dry_run","checkpoint","no_checkpoint","filterAssignee_filter"],"update-many":["list","update","dry_run","checkpoint","no_checkpoint","filterAssignee_filter"],...Object.fromEntries(h.filter(e=>e==="upgrade"||e==="install"||e==="extension"||e==="package"||e.startsWith("extension-")||e.startsWith("package-")).map(e=>[e,["project","local","global"]]))});function s(e){return U(e)}const pe=s([...K.map(e=>e.param),...E.map(e=>e.param)]),v=s([...Y.map(e=>e.param),...E.map(e=>e.param),"force"]),ue=s([...j.map(e=>e.param),...v.filter(e=>e!=="allowMissingParent"&&e!=="completedAt"),"dryRun","rollback","noCheckpoint"]),me=s([...J.map(e=>e.param),"reason","completedAt","resolution","expectedResult","actualResult","validateClose","dryRun","rollback","noCheckpoint","author","message","force"]),C=s([...G.map(e=>e.param),"past","section"]),ye=s([...H.map(e=>e.param),"stream"]),A=s([...$.map(e=>e.param),"all","includeBody","noTruncate","strictRead","compact","brief","full"]),c=A.filter(e=>e!=="all"&&e!=="status"),d=[[{property:"today",schema:{const:!0}},{property:"recent",schema:{const:!0}}],[{property:"today",schema:{const:!0}},{property:"updatedAfter",schema:{type:"string",pattern:"\\S"}}],[{property:"recent",schema:{const:!0}},{property:"updatedAfter",schema:{type:"string",pattern:"\\S"}}]],fe=[[{property:"summary",schema:{const:!0}},{property:"schemaOnly",schema:{const:!0}}],[{property:"summary",schema:{const:!0}},{property:"flagsOnly",schema:{const:!0}}],[{property:"summary",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}],[{property:"schemaOnly",schema:{const:!0}},{property:"flagsOnly",schema:{const:!0}}],[{property:"schemaOnly",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}],[{property:"flagsOnly",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}]],Oe=s([...B.map(e=>e.param),"count","completion","includeUnparented"]),he=s(["query","keywords","mode","semantic","hybrid","includeLinked","titleExact","phraseExact","highlight","compact","full",...z.map(e=>e.param)]),P=s(["type","tag","priority","assignee","assigneeFilter","sprint","release","parent","limit","blockedLimit","readyOnly","format","includeDecisions","includeGates","includeContainers","tokenBudget","explainRanking"]),l=["author","message","force"],Ae=["releaseAssignment","text","reason","closeReason","completedAt","duplicateOf","validateClose","resolution","expectedResult","actualResult"],m=["author","assignee","message","force"],Te=["dryRun","target","scope","capability","declarative","github","ref","init","install","uninstall","explore","manage","offline","describe","markdown","output","reload","doctor","catalog","list","adopt","adoptAll","activate","deactivate","runtimeProbe","fixManagedState","isolated","ignoreGlobal","detail","trace","watch","strictExit","failOnWarn"];function b(e){return{[`${e}-init`]:{required:["target"],optional:["scope","capability",...e==="package"?["declarative"]:[]]},[`${e}-install`]:{optional:["target","github","scope","ref","dryRun"],anyOfRequired:[["target"],["github"]]},[`${e}-uninstall`]:{required:["target"],optional:["scope"]},[`${e}-explore`]:{optional:["scope"]},[`${e}-manage`]:{optional:["scope","runtimeProbe","fixManagedState","offline"]},[`${e}-describe`]:{optional:["target","scope","markdown","output"]},[`${e}-reload`]:{optional:["scope","watch"]},[`${e}-doctor`]:{optional:["scope","detail","trace","fixManagedState","isolated","ignoreGlobal","strictExit","failOnWarn"]},[`${e}-catalog`]:{optional:["scope","fields"]},[`${e}-adopt`]:{required:["target"],optional:["scope","github","ref"]},[`${e}-adopt-all`]:{optional:["scope"]},[`${e}-activate`]:{required:["target"],optional:["scope"]},[`${e}-deactivate`]:{required:["target"],optional:["scope"]},[e]:{optional:Te,dependentAnyOfRequired:[{property:"dryRun",value:!0,anyOfRequired:[["install","target"],["install","github"]]}],mutuallyExclusiveWhen:[[{property:"dryRun",schema:{const:!0}},{property:"install",schema:{const:!1}}]]}}}const S={required:["title"],optional:["start","duration","end","location","timezone","allDay","parent","inheritFocus","allowMissingParent","tags","priority","body","description","author","message"]},q={optional:["target","scope","dryRun","cliOnly","packagesOnly","repair","tag","packageName"]},y={init:{optional:["prefix","idPrefix","workspace","preset","typePreset","defaults","author","agentGuidance","withPackages","mergeFence","force","verbose"]},config:{required:["scope","configAction"],optional:["key","value","criterion","clearCriteria","format","policy"]},...b("extension"),...b("package"),"package-upgrade":q,install:{optional:["target","github","scope","ref","dryRun"],anyOfRequired:[["target"],["github"]]},upgrade:q,create:{required:["title","description","type","status","priority","message"],optional:pe},copy:{required:["id"],optional:["title","author","message","allowDuplicate"]},focus:{optional:["id","clear"],mutuallyExclusive:[["id","clear"]]},list:{optional:A,mutuallyExclusiveWhen:d},"list-all":{optional:A,mutuallyExclusiveWhen:d},"list-draft":{optional:c,mutuallyExclusiveWhen:d},"list-open":{optional:c,mutuallyExclusiveWhen:d},"list-in-progress":{optional:c,mutuallyExclusiveWhen:d},"list-blocked":{optional:c,mutuallyExclusiveWhen:d},"list-closed":{optional:c,mutuallyExclusiveWhen:d},"list-canceled":{optional:c,mutuallyExclusiveWhen:d},aggregate:{optional:Oe},guide:{optional:["list","format","depth"]},context:{optional:C},ctx:{optional:C},get:{required:["id"],optional:["for","tokenBudget","at","depth","full","fields","tree","treeDepth","format"]},search:{optional:he,anyOfRequired:[["query"],["keywords"]]},eval:{optional:["mode","k","failUnder","queries","format"]},events:{optional:["verify","since","type","author","item","limit","full","provenance","provenanceSummary","harness","agentInstance","provenanceFilter","cursorMode"]},merge:{required:["subcommand"],optional:["dryRun","preCommitHook","stage","author","message","force","includeReconciled","artifact","basePath","oursPath","theirsPath","output","outputPath","itemPath","prefer"]},workspace:{required:["subcommand"],optional:["snapshotAction","name","target","dryRun","force","author","message","lockTtlSeconds","lockWaitMs"],conditionalRequired:[{property:"subcommand",value:"snapshot",required:["snapshotAction"]}]},meet:S,event:S,remind:{required:["title"],optional:["at","text","parent","inheritFocus","allowMissingParent","tags","priority","body","description","author","message"]},next:{optional:[...P,"for"]},reindex:{optional:["mode","progress"]},history:{required:["id"],optional:["limit","order","compact","full","provenance","provenanceSummary","harness","agentInstance","provenanceFilter","diff","verify","field","strictExit","failOnWarn","format"]},"history-attest":{optional:["verify","output","hashAlgorithm"],mutuallyExclusive:[["verify","hashAlgorithm"]]},"history-redact":{required:["id"],optional:["literal","regex","replacement","dryRun",...l],anyOfRequired:[["literal"],["regex"]]},"history-repair":{optional:["id","all","dryRun","normalizeProvenance","salvageTail","appendOnly",...l],oneOfRequired:[["id"],["all"]],mutuallyExclusiveWhen:[[{property:"appendOnly",schema:{const:!0}},{property:"salvageTail",schema:{const:!0}}],[{property:"appendOnly",schema:{const:!0}},{property:"normalizeProvenance",schema:{const:!0}}],[{property:"salvageTail",schema:{const:!0}},{property:"all",schema:{const:!0}}],[{property:"salvageTail",schema:{const:!0}},{property:"normalizeProvenance",schema:{const:!0}}]]},"history-author-acknowledge":{optional:["historyEvent","allActionable","dryRun","planFingerprint","limit","attributedAuthor","reviewer","reason"],oneOfRequired:[["historyEvent"],["allActionable"]]},"history-compact":{optional:["id","before","ids","allOver","closed","allStreams","minEntries","dryRun",...l]},schema:{mutuallyExclusiveWhen:[[{property:"subcommand",schema:{const:"policy-mode"}},{property:"name",schema:{not:{enum:["advise","refuse"]}}}]],required:["subcommand"],optional:["definition","policy","message","name","description","defaultStatus","folder","alias","role","order","fieldType","commands","cliFlag","required","requiredOnCreate","allowUnset","requiredTypes","typePreset","infer","minCount","apply","to","migrationId","fieldTypeScope","dryRun","author","force"],conditionalRequired:[{property:"subcommand",value:"policy-put",required:["definition"]},{property:"subcommand",value:"policy-remove",required:["name"]},{property:"subcommand",value:"policy-mode",required:["name"]},{property:"subcommand",value:"policy-check",required:["name"]},{property:"subcommand",value:"policy-approve",required:["name","policy"]},{property:"subcommand",value:"show",required:["name"]},{property:"subcommand",value:"show-status",required:["name"]},{property:"subcommand",value:"add-type",required:["name"]},{property:"subcommand",value:"remove-type",required:["name"]},{property:"subcommand",value:"add-status",required:["name"]},{property:"subcommand",value:"remove-status",required:["name"]},{property:"subcommand",value:"add-field",required:["name"]},{property:"subcommand",value:"remove-field",required:["name"]},{property:"subcommand",value:"show-field",required:["name"]},{property:"subcommand",value:"rename-type",required:["name","to"]},{property:"subcommand",value:"rename-field",required:["name","to"]},{property:"subcommand",value:"remap-status",required:["name","to"]},{property:"subcommand",value:"apply-preset",required:["typePreset"]}]},profile:{required:["subcommand"],optional:["name","dryRun","author","force"],conditionalRequired:[{property:"subcommand",value:"show",required:["name"]},{property:"subcommand",value:"apply",required:["name"]},{property:"subcommand",value:"lint",required:["name"]}]},plan:{required:["subcommand"],optional:["id","stepRef","reorderTo","title","description","template","scope","parent","inheritFocus","related","blocks","blockedBy","harness","mode","resumeContext","tags","priority",...de,"body","claim","fromSearch","stepTitle","step","stepBody","stepOwner","stepStatus","stepEvidence","stepBlockedReason","stepReplacement","dependsOn","link","linkKind","linkNote","promoteToItemDep","allowMultipleActive","file","test","doc","decisionText","decision","decisionRationale","decisionEvidence","discoveryText","discovery","validationText","validation","validationCommand","validationExpected","depth","fields","steps","materializeType","materializeParent","materializeTags","field",...l]},activity:{optional:ye},restore:{required:["id","target"],optional:l},update:{required:["id"],optional:v,mutuallyExclusive:[["acceptanceCriteria","addAc"],["acceptanceCriteria","removeAc"]]},"update-many":{optional:ue,mutuallyExclusive:[["acceptanceCriteria","addAc"],["acceptanceCriteria","removeAc"]]},close:{required:["id"],optional:[...Ae,...l]},"close-many":{optional:me},delete:{required:["id"],optional:["dryRun",...l]},append:{required:["id","body"],optional:l},comments:{required:["id"],optional:["text","add","stdin","edit","delete","limit","full","ifAbsent","expectAt",...l],mutuallyExclusive:[["edit","ifAbsent"],["delete","ifAbsent"],["expectAt","ifAbsent"]]},notes:{required:["id"],optional:["text","add","addJson","stdin","edit","delete","limit","since","eventType","includeMeta","full","ifAbsent","expectAt",...l],mutuallyExclusive:[["addJson","add"],["addJson","stdin"],["addJson","file"],["addJson","edit"],["addJson","delete"],["edit","ifAbsent"],["delete","ifAbsent"],["expectAt","ifAbsent"]]},learnings:{required:["id"],optional:["text","add","stdin","edit","delete","limit","full","ifAbsent","expectAt",...l],mutuallyExclusive:[["edit","ifAbsent"],["delete","ifAbsent"],["expectAt","ifAbsent"]]},files:{required:[],optional:["id","add","addGlob","remove","migrate","list","addNote","noteConflict","discover","apply","discoveryNote","appendStable","validatePaths","full","lookupPath","scope","limit","offset","noTruncate","strictRead","explain","lines","decisionDepth",...l],anyOfRequired:[["id"],["lookupPath"]],dependentAnyOfRequired:[{property:"addNote",anyOfRequired:[["add"],["addGlob"]]},{property:"noteConflict",anyOfRequired:[["add"],["addGlob"]]}]},docs:{required:["id"],optional:["add","addGlob","remove","migrate","addNote","noteConflict","list","validatePaths","full",...l],dependentAnyOfRequired:[{property:"addNote",anyOfRequired:[["add"],["addGlob"]]},{property:"noteConflict",anyOfRequired:[["add"],["addGlob"]]}]},deps:{required:["id"],optional:["format","maxDepth","collapse","summary","full","nodeLimit","edgeLimit","tokenBudget","cursor","direction","kind"]},graph:{required:["subcommand"],optional:["id","target","kind","maxDepth","limit","after","direction","maxPaths","sample","exemptIsolate","exemptIsolateType","saveBaseline","rebuild","clear","summary","full"]},test:{required:["id"],optional:["list","add","addJson","remove","removeIndex","update","updateIndex","setJson","run","match","onlyIndex","onlyLast","full","background","timeout","progress","envSet","envClear","sharedHostSafe","pmContext","overrideLinkedPmContext","workspaceContext","overrideLinkedWorkspaceContext","allowUntrustedLinkedTests","acknowledgeLinkedTests","failOnContextMismatch","failOnSkipped","failOnEmptyTestRun","requireAssertionsForPm","checkContext","fullOutput","autoPmContext","measure","metricBelow","metricDiff",...l],dependentAnyOfRequired:[{property:"update",anyOfRequired:[["setJson"]]},{property:"updateIndex",anyOfRequired:[["setJson"]]},{property:"setJson",anyOfRequired:[["update"],["updateIndex"]]}],mutuallyExclusive:[["update","updateIndex"],["acknowledgeLinkedTests","run"],["acknowledgeLinkedTests","background"]]},"test-all":{optional:["status","limit","offset","background","timeout","progress","envSet","envClear","sharedHostSafe","pmContext","overrideLinkedPmContext","workspaceContext","overrideLinkedWorkspaceContext","allowUntrustedLinkedTests","failOnContextMismatch","failOnSkipped","failOnEmptyTestRun","requireAssertionsForPm","checkContext","fullOutput","autoPmContext"]},telemetry:{optional:["subcommand","limit"]},"test-runs-list":{optional:["status","limit"]},"test-runs-status":{required:["runId"]},"test-runs-logs":{required:["runId"],optional:["stream","tail"]},"test-runs-stop":{required:["runId"],optional:["force"]},"test-runs-resume":{required:["runId"],optional:["author"]},stats:{optional:["includeEmpty","storage","metadataCoverage","fieldUtilization","byAssignee","byTag","byPriority","tagPrefix","measurements","metric","measurementLimit","observe","improvementDirection","measurementSource","measurementItem","measurementRevision","author","message","provenanceCoverage","fleetAttribution","since","eventLimit","minimumSample"]},duplicates:{optional:["status","since","threshold","limit","exhaustive"]},health:{optional:["strictDirectories","requireMergeDrivers","strictExit","failOnWarn","checkOnly","checkTelemetry","noRefresh","refreshVectors","verboseStaleItems","verboseAuthorEvents","brief","summary","skipVectors","skipIntegrity","skipDrift","full"]},validate:{optional:["checkCompleteness","checkStorageIntegrity","checkMetadata","metadataProfile","checkResolution","checkLifecycle","checkStaleBlockers","dependencyCycleSeverity","parentCycleSeverity","checkFiles","scanMode","includePmInternals","verboseFileLists","verboseDiagnostics","allAffectedIds","strictExit","failOnWarn","fixHints","autoFix","dryRun","fixScope","pruneMissing","checkHistoryDrift","checkCommandReferences","counts","full"]},assurance:{required:["subcommand"],optional:["kind","id","definition","trigger","treeId","gate","limit","dryRun","author","message","preset","owner","apply","enforcement"],conditionalRequired:[{property:"subcommand",value:"list",required:["kind"]},{property:"subcommand",value:"show",required:["kind","id"]},{property:"subcommand",value:"put",required:["kind","id","definition"]},{property:"subcommand",value:"remove",required:["kind","id"]},{property:"subcommand",value:"run",required:["id","trigger"]},{property:"subcommand",value:"apply",required:["preset","owner"]},{property:"subcommand",value:"derive",required:["owner"]},{property:"subcommand",value:"risk",required:["definition"]},{property:"subcommand",value:"lineages",required:["definition"]},{property:"subcommand",value:"promote",required:["id","enforcement"]}],mutuallyExclusiveWhen:[[{property:"subcommand",schema:{const:"risk"}},{property:"definition",schema:{not:{required:["policy","change"]}}}],[{property:"subcommand",schema:{const:"lineages"}},{property:"definition",schema:{anyOf:[{required:["change"]},{not:{required:["policy"]}}]}}]]},gc:{optional:["dryRun","gcScope"]},contracts:{optional:["contractAction","command","summary","schemaOnly","flagsOnly","availabilityOnly","runtimeOnly","activeOnly","full"],mutuallyExclusiveWhen:fe},completion:{required:["shell"],optional:["eagerTags"]},claim:{optional:["start","id","next","ifAvailable","takeoverStale","maxAttempts","includeDecisions",...P,...m],oneOfRequired:[["id"],["next"]],mutuallyExclusiveWhen:[[{property:"start",schema:{const:!0}},{property:"ifAvailable",schema:{const:!0}},{property:"id",schema:{type:"string"}}],[{property:"takeoverStale",schema:{const:!0}},{property:"force",schema:{const:!0}}],[{property:"takeoverStale",schema:{const:!0}},{property:"next",schema:{const:!0}}]]},release:{required:["id"],optional:["pause","handoff",...m],dependentAnyOfRequired:[{property:"handoff",anyOfRequired:[["message"]]}],mutuallyExclusiveWhen:[[{property:"pause",schema:{const:!0}},{property:"handoff",schema:{type:"string"}}]]},"start-task":{required:["id"],optional:[...m,"takeoverStale"],mutuallyExclusiveWhen:[[{property:"takeoverStale",schema:{const:!0}},{property:"force",schema:{const:!0}}]]},"pause-task":{required:["id"],optional:m},"close-task":{required:["id"],optional:["text","validateClose",...m]},"item-reopen":{required:["id","reason"],optional:["status","expectedResult","author","message","force"]}},Le=Object.freeze(Object.fromEntries(h.map(e=>[e,y[e]])));function x(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").trim().replace(/^./,t=>t.toUpperCase()).concat(".")}function M(e,t){const r=typeof t=="object"&&t!==null?{...t}:{},o=u[e];return{...r,description:o?.description??x(e),...o?.examples?{examples:o.examples}:{}}}function Ee(e,t){if(e==="history-attest"&&t==="verify")return{description:"Compare all retained history streams with a detached JSON proof object. Server-local proof paths are not accepted over MCP."};if(e==="history-attest"&&t==="output")return{description:"Local CLI/SDK only. MCP rejects this field; save the returned JSON bundle on the client."};if(e==="claim"&&t==="start")return{description:"Move the claimed item to its configured in-progress status; with next, the selected item is claimed and started in one locked write."};if((e==="list"||e.startsWith("list-"))&&t==="all")return{description:"Return items from every lifecycle status instead of the default active-status set."};if(e==="plan"&&Object.prototype.hasOwnProperty.call(g,t))return g[t];const r=Z[e];return r&&Object.prototype.hasOwnProperty.call(r,t)?r[t]:u[t]}function I(e,t,r){const o=typeof r=="object"&&r!==null?{...r}:{},a=Ee(e,t);return{...o,description:a?.description??x(t),...a?.examples?{examples:a.examples}:{}}}function Re(e,t){if(e==="claim"&&t==="start")return{type:"boolean"};const r=ae[e];return r&&Object.prototype.hasOwnProperty.call(r,t)?r[t]:e==="plan"&&Object.prototype.hasOwnProperty.call(_,t)?_[t]:(e==="get"||e==="history"||e==="search")&&t==="format"?{type:"string",enum:["json","toon"]}:t==="pause"||t==="handoff"||t==="releaseAssignment"||t==="hashAlgorithm"?f[t]:R[t]}function _e(e,t){const r={action:{const:e,description:u.action?.description??"Tool action to execute."}};for(const o of t){if(o==="action")continue;const a=Re(e,o);a&&(r[o]=I(e,o,a))}return r}function ge(e,t){const r=t.flat();return t.map(o=>{const a=r.filter(n=>!o.includes(n));return{required:[...o],...a.length>0?{not:{anyOf:a.map(n=>({required:[n]}))}}:{},...e==="history-repair"&&o.includes("all")?{properties:{all:{const:!0}}}:e==="claim"&&o.includes("next")?{properties:{next:{const:!0}}}:{}}})}function N(e,t){return{...t===void 0?{}:{properties:{[e]:{const:t}}},required:[e]}}function ve(e){const t=[];if(e.conditionalRequired&&e.conditionalRequired.length>0)for(const r of e.conditionalRequired)t.push({if:N(r.property,r.value),then:{required:r.required}});if(e.dependentAnyOfRequired&&e.dependentAnyOfRequired.length>0)for(const r of e.dependentAnyOfRequired)t.push({if:N(r.property,r.value),then:{anyOf:r.anyOfRequired.map(o=>({required:[...o]}))}});if(e.mutuallyExclusive&&e.mutuallyExclusive.length>0)for(const r of e.mutuallyExclusive)t.push({not:{required:s(r)}});if(e.mutuallyExclusiveWhen&&e.mutuallyExclusiveWhen.length>0)for(const r of e.mutuallyExclusiveWhen)t.push({not:{allOf:r.map(o=>({properties:{[o.property]:o.schema},required:[o.property]}))}});return t}function k(e){if(!Object.prototype.hasOwnProperty.call(y,e))return;const t=y[e],r=le[e]??[];return s(["action",...ne,...te(e)!==void 0?ie:[],...r,...W.has(e)?["expectHash"]:[],...t.required??[],...t.optional??[]])}function we(e){const t=k(e);if(t===void 0)return;const r=e==="create"?re:e==="update"?oe:[];return s([...t,...r.flatMap(({keys:o,target:a})=>[a,...o]),...ce[e]??[]])}function T(e){const t=y[e],r=s(t.required??[]),o=k(e),a={type:"object",additionalProperties:!1,required:["action",...r],title:`pm action "${e}" parameters`,properties:_e(e,o)};t.anyOfRequired&&t.anyOfRequired.length>0&&(a.anyOf=t.anyOfRequired.map(i=>({required:[...i]}))),t.oneOfRequired&&t.oneOfRequired.length>0&&(a.oneOf=ge(e,t.oneOfRequired));const n=ve(t);return n.length>0&&(a.allOf=n),a}function De(e,t={}){const r=T(e),o={...r.properties};delete o.action;const a=[...r.anyOf??[],...r.oneOf??[]],n=(t.required??r.required.map(String)).filter(p=>p==="action"?!1:t.required===void 0?!0:!a.some(O=>O.required?.map(String).includes(p))),i={type:"object",additionalProperties:t.additionalProperties??!0,properties:{...o,options:{type:"object",additionalProperties:!0,description:"Advanced command options forwarded to the selected pm action."},...t.properties},required:n};return r.anyOf!==void 0&&(i.anyOf=r.anyOf),r.oneOf!==void 0&&(i.oneOf=r.oneOf),r.allOf!==void 0&&(i.allOf=r.allOf),i}function L(e){let t;const r=()=>t??=e();return new Proxy({},{get:(o,a)=>r()[a],has:(o,a)=>a in r(),ownKeys:()=>Reflect.ownKeys(r()),getOwnPropertyDescriptor:(o,a)=>{const n=Reflect.getOwnPropertyDescriptor(r(),a);return n&&(n.configurable=!0),n}})}const w="4.28.0",Ce=w.split(".")[0],Pe="1.12.0",Fe=L(()=>({$schema:"https://json-schema.org/draft/2020-12/schema",$id:`https://schema.unbrained.dev/pm-cli/tool-parameters-v${Ce}.schema.json`,title:"pm-cli tool parameters (action-scoped strict schema)","x-schema-version":w,type:"object",oneOf:h.map(e=>T(e))}));function D(e,t){const r=M(e,t);if(typeof r.type=="string")return r;const a=(Array.isArray(r.anyOf)?r.anyOf:[]).find(p=>typeof p.type=="string");if(a){const{anyOf:p,...O}=r;return{...a,...O}}const{anyOf:n,...i}=r;return{...i,type:"string"}}function F(){const e={action:{type:"string",description:u.action?.description??"Tool action to execute."},options:{type:"object",additionalProperties:!0,description:"Advanced command options object forwarded to the selected pm action."}};for(const t of Object.keys(f).sort())e[t]=D(t,f[t]);return{title:"pm-cli tool parameters (provider-compatible flat schema)","x-schema-version":Pe,type:"object",additionalProperties:!1,required:["action"],properties:e}}const Ue=L(F),We={buildActionScopedToolSchema:T,buildProviderCompatibleToolSchema:F,decorateActionScopedToolParameterDefinition:I,decorateToolParameterDefinition:M,toolActionSchemaContracts:y,toolParameterMetadata:u,toProviderCompatibleParameterDefinition:D,toUniqueFlagContracts:Q,withFlagAliasMetadata:ee};export{Ae as CLOSE_ACTION_OPTION_KEYS,de as PLAN_CREATE_METADATA_PARAMETER_KEYS,Ue as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Pe as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,Le as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Fe as PM_TOOL_PARAMETERS_SCHEMA,Ce as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,w as PM_TOOL_PARAMETERS_SCHEMA_VERSION,se as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,We as _testOnlyCliContracts,De as buildPmActionToolInputSchema,we as pmToolActionNestedOptionKeys,k as pmToolActionParameterKeys,ke as resolvePmToolCustomFieldCollision};
1
+ import{normalizeUniqueStringList as U}from"./string-lists.js";import{PM_EXPECT_HASH_ACTIONS as W,PM_TOOL_ACTIONS as h}from"./enum-contracts.js";import{TOOL_CREATE_OPTION_CONTRACTS as K,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS as E,TOOL_UPDATE_OPTION_CONTRACTS as Y,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS as j,TOOL_CONTEXT_OPTION_CONTRACTS as G,TOOL_ACTIVITY_OPTION_CONTRACTS as H,TOOL_LIST_FILTER_OPTION_CONTRACTS as $,TOOL_AGGREGATE_OPTION_CONTRACTS as B,TOOL_SEARCH_FILTER_OPTION_CONTRACTS as z,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS as J}from"./tool-option-contracts.js";import{PM_TOOL_PARAMETER_PROPERTIES as R,PM_TOOL_PARAMETER_METADATA as V,PM_TOOL_ACTION_SCOPED_PARAMETER_PROPERTIES as X,PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA as Z,PLAN_ACTION_PARAMETER_PROPERTIES as _,PLAN_ACTION_PARAMETER_METADATA as g}from"./tool-parameter-tables.js";import{toUniqueFlagContracts as Q,withFlagAliasMetadata as ee}from"./flag-contracts.js";import{resolveReadOutputSurface as te}from"../read-output-contracts.js";import{CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS as re,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS as oe}from"./commander-mutation-options.js";const ae={...X,"history-attest":{verify:{type:"object",additionalProperties:!0},output:{not:{}}}},y={...R,pause:{type:"boolean"},handoff:{type:"string"},releaseAssignment:{type:"boolean"},hashAlgorithm:{type:"string",enum:["sha256","sha512"]}},u={...V,pause:{description:"Return work to its configured open status before releasing ownership."},handoff:{description:"Release into a configured non-terminal queue with a required evidence message."},releaseAssignment:{description:"Release assignment after recording closure evidence."},hashAlgorithm:{description:"Digest for detached history bundles; defaults to sha256."}},ne=["json","quiet","profile","noExtensions","noPager","tokenAccounting","path","pmExecutable","timeoutMs"],ie=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor","outputRowContract"],se=new Set(["action","cwd","options",...Object.keys(y).filter(e=>e!=="severity")]);function ke(e){const t=e.trim().toLowerCase();let r="";for(let o=0;o<t.length;o+=1){const a=t[o];if(a!=="-"&&a!=="_"){r+=a;continue}let n=o+1;for(;t[n]==="-"||t[n]==="_";)n+=1;const i=t[n];if(i!==void 0&&(i>="a"&&i<="z"||i>="0"&&i<="9")){r+=i.toUpperCase(),o=n;continue}r+=t.slice(o,n),o=n-1}return se.has(r)?{field:e,property:r,owner:"mcp_tool_input",nested_path:r==="expectHash"?`options.field (${e}=<value>)`:`options.${r}`}:void 0}const le={create:["fullChangedFields","idOnly"],copy:["fullChangedFields","idOnly"],update:["fullChangedFields","idOnly"],"item-reopen":["fullChangedFields","idOnly"],close:["fullChangedFields","idOnly"],claim:["fullChangedFields","idOnly"],release:["fullChangedFields","idOnly"],"start-task":["fullChangedFields","idOnly"],"pause-task":["fullChangedFields","idOnly"],"close-task":["fullChangedFields","idOnly"],restore:["fullChangedFields","idOnly"],append:["fullChangedFields"],"update-many":["fullChangedFields"],"close-many":["fullChangedFields"],assurance:["fullChangedFields","idOnly"]},de=["createMode","status","deadline","estimate","acceptanceCriteria","definitionOfReady","order","rank","goal","objective","value","impact","outcome","whyNow","assignee","reviewer","risk","confidence","sprint","release","blockedReason","unblockNote","reporter","severity","environment","reproSteps","resolution","expectedResult","actualResult","affectedVersion","fixedVersion","component","regression","customerImpact","comment","note","learning","reminder","event","typeOption"],ce=Object.freeze({"close-many":["list","expected_result","expected","actual_result","actual","validate_close","dry_run","checkpoint","no_checkpoint","filterAssignee_filter"],"update-many":["list","update","dry_run","checkpoint","no_checkpoint","filterAssignee_filter"],...Object.fromEntries(h.filter(e=>e==="upgrade"||e==="install"||e==="extension"||e==="package"||e.startsWith("extension-")||e.startsWith("package-")).map(e=>[e,["project","local","global"]]))});function s(e){return U(e)}const pe=s([...K.map(e=>e.param),...E.map(e=>e.param)]),v=s([...Y.map(e=>e.param),...E.map(e=>e.param),"force"]),ue=s([...j.map(e=>e.param),...v.filter(e=>e!=="allowMissingParent"&&e!=="completedAt"),"dryRun","rollback","noCheckpoint"]),me=s([...J.map(e=>e.param),"reason","completedAt","resolution","expectedResult","actualResult","validateClose","dryRun","rollback","noCheckpoint","author","message","force"]),C=s([...G.map(e=>e.param),"past","section"]),fe=s([...H.map(e=>e.param),"stream"]),A=s([...$.map(e=>e.param),"all","includeBody","noTruncate","strictRead","compact","brief","full"]),c=A.filter(e=>e!=="all"&&e!=="status"),d=[[{property:"today",schema:{const:!0}},{property:"recent",schema:{const:!0}}],[{property:"today",schema:{const:!0}},{property:"updatedAfter",schema:{type:"string",pattern:"\\S"}}],[{property:"recent",schema:{const:!0}},{property:"updatedAfter",schema:{type:"string",pattern:"\\S"}}]],ye=[[{property:"summary",schema:{const:!0}},{property:"schemaOnly",schema:{const:!0}}],[{property:"summary",schema:{const:!0}},{property:"flagsOnly",schema:{const:!0}}],[{property:"summary",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}],[{property:"schemaOnly",schema:{const:!0}},{property:"flagsOnly",schema:{const:!0}}],[{property:"schemaOnly",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}],[{property:"flagsOnly",schema:{const:!0}},{property:"availabilityOnly",schema:{const:!0}}]],Oe=s([...B.map(e=>e.param),"count","completion","includeUnparented"]),he=s(["query","keywords","mode","semantic","hybrid","includeLinked","titleExact","phraseExact","highlight","compact","full",...z.map(e=>e.param)]),P=s(["type","tag","priority","assignee","assigneeFilter","sprint","release","parent","limit","blockedLimit","readyOnly","format","includeDecisions","includeGates","includeContainers","tokenBudget","explainRanking"]),l=["author","message","force"],Ae=["releaseAssignment","text","reason","closeReason","completedAt","duplicateOf","validateClose","resolution","expectedResult","actualResult"],m=["author","assignee","message","force"],Te=["dryRun","target","scope","capability","declarative","github","ref","init","install","uninstall","explore","manage","offline","describe","markdown","output","reload","doctor","catalog","list","adopt","adoptAll","activate","deactivate","runtimeProbe","fixManagedState","isolated","ignoreGlobal","detail","trace","watch","strictExit","failOnWarn","fields"];function b(e){return{[`${e}-init`]:{required:["target"],optional:["scope","capability",...e==="package"?["declarative"]:[]]},[`${e}-install`]:{optional:["target","github","scope","ref","dryRun"],anyOfRequired:[["target"],["github"]]},[`${e}-uninstall`]:{required:["target"],optional:["scope"]},[`${e}-explore`]:{optional:["scope","fields"]},[`${e}-manage`]:{optional:["scope","runtimeProbe","fixManagedState","offline","fields"]},[`${e}-describe`]:{optional:["target","scope","markdown","output"]},[`${e}-reload`]:{optional:["scope","watch"]},[`${e}-doctor`]:{optional:["scope","detail","trace","fixManagedState","isolated","ignoreGlobal","strictExit","failOnWarn"]},[`${e}-catalog`]:{optional:["scope","fields"]},[`${e}-adopt`]:{required:["target"],optional:["scope","github","ref"]},[`${e}-adopt-all`]:{optional:["scope"]},[`${e}-activate`]:{required:["target"],optional:["scope"]},[`${e}-deactivate`]:{required:["target"],optional:["scope"]},[e]:{optional:Te,dependentAnyOfRequired:[{property:"dryRun",value:!0,anyOfRequired:[["install","target"],["install","github"]]}],mutuallyExclusiveWhen:[[{property:"dryRun",schema:{const:!0}},{property:"install",schema:{const:!1}}]]}}}const S={required:["title"],optional:["start","duration","end","location","timezone","allDay","parent","inheritFocus","allowMissingParent","tags","priority","body","description","author","message"]},q={optional:["target","scope","dryRun","cliOnly","packagesOnly","repair","tag","packageName"]},f={init:{optional:["prefix","idPrefix","workspace","preset","typePreset","defaults","author","agentGuidance","withPackages","mergeFence","force","verbose"]},config:{required:["scope","configAction"],optional:["key","value","criterion","clearCriteria","format","policy"]},...b("extension"),...b("package"),"package-upgrade":q,install:{optional:["target","github","scope","ref","dryRun"],anyOfRequired:[["target"],["github"]]},upgrade:q,create:{required:["title","description","type","status","priority","message"],optional:pe},copy:{required:["id"],optional:["title","author","message","allowDuplicate"]},focus:{optional:["id","clear"],mutuallyExclusive:[["id","clear"]]},list:{optional:A,mutuallyExclusiveWhen:d},"list-all":{optional:A,mutuallyExclusiveWhen:d},"list-draft":{optional:c,mutuallyExclusiveWhen:d},"list-open":{optional:c,mutuallyExclusiveWhen:d},"list-in-progress":{optional:c,mutuallyExclusiveWhen:d},"list-blocked":{optional:c,mutuallyExclusiveWhen:d},"list-closed":{optional:c,mutuallyExclusiveWhen:d},"list-canceled":{optional:c,mutuallyExclusiveWhen:d},aggregate:{optional:Oe},guide:{optional:["list","format","depth"]},context:{optional:C},ctx:{optional:C},get:{required:["id"],optional:["for","tokenBudget","at","depth","full","fields","tree","treeDepth","format"]},search:{optional:he,anyOfRequired:[["query"],["keywords"]]},eval:{optional:["mode","k","failUnder","queries","format"]},events:{optional:["verify","since","type","author","item","limit","full","provenance","provenanceSummary","harness","agentInstance","provenanceFilter","cursorMode"]},merge:{required:["subcommand"],optional:["dryRun","preCommitHook","stage","author","message","force","includeReconciled","artifact","basePath","oursPath","theirsPath","output","outputPath","itemPath","prefer"]},workspace:{required:["subcommand"],optional:["snapshotAction","name","target","dryRun","force","author","message","lockTtlSeconds","lockWaitMs"],conditionalRequired:[{property:"subcommand",value:"snapshot",required:["snapshotAction"]}]},meet:S,event:S,remind:{required:["title"],optional:["at","text","parent","inheritFocus","allowMissingParent","tags","priority","body","description","author","message"]},next:{optional:[...P,"for"]},reindex:{optional:["mode","progress"]},history:{required:["id"],optional:["limit","order","compact","full","provenance","provenanceSummary","harness","agentInstance","provenanceFilter","diff","verify","field","strictExit","failOnWarn","format"]},"history-attest":{optional:["verify","output","hashAlgorithm"],mutuallyExclusive:[["verify","hashAlgorithm"]]},"history-redact":{required:["id"],optional:["literal","regex","replacement","dryRun",...l],anyOfRequired:[["literal"],["regex"]]},"history-repair":{optional:["id","all","dryRun","normalizeProvenance","salvageTail","appendOnly",...l],oneOfRequired:[["id"],["all"]],mutuallyExclusiveWhen:[[{property:"appendOnly",schema:{const:!0}},{property:"salvageTail",schema:{const:!0}}],[{property:"appendOnly",schema:{const:!0}},{property:"normalizeProvenance",schema:{const:!0}}],[{property:"salvageTail",schema:{const:!0}},{property:"all",schema:{const:!0}}],[{property:"salvageTail",schema:{const:!0}},{property:"normalizeProvenance",schema:{const:!0}}]]},"history-author-acknowledge":{optional:["historyEvent","allActionable","dryRun","planFingerprint","limit","attributedAuthor","reviewer","reason"],oneOfRequired:[["historyEvent"],["allActionable"]]},"history-compact":{optional:["id","before","ids","allOver","closed","allStreams","minEntries","dryRun",...l]},schema:{mutuallyExclusiveWhen:[[{property:"subcommand",schema:{const:"policy-mode"}},{property:"name",schema:{not:{enum:["advise","refuse"]}}}]],required:["subcommand"],optional:["definition","policy","message","name","description","defaultStatus","folder","alias","role","order","fieldType","commands","cliFlag","required","requiredOnCreate","allowUnset","requiredTypes","typePreset","infer","minCount","apply","to","migrationId","fieldTypeScope","dryRun","author","force"],conditionalRequired:[{property:"subcommand",value:"policy-put",required:["definition"]},{property:"subcommand",value:"policy-remove",required:["name"]},{property:"subcommand",value:"policy-mode",required:["name"]},{property:"subcommand",value:"policy-check",required:["name"]},{property:"subcommand",value:"policy-approve",required:["name","policy"]},{property:"subcommand",value:"show",required:["name"]},{property:"subcommand",value:"show-status",required:["name"]},{property:"subcommand",value:"add-type",required:["name"]},{property:"subcommand",value:"remove-type",required:["name"]},{property:"subcommand",value:"add-status",required:["name"]},{property:"subcommand",value:"remove-status",required:["name"]},{property:"subcommand",value:"add-field",required:["name"]},{property:"subcommand",value:"remove-field",required:["name"]},{property:"subcommand",value:"show-field",required:["name"]},{property:"subcommand",value:"rename-type",required:["name","to"]},{property:"subcommand",value:"rename-field",required:["name","to"]},{property:"subcommand",value:"remap-status",required:["name","to"]},{property:"subcommand",value:"apply-preset",required:["typePreset"]}]},profile:{required:["subcommand"],optional:["name","dryRun","author","force"],conditionalRequired:[{property:"subcommand",value:"show",required:["name"]},{property:"subcommand",value:"apply",required:["name"]},{property:"subcommand",value:"lint",required:["name"]}]},plan:{required:["subcommand"],optional:["id","stepRef","reorderTo","title","description","template","scope","parent","inheritFocus","related","blocks","blockedBy","harness","mode","resumeContext","tags","priority",...de,"body","claim","fromSearch","stepTitle","step","stepBody","stepOwner","stepStatus","stepEvidence","stepBlockedReason","stepReplacement","dependsOn","link","linkKind","linkNote","promoteToItemDep","allowMultipleActive","file","test","doc","decisionText","decision","decisionRationale","decisionEvidence","discoveryText","discovery","validationText","validation","validationCommand","validationExpected","depth","fields","steps","materializeType","materializeParent","materializeTags","field",...l]},activity:{optional:fe},restore:{required:["id","target"],optional:l},update:{required:["id"],optional:v,mutuallyExclusive:[["acceptanceCriteria","addAc"],["acceptanceCriteria","removeAc"]]},"update-many":{optional:ue,mutuallyExclusive:[["acceptanceCriteria","addAc"],["acceptanceCriteria","removeAc"]]},close:{required:["id"],optional:[...Ae,...l]},"close-many":{optional:me},delete:{required:["id"],optional:["dryRun",...l]},append:{required:["id","body"],optional:l},comments:{required:["id"],optional:["text","add","stdin","edit","delete","limit","full","ifAbsent","expectAt",...l],mutuallyExclusive:[["edit","ifAbsent"],["delete","ifAbsent"],["expectAt","ifAbsent"]]},notes:{required:["id"],optional:["text","add","addJson","stdin","edit","delete","limit","since","eventType","includeMeta","full","ifAbsent","expectAt",...l],mutuallyExclusive:[["addJson","add"],["addJson","stdin"],["addJson","file"],["addJson","edit"],["addJson","delete"],["edit","ifAbsent"],["delete","ifAbsent"],["expectAt","ifAbsent"]]},learnings:{required:["id"],optional:["text","add","stdin","edit","delete","limit","full","ifAbsent","expectAt",...l],mutuallyExclusive:[["edit","ifAbsent"],["delete","ifAbsent"],["expectAt","ifAbsent"]]},files:{required:[],optional:["id","add","addGlob","remove","migrate","list","addNote","noteConflict","discover","apply","discoveryNote","appendStable","validatePaths","full","lookupPath","scope","limit","offset","noTruncate","strictRead","explain","lines","decisionDepth",...l],anyOfRequired:[["id"],["lookupPath"]],dependentAnyOfRequired:[{property:"addNote",anyOfRequired:[["add"],["addGlob"]]},{property:"noteConflict",anyOfRequired:[["add"],["addGlob"]]}]},docs:{required:["id"],optional:["add","addGlob","remove","migrate","addNote","noteConflict","list","validatePaths","full",...l],dependentAnyOfRequired:[{property:"addNote",anyOfRequired:[["add"],["addGlob"]]},{property:"noteConflict",anyOfRequired:[["add"],["addGlob"]]}]},deps:{required:["id"],optional:["format","maxDepth","collapse","summary","full","nodeLimit","edgeLimit","tokenBudget","cursor","direction","kind"]},graph:{required:["subcommand"],optional:["id","target","kind","maxDepth","limit","after","direction","maxPaths","sample","exemptIsolate","exemptIsolateType","saveBaseline","rebuild","clear","summary","full"]},test:{required:["id"],optional:["list","add","addJson","remove","removeIndex","update","updateIndex","setJson","run","match","onlyIndex","onlyLast","full","background","timeout","progress","envSet","envClear","sharedHostSafe","pmContext","overrideLinkedPmContext","workspaceContext","overrideLinkedWorkspaceContext","allowUntrustedLinkedTests","acknowledgeLinkedTests","failOnContextMismatch","failOnSkipped","failOnEmptyTestRun","requireAssertionsForPm","checkContext","fullOutput","autoPmContext","measure","metricBelow","metricDiff",...l],dependentAnyOfRequired:[{property:"update",anyOfRequired:[["setJson"]]},{property:"updateIndex",anyOfRequired:[["setJson"]]},{property:"setJson",anyOfRequired:[["update"],["updateIndex"]]}],mutuallyExclusive:[["update","updateIndex"],["acknowledgeLinkedTests","run"],["acknowledgeLinkedTests","background"]]},"test-all":{optional:["status","limit","offset","background","timeout","progress","envSet","envClear","sharedHostSafe","pmContext","overrideLinkedPmContext","workspaceContext","overrideLinkedWorkspaceContext","allowUntrustedLinkedTests","failOnContextMismatch","failOnSkipped","failOnEmptyTestRun","requireAssertionsForPm","checkContext","fullOutput","autoPmContext"]},telemetry:{optional:["subcommand","limit"]},"test-runs-list":{optional:["status","limit"]},"test-runs-status":{required:["runId"]},"test-runs-logs":{required:["runId"],optional:["stream","tail"]},"test-runs-stop":{required:["runId"],optional:["force"]},"test-runs-resume":{required:["runId"],optional:["author"]},stats:{optional:["includeEmpty","storage","metadataCoverage","fieldUtilization","byAssignee","byTag","byPriority","tagPrefix","measurements","metric","measurementLimit","observe","improvementDirection","measurementSource","measurementItem","measurementRevision","author","message","provenanceCoverage","fleetAttribution","since","eventLimit","minimumSample"]},duplicates:{optional:["status","since","threshold","limit","exhaustive"]},health:{optional:["strictDirectories","requireMergeDrivers","strictExit","failOnWarn","checkOnly","checkTelemetry","noRefresh","refreshVectors","verboseStaleItems","verboseAuthorEvents","brief","summary","skipVectors","skipIntegrity","skipDrift","full"]},validate:{optional:["checkCompleteness","checkStorageIntegrity","checkMetadata","metadataProfile","checkResolution","checkLifecycle","checkStaleBlockers","dependencyCycleSeverity","parentCycleSeverity","checkFiles","scanMode","includePmInternals","verboseFileLists","verboseDiagnostics","allAffectedIds","strictExit","failOnWarn","fixHints","autoFix","dryRun","fixScope","pruneMissing","checkHistoryDrift","checkCommandReferences","counts","full"]},assurance:{required:["subcommand"],optional:["kind","id","definition","trigger","treeId","gate","limit","dryRun","author","message","preset","owner","apply","enforcement"],conditionalRequired:[{property:"subcommand",value:"list",required:["kind"]},{property:"subcommand",value:"show",required:["kind","id"]},{property:"subcommand",value:"put",required:["kind","id","definition"]},{property:"subcommand",value:"remove",required:["kind","id"]},{property:"subcommand",value:"run",required:["id","trigger"]},{property:"subcommand",value:"apply",required:["preset","owner"]},{property:"subcommand",value:"derive",required:["owner"]},{property:"subcommand",value:"risk",required:["definition"]},{property:"subcommand",value:"lineages",required:["definition"]},{property:"subcommand",value:"promote",required:["id","enforcement"]}],mutuallyExclusiveWhen:[[{property:"subcommand",schema:{const:"risk"}},{property:"definition",schema:{not:{required:["policy","change"]}}}],[{property:"subcommand",schema:{const:"lineages"}},{property:"definition",schema:{anyOf:[{required:["change"]},{not:{required:["policy"]}}]}}]]},gc:{optional:["dryRun","gcScope"]},contracts:{optional:["contractAction","command","summary","schemaOnly","flagsOnly","availabilityOnly","runtimeOnly","activeOnly","full"],mutuallyExclusiveWhen:ye},completion:{required:["shell"],optional:["eagerTags"]},claim:{optional:["start","id","next","ifAvailable","takeoverStale","maxAttempts","includeDecisions",...P,...m],oneOfRequired:[["id"],["next"]],mutuallyExclusiveWhen:[[{property:"start",schema:{const:!0}},{property:"ifAvailable",schema:{const:!0}},{property:"id",schema:{type:"string"}}],[{property:"takeoverStale",schema:{const:!0}},{property:"force",schema:{const:!0}}],[{property:"takeoverStale",schema:{const:!0}},{property:"next",schema:{const:!0}}]]},release:{required:["id"],optional:["pause","handoff",...m],dependentAnyOfRequired:[{property:"handoff",anyOfRequired:[["message"]]}],mutuallyExclusiveWhen:[[{property:"pause",schema:{const:!0}},{property:"handoff",schema:{type:"string"}}]]},"start-task":{required:["id"],optional:[...m,"takeoverStale"],mutuallyExclusiveWhen:[[{property:"takeoverStale",schema:{const:!0}},{property:"force",schema:{const:!0}}]]},"pause-task":{required:["id"],optional:m},"close-task":{required:["id"],optional:["text","validateClose",...m]},"item-reopen":{required:["id","reason"],optional:["status","expectedResult","author","message","force"]}},Le=Object.freeze(Object.fromEntries(h.map(e=>[e,f[e]])));function x(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").trim().replace(/^./,t=>t.toUpperCase()).concat(".")}function M(e,t){const r=typeof t=="object"&&t!==null?{...t}:{},o=u[e];return{...r,description:o?.description??x(e),...o?.examples?{examples:o.examples}:{}}}function Ee(e,t){if(e==="history-attest"&&t==="verify")return{description:"Compare all retained history streams with a detached JSON proof object. Server-local proof paths are not accepted over MCP."};if(e==="history-attest"&&t==="output")return{description:"Local CLI/SDK only. MCP rejects this field; save the returned JSON bundle on the client."};if(e==="claim"&&t==="start")return{description:"Move the claimed item to its configured in-progress status; with next, the selected item is claimed and started in one locked write."};if((e==="list"||e.startsWith("list-"))&&t==="all")return{description:"Return items from every lifecycle status instead of the default active-status set."};if(e==="plan"&&Object.prototype.hasOwnProperty.call(g,t))return g[t];const r=Z[e];return r&&Object.prototype.hasOwnProperty.call(r,t)?r[t]:u[t]}function I(e,t,r){const o=typeof r=="object"&&r!==null?{...r}:{},a=Ee(e,t);return{...o,description:a?.description??x(t),...a?.examples?{examples:a.examples}:{}}}function Re(e,t){if(e==="claim"&&t==="start")return{type:"boolean"};const r=ae[e];return r&&Object.prototype.hasOwnProperty.call(r,t)?r[t]:e==="plan"&&Object.prototype.hasOwnProperty.call(_,t)?_[t]:(e==="get"||e==="history"||e==="search")&&t==="format"?{type:"string",enum:["json","toon"]}:t==="pause"||t==="handoff"||t==="releaseAssignment"||t==="hashAlgorithm"?y[t]:R[t]}function _e(e,t){const r={action:{const:e,description:u.action?.description??"Tool action to execute."}};for(const o of t){if(o==="action")continue;const a=Re(e,o);a&&(r[o]=I(e,o,a))}return r}function ge(e,t){const r=t.flat();return t.map(o=>{const a=r.filter(n=>!o.includes(n));return{required:[...o],...a.length>0?{not:{anyOf:a.map(n=>({required:[n]}))}}:{},...e==="history-repair"&&o.includes("all")?{properties:{all:{const:!0}}}:e==="claim"&&o.includes("next")?{properties:{next:{const:!0}}}:{}}})}function N(e,t){return{...t===void 0?{}:{properties:{[e]:{const:t}}},required:[e]}}function ve(e){const t=[];if(e.conditionalRequired&&e.conditionalRequired.length>0)for(const r of e.conditionalRequired)t.push({if:N(r.property,r.value),then:{required:r.required}});if(e.dependentAnyOfRequired&&e.dependentAnyOfRequired.length>0)for(const r of e.dependentAnyOfRequired)t.push({if:N(r.property,r.value),then:{anyOf:r.anyOfRequired.map(o=>({required:[...o]}))}});if(e.mutuallyExclusive&&e.mutuallyExclusive.length>0)for(const r of e.mutuallyExclusive)t.push({not:{required:s(r)}});if(e.mutuallyExclusiveWhen&&e.mutuallyExclusiveWhen.length>0)for(const r of e.mutuallyExclusiveWhen)t.push({not:{allOf:r.map(o=>({properties:{[o.property]:o.schema},required:[o.property]}))}});return t}function k(e){if(!Object.prototype.hasOwnProperty.call(f,e))return;const t=f[e],r=le[e]??[];return s(["action",...ne,...te(e)!==void 0?ie:[],...r,...W.has(e)?["expectHash"]:[],...t.required??[],...t.optional??[]])}function we(e){const t=k(e);if(t===void 0)return;const r=e==="create"?re:e==="update"?oe:[];return s([...t,...r.flatMap(({keys:o,target:a})=>[a,...o]),...ce[e]??[]])}function T(e){const t=f[e],r=s(t.required??[]),o=k(e),a={type:"object",additionalProperties:!1,required:["action",...r],title:`pm action "${e}" parameters`,properties:_e(e,o)};t.anyOfRequired&&t.anyOfRequired.length>0&&(a.anyOf=t.anyOfRequired.map(i=>({required:[...i]}))),t.oneOfRequired&&t.oneOfRequired.length>0&&(a.oneOf=ge(e,t.oneOfRequired));const n=ve(t);return n.length>0&&(a.allOf=n),a}function De(e,t={}){const r=T(e),o={...r.properties};delete o.action;const a=[...r.anyOf??[],...r.oneOf??[]],n=(t.required??r.required.map(String)).filter(p=>p==="action"?!1:t.required===void 0?!0:!a.some(O=>O.required?.map(String).includes(p))),i={type:"object",additionalProperties:t.additionalProperties??!0,properties:{...o,options:{type:"object",additionalProperties:!0,description:"Advanced command options forwarded to the selected pm action."},...t.properties},required:n};return r.anyOf!==void 0&&(i.anyOf=r.anyOf),r.oneOf!==void 0&&(i.oneOf=r.oneOf),r.allOf!==void 0&&(i.allOf=r.allOf),i}function L(e){let t;const r=()=>t??=e();return new Proxy({},{get:(o,a)=>r()[a],has:(o,a)=>a in r(),ownKeys:()=>Reflect.ownKeys(r()),getOwnPropertyDescriptor:(o,a)=>{const n=Reflect.getOwnPropertyDescriptor(r(),a);return n&&(n.configurable=!0),n}})}const w="4.28.1",Ce=w.split(".")[0],Pe="1.12.0",Fe=L(()=>({$schema:"https://json-schema.org/draft/2020-12/schema",$id:`https://schema.unbrained.dev/pm-cli/tool-parameters-v${Ce}.schema.json`,title:"pm-cli tool parameters (action-scoped strict schema)","x-schema-version":w,type:"object",oneOf:h.map(e=>T(e))}));function D(e,t){const r=M(e,t);if(typeof r.type=="string")return r;const a=(Array.isArray(r.anyOf)?r.anyOf:[]).find(p=>typeof p.type=="string");if(a){const{anyOf:p,...O}=r;return{...a,...O}}const{anyOf:n,...i}=r;return{...i,type:"string"}}function F(){const e={action:{type:"string",description:u.action?.description??"Tool action to execute."},options:{type:"object",additionalProperties:!0,description:"Advanced command options object forwarded to the selected pm action."}};for(const t of Object.keys(y).sort())e[t]=D(t,y[t]);return{title:"pm-cli tool parameters (provider-compatible flat schema)","x-schema-version":Pe,type:"object",additionalProperties:!1,required:["action"],properties:e}}const Ue=L(F),We={buildActionScopedToolSchema:T,buildProviderCompatibleToolSchema:F,decorateActionScopedToolParameterDefinition:I,decorateToolParameterDefinition:M,toolActionSchemaContracts:f,toolParameterMetadata:u,toProviderCompatibleParameterDefinition:D,toUniqueFlagContracts:Q,withFlagAliasMetadata:ee};export{Ae as CLOSE_ACTION_OPTION_KEYS,de as PLAN_CREATE_METADATA_PARAMETER_KEYS,Ue as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Pe as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,Le as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Fe as PM_TOOL_PARAMETERS_SCHEMA,Ce as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,w as PM_TOOL_PARAMETERS_SCHEMA_VERSION,se as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,We as _testOnlyCliContracts,De as buildPmActionToolInputSchema,we as pmToolActionNestedOptionKeys,k as pmToolActionParameterKeys,ke as resolvePmToolCustomFieldCollision};
2
2
  //# sourceMappingURL=tool-schema.js.map
@@ -10,4 +10,4 @@
10
10
  * property/metadata tables stay internal to tool-schema and are not surfaced
11
11
  * here.)
12
12
  */
13
- export type{CommanderOptionAliasContract,CommanderOptionRegistrationContract,}from "./cli-contracts/commander-types.js";export{EXECUTABLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,PM_HISTORY_COMMAND_ALIASES,PM_CONTEXT_OPS_COMMAND_ALIASES,PM_BULK_LIFECYCLE_COMMAND_ALIASES,PM_RELOCATED_COMMAND_ALIASES,PM_NAMESPACED_COMMAND_ALIASES,findPmNamespacedCommand,resolvePmCommandOperation,resolvePmHistoryOperation,renderPmCommandAliasMigrationHint,resolvePmCommandAlias,type PmCommandAliasContract,type PmCommandAliasLifecycle,type PmCommandAliasRegistration,}from "./cli-contracts/command-aliases.js";export{ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,LIST_COMMANDER_STRING_OPTION_CONTRACTS,NEXT_COMMANDER_STRING_OPTION_CONTRACTS,SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,readFirstValueFromCommanderOptions,readFirstStringFromCommanderOptions,readStringArrayFromCommanderOptions,}from "./cli-contracts/commander-types.js";export{CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,CREATE_COMMANDER_STRING_OPTION_CONTRACTS,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,}from "./cli-contracts/commander-mutation-options.js";export{MERGE_SUBCOMMAND_VALUES,PM_EXTENSION_CAPABILITY_CONTRACTS,PM_EXTENSION_SERVICE_NAME_CONTRACTS,PM_EXTENSION_POLICY_MODE_CONTRACTS,PM_EXTENSION_TRUST_MODE_CONTRACTS,PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,PM_EXTENSION_POLICY_SURFACE_CONTRACTS,PM_CORE_COMMAND_NAMES,PM_CLI_ONLY_TOOL_ACTION_WAIVERS,PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,PM_ITEM_ACTION_SUBCOMMANDS,PM_DEPRECATED_TOOL_ACTIONS,PM_DISCOVERABLE_TOOL_ACTIONS,PM_TOOL_ACTIONS,analyzePmToolActionParity,isPmToolAction,isPmExtensionCapabilityContract,isPmExtensionServiceNameContract,isPmExtensionPolicyModeContract,isPmExtensionPolicySurfaceContract,}from "./cli-contracts/enum-contracts.js";export type{MergeSubcommand,PmExtensionCapabilityContract,PmExtensionServiceNameContract,PmExtensionPolicyModeContract,PmExtensionTrustModeContract,PmExtensionSandboxProfileContract,PmExtensionPolicySurfaceContract,PmToolAction,}from "./cli-contracts/enum-contracts.js";export{TOOL_LIST_FILTER_OPTION_CONTRACTS,TOOL_AGGREGATE_OPTION_CONTRACTS,TOOL_SEARCH_FILTER_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CALENDAR_OPTION_CONTRACTS,TOOL_ACTIVITY_OPTION_CONTRACTS,TOOL_CONTEXT_OPTION_CONTRACTS,TOOL_DEPS_OPTION_CONTRACTS,TOOL_GRAPH_OPTION_CONTRACTS,TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,TOOL_CREATE_OPTION_CONTRACT_SOURCE,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,TOOL_UPDATE_OPTION_CONTRACT_SOURCE,verifyToolOptionCliParity,type ToolOptionCliParityFinding,type ToolOptionCliParityReport,}from "./cli-contracts/tool-option-contracts.js";export type{OptionsFromContracts,PmBulkMutationControlOptions,PmBulkMutationFilterOptions,PmCloseActionOptions,PmCloseManyActionOptions,PmCreateActionOptions,PmMutationAttributionOptions,PmOptionScalar,PmUpdateActionFields,PmUpdateActionOptions,PmUpdateManyActionOptions,}from "./cli-contracts/typed-action-inputs.js";export type{CliFlagContract,ToolOptionFlagContract,}from "./cli-contracts/flag-contracts.js";export{PM_COMMAND_POSITIONAL_CONTRACTS,PM_POSITIONAL_ACTION_CONTRACTS,type PmCommandPositionalContract,type PmCommandPositionalSlotContract,type PmPositionalActionContract,}from "./cli-contracts/grammar-contracts.js";export{withFlagAliasMetadata,compactFlagAliasContracts,resolvePmPositionalActionFlagContracts,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,GLOBAL_FLAG_CONTRACTS,LIST_FILTER_FLAG_CONTRACTS,AGGREGATE_FLAG_CONTRACTS,COMMENTS_FLAG_CONTRACTS,NOTES_FLAG_CONTRACTS,LEARNINGS_FLAG_CONTRACTS,FILES_FLAG_CONTRACTS,DOCS_FLAG_CONTRACTS,HISTORY_FLAG_CONTRACTS,HISTORY_REDACT_FLAG_CONTRACTS,HISTORY_REPAIR_FLAG_CONTRACTS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,HISTORY_COMPACT_FLAG_CONTRACTS,MERGE_FLAG_CONTRACTS,SCHEMA_FLAG_CONTRACTS,PROFILE_FLAG_CONTRACTS,PLAN_FLAG_CONTRACTS,INIT_FLAG_CONTRACTS,CONFIG_FLAG_CONTRACTS,EXTENSION_FLAG_CONTRACTS,EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_INIT_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS,PACKAGE_FLAG_CONTRACTS,PACKAGE_INIT_FLAG_CONTRACTS,EXTENSION_INSTALL_FLAG_CONTRACTS,EXTENSION_UNINSTALL_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,EXTENSION_ACTIVATE_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS,EXTENSION_MANAGE_FLAG_CONTRACTS,EXTENSION_RELOAD_FLAG_CONTRACTS,EXTENSION_DOCTOR_FLAG_CONTRACTS,EXTENSION_CATALOG_FLAG_CONTRACTS,EXTENSION_ADOPT_FLAG_CONTRACTS,INSTALL_FLAG_CONTRACTS,UPGRADE_FLAG_CONTRACTS,REINDEX_FLAG_CONTRACTS,CLOSE_FLAG_CONTRACTS,CLOSE_MANY_FLAG_CONTRACTS,APPEND_FLAG_CONTRACTS,CLAIM_FLAG_CONTRACTS,RESTORE_FLAG_CONTRACTS,DELETE_FLAG_CONTRACTS,RELEASE_FLAG_CONTRACTS,START_TASK_FLAG_CONTRACTS,PAUSE_TASK_FLAG_CONTRACTS,CLOSE_TASK_FLAG_CONTRACTS,MEET_FLAG_CONTRACTS,EVENT_FLAG_CONTRACTS,EVENTS_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS,TEST_FLAG_CONTRACTS,TEST_ALL_FLAG_CONTRACTS,TELEMETRY_FLAG_CONTRACTS,TEST_RUNS_FLAG_CONTRACTS,GC_FLAG_CONTRACTS,STATS_FLAG_CONTRACTS,DUPLICATES_FLAG_CONTRACTS,HEALTH_FLAG_CONTRACTS,VALIDATE_FLAG_CONTRACTS,ASSURANCE_FLAG_CONTRACTS,CREATE_FLAG_CONTRACTS,ITEM_COMPLETE_FLAG_CONTRACTS,ITEM_REOPEN_FLAG_CONTRACTS,ITEM_MUTATE_FLAG_CONTRACTS,COPY_FLAG_CONTRACTS,FOCUS_FLAG_CONTRACTS,UPDATE_FLAG_CONTRACTS,UPDATE_MANY_FLAG_CONTRACTS,CALENDAR_FLAG_CONTRACTS,ACTIVITY_FLAG_CONTRACTS,CONTEXT_FLAG_CONTRACTS,GET_FLAG_CONTRACTS,GUIDE_FLAG_CONTRACTS,DEPS_FLAG_CONTRACTS,GRAPH_FLAG_CONTRACTS,EVAL_FLAG_CONTRACTS,WORKSPACE_FLAG_CONTRACTS,NEXT_FLAG_CONTRACTS,SEARCH_FLAG_CONTRACTS,CONTRACTS_FLAG_CONTRACTS,COMPLETION_FLAG_CONTRACTS,hasSubcommandFlagContractsForCommand,resolveSubcommandFlagContractsForCommand,toCompletionFlagString,}from "./cli-contracts/flag-contracts.js";export type{PmActionSchemaContract}from "./cli-contracts/tool-schema.js";export{buildPmActionToolInputSchema,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,resolvePmToolCustomFieldCollision,CLOSE_ACTION_OPTION_KEYS,PLAN_CREATE_METADATA_PARAMETER_KEYS,PM_TOOL_ACTION_PARAMETER_CONTRACTS,PM_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_PARAMETERS_SCHEMA_MAJOR,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_PARAMETERS_SCHEMA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,_testOnlyCliContracts,}from "./cli-contracts/tool-schema.js";export type{PmActionToolInputSchemaOptions,PmToolCustomFieldCollision,}from "./cli-contracts/tool-schema.js";export{analyzeSdkCliParameterCompleteness,type SdkCliActionParameterCoverage,type SdkCliCompletenessContractSource,type SdkCliParameterCoverageEntry,type SdkCliParameterDisposition,}from "./cli-contracts/completeness.js";export{PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_DEGRADATION_STEPS,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_OUTPUT_CLASSES,PM_OUTPUT_BUDGET_CLASSES,PM_OUTPUT_DEGRADATION_STEPS,createPmCommandOutputBudget,definePmCommandOutputBudget,estimatePmOutputTokens,inferPmOutputBudgetClass,projectPmDiagnosticOutput,projectPmDiagnosticText,resolvePmDiagnosticOutputBudget,resolvePmCommandOutputBudget,type PmCommandOutputBudgetContract,type PmDiagnosticDegradationStep,type PmDiagnosticOutputBudgetContract,type PmDiagnosticOutputClass,type PmDiagnosticOutputReceipt,type PmOutputBudgetClass,type PmOutputDegradationStep,type PmProjectedDiagnostic,type PmProjectedTextDiagnostic,PM_GENERIC_REFUSAL_GUIDANCE,PM_RECOVERY_ECHO_FIELDS,isGenericRefusalRequired,isGenericRefusalWhy,projectLeanRecoveryPayload,withoutGenericRefusalExamples,}from "./cli-contracts/agent-output-contracts.js";
13
+ export type{CommanderOptionAliasContract,CommanderOptionRegistrationContract,}from "./cli-contracts/commander-types.js";export{EXECUTABLE_COMMAND_ALIASES,PM_COMMAND_ALIAS_CONTRACTS,PM_HISTORY_COMMAND_ALIASES,PM_CONTEXT_OPS_COMMAND_ALIASES,PM_BULK_LIFECYCLE_COMMAND_ALIASES,PM_RELOCATED_COMMAND_ALIASES,PM_NAMESPACED_COMMAND_ALIASES,findPmNamespacedCommand,resolvePmCommandOperation,resolvePmHistoryOperation,renderPmCommandAliasMigrationHint,resolvePmCommandAlias,type PmCommandAliasContract,type PmCommandAliasLifecycle,type PmCommandAliasRegistration,}from "./cli-contracts/command-aliases.js";export{ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,LIST_COMMANDER_STRING_OPTION_CONTRACTS,NEXT_COMMANDER_STRING_OPTION_CONTRACTS,SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,readFirstValueFromCommanderOptions,readFirstStringFromCommanderOptions,readStringArrayFromCommanderOptions,}from "./cli-contracts/commander-types.js";export{CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,CREATE_COMMANDER_STRING_OPTION_CONTRACTS,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,}from "./cli-contracts/commander-mutation-options.js";export{MERGE_SUBCOMMAND_VALUES,PM_EXTENSION_CAPABILITY_CONTRACTS,PM_EXTENSION_SERVICE_NAME_CONTRACTS,PM_EXTENSION_POLICY_MODE_CONTRACTS,PM_EXTENSION_TRUST_MODE_CONTRACTS,PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,PM_EXTENSION_POLICY_SURFACE_CONTRACTS,PM_CORE_COMMAND_NAMES,PM_CLI_ONLY_TOOL_ACTION_WAIVERS,PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,PM_ITEM_ACTION_SUBCOMMANDS,PM_DEPRECATED_TOOL_ACTIONS,PM_DISCOVERABLE_TOOL_ACTIONS,PM_TOOL_ACTIONS,analyzePmToolActionParity,isPmToolAction,isPmExtensionCapabilityContract,isPmExtensionServiceNameContract,isPmExtensionPolicyModeContract,isPmExtensionPolicySurfaceContract,}from "./cli-contracts/enum-contracts.js";export type{MergeSubcommand,PmExtensionCapabilityContract,PmExtensionServiceNameContract,PmExtensionPolicyModeContract,PmExtensionTrustModeContract,PmExtensionSandboxProfileContract,PmExtensionPolicySurfaceContract,PmToolAction,}from "./cli-contracts/enum-contracts.js";export{TOOL_LIST_FILTER_OPTION_CONTRACTS,TOOL_AGGREGATE_OPTION_CONTRACTS,TOOL_SEARCH_FILTER_OPTION_CONTRACTS,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,TOOL_CREATE_OPTION_CONTRACTS,TOOL_UPDATE_OPTION_CONTRACTS,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,TOOL_CALENDAR_OPTION_CONTRACTS,TOOL_ACTIVITY_OPTION_CONTRACTS,TOOL_CONTEXT_OPTION_CONTRACTS,TOOL_DEPS_OPTION_CONTRACTS,TOOL_GRAPH_OPTION_CONTRACTS,TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,TOOL_CREATE_OPTION_CONTRACT_SOURCE,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,TOOL_UPDATE_OPTION_CONTRACT_SOURCE,verifyToolOptionCliParity,type ToolOptionCliParityFinding,type ToolOptionCliParityReport,}from "./cli-contracts/tool-option-contracts.js";export type{OptionsFromContracts,PmBulkMutationControlOptions,PmBulkMutationFilterOptions,PmCloseActionOptions,PmCloseManyActionOptions,PmCreateActionOptions,PmMutationAttributionOptions,PmOptionScalar,PmUpdateActionFields,PmUpdateActionOptions,PmUpdateManyActionOptions,}from "./cli-contracts/typed-action-inputs.js";export type{CliFlagContract,ToolOptionFlagContract,}from "./cli-contracts/flag-contracts.js";export{PM_COMMAND_POSITIONAL_CONTRACTS,PM_POSITIONAL_ACTION_CONTRACTS,type PmCommandPositionalContract,type PmCommandPositionalSlotContract,type PmPositionalActionContract,}from "./cli-contracts/grammar-contracts.js";export{withFlagAliasMetadata,compactFlagAliasContracts,resolvePmPositionalActionFlagContracts,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,GLOBAL_FLAG_CONTRACTS,LIST_FILTER_FLAG_CONTRACTS,AGGREGATE_FLAG_CONTRACTS,COMMENTS_FLAG_CONTRACTS,NOTES_FLAG_CONTRACTS,LEARNINGS_FLAG_CONTRACTS,FILES_FLAG_CONTRACTS,DOCS_FLAG_CONTRACTS,HISTORY_FLAG_CONTRACTS,HISTORY_REDACT_FLAG_CONTRACTS,HISTORY_REPAIR_FLAG_CONTRACTS,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,HISTORY_COMPACT_FLAG_CONTRACTS,MERGE_FLAG_CONTRACTS,SCHEMA_FLAG_CONTRACTS,PROFILE_FLAG_CONTRACTS,PLAN_FLAG_CONTRACTS,INIT_FLAG_CONTRACTS,CONFIG_FLAG_CONTRACTS,EXTENSION_FLAG_CONTRACTS,EXTENSION_SCOPE_FLAG_CONTRACTS,EXTENSION_INIT_FLAG_CONTRACTS,EXTENSION_MIGRATE_FLAG_CONTRACTS,PACKAGE_FLAG_CONTRACTS,PACKAGE_INIT_FLAG_CONTRACTS,EXTENSION_INSTALL_FLAG_CONTRACTS,EXTENSION_UNINSTALL_FLAG_CONTRACTS,EXTENSION_EXPLORE_FLAG_CONTRACTS,EXTENSION_INVENTORY_FLAG_CONTRACTS,EXTENSION_DESCRIBE_FLAG_CONTRACTS,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,EXTENSION_ACTIVATE_FLAG_CONTRACTS,EXTENSION_DEACTIVATE_FLAG_CONTRACTS,EXTENSION_MANAGE_FLAG_CONTRACTS,EXTENSION_RELOAD_FLAG_CONTRACTS,EXTENSION_DOCTOR_FLAG_CONTRACTS,EXTENSION_CATALOG_FLAG_CONTRACTS,EXTENSION_ADOPT_FLAG_CONTRACTS,INSTALL_FLAG_CONTRACTS,UPGRADE_FLAG_CONTRACTS,REINDEX_FLAG_CONTRACTS,CLOSE_FLAG_CONTRACTS,CLOSE_MANY_FLAG_CONTRACTS,APPEND_FLAG_CONTRACTS,CLAIM_FLAG_CONTRACTS,RESTORE_FLAG_CONTRACTS,DELETE_FLAG_CONTRACTS,RELEASE_FLAG_CONTRACTS,START_TASK_FLAG_CONTRACTS,PAUSE_TASK_FLAG_CONTRACTS,CLOSE_TASK_FLAG_CONTRACTS,MEET_FLAG_CONTRACTS,EVENT_FLAG_CONTRACTS,EVENTS_FLAG_CONTRACTS,REMIND_FLAG_CONTRACTS,TEST_FLAG_CONTRACTS,TEST_ALL_FLAG_CONTRACTS,TELEMETRY_FLAG_CONTRACTS,TEST_RUNS_FLAG_CONTRACTS,GC_FLAG_CONTRACTS,STATS_FLAG_CONTRACTS,DUPLICATES_FLAG_CONTRACTS,HEALTH_FLAG_CONTRACTS,VALIDATE_FLAG_CONTRACTS,ASSURANCE_FLAG_CONTRACTS,CREATE_FLAG_CONTRACTS,ITEM_COMPLETE_FLAG_CONTRACTS,ITEM_REOPEN_FLAG_CONTRACTS,ITEM_MUTATE_FLAG_CONTRACTS,COPY_FLAG_CONTRACTS,FOCUS_FLAG_CONTRACTS,UPDATE_FLAG_CONTRACTS,UPDATE_MANY_FLAG_CONTRACTS,CALENDAR_FLAG_CONTRACTS,ACTIVITY_FLAG_CONTRACTS,CONTEXT_FLAG_CONTRACTS,GET_FLAG_CONTRACTS,GUIDE_FLAG_CONTRACTS,DEPS_FLAG_CONTRACTS,GRAPH_FLAG_CONTRACTS,EVAL_FLAG_CONTRACTS,WORKSPACE_FLAG_CONTRACTS,NEXT_FLAG_CONTRACTS,SEARCH_FLAG_CONTRACTS,CONTRACTS_FLAG_CONTRACTS,COMPLETION_FLAG_CONTRACTS,hasSubcommandFlagContractsForCommand,resolveSubcommandFlagContractsForCommand,toCompletionFlagString,}from "./cli-contracts/flag-contracts.js";export type{PmActionSchemaContract}from "./cli-contracts/tool-schema.js";export{buildPmActionToolInputSchema,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,resolvePmToolCustomFieldCollision,CLOSE_ACTION_OPTION_KEYS,PLAN_CREATE_METADATA_PARAMETER_KEYS,PM_TOOL_ACTION_PARAMETER_CONTRACTS,PM_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_PARAMETERS_SCHEMA_MAJOR,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,PM_TOOL_PARAMETERS_SCHEMA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,_testOnlyCliContracts,}from "./cli-contracts/tool-schema.js";export type{PmActionToolInputSchemaOptions,PmToolCustomFieldCollision,}from "./cli-contracts/tool-schema.js";export{analyzeSdkCliParameterCompleteness,type SdkCliActionParameterCoverage,type SdkCliCompletenessContractSource,type SdkCliParameterCoverageEntry,type SdkCliParameterDisposition,}from "./cli-contracts/completeness.js";export{PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_DEGRADATION_STEPS,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,PM_DIAGNOSTIC_OUTPUT_CLASSES,PM_OUTPUT_BUDGET_CLASSES,PM_OUTPUT_DEGRADATION_STEPS,createPmCommandOutputBudget,definePmCommandOutputBudget,estimatePmOutputTokens,inferPmOutputBudgetClass,projectPmDiagnosticOutput,projectPmDiagnosticText,resolvePmDiagnosticOutputBudget,resolvePmCommandOutputBudget,type PmCommandOutputBudgetContract,type PmDiagnosticDegradationStep,type PmDiagnosticOutputBudgetContract,type PmDiagnosticOutputClass,type PmDiagnosticOutputReceipt,type PmOutputBudgetClass,type PmOutputDegradationStep,type PmProjectedDiagnostic,type PmProjectedTextDiagnostic,PM_GENERIC_REFUSAL_GUIDANCE,PM_RECOVERY_ECHO_FIELDS,isGenericRefusalRequired,isGenericRefusalWhy,projectLeanRecoveryPayload,withoutGenericRefusalExamples,}from "./cli-contracts/agent-output-contracts.js";
@@ -1,2 +1,2 @@
1
- import{EXECUTABLE_COMMAND_ALIASES as A,PM_COMMAND_ALIAS_CONTRACTS as C,PM_HISTORY_COMMAND_ALIASES as O,PM_CONTEXT_OPS_COMMAND_ALIASES as N,PM_BULK_LIFECYCLE_COMMAND_ALIASES as S,PM_RELOCATED_COMMAND_ALIASES as E,PM_NAMESPACED_COMMAND_ALIASES as R,findPmNamespacedCommand as L,resolvePmCommandOperation as I,resolvePmHistoryOperation as P,renderPmCommandAliasMigrationHint as M,resolvePmCommandAlias as G}from"./cli-contracts/command-aliases.js";import{ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS as o,CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS as t,CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS as e,LIST_COMMANDER_STRING_OPTION_CONTRACTS as D,NEXT_COMMANDER_STRING_OPTION_CONTRACTS as r,SEARCH_COMMANDER_STRING_OPTION_CONTRACTS as a,readFirstValueFromCommanderOptions as m,readFirstStringFromCommanderOptions as i,readStringArrayFromCommanderOptions as n}from"./cli-contracts/commander-types.js";import{CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS as U,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS as l,CREATE_COMMANDER_STRING_OPTION_CONTRACTS as c,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS as d,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS as p,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS as X}from"./cli-contracts/commander-mutation-options.js";import{MERGE_SUBCOMMAND_VALUES as H,PM_EXTENSION_CAPABILITY_CONTRACTS as B,PM_EXTENSION_SERVICE_NAME_CONTRACTS as Y,PM_EXTENSION_POLICY_MODE_CONTRACTS as V,PM_EXTENSION_TRUST_MODE_CONTRACTS as f,PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS as g,PM_EXTENSION_POLICY_SURFACE_CONTRACTS as x,PM_CORE_COMMAND_NAMES as y,PM_CLI_ONLY_TOOL_ACTION_WAIVERS as K,PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS as v,PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS as h,PM_ITEM_ACTION_SUBCOMMANDS as b,PM_DEPRECATED_TOOL_ACTIONS as W,PM_DISCOVERABLE_TOOL_ACTIONS as j,PM_TOOL_ACTIONS as k,analyzePmToolActionParity as w,isPmToolAction as z,isPmExtensionCapabilityContract as q,isPmExtensionServiceNameContract as J,isPmExtensionPolicyModeContract as Q,isPmExtensionPolicySurfaceContract as Z}from"./cli-contracts/enum-contracts.js";import{TOOL_LIST_FILTER_OPTION_CONTRACTS as TT,TOOL_AGGREGATE_OPTION_CONTRACTS as _T,TOOL_SEARCH_FILTER_OPTION_CONTRACTS as AT,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS as CT,TOOL_CREATE_OPTION_CONTRACTS as OT,TOOL_UPDATE_OPTION_CONTRACTS as NT,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS as ST,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS as ET,TOOL_CALENDAR_OPTION_CONTRACTS as RT,TOOL_ACTIVITY_OPTION_CONTRACTS as LT,TOOL_CONTEXT_OPTION_CONTRACTS as IT,TOOL_DEPS_OPTION_CONTRACTS as PT,TOOL_GRAPH_OPTION_CONTRACTS as MT,TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE as GT,TOOL_CREATE_OPTION_CONTRACT_SOURCE as FT,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE as oT,TOOL_UPDATE_OPTION_CONTRACT_SOURCE as tT,verifyToolOptionCliParity as eT}from"./cli-contracts/tool-option-contracts.js";import{PM_COMMAND_POSITIONAL_CONTRACTS as rT,PM_POSITIONAL_ACTION_CONTRACTS as aT}from"./cli-contracts/grammar-contracts.js";import{withFlagAliasMetadata as iT,compactFlagAliasContracts as nT,resolvePmPositionalActionFlagContracts as sT,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS as UT,GLOBAL_FLAG_CONTRACTS as lT,LIST_FILTER_FLAG_CONTRACTS as cT,AGGREGATE_FLAG_CONTRACTS as dT,COMMENTS_FLAG_CONTRACTS as pT,NOTES_FLAG_CONTRACTS as XT,LEARNINGS_FLAG_CONTRACTS as uT,FILES_FLAG_CONTRACTS as HT,DOCS_FLAG_CONTRACTS as BT,HISTORY_FLAG_CONTRACTS as YT,HISTORY_REDACT_FLAG_CONTRACTS as VT,HISTORY_REPAIR_FLAG_CONTRACTS as fT,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS as gT,HISTORY_COMPACT_FLAG_CONTRACTS as xT,MERGE_FLAG_CONTRACTS as yT,SCHEMA_FLAG_CONTRACTS as KT,PROFILE_FLAG_CONTRACTS as vT,PLAN_FLAG_CONTRACTS as hT,INIT_FLAG_CONTRACTS as bT,CONFIG_FLAG_CONTRACTS as WT,EXTENSION_FLAG_CONTRACTS as jT,EXTENSION_SCOPE_FLAG_CONTRACTS as kT,EXTENSION_INIT_FLAG_CONTRACTS as wT,EXTENSION_MIGRATE_FLAG_CONTRACTS as zT,PACKAGE_FLAG_CONTRACTS as qT,PACKAGE_INIT_FLAG_CONTRACTS as JT,EXTENSION_INSTALL_FLAG_CONTRACTS as QT,EXTENSION_UNINSTALL_FLAG_CONTRACTS as ZT,EXTENSION_EXPLORE_FLAG_CONTRACTS as $T,EXTENSION_DESCRIBE_FLAG_CONTRACTS as T_,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS as __,EXTENSION_ACTIVATE_FLAG_CONTRACTS as A_,EXTENSION_DEACTIVATE_FLAG_CONTRACTS as C_,EXTENSION_MANAGE_FLAG_CONTRACTS as O_,EXTENSION_RELOAD_FLAG_CONTRACTS as N_,EXTENSION_DOCTOR_FLAG_CONTRACTS as S_,EXTENSION_CATALOG_FLAG_CONTRACTS as E_,EXTENSION_ADOPT_FLAG_CONTRACTS as R_,INSTALL_FLAG_CONTRACTS as L_,UPGRADE_FLAG_CONTRACTS as I_,REINDEX_FLAG_CONTRACTS as P_,CLOSE_FLAG_CONTRACTS as M_,CLOSE_MANY_FLAG_CONTRACTS as G_,APPEND_FLAG_CONTRACTS as F_,CLAIM_FLAG_CONTRACTS as o_,RESTORE_FLAG_CONTRACTS as t_,DELETE_FLAG_CONTRACTS as e_,RELEASE_FLAG_CONTRACTS as D_,START_TASK_FLAG_CONTRACTS as r_,PAUSE_TASK_FLAG_CONTRACTS as a_,CLOSE_TASK_FLAG_CONTRACTS as m_,MEET_FLAG_CONTRACTS as i_,EVENT_FLAG_CONTRACTS as n_,EVENTS_FLAG_CONTRACTS as s_,REMIND_FLAG_CONTRACTS as U_,TEST_FLAG_CONTRACTS as l_,TEST_ALL_FLAG_CONTRACTS as c_,TELEMETRY_FLAG_CONTRACTS as d_,TEST_RUNS_FLAG_CONTRACTS as p_,GC_FLAG_CONTRACTS as X_,STATS_FLAG_CONTRACTS as u_,DUPLICATES_FLAG_CONTRACTS as H_,HEALTH_FLAG_CONTRACTS as B_,VALIDATE_FLAG_CONTRACTS as Y_,ASSURANCE_FLAG_CONTRACTS as V_,CREATE_FLAG_CONTRACTS as f_,ITEM_COMPLETE_FLAG_CONTRACTS as g_,ITEM_REOPEN_FLAG_CONTRACTS as x_,ITEM_MUTATE_FLAG_CONTRACTS as y_,COPY_FLAG_CONTRACTS as K_,FOCUS_FLAG_CONTRACTS as v_,UPDATE_FLAG_CONTRACTS as h_,UPDATE_MANY_FLAG_CONTRACTS as b_,CALENDAR_FLAG_CONTRACTS as W_,ACTIVITY_FLAG_CONTRACTS as j_,CONTEXT_FLAG_CONTRACTS as k_,GET_FLAG_CONTRACTS as w_,GUIDE_FLAG_CONTRACTS as z_,DEPS_FLAG_CONTRACTS as q_,GRAPH_FLAG_CONTRACTS as J_,EVAL_FLAG_CONTRACTS as Q_,WORKSPACE_FLAG_CONTRACTS as Z_,NEXT_FLAG_CONTRACTS as $_,SEARCH_FLAG_CONTRACTS as TA,CONTRACTS_FLAG_CONTRACTS as _A,COMPLETION_FLAG_CONTRACTS as AA,hasSubcommandFlagContractsForCommand as CA,resolveSubcommandFlagContractsForCommand as OA,toCompletionFlagString as NA}from"./cli-contracts/flag-contracts.js";import{buildPmActionToolInputSchema as EA,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES as RA,resolvePmToolCustomFieldCollision as LA,CLOSE_ACTION_OPTION_KEYS as IA,PLAN_CREATE_METADATA_PARAMETER_KEYS as PA,PM_TOOL_ACTION_PARAMETER_CONTRACTS as MA,PM_TOOL_PARAMETERS_SCHEMA_VERSION as GA,PM_TOOL_PARAMETERS_SCHEMA_MAJOR as FA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION as oA,PM_TOOL_PARAMETERS_SCHEMA as tA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA as eA,_testOnlyCliContracts as DA}from"./cli-contracts/tool-schema.js";import{analyzeSdkCliParameterCompleteness as aA}from"./cli-contracts/completeness.js";import{PM_COMMAND_OUTPUT_BUDGET_CONTRACTS as iA,PM_DIAGNOSTIC_DEGRADATION_STEPS as nA,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS as sA,PM_DIAGNOSTIC_OUTPUT_CLASSES as UA,PM_OUTPUT_BUDGET_CLASSES as lA,PM_OUTPUT_DEGRADATION_STEPS as cA,createPmCommandOutputBudget as dA,definePmCommandOutputBudget as pA,estimatePmOutputTokens as XA,inferPmOutputBudgetClass as uA,projectPmDiagnosticOutput as HA,projectPmDiagnosticText as BA,resolvePmDiagnosticOutputBudget as YA,resolvePmCommandOutputBudget as VA,PM_GENERIC_REFUSAL_GUIDANCE as fA,PM_RECOVERY_ECHO_FIELDS as gA,isGenericRefusalRequired as xA,isGenericRefusalWhy as yA,projectLeanRecoveryPayload as KA,withoutGenericRefusalExamples as vA}from"./cli-contracts/agent-output-contracts.js";export{o as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,j_ as ACTIVITY_FLAG_CONTRACTS,dT as AGGREGATE_FLAG_CONTRACTS,F_ as APPEND_FLAG_CONTRACTS,V_ as ASSURANCE_FLAG_CONTRACTS,t as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,W_ as CALENDAR_FLAG_CONTRACTS,o_ as CLAIM_FLAG_CONTRACTS,IA as CLOSE_ACTION_OPTION_KEYS,M_ as CLOSE_FLAG_CONTRACTS,G_ as CLOSE_MANY_FLAG_CONTRACTS,m_ as CLOSE_TASK_FLAG_CONTRACTS,pT as COMMENTS_FLAG_CONTRACTS,AA as COMPLETION_FLAG_CONTRACTS,WT as CONFIG_FLAG_CONTRACTS,e as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,k_ as CONTEXT_FLAG_CONTRACTS,_A as CONTRACTS_FLAG_CONTRACTS,K_ as COPY_FLAG_CONTRACTS,U as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,l as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,c as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,f_ as CREATE_FLAG_CONTRACTS,e_ as DELETE_FLAG_CONTRACTS,q_ as DEPS_FLAG_CONTRACTS,BT as DOCS_FLAG_CONTRACTS,H_ as DUPLICATES_FLAG_CONTRACTS,Q_ as EVAL_FLAG_CONTRACTS,s_ as EVENTS_FLAG_CONTRACTS,n_ as EVENT_FLAG_CONTRACTS,A as EXECUTABLE_COMMAND_ALIASES,A_ as EXTENSION_ACTIVATE_FLAG_CONTRACTS,__ as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,R_ as EXTENSION_ADOPT_FLAG_CONTRACTS,E_ as EXTENSION_CATALOG_FLAG_CONTRACTS,C_ as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,T_ as EXTENSION_DESCRIBE_FLAG_CONTRACTS,S_ as EXTENSION_DOCTOR_FLAG_CONTRACTS,$T as EXTENSION_EXPLORE_FLAG_CONTRACTS,jT as EXTENSION_FLAG_CONTRACTS,wT as EXTENSION_INIT_FLAG_CONTRACTS,QT as EXTENSION_INSTALL_FLAG_CONTRACTS,O_ as EXTENSION_MANAGE_FLAG_CONTRACTS,zT as EXTENSION_MIGRATE_FLAG_CONTRACTS,N_ as EXTENSION_RELOAD_FLAG_CONTRACTS,kT as EXTENSION_SCOPE_FLAG_CONTRACTS,ZT as EXTENSION_UNINSTALL_FLAG_CONTRACTS,HT as FILES_FLAG_CONTRACTS,v_ as FOCUS_FLAG_CONTRACTS,X_ as GC_FLAG_CONTRACTS,w_ as GET_FLAG_CONTRACTS,lT as GLOBAL_FLAG_CONTRACTS,J_ as GRAPH_FLAG_CONTRACTS,z_ as GUIDE_FLAG_CONTRACTS,B_ as HEALTH_FLAG_CONTRACTS,gT as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,xT as HISTORY_COMPACT_FLAG_CONTRACTS,YT as HISTORY_FLAG_CONTRACTS,VT as HISTORY_REDACT_FLAG_CONTRACTS,fT as HISTORY_REPAIR_FLAG_CONTRACTS,bT as INIT_FLAG_CONTRACTS,L_ as INSTALL_FLAG_CONTRACTS,g_ as ITEM_COMPLETE_FLAG_CONTRACTS,y_ as ITEM_MUTATE_FLAG_CONTRACTS,x_ as ITEM_REOPEN_FLAG_CONTRACTS,uT as LEARNINGS_FLAG_CONTRACTS,D as LIST_COMMANDER_STRING_OPTION_CONTRACTS,cT as LIST_FILTER_FLAG_CONTRACTS,i_ as MEET_FLAG_CONTRACTS,yT as MERGE_FLAG_CONTRACTS,H as MERGE_SUBCOMMAND_VALUES,r as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,$_ as NEXT_FLAG_CONTRACTS,XT as NOTES_FLAG_CONTRACTS,qT as PACKAGE_FLAG_CONTRACTS,JT as PACKAGE_INIT_FLAG_CONTRACTS,a_ as PAUSE_TASK_FLAG_CONTRACTS,PA as PLAN_CREATE_METADATA_PARAMETER_KEYS,hT as PLAN_FLAG_CONTRACTS,S as PM_BULK_LIFECYCLE_COMMAND_ALIASES,K as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,C as PM_COMMAND_ALIAS_CONTRACTS,iA as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,rT as PM_COMMAND_POSITIONAL_CONTRACTS,N as PM_CONTEXT_OPS_COMMAND_ALIASES,y as PM_CORE_COMMAND_NAMES,W as PM_DEPRECATED_TOOL_ACTIONS,nA as PM_DIAGNOSTIC_DEGRADATION_STEPS,sA as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,UA as PM_DIAGNOSTIC_OUTPUT_CLASSES,j as PM_DISCOVERABLE_TOOL_ACTIONS,B as PM_EXTENSION_CAPABILITY_CONTRACTS,v as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,V as PM_EXTENSION_POLICY_MODE_CONTRACTS,x as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,g as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Y as PM_EXTENSION_SERVICE_NAME_CONTRACTS,f as PM_EXTENSION_TRUST_MODE_CONTRACTS,fA as PM_GENERIC_REFUSAL_GUIDANCE,O as PM_HISTORY_COMMAND_ALIASES,b as PM_ITEM_ACTION_SUBCOMMANDS,R as PM_NAMESPACED_COMMAND_ALIASES,lA as PM_OUTPUT_BUDGET_CLASSES,cA as PM_OUTPUT_DEGRADATION_STEPS,h as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,aT as PM_POSITIONAL_ACTION_CONTRACTS,eA as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,oA as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,gA as PM_RECOVERY_ECHO_FIELDS,E as PM_RELOCATED_COMMAND_ALIASES,k as PM_TOOL_ACTIONS,MA as PM_TOOL_ACTION_PARAMETER_CONTRACTS,tA as PM_TOOL_PARAMETERS_SCHEMA,FA as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,GA as PM_TOOL_PARAMETERS_SCHEMA_VERSION,RA as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,vT as PROFILE_FLAG_CONTRACTS,P_ as REINDEX_FLAG_CONTRACTS,D_ as RELEASE_FLAG_CONTRACTS,U_ as REMIND_FLAG_CONTRACTS,t_ as RESTORE_FLAG_CONTRACTS,KT as SCHEMA_FLAG_CONTRACTS,a as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,TA as SEARCH_FLAG_CONTRACTS,r_ as START_TASK_FLAG_CONTRACTS,u_ as STATS_FLAG_CONTRACTS,UT as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,d_ as TELEMETRY_FLAG_CONTRACTS,c_ as TEST_ALL_FLAG_CONTRACTS,l_ as TEST_FLAG_CONTRACTS,p_ as TEST_RUNS_FLAG_CONTRACTS,LT as TOOL_ACTIVITY_OPTION_CONTRACTS,_T as TOOL_AGGREGATE_OPTION_CONTRACTS,GT as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,RT as TOOL_CALENDAR_OPTION_CONTRACTS,ET as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,IT as TOOL_CONTEXT_OPTION_CONTRACTS,OT as TOOL_CREATE_OPTION_CONTRACTS,FT as TOOL_CREATE_OPTION_CONTRACT_SOURCE,PT as TOOL_DEPS_OPTION_CONTRACTS,MT as TOOL_GRAPH_OPTION_CONTRACTS,TT as TOOL_LIST_FILTER_OPTION_CONTRACTS,AT as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,CT as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,oT as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,ST as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,NT as TOOL_UPDATE_OPTION_CONTRACTS,tT as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,d as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,p as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,X as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,h_ as UPDATE_FLAG_CONTRACTS,b_ as UPDATE_MANY_FLAG_CONTRACTS,I_ as UPGRADE_FLAG_CONTRACTS,Y_ as VALIDATE_FLAG_CONTRACTS,Z_ as WORKSPACE_FLAG_CONTRACTS,DA as _testOnlyCliContracts,w as analyzePmToolActionParity,aA as analyzeSdkCliParameterCompleteness,EA as buildPmActionToolInputSchema,nT as compactFlagAliasContracts,dA as createPmCommandOutputBudget,pA as definePmCommandOutputBudget,XA as estimatePmOutputTokens,L as findPmNamespacedCommand,CA as hasSubcommandFlagContractsForCommand,uA as inferPmOutputBudgetClass,xA as isGenericRefusalRequired,yA as isGenericRefusalWhy,q as isPmExtensionCapabilityContract,Q as isPmExtensionPolicyModeContract,Z as isPmExtensionPolicySurfaceContract,J as isPmExtensionServiceNameContract,z as isPmToolAction,KA as projectLeanRecoveryPayload,HA as projectPmDiagnosticOutput,BA as projectPmDiagnosticText,i as readFirstStringFromCommanderOptions,m as readFirstValueFromCommanderOptions,n as readStringArrayFromCommanderOptions,M as renderPmCommandAliasMigrationHint,G as resolvePmCommandAlias,I as resolvePmCommandOperation,VA as resolvePmCommandOutputBudget,YA as resolvePmDiagnosticOutputBudget,P as resolvePmHistoryOperation,sT as resolvePmPositionalActionFlagContracts,LA as resolvePmToolCustomFieldCollision,OA as resolveSubcommandFlagContractsForCommand,NA as toCompletionFlagString,eT as verifyToolOptionCliParity,iT as withFlagAliasMetadata,vA as withoutGenericRefusalExamples};
1
+ import{EXECUTABLE_COMMAND_ALIASES as A,PM_COMMAND_ALIAS_CONTRACTS as C,PM_HISTORY_COMMAND_ALIASES as O,PM_CONTEXT_OPS_COMMAND_ALIASES as N,PM_BULK_LIFECYCLE_COMMAND_ALIASES as S,PM_RELOCATED_COMMAND_ALIASES as E,PM_NAMESPACED_COMMAND_ALIASES as R,findPmNamespacedCommand as L,resolvePmCommandOperation as I,resolvePmHistoryOperation as P,renderPmCommandAliasMigrationHint as M,resolvePmCommandAlias as G}from"./cli-contracts/command-aliases.js";import{ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS as o,CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS as t,CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS as e,LIST_COMMANDER_STRING_OPTION_CONTRACTS as D,NEXT_COMMANDER_STRING_OPTION_CONTRACTS as r,SEARCH_COMMANDER_STRING_OPTION_CONTRACTS as a,readFirstValueFromCommanderOptions as m,readFirstStringFromCommanderOptions as i,readStringArrayFromCommanderOptions as n}from"./cli-contracts/commander-types.js";import{CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS as U,CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS as l,CREATE_COMMANDER_STRING_OPTION_CONTRACTS as c,UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS as X,UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS as d,UPDATE_COMMANDER_STRING_OPTION_CONTRACTS as p}from"./cli-contracts/commander-mutation-options.js";import{MERGE_SUBCOMMAND_VALUES as H,PM_EXTENSION_CAPABILITY_CONTRACTS as Y,PM_EXTENSION_SERVICE_NAME_CONTRACTS as B,PM_EXTENSION_POLICY_MODE_CONTRACTS as V,PM_EXTENSION_TRUST_MODE_CONTRACTS as f,PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS as g,PM_EXTENSION_POLICY_SURFACE_CONTRACTS as x,PM_CORE_COMMAND_NAMES as y,PM_CLI_ONLY_TOOL_ACTION_WAIVERS as K,PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS as v,PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS as h,PM_ITEM_ACTION_SUBCOMMANDS as b,PM_DEPRECATED_TOOL_ACTIONS as W,PM_DISCOVERABLE_TOOL_ACTIONS as j,PM_TOOL_ACTIONS as k,analyzePmToolActionParity as w,isPmToolAction as z,isPmExtensionCapabilityContract as q,isPmExtensionServiceNameContract as J,isPmExtensionPolicyModeContract as Q,isPmExtensionPolicySurfaceContract as Z}from"./cli-contracts/enum-contracts.js";import{TOOL_LIST_FILTER_OPTION_CONTRACTS as TT,TOOL_AGGREGATE_OPTION_CONTRACTS as _T,TOOL_SEARCH_FILTER_OPTION_CONTRACTS as AT,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS as CT,TOOL_CREATE_OPTION_CONTRACTS as OT,TOOL_UPDATE_OPTION_CONTRACTS as NT,TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS as ST,TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS as ET,TOOL_CALENDAR_OPTION_CONTRACTS as RT,TOOL_ACTIVITY_OPTION_CONTRACTS as LT,TOOL_CONTEXT_OPTION_CONTRACTS as IT,TOOL_DEPS_OPTION_CONTRACTS as PT,TOOL_GRAPH_OPTION_CONTRACTS as MT,TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE as GT,TOOL_CREATE_OPTION_CONTRACT_SOURCE as FT,TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE as oT,TOOL_UPDATE_OPTION_CONTRACT_SOURCE as tT,verifyToolOptionCliParity as eT}from"./cli-contracts/tool-option-contracts.js";import{PM_COMMAND_POSITIONAL_CONTRACTS as rT,PM_POSITIONAL_ACTION_CONTRACTS as aT}from"./cli-contracts/grammar-contracts.js";import{withFlagAliasMetadata as iT,compactFlagAliasContracts as nT,resolvePmPositionalActionFlagContracts as sT,SUBCOMMAND_GLOBAL_FLAG_CONTRACTS as UT,GLOBAL_FLAG_CONTRACTS as lT,LIST_FILTER_FLAG_CONTRACTS as cT,AGGREGATE_FLAG_CONTRACTS as XT,COMMENTS_FLAG_CONTRACTS as dT,NOTES_FLAG_CONTRACTS as pT,LEARNINGS_FLAG_CONTRACTS as uT,FILES_FLAG_CONTRACTS as HT,DOCS_FLAG_CONTRACTS as YT,HISTORY_FLAG_CONTRACTS as BT,HISTORY_REDACT_FLAG_CONTRACTS as VT,HISTORY_REPAIR_FLAG_CONTRACTS as fT,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS as gT,HISTORY_COMPACT_FLAG_CONTRACTS as xT,MERGE_FLAG_CONTRACTS as yT,SCHEMA_FLAG_CONTRACTS as KT,PROFILE_FLAG_CONTRACTS as vT,PLAN_FLAG_CONTRACTS as hT,INIT_FLAG_CONTRACTS as bT,CONFIG_FLAG_CONTRACTS as WT,EXTENSION_FLAG_CONTRACTS as jT,EXTENSION_SCOPE_FLAG_CONTRACTS as kT,EXTENSION_INIT_FLAG_CONTRACTS as wT,EXTENSION_MIGRATE_FLAG_CONTRACTS as zT,PACKAGE_FLAG_CONTRACTS as qT,PACKAGE_INIT_FLAG_CONTRACTS as JT,EXTENSION_INSTALL_FLAG_CONTRACTS as QT,EXTENSION_UNINSTALL_FLAG_CONTRACTS as ZT,EXTENSION_EXPLORE_FLAG_CONTRACTS as $T,EXTENSION_INVENTORY_FLAG_CONTRACTS as T_,EXTENSION_DESCRIBE_FLAG_CONTRACTS as __,EXTENSION_ADOPT_ALL_FLAG_CONTRACTS as A_,EXTENSION_ACTIVATE_FLAG_CONTRACTS as C_,EXTENSION_DEACTIVATE_FLAG_CONTRACTS as O_,EXTENSION_MANAGE_FLAG_CONTRACTS as N_,EXTENSION_RELOAD_FLAG_CONTRACTS as S_,EXTENSION_DOCTOR_FLAG_CONTRACTS as E_,EXTENSION_CATALOG_FLAG_CONTRACTS as R_,EXTENSION_ADOPT_FLAG_CONTRACTS as L_,INSTALL_FLAG_CONTRACTS as I_,UPGRADE_FLAG_CONTRACTS as P_,REINDEX_FLAG_CONTRACTS as M_,CLOSE_FLAG_CONTRACTS as G_,CLOSE_MANY_FLAG_CONTRACTS as F_,APPEND_FLAG_CONTRACTS as o_,CLAIM_FLAG_CONTRACTS as t_,RESTORE_FLAG_CONTRACTS as e_,DELETE_FLAG_CONTRACTS as D_,RELEASE_FLAG_CONTRACTS as r_,START_TASK_FLAG_CONTRACTS as a_,PAUSE_TASK_FLAG_CONTRACTS as m_,CLOSE_TASK_FLAG_CONTRACTS as i_,MEET_FLAG_CONTRACTS as n_,EVENT_FLAG_CONTRACTS as s_,EVENTS_FLAG_CONTRACTS as U_,REMIND_FLAG_CONTRACTS as l_,TEST_FLAG_CONTRACTS as c_,TEST_ALL_FLAG_CONTRACTS as X_,TELEMETRY_FLAG_CONTRACTS as d_,TEST_RUNS_FLAG_CONTRACTS as p_,GC_FLAG_CONTRACTS as u_,STATS_FLAG_CONTRACTS as H_,DUPLICATES_FLAG_CONTRACTS as Y_,HEALTH_FLAG_CONTRACTS as B_,VALIDATE_FLAG_CONTRACTS as V_,ASSURANCE_FLAG_CONTRACTS as f_,CREATE_FLAG_CONTRACTS as g_,ITEM_COMPLETE_FLAG_CONTRACTS as x_,ITEM_REOPEN_FLAG_CONTRACTS as y_,ITEM_MUTATE_FLAG_CONTRACTS as K_,COPY_FLAG_CONTRACTS as v_,FOCUS_FLAG_CONTRACTS as h_,UPDATE_FLAG_CONTRACTS as b_,UPDATE_MANY_FLAG_CONTRACTS as W_,CALENDAR_FLAG_CONTRACTS as j_,ACTIVITY_FLAG_CONTRACTS as k_,CONTEXT_FLAG_CONTRACTS as w_,GET_FLAG_CONTRACTS as z_,GUIDE_FLAG_CONTRACTS as q_,DEPS_FLAG_CONTRACTS as J_,GRAPH_FLAG_CONTRACTS as Q_,EVAL_FLAG_CONTRACTS as Z_,WORKSPACE_FLAG_CONTRACTS as $_,NEXT_FLAG_CONTRACTS as TA,SEARCH_FLAG_CONTRACTS as _A,CONTRACTS_FLAG_CONTRACTS as AA,COMPLETION_FLAG_CONTRACTS as CA,hasSubcommandFlagContractsForCommand as OA,resolveSubcommandFlagContractsForCommand as NA,toCompletionFlagString as SA}from"./cli-contracts/flag-contracts.js";import{buildPmActionToolInputSchema as RA,PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES as LA,resolvePmToolCustomFieldCollision as IA,CLOSE_ACTION_OPTION_KEYS as PA,PLAN_CREATE_METADATA_PARAMETER_KEYS as MA,PM_TOOL_ACTION_PARAMETER_CONTRACTS as GA,PM_TOOL_PARAMETERS_SCHEMA_VERSION as FA,PM_TOOL_PARAMETERS_SCHEMA_MAJOR as oA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION as tA,PM_TOOL_PARAMETERS_SCHEMA as eA,PM_PROVIDER_TOOL_PARAMETERS_SCHEMA as DA,_testOnlyCliContracts as rA}from"./cli-contracts/tool-schema.js";import{analyzeSdkCliParameterCompleteness as mA}from"./cli-contracts/completeness.js";import{PM_COMMAND_OUTPUT_BUDGET_CONTRACTS as nA,PM_DIAGNOSTIC_DEGRADATION_STEPS as sA,PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS as UA,PM_DIAGNOSTIC_OUTPUT_CLASSES as lA,PM_OUTPUT_BUDGET_CLASSES as cA,PM_OUTPUT_DEGRADATION_STEPS as XA,createPmCommandOutputBudget as dA,definePmCommandOutputBudget as pA,estimatePmOutputTokens as uA,inferPmOutputBudgetClass as HA,projectPmDiagnosticOutput as YA,projectPmDiagnosticText as BA,resolvePmDiagnosticOutputBudget as VA,resolvePmCommandOutputBudget as fA,PM_GENERIC_REFUSAL_GUIDANCE as gA,PM_RECOVERY_ECHO_FIELDS as xA,isGenericRefusalRequired as yA,isGenericRefusalWhy as KA,projectLeanRecoveryPayload as vA,withoutGenericRefusalExamples as hA}from"./cli-contracts/agent-output-contracts.js";export{o as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,k_ as ACTIVITY_FLAG_CONTRACTS,XT as AGGREGATE_FLAG_CONTRACTS,o_ as APPEND_FLAG_CONTRACTS,f_ as ASSURANCE_FLAG_CONTRACTS,t as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,j_ as CALENDAR_FLAG_CONTRACTS,t_ as CLAIM_FLAG_CONTRACTS,PA as CLOSE_ACTION_OPTION_KEYS,G_ as CLOSE_FLAG_CONTRACTS,F_ as CLOSE_MANY_FLAG_CONTRACTS,i_ as CLOSE_TASK_FLAG_CONTRACTS,dT as COMMENTS_FLAG_CONTRACTS,CA as COMPLETION_FLAG_CONTRACTS,WT as CONFIG_FLAG_CONTRACTS,e as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,w_ as CONTEXT_FLAG_CONTRACTS,AA as CONTRACTS_FLAG_CONTRACTS,v_ as COPY_FLAG_CONTRACTS,U as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,l as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,c as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,g_ as CREATE_FLAG_CONTRACTS,D_ as DELETE_FLAG_CONTRACTS,J_ as DEPS_FLAG_CONTRACTS,YT as DOCS_FLAG_CONTRACTS,Y_ as DUPLICATES_FLAG_CONTRACTS,Z_ as EVAL_FLAG_CONTRACTS,U_ as EVENTS_FLAG_CONTRACTS,s_ as EVENT_FLAG_CONTRACTS,A as EXECUTABLE_COMMAND_ALIASES,C_ as EXTENSION_ACTIVATE_FLAG_CONTRACTS,A_ as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,L_ as EXTENSION_ADOPT_FLAG_CONTRACTS,R_ as EXTENSION_CATALOG_FLAG_CONTRACTS,O_ as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,__ as EXTENSION_DESCRIBE_FLAG_CONTRACTS,E_ as EXTENSION_DOCTOR_FLAG_CONTRACTS,$T as EXTENSION_EXPLORE_FLAG_CONTRACTS,jT as EXTENSION_FLAG_CONTRACTS,wT as EXTENSION_INIT_FLAG_CONTRACTS,QT as EXTENSION_INSTALL_FLAG_CONTRACTS,T_ as EXTENSION_INVENTORY_FLAG_CONTRACTS,N_ as EXTENSION_MANAGE_FLAG_CONTRACTS,zT as EXTENSION_MIGRATE_FLAG_CONTRACTS,S_ as EXTENSION_RELOAD_FLAG_CONTRACTS,kT as EXTENSION_SCOPE_FLAG_CONTRACTS,ZT as EXTENSION_UNINSTALL_FLAG_CONTRACTS,HT as FILES_FLAG_CONTRACTS,h_ as FOCUS_FLAG_CONTRACTS,u_ as GC_FLAG_CONTRACTS,z_ as GET_FLAG_CONTRACTS,lT as GLOBAL_FLAG_CONTRACTS,Q_ as GRAPH_FLAG_CONTRACTS,q_ as GUIDE_FLAG_CONTRACTS,B_ as HEALTH_FLAG_CONTRACTS,gT as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,xT as HISTORY_COMPACT_FLAG_CONTRACTS,BT as HISTORY_FLAG_CONTRACTS,VT as HISTORY_REDACT_FLAG_CONTRACTS,fT as HISTORY_REPAIR_FLAG_CONTRACTS,bT as INIT_FLAG_CONTRACTS,I_ as INSTALL_FLAG_CONTRACTS,x_ as ITEM_COMPLETE_FLAG_CONTRACTS,K_ as ITEM_MUTATE_FLAG_CONTRACTS,y_ as ITEM_REOPEN_FLAG_CONTRACTS,uT as LEARNINGS_FLAG_CONTRACTS,D as LIST_COMMANDER_STRING_OPTION_CONTRACTS,cT as LIST_FILTER_FLAG_CONTRACTS,n_ as MEET_FLAG_CONTRACTS,yT as MERGE_FLAG_CONTRACTS,H as MERGE_SUBCOMMAND_VALUES,r as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,TA as NEXT_FLAG_CONTRACTS,pT as NOTES_FLAG_CONTRACTS,qT as PACKAGE_FLAG_CONTRACTS,JT as PACKAGE_INIT_FLAG_CONTRACTS,m_ as PAUSE_TASK_FLAG_CONTRACTS,MA as PLAN_CREATE_METADATA_PARAMETER_KEYS,hT as PLAN_FLAG_CONTRACTS,S as PM_BULK_LIFECYCLE_COMMAND_ALIASES,K as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,C as PM_COMMAND_ALIAS_CONTRACTS,nA as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,rT as PM_COMMAND_POSITIONAL_CONTRACTS,N as PM_CONTEXT_OPS_COMMAND_ALIASES,y as PM_CORE_COMMAND_NAMES,W as PM_DEPRECATED_TOOL_ACTIONS,sA as PM_DIAGNOSTIC_DEGRADATION_STEPS,UA as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,lA as PM_DIAGNOSTIC_OUTPUT_CLASSES,j as PM_DISCOVERABLE_TOOL_ACTIONS,Y as PM_EXTENSION_CAPABILITY_CONTRACTS,v as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,V as PM_EXTENSION_POLICY_MODE_CONTRACTS,x as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,g as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,B as PM_EXTENSION_SERVICE_NAME_CONTRACTS,f as PM_EXTENSION_TRUST_MODE_CONTRACTS,gA as PM_GENERIC_REFUSAL_GUIDANCE,O as PM_HISTORY_COMMAND_ALIASES,b as PM_ITEM_ACTION_SUBCOMMANDS,R as PM_NAMESPACED_COMMAND_ALIASES,cA as PM_OUTPUT_BUDGET_CLASSES,XA as PM_OUTPUT_DEGRADATION_STEPS,h as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,aT as PM_POSITIONAL_ACTION_CONTRACTS,DA as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,tA as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,xA as PM_RECOVERY_ECHO_FIELDS,E as PM_RELOCATED_COMMAND_ALIASES,k as PM_TOOL_ACTIONS,GA as PM_TOOL_ACTION_PARAMETER_CONTRACTS,eA as PM_TOOL_PARAMETERS_SCHEMA,oA as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,FA as PM_TOOL_PARAMETERS_SCHEMA_VERSION,LA as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,vT as PROFILE_FLAG_CONTRACTS,M_ as REINDEX_FLAG_CONTRACTS,r_ as RELEASE_FLAG_CONTRACTS,l_ as REMIND_FLAG_CONTRACTS,e_ as RESTORE_FLAG_CONTRACTS,KT as SCHEMA_FLAG_CONTRACTS,a as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,_A as SEARCH_FLAG_CONTRACTS,a_ as START_TASK_FLAG_CONTRACTS,H_ as STATS_FLAG_CONTRACTS,UT as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,d_ as TELEMETRY_FLAG_CONTRACTS,X_ as TEST_ALL_FLAG_CONTRACTS,c_ as TEST_FLAG_CONTRACTS,p_ as TEST_RUNS_FLAG_CONTRACTS,LT as TOOL_ACTIVITY_OPTION_CONTRACTS,_T as TOOL_AGGREGATE_OPTION_CONTRACTS,GT as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,RT as TOOL_CALENDAR_OPTION_CONTRACTS,ET as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,IT as TOOL_CONTEXT_OPTION_CONTRACTS,OT as TOOL_CREATE_OPTION_CONTRACTS,FT as TOOL_CREATE_OPTION_CONTRACT_SOURCE,PT as TOOL_DEPS_OPTION_CONTRACTS,MT as TOOL_GRAPH_OPTION_CONTRACTS,TT as TOOL_LIST_FILTER_OPTION_CONTRACTS,AT as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,CT as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,oT as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,ST as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,NT as TOOL_UPDATE_OPTION_CONTRACTS,tT as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,X as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,d as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,p as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,b_ as UPDATE_FLAG_CONTRACTS,W_ as UPDATE_MANY_FLAG_CONTRACTS,P_ as UPGRADE_FLAG_CONTRACTS,V_ as VALIDATE_FLAG_CONTRACTS,$_ as WORKSPACE_FLAG_CONTRACTS,rA as _testOnlyCliContracts,w as analyzePmToolActionParity,mA as analyzeSdkCliParameterCompleteness,RA as buildPmActionToolInputSchema,nT as compactFlagAliasContracts,dA as createPmCommandOutputBudget,pA as definePmCommandOutputBudget,uA as estimatePmOutputTokens,L as findPmNamespacedCommand,OA as hasSubcommandFlagContractsForCommand,HA as inferPmOutputBudgetClass,yA as isGenericRefusalRequired,KA as isGenericRefusalWhy,q as isPmExtensionCapabilityContract,Q as isPmExtensionPolicyModeContract,Z as isPmExtensionPolicySurfaceContract,J as isPmExtensionServiceNameContract,z as isPmToolAction,vA as projectLeanRecoveryPayload,YA as projectPmDiagnosticOutput,BA as projectPmDiagnosticText,i as readFirstStringFromCommanderOptions,m as readFirstValueFromCommanderOptions,n as readStringArrayFromCommanderOptions,M as renderPmCommandAliasMigrationHint,G as resolvePmCommandAlias,I as resolvePmCommandOperation,fA as resolvePmCommandOutputBudget,VA as resolvePmDiagnosticOutputBudget,P as resolvePmHistoryOperation,sT as resolvePmPositionalActionFlagContracts,IA as resolvePmToolCustomFieldCollision,NA as resolveSubcommandFlagContractsForCommand,SA as toCompletionFlagString,eT as verifyToolOptionCliParity,iT as withFlagAliasMetadata,hA as withoutGenericRefusalExamples};
2
2
  //# sourceMappingURL=cli-contracts.js.map
@@ -1,4 +1,4 @@
1
- import type{GlobalOptions}from "../core/shared/command-types.js";export{quoteWindowsCommandArg,quoteCommandArg,renderPmCommand}from "../core/shared/command-line.js";export{URL_CREDENTIAL_PLACEHOLDER,invocationCarriesUrlCredentials,redactUrlCredentialsInText,redactUrlCredentialsInToken,runWithUrlCredentialInvocation,}from "../core/shared/url-credentials.js";
1
+ import type{GlobalOptions}from "../core/shared/command-types.js";export{COMMAND_SHELL_ENV,quoteCmdCommandArg,quoteCommandArg,quotePosixCommandArg,quotePowerShellCommandArg,quoteWindowsCommandArg,renderPmCommand,resolveCommandShellDialect,type CommandShellDialect,}from "../core/shared/command-line.js";export{URL_CREDENTIAL_PLACEHOLDER,invocationCarriesUrlCredentials,redactUrlCredentialsInText,redactUrlCredentialsInToken,runWithUrlCredentialInvocation,}from "../core/shared/url-credentials.js";
2
2
  /** Tracker selection a rendered recovery command must preserve: the requested path and extension isolation. */
3
3
  export type CommandScope=Pick<GlobalOptions,"path"|"noExtensions">;
4
4
  /** Retain caller scope before runtime dispatch resolves its working storage path. */
@@ -1,2 +1,2 @@
1
- import{findBootstrapCommandTokenIndex as a}from"./cli-contracts/bootstrap-command-scanner.js";import c from"node:path";import{resolveImplicitPmRoot as d,resolvePmRoot as m,resolveWorkspaceRoot as u}from"../core/store/paths.js";import{isPathWithinDirectory as f}from"../core/fs/path-utils.js";import{quoteWindowsCommandArg as v,quoteCommandArg as _,renderPmCommand as k}from"../core/shared/command-line.js";import{URL_CREDENTIAL_PLACEHOLDER as L,invocationCarriesUrlCredentials as U,redactUrlCredentialsInText as W,redactUrlCredentialsInToken as g,runWithUrlCredentialInvocation as y}from"../core/shared/url-credentials.js";const i=new WeakMap;function P(e){i.set(e,e.path)}function l(e){if(!process.env.PM_PATH?.trim())return;const t=m(e);return f(u(t),e)&&t===d(e)?void 0:c.relative(e,t)||"."}function R(e,t=process.cwd()){const n=i.has(e)?i.get(e):e.path,r=n?.trim()?n:l(t),o=r?["--pm-path",r]:[];return e.noExtensions&&o.push("--no-extensions"),o}const p=new Set(["--literal","--regex","--replacement"]);function h(e){const t=a(e);if(t===void 0)return!1;if(e[t]==="history-redact")return!0;if(e[t]!=="history")return!1;const n=e.slice(t+1),r=a(n);return r!==void 0&&n[r]==="redact"}function S(e){if(!h(e))return[...e];const t=[];let n=!1;for(const r of e){if(n){t.push("[redacted]"),n=!1;continue}n=!1;const o=r.indexOf("="),s=o>=0?r.slice(0,o):r;if(!p.has(s)){t.push(r);continue}if(o>=0){t.push(`${s}=[redacted]`);continue}t.push(s),n=!0}return t}export{L as URL_CREDENTIAL_PLACEHOLDER,P as capturePmCommandScope,U as invocationCarriesUrlCredentials,h as isHistoryRedactInvocation,_ as quoteCommandArg,v as quoteWindowsCommandArg,S as redactSensitiveCommandArgs,W as redactUrlCredentialsInText,g as redactUrlCredentialsInToken,k as renderPmCommand,R as resolvePmCommandScopeArgs,y as runWithUrlCredentialInvocation};
1
+ import{findBootstrapCommandTokenIndex as a}from"./cli-contracts/bootstrap-command-scanner.js";import d from"node:path";import{resolveImplicitPmRoot as c,resolvePmRoot as m,resolveWorkspaceRoot as u}from"../core/store/paths.js";import{isPathWithinDirectory as l}from"../core/fs/path-utils.js";import{COMMAND_SHELL_ENV as v,quoteCmdCommandArg as T,quoteCommandArg as _,quotePosixCommandArg as g,quotePowerShellCommandArg as L,quoteWindowsCommandArg as D,renderPmCommand as k,resolveCommandShellDialect as H}from"../core/shared/command-line.js";import{URL_CREDENTIAL_PLACEHOLDER as U,invocationCarriesUrlCredentials as W,redactUrlCredentialsInText as y,redactUrlCredentialsInToken as M,runWithUrlCredentialInvocation as O}from"../core/shared/url-credentials.js";const i=new WeakMap;function P(e){i.set(e,e.path)}function f(e){if(!process.env.PM_PATH?.trim())return;const t=m(e);return l(u(t),e)&&t===c(e)?void 0:d.relative(e,t)||"."}function S(e,t=process.cwd()){const n=i.has(e)?i.get(e):e.path,o=n?.trim()?n:f(t),r=o?["--pm-path",o]:[];return e.noExtensions&&r.push("--no-extensions"),r}const p=new Set(["--literal","--regex","--replacement"]);function C(e){const t=a(e);if(t===void 0)return!1;if(e[t]==="history-redact")return!0;if(e[t]!=="history")return!1;const n=e.slice(t+1),o=a(n);return o!==void 0&&n[o]==="redact"}function E(e){if(!C(e))return[...e];const t=[];let n=!1;for(const o of e){if(n){t.push("[redacted]"),n=!1;continue}n=!1;const r=o.indexOf("="),s=r>=0?o.slice(0,r):o;if(!p.has(s)){t.push(o);continue}if(r>=0){t.push(`${s}=[redacted]`);continue}t.push(s),n=!0}return t}export{v as COMMAND_SHELL_ENV,U as URL_CREDENTIAL_PLACEHOLDER,P as capturePmCommandScope,W as invocationCarriesUrlCredentials,C as isHistoryRedactInvocation,T as quoteCmdCommandArg,_ as quoteCommandArg,g as quotePosixCommandArg,L as quotePowerShellCommandArg,D as quoteWindowsCommandArg,E as redactSensitiveCommandArgs,y as redactUrlCredentialsInText,M as redactUrlCredentialsInToken,k as renderPmCommand,H as resolveCommandShellDialect,S as resolvePmCommandScopeArgs,O as runWithUrlCredentialInvocation};
2
2
  //# sourceMappingURL=command-line.js.map
@@ -21,7 +21,7 @@ statuses?:string[];
21
21
  command_flags?:Partial<Record<CompletionFlagCommand,string[]>>;}
22
22
  declare const HIDDEN_COMMAND_ALIASES:Set<string>;declare const ALL_COMMANDS:string[];declare const LIST_FLAGS:string;declare const AGGREGATE_FLAGS:string;declare const APPEND_FLAGS:string;declare const COPY_FLAGS:string;declare const RESTORE_INVOCATIONS:import("../flag-invocation-contracts.js").CliFlagInvocationContract[];declare const ATTEST_INVOCATIONS:import("../flag-invocation-contracts.js").CliFlagInvocationContract[];declare const FOCUS_FLAGS:string;declare const MEET_FLAGS:string;declare const REMIND_FLAGS:string;declare const CREATE_FLAGS:string;declare const GET_FLAGS:string;declare const UPDATE_FLAGS:string;declare const UPDATE_MANY_FLAGS:string;declare const CLOSE_MANY_FLAGS:string;declare const NAMESPACE_NOUNS:string[];declare const NAMESPACE_PREFIXES:string[];declare const HISTORY_LEAVES:string;
23
23
  /** Advertise core namespace leaves plus facets supplied by the active package registry. */
24
- declare function completionNamespaceLeaves(runtime:CompletionRuntimeConfig):Record<string,string>;declare const HISTORY_OPERATION_FLAGS:{flags:string;alias:string;canonical:string;canonical_argv:readonly string[];lifecycle:import("../cli-contracts.js").PmCommandAliasLifecycle;hidden:boolean;registration:import("../cli-contracts.js").PmCommandAliasRegistration;owner:string;}[];declare const HISTORY_FLAGS:string;declare const HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS:string;declare const EVENTS_FLAGS:string;declare const CALENDAR_FLAGS:string;declare const CONTEXT_FLAGS:string;declare const NEXT_FLAGS:string;declare const DEPS_FLAGS:string;declare const DUPLICATES_FLAGS:string;declare const GRAPH_FLAGS:string;declare const GUIDE_FLAGS:string;declare const SEARCH_FLAGS:string;declare const STATS_FLAGS:string;declare const HEALTH_FLAGS:string;declare const INIT_FLAGS:string;declare const CONTRACTS_FLAGS:string;declare const PLAN_FLAGS:string;declare const SCHEMA_SUBCOMMAND_CHOICES:string;declare const PLAN_SUBCOMMANDS_LIST="create show add-step update-step complete-step block-step reorder-step remove-step link unlink decision discovery validation resume approve materialize";declare const COMPLETION_SHELL_CHOICES:string;declare const GUIDE_TOPIC_CHOICES:string;declare const EXTENSION_LIFECYCLE_ACTIONS="init scaffold install uninstall explore manage describe reload doctor catalog adopt adopt-all activate deactivate migrate";declare const PACKAGE_LIFECYCLE_ACTIONS="init scaffold install uninstall explore manage describe reload doctor catalog adopt adopt-all activate deactivate migrate upgrade";declare const EXTENSION_LIFECYCLE_FLAGS:string;declare const PACKAGE_LIFECYCLE_FLAGS:string;declare const UPGRADE_FLAGS:string;declare const MUTATION_FLAGS="--author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help";declare const DELETE_MUTATION_FLAGS="--dry-run --author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help";declare const CLOSE_MUTATION_FLAGS:string;declare const CLOSE_TASK_MUTATION_FLAGS:string;declare const RELEASE_MUTATION_FLAGS:string;declare const CLAIM_MUTATION_FLAGS:string;declare const COMMAND_COMPLETION_DESCRIPTIONS:readonly[readonly["workspace","Workspace initialization, customization, state and snapshots"],readonly["init","Initialize pm storage for the current workspace"],readonly["config","Read or update pm settings"],readonly["package","Manage package lifecycle operations"],readonly["packages","Alias for package"],readonly["create","Create a new project management item"],readonly["item","Manage item evidence, links, tests, and duplication"],readonly["copy","Copy an existing item to a new ID"],readonly["focus","Set/clear/show the session focused parent for new items"],readonly["list","List active items with optional filters"],readonly["aggregate","Aggregate grouped item counts and numeric stats for governance queries"],readonly["duplicates","Find bounded duplicate clusters across lifecycle statuses"],readonly["guide","Browse local progressive-disclosure guides"],readonly["calendar","Show calendar views for deadlines and reminders"],readonly["cal","Alias for calendar"],readonly["context","Show a token-efficient project context snapshot"],readonly["ctx","Alias for context"],readonly["get","Show item details by ID"],readonly["next","Recommend the next actionable (unblocked, ready) work item"],readonly["search","Search items with keyword, semantic, or hybrid modes"],readonly["reindex","Rebuild search artifacts"],readonly["history","Show item history entries"],readonly["history-compact","Compact history streams into a synthetic baseline + retained tail"],readonly["history-redact","Redact and reseal item history."],readonly["history-repair","Re-anchor a drifted history chain so pm health/validate report ok"],readonly["schema","Manage custom item types and statuses in .agents/pm/schema/*.json"],readonly["profile","List, show, apply, and lint project profiles (archetype schema/config/template/package bundles)"],readonly["plan","Agent-optimized Plan item workflow (create/show/add-step/update-step/complete-step/link/approve/materialize)"],readonly["activity","Show recent activity across items"],readonly["restore","Restore an item to an earlier state"],readonly["update","Update item fields and metadata"],readonly["update-many","Bulk-update matched items with dry-run and rollback checkpoints"],readonly["close","Close an item (reason requirement follows governance settings)"],readonly["close-many","Bulk-close matched items with an optional shared reason and rollback checkpoint"],readonly["delete","Delete an item and record the change"],readonly["append","Append text to an item body"],readonly["comments","List or add comments for an item"],readonly["notes","List or add notes for an item"],readonly["learnings","List or add learnings for an item"],readonly["files","Manage linked files"],readonly["docs","Manage linked docs"],readonly["deps","Show dependency relationships for an item"],readonly["graph","Bounded graph traversal, analytics, and governance-audit queries"],readonly["test","Manage linked tests and optionally run them"],readonly["test-all","Run linked tests across matching items"],readonly["test-runs","Manage background linked-test runs"],readonly["stats","Show project tracker statistics"],readonly["health","Show project tracker health checks"],readonly["validate","Run standalone validation checks"],readonly["gc","Clean optional cache artifacts"],readonly["contracts","Show machine-readable command and schema contracts"],readonly["claim","Claim an item for active work"],readonly["release","Release the active claim for an item"],readonly["start-task","Lifecycle alias to claim and set in_progress"],readonly["pause-task","Lifecycle alias to reopen and release claim"],readonly["close-task","Lifecycle alias to close and release claim"],readonly["meet","Shortcut to create a Meeting with scheduling defaults"],readonly["event","Shortcut to create an Event with scheduling defaults"],readonly["remind","Shortcut to create a Reminder from a point in time"],readonly["templates","Manage reusable create templates"],readonly["completion","Generate shell completion"],readonly["help","Display help for a command"]];declare const GLOBAL_FLAGS:string;declare const GLOBAL_COMPLETION_VALUE_PATTERNS:string;declare const GLOBAL_COMPLETION_INLINE_PATTERNS:string;declare const GLOBAL_COMPLETION_SWITCH_PATTERNS:string;
24
+ declare function completionNamespaceLeaves(runtime:CompletionRuntimeConfig):Record<string,string>;declare const HISTORY_OPERATION_FLAGS:{flags:string;alias:string;canonical:string;canonical_argv:readonly string[];lifecycle:import("../cli-contracts.js").PmCommandAliasLifecycle;hidden:boolean;registration:import("../cli-contracts.js").PmCommandAliasRegistration;owner:string;}[];declare const HISTORY_FLAGS:string;declare const HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS:string;declare const EVENTS_FLAGS:string;declare const CALENDAR_FLAGS:string;declare const CONTEXT_FLAGS:string;declare const NEXT_FLAGS:string;declare const DEPS_FLAGS:string;declare const DUPLICATES_FLAGS:string;declare const GRAPH_FLAGS:string;declare const GUIDE_FLAGS:string;declare const SEARCH_FLAGS:string;declare const STATS_FLAGS:string;declare const HEALTH_FLAGS:string;declare const INIT_FLAGS:string;declare const CONTRACTS_FLAGS:string;declare const PLAN_FLAGS:string;declare const SCHEMA_SUBCOMMAND_CHOICES:string;declare const PLAN_SUBCOMMANDS_LIST="create show add-step update-step complete-step block-step reorder-step remove-step link unlink decision discovery validation resume approve materialize";declare const COMPLETION_SHELL_CHOICES:string;declare const GUIDE_TOPIC_CHOICES:string;declare const EXTENSION_LIFECYCLE_ACTIONS="init scaffold install uninstall list inventory explore manage describe reload doctor catalog adopt adopt-all activate deactivate migrate";declare const PACKAGE_LIFECYCLE_ACTIONS="init scaffold install uninstall list inventory explore manage describe reload doctor catalog adopt adopt-all activate deactivate migrate upgrade";declare const EXTENSION_LIFECYCLE_FLAGS:string;declare const PACKAGE_LIFECYCLE_FLAGS:string;declare const UPGRADE_FLAGS:string;declare const MUTATION_FLAGS="--author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help";declare const DELETE_MUTATION_FLAGS="--dry-run --author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help";declare const CLOSE_MUTATION_FLAGS:string;declare const CLOSE_TASK_MUTATION_FLAGS:string;declare const RELEASE_MUTATION_FLAGS:string;declare const CLAIM_MUTATION_FLAGS:string;declare const COMMAND_COMPLETION_DESCRIPTIONS:readonly[readonly["workspace","Workspace initialization, customization, state and snapshots"],readonly["init","Initialize pm storage for the current workspace"],readonly["config","Read or update pm settings"],readonly["package","Manage package lifecycle operations"],readonly["packages","Alias for package"],readonly["create","Create a new project management item"],readonly["item","Manage item evidence, links, tests, and duplication"],readonly["copy","Copy an existing item to a new ID"],readonly["focus","Set/clear/show the session focused parent for new items"],readonly["list","List active items with optional filters"],readonly["aggregate","Aggregate grouped item counts and numeric stats for governance queries"],readonly["duplicates","Find bounded duplicate clusters across lifecycle statuses"],readonly["guide","Browse local progressive-disclosure guides"],readonly["calendar","Show calendar views for deadlines and reminders"],readonly["cal","Alias for calendar"],readonly["context","Show a token-efficient project context snapshot"],readonly["ctx","Alias for context"],readonly["get","Show item details by ID"],readonly["next","Recommend the next actionable (unblocked, ready) work item"],readonly["search","Search items with keyword, semantic, or hybrid modes"],readonly["reindex","Rebuild search artifacts"],readonly["history","Show item history entries"],readonly["history-compact","Compact history streams into a synthetic baseline + retained tail"],readonly["history-redact","Redact and reseal item history."],readonly["history-repair","Re-anchor a drifted history chain so pm health/validate report ok"],readonly["schema","Manage custom item types and statuses in .agents/pm/schema/*.json"],readonly["profile","List, show, apply, and lint project profiles (archetype schema/config/template/package bundles)"],readonly["plan","Agent-optimized Plan item workflow (create/show/add-step/update-step/complete-step/link/approve/materialize)"],readonly["activity","Show recent activity across items"],readonly["restore","Restore an item to an earlier state"],readonly["update","Update item fields and metadata"],readonly["update-many","Bulk-update matched items with dry-run and rollback checkpoints"],readonly["close","Close an item (reason requirement follows governance settings)"],readonly["close-many","Bulk-close matched items with an optional shared reason and rollback checkpoint"],readonly["delete","Delete an item and record the change"],readonly["append","Append text to an item body"],readonly["comments","List or add comments for an item"],readonly["notes","List or add notes for an item"],readonly["learnings","List or add learnings for an item"],readonly["files","Manage linked files"],readonly["docs","Manage linked docs"],readonly["deps","Show dependency relationships for an item"],readonly["graph","Bounded graph traversal, analytics, and governance-audit queries"],readonly["test","Manage linked tests and optionally run them"],readonly["test-all","Run linked tests across matching items"],readonly["test-runs","Manage background linked-test runs"],readonly["stats","Show project tracker statistics"],readonly["health","Show project tracker health checks"],readonly["validate","Run standalone validation checks"],readonly["gc","Clean optional cache artifacts"],readonly["contracts","Show machine-readable command and schema contracts"],readonly["claim","Claim an item for active work"],readonly["release","Release the active claim for an item"],readonly["start-task","Lifecycle alias to claim and set in_progress"],readonly["pause-task","Lifecycle alias to reopen and release claim"],readonly["close-task","Lifecycle alias to close and release claim"],readonly["meet","Shortcut to create a Meeting with scheduling defaults"],readonly["event","Shortcut to create an Event with scheduling defaults"],readonly["remind","Shortcut to create a Reminder from a point in time"],readonly["templates","Manage reusable create templates"],readonly["completion","Generate shell completion"],readonly["help","Display help for a command"]];declare const GLOBAL_FLAGS:string;declare const GLOBAL_COMPLETION_VALUE_PATTERNS:string;declare const GLOBAL_COMPLETION_INLINE_PATTERNS:string;declare const GLOBAL_COMPLETION_SWITCH_PATTERNS:string;
25
25
  /** Deduplicate, sort and join non-empty completion choices for deterministic output. */
26
26
  declare function joinCompletionValues(values:string[]):string;
27
27
  /** Escape shell interpolation characters before embedding a value in a double-quoted resolver fallback. */
@@ -1,2 +1,2 @@
1
- import{BUILTIN_ITEM_TYPE_VALUES as d,STATUS_VALUES as L}from"../../types/index.js";import{listPmCommandsForTier as E,resolvePmCommandVisibilityTier as O}from"../agent-capability-contracts.js";import{AGGREGATE_FLAG_CONTRACTS as N,APPEND_FLAG_CONTRACTS as h,CALENDAR_FLAG_CONTRACTS as G,CLOSE_MANY_FLAG_CONTRACTS as F,COMPLETION_FLAG_CONTRACTS as u,CONTEXT_FLAG_CONTRACTS as f,CONTRACTS_FLAG_CONTRACTS as R,COPY_FLAG_CONTRACTS as g,CREATE_FLAG_CONTRACTS as I,DEPS_FLAG_CONTRACTS as M,DUPLICATES_FLAG_CONTRACTS as P,EVENTS_FLAG_CONTRACTS as w,EXTENSION_FLAG_CONTRACTS as D,FOCUS_FLAG_CONTRACTS as k,GET_FLAG_CONTRACTS as y,GLOBAL_FLAG_CONTRACTS as v,GRAPH_FLAG_CONTRACTS as U,GUIDE_FLAG_CONTRACTS as H,HEALTH_FLAG_CONTRACTS as b,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS as j,HISTORY_FLAG_CONTRACTS as Y,INIT_FLAG_CONTRACTS as V,LIST_FILTER_FLAG_CONTRACTS as B,MEET_FLAG_CONTRACTS as x,NEXT_FLAG_CONTRACTS as z,PACKAGE_FLAG_CONTRACTS as K,PLAN_FLAG_CONTRACTS as W,PM_COMMAND_ALIAS_CONTRACTS as X,PM_NAMESPACED_COMMAND_ALIASES as i,REMIND_FLAG_CONTRACTS as $,SEARCH_FLAG_CONTRACTS as q,STATS_FLAG_CONTRACTS as Q,UPDATE_FLAG_CONTRACTS as J,UPDATE_MANY_FLAG_CONTRACTS as Z,UPGRADE_FLAG_CONTRACTS as ee,resolvePmCommandOperation as A,resolveSubcommandFlagContractsForCommand as n,toCompletionFlagString as t}from"../cli-contracts.js";import{GLOBAL_VALUE_CONSUMING_FLAGS as l}from"../cli-contracts/bootstrap-command-scanner.js";import{WORKFLOW_POLICY_ACTIONS as te}from"../cli-contracts/enum-contracts.js";import{PM_COMMAND_DESTINATION_CONTRACTS as ae}from"../cli-contracts/grammar-contracts.js";import{enrichCliFlagInvocationContracts as _}from"../flag-invocation-contracts.js";import{listGuideTopicIds as oe}from"../guide-topics.js";const se=[...d],ne=[...L],S=new Set(X.filter(e=>e.hidden).map(e=>e.alias)),ie=E("full").filter(e=>!e.includes(" ")&&!S.has(e)),ce=t(B),re=t(N),le=t(h),Ae=t(g),_e=_("restore",n("restore")),Se=_("history-attest",n("history-attest")),Te=t(k),me=t(x),Ce=t($),pe=t(I),de=t(y),Le=t(J),Ee=t(Z),Oe=t(F),Ne=[...new Set(i.map(e=>e.canonical_argv[0]))],T=[...new Set(i.flatMap(e=>e.canonical_argv.slice(0,-1).map((a,o)=>e.canonical_argv.slice(0,o+1).join(" "))))],he=new Set(ae.filter(e=>e.disposition==="package_owned").map(e=>A(e.command))),m=i.filter(e=>e.canonical_argv[0]==="history"),Ge=m.map(e=>e.canonical_argv[1]).join(" ");function Fe(e){const a=new Set((e.namespace_commands??[]).map(A)),o=i.filter(s=>O(s.canonical)!=="internal"&&(!he.has(s.alias)||a.has(s.alias)));return Object.fromEntries(T.map(s=>[s,[...new Set(o.filter(r=>r.canonical.startsWith(`${s} `)).map(r=>r.canonical_argv[s.split(" ").length]))].join(" ")]))}const ue=m.map(e=>({...e,flags:t(n(e.alias))})),fe=t(Y),Re=t(j,!1),ge=t(w),Ie=t(G),Me=t(f),Pe=t(z),we=t(M),De=t(P),ke=t(U),ye=t(H),ve=t(q),Ue=t(Q),He=t(b),be=t(V),je=t(R),Ye=t(W),Ve=`${te.join(" ")} list show show-status add-type remove-type add-status remove-status add-field remove-field list-fields show-field apply-preset rename-type rename-field remap-status`,Be="create show add-step update-step complete-step block-step reorder-step remove-step link unlink decision discovery validation resume approve materialize",xe=t(u),ze=`${xe} bash zsh fish`,Ke=c(oe()),C="init scaffold install uninstall explore manage describe reload doctor catalog adopt adopt-all activate deactivate migrate",We=`${C} upgrade`,Xe=t(D),$e=t(K),qe=t(ee),Qe="--author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help",Je="--dry-run --author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help",Ze=t(n("close")),et=t(n("close-task")),tt=t(n("release")),at=t(n("claim")),ot=[["workspace","Workspace initialization, customization, state and snapshots"],["init","Initialize pm storage for the current workspace"],["config","Read or update pm settings"],["package","Manage package lifecycle operations"],["packages","Alias for package"],["create","Create a new project management item"],["item","Manage item evidence, links, tests, and duplication"],["copy","Copy an existing item to a new ID"],["focus","Set/clear/show the session focused parent for new items"],["list","List active items with optional filters"],["aggregate","Aggregate grouped item counts and numeric stats for governance queries"],["duplicates","Find bounded duplicate clusters across lifecycle statuses"],["guide","Browse local progressive-disclosure guides"],["calendar","Show calendar views for deadlines and reminders"],["cal","Alias for calendar"],["context","Show a token-efficient project context snapshot"],["ctx","Alias for context"],["get","Show item details by ID"],["next","Recommend the next actionable (unblocked, ready) work item"],["search","Search items with keyword, semantic, or hybrid modes"],["reindex","Rebuild search artifacts"],["history","Show item history entries"],["history-compact","Compact history streams into a synthetic baseline + retained tail"],["history-redact","Redact and reseal item history."],["history-repair","Re-anchor a drifted history chain so pm health/validate report ok"],["schema","Manage custom item types and statuses in .agents/pm/schema/*.json"],["profile","List, show, apply, and lint project profiles (archetype schema/config/template/package bundles)"],["plan","Agent-optimized Plan item workflow (create/show/add-step/update-step/complete-step/link/approve/materialize)"],["activity","Show recent activity across items"],["restore","Restore an item to an earlier state"],["update","Update item fields and metadata"],["update-many","Bulk-update matched items with dry-run and rollback checkpoints"],["close","Close an item (reason requirement follows governance settings)"],["close-many","Bulk-close matched items with an optional shared reason and rollback checkpoint"],["delete","Delete an item and record the change"],["append","Append text to an item body"],["comments","List or add comments for an item"],["notes","List or add notes for an item"],["learnings","List or add learnings for an item"],["files","Manage linked files"],["docs","Manage linked docs"],["deps","Show dependency relationships for an item"],["graph","Bounded graph traversal, analytics, and governance-audit queries"],["test","Manage linked tests and optionally run them"],["test-all","Run linked tests across matching items"],["test-runs","Manage background linked-test runs"],["stats","Show project tracker statistics"],["health","Show project tracker health checks"],["validate","Run standalone validation checks"],["gc","Clean optional cache artifacts"],["contracts","Show machine-readable command and schema contracts"],["claim","Claim an item for active work"],["release","Release the active claim for an item"],["start-task","Lifecycle alias to claim and set in_progress"],["pause-task","Lifecycle alias to reopen and release claim"],["close-task","Lifecycle alias to close and release claim"],["meet","Shortcut to create a Meeting with scheduling defaults"],["event","Shortcut to create an Event with scheduling defaults"],["remind","Shortcut to create a Reminder from a point in time"],["templates","Manage reusable create templates"],["completion","Generate shell completion"],["help","Display help for a command"]],p=v.flatMap(e=>[e.short,e.flag,...e.aliases??[]]).filter(e=>!!e).join(" "),st=[...l].join("|"),nt=[...l].map(e=>`${e}=*`).join("|"),it=[...p.split(" ").filter(e=>!l.has(e)),"-h","-V"].join("|");function c(e){return[...new Set(e.map(a=>a.trim()).filter(a=>a.length>0))].sort((a,o)=>a.localeCompare(o)).join(" ")}function ct(e){return[...new Set(e.map(a=>a.trim()).filter(a=>a.length>0))].join(" ")}function rt(e){return e.replaceAll("\\","\\\\").replaceAll('"','\\"').replaceAll("$","\\$").replaceAll("`","\\`")}function lt(e,a){return ct(e.length>0?e:a.item_types??se)}function At(e){return c(e.statuses??ne)}function _t(e,a){const o=[...e.split(/\s+/u).filter(s=>s.length>0),...a??[]];return c(o)}function St(e){const a=(e??[]).map(o=>o.trim()).filter(o=>o.startsWith("--")&&o.length>2).map(o=>`--${o.slice(2).replaceAll("_","-")}`);return[...new Set(a)].sort((o,s)=>o.localeCompare(s))}export{re as AGGREGATE_FLAGS,ie as ALL_COMMANDS,le as APPEND_FLAGS,Se as ATTEST_INVOCATIONS,Ie as CALENDAR_FLAGS,at as CLAIM_MUTATION_FLAGS,Oe as CLOSE_MANY_FLAGS,Ze as CLOSE_MUTATION_FLAGS,et as CLOSE_TASK_MUTATION_FLAGS,ot as COMMAND_COMPLETION_DESCRIPTIONS,ze as COMPLETION_SHELL_CHOICES,Me as CONTEXT_FLAGS,je as CONTRACTS_FLAGS,Ae as COPY_FLAGS,pe as CREATE_FLAGS,Je as DELETE_MUTATION_FLAGS,we as DEPS_FLAGS,De as DUPLICATES_FLAGS,ge as EVENTS_FLAGS,C as EXTENSION_LIFECYCLE_ACTIONS,Xe as EXTENSION_LIFECYCLE_FLAGS,Te as FOCUS_FLAGS,de as GET_FLAGS,nt as GLOBAL_COMPLETION_INLINE_PATTERNS,it as GLOBAL_COMPLETION_SWITCH_PATTERNS,st as GLOBAL_COMPLETION_VALUE_PATTERNS,p as GLOBAL_FLAGS,ke as GRAPH_FLAGS,ye as GUIDE_FLAGS,Ke as GUIDE_TOPIC_CHOICES,He as HEALTH_FLAGS,S as HIDDEN_COMMAND_ALIASES,Re as HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS,fe as HISTORY_FLAGS,Ge as HISTORY_LEAVES,ue as HISTORY_OPERATION_FLAGS,be as INIT_FLAGS,ce as LIST_FLAGS,me as MEET_FLAGS,Qe as MUTATION_FLAGS,Ne as NAMESPACE_NOUNS,T as NAMESPACE_PREFIXES,Pe as NEXT_FLAGS,We as PACKAGE_LIFECYCLE_ACTIONS,$e as PACKAGE_LIFECYCLE_FLAGS,Ye as PLAN_FLAGS,Be as PLAN_SUBCOMMANDS_LIST,tt as RELEASE_MUTATION_FLAGS,Ce as REMIND_FLAGS,_e as RESTORE_INVOCATIONS,Ve as SCHEMA_SUBCOMMAND_CHOICES,ve as SEARCH_FLAGS,Ue as STATS_FLAGS,Le as UPDATE_FLAGS,Ee as UPDATE_MANY_FLAGS,qe as UPGRADE_FLAGS,Fe as completionNamespaceLeaves,At as completionStatusValues,lt as completionTypeValues,c as joinCompletionValues,_t as mergeFlagStrings,St as normalizeRuntimeCompletionFlags,rt as shellDoubleQuote};
1
+ import{BUILTIN_ITEM_TYPE_VALUES as d,STATUS_VALUES as L}from"../../types/index.js";import{listPmCommandsForTier as E,resolvePmCommandVisibilityTier as O}from"../agent-capability-contracts.js";import{AGGREGATE_FLAG_CONTRACTS as N,APPEND_FLAG_CONTRACTS as h,CALENDAR_FLAG_CONTRACTS as G,CLOSE_MANY_FLAG_CONTRACTS as F,COMPLETION_FLAG_CONTRACTS as u,CONTEXT_FLAG_CONTRACTS as f,CONTRACTS_FLAG_CONTRACTS as R,COPY_FLAG_CONTRACTS as g,CREATE_FLAG_CONTRACTS as I,DEPS_FLAG_CONTRACTS as M,DUPLICATES_FLAG_CONTRACTS as P,EVENTS_FLAG_CONTRACTS as w,EXTENSION_FLAG_CONTRACTS as D,FOCUS_FLAG_CONTRACTS as k,GET_FLAG_CONTRACTS as y,GLOBAL_FLAG_CONTRACTS as v,GRAPH_FLAG_CONTRACTS as U,GUIDE_FLAG_CONTRACTS as H,HEALTH_FLAG_CONTRACTS as b,HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS as j,HISTORY_FLAG_CONTRACTS as Y,INIT_FLAG_CONTRACTS as V,LIST_FILTER_FLAG_CONTRACTS as B,MEET_FLAG_CONTRACTS as x,NEXT_FLAG_CONTRACTS as z,PACKAGE_FLAG_CONTRACTS as K,PLAN_FLAG_CONTRACTS as W,PM_COMMAND_ALIAS_CONTRACTS as X,PM_NAMESPACED_COMMAND_ALIASES as i,REMIND_FLAG_CONTRACTS as $,SEARCH_FLAG_CONTRACTS as q,STATS_FLAG_CONTRACTS as Q,UPDATE_FLAG_CONTRACTS as J,UPDATE_MANY_FLAG_CONTRACTS as Z,UPGRADE_FLAG_CONTRACTS as ee,resolvePmCommandOperation as A,resolveSubcommandFlagContractsForCommand as n,toCompletionFlagString as t}from"../cli-contracts.js";import{GLOBAL_VALUE_CONSUMING_FLAGS as l}from"../cli-contracts/bootstrap-command-scanner.js";import{WORKFLOW_POLICY_ACTIONS as te}from"../cli-contracts/enum-contracts.js";import{PM_COMMAND_DESTINATION_CONTRACTS as ae}from"../cli-contracts/grammar-contracts.js";import{enrichCliFlagInvocationContracts as _}from"../flag-invocation-contracts.js";import{listGuideTopicIds as oe}from"../guide-topics.js";const se=[...d],ne=[...L],S=new Set(X.filter(e=>e.hidden).map(e=>e.alias)),ie=E("full").filter(e=>!e.includes(" ")&&!S.has(e)),ce=t(B),re=t(N),le=t(h),Ae=t(g),_e=_("restore",n("restore")),Se=_("history-attest",n("history-attest")),Te=t(k),me=t(x),Ce=t($),pe=t(I),de=t(y),Le=t(J),Ee=t(Z),Oe=t(F),Ne=[...new Set(i.map(e=>e.canonical_argv[0]))],T=[...new Set(i.flatMap(e=>e.canonical_argv.slice(0,-1).map((a,o)=>e.canonical_argv.slice(0,o+1).join(" "))))],he=new Set(ae.filter(e=>e.disposition==="package_owned").map(e=>A(e.command))),m=i.filter(e=>e.canonical_argv[0]==="history"),Ge=m.map(e=>e.canonical_argv[1]).join(" ");function Fe(e){const a=new Set((e.namespace_commands??[]).map(A)),o=i.filter(s=>O(s.canonical)!=="internal"&&(!he.has(s.alias)||a.has(s.alias)));return Object.fromEntries(T.map(s=>[s,[...new Set(o.filter(r=>r.canonical.startsWith(`${s} `)).map(r=>r.canonical_argv[s.split(" ").length]))].join(" ")]))}const ue=m.map(e=>({...e,flags:t(n(e.alias))})),fe=t(Y),Re=t(j,!1),ge=t(w),Ie=t(G),Me=t(f),Pe=t(z),we=t(M),De=t(P),ke=t(U),ye=t(H),ve=t(q),Ue=t(Q),He=t(b),be=t(V),je=t(R),Ye=t(W),Ve=`${te.join(" ")} list show show-status add-type remove-type add-status remove-status add-field remove-field list-fields show-field apply-preset rename-type rename-field remap-status`,Be="create show add-step update-step complete-step block-step reorder-step remove-step link unlink decision discovery validation resume approve materialize",xe=t(u),ze=`${xe} bash zsh fish`,Ke=c(oe()),C="init scaffold install uninstall list inventory explore manage describe reload doctor catalog adopt adopt-all activate deactivate migrate",We=`${C} upgrade`,Xe=t(D),$e=t(K),qe=t(ee),Qe="--author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help",Je="--dry-run --author --message --force --json --quiet --no-changed-fields --id-only --pm-path --path --no-extensions --no-pager --profile --help",Ze=t(n("close")),et=t(n("close-task")),tt=t(n("release")),at=t(n("claim")),ot=[["workspace","Workspace initialization, customization, state and snapshots"],["init","Initialize pm storage for the current workspace"],["config","Read or update pm settings"],["package","Manage package lifecycle operations"],["packages","Alias for package"],["create","Create a new project management item"],["item","Manage item evidence, links, tests, and duplication"],["copy","Copy an existing item to a new ID"],["focus","Set/clear/show the session focused parent for new items"],["list","List active items with optional filters"],["aggregate","Aggregate grouped item counts and numeric stats for governance queries"],["duplicates","Find bounded duplicate clusters across lifecycle statuses"],["guide","Browse local progressive-disclosure guides"],["calendar","Show calendar views for deadlines and reminders"],["cal","Alias for calendar"],["context","Show a token-efficient project context snapshot"],["ctx","Alias for context"],["get","Show item details by ID"],["next","Recommend the next actionable (unblocked, ready) work item"],["search","Search items with keyword, semantic, or hybrid modes"],["reindex","Rebuild search artifacts"],["history","Show item history entries"],["history-compact","Compact history streams into a synthetic baseline + retained tail"],["history-redact","Redact and reseal item history."],["history-repair","Re-anchor a drifted history chain so pm health/validate report ok"],["schema","Manage custom item types and statuses in .agents/pm/schema/*.json"],["profile","List, show, apply, and lint project profiles (archetype schema/config/template/package bundles)"],["plan","Agent-optimized Plan item workflow (create/show/add-step/update-step/complete-step/link/approve/materialize)"],["activity","Show recent activity across items"],["restore","Restore an item to an earlier state"],["update","Update item fields and metadata"],["update-many","Bulk-update matched items with dry-run and rollback checkpoints"],["close","Close an item (reason requirement follows governance settings)"],["close-many","Bulk-close matched items with an optional shared reason and rollback checkpoint"],["delete","Delete an item and record the change"],["append","Append text to an item body"],["comments","List or add comments for an item"],["notes","List or add notes for an item"],["learnings","List or add learnings for an item"],["files","Manage linked files"],["docs","Manage linked docs"],["deps","Show dependency relationships for an item"],["graph","Bounded graph traversal, analytics, and governance-audit queries"],["test","Manage linked tests and optionally run them"],["test-all","Run linked tests across matching items"],["test-runs","Manage background linked-test runs"],["stats","Show project tracker statistics"],["health","Show project tracker health checks"],["validate","Run standalone validation checks"],["gc","Clean optional cache artifacts"],["contracts","Show machine-readable command and schema contracts"],["claim","Claim an item for active work"],["release","Release the active claim for an item"],["start-task","Lifecycle alias to claim and set in_progress"],["pause-task","Lifecycle alias to reopen and release claim"],["close-task","Lifecycle alias to close and release claim"],["meet","Shortcut to create a Meeting with scheduling defaults"],["event","Shortcut to create an Event with scheduling defaults"],["remind","Shortcut to create a Reminder from a point in time"],["templates","Manage reusable create templates"],["completion","Generate shell completion"],["help","Display help for a command"]],p=v.flatMap(e=>[e.short,e.flag,...e.aliases??[]]).filter(e=>!!e).join(" "),st=[...l].join("|"),nt=[...l].map(e=>`${e}=*`).join("|"),it=[...p.split(" ").filter(e=>!l.has(e)),"-h","-V"].join("|");function c(e){return[...new Set(e.map(a=>a.trim()).filter(a=>a.length>0))].sort((a,o)=>a.localeCompare(o)).join(" ")}function ct(e){return[...new Set(e.map(a=>a.trim()).filter(a=>a.length>0))].join(" ")}function rt(e){return e.replaceAll("\\","\\\\").replaceAll('"','\\"').replaceAll("$","\\$").replaceAll("`","\\`")}function lt(e,a){return ct(e.length>0?e:a.item_types??se)}function At(e){return c(e.statuses??ne)}function _t(e,a){const o=[...e.split(/\s+/u).filter(s=>s.length>0),...a??[]];return c(o)}function St(e){const a=(e??[]).map(o=>o.trim()).filter(o=>o.startsWith("--")&&o.length>2).map(o=>`--${o.slice(2).replaceAll("_","-")}`);return[...new Set(a)].sort((o,s)=>o.localeCompare(s))}export{re as AGGREGATE_FLAGS,ie as ALL_COMMANDS,le as APPEND_FLAGS,Se as ATTEST_INVOCATIONS,Ie as CALENDAR_FLAGS,at as CLAIM_MUTATION_FLAGS,Oe as CLOSE_MANY_FLAGS,Ze as CLOSE_MUTATION_FLAGS,et as CLOSE_TASK_MUTATION_FLAGS,ot as COMMAND_COMPLETION_DESCRIPTIONS,ze as COMPLETION_SHELL_CHOICES,Me as CONTEXT_FLAGS,je as CONTRACTS_FLAGS,Ae as COPY_FLAGS,pe as CREATE_FLAGS,Je as DELETE_MUTATION_FLAGS,we as DEPS_FLAGS,De as DUPLICATES_FLAGS,ge as EVENTS_FLAGS,C as EXTENSION_LIFECYCLE_ACTIONS,Xe as EXTENSION_LIFECYCLE_FLAGS,Te as FOCUS_FLAGS,de as GET_FLAGS,nt as GLOBAL_COMPLETION_INLINE_PATTERNS,it as GLOBAL_COMPLETION_SWITCH_PATTERNS,st as GLOBAL_COMPLETION_VALUE_PATTERNS,p as GLOBAL_FLAGS,ke as GRAPH_FLAGS,ye as GUIDE_FLAGS,Ke as GUIDE_TOPIC_CHOICES,He as HEALTH_FLAGS,S as HIDDEN_COMMAND_ALIASES,Re as HISTORY_AUTHOR_ACKNOWLEDGE_FLAGS,fe as HISTORY_FLAGS,Ge as HISTORY_LEAVES,ue as HISTORY_OPERATION_FLAGS,be as INIT_FLAGS,ce as LIST_FLAGS,me as MEET_FLAGS,Qe as MUTATION_FLAGS,Ne as NAMESPACE_NOUNS,T as NAMESPACE_PREFIXES,Pe as NEXT_FLAGS,We as PACKAGE_LIFECYCLE_ACTIONS,$e as PACKAGE_LIFECYCLE_FLAGS,Ye as PLAN_FLAGS,Be as PLAN_SUBCOMMANDS_LIST,tt as RELEASE_MUTATION_FLAGS,Ce as REMIND_FLAGS,_e as RESTORE_INVOCATIONS,Ve as SCHEMA_SUBCOMMAND_CHOICES,ve as SEARCH_FLAGS,Ue as STATS_FLAGS,Le as UPDATE_FLAGS,Ee as UPDATE_MANY_FLAGS,qe as UPGRADE_FLAGS,Fe as completionNamespaceLeaves,At as completionStatusValues,lt as completionTypeValues,c as joinCompletionValues,_t as mergeFlagStrings,St as normalizeRuntimeCompletionFlags,rt as shellDoubleQuote};
2
2
  //# sourceMappingURL=shared.js.map
@@ -1,2 +1,2 @@
1
- import{AsyncLocalStorage as tt}from"node:async_hooks";import{attachExtensionReadOutputRows as et}from"./read-output/extension.js";import{renderPmCommand as P}from"./command-line.js";import{attachOutputOmissionReceipt as nt}from"./output-projection.js";import{encodeQueryCursor as rt}from"./pagination.js";import{applyReadOutputDimensions as ot,decodeReadOutputContinuationCursor as it,isReadResultOmittedForBudget as q,resolveReadOutputSurface as dt,stabilizeReadOutputReceiptEstimates as ut}from"./read-output-contracts.js";import{estimateReadOutputTokens as I,MAX_ESTIMATE_ITERATIONS as st,readOutputMeasurementFormat as T,registerReadOutputPassHooks as at,resolveReadOutputRecoveryBudget as ct}from"./read-output-budget.js";import{propagateContextUsageServingReceipt as E}from"./context-usage.js";import{readOutputContinuationRowCollections as ft}from"./read-output-rows.js";import{EXIT_CODE as R}from"../core/shared/constants.js";import{PmCliError as B}from"../core/shared/errors.js";import{compactExplanatoryString as lt,isContinuationTokenKey as _t,isTrackerItemDocumentKey as gt}from"../core/shared/text-normalization.js";const mt="limit_overridden_by_intent",z=Object.freeze([{command:"context",intent:"orient",description:"Bounded active hierarchy, ownership, blockers, and recent progress.",included_field_groups:["summary","focus","hierarchy","blockers","activity"],token_budget:3e3,source:"core"},{command:"context",intent:"handoff",description:"Active ownership, evidence, decisions, and immediate continuation context.",included_field_groups:["summary","focus","in_progress","decisions","activity"],token_budget:2200,source:"core"},{command:"get",intent:"inspect",description:"Standard-depth item metadata, relationships, evidence, and lifecycle state.",included_field_groups:["item","children","claim_state","linked"],token_budget:3200,source:"core"},{command:"list",intent:"triage",description:"A budget-derived page of compact governance, ownership, priority, and blocker rows for triage.",included_field_groups:["identity","governance","ownership","dependencies"],token_budget:3200,source:"core"},{command:"next",intent:"execute",description:"The highest-ranked actionable work with concise ranking evidence.",included_field_groups:["recommended"],token_budget:1200,source:"core"},{command:"search",intent:"discover",description:"A budget-derived page of ranked canonical lineage candidates with compact match evidence.",included_field_groups:["identity","status","lineage","match"],token_budget:1800,source:"core"}]),U=new tt;function bt(){return U.getStore()??z}function Yt(t,e){return U.run(kt(t.workspaceContracts,t.packageContracts),e)}function ht(t,e){const n=t.command.trim().toLowerCase(),r=t.intent.trim().toLowerCase(),i=`${n}:${r}`;if(!/^[a-z0-9][a-z0-9-]*$/.test(n)||!/^[a-z0-9][a-z0-9-]*$/.test(r))throw new TypeError(`Invalid context intent command or name: ${i}`);if(t.description.trim().length===0)throw new TypeError(`Context intent ${i} requires a non-empty description`);if(!Number.isSafeInteger(t.token_budget)||t.token_budget<=0)throw new TypeError(`Context intent ${i} requires a positive integer token_budget`);const o=[...new Set(t.included_field_groups.map(d=>d.trim()).filter(Boolean))];if(o.length===0)throw new TypeError(`Context intent ${i} requires included_field_groups`);return{command:n,intent:r,description:t.description.trim(),included_field_groups:o,token_budget:t.token_budget,source:e}}function kt(t=[],e=[]){const n=[{source:"core",contracts:z,allowOverride:!1},{source:"package",contracts:e,allowOverride:!1},{source:"workspace",contracts:t,allowOverride:!0}],r=new Map,i=new Set;for(const o of n){i.clear();for(const d of o.contracts){const s=ht(d,o.source),u=`${s.command}:${s.intent}`;if(i.has(u))throw new TypeError(`Duplicate context intent declaration: ${u}`);if(i.add(u),!o.allowOverride&&r.has(u))throw new TypeError(`Duplicate context intent declaration: ${u}`);r.set(u,s)}}return[...r.values()].sort((o,d)=>o.command.localeCompare(d.command)||o.intent.localeCompare(d.intent))}function G(t,e,n=bt(),r=[]){const i=t.trim().toLowerCase(),o=e.trim().toLowerCase(),d=n.find(a=>a.command===i&&a.intent===o);if(d)return{...d,source:d.source??"core"};const s=n.filter(a=>a.command===i).map(a=>a.intent);if(s.length===0)return;const u=s.map(a=>{const f=Array.from({length:o.length+1},(b,g)=>g);for(let b=1;b<=a.length;b+=1){let g=f[0];f[0]=b;for(let h=1;h<=o.length;h+=1){const j=f[h];f[h]=Math.min(f[h]+1,f[h-1]+1,g+(a[b-1]===o[h-1]?0:1)),g=j}}return{candidate:a,distance:f[o.length]}}).sort((a,f)=>a.distance-f.distance||a.candidate.localeCompare(f.candidate))[0].candidate,c=[i,...r,"--for",o],l=[i,...r,"--for",u],_=P(l);throw new B(`Unknown context intent "${o}" for ${i}. Did you mean "${u}"?`,R.USAGE,{code:"unknown_context_intent",reason:"unknown_intent",field:"for",flag:"--for",value:o,required:`Use a declared ${i} intent.`,why:"Intent names are command-local contracts and cannot be inferred from output section names.",nextSteps:[_],recovery:{recovery_mode:"compact",attempted_command:P(c),allowed_values:[...s].sort(),suggested_retry:_,suggested_retry_args:l}})}function A(t,e){const n=k(t.limit),r=String(n===void 0?e:Math.min(n,e));return(t.limit===void 0||n!==void 0)&&(t.limit=r),r}const X={context:(t,e,n,r)=>{t.section===void 0&&t.depth===void 0&&(t.section=e.intent==="handoff"?["activity","progress","blockers"]:["hierarchy","blockers","activity"]),t.depth===void 0&&(t.depth=e.intent==="handoff"?"deep":"standard");const i=v(r,t.tokenBudget,e.token_budget),o=C("context",e.intent,i,n),d=A(t,o);t.activityLimit===void 0&&(t.activityLimit=d)},get:t=>{t.depth===void 0&&t.fields===void 0&&(t.depth="standard")},list:(t,e,n,r)=>{t.brief===void 0&&t.compact===void 0&&t.full===void 0&&t.fields===void 0&&(t.fields="id,title,status,type,priority,parent,assignee,risk,blocked_by");const i=v(r,t.tokenBudget,e.token_budget),o=C("list",e.intent,i,n);A(t,o)},next:t=>{t.readyOnly===void 0&&(t.readyOnly=!0)},search:(t,e,n,r)=>{t.compact===void 0&&t.full===void 0&&t.fields===void 0&&(t.compact=!0);const i=v(r,t.tokenBudget,e.token_budget),o=C("search",e.intent,i,n);A(t,o)}};function Ht(t,e,n=[]){const r=e.tokenBudget??e.token_budget;if(typeof e.for!="string"){if(r!==void 0&&(t==="get"||t==="list"||t==="search"))throw new B("--token-budget requires a declared context intent selected with --for",R.USAGE,{code:"missing_required_option",field:"for",required:"Select a context intent with --for when setting --token-budget.",why:"A token-budget override has no projection contract to constrain without a selected intent.",nextSteps:["Retry with --for <intent> --token-budget <n>, or omit --token-budget."]});if(e.tokenBudget!==void 0||e.token_budget===void 0)return e;const u={...e,tokenBudget:r};return delete u.token_budget,u}const i=G(t,e.for,void 0,n),o=w(e),d=k(r)!==void 0||typeof o=="number",s={...e};return s.tokenBudget===void 0&&r!==void 0&&(s.tokenBudget=r),delete s.token_budget,typeof o=="number"?s.tokenBudget=String(o):s.tokenBudget===void 0&&(s.tokenBudget=String(i.token_budget)),X[t](s,i,d,o),s}const pt={context:"bounded_sections",get:"standard_item",list:"bounded_fields_and_rows",next:"bounded_ranked_rows",search:"bounded_ranked_rows"},x=256;function N(t,e,n=!0,r=!0){return Array.isArray(t)?t.map(i=>N(i,e,n,!1)):t!==null&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([i,o])=>[i,n&&typeof o=="string"&&_t(i)?o:N(o,e,n&&!(r&&gt(e,i)),!1)])):typeof t=="string"?lt(t):t}function k(t){const e=typeof t=="number"?t:typeof t=="string"&&/^\d+$/u.test(t.trim())?Number(t):Number.NaN;return Number.isSafeInteger(e)&&e>0?e:void 0}function w(t){const e=t.outputBudget??t.output_budget;return e==="unbounded"?e:k(e)}function yt(t){return w(t)===void 0?"--token-budget":"--output-budget"}function v(t,e,n){return typeof t=="number"?t:wt(e,n)}function wt(t,e){const n=k(t);if(n===void 0)return e;if(n<x)throw new B(`Context intent token budget must be at least ${x}`,R.USAGE,{code:"invalid_argument_value",reason:"below_minimum",field:"tokenBudget",value:String(t),required:`Use an integer token budget of at least ${x}.`,why:"Smaller ceilings cannot contain the minimum machine-readable intent receipt.",nextSteps:[`Retry with --token-budget ${x} or omit the override.`]});return n}function W(t,e){const n=t==="context"&&e==="orient";return t==="context"?n?{overhead:1200,rowCost:600}:{overhead:800,rowCost:500}:{overhead:t==="list"?520:480,rowCost:16}}function C(t,e,n,r){if(t==="get"||t==="next")return;const{overhead:i,rowCost:o}=W(t,e),d=Math.max(t==="context"?1:2,Math.floor((n-i)/o));return r?d:Math.min(t==="context"?20:100,d)}function p(t,e,n){const r=T(n),i=n.outputRowContract===!0||n.output_row_contract===!0;let o=e.estimated_tokens,d=o;for(let s=0;s<st;s+=1){e.estimated_tokens=o;const u=I(i||!Object.hasOwn(t,"row_contract")?t:Object.fromEntries(Object.entries(t).filter(([c])=>c!=="row_contract")),r);if(u===o)return;o=u,d=Math.max(d,o)}e.estimated_tokens=d}const F={context:["high_level","low_level","blocked_fallback","recently_created","unparented","hierarchy","activity","blockers"],get:["children"],list:["items"],next:["ready","decision_needed","gate_needed","containers","blocked","held_by_others"],search:["items"]};function K(t){try{const e=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return typeof e.fingerprint!="string"||!Number.isSafeInteger(e.after_index)?void 0:{fingerprint:e.fingerprint,after_index:e.after_index,...typeof e.snapshot=="string"?{snapshot:e.snapshot}:{}}}catch{return}}function xt(t){if(t===null||typeof t!="object")return;if(typeof t.id=="string")return t.id;const e=t.item?.id;return typeof e=="string"?e:void 0}function vt(t,e,n,r){let i=!1;for(;;){if(p(t,e,r),e.estimated_tokens<=e.token_budget||n.length<=1)return i;const o=Buffer.byteLength(JSON.stringify(n),"utf8"),d=(e.estimated_tokens-e.token_budget)*4;n.splice(-Math.min(n.length-1,Math.max(1,Math.ceil(d/Math.max(1,Math.ceil(o/n.length)))))),i=!0}}function Ct(t,e,n){const r=t.items,i=typeof t.next_cursor=="string",o=i?t.next_cursor:n.after;if(!Array.isArray(r)||typeof o!="string")return!1;const d=K(o);if(d===void 0)return!1;const s=r.length,u=[...r];let c=!1;for(;;){if(c=vt(t,e,r,n)||c,!c)return!1;const l=xt(r.at(-1));if(l===void 0)return r.splice(0,r.length,...u),p(t,e,n),!1;if(t.next_cursor=rt(d.fingerprint,l,i?d.after_index-(s-r.length):d.after_index+r.length,d.snapshot),p(t,e,n),e.estimated_tokens<=e.token_budget||r.length<=1)break}return typeof t.count=="number"&&(t.count=r.length),typeof t.applied_limit=="number"&&(t.applied_limit=r.length),!0}function Ot(t,e,n,r){if(t==="list"||t==="search")return Ct(e,n,r);if(t!=="next"||typeof e.next_cursor=="string")return!1;let i=!1;for(;;){if(p(e,n,r),n.estimated_tokens<=n.token_budget)return i;const o=F[t].map(a=>({key:a,rows:Array.isArray(e[a])?e[a]:[]})).filter(({rows:a})=>a.length>0).sort((a,f)=>f.rows.length-a.rows.length||a.key.localeCompare(f.key))[0];if(o===void 0)return i;const d=F[t].reduce((a,f)=>a+(Array.isArray(e[f])?e[f].length:0),0);if(d<=1)return i;const s=Math.min(o.rows.length,d-1),u=Buffer.byteLength(JSON.stringify(o.rows),"utf8"),c=Math.max(1,Math.ceil(u/o.rows.length)),l=(n.estimated_tokens-n.token_budget)*4,_=Math.min(s,Math.max(1,Math.ceil(l/c)));o.rows.splice(-_,_),i=!0}}function S(t,e,n){if(typeof e.for!="string")return n;const r=t.startsWith("list-")?"list":t;if(!(r in X))return n;const i=r,o=G(i,e.for),d=w(e),s=v(d,e.tokenBudget??e.token_budget,o.token_budget),u={command:i,intent:o.intent,source:o.source,included_field_groups:[...o.included_field_groups],token_budget:s,declared_token_budget:o.token_budget,token_budget_override:s-o.token_budget,estimated_tokens:0,within_budget:!0,degradation:pt[i],declaration_feasible:!0,result_omitted:!1},c={...n},l=C(i,o.intent,u.token_budget,k(e.tokenBudget??e.token_budget)!==void 0||typeof d=="number");if(l!==void 0){const g=k(e.limit),h=g!==void 0&&g<l;u.budget_derived_limit=l,u.binding_constraint=h?"explicit_limit":"token_budget",u.limit_reason=h?"The caller supplied a smaller row limit than the budget-derived ceiling.":"The selected intent token budget constrains the effective row ceiling.",c.budget_derived_limit=l,Bt({builtInCommand:i,intent:o.intent},u,c,e)}const _=M.get(e)??0,a=u.token_budget;u.token_budget=a-_;const f=d==="unbounded"?$(c,u,e):It(i,c,u,e,dt(t,e));u.declaration_feasible=u.estimated_tokens<=u.declared_token_budget;const b=J(d,u,f,()=>Y(t,i,o.intent,{...u,token_budget:a,estimated_tokens:u.estimated_tokens+_},c,e));return u.result_omitted&&(u.estimated_tokens+=_,u.declaration_feasible=u.estimated_tokens<=u.declared_token_budget),u.token_budget=a,b}function $(t,e,n){const r={...t,context_intent:e};return p(r,e,n),r}function It(t,e,n,r,i){let o=$(e,n,r);return n.estimated_tokens>n.token_budget&&(n.degradation="recursive_budget_compaction",o=$(N(e,i),n,r)),n.estimated_tokens>n.token_budget&&Ot(t,o,n,r)&&(n.degradation="budget_row_compaction",p(o,n,r)),o}const M=new WeakMap;function J(t,e,n,r){return e.estimated_tokens<=e.token_budget||(e.within_budget=!1,t==="unbounded")?n:(e.degradation="budget_receipt_only",e.result_omitted=!0,typeof t=="number"?{output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Unbounded",recovery:{outputBudget:"unbounded"}},context_intent:e}:{budget_exceeded:{omitted_result:!0,reason:e.token_budget_override===0?"declared_budget_infeasible":"effective_budget_infeasible",restore_with:r()},context_intent:e})}const Tt=["applied_limit","completeness","context_intent","count","filters","has_more","now","omission_receipt","projection","row_contract","sorting","total","truncated"];function V(t,e){if(typeof t.after!="string"||t.after.length===0||q(e))return e;const n=K(t.after)?.fingerprint??"opaque_cursor",r={...e};for(const i of Tt)delete r[i];return r.continuation_contract={fingerprint:n,metadata:"reference",restore_with:"omit --after"},r}function m(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Et(t,e){const n=t==="get"&&m(e.item)&&typeof e.item.id=="string"?e.item.id:t==="search"&&typeof e.query=="string"?e.query:void 0;return n===void 0?"":` ${Q(n)}`}function Q(t){return`'${t.replaceAll("'",`'"'"'`)}'`}function Rt(t){return typeof t.fields=="string"&&t.fields.trim()!==""?` --fields ${Q(t.fields)}`:""}function Bt(t,e,n,r){const i=k(r.limit),o=e.budget_derived_limit;if(i===void 0||i<=o)return;const{overhead:d,rowCost:s}=W(t.builtInCommand,t.intent),u=Math.max(e.token_budget,d+s*i);e.limit_reason=`The ${e.token_budget}-token ${t.intent} budget carries ${o} rows, so it reduced the caller's --limit ${i}.`,e.limit_override={flag:"--limit",requested:i,effective:o,...Number.isSafeInteger(u)?{token_budget_for_requested:u,restore_with:`${yt(r)} ${u}`}:{}};const c=`${mt}:--limit ${i}->${o}`;n.warnings=Array.isArray(n.warnings)?[...n.warnings,c]:[c],m(n.filters)&&(n.filters={...n.filters,requested_limit:String(i)})}function Y(t,e,n,r,i,o){const d=Et(e,i),s=e==="get"?"":` --limit ${r.budget_derived_limit??1}`,{output_budget:u}=ct({effective_budget_tokens:r.token_budget,measured_result_tokens:r.estimated_tokens});return`pm ${t}${d}${Rt(o)} --for ${n} --token-budget ${u}${s}`}function y(t,e){if(m(t))return typeof t[e]=="number"?t[e]:void 0}function H(t,e){let n=t;for(let r=0;r<8;r+=1){At(n);const i=y(n.context_intent,"estimated_tokens"),o=y(n.read_output,"estimated_tokens"),d=y(n.read_session,"spent_this_call_tokens");if(m(n.context_intent)&&n.context_intent.result_omitted!==!0&&p(n,n.context_intent,e),n=ut(n,e),y(n.context_intent,"estimated_tokens")===i&&y(n.read_output,"estimated_tokens")===o&&y(n.read_session,"spent_this_call_tokens")===d)break}return n}function At(t){const e=t.context_intent;m(e)&&Number(e.estimated_tokens)>Number(e.token_budget)&&(e.within_budget=!1)}function Nt(t,e){const n=e.context_intent;if(!m(n)||n.result_omitted===!0)return;const r=n.degradation==="recursive_budget_compaction"||n.degradation==="budget_row_compaction",i={...e};for(const o of ft(t)){const d=e[o.path];if(Array.isArray(d)&&Array.isArray(o.value)&&d.length<=o.value.length){const s=o.value.slice(0,d.length);i[o.path]=r?s.map(L):s}}return i}function L(t){return Array.isArray(t)?t.map(L):t!==null&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,L(n)])):t}function Zt(t,e,n){const r=nt(t,et(t??"",n));if(typeof r!="object"||r===null||Array.isArray(r))return E(n,r),r;const i=t??"",o=r,d=S(i,e,o),s=y(d.context_intent,"estimated_tokens"),u=Nt(o,d),c=O(i,e,n,d,u),l=D(e,c,d.context_intent);if(l===void 0)return St(e,c,d)?Mt(i,e,n,o,d,Number(s),u,c):c;const _={...e};M.set(_,l.estimated-Number(s));const a=S(i,_,o),f=Z(i,e,_,n,a,u),b=f===void 0?l:D(e,f,a.context_intent);if(b===void 0)return f;const g={...b.receipt,estimated_tokens:b.estimated};return O(i,{...e,outputCursor:void 0,output_cursor:void 0},n,J(w(e),g,f??c,()=>Y(i,g.command,g.intent,g,o,e)))}function St(t,e,n){const r=n.context_intent;return Object.hasOwn(e,"output_budget_exceeded")&&m(r)&&r.result_omitted!==!0&&$t.has(String(r.command))&&(t.outputInclude??t.output_include)===void 0&&(t.outputSession??t.output_session)===void 0}const $t=new Set(["list","search"]);function Mt(t,e,n,r,i,o,d,s){const u=O(t,{...e,outputBudget:"unbounded"},n,{...i,context_intent:{...i.context_intent}},d),c={...e};M.set(c,I(u,T(e))-o);const l=S(t,c,r),_=Z(t,e,c,n,l,d);return _===void 0||Object.hasOwn(_,"output_budget_exceeded")||D(e,_,l.context_intent)!==void 0?s:_}function Z(t,e,n,r,i,o){return q(i)||Lt(e,i)?void 0:O(t,n,r,i,o)}function Lt(t,e){const n=t.outputCursor??t.output_cursor;if(typeof n!="string")return!1;const r=it(n),i=e[r.path];return Array.isArray(i)&&i.length<=r.offset}function D(t,e,n){const r=m(e.context_intent),i=r?e.context_intent:n;if(!m(i)||i.result_omitted===!0||Object.hasOwn(e,"output_budget_exceeded"))return;const o=i,d=r?o.estimated_tokens:I(e,T(t));return w(t)==="unbounded"||d<=o.token_budget?void 0:{receipt:o,estimated:d}}function Dt(t){return!m(t)||t.result_omitted===!0?{}:{mirrorEstimate:(e,n)=>{m(e.context_intent)&&(e.context_intent.estimated_tokens=n)}}}function O(t,e,n,r,i){const o={...e,outputRowContract:e.outputRowContract===!0||e.output_row_contract===!0};at(o,{...i===void 0?{}:{continuationBinding:V(e,i)},...Dt(r.context_intent)});const d=ot(t,o,V(e,r));if(E(n,d),e.outputRowContract===!0||e.output_row_contract===!0||!Object.hasOwn(d,"row_contract"))return m(d.context_intent)?H(d,e):d;const s=Object.fromEntries(Object.entries(d).filter(([c])=>c!=="row_contract"));Object.defineProperty(s,"row_contract",{value:d.row_contract,enumerable:!1,configurable:!0});const u=H(s,e);return delete u.row_contract,E(d,u),u}export{mt as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,z as PM_CONTEXT_INTENT_CONTRACTS,Ht as applyContextIntentProjection,S as attachContextIntentReceipt,Zt as attachReadOutputContracts,kt as composeContextIntentContracts,xt as contextIntentRowId,K as decodeContextIntentCursor,bt as getActiveContextIntentContracts,G as resolveContextIntentContract,Yt as runWithContextIntentContracts};
1
+ import{AsyncLocalStorage as tt}from"node:async_hooks";import{attachExtensionReadOutputRows as et}from"./read-output/extension.js";import{quoteCommandArg as I,renderPmCommand as q}from"./command-line.js";import{attachOutputOmissionReceipt as nt}from"./output-projection.js";import{encodeQueryCursor as rt}from"./pagination.js";import{applyReadOutputDimensions as ot,decodeReadOutputContinuationCursor as it,isReadResultOmittedForBudget as z,resolveReadOutputSurface as dt,stabilizeReadOutputReceiptEstimates as ut}from"./read-output-contracts.js";import{estimateReadOutputTokens as T,MAX_ESTIMATE_ITERATIONS as st,readOutputMeasurementFormat as E,registerReadOutputPassHooks as at,resolveReadOutputRecoveryBudget as ct}from"./read-output-budget.js";import{propagateContextUsageServingReceipt as R}from"./context-usage.js";import{readOutputContinuationRowCollections as ft}from"./read-output-rows.js";import{EXIT_CODE as B}from"../core/shared/constants.js";import{PmCliError as A}from"../core/shared/errors.js";import{compactExplanatoryString as lt,isContinuationTokenKey as _t,isTrackerItemDocumentKey as gt}from"../core/shared/text-normalization.js";const mt="limit_overridden_by_intent",U=Object.freeze([{command:"context",intent:"orient",description:"Bounded active hierarchy, ownership, blockers, and recent progress.",included_field_groups:["summary","focus","hierarchy","blockers","activity"],token_budget:3e3,source:"core"},{command:"context",intent:"handoff",description:"Active ownership, evidence, decisions, and immediate continuation context.",included_field_groups:["summary","focus","in_progress","decisions","activity"],token_budget:2200,source:"core"},{command:"get",intent:"inspect",description:"Standard-depth item metadata, relationships, evidence, and lifecycle state.",included_field_groups:["item","children","claim_state","linked"],token_budget:3200,source:"core"},{command:"list",intent:"triage",description:"A budget-derived page of compact governance, ownership, priority, and blocker rows for triage.",included_field_groups:["identity","governance","ownership","dependencies"],token_budget:3200,source:"core"},{command:"next",intent:"execute",description:"The highest-ranked actionable work with concise ranking evidence.",included_field_groups:["recommended"],token_budget:1200,source:"core"},{command:"search",intent:"discover",description:"A budget-derived page of ranked canonical lineage candidates with compact match evidence.",included_field_groups:["identity","status","lineage","match"],token_budget:1800,source:"core"}]),G=new tt;function bt(){return G.getStore()??U}function Ht(t,e){return G.run(kt(t.workspaceContracts,t.packageContracts),e)}function ht(t,e){const n=t.command.trim().toLowerCase(),r=t.intent.trim().toLowerCase(),i=`${n}:${r}`;if(!/^[a-z0-9][a-z0-9-]*$/.test(n)||!/^[a-z0-9][a-z0-9-]*$/.test(r))throw new TypeError(`Invalid context intent command or name: ${i}`);if(t.description.trim().length===0)throw new TypeError(`Context intent ${i} requires a non-empty description`);if(!Number.isSafeInteger(t.token_budget)||t.token_budget<=0)throw new TypeError(`Context intent ${i} requires a positive integer token_budget`);const o=[...new Set(t.included_field_groups.map(d=>d.trim()).filter(Boolean))];if(o.length===0)throw new TypeError(`Context intent ${i} requires included_field_groups`);return{command:n,intent:r,description:t.description.trim(),included_field_groups:o,token_budget:t.token_budget,source:e}}function kt(t=[],e=[]){const n=[{source:"core",contracts:U,allowOverride:!1},{source:"package",contracts:e,allowOverride:!1},{source:"workspace",contracts:t,allowOverride:!0}],r=new Map,i=new Set;for(const o of n){i.clear();for(const d of o.contracts){const s=ht(d,o.source),u=`${s.command}:${s.intent}`;if(i.has(u))throw new TypeError(`Duplicate context intent declaration: ${u}`);if(i.add(u),!o.allowOverride&&r.has(u))throw new TypeError(`Duplicate context intent declaration: ${u}`);r.set(u,s)}}return[...r.values()].sort((o,d)=>o.command.localeCompare(d.command)||o.intent.localeCompare(d.intent))}function X(t,e,n=bt(),r=[]){const i=t.trim().toLowerCase(),o=e.trim().toLowerCase(),d=n.find(a=>a.command===i&&a.intent===o);if(d)return{...d,source:d.source??"core"};const s=n.filter(a=>a.command===i).map(a=>a.intent);if(s.length===0)return;const u=s.map(a=>{const f=Array.from({length:o.length+1},(b,g)=>g);for(let b=1;b<=a.length;b+=1){let g=f[0];f[0]=b;for(let h=1;h<=o.length;h+=1){const j=f[h];f[h]=Math.min(f[h]+1,f[h-1]+1,g+(a[b-1]===o[h-1]?0:1)),g=j}}return{candidate:a,distance:f[o.length]}}).sort((a,f)=>a.distance-f.distance||a.candidate.localeCompare(f.candidate))[0].candidate,c=[i,...r,"--for",o],l=[i,...r,"--for",u],_=q(l);throw new A(`Unknown context intent "${o}" for ${i}. Did you mean "${u}"?`,B.USAGE,{code:"unknown_context_intent",reason:"unknown_intent",field:"for",flag:"--for",value:o,required:`Use a declared ${i} intent.`,why:"Intent names are command-local contracts and cannot be inferred from output section names.",nextSteps:[_],recovery:{recovery_mode:"compact",attempted_command:q(c),allowed_values:[...s].sort(),suggested_retry:_,suggested_retry_args:l}})}function N(t,e){const n=k(t.limit),r=String(n===void 0?e:Math.min(n,e));return(t.limit===void 0||n!==void 0)&&(t.limit=r),r}const W={context:(t,e,n,r)=>{t.section===void 0&&t.depth===void 0&&(t.section=e.intent==="handoff"?["activity","progress","blockers"]:["hierarchy","blockers","activity"]),t.depth===void 0&&(t.depth=e.intent==="handoff"?"deep":"standard");const i=C(r,t.tokenBudget,e.token_budget),o=v("context",e.intent,i,n),d=N(t,o);t.activityLimit===void 0&&(t.activityLimit=d)},get:t=>{t.depth===void 0&&t.fields===void 0&&(t.depth="standard")},list:(t,e,n,r)=>{t.brief===void 0&&t.compact===void 0&&t.full===void 0&&t.fields===void 0&&(t.fields="id,title,status,type,priority,parent,assignee,risk,blocked_by");const i=C(r,t.tokenBudget,e.token_budget),o=v("list",e.intent,i,n);N(t,o)},next:t=>{t.readyOnly===void 0&&(t.readyOnly=!0)},search:(t,e,n,r)=>{t.compact===void 0&&t.full===void 0&&t.fields===void 0&&(t.compact=!0);const i=C(r,t.tokenBudget,e.token_budget),o=v("search",e.intent,i,n);N(t,o)}};function Qt(t,e,n=[]){const r=e.tokenBudget??e.token_budget;if(typeof e.for!="string"){if(r!==void 0&&(t==="get"||t==="list"||t==="search"))throw new A("--token-budget requires a declared context intent selected with --for",B.USAGE,{code:"missing_required_option",field:"for",required:"Select a context intent with --for when setting --token-budget.",why:"A token-budget override has no projection contract to constrain without a selected intent.",nextSteps:["Retry with --for <intent> --token-budget <n>, or omit --token-budget."]});if(e.tokenBudget!==void 0||e.token_budget===void 0)return e;const u={...e,tokenBudget:r};return delete u.token_budget,u}const i=X(t,e.for,void 0,n),o=w(e),d=k(r)!==void 0||typeof o=="number",s={...e};return s.tokenBudget===void 0&&r!==void 0&&(s.tokenBudget=r),delete s.token_budget,typeof o=="number"?s.tokenBudget=String(o):s.tokenBudget===void 0&&(s.tokenBudget=String(i.token_budget)),W[t](s,i,d,o),s}const pt={context:"bounded_sections",get:"standard_item",list:"bounded_fields_and_rows",next:"bounded_ranked_rows",search:"bounded_ranked_rows"},x=256;function S(t,e,n=!0,r=!0){return Array.isArray(t)?t.map(i=>S(i,e,n,!1)):t!==null&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([i,o])=>[i,n&&typeof o=="string"&&_t(i)?o:S(o,e,n&&!(r&&gt(e,i)),!1)])):typeof t=="string"?lt(t):t}function k(t){const e=typeof t=="number"?t:typeof t=="string"&&/^\d+$/u.test(t.trim())?Number(t):Number.NaN;return Number.isSafeInteger(e)&&e>0?e:void 0}function w(t){const e=t.outputBudget??t.output_budget;return e==="unbounded"?e:k(e)}function yt(t){return w(t)===void 0?"--token-budget":"--output-budget"}function C(t,e,n){return typeof t=="number"?t:wt(e,n)}function wt(t,e){const n=k(t);if(n===void 0)return e;if(n<x)throw new A(`Context intent token budget must be at least ${x}`,B.USAGE,{code:"invalid_argument_value",reason:"below_minimum",field:"tokenBudget",value:String(t),required:`Use an integer token budget of at least ${x}.`,why:"Smaller ceilings cannot contain the minimum machine-readable intent receipt.",nextSteps:[`Retry with --token-budget ${x} or omit the override.`]});return n}function F(t,e){const n=t==="context"&&e==="orient";return t==="context"?n?{overhead:1200,rowCost:600}:{overhead:800,rowCost:500}:{overhead:t==="list"?520:480,rowCost:16}}function v(t,e,n,r){if(t==="get"||t==="next")return;const{overhead:i,rowCost:o}=F(t,e),d=Math.max(t==="context"?1:2,Math.floor((n-i)/o));return r?d:Math.min(t==="context"?20:100,d)}function p(t,e,n){const r=E(n),i=n.outputRowContract===!0||n.output_row_contract===!0;let o=e.estimated_tokens,d=o;for(let s=0;s<st;s+=1){e.estimated_tokens=o;const u=T(i||!Object.hasOwn(t,"row_contract")?t:Object.fromEntries(Object.entries(t).filter(([c])=>c!=="row_contract")),r);if(u===o)return;o=u,d=Math.max(d,o)}e.estimated_tokens=d}const K={context:["high_level","low_level","blocked_fallback","recently_created","unparented","hierarchy","activity","blockers"],get:["children"],list:["items"],next:["ready","decision_needed","gate_needed","containers","blocked","held_by_others"],search:["items"]};function J(t){try{const e=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return typeof e.fingerprint!="string"||!Number.isSafeInteger(e.after_index)?void 0:{fingerprint:e.fingerprint,after_index:e.after_index,...typeof e.snapshot=="string"?{snapshot:e.snapshot}:{}}}catch{return}}function xt(t){if(t===null||typeof t!="object")return;if(typeof t.id=="string")return t.id;const e=t.item?.id;return typeof e=="string"?e:void 0}function Ct(t,e,n,r){let i=!1;for(;;){if(p(t,e,r),e.estimated_tokens<=e.token_budget||n.length<=1)return i;const o=Buffer.byteLength(JSON.stringify(n),"utf8"),d=(e.estimated_tokens-e.token_budget)*4;n.splice(-Math.min(n.length-1,Math.max(1,Math.ceil(d/Math.max(1,Math.ceil(o/n.length)))))),i=!0}}function vt(t,e,n){const r=t.items,i=typeof t.next_cursor=="string",o=i?t.next_cursor:n.after;if(!Array.isArray(r)||typeof o!="string")return!1;const d=J(o);if(d===void 0)return!1;const s=r.length,u=[...r];let c=!1;for(;;){if(c=Ct(t,e,r,n)||c,!c)return!1;const l=xt(r.at(-1));if(l===void 0)return r.splice(0,r.length,...u),p(t,e,n),!1;if(t.next_cursor=rt(d.fingerprint,l,i?d.after_index-(s-r.length):d.after_index+r.length,d.snapshot),p(t,e,n),e.estimated_tokens<=e.token_budget||r.length<=1)break}return typeof t.count=="number"&&(t.count=r.length),typeof t.applied_limit=="number"&&(t.applied_limit=r.length),!0}function Ot(t,e,n,r){if(t==="list"||t==="search")return vt(e,n,r);if(t!=="next"||typeof e.next_cursor=="string")return!1;let i=!1;for(;;){if(p(e,n,r),n.estimated_tokens<=n.token_budget)return i;const o=K[t].map(a=>({key:a,rows:Array.isArray(e[a])?e[a]:[]})).filter(({rows:a})=>a.length>0).sort((a,f)=>f.rows.length-a.rows.length||a.key.localeCompare(f.key))[0];if(o===void 0)return i;const d=K[t].reduce((a,f)=>a+(Array.isArray(e[f])?e[f].length:0),0);if(d<=1)return i;const s=Math.min(o.rows.length,d-1),u=Buffer.byteLength(JSON.stringify(o.rows),"utf8"),c=Math.max(1,Math.ceil(u/o.rows.length)),l=(n.estimated_tokens-n.token_budget)*4,_=Math.min(s,Math.max(1,Math.ceil(l/c)));o.rows.splice(-_,_),i=!0}}function $(t,e,n){if(typeof e.for!="string")return n;const r=t.startsWith("list-")?"list":t;if(!(r in W))return n;const i=r,o=X(i,e.for),d=w(e),s=C(d,e.tokenBudget??e.token_budget,o.token_budget),u={command:i,intent:o.intent,source:o.source,included_field_groups:[...o.included_field_groups],token_budget:s,declared_token_budget:o.token_budget,token_budget_override:s-o.token_budget,estimated_tokens:0,within_budget:!0,degradation:pt[i],declaration_feasible:!0,result_omitted:!1},c={...n},l=v(i,o.intent,u.token_budget,k(e.tokenBudget??e.token_budget)!==void 0||typeof d=="number");if(l!==void 0){const g=k(e.limit),h=g!==void 0&&g<l;u.budget_derived_limit=l,u.binding_constraint=h?"explicit_limit":"token_budget",u.limit_reason=h?"The caller supplied a smaller row limit than the budget-derived ceiling.":"The selected intent token budget constrains the effective row ceiling.",c.budget_derived_limit=l,Bt({builtInCommand:i,intent:o.intent},u,c,e)}const _=L.get(e)??0,a=u.token_budget;u.token_budget=a-_;const f=d==="unbounded"?M(c,u,e):It(i,c,u,e,dt(t,e));u.declaration_feasible=u.estimated_tokens<=u.declared_token_budget;const b=V(d,u,f,()=>H(t,i,o.intent,{...u,token_budget:a,estimated_tokens:u.estimated_tokens+_},c,e));return u.result_omitted&&(u.estimated_tokens+=_,u.declaration_feasible=u.estimated_tokens<=u.declared_token_budget),u.token_budget=a,b}function M(t,e,n){const r={...t,context_intent:e};return p(r,e,n),r}function It(t,e,n,r,i){let o=M(e,n,r);return n.estimated_tokens>n.token_budget&&(n.degradation="recursive_budget_compaction",o=M(S(e,i),n,r)),n.estimated_tokens>n.token_budget&&Ot(t,o,n,r)&&(n.degradation="budget_row_compaction",p(o,n,r)),o}const L=new WeakMap;function V(t,e,n,r){return e.estimated_tokens<=e.token_budget||(e.within_budget=!1,t==="unbounded")?n:(e.degradation="budget_receipt_only",e.result_omitted=!0,typeof t=="number"?{output_budget_exceeded:{omitted_result:!0,reason:"requested_budget_infeasible",restore_with:"Unbounded",recovery:{outputBudget:"unbounded"}},context_intent:e}:{budget_exceeded:{omitted_result:!0,reason:e.token_budget_override===0?"declared_budget_infeasible":"effective_budget_infeasible",restore_with:r()},context_intent:e})}const Tt=["applied_limit","completeness","context_intent","count","filters","has_more","now","omission_receipt","projection","row_contract","sorting","total","truncated"];function Y(t,e){if(typeof t.after!="string"||t.after.length===0||z(e))return e;const n=J(t.after)?.fingerprint??"opaque_cursor",r={...e};for(const i of Tt)delete r[i];return r.continuation_contract={fingerprint:n,metadata:"reference",restore_with:"omit --after"},r}function m(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Et(t,e){const n=t==="get"&&m(e.item)&&typeof e.item.id=="string"?e.item.id:t==="search"&&typeof e.query=="string"?e.query:void 0;return n===void 0?"":` ${I(n)}`}function Rt(t){return typeof t.fields=="string"&&t.fields.trim()!==""?` --fields ${I(t.fields)}`:""}function Bt(t,e,n,r){const i=k(r.limit),o=e.budget_derived_limit;if(i===void 0||i<=o)return;const{overhead:d,rowCost:s}=F(t.builtInCommand,t.intent),u=Math.max(e.token_budget,d+s*i);e.limit_reason=`The ${e.token_budget}-token ${t.intent} budget carries ${o} rows, so it reduced the caller's --limit ${i}.`,e.limit_override={flag:"--limit",requested:i,effective:o,...Number.isSafeInteger(u)?{token_budget_for_requested:u,restore_with:`${yt(r)} ${u}`}:{}};const c=`${mt}:--limit ${i}->${o}`;n.warnings=Array.isArray(n.warnings)?[...n.warnings,c]:[c],m(n.filters)&&(n.filters={...n.filters,requested_limit:String(i)})}function H(t,e,n,r,i,o){const d=Et(e,i),s=e==="get"?"":` --limit ${r.budget_derived_limit??1}`,{output_budget:u}=ct({effective_budget_tokens:r.token_budget,measured_result_tokens:r.estimated_tokens});return`pm ${t}${d}${Rt(o)} --for ${I(n)} --token-budget ${u}${s}`}function y(t,e){if(m(t))return typeof t[e]=="number"?t[e]:void 0}function Q(t,e){let n=t;for(let r=0;r<8;r+=1){At(n);const i=y(n.context_intent,"estimated_tokens"),o=y(n.read_output,"estimated_tokens"),d=y(n.read_session,"spent_this_call_tokens");if(m(n.context_intent)&&n.context_intent.result_omitted!==!0&&p(n,n.context_intent,e),n=ut(n,e),y(n.context_intent,"estimated_tokens")===i&&y(n.read_output,"estimated_tokens")===o&&y(n.read_session,"spent_this_call_tokens")===d)break}return n}function At(t){const e=t.context_intent;m(e)&&Number(e.estimated_tokens)>Number(e.token_budget)&&(e.within_budget=!1)}function Nt(t,e){const n=e.context_intent;if(!m(n)||n.result_omitted===!0)return;const r=n.degradation==="recursive_budget_compaction"||n.degradation==="budget_row_compaction",i={...e};for(const o of ft(t)){const d=e[o.path];if(Array.isArray(d)&&Array.isArray(o.value)&&d.length<=o.value.length){const s=o.value.slice(0,d.length);i[o.path]=r?s.map(D):s}}return i}function D(t){return Array.isArray(t)?t.map(D):t!==null&&typeof t=="object"?Object.fromEntries(Object.entries(t).map(([e,n])=>[e,D(n)])):t}function Zt(t,e,n){const r=nt(t,et(t??"",n));if(typeof r!="object"||r===null||Array.isArray(r))return R(n,r),r;const i=t??"",o=r,d=$(i,e,o),s=y(d.context_intent,"estimated_tokens"),u=Nt(o,d),c=O(i,e,n,d,u),l=P(e,c,d.context_intent);if(l===void 0)return St(e,c,d)?Mt(i,e,n,o,d,Number(s),u,c):c;const _={...e};L.set(_,l.estimated-Number(s));const a=$(i,_,o),f=Z(i,e,_,n,a,u),b=f===void 0?l:P(e,f,a.context_intent);if(b===void 0)return f;const g={...b.receipt,estimated_tokens:b.estimated};return O(i,{...e,outputCursor:void 0,output_cursor:void 0},n,V(w(e),g,f??c,()=>H(i,g.command,g.intent,g,o,e)))}function St(t,e,n){const r=n.context_intent;return Object.hasOwn(e,"output_budget_exceeded")&&m(r)&&r.result_omitted!==!0&&$t.has(String(r.command))&&(t.outputInclude??t.output_include)===void 0&&(t.outputSession??t.output_session)===void 0}const $t=new Set(["list","search"]);function Mt(t,e,n,r,i,o,d,s){const u=O(t,{...e,outputBudget:"unbounded"},n,{...i,context_intent:{...i.context_intent}},d),c={...e};L.set(c,T(u,E(e))-o);const l=$(t,c,r),_=Z(t,e,c,n,l,d);return _===void 0||Object.hasOwn(_,"output_budget_exceeded")||P(e,_,l.context_intent)!==void 0?s:_}function Z(t,e,n,r,i,o){return z(i)||Lt(e,i)?void 0:O(t,n,r,i,o)}function Lt(t,e){const n=t.outputCursor??t.output_cursor;if(typeof n!="string")return!1;const r=it(n),i=e[r.path];return Array.isArray(i)&&i.length<=r.offset}function P(t,e,n){const r=m(e.context_intent),i=r?e.context_intent:n;if(!m(i)||i.result_omitted===!0||Object.hasOwn(e,"output_budget_exceeded"))return;const o=i,d=r?o.estimated_tokens:T(e,E(t));return w(t)==="unbounded"||d<=o.token_budget?void 0:{receipt:o,estimated:d}}function Dt(t){return!m(t)||t.result_omitted===!0?{}:{mirrorEstimate:(e,n)=>{m(e.context_intent)&&(e.context_intent.estimated_tokens=n)}}}function O(t,e,n,r,i){const o={...e,outputRowContract:e.outputRowContract===!0||e.output_row_contract===!0};at(o,{...i===void 0?{}:{continuationBinding:Y(e,i)},...Dt(r.context_intent)});const d=ot(t,o,Y(e,r));if(R(n,d),e.outputRowContract===!0||e.output_row_contract===!0||!Object.hasOwn(d,"row_contract"))return m(d.context_intent)?Q(d,e):d;const s=Object.fromEntries(Object.entries(d).filter(([c])=>c!=="row_contract"));Object.defineProperty(s,"row_contract",{value:d.row_contract,enumerable:!1,configurable:!0});const u=Q(s,e);return delete u.row_contract,R(d,u),u}export{mt as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,U as PM_CONTEXT_INTENT_CONTRACTS,Qt as applyContextIntentProjection,$ as attachContextIntentReceipt,Zt as attachReadOutputContracts,kt as composeContextIntentContracts,xt as contextIntentRowId,J as decodeContextIntentCursor,bt as getActiveContextIntentContracts,X as resolveContextIntentContract,Ht as runWithContextIntentContracts};
2
2
  //# sourceMappingURL=context-intent-contracts.js.map
@@ -1,2 +1,2 @@
1
- import j from"node:fs/promises";import c from"node:path";import{collectPackageExtensionDirectories as S,PM_PACKAGE_RESOURCE_KINDS as A,readPmPackageManifest as _}from"../../core/packages/manifest.js";import{resolvePmPackageRootFromModule as B}from"../../core/packages/root.js";import{pathExists as u}from"../../core/fs/fs-utils.js";import{EXIT_CODE as P}from"../../core/shared/constants.js";import{PmCliError as h}from"../../core/shared/errors.js";import{splitCommaList as D}from"../../core/shared/split-comma-list.js";import{resolveExtensionRoots as G}from"../../core/extensions/loader.js";import{resolvePmRoot as M}from"../../core/store/paths.js";import{validateExtensionDirectory as O}from"./shared.js";import{readManagedExtensionState as T}from"./managed-state.js";const I="PM_CLI_PACKAGE_ROOT",C={beads:{package_directory:"pm-beads",legacy_extension_directory:"beads"},todos:{package_directory:"pm-todos",legacy_extension_directory:"todos"}},N=new Set(["*","all"]);function f(){const a=[],e=process.env[I];return typeof e=="string"&&e.trim().length>0&&a.push(c.resolve(e.trim())),a.push(B(import.meta.url,["../../.."])),[...new Set(a)]}async function K(a){const e=a.trim().toLowerCase(),o=await v(e);if(o)return o;const t=C[e];if(!t)return null;for(const r of f()){const i=c.join(r,".agents","pm","extensions",t.legacy_extension_directory);if(await u(c.join(i,"manifest.json")))return i}return null}function na(a){return N.has(a.trim().toLowerCase())}function U(a){return a.replace(/^pm-/i,"").trim().toLowerCase()}async function F(a,e){const o=await j.readdir(a,{withFileTypes:!0});for(const t of o){if(!t.isDirectory()||!t.name.startsWith("pm-"))continue;const r=c.join(a,t.name);if(!await u(c.join(r,"package.json")))continue;const i=await _(r),l=i.aliases&&i.aliases.length>0?i.aliases:[U(t.name)];for(const p of l){const s=p.trim().toLowerCase();s.length===0||e.has(s)||e.set(s,{alias:s,package_directory:t.name,package_root:r,package_name:i.package_name??null})}}}async function y(){const a=new Map;for(const e of f()){const o=c.join(e,"packages");await u(o)&&await F(o,a)}for(const[e,o]of Object.entries(C))if(!a.has(e))for(const t of f()){const r=c.join(t,"packages",o.package_directory);if(await u(c.join(r,"package.json"))){a.set(e,{alias:e,package_directory:o.package_directory,package_root:r,package_name:null});break}}return[...a.values()].sort((e,o)=>e.alias.localeCompare(o.alias))}async function sa(){return(await y()).map(a=>a.alias)}async function v(a){const e=a.trim().toLowerCase();return(await y()).find(t=>t.alias===e||t.package_directory.toLowerCase()===e||t.package_name?.toLowerCase()===e)?.package_root??null}async function ra(a){const e=await v(a);return e?(await _(e)).package_name??null:null}async function ia(a){const e=await K(a);if(!e)return null;try{const o=await S(e);return o.length!==1?null:(await O(o[0])).manifest.name}catch{return null}}function $(a){return{docs:a.catalog?.links?.docs??a.package_homepage,npm:a.catalog?.links?.npm??(a.package_name&&a.package_private!==!0?`https://www.npmjs.com/package/${encodeURIComponent(a.package_name)}`:void 0),repository:a.catalog?.links?.repository??a.package_repository_url,report:a.catalog?.links?.report??a.package_bugs_url}}function z(a,e,o,t,r,i){const l=t==="global"?"--global":"--project",p=Object.fromEntries(A.filter(s=>s!=="extensions").map(s=>[s,a.resources[s]??[]]).filter(([,s])=>Array.isArray(s)&&s.length>0));return{alias:e.alias,aliases:o,bundled:!0,available:!0,installed:o.some(s=>r.has(s))||i.has(c.resolve(e.package_root)),install_target:e.alias,install_command:`pm install ${e.alias} ${l}`,package_name:a.package_name,package_version:a.package_version,description:a.catalog?.summary??a.package_description,keywords:a.package_keywords??[],resources:a.resources,installable_resources:{extensions:a.resources.extensions??[]},metadata_only_resources:p,catalog:{display_name:a.catalog?.display_name,category:a.catalog?.category,tags:a.catalog?.tags??a.package_keywords??[],links:$(a),media:a.catalog?.media}}}async function ca(a,e,o={}){const t=G(M(process.cwd(),e.path),process.cwd()),r=a==="global"?t.global:t.project,i=await T(r),l=new Set(i.state.entries.filter(n=>n.scope===a).filter(n=>n.source.kind!=="builtin").map(n=>c.resolve(n.source.location))),p=new Set(i.state.entries.filter(n=>n.scope===a&&n.source.kind==="builtin").flatMap(n=>[n.source.name,n.source.input,n.source.location]).filter(n=>typeof n=="string"&&n.trim().length>0).map(n=>n.trim().toLowerCase())),s=[],m=new Map;for(const n of await y()){const g=c.resolve(n.package_root),d=m.get(g)??[];d.push(n),m.set(g,d)}for(const n of m.values()){const g=n[0],d=n.map(k=>k.alias).sort((k,L)=>k.localeCompare(L)),R=await _(g.package_root);s.push(z(R,g,d,a,p,l))}const w=x(o.fields),E=w?s.map(n=>b(n,w)):s;return{total:E.length,scope:a,installable_resource_kinds:["extensions"],metadata_only_resource_kinds:A.filter(n=>n!=="extensions"),packages:E}}const Y=new Set(["alias","aliases","bundled","available","installed","install_target","install_command","package_name","package_version","description","keywords","resources","installable_resources","metadata_only_resources","catalog","category","display_name"]);function x(a){if(a===void 0)return;const e=D(a);if(e.length===0)throw new h("Package catalog --fields requires a comma-separated list of field names",P.USAGE);const o=e.filter(t=>!Y.has(t));if(o.length>0)throw new h(`Unknown package catalog --fields value(s): ${o.join(", ")}`,P.USAGE,{examples:["pm package list --project --fields alias,installed,install_command","pm package catalog --project --fields alias,package_name,category"]});return e}function b(a,e){const o={};for(const t of e)t==="category"?o[t]=a.catalog?.category??null:t==="display_name"?o[t]=a.catalog?.display_name??null:o[t]=a[t]??null;return o}const la={parsePackageCatalogFields:x,projectPackageCatalogEntry:b};export{la as _testOnlyBundledCatalog,ca as buildBundledPackageCatalog,na as isBundledPackageInstallAllTarget,sa as listBundledPackageAliases,ia as resolveBundledAliasManifestName,K as resolveBundledExtensionAliasSource,ra as resolveBundledPackageNpmName,v as resolveBundledPackageRoot};
1
+ import R from"node:fs/promises";import i from"node:path";import{collectPackageExtensionDirectories as L,PM_PACKAGE_RESOURCE_KINDS as P,readPmPackageManifest as k}from"../../core/packages/manifest.js";import{resolvePmPackageRootFromModule as j}from"../../core/packages/root.js";import{pathExists as d}from"../../core/fs/fs-utils.js";import{parseListingFields as S}from"./listing-fields.js";import{resolveExtensionRoots as B}from"../../core/extensions/loader.js";import{resolvePmRoot as M}from"../../core/store/paths.js";import{validateExtensionDirectory as D}from"./shared.js";import{readManagedExtensionState as O}from"./managed-state.js";const G="PM_CLI_PACKAGE_ROOT",E={beads:{package_directory:"pm-beads",legacy_extension_directory:"beads"},todos:{package_directory:"pm-todos",legacy_extension_directory:"todos"}},N=new Set(["*","all"]);function f(){const a=[],e=process.env[G];return typeof e=="string"&&e.trim().length>0&&a.push(i.resolve(e.trim())),a.push(j(import.meta.url,["../../.."])),[...new Set(a)]}async function T(a){const e=a.trim().toLowerCase(),o=await C(e);if(o)return o;const t=E[e];if(!t)return null;for(const r of f()){const c=i.join(r,".agents","pm","extensions",t.legacy_extension_directory);if(await d(i.join(c,"manifest.json")))return c}return null}function aa(a){return N.has(a.trim().toLowerCase())}function I(a){return a.replace(/^pm-/i,"").trim().toLowerCase()}async function K(a,e){const o=await R.readdir(a,{withFileTypes:!0});for(const t of o){if(!t.isDirectory()||!t.name.startsWith("pm-"))continue;const r=i.join(a,t.name);if(!await d(i.join(r,"package.json")))continue;const c=await k(r),l=c.aliases&&c.aliases.length>0?c.aliases:[I(t.name)];for(const p of l){const s=p.trim().toLowerCase();s.length===0||e.has(s)||e.set(s,{alias:s,package_directory:t.name,package_root:r,package_name:c.package_name??null})}}}async function y(){const a=new Map;for(const e of f()){const o=i.join(e,"packages");await d(o)&&await K(o,a)}for(const[e,o]of Object.entries(E))if(!a.has(e))for(const t of f()){const r=i.join(t,"packages",o.package_directory);if(await d(i.join(r,"package.json"))){a.set(e,{alias:e,package_directory:o.package_directory,package_root:r,package_name:null});break}}return[...a.values()].sort((e,o)=>e.alias.localeCompare(o.alias))}async function ea(){return(await y()).map(a=>a.alias)}async function C(a){const e=a.trim().toLowerCase();return(await y()).find(t=>t.alias===e||t.package_directory.toLowerCase()===e||t.package_name?.toLowerCase()===e)?.package_root??null}async function oa(a){const e=await C(a);return e?(await k(e)).package_name??null:null}async function ta(a){const e=await T(a);if(!e)return null;try{const o=await L(e);return o.length!==1?null:(await D(o[0])).manifest.name}catch{return null}}function F(a){return{docs:a.catalog?.links?.docs??a.package_homepage,npm:a.catalog?.links?.npm??(a.package_name&&a.package_private!==!0?`https://www.npmjs.com/package/${encodeURIComponent(a.package_name)}`:void 0),repository:a.catalog?.links?.repository??a.package_repository_url,report:a.catalog?.links?.report??a.package_bugs_url}}function U(a,e,o,t,r,c){const l=t==="global"?"--global":"--project",p=Object.fromEntries(P.filter(s=>s!=="extensions").map(s=>[s,a.resources[s]??[]]).filter(([,s])=>Array.isArray(s)&&s.length>0));return{alias:e.alias,aliases:o,bundled:!0,available:!0,installed:o.some(s=>r.has(s))||c.has(i.resolve(e.package_root)),install_target:e.alias,install_command:`pm install ${e.alias} ${l}`,package_name:a.package_name,package_version:a.package_version,description:a.catalog?.summary??a.package_description,keywords:a.package_keywords??[],resources:a.resources,installable_resources:{extensions:a.resources.extensions??[]},metadata_only_resources:p,catalog:{display_name:a.catalog?.display_name,category:a.catalog?.category,tags:a.catalog?.tags??a.package_keywords??[],links:F(a),media:a.catalog?.media}}}async function na(a,e,o={}){const t=B(M(process.cwd(),e.path),process.cwd()),r=a==="global"?t.global:t.project,c=await O(r),l=new Set(c.state.entries.filter(n=>n.scope===a).filter(n=>n.source.kind!=="builtin").map(n=>i.resolve(n.source.location))),p=new Set(c.state.entries.filter(n=>n.scope===a&&n.source.kind==="builtin").flatMap(n=>[n.source.name,n.source.input,n.source.location]).filter(n=>typeof n=="string"&&n.trim().length>0).map(n=>n.trim().toLowerCase())),s=[],m=new Map;for(const n of await y()){const g=i.resolve(n.package_root),u=m.get(g)??[];u.push(n),m.set(g,u)}for(const n of m.values()){const g=n[0],u=n.map(_=>_.alias).sort((_,b)=>_.localeCompare(b)),x=await k(g.package_root);s.push(U(x,g,u,a,p,l))}const w=h(o.fields),A=w?s.map(n=>v(n,w)):s;return{total:A.length,scope:a,installable_resource_kinds:["extensions"],metadata_only_resource_kinds:P.filter(n=>n!=="extensions"),packages:A}}const z=new Set(["alias","aliases","bundled","available","installed","install_target","install_command","package_name","package_version","description","keywords","resources","installable_resources","metadata_only_resources","catalog","category","display_name"]);function h(a){return S(a,[...z],"catalog","pm package catalog --project --fields alias,package_name,category")}function v(a,e){const o={};for(const t of e)t==="category"?o[t]=a.catalog?.category??null:t==="display_name"?o[t]=a.catalog?.display_name??null:o[t]=a[t]??null;return o}const sa={parsePackageCatalogFields:h,projectPackageCatalogEntry:v};export{sa as _testOnlyBundledCatalog,na as buildBundledPackageCatalog,aa as isBundledPackageInstallAllTarget,ea as listBundledPackageAliases,ta as resolveBundledAliasManifestName,T as resolveBundledExtensionAliasSource,oa as resolveBundledPackageNpmName,C as resolveBundledPackageRoot};
2
2
  //# sourceMappingURL=bundled-catalog.js.map