@unbrained/pm-cli 2026.11.8 → 2026.11.10

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 (619) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +31 -0
  3. package/dist/cli/error-guidance.js +4 -4
  4. package/dist/cli/main.js +1 -1
  5. package/dist/cli/public.d.ts +1 -1
  6. package/dist/cli/register-history-maintenance.js +2 -2
  7. package/dist/cli/register-setup.js +1 -1
  8. package/dist/cli/runtime/projection-retry.js +1 -1
  9. package/dist/cli/runtime/read-output-mutation-retry.js +2 -0
  10. package/dist/cli-bundle/bundle-manifest.json +1 -1
  11. package/dist/cli-bundle/chunks/{chunk-NKO42JMT.js → chunk-4AASUCHO.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-7GC6WIDR.js → chunk-4FLAKTZW.js} +2 -2
  13. package/dist/cli-bundle/chunks/chunk-5CAMQHEW.js +3 -0
  14. package/dist/cli-bundle/chunks/{chunk-NH7QX2M2.js → chunk-7NAAW5EX.js} +2 -2
  15. package/dist/cli-bundle/chunks/chunk-BSJSGDA3.js +3 -0
  16. package/dist/cli-bundle/chunks/{chunk-DOHZKPPC.js → chunk-CZETQYKO.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-YUTFMHSG.js → chunk-D727C4RO.js} +33 -33
  18. package/dist/cli-bundle/chunks/{chunk-XBUZENP4.js → chunk-EHDGHFMJ.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-L5BU5FYN.js → chunk-F6FBGLR7.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-MKW5LGVQ.js → chunk-F7P2NZEG.js} +6 -6
  21. package/dist/cli-bundle/chunks/{chunk-7V6I6X4G.js → chunk-FYD6LSJA.js} +2 -2
  22. package/dist/cli-bundle/chunks/chunk-L4WWG2H6.js +6 -0
  23. package/dist/cli-bundle/chunks/{chunk-S4IZIMAO.js → chunk-NNE63MSM.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-HESIRIVX.js → chunk-NZAFLDSH.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-Z3LWNF7C.js → chunk-OJ2KEDUX.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-4BMPGUTG.js → chunk-T2MNRM3S.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-YGUUJHSR.js → chunk-TBBWPEF5.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-C4MQFWCM.js → chunk-U7LILCUN.js} +2 -2
  29. package/dist/cli-bundle/chunks/chunk-UFPLZ6LZ.js +2 -0
  30. package/dist/cli-bundle/chunks/{chunk-CP43BHX3.js → chunk-UL64P6MR.js} +29 -29
  31. package/dist/cli-bundle/chunks/chunk-WNEUWDUE.js +116 -0
  32. package/dist/cli-bundle/chunks/{chunk-RC6SSFOF.js → chunk-X7NM5HVQ.js} +2 -2
  33. package/dist/cli-bundle/chunks/{chunk-LI2HP5OX.js → chunk-YSWD2NXB.js} +2 -2
  34. package/dist/cli-bundle/chunks/item-revision-M7KXLQXF.js +2 -0
  35. package/dist/cli-bundle/chunks/item-transaction-4N5P34GO.js +2 -0
  36. package/dist/cli-bundle/chunks/{mutation-admission-FJ3D66PV.js → mutation-admission-374UR7NI.js} +2 -2
  37. package/dist/cli-bundle/chunks/{register-list-query-GXP77CX7.js → register-list-query-GSB7PP5P.js} +2 -2
  38. package/dist/cli-bundle/chunks/{register-mutation-XJ2DROUM.js → register-mutation-ZBF6ITYK.js} +2 -2
  39. package/dist/cli-bundle/chunks/{register-operations-O5LERXM7.js → register-operations-PWF6GOHE.js} +2 -2
  40. package/dist/cli-bundle/chunks/{register-setup-4VOTYLL2.js → register-setup-QDZ2Y3CI.js} +2 -2
  41. package/dist/cli-bundle/chunks/{stage-ZDJL3FGL.js → stage-67WGPKPH.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/{chunk-Z2QWZRSL.js → chunk-2SQUWQP3.js} +18 -18
  43. package/dist/cli-bundle/focused-chunks/{chunk-P4EHEH4C.js → chunk-2Y4H4LIX.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/{chunk-WPXMPGTY.js → chunk-3DWNH72D.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/chunk-3K2MYE7R.js +26 -0
  46. package/dist/cli-bundle/focused-chunks/{chunk-LTPT5TE7.js → chunk-56MIAFEN.js} +20 -20
  47. package/dist/cli-bundle/focused-chunks/{chunk-3HFENALW.js → chunk-67M7E2Z3.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-6U5HP6L3.js → chunk-ALLOWZSH.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-I4YUZW3J.js → chunk-BE2GK2G7.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/{chunk-KNF2QTEZ.js → chunk-HTMQDNVC.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-UUVRYIKA.js → chunk-LWMPQRJT.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-O7K3X4LH.js → chunk-LY3JXL25.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-DIEBSC76.js → chunk-NZQYHPUN.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-5YPX3QKU.js → chunk-PAGW6A2X.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/chunk-QCHCEFTO.js +12 -0
  56. package/dist/cli-bundle/focused-chunks/{chunk-4UOXVFJZ.js → chunk-QHGGO7SY.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/chunk-QK7FX4O5.js +44 -0
  58. package/dist/cli-bundle/focused-chunks/{chunk-SZ2BKK3M.js → chunk-RFMKS7VD.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/chunk-U7HWWEJ2.js +2 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-UIZVD36C.js +2 -0
  61. package/dist/cli-bundle/focused-chunks/{chunk-ULTSMJYF.js → chunk-WJHDUON5.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-TSHRBPTI.js → chunk-WK773UVA.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/chunk-ZBOCYFBE.js +82 -0
  64. package/dist/cli-bundle/focused-chunks/item-revision-XC4ZJ7MY.js +2 -0
  65. package/dist/cli-bundle/focused-chunks/{item-transaction-Q2Z7DDCR.js → item-transaction-CVGK4RJP.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/{mutation-admission-QWC6MLTZ.js → mutation-admission-N27D5H64.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/{stage-NKH5SKSZ.js → stage-KPK2UHVO.js} +2 -2
  68. package/dist/cli-bundle/main.js +26 -26
  69. package/dist/cli-bundle/sdk-authoring.js +1 -1
  70. package/dist/cli-bundle/sdk-contracts.js +4 -4
  71. package/dist/cli-bundle/sdk-core.js +1 -1
  72. package/dist/cli-bundle/sdk-governance.js +1 -1
  73. package/dist/cli-bundle/sdk-graph.js +1 -1
  74. package/dist/cli-bundle/sdk-merge.js +57 -57
  75. package/dist/cli-bundle/sdk-query.js +1 -1
  76. package/dist/cli-bundle/sdk-runtime.js +1 -1
  77. package/dist/cli-bundle/sdk-testing.js +1 -1
  78. package/dist/cli-bundle/sdk.js +9 -9
  79. package/dist/core/checkpoint/mutation-checkpoint.d.ts +12 -20
  80. package/dist/core/config/nested-settings.d.ts +14 -45
  81. package/dist/core/config/nested-settings.js +1 -1
  82. package/dist/core/config/positional-value.d.ts +11 -14
  83. package/dist/core/config/positional-value.js +1 -1
  84. package/dist/core/extensions/activation-summary-markdown.d.ts +4 -5
  85. package/dist/core/extensions/activation-summary.d.ts +7 -15
  86. package/dist/core/extensions/capability-usage.d.ts +7 -23
  87. package/dist/core/extensions/command-hook-context.d.ts +4 -7
  88. package/dist/core/extensions/command-metadata-contract.d.ts +2 -2
  89. package/dist/core/extensions/contribution-inventory.d.ts +3 -25
  90. package/dist/core/extensions/extension-capability-aliases.d.ts +7 -10
  91. package/dist/core/extensions/extension-hook-runtime.d.ts +2 -2
  92. package/dist/core/extensions/extension-policy.d.ts +12 -47
  93. package/dist/core/extensions/extension-registries.d.ts +2 -2
  94. package/dist/core/extensions/extension-types.d.ts +332 -545
  95. package/dist/core/extensions/flag-definition-validation.d.ts +11 -13
  96. package/dist/core/extensions/flag-value-types.d.ts +11 -13
  97. package/dist/core/extensions/index.d.ts +15 -20
  98. package/dist/core/extensions/item-field-types.d.ts +5 -5
  99. package/dist/core/extensions/item-fields.d.ts +4 -7
  100. package/dist/core/extensions/loader.d.ts +5 -69
  101. package/dist/core/extensions/manifest-parser.d.ts +3 -3
  102. package/dist/core/extensions/manifest-schema.d.ts +10 -13
  103. package/dist/core/extensions/registration-contracts.d.ts +2 -4
  104. package/dist/core/extensions/registration-validation.d.ts +1 -1
  105. package/dist/core/extensions/registration-values.d.ts +5 -7
  106. package/dist/core/extensions/runtime-registrations.d.ts +6 -6
  107. package/dist/core/extensions/version-compat.d.ts +9 -10
  108. package/dist/core/fs/fs-utils.d.ts +4 -6
  109. package/dist/core/fs/host-environment-errors.d.ts +8 -10
  110. package/dist/core/governance/content-fields.d.ts +10 -14
  111. package/dist/core/governance/issue-codes.d.ts +12 -18
  112. package/dist/core/governance/metadata-coverage.d.ts +24 -34
  113. package/dist/core/history/digest.d.ts +3 -3
  114. package/dist/core/history/event-classification.d.ts +5 -5
  115. package/dist/core/history/event-index.d.ts +14 -35
  116. package/dist/core/history/history-compact-bulk.d.ts +10 -13
  117. package/dist/core/history/history-diff.d.ts +6 -11
  118. package/dist/core/history/history-rewrite.d.ts +24 -40
  119. package/dist/core/history/history-storage-stats.d.ts +9 -17
  120. package/dist/core/history/history-stream-policy.d.ts +8 -11
  121. package/dist/core/history/history.d.ts +10 -44
  122. package/dist/core/history/identity.d.ts +4 -5
  123. package/dist/core/history/operation-contract.d.ts +5 -15
  124. package/dist/core/history/projection.d.ts +10 -14
  125. package/dist/core/history/read.d.ts +6 -7
  126. package/dist/core/history/replay.d.ts +16 -37
  127. package/dist/core/history/workspace-history.d.ts +27 -60
  128. package/dist/core/io/body-file.d.ts +2 -2
  129. package/dist/core/io/bulk-ids-input.d.ts +7 -8
  130. package/dist/core/item/actionability.d.ts +16 -22
  131. package/dist/core/item/dependency-reference.d.ts +2 -2
  132. package/dist/core/item/id.d.ts +5 -9
  133. package/dist/core/item/item-format-version.d.ts +11 -13
  134. package/dist/core/item/item-format.d.ts +20 -60
  135. package/dist/core/item/item-format.js +1 -1
  136. package/dist/core/item/item-record.d.ts +2 -2
  137. package/dist/core/item/literal-mutation-input.d.ts +2 -2
  138. package/dist/core/item/parent-reference-policy.d.ts +4 -7
  139. package/dist/core/item/parse.d.ts +10 -26
  140. package/dist/core/item/plan-lifecycle.d.ts +3 -3
  141. package/dist/core/item/priority.d.ts +2 -2
  142. package/dist/core/item/sprint-release-format.d.ts +3 -7
  143. package/dist/core/item/status-filter.d.ts +5 -7
  144. package/dist/core/item/status.d.ts +3 -4
  145. package/dist/core/item/type-registry.d.ts +17 -24
  146. package/dist/core/item/type-synonyms.d.ts +1 -1
  147. package/dist/core/lock/lock-owner.d.ts +8 -10
  148. package/dist/core/lock/lock.d.ts +19 -67
  149. package/dist/core/output/output-control.d.ts +5 -6
  150. package/dist/core/output/output.d.ts +18 -20
  151. package/dist/core/output/output.js +4 -4
  152. package/dist/core/output/tabular.d.ts +2 -2
  153. package/dist/core/packages/manifest.d.ts +13 -17
  154. package/dist/core/packages/root.d.ts +3 -3
  155. package/dist/core/policy/workflow-policy-schema.d.ts +2 -310
  156. package/dist/core/policy/workflow-policy-store.d.ts +5 -14
  157. package/dist/core/policy/workflow-policy.d.ts +25 -52
  158. package/dist/core/profile/profile-describe.d.ts +8 -11
  159. package/dist/core/profile/profile-lint.d.ts +11 -13
  160. package/dist/core/profile/profile-plan.d.ts +30 -49
  161. package/dist/core/profile/profile-presets.d.ts +25 -36
  162. package/dist/core/reproducibility/context.d.ts +6 -7
  163. package/dist/core/schema/fields-file.d.ts +14 -21
  164. package/dist/core/schema/item-types-file.d.ts +16 -22
  165. package/dist/core/schema/runtime-field-filters.d.ts +2 -2
  166. package/dist/core/schema/runtime-field-values.d.ts +6 -13
  167. package/dist/core/schema/runtime-schema.d.ts +19 -31
  168. package/dist/core/schema/status-defs-file.d.ts +15 -25
  169. package/dist/core/schema/status-token.d.ts +1 -1
  170. package/dist/core/schema/type-inference.d.ts +6 -8
  171. package/dist/core/schema/type-presets.d.ts +5 -5
  172. package/dist/core/schema/type-workflows.d.ts +11 -16
  173. package/dist/core/search/background-refresh.d.ts +6 -12
  174. package/dist/core/search/bm25.d.ts +11 -19
  175. package/dist/core/search/cache.d.ts +19 -41
  176. package/dist/core/search/corpus.d.ts +16 -19
  177. package/dist/core/search/corpus.js +1 -1
  178. package/dist/core/search/embedding-batches.d.ts +12 -17
  179. package/dist/core/search/eval-thresholds.d.ts +3 -3
  180. package/dist/core/search/eval.d.ts +16 -34
  181. package/dist/core/search/http-client.d.ts +14 -18
  182. package/dist/core/search/providers.d.ts +22 -39
  183. package/dist/core/search/relevance.d.ts +14 -19
  184. package/dist/core/search/semantic-defaults.d.ts +4 -5
  185. package/dist/core/search/vector-stores.d.ts +35 -57
  186. package/dist/core/search/vectorization-metadata.d.ts +9 -11
  187. package/dist/core/sentry/helpers.d.ts +6 -31
  188. package/dist/core/sentry/instrument.d.ts +6 -59
  189. package/dist/core/session/session-state.d.ts +12 -32
  190. package/dist/core/shared/agent-session-context.d.ts +10 -17
  191. package/dist/core/shared/author.d.ts +48 -69
  192. package/dist/core/shared/command-line.d.ts +3 -3
  193. package/dist/core/shared/command-types.d.ts +3 -4
  194. package/dist/core/shared/constants.d.ts +14 -32
  195. package/dist/core/shared/error-details.d.ts +5 -18
  196. package/dist/core/shared/errors.d.ts +42 -83
  197. package/dist/core/shared/html-entity-decode.d.ts +1 -1
  198. package/dist/core/shared/item-metadata-contract.d.ts +2 -2
  199. package/dist/core/shared/lazy-module.d.ts +1 -1
  200. package/dist/core/shared/levenshtein.d.ts +1 -1
  201. package/dist/core/shared/numeric-parsers.d.ts +1 -1
  202. package/dist/core/shared/option-alias-visibility.d.ts +2 -2
  203. package/dist/core/shared/output-unicode.d.ts +1 -1
  204. package/dist/core/shared/primitives.d.ts +10 -10
  205. package/dist/core/shared/secret-rules.d.ts +7 -93
  206. package/dist/core/shared/serial-queue.d.ts +7 -9
  207. package/dist/core/shared/serialization.d.ts +1 -1
  208. package/dist/core/shared/split-comma-list.d.ts +4 -5
  209. package/dist/core/shared/text-normalization.d.ts +1 -1
  210. package/dist/core/shared/time.d.ts +6 -20
  211. package/dist/core/store/item-format-migration.d.ts +4 -5
  212. package/dist/core/store/item-metadata-cache.d.ts +22 -27
  213. package/dist/core/store/item-metadata-query-index.d.ts +20 -61
  214. package/dist/core/store/item-metadata-read-work.d.ts +3 -7
  215. package/dist/core/store/item-mutation-precondition.d.ts +19 -35
  216. package/dist/core/store/item-store.d.ts +18 -141
  217. package/dist/core/store/paths.d.ts +5 -10
  218. package/dist/core/store/settings-read-cache.d.ts +7 -9
  219. package/dist/core/store/settings-sections.d.ts +15 -19
  220. package/dist/core/store/settings-validator.d.ts +27 -143
  221. package/dist/core/store/settings-validator.js +1 -1
  222. package/dist/core/store/settings.d.ts +19 -94
  223. package/dist/core/store/sqlite-runtime.d.ts +3 -3
  224. package/dist/core/store/tracker-preflight.d.ts +2 -2
  225. package/dist/core/telemetry/consent.d.ts +2 -2
  226. package/dist/core/telemetry/observability.d.ts +8 -19
  227. package/dist/core/telemetry/policy.d.ts +8 -23
  228. package/dist/core/telemetry/runtime.d.ts +44 -254
  229. package/dist/core/test/background-runs.d.ts +35 -79
  230. package/dist/core/test/run-selectors.d.ts +10 -12
  231. package/dist/core/validate/fix-planning.d.ts +19 -28
  232. package/dist/core/validate/missing-by-type.d.ts +3 -4
  233. package/dist/core/validate/missing-link-owners.d.ts +12 -16
  234. package/dist/core/validate/stale-file-classification.d.ts +5 -6
  235. package/dist/mcp/tool-definitions.d.ts +7 -30
  236. package/dist/mcp/tool-definitions.js +1 -1
  237. package/dist/sdk/actionability.d.ts +1 -1
  238. package/dist/sdk/agent/closed-domain-contracts.d.ts +4 -5
  239. package/dist/sdk/agent/command-recovery.d.ts +9 -13
  240. package/dist/sdk/agent/command-suggestions.d.ts +2 -2
  241. package/dist/sdk/agent/create-option-policy.d.ts +2 -2
  242. package/dist/sdk/agent/identity-config.d.ts +13 -18
  243. package/dist/sdk/agent/item-addressing.d.ts +4 -5
  244. package/dist/sdk/agent/linked-resource-recovery.d.ts +3 -4
  245. package/dist/sdk/agent/refusal-closure-census.d.ts +13 -25
  246. package/dist/sdk/agent/refusal-closure.d.ts +8 -11
  247. package/dist/sdk/agent/refusal-corpus-contracts.d.ts +15 -21
  248. package/dist/sdk/agent/refusal-reachability.d.ts +38 -52
  249. package/dist/sdk/agent/subcommand-recovery.d.ts +7 -15
  250. package/dist/sdk/agent/task-transcript-contracts.d.ts +12 -15
  251. package/dist/sdk/agent/tracker-preflight-contracts.d.ts +13 -17
  252. package/dist/sdk/agent-capability-contracts.d.ts +19 -32
  253. package/dist/sdk/agent-session-context.d.ts +1 -1
  254. package/dist/sdk/annotations.d.ts +32 -68
  255. package/dist/sdk/annotations.js +1 -1
  256. package/dist/sdk/author-attribution.d.ts +22 -33
  257. package/dist/sdk/authoring.d.ts +1 -19
  258. package/dist/sdk/cli-bootstrap.d.ts +22 -59
  259. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +31 -57
  260. package/dist/sdk/cli-contracts/command-aliases.d.ts +7 -8
  261. package/dist/sdk/cli-contracts/command-exit-contracts.d.ts +19 -65
  262. package/dist/sdk/cli-contracts/commander-mutation-options.d.ts +2 -2
  263. package/dist/sdk/cli-contracts/commander-types.d.ts +6 -11
  264. package/dist/sdk/cli-contracts/completeness.d.ts +11 -15
  265. package/dist/sdk/cli-contracts/enum-contracts.d.ts +25 -37
  266. package/dist/sdk/cli-contracts/flag-contracts.d.ts +16 -20
  267. package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +14 -19
  268. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +29 -47
  269. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +44 -265
  270. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +11 -564
  271. package/dist/sdk/cli-contracts/tool-schema.d.ts +18 -51
  272. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +18 -37
  273. package/dist/sdk/cli-contracts.d.ts +1 -16
  274. package/dist/sdk/cli-program.d.ts +2 -2
  275. package/dist/sdk/command-line.d.ts +3 -4
  276. package/dist/sdk/comments.d.ts +6 -10
  277. package/dist/sdk/compile-cache.d.ts +4 -5
  278. package/dist/sdk/completion/bash.d.ts +2 -2
  279. package/dist/sdk/completion/fish.d.ts +2 -2
  280. package/dist/sdk/completion/shared.d.ts +10 -77
  281. package/dist/sdk/completion/shared.js +1 -1
  282. package/dist/sdk/completion/zsh.d.ts +2 -2
  283. package/dist/sdk/completion.d.ts +2 -6
  284. package/dist/sdk/compose.d.ts +49 -74
  285. package/dist/sdk/config.d.ts +18 -94
  286. package/dist/sdk/config.js +1 -1
  287. package/dist/sdk/context/recency.d.ts +2 -2
  288. package/dist/sdk/context/semantic-session-attribution.d.ts +6 -25
  289. package/dist/sdk/context/usage-ledger.d.ts +9 -21
  290. package/dist/sdk/context-intent-contracts.d.ts +24 -35
  291. package/dist/sdk/context-intent-runtime.d.ts +7 -9
  292. package/dist/sdk/context-packing.d.ts +16 -34
  293. package/dist/sdk/context-relevance.d.ts +58 -93
  294. package/dist/sdk/context-signal-store.d.ts +29 -60
  295. package/dist/sdk/context-usage.d.ts +22 -69
  296. package/dist/sdk/contracts.d.ts +1 -24
  297. package/dist/sdk/core-governance.d.ts +1 -5
  298. package/dist/sdk/core.d.ts +1 -27
  299. package/dist/sdk/corpus-shape.d.ts +16 -28
  300. package/dist/sdk/define.d.ts +10 -14
  301. package/dist/sdk/dependencies.d.ts +32 -50
  302. package/dist/sdk/dependency-provenance.d.ts +19 -23
  303. package/dist/sdk/docs.d.ts +6 -10
  304. package/dist/sdk/duplicates.d.ts +8 -15
  305. package/dist/sdk/environment/agent-environment.d.ts +60 -101
  306. package/dist/sdk/environment/host-environment-errors.d.ts +1 -1
  307. package/dist/sdk/environment/project-runtime-compatibility.d.ts +15 -29
  308. package/dist/sdk/environment/source-context.d.ts +6 -7
  309. package/dist/sdk/environment/tracker-preflight.d.ts +1 -1
  310. package/dist/sdk/error-code-catalog.d.ts +9 -26
  311. package/dist/sdk/error-runtime.d.ts +6 -8
  312. package/dist/sdk/errors.d.ts +10 -17
  313. package/dist/sdk/eval.d.ts +11 -21
  314. package/dist/sdk/extension/command-options.d.ts +14 -26
  315. package/dist/sdk/extension/describe.d.ts +14 -19
  316. package/dist/sdk/extension/doctor.d.ts +8 -48
  317. package/dist/sdk/extension/install-plan.d.ts +12 -26
  318. package/dist/sdk/extension/install-runtime.d.ts +10 -11
  319. package/dist/sdk/extension/install-sources.d.ts +22 -104
  320. package/dist/sdk/extension/managed-state.d.ts +13 -18
  321. package/dist/sdk/extension/migrations.d.ts +22 -37
  322. package/dist/sdk/extension/output-ownership.d.ts +3 -30
  323. package/dist/sdk/extension/shared.d.ts +9 -15
  324. package/dist/sdk/extension/source-resolution.d.ts +13 -18
  325. package/dist/sdk/extension/static-inventory.d.ts +17 -21
  326. package/dist/sdk/extension/update-check.d.ts +7 -11
  327. package/dist/sdk/extension-command-context.d.ts +2 -3
  328. package/dist/sdk/extension-contracts.d.ts +11 -14
  329. package/dist/sdk/extension.d.ts +31 -192
  330. package/dist/sdk/files.d.ts +27 -68
  331. package/dist/sdk/flag-invocation-contracts.d.ts +13 -17
  332. package/dist/sdk/generated/error-code-catalog-rows.js +1 -1
  333. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  334. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  335. package/dist/sdk/generated-error-code-catalog.d.ts +1 -1
  336. package/dist/sdk/governance/artifact-ledgers.d.ts +9 -16
  337. package/dist/sdk/governance/assurance-action-contracts.d.ts +1 -1
  338. package/dist/sdk/governance/assurance-action.d.ts +13 -45
  339. package/dist/sdk/governance/assurance-mutation-error.d.ts +12 -17
  340. package/dist/sdk/governance/assurance-presets.d.ts +10 -21
  341. package/dist/sdk/governance/assurance-runtime.d.ts +5 -6
  342. package/dist/sdk/governance/assurance.d.ts +97 -154
  343. package/dist/sdk/governance/boundary-fixtures.d.ts +17 -23
  344. package/dist/sdk/governance/closure-timestamps.d.ts +5 -15
  345. package/dist/sdk/governance/coverage-assurance.d.ts +5 -6
  346. package/dist/sdk/governance/defect-recurrence-coverage.d.ts +13 -23
  347. package/dist/sdk/governance/defect-recurrence-graph.d.ts +9 -13
  348. package/dist/sdk/governance/defect-recurrence.d.ts +43 -67
  349. package/dist/sdk/governance/extension-host-version.d.ts +8 -10
  350. package/dist/sdk/governance/gc.d.ts +12 -20
  351. package/dist/sdk/governance/health/projection.d.ts +8 -23
  352. package/dist/sdk/governance/health.d.ts +23 -167
  353. package/dist/sdk/governance/hierarchy-validation.d.ts +2 -18
  354. package/dist/sdk/governance/linked-file-report.d.ts +6 -10
  355. package/dist/sdk/governance/merge-receipt-history.d.ts +12 -16
  356. package/dist/sdk/governance/provenance-health.d.ts +17 -23
  357. package/dist/sdk/governance/reindex.d.ts +13 -116
  358. package/dist/sdk/governance/reliability.d.ts +13 -17
  359. package/dist/sdk/governance/stale-work.d.ts +8 -11
  360. package/dist/sdk/governance/status-role-diagnostics.d.ts +4 -6
  361. package/dist/sdk/governance/storage-integrity.d.ts +16 -23
  362. package/dist/sdk/governance/upgrade.d.ts +17 -57
  363. package/dist/sdk/governance/validate-item-reader.d.ts +3 -11
  364. package/dist/sdk/governance/validate-normalization.d.ts +2 -2
  365. package/dist/sdk/governance/validate.d.ts +29 -175
  366. package/dist/sdk/governance/workflow-completeness.d.ts +5 -17
  367. package/dist/sdk/governance/workflow-policy.d.ts +8 -16
  368. package/dist/sdk/governance/workspace-position.d.ts +12 -43
  369. package/dist/sdk/governance.d.ts +1 -39
  370. package/dist/sdk/graph/adapter.d.ts +23 -41
  371. package/dist/sdk/graph/analytics.d.ts +20 -31
  372. package/dist/sdk/graph/assembly.d.ts +24 -35
  373. package/dist/sdk/graph/cache.d.ts +13 -25
  374. package/dist/sdk/graph/cardinality-integrity.d.ts +4 -6
  375. package/dist/sdk/graph/centrality.d.ts +14 -20
  376. package/dist/sdk/graph/conformance.d.ts +12 -19
  377. package/dist/sdk/graph/deadline-scheduling.d.ts +14 -20
  378. package/dist/sdk/graph/durable-cache.d.ts +11 -14
  379. package/dist/sdk/graph/governance-contracts.d.ts +2 -2
  380. package/dist/sdk/graph/governance.d.ts +22 -36
  381. package/dist/sdk/graph/hierarchy-integrity.d.ts +18 -26
  382. package/dist/sdk/graph/index.d.ts +1 -17
  383. package/dist/sdk/graph/lifecycle-coverage.d.ts +8 -12
  384. package/dist/sdk/graph/mutation-advisory.d.ts +5 -16
  385. package/dist/sdk/graph/query-contracts.d.ts +1 -2
  386. package/dist/sdk/graph/remediation.d.ts +11 -18
  387. package/dist/sdk/graph/run.d.ts +73 -115
  388. package/dist/sdk/graph/scheduling.d.ts +8 -15
  389. package/dist/sdk/graph/traversal.d.ts +9 -15
  390. package/dist/sdk/graph/workspace-relationship-kind-registry.d.ts +2 -2
  391. package/dist/sdk/graph.d.ts +1 -12
  392. package/dist/sdk/guide-topics.d.ts +7 -10
  393. package/dist/sdk/guide.d.ts +21 -43
  394. package/dist/sdk/history/attestation-command.d.ts +7 -10
  395. package/dist/sdk/history/attestation-contract.d.ts +19 -34
  396. package/dist/sdk/history/attestation.d.ts +2 -3
  397. package/dist/sdk/history/maintenance.d.ts +17 -27
  398. package/dist/sdk/history/salvage.d.ts +5 -22
  399. package/dist/sdk/history/subject.d.ts +5 -11
  400. package/dist/sdk/history-analytics.d.ts +28 -59
  401. package/dist/sdk/history-compact.d.ts +25 -66
  402. package/dist/sdk/history-provenance.d.ts +16 -33
  403. package/dist/sdk/history-read.d.ts +9 -16
  404. package/dist/sdk/history-redact.d.ts +19 -74
  405. package/dist/sdk/history-redact.js +1 -1
  406. package/dist/sdk/history-repair.d.ts +26 -71
  407. package/dist/sdk/improvement-ledger-validation.d.ts +2 -2
  408. package/dist/sdk/improvement-ledger.d.ts +20 -39
  409. package/dist/sdk/index.d.ts +1 -268
  410. package/dist/sdk/init-agent-guidance.d.ts +13 -68
  411. package/dist/sdk/init.d.ts +24 -94
  412. package/dist/sdk/invocation-author.d.ts +1 -1
  413. package/dist/sdk/item-children.d.ts +10 -13
  414. package/dist/sdk/item-metadata-index.d.ts +1 -2
  415. package/dist/sdk/item-schedule.d.ts +8 -9
  416. package/dist/sdk/item-transaction.d.ts +46 -90
  417. package/dist/sdk/learnings.d.ts +6 -10
  418. package/dist/sdk/lifecycle/append.d.ts +7 -9
  419. package/dist/sdk/lifecycle/claim.d.ts +26 -42
  420. package/dist/sdk/lifecycle/cli-input.d.ts +1 -1
  421. package/dist/sdk/lifecycle/close-many.d.ts +14 -65
  422. package/dist/sdk/lifecycle/close.d.ts +10 -26
  423. package/dist/sdk/lifecycle/copy.d.ts +6 -10
  424. package/dist/sdk/lifecycle/create.d.ts +15 -83
  425. package/dist/sdk/lifecycle/delete.d.ts +7 -9
  426. package/dist/sdk/lifecycle/focus.d.ts +9 -11
  427. package/dist/sdk/lifecycle/item-revision.d.ts +31 -45
  428. package/dist/sdk/lifecycle/item-revision.js +1 -1
  429. package/dist/sdk/lifecycle/lifecycle-transitions.d.ts +4 -5
  430. package/dist/sdk/lifecycle/mutation-command-options.d.ts +6 -9
  431. package/dist/sdk/lifecycle/plan-mutation-receipt.d.ts +5 -13
  432. package/dist/sdk/lifecycle/plan.d.ts +34 -74
  433. package/dist/sdk/lifecycle/reopen.d.ts +8 -14
  434. package/dist/sdk/lifecycle/restore.d.ts +9 -38
  435. package/dist/sdk/lifecycle/shared-unset-fields.d.ts +23 -614
  436. package/dist/sdk/lifecycle/start-blockers.d.ts +7 -27
  437. package/dist/sdk/lifecycle/structured-mutation-plan.d.ts +8 -16
  438. package/dist/sdk/lifecycle/task-composition.d.ts +6 -14
  439. package/dist/sdk/lifecycle/update-many.d.ts +15 -65
  440. package/dist/sdk/lifecycle/update.d.ts +21 -104
  441. package/dist/sdk/lifecycle/workflow-transition.d.ts +2 -11
  442. package/dist/sdk/lifecycle-completion.d.ts +11 -14
  443. package/dist/sdk/lifecycle-policy.d.ts +23 -32
  444. package/dist/sdk/linked-artifacts.d.ts +31 -41
  445. package/dist/sdk/mcp/apps.d.ts +12 -27
  446. package/dist/sdk/mcp/authorization.d.ts +30 -63
  447. package/dist/sdk/mcp/discovery.d.ts +23 -52
  448. package/dist/sdk/mcp/executable.d.ts +3 -10
  449. package/dist/sdk/mcp/interactions.d.ts +25 -47
  450. package/dist/sdk/mcp/protocol.d.ts +32 -64
  451. package/dist/sdk/mcp/skills.d.ts +21 -71
  452. package/dist/sdk/mcp/subscriptions.d.ts +14 -28
  453. package/dist/sdk/mcp/tasks.d.ts +21 -55
  454. package/dist/sdk/mcp/transport.d.ts +7 -15
  455. package/dist/sdk/merge/driver.d.ts +13 -37
  456. package/dist/sdk/merge/index.d.ts +1 -6
  457. package/dist/sdk/merge/install.d.ts +27 -55
  458. package/dist/sdk/merge/receipt-operation.d.ts +5 -6
  459. package/dist/sdk/merge/receipt-schema.d.ts +6 -9
  460. package/dist/sdk/merge/receipts.d.ts +29 -79
  461. package/dist/sdk/merge/reconcile.d.ts +9 -18
  462. package/dist/sdk/merge/three-way.d.ts +21 -30
  463. package/dist/sdk/merge.d.ts +1 -5
  464. package/dist/sdk/mutation-events.d.ts +21 -53
  465. package/dist/sdk/mutation-guard.d.ts +15 -135
  466. package/dist/sdk/notes.d.ts +6 -10
  467. package/dist/sdk/output/fit-envelope.d.ts +21 -28
  468. package/dist/sdk/output/list-envelope.d.ts +1 -1
  469. package/dist/sdk/output/table-rows.d.ts +8 -12
  470. package/dist/sdk/output-contracts.d.ts +11 -14
  471. package/dist/sdk/output-projection.d.ts +18 -130
  472. package/dist/sdk/output-token-accounting.d.ts +8 -15
  473. package/dist/sdk/output.d.ts +10 -15
  474. package/dist/sdk/ownership-source.d.ts +4 -5
  475. package/dist/sdk/package-import-adapters.d.ts +27 -37
  476. package/dist/sdk/package-migrations.d.ts +2 -2
  477. package/dist/sdk/package-runtime-options.d.ts +3 -3
  478. package/dist/sdk/pagination.d.ts +12 -24
  479. package/dist/sdk/profile.d.ts +25 -42
  480. package/dist/sdk/provenance.d.ts +21 -32
  481. package/dist/sdk/public-surface.json +1 -1
  482. package/dist/sdk/query/activity.d.ts +24 -77
  483. package/dist/sdk/query/aggregate.d.ts +20 -95
  484. package/dist/sdk/query/calendar.d.ts +26 -74
  485. package/dist/sdk/query/complete-list.d.ts +19 -35
  486. package/dist/sdk/query/context.d.ts +69 -240
  487. package/dist/sdk/query/declared-blockers.d.ts +2 -9
  488. package/dist/sdk/query/duplicate-candidates.d.ts +3 -5
  489. package/dist/sdk/query/get-facet-roots.js +2 -0
  490. package/dist/sdk/query/get.d.ts +13 -55
  491. package/dist/sdk/query/get.js +1 -1
  492. package/dist/sdk/query/history.d.ts +18 -29
  493. package/dist/sdk/query/item-filter-options.d.ts +7 -12
  494. package/dist/sdk/query/list-filter-shared.d.ts +4 -8
  495. package/dist/sdk/query/list.d.ts +44 -168
  496. package/dist/sdk/query/multi-value-filters.d.ts +7 -9
  497. package/dist/sdk/query/next-ranking-policy.d.ts +4 -10
  498. package/dist/sdk/query/next-ready-budget.d.ts +4 -5
  499. package/dist/sdk/query/next.d.ts +27 -86
  500. package/dist/sdk/query/parsers.d.ts +4 -6
  501. package/dist/sdk/query/projection-contracts.d.ts +12 -21
  502. package/dist/sdk/query/search/corpus.d.ts +5 -20
  503. package/dist/sdk/query/search/filters.d.ts +5 -17
  504. package/dist/sdk/query/search/input.d.ts +4 -9
  505. package/dist/sdk/query/search/lexical.d.ts +5 -9
  506. package/dist/sdk/query/search/response.d.ts +5 -22
  507. package/dist/sdk/query/search/semantic.d.ts +24 -170
  508. package/dist/sdk/query/search/types.d.ts +19 -73
  509. package/dist/sdk/query/search-contracts.d.ts +24 -34
  510. package/dist/sdk/query/search-pagination.d.ts +5 -24
  511. package/dist/sdk/query/search-rendering.d.ts +8 -32
  512. package/dist/sdk/query/search.d.ts +3 -63
  513. package/dist/sdk/query/workspace-contracts.d.ts +2 -2
  514. package/dist/sdk/query.d.ts +1 -43
  515. package/dist/sdk/read-output/continuation.d.ts +5 -6
  516. package/dist/sdk/read-output/options.d.ts +3 -8
  517. package/dist/sdk/read-output/positional-rows.js +2 -0
  518. package/dist/sdk/read-output/session-result.d.ts +2 -33
  519. package/dist/sdk/read-output/tail-retention.d.ts +6 -8
  520. package/dist/sdk/read-output-budget.d.ts +14 -16
  521. package/dist/sdk/read-output-contracts.d.ts +62 -102
  522. package/dist/sdk/read-output-contracts.js +1 -1
  523. package/dist/sdk/read-output-rows.d.ts +5 -9
  524. package/dist/sdk/read-output-session.d.ts +11 -14
  525. package/dist/sdk/relationship-analytics.d.ts +17 -37
  526. package/dist/sdk/relationship-context.d.ts +15 -33
  527. package/dist/sdk/relationship-history.d.ts +29 -50
  528. package/dist/sdk/relationship-kinds/contract.d.ts +11 -12
  529. package/dist/sdk/relationship-migration.d.ts +6 -10
  530. package/dist/sdk/relationships.d.ts +22 -34
  531. package/dist/sdk/reproducibility/process.d.ts +7 -11
  532. package/dist/sdk/runtime/actions.js +1 -1
  533. package/dist/sdk/runtime/context.d.ts +6 -22
  534. package/dist/sdk/runtime/schema-preview.d.ts +1 -1
  535. package/dist/sdk/runtime-input.d.ts +9 -20
  536. package/dist/sdk/runtime-primitives.d.ts +3 -82
  537. package/dist/sdk/runtime-public-contracts.d.ts +30 -50
  538. package/dist/sdk/runtime.d.ts +77 -302
  539. package/dist/sdk/scheduling-shortcuts.d.ts +8 -12
  540. package/dist/sdk/schema-migration.d.ts +18 -80
  541. package/dist/sdk/schema.d.ts +89 -192
  542. package/dist/sdk/search-refresh-worker.d.ts +1 -1
  543. package/dist/sdk/similarity-scoring.d.ts +6 -8
  544. package/dist/sdk/similarity.d.ts +33 -64
  545. package/dist/sdk/start-task-status.d.ts +2 -2
  546. package/dist/sdk/stats.d.ts +13 -48
  547. package/dist/sdk/structured-mutations.d.ts +18 -26
  548. package/dist/sdk/telemetry-flush.d.ts +1 -1
  549. package/dist/sdk/telemetry.d.ts +14 -20
  550. package/dist/sdk/templates.d.ts +14 -35
  551. package/dist/sdk/test/batch.d.ts +10 -25
  552. package/dist/sdk/test/execution.d.ts +44 -209
  553. package/dist/sdk/test/json-path.d.ts +2 -5
  554. package/dist/sdk/test/linked-command-detection.d.ts +10 -25
  555. package/dist/sdk/test/measurements.d.ts +10 -13
  556. package/dist/sdk/test/parsers.d.ts +16 -20
  557. package/dist/sdk/test/prerequisites.d.ts +2 -3
  558. package/dist/sdk/test/runs.d.ts +19 -52
  559. package/dist/sdk/test/trust.d.ts +8 -12
  560. package/dist/sdk/test/update.d.ts +9 -25
  561. package/dist/sdk/testing.d.ts +97 -206
  562. package/dist/sdk/traceability/source-traceability.d.ts +25 -56
  563. package/dist/sdk/tracker-root-discovery.d.ts +1 -1
  564. package/dist/sdk/workspace-contracts-cache.d.ts +2 -2
  565. package/dist/sdk/workspace-contracts.d.ts +8 -14
  566. package/dist/sdk/workspace-memory.d.ts +24 -42
  567. package/dist/sdk/workspace-recipe.d.ts +10 -14
  568. package/dist/sdk/workspace-snapshot.d.ts +26 -53
  569. package/dist/sdk/workspace-transaction-gc.d.ts +12 -16
  570. package/dist/sdk/workspace-transaction.d.ts +26 -40
  571. package/dist/sdk/workspace.d.ts +8 -10
  572. package/dist/types/index.d.ts +1 -1
  573. package/dist/types.d.ts +210 -353
  574. package/docs/AGENT_OUTPUT_ENCODINGS.md +16 -0
  575. package/docs/COMMANDS.md +8 -0
  576. package/docs/CONFIGURATION.md +17 -0
  577. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +28 -9
  578. package/docs/README.md +1 -1
  579. package/docs/READ_OUTPUT_CONTRACTS.md +21 -0
  580. package/docs/RELEASING.md +52 -5
  581. package/docs/SDK.md +17 -2
  582. package/docs/TESTING.md +11 -0
  583. package/marketplace.json +1 -1
  584. package/package.json +2 -1
  585. package/packages/pm-beads/package.json +1 -1
  586. package/packages/pm-calendar/package.json +1 -1
  587. package/packages/pm-command-kit/package.json +1 -1
  588. package/packages/pm-digital-twin/package.json +1 -1
  589. package/packages/pm-governance-audit/package.json +1 -1
  590. package/packages/pm-guide-shell/package.json +1 -1
  591. package/packages/pm-kanban/package.json +1 -1
  592. package/packages/pm-lifecycle-hooks/package.json +1 -1
  593. package/packages/pm-linked-test-adapters/package.json +1 -1
  594. package/packages/pm-search-advanced/package.json +1 -1
  595. package/packages/pm-templates/package.json +1 -1
  596. package/packages/pm-todos/package.json +1 -1
  597. package/packages/pm-vcs/package.json +1 -1
  598. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  599. package/plugins/pm-claude/package.json +1 -1
  600. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  601. package/plugins/pm-codex/package.json +1 -1
  602. package/plugins/pm-codex/plugin.json +1 -1
  603. package/runtime-dependencies.json +1 -1
  604. package/scripts/finalize-build.mjs +41 -4
  605. package/dist/cli-bundle/chunks/chunk-3A5DJZCC.js +0 -116
  606. package/dist/cli-bundle/chunks/chunk-AFZS6WFV.js +0 -3
  607. package/dist/cli-bundle/chunks/chunk-JAE5MWLX.js +0 -2
  608. package/dist/cli-bundle/chunks/chunk-LLTRUVKK.js +0 -6
  609. package/dist/cli-bundle/chunks/chunk-PE6CZ3PE.js +0 -3
  610. package/dist/cli-bundle/chunks/item-revision-TUGZYYXX.js +0 -2
  611. package/dist/cli-bundle/chunks/item-transaction-2RRBAQN3.js +0 -2
  612. package/dist/cli-bundle/focused-chunks/chunk-2A3QZELL.js +0 -26
  613. package/dist/cli-bundle/focused-chunks/chunk-KBRSA4OK.js +0 -44
  614. package/dist/cli-bundle/focused-chunks/chunk-P6TG33FV.js +0 -82
  615. package/dist/cli-bundle/focused-chunks/chunk-PL6EO4GJ.js +0 -2
  616. package/dist/cli-bundle/focused-chunks/chunk-PSLDGAEY.js +0 -12
  617. package/dist/cli-bundle/focused-chunks/chunk-UNNLBJRI.js +0 -2
  618. package/dist/cli-bundle/focused-chunks/item-revision-XNSRDTFB.js +0 -2
  619. package/docs/ECOSYSTEM_PLANNING_REVIEW.md +0 -274
@@ -1,49 +1,42 @@
1
- import { bindItemRevisionScope,createItemRevisionScope,itemRevisionScopeReceipt,runWithItemRevisionScope,type ItemRevisionRecoveryInvocation,type ItemRevisionScope } from "../../core/store/item-mutation-precondition.js";
2
- import { PmCliError,type PmCliErrorDetails } from "../../core/shared/errors.js";
3
- export type { ItemRevisionRecoveryInvocation,ItemRevisionScope } from "../../core/store/item-mutation-precondition.js";
1
+ import{bindItemRevisionScope,createItemRevisionScope,itemRevisionScopeReceipt,runWithItemRevisionScope,type ItemRevisionRecoveryInvocation,type ItemRevisionScope}from "../../core/store/item-mutation-precondition.js";import{PmCliError,type PmCliErrorDetails}from "../../core/shared/errors.js";export type{ItemRevisionRecoveryInvocation,ItemRevisionScope}from "../../core/store/item-mutation-precondition.js";
4
2
  /** Refusal code for a locked write that found a revision other than the declared one. */
5
- export declare const ITEM_REVISION_CONFLICT_CODE = "item_revision_conflict";
3
+ export declare const ITEM_REVISION_CONFLICT_CODE="item_revision_conflict";
6
4
  /** Most recent history entries a conflict refusal describes. */
7
- export declare const ITEM_REVISION_CONFLICT_CHANGE_LIMIT = 10;
5
+ export declare const ITEM_REVISION_CONFLICT_CHANGE_LIMIT=10;
8
6
  /** One item revision a caller decided on. */
9
- export interface ExpectedItemRevision {
7
+ export interface ExpectedItemRevision{
10
8
  /** Item id; unprefixed ids are normalized with the workspace id prefix. */
11
9
  id:string;
12
10
  /** The `item_hash` returned by `pm get` or {@link readItemRevision}. */
13
- itemHash:string;
14
- }
11
+ itemHash:string;}
15
12
  /** Current revision of one item. */
16
- export interface ItemRevision {
13
+ export interface ItemRevision{
17
14
  /** Canonical item id. */
18
15
  id:string;
19
16
  /** SHA-256 of the canonical item document, equal to its latest history `after_hash`. */
20
- item_hash:string;
21
- }
17
+ item_hash:string;}
22
18
  /** Tracker selection for revision reads and guarded operations. */
23
- export interface ItemRevisionContext {
19
+ export interface ItemRevisionContext{
24
20
  /** Tracker root (the SDK equivalent of `--pm-path`). */
25
21
  pmRoot?:string;
26
22
  /** Working directory used when `pmRoot` is omitted. */
27
- cwd?:string;
28
- }
23
+ cwd?:string;}
29
24
  /** Result of an operation run under expected revisions. */
30
- export interface ExpectedItemRevisionsOutcome<T> {
25
+ export interface ExpectedItemRevisionsOutcome<T>{
31
26
  /** Value returned by the guarded operation. */
32
27
  result:T;
33
28
  /** Canonical ids whose expectation a locked write evaluated. */
34
29
  checked:string[];
35
30
  /** Canonical ids the operation never wrote, so their expectation was never evaluated. */
36
- unchecked:string[];
37
- }
31
+ unchecked:string[];}
38
32
  /** One parsed `--expect-hash` / `expect_hash` token before id resolution. */
39
- export interface ExpectHashSpec {
33
+ export interface ExpectHashSpec{
40
34
  /** Explicit target id, or undefined when the token binds to the command's item. */
41
35
  id?:string;
42
36
  /** Normalized lowercase revision. */
43
- itemHash:string;
44
- }
37
+ itemHash:string;}
45
38
  /** One history entry summarized for a revision conflict. */
46
- export interface ItemRevisionChange {
39
+ export interface ItemRevisionChange{
47
40
  /** Entry timestamp. */
48
41
  ts:string;
49
42
  /** History operation. */
@@ -51,15 +44,14 @@ op:string;
51
44
  /** Recorded author. */
52
45
  author:string;
53
46
  /** Top-level metadata fields (or `body`) the entry changed. */
54
- fields:string[];
55
- }
47
+ fields:string[];}
56
48
  /** Normalize one declared revision, refusing anything that cannot be an item_hash. */
57
49
  export declare function normalizeExpectedItemHash(value:unknown):string;
58
50
  /**
59
51
  * Parse expected-revision tokens. A bare hash binds to the command's item; the
60
52
  * `<id>=<hash>` form names its target explicitly, which bulk commands require.
61
53
  */
62
- export declare function parseExpectHashSpecs(values:string | readonly string[] | undefined):ExpectHashSpec[];
54
+ export declare function parseExpectHashSpecs(values:string|readonly string[]|undefined):ExpectHashSpec[];
63
55
  /** Read the current revision of one item (the tombstone revision for a deleted item) without writing anything. */
64
56
  export declare function readItemRevision(id:string,context?:ItemRevisionContext):Promise<ItemRevision>;
65
57
  /**
@@ -71,13 +63,9 @@ export declare function resolveExpectedItemRevisions(pmRoot:string,specs:readonl
71
63
  * Describe what changed after the declared revision, from the item's immutable
72
64
  * history. Returns undefined when the history cannot be read.
73
65
  */
74
- export declare function describeItemRevisionChanges(pmRoot:string,id:string,expectedHash:string):Promise<{
75
- expected_revision_recorded:boolean;
76
- changes_since:ItemRevisionChange[];
77
- changes_since_omitted:number;
78
- } | undefined>;
66
+ export declare function describeItemRevisionChanges(pmRoot:string,id:string,expectedHash:string):Promise<{expected_revision_recorded:boolean;changes_since:ItemRevisionChange[];changes_since_omitted:number;}|undefined>;
79
67
  /** Structured revision fields a bulk row keeps when its item refused an expected revision. */
80
- export interface ItemRevisionConflictRowFields {
68
+ export interface ItemRevisionConflictRowFields{
81
69
  /** Always `item_revision_conflict`. */
82
70
  error_code?:typeof ITEM_REVISION_CONFLICT_CODE;
83
71
  /** Revision the row's locked write expected. */
@@ -85,8 +73,7 @@ expected_revision?:string;
85
73
  /** Revision the row's locked write found. */
86
74
  current_revision?:string;
87
75
  /** Bounded history evidence of what changed since the expected revision, as single-item refusals report it. */
88
- details?:PmCliErrorDetails;
89
- }
76
+ details?:PmCliErrorDetails;}
90
77
  /**
91
78
  * Keep the typed refusal on a bulk row: partial-success commands report a
92
79
  * stale row's code, both revisions and the same bounded change evidence a
@@ -112,7 +99,7 @@ export declare function expectHashInvocationRewrittenError():PmCliError;
112
99
  * them reads the same tracker in the same output mode. Other errors, and an
113
100
  * omitted invocation, pass through unchanged.
114
101
  */
115
- export declare function scopeItemRevisionConflict(error:unknown,invocation:ItemRevisionRecoveryInvocation | undefined):unknown;
102
+ export declare function scopeItemRevisionConflict(error:unknown,invocation:ItemRevisionRecoveryInvocation|undefined):unknown;
116
103
  /**
117
104
  * Attach bounded change evidence to a revision conflict. The evidence is read
118
105
  * after the lock is released, so it describes the record as it was then; the
@@ -125,7 +112,7 @@ export declare function enrichItemRevisionConflict(error:unknown,pmRoot:string,i
125
112
  * Run an operation under an already-bound scope and return its receipt,
126
113
  * enriching a revision refusal with bounded change evidence.
127
114
  */
128
- export declare function runWithBoundItemRevisionScope<T>(scope:ItemRevisionScope,operation:() => Promise<T>,invocation?:ItemRevisionRecoveryInvocation):Promise<ExpectedItemRevisionsOutcome<T>>;
115
+ export declare function runWithBoundItemRevisionScope<T>(scope:ItemRevisionScope,operation:()=> Promise<T>,invocation?:ItemRevisionRecoveryInvocation):Promise<ExpectedItemRevisionsOutcome<T>>;
129
116
  /**
130
117
  * Run `operation` so every locked write to an expected item first proves the
131
118
  * item is still at the declared revision. A mismatch refuses that write with
@@ -134,15 +121,20 @@ export declare function runWithBoundItemRevisionScope<T>(scope:ItemRevisionScope
134
121
  * so a multi-write operation does not refuse itself. The receipt lists items
135
122
  * the operation never wrote, whose expectation therefore proved nothing.
136
123
  */
137
- export declare function withExpectedItemRevisions<T>(expectations:readonly ExpectedItemRevision[],operation:() => Promise<T>,context?:ItemRevisionContext):Promise<ExpectedItemRevisionsOutcome<T>>;
124
+ export declare function withExpectedItemRevisions<T>(expectations:readonly ExpectedItemRevision[],operation:()=> Promise<T>,context?:ItemRevisionContext):Promise<ExpectedItemRevisionsOutcome<T>>;
138
125
  /**
139
126
  * Resolve expectations to canonical ids and bind them to a fresh scope, without
140
127
  * running anything. Hosts that must resolve targets inside one extension
141
128
  * context but run the guarded operation outside it bind first, then call
142
129
  * {@link runWithBoundItemRevisionScope}.
143
130
  */
144
- export declare function bindExpectedItemRevisions(expectations:readonly ExpectedItemRevision[],context?:ItemRevisionContext):Promise<ItemRevisionScope>;
145
- export { bindItemRevisionScope,createItemRevisionScope,itemRevisionScopeReceipt,runWithItemRevisionScope };
131
+ export declare function bindExpectedItemRevisions(expectations:readonly ExpectedItemRevision[],context?:ItemRevisionContext):Promise<ItemRevisionScope>;export{bindItemRevisionScope,createItemRevisionScope,itemRevisionScopeReceipt,runWithItemRevisionScope};
132
+ /**
133
+ * Whether an active revision scope guards writes to this tracker. An enclosing
134
+ * SDK scope (an embedded CLI run) carries revisions the invocation's argv never
135
+ * spelled, so a retry rebuilt from argv alone would drop them (PR #1688 review).
136
+ */
137
+ export declare function isTrackerRevisionGuarded(pmRoot:string):boolean;
146
138
  /** Warning recorded when an expectation's item was never written by the action. */
147
139
  export declare function itemRevisionUncheckedWarning(id:string):string;
148
140
  /**
@@ -158,16 +150,10 @@ export declare function expectHashRequiresMutationError(action:string):PmCliErro
158
150
  * `PmClient.run`. Tokens follow the CLI grammar: a bare hash binds to the
159
151
  * action's `id`, and `<id>=<hash>` names the target explicitly.
160
152
  */
161
- export declare function dispatchWithExpectedItemRevisions<T>(params:{
162
- action:string;
163
- expectHash:unknown;
164
- defaultId?:string;
165
- pmRoot:string;
166
- run:() => Promise<T>;
153
+ export declare function dispatchWithExpectedItemRevisions<T>(params:{action:string;expectHash:unknown;defaultId?:string;pmRoot:string;run:()=> Promise<T>;
167
154
  /** Nested action options, consulted for modes the guard cannot cover (background test workers). */
168
155
  options?:Record<string,unknown>;
169
156
  /** Top-level background flag, consulted like `options.background`. */
170
157
  background?:unknown;
171
158
  /** Invocation whose tracker scope a revision refusal's recovery commands replay. */
172
- invocation?:ItemRevisionRecoveryInvocation;
173
- }):Promise<T>;
159
+ invocation?:ItemRevisionRecoveryInvocation;}):Promise<T>;
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2277d018-a882-57ee-bcd5-52bc61cd8efe")}catch{}})();import{getActiveExtensionRegistrations}from"../../core/extensions/index.js";import{hashDocument}from"../../core/history/history.js";import{readHistoryEntries}from"../../core/history/read.js";import{resolveItemTypeRegistry}from"../../core/item/type-registry.js";import{bindItemRevisionScope,createItemRevisionScope,ITEM_REVISION_CONFLICT_CHANGED_REASON,ITEM_REVISION_CONFLICT_UNREADABLE_REASON,isItemRevisionRefusalFrom,isItemRevisionRefusalScoped,itemRevisionConflictGuidance,markItemRevisionRefusalScoped,retainItemRevisionRefusalTracker,itemRevisionScopeReceipt,runWithItemRevisionScope}from"../../core/store/item-mutation-precondition.js";import{buildItemNotFoundError,locateItem,readLocatedItem}from"../../core/store/item-store.js";import{getHistoryPath,resolvePmRoot}from"../../core/store/paths.js";import{readSettings}from"../../core/store/settings.js";import{EXIT_CODE}from"../../core/shared/constants.js";import{PmCliError}from"../../core/shared/errors.js";import{PM_EXPECT_HASH_ACTIONS,PM_TOOL_ACTIONS}from"../cli-contracts/enum-contracts.js";import{resolveHistorySubject}from"../history/subject.js";import{resolvePhysicalItemId}from"../query/declared-blockers.js";import{EMPTY_CANONICAL_DOCUMENT}from"../../core/shared/constants.js";import{isMutationAction}from"../mutation-guard.js";import{isPmCliExpectedError}from"../errors.js";const ITEM_REVISION_CONFLICT_CODE="item_revision_conflict",ITEM_REVISION_CONFLICT_CHANGE_LIMIT=10,ITEM_HASH_PATTERN=/^[0-9a-f]{64}$/u;function invalidExpectHash(value,reason){return new PmCliError(`Invalid expected revision ${JSON.stringify(value)}: ${reason}.`,EXIT_CODE.USAGE,{code:"expect_hash_invalid",value,required:"Pass the 64-character item_hash from pm get <id> --json, optionally as <id>=<item_hash>.",examples:["--expect-hash <item_hash>","--expect-hash pm-a1b2=<item_hash>"]})}function normalizeExpectedItemHash(value){const normalized=typeof value=="string"?value.trim().toLowerCase():"";if(!ITEM_HASH_PATTERN.test(normalized))throw invalidExpectHash(String(value),"the revision is not a 64-character hexadecimal item_hash");return normalized}function parseExpectHashSpecs(values){return(values===void 0?[]:typeof values=="string"?[values]:values).flatMap(raw=>{if(typeof raw!="string")throw invalidExpectHash(String(raw),"expected a string");const parts=raw.split(",").map(token=>token.trim()).filter(token=>token.length>0);if(parts.length===0)throw invalidExpectHash(raw,"the value is empty");return parts.map(token=>{const separator=token.lastIndexOf("="),id=separator===-1?void 0:token.slice(0,separator).trim();if(id!==void 0&&id.length===0)throw invalidExpectHash(token,"the item id before = is empty");const itemHash=normalizeExpectedItemHash(separator===-1?token:token.slice(separator+1));return id===void 0?{itemHash}:{id,itemHash}})})}async function locateRevisionTarget(pmRoot,id){const settings=await readSettings(pmRoot),typeToFolder=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()).type_to_folder,located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeToFolder);if(located){const{document}=await readLocatedItem(located,{schema:settings.schema});if(document.metadata.id!==await resolvePhysicalItemId(located.itemPath,located.id))throw new PmCliError(`Item file ${located.id} embeds the id ${document.metadata.id}; no revision can be bound to an item whose identity is in conflict.`,EXIT_CODE.CONFLICT,{code:"item_identity_conflict",item_id:located.id,required:`Repair ${located.id}'s identity first (pm validate reports it; pm restore ${located.id} <version> recovers a recorded state), then read its item_hash again.`});return{id:document.metadata.id,document}}try{return{id:(await resolveHistorySubject(pmRoot,id,settings,typeToFolder)).id,document:EMPTY_CANONICAL_DOCUMENT}}catch{throw await buildItemNotFoundError(pmRoot,id,settings.id_prefix,typeToFolder)}}function resolveRevisionRoot(context){return resolvePmRoot(context.cwd??process.cwd(),context.pmRoot)}async function readItemRevision(id,context={}){const target=await locateRevisionTarget(resolveRevisionRoot(context),id);return{id:target.id,item_hash:hashDocument(target.document)}}async function resolveExpectedItemRevisions(pmRoot,specs,defaultId){const resolved=[];for(const spec of specs){const target=spec.id??defaultId;if(target===void 0||target.trim().length===0)throw new PmCliError("A bare expected revision needs an item to bind to.",EXIT_CODE.USAGE,{code:"expect_hash_target_required",required:"This command has no single item argument; name each target as --expect-hash <id>=<item_hash>.",examples:["--expect-hash pm-a1b2=<item_hash>"]});resolved.push({id:(await locateRevisionTarget(pmRoot,target)).id,itemHash:spec.itemHash})}return resolved}function changedTopLevelFields(entry){return[...new Set(entry.patch.map(change=>{const segments=change.path.split("/");return String(segments[1]==="metadata"?segments[2]:segments[1])}))].sort()}async function describeItemRevisionChanges(pmRoot,id,expectedHash){let history;try{history=await readHistoryEntries(getHistoryPath(pmRoot,id),id)}catch{return}let start=-1;for(let index=history.length-1;index>=0;index-=1){const entry=history[index];if(entry.after_hash===expectedHash){start=index+1;break}if(entry.before_hash===expectedHash){start=index;break}}if(start===-1)return{expected_revision_recorded:!1,changes_since:[],changes_since_omitted:0};const later=history.slice(start),shown=later.slice(-ITEM_REVISION_CONFLICT_CHANGE_LIMIT);return{expected_revision_recorded:!0,changes_since:shown.map(entry=>({ts:entry.ts,op:entry.op,author:entry.author,fields:changedTopLevelFields(entry)})),changes_since_omitted:later.length-shown.length}}async function itemRevisionConflictRowFields(error,pmRoot){if(!isItemRevisionConflict(error))return{};const enriched=await enrichItemRevisionConflict(error,pmRoot);return{error_code:ITEM_REVISION_CONFLICT_CODE,expected_revision:String(enriched.context.expected_revision),current_revision:String(enriched.context.current_revision),details:enriched.context.details}}function isItemRevisionConflict(error){return isPmCliExpectedError(error)&&error.context.code===ITEM_REVISION_CONFLICT_CODE}function throwFirstItemRevisionConflict(errors){const conflict=errors.find(error=>isItemRevisionConflict(error));if(conflict!==void 0)throw conflict}function expectHashInvocationRewrittenError(){return new PmCliError("--expect-hash cannot guard an invocation an extension override rewrote: which item it writes is not provable.",EXIT_CODE.USAGE,{code:"expect_hash_invocation_rewritten",required:"Run the command without the rewriting extension (--no-extensions), or drop --expect-hash.",why:"An extension parser or preflight override changed this invocation's tracker or arguments, and final dispatch, the extension SDK client and the guard do not share one rewritten view."})}function scopeItemRevisionConflict(error,invocation){if(invocation===void 0||!isItemRevisionConflict(error)||typeof error.context.item_id!="string"||isItemRevisionRefusalScoped(error))return error;const unreadable=error.context.reason===ITEM_REVISION_CONFLICT_UNREADABLE_REASON;if(!unreadable&&error.context.reason!==ITEM_REVISION_CONFLICT_CHANGED_REASON)return error;const scoped=markItemRevisionRefusalScoped(retainItemRevisionRefusalTracker(error,new PmCliError(error.message,error.exitCode,{...error.context,...itemRevisionConflictGuidance(error.context.item_id,unreadable,invocation)})));return scoped.stack=error.stack,scoped}async function enrichItemRevisionConflict(error,pmRoot,invocation){if(!isItemRevisionRefusalFrom(error,pmRoot))return error;const scoped=scopeItemRevisionConflict(error,invocation);if(!isItemRevisionConflict(scoped)||scoped.context.details!==void 0)return scoped;const id=scoped.context.item_id,expected=scoped.context.expected_revision;if(typeof id!="string"||typeof expected!="string")return scoped;let changes;try{changes=await describeItemRevisionChanges(pmRoot,id,expected)}catch{return scoped}if(changes===void 0)return scoped;const details={expected_revision_recorded:changes.expected_revision_recorded,changes_since:changes.changes_since.map(change=>({ts:change.ts,op:change.op,author:change.author,fields:[...change.fields]})),changes_since_omitted:changes.changes_since_omitted},enriched=retainItemRevisionRefusalTracker(scoped,new PmCliError(scoped.message,scoped.exitCode,{...scoped.context,details}));return enriched.stack=scoped.stack,enriched}async function runWithBoundItemRevisionScope(scope,operation,invocation){try{return{result:await runWithItemRevisionScope(scope,operation),...itemRevisionScopeReceipt(scope)}}catch(error){throw scope.pmRoot===void 0?error:await enrichItemRevisionConflict(error,scope.pmRoot,invocation)}}function revisionRecoveryInvocation(context){return context.cwd===void 0&&context.pmRoot===void 0?void 0:{scopeArgs:["--pm-path",resolveRevisionRoot(context)]}}async function withExpectedItemRevisions(expectations,operation,context={}){return runWithBoundItemRevisionScope(await bindExpectedItemRevisions(expectations,context),operation,revisionRecoveryInvocation(context))}async function bindExpectedItemRevisions(expectations,context={}){const pmRoot=resolveRevisionRoot(context),specs=expectations.map(({id,itemHash})=>({id,itemHash:normalizeExpectedItemHash(itemHash)})),scope=createItemRevisionScope();return bindItemRevisionScope(scope,pmRoot,await resolveExpectedItemRevisions(pmRoot,specs)),scope}function itemRevisionUncheckedWarning(id){return`expect_hash_unchecked:${id}:no_locked_write_reached_this_item`}const NATIVE_ACTIONS=new Set(PM_TOOL_ACTIONS);function assertExpectHashAdmissible(path,options={}){const hyphenated=path.trim().replace(/\s+/gu,"-"),action=NATIVE_ACTIONS.has(hyphenated)?hyphenated:path;if(NATIVE_ACTIONS.has(action)&&(!isMutationAction(action)||action==="deps")&&!PM_EXPECT_HASH_ACTIONS.has(action))throw expectHashRequiresMutationError(action);if((action==="test"||action==="test-all")&&options.background===!0)throw new PmCliError(`--expect-hash cannot guard ${action} --background: the worker runs in another process.`,EXIT_CODE.USAGE,{code:"expect_hash_background_unsupported",required:`Run ${action} in the foreground to guard its result recording, or drop --expect-hash for a background run.`})}function expectHashRequiresMutationError(action){return new PmCliError(`--expect-hash guards item writes, and ${action} is not a mutation.`,EXIT_CODE.USAGE,{code:"expect_hash_requires_mutation",required:"Use --expect-hash (MCP/SDK expectHash) only on a command or action that writes items."})}function withUncheckedRevisionWarnings(result,unchecked){if(unchecked.length===0||typeof result!="object"||result===null||Array.isArray(result))return result;const record=result,warnings=Array.isArray(record.warnings)?record.warnings:[];return{...record,warnings:[...warnings,...unchecked.map(itemRevisionUncheckedWarning)]}}async function dispatchWithExpectedItemRevisions(params){const raw=params.expectHash;if(raw!==void 0&&typeof raw!="string"&&!(Array.isArray(raw)&&raw.every(entry=>typeof entry=="string")))throw invalidExpectHash(JSON.stringify(raw)??String(raw),"expected a string or an array of strings");const specs=parseExpectHashSpecs(raw);if(specs.length===0)return params.run();assertExpectHashAdmissible(params.action,{background:params.background===!0||params.options?.background===!0});const scope=createItemRevisionScope();bindItemRevisionScope(scope,params.pmRoot,await resolveExpectedItemRevisions(params.pmRoot,specs,params.defaultId));const outcome=await runWithBoundItemRevisionScope(scope,params.run,params.invocation);return withUncheckedRevisionWarnings(outcome.result,outcome.unchecked)}export{ITEM_REVISION_CONFLICT_CHANGE_LIMIT,ITEM_REVISION_CONFLICT_CODE,assertExpectHashAdmissible,bindExpectedItemRevisions,bindItemRevisionScope,createItemRevisionScope,describeItemRevisionChanges,dispatchWithExpectedItemRevisions,enrichItemRevisionConflict,expectHashInvocationRewrittenError,expectHashRequiresMutationError,isItemRevisionConflict,itemRevisionConflictRowFields,itemRevisionScopeReceipt,itemRevisionUncheckedWarning,normalizeExpectedItemHash,parseExpectHashSpecs,readItemRevision,resolveExpectedItemRevisions,runWithBoundItemRevisionScope,runWithItemRevisionScope,scopeItemRevisionConflict,throwFirstItemRevisionConflict,withExpectedItemRevisions};
1
+ (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2ad03a1e-c9fc-5f69-8391-97c1e845ba28")}catch{}})();import{getActiveExtensionRegistrations}from"../../core/extensions/index.js";import{hashDocument}from"../../core/history/history.js";import{readHistoryEntries}from"../../core/history/read.js";import{resolveItemTypeRegistry}from"../../core/item/type-registry.js";import{bindItemRevisionScope,createItemRevisionScope,ITEM_REVISION_CONFLICT_CHANGED_REASON,ITEM_REVISION_CONFLICT_UNREADABLE_REASON,isItemRevisionRefusalFrom,isItemRevisionRefusalScoped,itemRevisionConflictGuidance,markItemRevisionRefusalScoped,retainItemRevisionRefusalTracker,itemRevisionScopeReceipt,runWithItemRevisionScope,activeItemRevisionExpectations}from"../../core/store/item-mutation-precondition.js";import{buildItemNotFoundError,locateItem,readLocatedItem}from"../../core/store/item-store.js";import{getHistoryPath,resolvePmRoot}from"../../core/store/paths.js";import{readSettings}from"../../core/store/settings.js";import{EXIT_CODE}from"../../core/shared/constants.js";import{PmCliError}from"../../core/shared/errors.js";import{PM_EXPECT_HASH_ACTIONS,PM_TOOL_ACTIONS}from"../cli-contracts/enum-contracts.js";import{resolveHistorySubject}from"../history/subject.js";import{resolvePhysicalItemId}from"../query/declared-blockers.js";import{EMPTY_CANONICAL_DOCUMENT}from"../../core/shared/constants.js";import{isMutationAction}from"../mutation-guard.js";import{isPmCliExpectedError}from"../errors.js";const ITEM_REVISION_CONFLICT_CODE="item_revision_conflict",ITEM_REVISION_CONFLICT_CHANGE_LIMIT=10,ITEM_HASH_PATTERN=/^[0-9a-f]{64}$/u;function invalidExpectHash(value,reason){return new PmCliError(`Invalid expected revision ${JSON.stringify(value)}: ${reason}.`,EXIT_CODE.USAGE,{code:"expect_hash_invalid",value,required:"Pass the 64-character item_hash from pm get <id> --json, optionally as <id>=<item_hash>.",examples:["--expect-hash <item_hash>","--expect-hash pm-a1b2=<item_hash>"]})}function normalizeExpectedItemHash(value){const normalized=typeof value=="string"?value.trim().toLowerCase():"";if(!ITEM_HASH_PATTERN.test(normalized))throw invalidExpectHash(String(value),"the revision is not a 64-character hexadecimal item_hash");return normalized}function parseExpectHashSpecs(values){return(values===void 0?[]:typeof values=="string"?[values]:values).flatMap(raw=>{if(typeof raw!="string")throw invalidExpectHash(String(raw),"expected a string");const parts=raw.split(",").map(token=>token.trim()).filter(token=>token.length>0);if(parts.length===0)throw invalidExpectHash(raw,"the value is empty");return parts.map(token=>{const separator=token.lastIndexOf("="),id=separator===-1?void 0:token.slice(0,separator).trim();if(id!==void 0&&id.length===0)throw invalidExpectHash(token,"the item id before = is empty");const itemHash=normalizeExpectedItemHash(separator===-1?token:token.slice(separator+1));return id===void 0?{itemHash}:{id,itemHash}})})}async function locateRevisionTarget(pmRoot,id){const settings=await readSettings(pmRoot),typeToFolder=resolveItemTypeRegistry(settings,getActiveExtensionRegistrations()).type_to_folder,located=await locateItem(pmRoot,id,settings.id_prefix,settings.item_format,typeToFolder);if(located){const{document}=await readLocatedItem(located,{schema:settings.schema});if(document.metadata.id!==await resolvePhysicalItemId(located.itemPath,located.id))throw new PmCliError(`Item file ${located.id} embeds the id ${document.metadata.id}; no revision can be bound to an item whose identity is in conflict.`,EXIT_CODE.CONFLICT,{code:"item_identity_conflict",item_id:located.id,required:`Repair ${located.id}'s identity first (pm validate reports it; pm restore ${located.id} <version> recovers a recorded state), then read its item_hash again.`});return{id:document.metadata.id,document}}try{return{id:(await resolveHistorySubject(pmRoot,id,settings,typeToFolder)).id,document:EMPTY_CANONICAL_DOCUMENT}}catch{throw await buildItemNotFoundError(pmRoot,id,settings.id_prefix,typeToFolder)}}function resolveRevisionRoot(context){return resolvePmRoot(context.cwd??process.cwd(),context.pmRoot)}async function readItemRevision(id,context={}){const target=await locateRevisionTarget(resolveRevisionRoot(context),id);return{id:target.id,item_hash:hashDocument(target.document)}}async function resolveExpectedItemRevisions(pmRoot,specs,defaultId){const resolved=[];for(const spec of specs){const target=spec.id??defaultId;if(target===void 0||target.trim().length===0)throw new PmCliError("A bare expected revision needs an item to bind to.",EXIT_CODE.USAGE,{code:"expect_hash_target_required",required:"This command has no single item argument; name each target as --expect-hash <id>=<item_hash>.",examples:["--expect-hash pm-a1b2=<item_hash>"]});resolved.push({id:(await locateRevisionTarget(pmRoot,target)).id,itemHash:spec.itemHash})}return resolved}function changedTopLevelFields(entry){return[...new Set(entry.patch.map(change=>{const segments=change.path.split("/");return String(segments[1]==="metadata"?segments[2]:segments[1])}))].sort()}async function describeItemRevisionChanges(pmRoot,id,expectedHash){let history;try{history=await readHistoryEntries(getHistoryPath(pmRoot,id),id)}catch{return}let start=-1;for(let index=history.length-1;index>=0;index-=1){const entry=history[index];if(entry.after_hash===expectedHash){start=index+1;break}if(entry.before_hash===expectedHash){start=index;break}}if(start===-1)return{expected_revision_recorded:!1,changes_since:[],changes_since_omitted:0};const later=history.slice(start),shown=later.slice(-ITEM_REVISION_CONFLICT_CHANGE_LIMIT);return{expected_revision_recorded:!0,changes_since:shown.map(entry=>({ts:entry.ts,op:entry.op,author:entry.author,fields:changedTopLevelFields(entry)})),changes_since_omitted:later.length-shown.length}}async function itemRevisionConflictRowFields(error,pmRoot){if(!isItemRevisionConflict(error))return{};const enriched=await enrichItemRevisionConflict(error,pmRoot);return{error_code:ITEM_REVISION_CONFLICT_CODE,expected_revision:String(enriched.context.expected_revision),current_revision:String(enriched.context.current_revision),details:enriched.context.details}}function isItemRevisionConflict(error){return isPmCliExpectedError(error)&&error.context.code===ITEM_REVISION_CONFLICT_CODE}function throwFirstItemRevisionConflict(errors){const conflict=errors.find(error=>isItemRevisionConflict(error));if(conflict!==void 0)throw conflict}function expectHashInvocationRewrittenError(){return new PmCliError("--expect-hash cannot guard an invocation an extension override rewrote: which item it writes is not provable.",EXIT_CODE.USAGE,{code:"expect_hash_invocation_rewritten",required:"Run the command without the rewriting extension (--no-extensions), or drop --expect-hash.",why:"An extension parser or preflight override changed this invocation's tracker or arguments, and final dispatch, the extension SDK client and the guard do not share one rewritten view."})}function scopeItemRevisionConflict(error,invocation){if(invocation===void 0||!isItemRevisionConflict(error)||typeof error.context.item_id!="string"||isItemRevisionRefusalScoped(error))return error;const unreadable=error.context.reason===ITEM_REVISION_CONFLICT_UNREADABLE_REASON;if(!unreadable&&error.context.reason!==ITEM_REVISION_CONFLICT_CHANGED_REASON)return error;const scoped=markItemRevisionRefusalScoped(retainItemRevisionRefusalTracker(error,new PmCliError(error.message,error.exitCode,{...error.context,...itemRevisionConflictGuidance(error.context.item_id,unreadable,invocation)})));return scoped.stack=error.stack,scoped}async function enrichItemRevisionConflict(error,pmRoot,invocation){if(!isItemRevisionRefusalFrom(error,pmRoot))return error;const scoped=scopeItemRevisionConflict(error,invocation);if(!isItemRevisionConflict(scoped)||scoped.context.details!==void 0)return scoped;const id=scoped.context.item_id,expected=scoped.context.expected_revision;if(typeof id!="string"||typeof expected!="string")return scoped;let changes;try{changes=await describeItemRevisionChanges(pmRoot,id,expected)}catch{return scoped}if(changes===void 0)return scoped;const details={expected_revision_recorded:changes.expected_revision_recorded,changes_since:changes.changes_since.map(change=>({ts:change.ts,op:change.op,author:change.author,fields:[...change.fields]})),changes_since_omitted:changes.changes_since_omitted},enriched=retainItemRevisionRefusalTracker(scoped,new PmCliError(scoped.message,scoped.exitCode,{...scoped.context,details}));return enriched.stack=scoped.stack,enriched}async function runWithBoundItemRevisionScope(scope,operation,invocation){try{return{result:await runWithItemRevisionScope(scope,operation),...itemRevisionScopeReceipt(scope)}}catch(error){throw scope.pmRoot===void 0?error:await enrichItemRevisionConflict(error,scope.pmRoot,invocation)}}function revisionRecoveryInvocation(context){return context.cwd===void 0&&context.pmRoot===void 0?void 0:{scopeArgs:["--pm-path",resolveRevisionRoot(context)]}}async function withExpectedItemRevisions(expectations,operation,context={}){return runWithBoundItemRevisionScope(await bindExpectedItemRevisions(expectations,context),operation,revisionRecoveryInvocation(context))}async function bindExpectedItemRevisions(expectations,context={}){const pmRoot=resolveRevisionRoot(context),specs=expectations.map(({id,itemHash})=>({id,itemHash:normalizeExpectedItemHash(itemHash)})),scope=createItemRevisionScope();return bindItemRevisionScope(scope,pmRoot,await resolveExpectedItemRevisions(pmRoot,specs)),scope}function isTrackerRevisionGuarded(pmRoot){const expectations=activeItemRevisionExpectations(pmRoot);return expectations===void 0||expectations.length>0}function itemRevisionUncheckedWarning(id){return`expect_hash_unchecked:${id}:no_locked_write_reached_this_item`}const NATIVE_ACTIONS=new Set(PM_TOOL_ACTIONS);function assertExpectHashAdmissible(path,options={}){const hyphenated=path.trim().replace(/\s+/gu,"-"),action=NATIVE_ACTIONS.has(hyphenated)?hyphenated:path;if(NATIVE_ACTIONS.has(action)&&(!isMutationAction(action)||action==="deps")&&!PM_EXPECT_HASH_ACTIONS.has(action))throw expectHashRequiresMutationError(action);if((action==="test"||action==="test-all")&&options.background===!0)throw new PmCliError(`--expect-hash cannot guard ${action} --background: the worker runs in another process.`,EXIT_CODE.USAGE,{code:"expect_hash_background_unsupported",required:`Run ${action} in the foreground to guard its result recording, or drop --expect-hash for a background run.`})}function expectHashRequiresMutationError(action){return new PmCliError(`--expect-hash guards item writes, and ${action} is not a mutation.`,EXIT_CODE.USAGE,{code:"expect_hash_requires_mutation",required:"Use --expect-hash (MCP/SDK expectHash) only on a command or action that writes items."})}function withUncheckedRevisionWarnings(result,unchecked){if(unchecked.length===0||typeof result!="object"||result===null||Array.isArray(result))return result;const record=result,warnings=Array.isArray(record.warnings)?record.warnings:[];return{...record,warnings:[...warnings,...unchecked.map(itemRevisionUncheckedWarning)]}}async function dispatchWithExpectedItemRevisions(params){const raw=params.expectHash;if(raw!==void 0&&typeof raw!="string"&&!(Array.isArray(raw)&&raw.every(entry=>typeof entry=="string")))throw invalidExpectHash(JSON.stringify(raw)??String(raw),"expected a string or an array of strings");const specs=parseExpectHashSpecs(raw);if(specs.length===0)return params.run();assertExpectHashAdmissible(params.action,{background:params.background===!0||params.options?.background===!0});const scope=createItemRevisionScope();bindItemRevisionScope(scope,params.pmRoot,await resolveExpectedItemRevisions(params.pmRoot,specs,params.defaultId));const outcome=await runWithBoundItemRevisionScope(scope,params.run,params.invocation);return withUncheckedRevisionWarnings(outcome.result,outcome.unchecked)}export{ITEM_REVISION_CONFLICT_CHANGE_LIMIT,ITEM_REVISION_CONFLICT_CODE,assertExpectHashAdmissible,bindExpectedItemRevisions,bindItemRevisionScope,createItemRevisionScope,describeItemRevisionChanges,dispatchWithExpectedItemRevisions,enrichItemRevisionConflict,expectHashInvocationRewrittenError,expectHashRequiresMutationError,isItemRevisionConflict,isTrackerRevisionGuarded,itemRevisionConflictRowFields,itemRevisionScopeReceipt,itemRevisionUncheckedWarning,normalizeExpectedItemHash,parseExpectHashSpecs,readItemRevision,resolveExpectedItemRevisions,runWithBoundItemRevisionScope,runWithItemRevisionScope,scopeItemRevisionConflict,throwFirstItemRevisionConflict,withExpectedItemRevisions};
2
2
  //# sourceMappingURL=item-revision.js.map
@@ -3,14 +3,13 @@
3
3
  *
4
4
  * Implements the pm lifecycle transitions command surface and its agent-facing runtime behavior.
5
5
  */
6
- import { type RuntimeStatusRegistry } from "../runtime-primitives.js";
6
+ import{type RuntimeStatusRegistry}from "../runtime-primitives.js";
7
7
  /** GH-216: a contextual next-step hint that nudges agents toward the underutilized `in_progress` lifecycle state instead of jumping straight from `open` to `closed`. The suggestion is intentionally non-binding (no governance enforcement) and only surfaces when a richer transition genuinely exists. */
8
- export interface LifecycleTransitionSuggestion {
8
+ export interface LifecycleTransitionSuggestion{
9
9
  /** Ready-to-run command that advances the item to the suggested status. */
10
10
  command:string;
11
11
  /** The status the suggested command moves the item to. */
12
- to_status:string;
13
- }
12
+ to_status:string;}
14
13
  /**
15
14
  * Suggest the next lifecycle transition for a freshly created (or open) item.
16
15
  *
@@ -20,4 +19,4 @@ to_status:string;
20
19
  * scheduling types and workflows that collapse `in_progress` into `open` — so
21
20
  * the suggestion never fabricates a transition the workflow cannot perform.
22
21
  */
23
- export declare function suggestNextLifecycleTransition(id:string,type:string,status:string,statusRegistry:RuntimeStatusRegistry):LifecycleTransitionSuggestion | undefined;
22
+ export declare function suggestNextLifecycleTransition(id:string,type:string,status:string,statusRegistry:RuntimeStatusRegistry):LifecycleTransitionSuggestion|undefined;
@@ -4,7 +4,7 @@
4
4
  * Defines shared create/update option fields used by mutation command surfaces.
5
5
  */
6
6
  /** Documents metadata mutation options shared by create and update command payloads. */
7
- export interface MutationMetadataCommandOptions {
7
+ export interface MutationMetadataCommandOptions{
8
8
  /** Value that configures or reports deadline for this contract. */
9
9
  deadline?:string;
10
10
  /** Value that configures or reports estimated minutes for this contract. */
@@ -76,10 +76,9 @@ component?:string;
76
76
  /** Value that configures or reports regression for this contract. */
77
77
  regression?:string;
78
78
  /** Value that configures or reports customer impact for this contract. */
79
- customerImpact?:string;
80
- }
79
+ customerImpact?:string;}
81
80
  /** Documents repeatable linked-resource option payloads accepted by create/update commands. */
82
- export interface SharedLinkedResourceOptions {
81
+ export interface SharedLinkedResourceOptions{
83
82
  /** Value that configures or reports comment for this contract. */
84
83
  comment?:string[];
85
84
  /** Value that configures or reports note for this contract. */
@@ -101,10 +100,9 @@ event?:string[];
101
100
  /** Value that configures or reports type option for this contract. */
102
101
  typeOption?:string[];
103
102
  /** Value that configures or reports field for this contract. */
104
- field?:string[];
105
- }
103
+ field?:string[];}
106
104
  /** Documents shared linked-resource clear flags accepted by create/update commands. */
107
- export interface SharedLinkedResourceClearOptions {
105
+ export interface SharedLinkedResourceClearOptions{
108
106
  /** Value that configures or reports unset for this contract. */
109
107
  unset?:string[];
110
108
  /** Value that configures or reports clear deps for this contract. */
@@ -126,5 +124,4 @@ clearReminders?:boolean;
126
124
  /** Value that configures or reports clear events for this contract. */
127
125
  clearEvents?:boolean;
128
126
  /** Inputs that customize the clear type operation. */
129
- clearTypeOptions?:boolean;
130
- }
127
+ clearTypeOptions?:boolean;}
@@ -2,10 +2,9 @@
2
2
  * @module sdk/lifecycle/plan-mutation-receipt
3
3
  * Bounded mutation acknowledgements; full Plan state remains a separate read.
4
4
  */
5
- import type { PlanCommandResult,PlanStepSummary,PlanSubcommand } from "./plan.js";
6
- import type { PlanMode,PlanStepStatus } from "../../types/index.js";
5
+ import type{PlanCommandResult,PlanStepSummary,PlanSubcommand}from "./plan.js";import type{PlanMode,PlanStepStatus}from "../../types/index.js";
7
6
  /** Stable mutation facts whose size does not grow with unrelated Plan content. */
8
- export interface PlanMutationReceipt {
7
+ export interface PlanMutationReceipt{
9
8
  /** Discriminator used by CLI and MCP mutation projection. */
10
9
  kind:"plan_mutation";
11
10
  /** Operation that completed successfully. */
@@ -19,9 +18,7 @@ mode:PlanMode;
19
18
  /** Counts over the complete persisted step collection. */
20
19
  steps_summary:PlanStepSummary;
21
20
  /** Affected step identity when the operation returns a step. */
22
- step?:Pick<NonNullable<PlanCommandResult["step"]>,"id" | "order"> & {
23
- status:PlanStepStatus;
24
- };
21
+ step?:Pick<NonNullable<PlanCommandResult["step"]>,"id"|"order">&{status:PlanStepStatus;};
25
22
  /** Number of items created by this materialization. */
26
23
  materialized_count:number;
27
24
  /** Number of already completed or materialized steps skipped. */
@@ -43,11 +40,6 @@ has_omissions:true;
43
40
  /** Projection group count. */
44
41
  omitted_field_group_count:1;
45
42
  /** Named omitted group and its safe read-only recovery. */
46
- omitted_field_groups:{
47
- name:"plan_detail";
48
- restore_with:string;
49
- }[];
50
- };
51
- }
43
+ omitted_field_groups:{name:"plan_detail";restore_with:string;}[];};}
52
44
  /** Project completed work; omit the root for MCP recovery in the caller's existing workspace context. */
53
- export declare function buildPlanMutationReceipt(result:PlanCommandResult,pmRoot:string | undefined):PlanMutationReceipt;
45
+ export declare function buildPlanMutationReceipt(result:PlanCommandResult,pmRoot:string|undefined):PlanMutationReceipt;
@@ -1,17 +1,12 @@
1
- import { type GlobalOptions } from "../runtime-primitives.js";
2
- import type { DependencyKind,ItemMetadata,PlanDecision,PlanDiscovery,PlanHarness,PlanMode,PlanStep,PlanStepStatus,PlanValidationCheck } from "../../types/index.js";
3
- import type { MutationMetadataCommandOptions,SharedLinkedResourceOptions } from "./mutation-command-options.js";
4
- import { PLAN_SHOW_DEPTH_VALUES } from "../query/projection-contracts.js";
5
- import { type PlanMutationReceipt } from "./plan-mutation-receipt.js";
1
+ import{type GlobalOptions}from "../runtime-primitives.js";import type{DependencyKind,ItemMetadata,PlanDecision,PlanDiscovery,PlanHarness,PlanMode,PlanStep,PlanStepStatus,PlanValidationCheck}from "../../types/index.js";import type{MutationMetadataCommandOptions,SharedLinkedResourceOptions}from "./mutation-command-options.js";import{PLAN_SHOW_DEPTH_VALUES}from "../query/projection-contracts.js";import{type PlanMutationReceipt}from "./plan-mutation-receipt.js";
6
2
  /** Public contract for plan subcommands, shared by SDK and presentation-layer consumers. */
7
- export declare const PLAN_SUBCOMMANDS:readonly ["create","show","add-step","update-step","complete-step","block-step","reorder-step","remove-step","link","unlink","decision","discovery","validation","resume","approve","materialize"];
3
+ export declare const PLAN_SUBCOMMANDS:readonly["create","show","add-step","update-step","complete-step","block-step","reorder-step","remove-step","link","unlink","decision","discovery","validation","resume","approve","materialize"];
8
4
  /** Restricts plan subcommand values accepted by command, SDK, and storage contracts. */
9
- export type PlanSubcommand = (typeof PLAN_SUBCOMMANDS)[number];
10
- export { PLAN_SHOW_DEPTH_VALUES };
5
+ export type PlanSubcommand=(typeof PLAN_SUBCOMMANDS)[number];export{PLAN_SHOW_DEPTH_VALUES};
11
6
  /** Restricts plan show depth values accepted by command, SDK, and storage contracts. */
12
- export type PlanShowDepth = (typeof PLAN_SHOW_DEPTH_VALUES)[number];
7
+ export type PlanShowDepth=(typeof PLAN_SHOW_DEPTH_VALUES)[number];
13
8
  /** Documents the plan command options payload exchanged by command, SDK, and package integrations. */
14
- export interface PlanCommandOptions extends Omit<MutationMetadataCommandOptions,"author" | "blockedBy" | "message" | "parent">,Omit<SharedLinkedResourceOptions,"dep" | "doc" | "field" | "file" | "test"> {
9
+ export interface PlanCommandOptions extends Omit<MutationMetadataCommandOptions,"author"|"blockedBy"|"message"|"parent">,Omit<SharedLinkedResourceOptions,"dep"|"doc"|"field"|"file"|"test">{
15
10
  /** Value that configures or reports title for this contract. */
16
11
  title?:string;
17
12
  /** Value that configures or reports description for this contract. */
@@ -23,11 +18,11 @@ parent?:string;
23
18
  /** Opt into saved session focus as parent when creating; SDK default is false. */
24
19
  inheritFocus?:boolean;
25
20
  /** Value that configures or reports related for this contract. */
26
- related?:string | string[];
21
+ related?:string|string[];
27
22
  /** Value that configures or reports blocks for this contract. */
28
- blocks?:string | string[];
23
+ blocks?:string|string[];
29
24
  /** Value that configures or reports blocked by for this contract. */
30
- blockedBy?:string | string[];
25
+ blockedBy?:string|string[];
31
26
  /** Value that configures or reports harness for this contract. */
32
27
  harness?:string;
33
28
  /** Value that configures or reports mode for this contract. */
@@ -51,7 +46,7 @@ fromSearch?:string;
51
46
  /** Value that configures or reports step title for this contract. */
52
47
  stepTitle?:string;
53
48
  /** pm-6mit: repeatable --step values. On create each value seeds one ordered step (argv order; values are never comma-split so titles may contain commas). On other subcommands a single value aliases stepTitle. */
54
- step?:string | string[];
49
+ step?:string|string[];
55
50
  /** Value that configures or reports step body for this contract. */
56
51
  stepBody?:string;
57
52
  /** Value that configures or reports step owner for this contract. */
@@ -65,9 +60,9 @@ stepBlockedReason?:string;
65
60
  /** Value that configures or reports step replacement for this contract. */
66
61
  stepReplacement?:string;
67
62
  /** Value that configures or reports depends on for this contract. */
68
- dependsOn?:string | string[];
63
+ dependsOn?:string|string[];
69
64
  /** Value that configures or reports link for this contract. */
70
- link?:string | string[];
65
+ link?:string|string[];
71
66
  /** Value that configures or reports link kind for this contract. */
72
67
  linkKind?:string;
73
68
  /** Value that configures or reports link note for this contract. */
@@ -77,11 +72,11 @@ promoteToItemDep?:boolean;
77
72
  /** Value that configures or reports allow multiple active for this contract. */
78
73
  allowMultipleActive?:boolean;
79
74
  /** Value that configures or reports file for this contract. */
80
- file?:string | string[];
75
+ file?:string|string[];
81
76
  /** Value that configures or reports test for this contract. */
82
- test?:string | string[];
77
+ test?:string|string[];
83
78
  /** Value that configures or reports doc for this contract. */
84
- doc?:string | string[];
79
+ doc?:string|string[];
85
80
  /** Value that configures or reports decision text for this contract. */
86
81
  decisionText?:string;
87
82
  /** Value that configures or reports decision for this contract. */
@@ -117,18 +112,17 @@ materializeParent?:string;
117
112
  /** Value that configures or reports materialize tags for this contract. */
118
113
  materializeTags?:string;
119
114
  /** Custom field values forwarded to every materialized item as `name=value` pairs. */
120
- field?:string | string[];
115
+ field?:string|string[];
121
116
  /** Value that configures or reports author for this contract. */
122
117
  author?:string;
123
118
  /** Human-readable explanation suitable for logs and agent-facing output. */
124
119
  message?:string;
125
120
  /** Value that configures or reports force for this contract. */
126
- force?:boolean;
127
- }
121
+ force?:boolean;}
128
122
  /** Presentation-neutral input accepted by SDK-owned planning operations. */
129
- export type PlanOperationOptions = PlanCommandOptions;
123
+ export type PlanOperationOptions=PlanCommandOptions;
130
124
  /** Documents the plan command result payload exchanged by command, SDK, and package integrations. */
131
- export interface PlanCommandResult {
125
+ export interface PlanCommandResult{
132
126
  /** Bounded acknowledgement for mutations; full typed Plan state remains available alongside it. */
133
127
  mutation_receipt?:PlanMutationReceipt;
134
128
  /** Value that configures or reports action for this contract. */
@@ -138,31 +132,19 @@ plan:PlanResultPlan;
138
132
  /** Value that configures or reports step for this contract. */
139
133
  step?:PlanStep;
140
134
  /** Value that configures or reports current step for this contract. */
141
- current_step?:PlanStep | undefined;
135
+ current_step?:PlanStep|undefined;
142
136
  /** Value that configures or reports next actions for this contract. */
143
137
  next_actions?:string[];
144
138
  /** Value that configures or reports materialized for this contract. */
145
- materialized?:{
146
- id:string;
147
- title:string;
148
- type:string;
149
- parent?:string;
150
- tags:string[];
151
- from_step:string;
152
- }[];
139
+ materialized?:{id:string;title:string;type:string;parent?:string;tags:string[];from_step:string;}[];
153
140
  /** Value that configures or reports materialize skipped for this contract. */
154
- materialize_skipped?:{
155
- from_step:string;
156
- reason:"already_completed" | "already_materialized";
157
- existing_id?:string;
158
- }[];
141
+ materialize_skipped?:{from_step:string;reason:"already_completed"|"already_materialized";existing_id?:string;}[];
159
142
  /** Value that configures or reports warnings for this contract. */
160
143
  warnings:string[];
161
144
  /** ISO 8601 timestamp recording when generated occurred. */
162
- generated_at:string;
163
- }
145
+ generated_at:string;}
164
146
  /** Documents the plan result plan payload exchanged by command, SDK, and package integrations. */
165
- export interface PlanResultPlan {
147
+ export interface PlanResultPlan{
166
148
  /** Stable identifier used to reference this record across commands and storage. */
167
149
  id:string;
168
150
  /** Value that configures or reports title for this contract. */
@@ -182,19 +164,9 @@ resume_context?:string;
182
164
  /** Value that configures or reports steps summary for this contract. */
183
165
  steps_summary:PlanStepSummary;
184
166
  /** Value that configures or reports current step for this contract. */
185
- current_step?:{
186
- id:string;
187
- order:number;
188
- title:string;
189
- status:PlanStepStatus;
190
- } | undefined;
167
+ current_step?:{id:string;order:number;title:string;status:PlanStepStatus;}|undefined;
191
168
  /** Value that configures or reports blocked steps for this contract. */
192
- blocked_steps?:{
193
- id:string;
194
- order:number;
195
- title:string;
196
- blocked_reason?:string;
197
- }[];
169
+ blocked_steps?:{id:string;order:number;title:string;blocked_reason?:string;}[];
198
170
  /** Value that configures or reports steps for this contract. */
199
171
  steps?:PlanStep[];
200
172
  /** Value that configures or reports decisions for this contract. */
@@ -204,13 +176,9 @@ discoveries?:PlanDiscovery[];
204
176
  /** Value that configures or reports validation for this contract. */
205
177
  validation?:PlanValidationCheck[];
206
178
  /** Value that configures or reports linked items for this contract. */
207
- linked_items?:{
208
- id:string;
209
- kind:DependencyKind;
210
- }[];
211
- }
179
+ linked_items?:{id:string;kind:DependencyKind;}[];}
212
180
  /** Documents the plan step summary payload exchanged by command, SDK, and package integrations. */
213
- export interface PlanStepSummary {
181
+ export interface PlanStepSummary{
214
182
  /** Value that configures or reports total for this contract. */
215
183
  total:number;
216
184
  /** Value that configures or reports pending for this contract. */
@@ -226,22 +194,17 @@ skipped:number;
226
194
  /** Value that configures or reports superseded for this contract. */
227
195
  superseded:number;
228
196
  /** Whole-percent step-completion progress (`round(completed / total * 100)`), surfaced so agents see plan progress without recomputing it (GH-158 #5). */
229
- completion_pct:number;
230
- }
197
+ completion_pct:number;}
231
198
  /** Public contract for plan template names, shared by SDK and presentation-layer consumers. */
232
- export declare const PLAN_TEMPLATE_NAMES:readonly ["bug-investigation","feature-implementation","refactoring-sprint"];
199
+ export declare const PLAN_TEMPLATE_NAMES:readonly["bug-investigation","feature-implementation","refactoring-sprint"];
233
200
  /** Restricts plan template names accepted by `pm plan create --template` (GH-158 #2). */
234
- export type PlanTemplateName = (typeof PLAN_TEMPLATE_NAMES)[number];
235
- interface PlanTemplateStepSeed {
236
- title:string;
237
- body:string;
238
- }
201
+ export type PlanTemplateName=(typeof PLAN_TEMPLATE_NAMES)[number];interface PlanTemplateStepSeed{title:string;body:string;}
239
202
  /** Resolves the ordered step seeds for a built-in plan template, rejecting unknown names with the allowed set so agents can self-correct. */
240
203
  export declare function resolvePlanTemplateSteps(raw:string):PlanTemplateStepSeed[];
241
204
  /** Compare the union of persisted Plan metadata keys so additions, updates, and removals are all audited. */
242
- declare function changedPlanMetadataFields(beforePlanFields:ReadonlyMap<string,string | undefined>,metadata:ItemMetadata):string[];
205
+ declare function changedPlanMetadataFields(beforePlanFields:ReadonlyMap<string,string|undefined>,metadata:ItemMetadata):string[];
243
206
  /** Documents the plan dispatch input payload exchanged by command, SDK, and package integrations. */
244
- export interface PlanDispatchInput {
207
+ export interface PlanDispatchInput{
245
208
  /** Value that configures or reports subcommand for this contract. */
246
209
  subcommand:PlanSubcommand;
247
210
  /** Stable identifier used to reference this record across commands and storage. */
@@ -253,11 +216,8 @@ reorderTo?:number;
253
216
  /** Value that configures or reports options for this contract. */
254
217
  options:PlanCommandOptions;
255
218
  /** Value that configures or reports global for this contract. */
256
- global:GlobalOptions;
257
- }
219
+ global:GlobalOptions;}
258
220
  /** Implements run plan for the public runtime surface of this module. */
259
221
  export declare function runPlan(input:PlanDispatchInput):Promise<PlanCommandResult>;
260
222
  /** Internal Plan mutation helpers exposed only for branch-complete regression coverage. */
261
- export declare const _testOnlyPlanCommand:{
262
- changedPlanMetadataFields:typeof changedPlanMetadataFields;
263
- };
223
+ export declare const _testOnlyPlanCommand:{changedPlanMetadataFields:typeof changedPlanMetadataFields;};
@@ -4,12 +4,9 @@
4
4
  * Reopens terminal work as a recurrence while preserving immutable closure
5
5
  * evidence and delegating every state change to the canonical update pipeline.
6
6
  */
7
- import type { GlobalOptions } from "../../core/shared/command-types.js";
8
- import type { PmCliErrorRecoveryPayload } from "../../core/shared/errors.js";
9
- import { type PreviousTerminalEvidence } from "./update.js";
10
- export type { PreviousTerminalEvidence } from "./update.js";
7
+ import type{GlobalOptions}from "../../core/shared/command-types.js";import type{PmCliErrorRecoveryPayload}from "../../core/shared/errors.js";import{type PreviousTerminalEvidence}from "./update.js";export type{PreviousTerminalEvidence}from "./update.js";
11
8
  /** Options accepted by the SDK and `pm item reopen` recurrence primitive. */
12
- export interface ReopenCommandOptions {
9
+ export interface ReopenCommandOptions{
13
10
  /** Active target status; only the workspace open or in-progress status is allowed. */
14
11
  status?:string;
15
12
  /** Current active planning expectation, replacing the archived terminal expectation. */
@@ -19,10 +16,9 @@ author?:string;
19
16
  /** Optional human-readable history message in addition to structured recurrence context. */
20
17
  message?:string;
21
18
  /** Override an ownership or stale-lock conflict. */
22
- force?:boolean;
23
- }
19
+ force?:boolean;}
24
20
  /** Structured recurrence receipt returned by every presentation surface. */
25
- export interface RecurrenceReceipt {
21
+ export interface RecurrenceReceipt{
26
22
  /** Required reason that the terminal work became active again. */
27
23
  reason:string;
28
24
  /** Terminal status observed while holding the item lock. */
@@ -30,10 +26,9 @@ from_status:string;
30
26
  /** Active status written through the update pipeline. */
31
27
  to_status:string;
32
28
  /** Prior terminal evidence retained in immutable history. */
33
- previous_terminal:PreviousTerminalEvidence;
34
- }
29
+ previous_terminal:PreviousTerminalEvidence;}
35
30
  /** Result returned after a terminal item is reopened. */
36
- export interface ReopenResult {
31
+ export interface ReopenResult{
37
32
  /** Reopened item metadata. */
38
33
  item:Record<string,unknown>;
39
34
  /** Fields changed by the canonical update pipeline. */
@@ -43,7 +38,6 @@ warnings:string[];
43
38
  /** Immutable recurrence transition receipt. */
44
39
  recurrence:RecurrenceReceipt;
45
40
  /** Executable planning recovery when the caller has not supplied a current expectation. */
46
- recovery?:PmCliErrorRecoveryPayload;
47
- }
41
+ recovery?:PmCliErrorRecoveryPayload;}
48
42
  /** Reopen terminal work through the canonical update mutation and history path. */
49
- export declare function runReopen(id:string,reason:string,options:ReopenCommandOptions,global:GlobalOptions):Promise<ReopenResult>;
43
+ export declare function runReopen(id:string,reason:string,options:ReopenCommandOptions,global:GlobalOptions):Promise<ReopenResult>;