@unbrained/pm-cli 2026.8.6 → 2026.8.8

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 (269) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +65 -0
  3. package/dist/cli/main.js +6 -3
  4. package/dist/cli/register-annotations.d.ts +11 -0
  5. package/dist/cli/register-annotations.js +195 -0
  6. package/dist/cli/register-history-author.js +7 -30
  7. package/dist/cli/register-mutation.js +25 -206
  8. package/dist/cli/register-operations.js +11 -2
  9. package/dist/cli/runtime-compatibility-boundary.d.ts +17 -0
  10. package/dist/cli/runtime-compatibility-boundary.js +43 -0
  11. package/dist/cli/stats-analytics-json.d.ts +9 -0
  12. package/dist/cli/stats-analytics-json.js +69 -0
  13. package/dist/cli-bundle/bundle-manifest.json +156 -692
  14. package/dist/cli-bundle/chunks/chunk-2ZMXX3Q6.js +2068 -0
  15. package/dist/cli-bundle/chunks/chunk-ALDHXLPS.js +3 -0
  16. package/dist/cli-bundle/chunks/chunk-CBLA33YK.js +8 -0
  17. package/dist/cli-bundle/chunks/chunk-GKA54IJM.js +5 -0
  18. package/dist/cli-bundle/chunks/chunk-KRY7SRUO.js +2 -0
  19. package/dist/cli-bundle/chunks/chunk-MNJ4NNSY.js +26 -0
  20. package/dist/cli-bundle/chunks/chunk-NUXRRNAB.js +77 -0
  21. package/dist/cli-bundle/chunks/chunk-OJPCFDDY.js +13 -0
  22. package/dist/cli-bundle/chunks/chunk-PFSD3DAN.js +194 -0
  23. package/dist/cli-bundle/chunks/chunk-QWRRFYK3.js +2 -0
  24. package/dist/cli-bundle/chunks/chunk-SQ7QZFQ6.js +2 -0
  25. package/dist/cli-bundle/chunks/{register-list-query-QH7ONPKU.js → register-list-query-WFZAMJHZ.js} +8 -8
  26. package/dist/cli-bundle/chunks/register-mutation-SOKKOTHQ.js +20 -0
  27. package/dist/cli-bundle/chunks/register-operations-5XQETS6E.js +2 -0
  28. package/dist/cli-bundle/chunks/register-setup-2HL5ZHMK.js +2 -0
  29. package/dist/cli-bundle/focused-chunks/chunk-54EU2UVO.js +2 -0
  30. package/dist/cli-bundle/focused-chunks/{chunk-N7QN3NE6.js → chunk-5FLBTZJQ.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/chunk-5GJ57YKN.js +2 -0
  32. package/dist/cli-bundle/focused-chunks/{chunk-YLPZHWX7.js → chunk-ANTMGYLI.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/chunk-CMDS3KYT.js +14 -0
  34. package/dist/cli-bundle/focused-chunks/{chunk-EYO4F74Z.js → chunk-DMKOMTTY.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/{chunk-GSW2Y7VZ.js → chunk-F5B3HBEZ.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-27DK4A5O.js → chunk-FI6DWU2M.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-CL3NB7VW.js → chunk-FNOKJG6N.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/{chunk-EAXXF2HW.js → chunk-FPDYXZBK.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-XNVXIQ4B.js → chunk-GWI6YIKJ.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-6KDHXURF.js → chunk-HCUC62AB.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{chunk-GEYU23YS.js → chunk-HGNKPSCB.js} +22 -22
  42. package/dist/cli-bundle/focused-chunks/chunk-IAS7PMLG.js +2 -0
  43. package/dist/cli-bundle/focused-chunks/{chunk-TQMFQYXR.js → chunk-PL2EYDJK.js} +29 -29
  44. package/dist/cli-bundle/focused-chunks/chunk-SM2PJGP3.js +2 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-4JC3AOGS.js → chunk-TCSAPH33.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/chunk-U646T7Z6.js +18 -0
  47. package/dist/cli-bundle/focused-chunks/chunk-YKPE4PPY.js +2 -0
  48. package/dist/cli-bundle/focused-chunks/{chunk-GIERI4YU.js → chunk-YSAHYUXX.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/chunk-ZOLDTUU7.js +2 -0
  50. package/dist/cli-bundle/main.js +13 -13
  51. package/dist/cli-bundle/sdk-authoring.js +1 -1
  52. package/dist/cli-bundle/sdk-contracts.js +1 -1
  53. package/dist/cli-bundle/sdk-core.js +38 -37
  54. package/dist/cli-bundle/sdk-governance.js +1 -1
  55. package/dist/cli-bundle/sdk-graph.js +1 -1
  56. package/dist/cli-bundle/sdk-merge.js +1 -1
  57. package/dist/cli-bundle/sdk-query.js +1 -1
  58. package/dist/cli-bundle/sdk-runtime.js +1 -1
  59. package/dist/cli-bundle/sdk-testing.js +1 -1
  60. package/dist/cli-bundle/sdk.js +2 -1
  61. package/dist/cli.js +14 -4
  62. package/dist/core/extensions/reserved-host-flags.js +3 -2
  63. package/dist/core/history/workspace-history.d.ts +22 -2
  64. package/dist/core/history/workspace-history.js +60 -36
  65. package/dist/core/output/output.d.ts +2 -0
  66. package/dist/core/output/output.js +10 -2
  67. package/dist/core/sentry/helpers.d.ts +10 -0
  68. package/dist/core/sentry/helpers.js +59 -4
  69. package/dist/core/shared/command-types.d.ts +2 -0
  70. package/dist/core/shared/command-types.js +2 -2
  71. package/dist/core/shared/constants.d.ts +2 -0
  72. package/dist/core/shared/constants.js +4 -2
  73. package/dist/mcp/tool-definitions.js +6 -2
  74. package/dist/sdk/annotations.d.ts +40 -0
  75. package/dist/sdk/annotations.js +61 -9
  76. package/dist/sdk/author-attribution.d.ts +12 -0
  77. package/dist/sdk/author-attribution.js +87 -9
  78. package/dist/sdk/cli-bootstrap.d.ts +2 -0
  79. package/dist/sdk/cli-bootstrap.js +7 -2
  80. package/dist/sdk/cli-contracts/command-exit-contracts.d.ts +118 -0
  81. package/dist/sdk/cli-contracts/command-exit-contracts.js +152 -0
  82. package/dist/sdk/cli-contracts/completeness.js +54 -5
  83. package/dist/sdk/cli-contracts/flag-contracts.js +6 -2
  84. package/dist/sdk/cli-contracts/registration-helpers.js +3 -2
  85. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +11 -0
  86. package/dist/sdk/cli-contracts/runtime-contracts.js +41 -8
  87. package/dist/sdk/cli-contracts/tool-parameter-tables.js +129 -10
  88. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  89. package/dist/sdk/cli-contracts/tool-schema.js +22 -3
  90. package/dist/sdk/cli-program.js +3 -2
  91. package/dist/sdk/comments.d.ts +7 -0
  92. package/dist/sdk/comments.js +2 -2
  93. package/dist/sdk/completion.js +12 -5
  94. package/dist/sdk/contracts.d.ts +2 -0
  95. package/dist/sdk/contracts.js +3 -2
  96. package/dist/sdk/core.d.ts +3 -1
  97. package/dist/sdk/core.js +4 -3
  98. package/dist/sdk/environment/host-environment-errors.d.ts +27 -0
  99. package/dist/sdk/environment/host-environment-errors.js +124 -0
  100. package/dist/sdk/environment/project-runtime-compatibility.d.ts +65 -0
  101. package/dist/sdk/environment/project-runtime-compatibility.js +385 -0
  102. package/dist/sdk/environment/source-context.d.ts +23 -0
  103. package/dist/sdk/environment/source-context.js +29 -0
  104. package/dist/sdk/error-code-catalog.d.ts +6 -0
  105. package/dist/sdk/error-code-catalog.js +62 -8
  106. package/dist/sdk/extension.js +9 -11
  107. package/dist/sdk/generated-error-code-catalog.js +739 -3
  108. package/dist/sdk/governance/health.d.ts +11 -3
  109. package/dist/sdk/governance/health.js +5 -5
  110. package/dist/sdk/history-analytics.d.ts +141 -0
  111. package/dist/sdk/history-analytics.js +283 -0
  112. package/dist/sdk/improvement-ledger-validation.d.ts +3 -0
  113. package/dist/sdk/improvement-ledger-validation.js +63 -0
  114. package/dist/sdk/improvement-ledger.d.ts +139 -0
  115. package/dist/sdk/improvement-ledger.js +261 -0
  116. package/dist/sdk/index.d.ts +13 -5
  117. package/dist/sdk/index.js +15 -7
  118. package/dist/sdk/learnings.d.ts +15 -0
  119. package/dist/sdk/learnings.js +2 -2
  120. package/dist/sdk/lifecycle/close-many.d.ts +6 -1
  121. package/dist/sdk/lifecycle/close-many.js +43 -5
  122. package/dist/sdk/lifecycle/plan.js +6 -3
  123. package/dist/sdk/lifecycle/update-many.d.ts +2 -1
  124. package/dist/sdk/lifecycle/update-many.js +29 -5
  125. package/dist/sdk/merge/index.d.ts +1 -1
  126. package/dist/sdk/merge/index.js +3 -3
  127. package/dist/sdk/merge/install.d.ts +21 -0
  128. package/dist/sdk/merge/install.js +58 -20
  129. package/dist/sdk/notes.d.ts +7 -0
  130. package/dist/sdk/notes.js +2 -2
  131. package/dist/sdk/read-output-budget.js +24 -22
  132. package/dist/sdk/read-output-contracts.d.ts +10 -2
  133. package/dist/sdk/read-output-contracts.js +204 -66
  134. package/dist/sdk/read-output-rows.d.ts +29 -0
  135. package/dist/sdk/read-output-rows.js +100 -0
  136. package/dist/sdk/read-output-session.d.ts +69 -0
  137. package/dist/sdk/read-output-session.js +200 -0
  138. package/dist/sdk/runtime-input.d.ts +2 -0
  139. package/dist/sdk/runtime-input.js +14 -2
  140. package/dist/sdk/runtime-primitives.d.ts +1 -1
  141. package/dist/sdk/runtime-primitives.js +3 -3
  142. package/dist/sdk/runtime-stats-options.d.ts +9 -0
  143. package/dist/sdk/runtime-stats-options.js +38 -0
  144. package/dist/sdk/runtime.d.ts +1 -0
  145. package/dist/sdk/runtime.js +13 -50
  146. package/dist/sdk/stats.d.ts +40 -0
  147. package/dist/sdk/stats.js +112 -29
  148. package/dist/sdk/test/execution.js +4 -2
  149. package/dist/sdk/test/parsers.js +5 -2
  150. package/dist/sdk/workspace-snapshot.d.ts +9 -0
  151. package/dist/sdk/workspace-snapshot.js +48 -16
  152. package/docs/AGENT_RUNTIME_PRIMITIVES.md +11 -4
  153. package/docs/IMPROVEMENT_ANALYTICS.md +103 -0
  154. package/docs/OUTPUT_PROJECTION_CONTRACTS.md +5 -5
  155. package/docs/README.md +2 -0
  156. package/docs/READ_OUTPUT_CONTRACTS.md +60 -1
  157. package/docs/RELEASING.md +27 -2
  158. package/docs/SCRIPTING.md +27 -1
  159. package/docs/SDK_CONTEXT_INTEGRITY.md +66 -0
  160. package/docs/SDK_RUNTIME_BOUNDARIES.md +58 -0
  161. package/docs/SELF_DESCRIBING_CONTEXT_CONTRACTS.md +13 -0
  162. package/docs/TESTING.md +17 -0
  163. package/marketplace.json +2 -2
  164. package/package.json +6 -4
  165. package/packages/pm-beads/package.json +1 -1
  166. package/packages/pm-calendar/package.json +1 -1
  167. package/packages/pm-command-kit/package.json +1 -1
  168. package/packages/pm-digital-twin/package.json +1 -1
  169. package/packages/pm-governance-audit/package.json +1 -1
  170. package/packages/pm-guide-shell/package.json +1 -1
  171. package/packages/pm-kanban/package.json +1 -1
  172. package/packages/pm-lifecycle-hooks/package.json +1 -1
  173. package/packages/pm-linked-test-adapters/package.json +1 -1
  174. package/packages/pm-search-advanced/package.json +1 -1
  175. package/packages/pm-templates/package.json +1 -1
  176. package/packages/pm-todos/package.json +1 -1
  177. package/packages/pm-vcs/package.json +1 -1
  178. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  179. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  180. package/sdk/public-surface.json +875 -827
  181. package/dist/cli-bundle/chunks/append-XAJ5Z4XS.js +0 -2
  182. package/dist/cli-bundle/chunks/chunk-343QETLI.js +0 -2
  183. package/dist/cli-bundle/chunks/chunk-3KFVGGRE.js +0 -2
  184. package/dist/cli-bundle/chunks/chunk-3ZJRFYY2.js +0 -23
  185. package/dist/cli-bundle/chunks/chunk-4AVFKHHC.js +0 -2
  186. package/dist/cli-bundle/chunks/chunk-4OVGQW22.js +0 -2
  187. package/dist/cli-bundle/chunks/chunk-5PBP2ZP3.js +0 -2
  188. package/dist/cli-bundle/chunks/chunk-5ZKQPA44.js +0 -2
  189. package/dist/cli-bundle/chunks/chunk-A3XQ7VPU.js +0 -2
  190. package/dist/cli-bundle/chunks/chunk-A6KGKEWT.js +0 -2
  191. package/dist/cli-bundle/chunks/chunk-AJE3AHPD.js +0 -8
  192. package/dist/cli-bundle/chunks/chunk-AOBDLU4T.js +0 -2
  193. package/dist/cli-bundle/chunks/chunk-AYRUGRNS.js +0 -3
  194. package/dist/cli-bundle/chunks/chunk-BP6EMEDP.js +0 -5
  195. package/dist/cli-bundle/chunks/chunk-BXCSXK4J.js +0 -2
  196. package/dist/cli-bundle/chunks/chunk-C3YABSJK.js +0 -2
  197. package/dist/cli-bundle/chunks/chunk-CA3BURYF.js +0 -2
  198. package/dist/cli-bundle/chunks/chunk-CHOQ2VAW.js +0 -2
  199. package/dist/cli-bundle/chunks/chunk-D7I3TUGV.js +0 -2
  200. package/dist/cli-bundle/chunks/chunk-DQGJ2RWT.js +0 -3
  201. package/dist/cli-bundle/chunks/chunk-DWOAOZHZ.js +0 -2
  202. package/dist/cli-bundle/chunks/chunk-E2ZSLTOP.js +0 -2
  203. package/dist/cli-bundle/chunks/chunk-E7BFPLUZ.js +0 -5
  204. package/dist/cli-bundle/chunks/chunk-F4NREH3G.js +0 -2
  205. package/dist/cli-bundle/chunks/chunk-FB7G2HY2.js +0 -2
  206. package/dist/cli-bundle/chunks/chunk-FDBRXV25.js +0 -2
  207. package/dist/cli-bundle/chunks/chunk-GU3TSEHD.js +0 -2
  208. package/dist/cli-bundle/chunks/chunk-HS7OVAUN.js +0 -164
  209. package/dist/cli-bundle/chunks/chunk-JC6FKIFM.js +0 -2
  210. package/dist/cli-bundle/chunks/chunk-JFZIS6JF.js +0 -2
  211. package/dist/cli-bundle/chunks/chunk-JQ4NZ5EB.js +0 -2
  212. package/dist/cli-bundle/chunks/chunk-L6LGKJX3.js +0 -2
  213. package/dist/cli-bundle/chunks/chunk-LEPJJ6QC.js +0 -2
  214. package/dist/cli-bundle/chunks/chunk-M357ZCOR.js +0 -2
  215. package/dist/cli-bundle/chunks/chunk-M4VEE3FK.js +0 -2
  216. package/dist/cli-bundle/chunks/chunk-MCS73BKB.js +0 -3
  217. package/dist/cli-bundle/chunks/chunk-MDTH7SAE.js +0 -19
  218. package/dist/cli-bundle/chunks/chunk-NE5VRDAI.js +0 -2
  219. package/dist/cli-bundle/chunks/chunk-OXY3SJ3N.js +0 -2
  220. package/dist/cli-bundle/chunks/chunk-PECV7L5T.js +0 -2
  221. package/dist/cli-bundle/chunks/chunk-Q3VOP62W.js +0 -2
  222. package/dist/cli-bundle/chunks/chunk-QJ7C3JIW.js +0 -2
  223. package/dist/cli-bundle/chunks/chunk-R6LSRGPS.js +0 -8
  224. package/dist/cli-bundle/chunks/chunk-R6RKEYYW.js +0 -2
  225. package/dist/cli-bundle/chunks/chunk-RAFUN7IX.js +0 -2005
  226. package/dist/cli-bundle/chunks/chunk-RSIC5OPE.js +0 -2
  227. package/dist/cli-bundle/chunks/chunk-RUAU5OSH.js +0 -2
  228. package/dist/cli-bundle/chunks/chunk-SD3YXU2U.js +0 -56
  229. package/dist/cli-bundle/chunks/chunk-SV3YQ4RY.js +0 -2
  230. package/dist/cli-bundle/chunks/chunk-SVV3DQES.js +0 -2
  231. package/dist/cli-bundle/chunks/chunk-SXECIECW.js +0 -5
  232. package/dist/cli-bundle/chunks/chunk-T45OHXDW.js +0 -8
  233. package/dist/cli-bundle/chunks/chunk-TPKDJ5WL.js +0 -2
  234. package/dist/cli-bundle/chunks/chunk-UVVXHGYS.js +0 -3
  235. package/dist/cli-bundle/chunks/chunk-V663653R.js +0 -20
  236. package/dist/cli-bundle/chunks/chunk-WSI5KZQJ.js +0 -55
  237. package/dist/cli-bundle/chunks/chunk-XPOQQJTX.js +0 -13
  238. package/dist/cli-bundle/chunks/chunk-YCCDXBNU.js +0 -2
  239. package/dist/cli-bundle/chunks/chunk-ZFBWCKYF.js +0 -2
  240. package/dist/cli-bundle/chunks/close-DI66JMSB.js +0 -2
  241. package/dist/cli-bundle/chunks/close-many-VFKT6U3O.js +0 -2
  242. package/dist/cli-bundle/chunks/comments-E73HIEZJ.js +0 -2
  243. package/dist/cli-bundle/chunks/copy-WBYVLCPC.js +0 -2
  244. package/dist/cli-bundle/chunks/create-TG67IVFI.js +0 -2
  245. package/dist/cli-bundle/chunks/delete-6XKUVVQN.js +0 -2
  246. package/dist/cli-bundle/chunks/deps-AJUGP2OH.js +0 -2
  247. package/dist/cli-bundle/chunks/docs-QOCLDRKJ.js +0 -2
  248. package/dist/cli-bundle/chunks/files-3ST5TY64.js +0 -2
  249. package/dist/cli-bundle/chunks/focus-R2AWS63Y.js +0 -2
  250. package/dist/cli-bundle/chunks/history-compact-7BJFML4S.js +0 -2
  251. package/dist/cli-bundle/chunks/history-redact-WJN3HYXR.js +0 -2
  252. package/dist/cli-bundle/chunks/history-repair-XDNZUB7F.js +0 -2
  253. package/dist/cli-bundle/chunks/learnings-SZMUPVNA.js +0 -2
  254. package/dist/cli-bundle/chunks/profile-KL53JIAC.js +0 -2
  255. package/dist/cli-bundle/chunks/register-mutation-OCRQNZK4.js +0 -20
  256. package/dist/cli-bundle/chunks/register-operations-HIBJXRGB.js +0 -2
  257. package/dist/cli-bundle/chunks/register-setup-QWBQ6HBS.js +0 -2
  258. package/dist/cli-bundle/chunks/restore-FXA5QPM7.js +0 -2
  259. package/dist/cli-bundle/chunks/schema-QJ27OTRV.js +0 -2
  260. package/dist/cli-bundle/chunks/update-7GBO4SXG.js +0 -2
  261. package/dist/cli-bundle/chunks/update-many-VF6ZKQUO.js +0 -2
  262. package/dist/cli-bundle/focused-chunks/chunk-74CWP3A4.js +0 -2
  263. package/dist/cli-bundle/focused-chunks/chunk-7AZDTGPA.js +0 -2
  264. package/dist/cli-bundle/focused-chunks/chunk-7YTZ7A4E.js +0 -2
  265. package/dist/cli-bundle/focused-chunks/chunk-LKQXXO62.js +0 -2
  266. package/dist/cli-bundle/focused-chunks/chunk-MBBMTDD3.js +0 -12
  267. package/dist/cli-bundle/focused-chunks/chunk-ME4XVOBJ.js +0 -8
  268. package/dist/cli-bundle/focused-chunks/chunk-QL5H3AQH.js +0 -2
  269. package/dist/cli-bundle/focused-chunks/chunk-YHDCGUIW.js +0 -14
@@ -4,7 +4,7 @@
4
4
  * Provides CLI runtime support for Registration Helpers.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e520de00-0810-5356-9290-324cf1d3c133")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d44229ca-8c70-5d55-a168-32bfe66711e6")}catch(e){}}();
8
8
  import { Option } from "commander";
9
9
  import { pathExists, refreshSearchArtifactsForMutation, shouldRunSearchRefreshInForeground, EXIT_CODE, PmCliError, printError, printResult, writeStdout, getSettingsPath, resolvePmRoot, readSettings, runActiveServiceOverride, setActiveCommandResult, } from "../runtime-primitives.js";
10
10
  import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, NEXT_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, readFirstValueFromCommanderOptions, readFirstStringFromCommanderOptions, readStringArrayFromCommanderOptions, } from "../cli-contracts.js";
@@ -111,6 +111,7 @@ export function getGlobalOptions(command) {
111
111
  outputInclude: readStringCommandOption(opts, "outputInclude"),
112
112
  outputLimit: readStringCommandOption(opts, "outputLimit"),
113
113
  outputBudget: readStringCommandOption(opts, "outputBudget"),
114
+ outputSession: readStringCommandOption(opts, "outputSession"),
114
115
  ...(opts.outputFormat === "toon" || opts.outputFormat === "json"
115
116
  ? { outputFormat: opts.outputFormat }
116
117
  : {}),
@@ -969,4 +970,4 @@ export const _testOnly = {
969
970
  collectMutationItemIds,
970
971
  };
971
972
  //# sourceMappingURL=registration-helpers.js.map
972
- //# debugId=e520de00-0810-5356-9290-324cf1d3c133
973
+ //# debugId=d44229ca-8c70-5d55-a168-32bfe66711e6
@@ -13,6 +13,7 @@ import { type CliFlagInvocationContract } from "../flag-invocation-contracts.js"
13
13
  import { type PmCommandVisibilityTier } from "../agent-capability-contracts.js";
14
14
  import type { PmErrorCodeContract } from "../error-code-catalog.js";
15
15
  import { type PmCommandOutputEnvelopeContract } from "../output-contracts.js";
16
+ import { type PmCommandExitContract, type PmCommandExitOutcomeContract } from "./command-exit-contracts.js";
16
17
  /** Documents the contracts command options payload exchanged by command, SDK, and package integrations. */
17
18
  export interface ContractsCommandOptions {
18
19
  /** Value that configures or reports action for this contract. */
@@ -152,6 +153,14 @@ export interface ContractsResult {
152
153
  budget: PmCommandOutputBudgetContract;
153
154
  envelope: PmCommandOutputEnvelopeContract;
154
155
  }>;
156
+ /** Stable outcome vocabulary and exhaustive per-command process exit sets. */
157
+ command_exit_contracts?: {
158
+ vocabulary: readonly PmCommandExitOutcomeContract[];
159
+ command_sets: Array<{
160
+ commands: string[];
161
+ exit_codes: PmCommandExitContract["exit_codes"];
162
+ }>;
163
+ };
155
164
  }
156
165
  type PmToolAction = (typeof PM_TOOL_ACTIONS)[number];
157
166
  /** Documents the contracts action availability payload exchanged by command, SDK, and package integrations. */
@@ -260,6 +269,7 @@ declare function attachCreateRequiredOptionContracts(schema: Record<string, unkn
260
269
  declare function readContractsSettings(pmRoot: string, readSettingsFn?: typeof readSettings): Promise<Awaited<ReturnType<typeof readSettings>>>;
261
270
  declare function buildCommandSummarySurface(commands: readonly string[]): CommandSummarySurface[];
262
271
  declare function buildCommandOutputContracts(commands: readonly string[]): NonNullable<ContractsResult["command_output_contracts"]>;
272
+ declare function buildCommandExitContractGroups(commands: readonly string[]): NonNullable<ContractsResult["command_exit_contracts"]>["command_sets"];
263
273
  /** Implements run contracts for the public runtime surface of this module. */
264
274
  export declare function runContracts(options: ContractsCommandOptions, global: GlobalOptions): Promise<ContractsResult>;
265
275
  /** Public contract for test only contracts command, shared by SDK and presentation-layer consumers. */
@@ -269,6 +279,7 @@ export declare const _testOnlyContractsCommand: {
269
279
  buildExtensionActionSchemaBranch: typeof buildExtensionActionSchemaBranch;
270
280
  buildCommandSummarySurface: typeof buildCommandSummarySurface;
271
281
  buildCommandOutputContracts: typeof buildCommandOutputContracts;
282
+ buildCommandExitContractGroups: typeof buildCommandExitContractGroups;
272
283
  buildRuntimeFieldFlagContracts: typeof buildRuntimeFieldFlagContracts;
273
284
  collectActionContractDescriptors: typeof collectActionContractDescriptors;
274
285
  collectExtensionCommandContracts: typeof collectExtensionCommandContracts;
@@ -4,7 +4,7 @@
4
4
  * Implements the pm contracts command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e6dd81d6-95d6-51e6-a0c9-ba7bb5372457")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="adf76b7b-fc29-5b35-b33a-5ae008cbc8e7")}catch(e){}}();
8
8
  import { EXIT_CODE, SETTINGS_DEFAULTS, PmCliError, activateExtensions, getActiveExtensionRegistrations, loadExtensions, pathExists, commandOptionFlagLabel, resolveCommandOptionPolicyState, resolveItemTypeRegistry, resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, getSettingsPath, resolvePmRoot, readSettings, } from "../runtime-primitives.js";
9
9
  import { buildMcpToolContracts, } from "../../mcp/tool-definitions.js";
10
10
  import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, CLOSE_FLAG_CONTRACTS, CLOSE_MANY_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_FLAG_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, GRAPH_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, EXTENSION_ACTIVATE_FLAG_CONTRACTS, EXTENSION_ADOPT_ALL_FLAG_CONTRACTS, EXTENSION_ADOPT_FLAG_CONTRACTS, EXTENSION_CATALOG_FLAG_CONTRACTS, EXTENSION_DEACTIVATE_FLAG_CONTRACTS, EXTENSION_DESCRIBE_FLAG_CONTRACTS, EXTENSION_DOCTOR_FLAG_CONTRACTS, EXTENSION_EXPLORE_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, EXTENSION_INIT_FLAG_CONTRACTS, EXTENSION_INSTALL_FLAG_CONTRACTS, EXTENSION_MANAGE_FLAG_CONTRACTS, EXTENSION_MIGRATE_FLAG_CONTRACTS, EXTENSION_RELOAD_FLAG_CONTRACTS, EXTENSION_UNINSTALL_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_COMPACT_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, ITEM_COMPLETE_FLAG_CONTRACTS, ITEM_MUTATE_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, MERGE_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, PACKAGE_FLAG_CONTRACTS, PACKAGE_INIT_FLAG_CONTRACTS, PM_EXTENSION_CAPABILITY_CONTRACTS, PM_EXTENSION_POLICY_MODE_CONTRACTS, PM_EXTENSION_POLICY_SURFACE_CONTRACTS, PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS, PM_EXTENSION_SERVICE_NAME_CONTRACTS, PM_EXTENSION_TRUST_MODE_CONTRACTS, PM_OUTPUT_DEGRADATION_STEPS, PLAN_FLAG_CONTRACTS, PM_CORE_COMMAND_NAMES, PM_TOOL_ACTIONS, PM_TOOL_PARAMETERS_SCHEMA, REINDEX_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, PROFILE_FLAG_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, EVAL_FLAG_CONTRACTS, WORKSPACE_FLAG_CONTRACTS, NEXT_FLAG_CONTRACTS, SEARCH_FLAG_CONTRACTS, STATS_FLAG_CONTRACTS, DUPLICATES_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, TELEMETRY_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, compactFlagAliasContracts, resolvePmCommandOutputBudget, } from "../cli-contracts.js";
@@ -16,6 +16,7 @@ import { enrichCliFlagInvocationContracts, } from "../flag-invocation-contracts.
16
16
  import { resolvePmCommandVisibilityTier, } from "../agent-capability-contracts.js";
17
17
  import { PM_ERROR_CODE_CATALOG } from "../generated-error-code-catalog.js";
18
18
  import { resolvePmCommandOutputEnvelope, } from "../output-contracts.js";
19
+ import { PM_COMMAND_EXIT_OUTCOME_CONTRACTS, resolvePmCommandExitContract, } from "./command-exit-contracts.js";
19
20
  const AGENT_BOOTSTRAP_FLAGS = new Map([
20
21
  [
21
22
  "claim",
@@ -1619,6 +1620,27 @@ function buildCommandOutputContracts(commands) {
1619
1620
  envelope: resolvePmCommandOutputEnvelope(command),
1620
1621
  }));
1621
1622
  }
1623
+ function buildCommandExitContractGroups(commands) {
1624
+ const groups = new Map();
1625
+ for (const command of commands) {
1626
+ const contract = resolvePmCommandExitContract(command);
1627
+ const exitCodes = contract === undefined
1628
+ ? [
1629
+ EXIT_CODE.SUCCESS,
1630
+ EXIT_CODE.GENERIC_FAILURE,
1631
+ EXIT_CODE.USAGE,
1632
+ EXIT_CODE.NOT_FOUND,
1633
+ EXIT_CODE.CONFLICT,
1634
+ EXIT_CODE.DEPENDENCY_FAILED,
1635
+ ]
1636
+ : contract.exit_codes;
1637
+ const key = exitCodes.join(",");
1638
+ const group = groups.get(key) ?? { commands: [], exit_codes: exitCodes };
1639
+ group.commands.push(command);
1640
+ groups.set(key, group);
1641
+ }
1642
+ return [...groups.values()];
1643
+ }
1622
1644
  function resolveExtensionCommandContracts(selection, runtime, outputCommands) {
1623
1645
  if (selection.selectedCommand) {
1624
1646
  return runtime.extensionContracts.filter((entry) => splitCommandPathAliases(entry.command).includes(selection.selectedCommand));
@@ -1744,6 +1766,15 @@ function attachCommanderAliasContractsResult(result, selection) {
1744
1766
  }
1745
1767
  result.commander_aliases_omitted_reason = "unfiltered_default_brief";
1746
1768
  }
1769
+ /** Attach the compact agent-facing command semantics shared by summary and full projections. */
1770
+ function attachAgentCommandContractsResult(result, outputCommands) {
1771
+ result.command_summaries = buildCommandSummarySurface(outputCommands);
1772
+ result.output_policy = {
1773
+ token_estimate: "ceil(utf8_bytes / 4)",
1774
+ degradation_ladder: [...PM_OUTPUT_DEGRADATION_STEPS],
1775
+ allows_unbounded_opt_out: true,
1776
+ };
1777
+ }
1747
1778
  /** Implements run contracts for the public runtime surface of this module. */
1748
1779
  export async function runContracts(options, global) {
1749
1780
  const selection = resolveContractsSelection(options);
@@ -1755,13 +1786,10 @@ export async function runContracts(options, global) {
1755
1786
  const commands = resolveContractsCommands(selection, actionContext);
1756
1787
  const outputCommands = resolveOutputCommands(selection, commands);
1757
1788
  const result = createContractsResult(selection, schemaContext, actionContext, outputCommands);
1789
+ if (selection.summary || selection.fullOutput) {
1790
+ attachAgentCommandContractsResult(result, outputCommands);
1791
+ }
1758
1792
  if (selection.summary) {
1759
- result.command_summaries = buildCommandSummarySurface(outputCommands);
1760
- result.output_policy = {
1761
- token_estimate: "ceil(utf8_bytes / 4)",
1762
- degradation_ladder: [...PM_OUTPUT_DEGRADATION_STEPS],
1763
- allows_unbounded_opt_out: true,
1764
- };
1765
1793
  return result;
1766
1794
  }
1767
1795
  const commandAliases = buildCommandAliasSurface(commands);
@@ -1785,6 +1813,10 @@ export async function runContracts(options, global) {
1785
1813
  result.error_codes = PM_ERROR_CODE_CATALOG;
1786
1814
  result.command_output_contracts =
1787
1815
  buildCommandOutputContracts(outputCommands);
1816
+ result.command_exit_contracts = {
1817
+ vocabulary: PM_COMMAND_EXIT_OUTCOME_CONTRACTS,
1818
+ command_sets: buildCommandExitContractGroups(outputCommands),
1819
+ };
1788
1820
  }
1789
1821
  return result;
1790
1822
  }
@@ -1795,6 +1827,7 @@ export const _testOnlyContractsCommand = {
1795
1827
  buildExtensionActionSchemaBranch,
1796
1828
  buildCommandSummarySurface,
1797
1829
  buildCommandOutputContracts,
1830
+ buildCommandExitContractGroups,
1798
1831
  buildRuntimeFieldFlagContracts,
1799
1832
  collectActionContractDescriptors,
1800
1833
  collectExtensionCommandContracts,
@@ -1821,4 +1854,4 @@ export const _testOnlyContractsCommand = {
1821
1854
  toRuntimeShortFlagToken,
1822
1855
  };
1823
1856
  //# sourceMappingURL=runtime-contracts.js.map
1824
- //# debugId=e6dd81d6-95d6-51e6-a0c9-ba7bb5372457
1857
+ //# debugId=adf76b7b-fc29-5b35-b33a-5ae008cbc8e7
@@ -4,8 +4,9 @@
4
4
  * Defines SDK command-contract metadata for Tool Parameter Tables.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4dd6e565-011f-5411-9fcb-37e94ee4cdb2")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="35c4b819-02d6-582a-a7eb-fe3f4a4903d9")}catch(e){}}();
8
8
  import { PLAN_HARNESS_VALUES, PLAN_MODE_VALUES, PLAN_STEP_LINK_KIND_VALUES, PLAN_STEP_STATUS_VALUES, } from "../../types/index.js";
9
+ import { PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS } from "../read-output-session.js";
9
10
  /** Public contract for pm tool parameter properties, shared by SDK and presentation-layer consumers. */
10
11
  export const PM_TOOL_PARAMETER_PROPERTIES = {
11
12
  json: { type: "boolean", default: true },
@@ -20,6 +21,39 @@ export const PM_TOOL_PARAMETER_PROPERTIES = {
20
21
  },
21
22
  outputBudget: { type: "integer", minimum: 1 },
22
23
  outputFormat: { type: "string", enum: ["json", "toon"] },
24
+ outputSession: {
25
+ anyOf: [
26
+ { type: "string", minLength: 1 },
27
+ {
28
+ type: "object",
29
+ additionalProperties: false,
30
+ required: [
31
+ "version",
32
+ "id",
33
+ "token_budget",
34
+ "spent_tokens",
35
+ "seen_item_ids",
36
+ ],
37
+ properties: {
38
+ version: { const: 1 },
39
+ id: {
40
+ type: "string",
41
+ pattern: "^[A-Za-z0-9][A-Za-z0-9._:-]{0,63}$",
42
+ },
43
+ token_budget: { type: "integer", minimum: 256 },
44
+ spent_tokens: { type: "integer", minimum: 0 },
45
+ seen_item_ids: {
46
+ type: "array",
47
+ maxItems: PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,
48
+ items: {
49
+ type: "string",
50
+ pattern: "^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$",
51
+ },
52
+ },
53
+ },
54
+ },
55
+ ],
56
+ },
23
57
  path: { type: "string" },
24
58
  pmExecutable: { type: "string" },
25
59
  timeoutMs: { type: "number" },
@@ -365,6 +399,21 @@ export const PM_TOOL_PARAMETER_PROPERTIES = {
365
399
  byTag: { type: "boolean" },
366
400
  byPriority: { type: "boolean" },
367
401
  tagPrefix: { type: "string" },
402
+ measurements: { type: "boolean" },
403
+ metric: { type: "string" },
404
+ measurementLimit: { type: "integer", minimum: 0, maximum: 1000 },
405
+ observe: { type: "array", items: { type: "string" } },
406
+ improvementDirection: {
407
+ type: "string",
408
+ enum: ["higher", "lower", "target"],
409
+ },
410
+ measurementSource: { type: "string" },
411
+ measurementItem: { type: "string" },
412
+ measurementRevision: { type: "string" },
413
+ provenanceCoverage: { type: "boolean" },
414
+ fleetAttribution: { type: "boolean" },
415
+ eventLimit: { type: "integer", minimum: 1, maximum: 100000 },
416
+ minimumSample: { type: "integer", minimum: 1, maximum: 10000 },
368
417
  verify: { type: "boolean" },
369
418
  literal: { type: "array", items: { type: "string" } },
370
419
  regex: { type: "array", items: { type: "string" } },
@@ -562,10 +611,7 @@ export const PM_TOOL_PARAMETER_PROPERTIES = {
562
611
  export const PM_TOOL_ACTION_SCOPED_PARAMETER_PROPERTIES = {
563
612
  activity: {
564
613
  harness: {
565
- anyOf: [
566
- { type: "string" },
567
- { type: "array", items: { type: "string" } },
568
- ],
614
+ anyOf: [{ type: "string" }, { type: "array", items: { type: "string" } }],
569
615
  },
570
616
  },
571
617
  events: {
@@ -586,10 +632,7 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_PROPERTIES = {
586
632
  },
587
633
  history: {
588
634
  harness: {
589
- anyOf: [
590
- { type: "string" },
591
- { type: "array", items: { type: "string" } },
592
- ],
635
+ anyOf: [{ type: "string" }, { type: "array", items: { type: "string" } }],
593
636
  },
594
637
  },
595
638
  remind: {
@@ -845,6 +888,18 @@ export const PM_TOOL_PARAMETER_METADATA = {
845
888
  description: "Universal read-result encoding selector.",
846
889
  examples: ["toon", "json"],
847
890
  },
891
+ outputSession: {
892
+ description: "Caller-carried JSON session state that enforces a token ceiling across read calls and replaces repeated item facts with resolvable context references.",
893
+ examples: [
894
+ {
895
+ version: 1,
896
+ id: "orientation",
897
+ token_budget: 4000,
898
+ spent_tokens: 0,
899
+ seen_item_ids: [],
900
+ },
901
+ ],
902
+ },
848
903
  profile: {
849
904
  description: "Emit deterministic timing diagnostics to stderr.",
850
905
  },
@@ -1255,6 +1310,51 @@ export const PM_TOOL_PARAMETER_METADATA = {
1255
1310
  fieldUtilization: {
1256
1311
  description: "For stats action: include a field_utilization block reporting present/total/percent for content fields (notes, learnings, files, docs, tests, comments, deps, body, linked_command) across all items so under-documented dimensions are visible at a glance.",
1257
1312
  },
1313
+ measurements: {
1314
+ description: "For stats action: include the audited append-only improvement ledger and baseline-to-latest trends.",
1315
+ },
1316
+ metric: {
1317
+ description: "Exact improvement metric name used to filter ledger reads.",
1318
+ examples: ["quality.coverage.lines"],
1319
+ },
1320
+ measurementLimit: {
1321
+ description: "Maximum newest improvement observations returned by stats.",
1322
+ examples: [50],
1323
+ },
1324
+ observe: {
1325
+ description: "Repeatable audited observation in name=value[,unit=...][,threshold=...] form.",
1326
+ examples: [["quality.coverage.lines=100,unit=percent,threshold=100"]],
1327
+ },
1328
+ improvementDirection: {
1329
+ description: "Improvement direction for newly recorded observations.",
1330
+ examples: ["higher", "lower", "target"],
1331
+ },
1332
+ measurementSource: {
1333
+ description: "Producing gate or instrument for a new observation.",
1334
+ examples: ["pnpm coverage"],
1335
+ },
1336
+ measurementItem: {
1337
+ description: "Tracked item that owns an improvement observation.",
1338
+ examples: ["pm-123abc"],
1339
+ },
1340
+ measurementRevision: {
1341
+ description: "Explicit source revision for a new observation.",
1342
+ examples: ["0123456789abcdef"],
1343
+ },
1344
+ provenanceCoverage: {
1345
+ description: "For stats action: compare configured provenance descriptors with bounded immutable-history observations.",
1346
+ },
1347
+ fleetAttribution: {
1348
+ description: "For stats action: derive observational throughput, rework, and defect-escape rates by harness, model, and author source.",
1349
+ },
1350
+ eventLimit: {
1351
+ description: "Maximum immutable history events consumed by an analytics projection.",
1352
+ examples: [10000],
1353
+ },
1354
+ minimumSample: {
1355
+ description: "Minimum denominator before analytics rates are reported.",
1356
+ examples: [5],
1357
+ },
1258
1358
  offset: {
1259
1359
  description: "Number of matching rows to skip before limit is applied.",
1260
1360
  examples: [0, 50, "100"],
@@ -1664,6 +1764,12 @@ export const PM_TOOL_PARAMETER_METADATA = {
1664
1764
  * because its single `name` property must cover every action at once.
1665
1765
  */
1666
1766
  export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
1767
+ stats: {
1768
+ since: {
1769
+ description: "Inclusive ISO 8601 timestamp or negative duration lower bound for provenance and fleet analytics.",
1770
+ examples: ["2026-08-01T00:00:00.000Z", "-30d"],
1771
+ },
1772
+ },
1667
1773
  events: {
1668
1774
  since: {
1669
1775
  description: "Durable event cursor returned as next_cursor, or an inclusive event timestamp.",
@@ -1698,12 +1804,25 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
1698
1804
  examples: [600, "1200"],
1699
1805
  },
1700
1806
  },
1807
+ comments: {
1808
+ full: {
1809
+ description: "Return the complete post-mutation comment history instead of the bounded mutation receipt projection.",
1810
+ },
1811
+ },
1701
1812
  notes: {
1813
+ full: {
1814
+ description: "Return the complete post-mutation note history instead of the bounded mutation receipt projection.",
1815
+ },
1702
1816
  since: {
1703
1817
  description: "Inclusive ISO 8601 creation timestamp lower bound for structured note event filtering.",
1704
1818
  examples: ["2026-01-01T00:00:00.000Z"],
1705
1819
  },
1706
1820
  },
1821
+ learnings: {
1822
+ full: {
1823
+ description: "Return the complete post-mutation learning history instead of the bounded mutation receipt projection.",
1824
+ },
1825
+ },
1707
1826
  next: {
1708
1827
  tag: {
1709
1828
  description: "Only recommend items carrying this exact tag.",
@@ -1788,4 +1907,4 @@ export const PM_TOOL_ACTION_SCOPED_PARAMETER_METADATA = {
1788
1907
  },
1789
1908
  };
1790
1909
  //# sourceMappingURL=tool-parameter-tables.js.map
1791
- //# debugId=4dd6e565-011f-5411-9fcb-37e94ee4cdb2
1910
+ //# debugId=35c4b819-02d6-582a-a7eb-fe3f4a4903d9
@@ -91,7 +91,7 @@ export interface PmActionToolInputSchemaOptions {
91
91
  */
92
92
  export declare function buildPmActionToolInputSchema(action: PmToolAction, options?: PmActionToolInputSchemaOptions): Record<string, unknown>;
93
93
  /** Canonical version of the action-scoped strict MCP tool-parameters schema (`PM_TOOL_PARAMETERS_SCHEMA`). Exported as the single source of truth so the MCP server, the `pm contracts` command, SDK consumers, and the contract tests all bind to one constant instead of re-typing the `"4.0.2"` literal (pm-r9sz). Bump the patch/minor for additive, backward-compatible schema changes; bump the MAJOR for breaking changes — the major also drives the `$id` `tool-parameters-v{major}` slug, so the two never drift. */
94
- export declare const PM_TOOL_PARAMETERS_SCHEMA_VERSION: "4.4.0";
94
+ export declare const PM_TOOL_PARAMETERS_SCHEMA_VERSION: "4.4.1";
95
95
  /**
96
96
  * Major component of {@link PM_TOOL_PARAMETERS_SCHEMA_VERSION}, used to build the
97
97
  * schema `$id` slug so a breaking version bump renames the document in lockstep.
@@ -7,7 +7,7 @@
7
7
  * consumers from a single source of truth.
8
8
  */
9
9
 
10
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b26c9bc3-e1bf-5174-a0af-296c947678da")}catch(e){}}();
10
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d9f01e68-6b54-5861-a4b5-ae40613c2047")}catch(e){}}();
11
11
  import { normalizeUniqueStringList } from "./string-lists.js";
12
12
  import { PM_TOOL_ACTIONS } from "./enum-contracts.js";
13
13
  import { TOOL_CREATE_OPTION_CONTRACTS, TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_OPTION_CONTRACTS, TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS, TOOL_CONTEXT_OPTION_CONTRACTS, TOOL_ACTIVITY_OPTION_CONTRACTS, TOOL_LIST_FILTER_OPTION_CONTRACTS, TOOL_AGGREGATE_OPTION_CONTRACTS, TOOL_SEARCH_FILTER_OPTION_CONTRACTS, TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS, } from "./tool-option-contracts.js";
@@ -30,6 +30,7 @@ const PM_TOOL_READ_OUTPUT_PARAMETER_KEYS = [
30
30
  "outputLimit",
31
31
  "outputBudget",
32
32
  "outputFormat",
33
+ "outputSession",
33
34
  ];
34
35
  /** Canonical top-level MCP properties that take precedence over runtime custom fields. */
35
36
  export const PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES = new Set([
@@ -810,6 +811,7 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
810
811
  "edit",
811
812
  "delete",
812
813
  "limit",
814
+ "full",
813
815
  ...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS,
814
816
  ],
815
817
  },
@@ -826,6 +828,7 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
826
828
  "since",
827
829
  "eventType",
828
830
  "includeMeta",
831
+ "full",
829
832
  ...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS,
830
833
  ],
831
834
  mutuallyExclusive: [
@@ -845,6 +848,7 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
845
848
  "edit",
846
849
  "delete",
847
850
  "limit",
851
+ "full",
848
852
  ...AUTHOR_MESSAGE_FORCE_PARAMETER_KEYS,
849
853
  ],
850
854
  },
@@ -1013,6 +1017,21 @@ const PM_TOOL_ACTION_SCHEMA_CONTRACTS = {
1013
1017
  "byTag",
1014
1018
  "byPriority",
1015
1019
  "tagPrefix",
1020
+ "measurements",
1021
+ "metric",
1022
+ "measurementLimit",
1023
+ "observe",
1024
+ "improvementDirection",
1025
+ "measurementSource",
1026
+ "measurementItem",
1027
+ "measurementRevision",
1028
+ "author",
1029
+ "message",
1030
+ "provenanceCoverage",
1031
+ "fleetAttribution",
1032
+ "since",
1033
+ "eventLimit",
1034
+ "minimumSample",
1016
1035
  ],
1017
1036
  },
1018
1037
  duplicates: {
@@ -1411,7 +1430,7 @@ function createLazyContractSchema(build) {
1411
1430
  });
1412
1431
  }
1413
1432
  /** Canonical version of the action-scoped strict MCP tool-parameters schema (`PM_TOOL_PARAMETERS_SCHEMA`). Exported as the single source of truth so the MCP server, the `pm contracts` command, SDK consumers, and the contract tests all bind to one constant instead of re-typing the `"4.0.2"` literal (pm-r9sz). Bump the patch/minor for additive, backward-compatible schema changes; bump the MAJOR for breaking changes — the major also drives the `$id` `tool-parameters-v{major}` slug, so the two never drift. */
1414
- export const PM_TOOL_PARAMETERS_SCHEMA_VERSION = "4.4.0";
1433
+ export const PM_TOOL_PARAMETERS_SCHEMA_VERSION = "4.4.1";
1415
1434
  /**
1416
1435
  * Major component of {@link PM_TOOL_PARAMETERS_SCHEMA_VERSION}, used to build the
1417
1436
  * schema `$id` slug so a breaking version bump renames the document in lockstep.
@@ -1493,4 +1512,4 @@ export const _testOnlyCliContracts = {
1493
1512
  withFlagAliasMetadata,
1494
1513
  };
1495
1514
  //# sourceMappingURL=tool-schema.js.map
1496
- //# debugId=b26c9bc3-e1bf-5174-a0af-296c947678da
1515
+ //# debugId=d9f01e68-6b54-5861-a4b5-ae40613c2047
@@ -4,7 +4,7 @@
4
4
  * Builds the reusable Commander root that embeds pm's universal global contracts.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="26c939a0-e02d-5998-95e3-a4c26c3b47bd")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a410d336-c332-56fc-9a5d-7841a2b3dfa5")}catch(e){}}();
8
8
  import { Command } from "commander";
9
9
  import { writeStdout } from "../core/output/output.js";
10
10
  /** Create a fresh pm root program suitable for one-shot CLI or embedded hosts. */
@@ -29,6 +29,7 @@ export function createPmCliProgram(version) {
29
29
  .option("--output-limit <count>", "Bound rows in read output")
30
30
  .option("--output-budget <tokens>", "Bound estimated tokens in read output")
31
31
  .option("--output-format <toon|json>", "Select the read-output encoding")
32
+ .option("--output-session <state>", "Carry a JSON session budget and served-item ledger across read calls")
32
33
  .option("--quiet", "Suppress stdout output")
33
34
  .option("--no-changed-fields", "Omit the changed_fields array from mutation output (keeps changed_field_count)")
34
35
  .option("--full-changed-fields", "Restore the legacy full mutation envelope and changed_fields array")
@@ -43,4 +44,4 @@ export function createPmCliProgram(version) {
43
44
  .exitOverride();
44
45
  }
45
46
  //# sourceMappingURL=cli-program.js.map
46
- //# debugId=26c939a0-e02d-5998-95e3-a4c26c3b47bd
47
+ //# debugId=a410d336-c332-56fc-9a5d-7841a2b3dfa5
@@ -1,5 +1,6 @@
1
1
  import { type GlobalOptions } from "./runtime-primitives.js";
2
2
  import type { Comment } from "../types/index.js";
3
+ import { type AnnotationMutationReceipt, type AnnotationOmissionReceipt } from "./annotations.js";
3
4
  /** Documents the comments command options payload exchanged by command, SDK, and package integrations. */
4
5
  export interface CommentsCommandOptions {
5
6
  /** Value that configures or reports add for this contract. */
@@ -16,6 +17,8 @@ export interface CommentsCommandOptions {
16
17
  limit?: string;
17
18
  /** Value that configures or reports include meta for this contract. */
18
19
  includeMeta?: boolean;
20
+ /** Return complete comment history after a mutation instead of a bounded receipt. */
21
+ fullHistory?: boolean;
19
22
  /** Value that configures or reports author for this contract. */
20
23
  author?: string;
21
24
  /** Human-readable explanation suitable for logs and agent-facing output. */
@@ -39,6 +42,10 @@ export interface CommentsResult {
39
42
  has_more?: boolean;
40
43
  /** Value that configures or reports limit for this contract. */
41
44
  limit?: number;
45
+ /** Mutation identity when this result changed the collection. */
46
+ mutation_receipt?: AnnotationMutationReceipt;
47
+ /** Declares whether older comments were withheld from a mutation response. */
48
+ omission_receipt?: AnnotationOmissionReceipt;
42
49
  }
43
50
  /** Implements run comments for the public runtime surface of this module. */
44
51
  export declare function runComments(id: string, options: CommentsCommandOptions, global: GlobalOptions): Promise<CommentsResult>;
@@ -4,7 +4,7 @@
4
4
  * Implements the pm comments command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="500e83b0-28a8-58b1-a625-2d81eb245eb4")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="667218ac-866c-59b1-8309-18ad92434fca")}catch(e){}}();
8
8
  import { readFile } from "node:fs/promises";
9
9
  import { EXIT_CODE, PmCliError, createStdinTokenResolver, } from "./runtime-primitives.js";
10
10
  import { isErrnoError, parseAnnotationTextInput, runAnnotationCommand, } from "./annotations.js";
@@ -122,4 +122,4 @@ export async function runComments(id, options, global) {
122
122
  });
123
123
  }
124
124
  //# sourceMappingURL=comments.js.map
125
- //# debugId=500e83b0-28a8-58b1-a625-2d81eb245eb4
125
+ //# debugId=667218ac-866c-59b1-8309-18ad92434fca
@@ -4,7 +4,7 @@
4
4
  * Implements the pm completion command surface and its agent-facing runtime behavior.
5
5
  */
6
6
 
7
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bba460dd-91d7-5444-b754-58c684a425fd")}catch(e){}}();
7
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6c9648d7-ab14-5e0d-8793-86ae13643fa6")}catch(e){}}();
8
8
  import { EXIT_CODE, PmCliError } from "./runtime-primitives.js";
9
9
  import { listPmCommandsForTier } from "./agent-capability-contracts.js";
10
10
  import { SCAFFOLD_CAPABILITIES } from "./extension/scaffold.js";
@@ -599,13 +599,13 @@ export function generateBashScript(itemTypes = [], tags = [], eagerTagExpansion
599
599
  ` COMPREPLY=(${compgen(`${LIFECYCLE_ACTIONS} ${PACKAGE_LIFECYCLE_FLAGS}`)})`,
600
600
  " ;;",
601
601
  " comments)",
602
- ` COMPREPLY=(${compgen("--add --body --stdin --file --edit --delete --limit --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
602
+ ` COMPREPLY=(${compgen("--add --body --stdin --file --edit --delete --limit --full-history --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
603
603
  " ;;",
604
604
  " notes)",
605
- ` COMPREPLY=(${compgen("--add --add-json --stdin --file --edit --delete --limit --since --event-type --include-meta --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
605
+ ` COMPREPLY=(${compgen("--add --add-json --stdin --file --edit --delete --limit --since --event-type --include-meta --full-history --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
606
606
  " ;;",
607
607
  " learnings)",
608
- ` COMPREPLY=(${compgen("--add --stdin --file --edit --delete --limit --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
608
+ ` COMPREPLY=(${compgen("--add --stdin --file --edit --delete --limit --full-history --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
609
609
  " ;;",
610
610
  " files)",
611
611
  ` COMPREPLY=(${compgen("discover lookup --add --add-glob --remove --migrate --list --apply --note --append-stable --validate-paths --scope --limit --offset --no-truncate --strict-read --author --message --force --json --quiet --no-changed-fields --pm-path --path --no-extensions --no-pager --profile --help")})`,
@@ -787,6 +787,7 @@ _pm() {
787
787
  '--output-limit[Set the universal read row ceiling]:limit' \\
788
788
  '--output-budget[Set the universal estimated-token ceiling]:tokens' \\
789
789
  '--output-format[Select the universal read encoding]:(toon json)' \\
790
+ '--output-session[Carry cross-call read budget and served-item state]:state' \\
790
791
  '--no-changed-fields[Omit changed_fields array from mutation output]' \\
791
792
  '--pm-path[Explicit tracker storage path for this command]:path:_files -/' \\
792
793
  '--path[Compatibility alias for --pm-path]:path:_files -/' \\
@@ -1353,6 +1354,7 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
1353
1354
  '--edit[Replace the comment at 1-based index (text from positional/--add/--stdin/--file)]:index' \\
1354
1355
  '--delete[Delete the comment at 1-based index]:index' \\
1355
1356
  '--limit[Return only latest n entries]:number' \\
1357
+ '--full-history[Return complete post-mutation history]' \\
1356
1358
  '--author[Entry author (falls back to PM_AUTHOR/settings)]:author' \\
1357
1359
  '--message[History message]:message' \\
1358
1360
  '--force[Force override]' \\
@@ -1371,6 +1373,7 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
1371
1373
  '--since[Return structured events at or after an ISO timestamp]:timestamp' \\
1372
1374
  '--event-type[Return structured events with this top-level type]:event_type' \\
1373
1375
  '--include-meta[Include result counts and truncation metadata]' \\
1376
+ '--full-history[Return complete post-mutation history]' \\
1374
1377
  '--author[Entry author (falls back to PM_AUTHOR/settings)]:author' \\
1375
1378
  '--message[History message]:message' \\
1376
1379
  '--force[Force override]' \\
@@ -1385,6 +1388,7 @@ ${zshSearchRuntimeFieldFlags} '--json[Output JSON]' \\
1385
1388
  '--edit[Replace the entry at a 1-based index]:index' \\
1386
1389
  '--delete[Delete the entry at a 1-based index]:index' \\
1387
1390
  '--limit[Return only latest n entries]:number' \\
1391
+ '--full-history[Return complete post-mutation history]' \\
1388
1392
  '--author[Entry author (falls back to PM_AUTHOR/settings)]:author' \\
1389
1393
  '--message[History message]:message' \\
1390
1394
  '--force[Force override]' \\
@@ -1811,6 +1815,7 @@ complete -c pm -l output-include -d 'Retain comma-separated read fields or secti
1811
1815
  complete -c pm -l output-limit -d 'Set the universal read row ceiling' -r
1812
1816
  complete -c pm -l output-budget -d 'Set the universal estimated-token ceiling' -r
1813
1817
  complete -c pm -l output-format -d 'Select the universal read encoding' -r -a 'toon json'
1818
+ complete -c pm -l output-session -d 'Carry cross-call read budget and served-item state' -r
1814
1819
  complete -c pm -l no-changed-fields -d 'Omit changed_fields array from mutation output'
1815
1820
  complete -c pm -l id-only -d 'Print only id and status for single-item mutation output'
1816
1821
  complete -c pm -l pm-path -d 'Explicit tracker storage path for this command' -r
@@ -2413,6 +2418,7 @@ complete -c pm -n '__fish_seen_subcommand_from notes' -l file -d 'Read entry tex
2413
2418
  complete -c pm -n '__fish_seen_subcommand_from notes' -l edit -d 'Replace the entry at a 1-based index' -r
2414
2419
  complete -c pm -n '__fish_seen_subcommand_from notes' -l delete -d 'Delete the entry at a 1-based index' -r
2415
2420
  complete -c pm -n '__fish_seen_subcommand_from comments notes learnings' -l limit -d 'Return only latest n entries' -r
2421
+ complete -c pm -n '__fish_seen_subcommand_from comments notes learnings' -l full-history -d 'Return complete post-mutation history'
2416
2422
  complete -c pm -n '__fish_seen_subcommand_from comments notes learnings' -l author -d 'Entry author' -r
2417
2423
  complete -c pm -n '__fish_seen_subcommand_from comments notes learnings' -l message -d 'History message' -r
2418
2424
  complete -c pm -n '__fish_seen_subcommand_from comments notes learnings' -l force -d 'Force override'
@@ -2484,6 +2490,7 @@ complete -c pm -n '__fish_seen_subcommand_from stats' -l by-assignee -d 'Lifecyc
2484
2490
  complete -c pm -n '__fish_seen_subcommand_from stats' -l by-tag -d 'Lifecycle-bucketed breakdown grouped by tag'
2485
2491
  complete -c pm -n '__fish_seen_subcommand_from stats' -l by-priority -d 'Lifecycle-bucketed breakdown grouped by priority'
2486
2492
  complete -c pm -n '__fish_seen_subcommand_from stats' -l tag-prefix -d 'With --by-tag: only count tags with this prefix' -r
2493
+ complete -c pm -n '__fish_seen_subcommand_from stats' -l analytics -d 'Improvement ledger/history analytics JSON' -r
2487
2494
 
2488
2495
  # append flags
2489
2496
  complete -c pm -n '__fish_seen_subcommand_from append' -s b -l body -d 'Item body' -r
@@ -2740,4 +2747,4 @@ export function runCompletion(shell, itemTypes = [], tags = [], eagerTagExpansio
2740
2747
  };
2741
2748
  }
2742
2749
  //# sourceMappingURL=completion.js.map
2743
- //# debugId=bba460dd-91d7-5444-b754-58c684a425fd
2750
+ //# debugId=6c9648d7-ab14-5e0d-8793-86ae13643fa6
@@ -4,6 +4,7 @@
4
4
  * Exposes command and action contract data without loading SDK runtime code.
5
5
  */
6
6
  export * from "./cli-contracts.js";
7
+ export * from "./cli-contracts/command-exit-contracts.js";
7
8
  export * from "./context-intent-contracts.js";
8
9
  export * from "./error-code-catalog.js";
9
10
  export * from "./generated-error-code-catalog.js";
@@ -11,3 +12,4 @@ export * from "./flag-invocation-contracts.js";
11
12
  export * from "./output-token-accounting.js";
12
13
  export * from "./output-contracts.js";
13
14
  export * from "./read-output-contracts.js";
15
+ export type { PmReadOutputSessionReceipt, PmReadOutputSessionState, } from "./read-output-session.js";