@unbrained/pm-cli 2026.11.9 → 2026.11.11

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 (613) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +28 -0
  3. package/dist/cli/commander-usage.js +2 -2
  4. package/dist/cli/error-guidance.js +5 -5
  5. package/dist/cli/help-json-payload.js +1 -1
  6. package/dist/cli/main.js +4 -4
  7. package/dist/cli/public.d.ts +1 -1
  8. package/dist/cli/register-history-maintenance.js +2 -2
  9. package/dist/cli/register-setup.js +1 -1
  10. package/dist/cli/runtime/refusal-credential-redaction.js +2 -0
  11. package/dist/cli-bundle/bundle-manifest.json +1 -1
  12. package/dist/cli-bundle/chunks/{chunk-YV5ALMG2.js → chunk-4RHXGQMK.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-IGT252ES.js → chunk-5N3JMGXU.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-VATZTJE3.js → chunk-DIWTFDU7.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-MSJ7IHMJ.js → chunk-DV7WBAKQ.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-GZVOOHTO.js → chunk-EBAHNZJT.js} +2 -2
  17. package/dist/cli-bundle/chunks/chunk-FM375BHH.js +3 -0
  18. package/dist/cli-bundle/chunks/{chunk-O2M3TNFY.js → chunk-GOLQYO6M.js} +5 -5
  19. package/dist/cli-bundle/chunks/chunk-GZ52WAY2.js +124 -0
  20. package/dist/cli-bundle/chunks/{chunk-6V4PGJBZ.js → chunk-JESMEJTD.js} +2 -2
  21. package/dist/cli-bundle/chunks/{chunk-XKY4LUXN.js → chunk-JLQ7O6UV.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-YK5GAWOT.js → chunk-L3SA3354.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-GDQ2T2OR.js → chunk-NIOOJ3AG.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-GCPP37N6.js → chunk-PZI6CR24.js} +46 -46
  25. package/dist/cli-bundle/chunks/{chunk-Z3QEEOAM.js → chunk-QCTA2UFR.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-EZRLW4R6.js → chunk-SPERPX27.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-ELNWRSGZ.js → chunk-SVVFJPNW.js} +2 -2
  28. package/dist/cli-bundle/chunks/chunk-WEAF3OY4.js +3 -0
  29. package/dist/cli-bundle/chunks/{chunk-JK7O7MFO.js → chunk-WWW5WHHJ.js} +3 -3
  30. package/dist/cli-bundle/chunks/{chunk-5VRJPPUC.js → chunk-XJUYJXHZ.js} +2 -2
  31. package/dist/cli-bundle/chunks/chunk-XN2BRWDD.js +6 -0
  32. package/dist/cli-bundle/chunks/chunk-Z4YEH7VQ.js +2 -0
  33. package/dist/cli-bundle/chunks/{chunk-3BMIAI4P.js → chunk-ZJDYBXMC.js} +2 -2
  34. package/dist/cli-bundle/chunks/{chunk-G6Q4VQSI.js → chunk-ZSL6U53K.js} +2 -2
  35. package/dist/cli-bundle/chunks/{item-revision-Y5CE3EIN.js → item-revision-LNIHK36Q.js} +2 -2
  36. package/dist/cli-bundle/chunks/item-transaction-TMUYPSMR.js +2 -0
  37. package/dist/cli-bundle/chunks/{mutation-admission-TAQN2AKK.js → mutation-admission-WZY22LVH.js} +2 -2
  38. package/dist/cli-bundle/chunks/{register-list-query-XMQYFUFI.js → register-list-query-DYGPLVRL.js} +2 -2
  39. package/dist/cli-bundle/chunks/{register-mutation-OBVCFLDK.js → register-mutation-MP5JCBAJ.js} +2 -2
  40. package/dist/cli-bundle/chunks/{register-operations-CGNFZ6DR.js → register-operations-QEASK3EF.js} +2 -2
  41. package/dist/cli-bundle/chunks/{register-setup-LFB5ERXH.js → register-setup-G66U2WFV.js} +2 -2
  42. package/dist/cli-bundle/chunks/{stage-NQHF6JPC.js → stage-VIDXGF3T.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/{chunk-LDMBNTOG.js → chunk-2ZS3I5ZP.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/chunk-33EK522E.js +26 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-XLSTFUXM.js → chunk-3A6XMQZJ.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-IS5FLEZW.js → chunk-3FN4ON2Z.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-UIKLNSW3.js → chunk-3SH3L3DB.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-ALLOWZSH.js → chunk-6ICHSVEY.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/chunk-6TJXTKZD.js +44 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-AH5IST3V.js → chunk-AXPRCCYM.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/chunk-DW5S67LO.js +2 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-C3DO4ZGZ.js → chunk-GBW2EAAG.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/chunk-HIKZYZ26.js +82 -0
  54. package/dist/cli-bundle/focused-chunks/{chunk-4FWMXQN3.js → chunk-JYWVRXLD.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/chunk-M5FZTPFA.js +2 -0
  56. package/dist/cli-bundle/focused-chunks/{chunk-2SQUWQP3.js → chunk-MK7UQEE5.js} +18 -18
  57. package/dist/cli-bundle/focused-chunks/{chunk-HNFY3XLC.js → chunk-NMU3QFAU.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-QWUWNFQO.js → chunk-NP5C2TQM.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{chunk-RNZUORGI.js → chunk-NSOXVVQX.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-J7PWHKZK.js → chunk-NY65XTX7.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{chunk-Q45LDP7P.js → chunk-P6KYUJD4.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-LWMPQRJT.js → chunk-UCUESVFW.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{chunk-NZQYHPUN.js → chunk-V27M5UQH.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/chunk-VVGXPF4W.js +26 -0
  65. package/dist/cli-bundle/focused-chunks/{item-revision-M6FOLME2.js → item-revision-B3BIG66B.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/{item-transaction-H6VA5JGB.js → item-transaction-4JDWOXNB.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/{mutation-admission-PRTQWQK6.js → mutation-admission-577MXOGD.js} +2 -2
  68. package/dist/cli-bundle/focused-chunks/{stage-7T77PSJD.js → stage-EKYWEU2Y.js} +2 -2
  69. package/dist/cli-bundle/main.js +32 -32
  70. package/dist/cli-bundle/sdk-authoring.js +1 -1
  71. package/dist/cli-bundle/sdk-contracts.js +1 -1
  72. package/dist/cli-bundle/sdk-core.js +1 -1
  73. package/dist/cli-bundle/sdk-governance.js +1 -1
  74. package/dist/cli-bundle/sdk-graph.js +1 -1
  75. package/dist/cli-bundle/sdk-merge.js +57 -57
  76. package/dist/cli-bundle/sdk-query.js +1 -1
  77. package/dist/cli-bundle/sdk-runtime.js +1 -1
  78. package/dist/cli-bundle/sdk-testing.js +1 -1
  79. package/dist/cli-bundle/sdk.js +11 -11
  80. package/dist/core/checkpoint/mutation-checkpoint.d.ts +12 -20
  81. package/dist/core/config/nested-settings.d.ts +14 -45
  82. package/dist/core/config/nested-settings.js +1 -1
  83. package/dist/core/config/positional-value.d.ts +11 -14
  84. package/dist/core/config/positional-value.js +1 -1
  85. package/dist/core/extensions/activation-summary-markdown.d.ts +4 -5
  86. package/dist/core/extensions/activation-summary.d.ts +7 -15
  87. package/dist/core/extensions/capability-usage.d.ts +7 -23
  88. package/dist/core/extensions/command-hook-context.d.ts +4 -7
  89. package/dist/core/extensions/command-metadata-contract.d.ts +2 -2
  90. package/dist/core/extensions/contribution-inventory.d.ts +3 -25
  91. package/dist/core/extensions/extension-capability-aliases.d.ts +7 -10
  92. package/dist/core/extensions/extension-hook-runtime.d.ts +2 -2
  93. package/dist/core/extensions/extension-policy.d.ts +12 -47
  94. package/dist/core/extensions/extension-registries.d.ts +2 -2
  95. package/dist/core/extensions/extension-types.d.ts +332 -545
  96. package/dist/core/extensions/flag-definition-validation.d.ts +11 -13
  97. package/dist/core/extensions/flag-value-types.d.ts +11 -13
  98. package/dist/core/extensions/index.d.ts +15 -20
  99. package/dist/core/extensions/item-field-types.d.ts +5 -5
  100. package/dist/core/extensions/item-fields.d.ts +4 -7
  101. package/dist/core/extensions/loader.d.ts +5 -69
  102. package/dist/core/extensions/manifest-parser.d.ts +3 -3
  103. package/dist/core/extensions/manifest-schema.d.ts +10 -13
  104. package/dist/core/extensions/registration-contracts.d.ts +2 -4
  105. package/dist/core/extensions/registration-validation.d.ts +1 -1
  106. package/dist/core/extensions/registration-values.d.ts +5 -7
  107. package/dist/core/extensions/runtime-registrations.d.ts +6 -6
  108. package/dist/core/extensions/version-compat.d.ts +9 -10
  109. package/dist/core/fs/fs-utils.d.ts +4 -6
  110. package/dist/core/fs/host-environment-errors.d.ts +8 -10
  111. package/dist/core/governance/content-fields.d.ts +10 -14
  112. package/dist/core/governance/issue-codes.d.ts +12 -18
  113. package/dist/core/governance/metadata-coverage.d.ts +24 -34
  114. package/dist/core/history/digest.d.ts +3 -3
  115. package/dist/core/history/event-classification.d.ts +5 -5
  116. package/dist/core/history/event-index.d.ts +14 -35
  117. package/dist/core/history/history-compact-bulk.d.ts +10 -13
  118. package/dist/core/history/history-diff.d.ts +6 -11
  119. package/dist/core/history/history-rewrite.d.ts +24 -40
  120. package/dist/core/history/history-storage-stats.d.ts +9 -17
  121. package/dist/core/history/history-stream-policy.d.ts +8 -11
  122. package/dist/core/history/history.d.ts +10 -44
  123. package/dist/core/history/identity.d.ts +4 -5
  124. package/dist/core/history/operation-contract.d.ts +5 -15
  125. package/dist/core/history/projection.d.ts +10 -14
  126. package/dist/core/history/read.d.ts +6 -7
  127. package/dist/core/history/replay.d.ts +16 -37
  128. package/dist/core/history/workspace-history.d.ts +27 -60
  129. package/dist/core/io/body-file.d.ts +2 -2
  130. package/dist/core/io/bulk-ids-input.d.ts +7 -8
  131. package/dist/core/item/actionability.d.ts +16 -22
  132. package/dist/core/item/dependency-reference.d.ts +2 -2
  133. package/dist/core/item/id.d.ts +5 -9
  134. package/dist/core/item/item-format-version.d.ts +11 -13
  135. package/dist/core/item/item-format.d.ts +11 -59
  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 +10 -19
  151. package/dist/core/output/tabular.d.ts +2 -2
  152. package/dist/core/packages/manifest.d.ts +13 -17
  153. package/dist/core/packages/root.d.ts +3 -3
  154. package/dist/core/policy/workflow-policy-schema.d.ts +2 -310
  155. package/dist/core/policy/workflow-policy-store.d.ts +5 -14
  156. package/dist/core/policy/workflow-policy.d.ts +25 -52
  157. package/dist/core/profile/profile-describe.d.ts +8 -11
  158. package/dist/core/profile/profile-lint.d.ts +11 -13
  159. package/dist/core/profile/profile-plan.d.ts +30 -49
  160. package/dist/core/profile/profile-presets.d.ts +25 -36
  161. package/dist/core/reproducibility/context.d.ts +6 -7
  162. package/dist/core/schema/fields-file.d.ts +14 -21
  163. package/dist/core/schema/item-types-file.d.ts +16 -22
  164. package/dist/core/schema/runtime-field-filters.d.ts +2 -2
  165. package/dist/core/schema/runtime-field-values.d.ts +6 -13
  166. package/dist/core/schema/runtime-schema.d.ts +19 -31
  167. package/dist/core/schema/status-defs-file.d.ts +15 -25
  168. package/dist/core/schema/status-token.d.ts +1 -1
  169. package/dist/core/schema/type-inference.d.ts +6 -8
  170. package/dist/core/schema/type-presets.d.ts +5 -5
  171. package/dist/core/schema/type-workflows.d.ts +11 -16
  172. package/dist/core/search/background-refresh.d.ts +6 -12
  173. package/dist/core/search/bm25.d.ts +11 -19
  174. package/dist/core/search/cache.d.ts +19 -41
  175. package/dist/core/search/corpus.d.ts +16 -19
  176. package/dist/core/search/embedding-batches.d.ts +12 -17
  177. package/dist/core/search/eval-thresholds.d.ts +3 -3
  178. package/dist/core/search/eval.d.ts +16 -34
  179. package/dist/core/search/http-client.d.ts +14 -18
  180. package/dist/core/search/providers.d.ts +22 -39
  181. package/dist/core/search/relevance.d.ts +14 -19
  182. package/dist/core/search/semantic-defaults.d.ts +4 -5
  183. package/dist/core/search/vector-stores.d.ts +35 -57
  184. package/dist/core/search/vectorization-metadata.d.ts +9 -11
  185. package/dist/core/sentry/helpers.d.ts +6 -31
  186. package/dist/core/sentry/instrument.d.ts +6 -59
  187. package/dist/core/sentry/instrument.js +1 -1
  188. package/dist/core/session/session-state.d.ts +12 -32
  189. package/dist/core/shared/agent-session-context.d.ts +10 -17
  190. package/dist/core/shared/author.d.ts +48 -69
  191. package/dist/core/shared/command-line.d.ts +3 -3
  192. package/dist/core/shared/command-types.d.ts +3 -4
  193. package/dist/core/shared/constants.d.ts +14 -32
  194. package/dist/core/shared/error-details.d.ts +5 -18
  195. package/dist/core/shared/errors.d.ts +42 -83
  196. package/dist/core/shared/html-entity-decode.d.ts +1 -1
  197. package/dist/core/shared/item-metadata-contract.d.ts +2 -2
  198. package/dist/core/shared/lazy-module.d.ts +1 -1
  199. package/dist/core/shared/levenshtein.d.ts +1 -1
  200. package/dist/core/shared/numeric-parsers.d.ts +1 -1
  201. package/dist/core/shared/option-alias-visibility.d.ts +2 -2
  202. package/dist/core/shared/output-unicode.d.ts +1 -1
  203. package/dist/core/shared/primitives.d.ts +10 -10
  204. package/dist/core/shared/secret-rules.d.ts +22 -92
  205. package/dist/core/shared/secret-rules.js +4 -2
  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/shared/url-credentials.d.ts +37 -0
  212. package/dist/core/shared/url-credentials.js +2 -0
  213. package/dist/core/store/item-format-migration.d.ts +4 -5
  214. package/dist/core/store/item-metadata-cache.d.ts +22 -27
  215. package/dist/core/store/item-metadata-query-index.d.ts +20 -61
  216. package/dist/core/store/item-metadata-read-work.d.ts +3 -7
  217. package/dist/core/store/item-mutation-precondition.d.ts +19 -35
  218. package/dist/core/store/item-store.d.ts +18 -141
  219. package/dist/core/store/paths.d.ts +5 -10
  220. package/dist/core/store/settings-read-cache.d.ts +7 -9
  221. package/dist/core/store/settings-sections.d.ts +15 -19
  222. package/dist/core/store/settings-validator.d.ts +27 -143
  223. package/dist/core/store/settings-validator.js +1 -1
  224. package/dist/core/store/settings.d.ts +19 -94
  225. package/dist/core/store/sqlite-runtime.d.ts +3 -3
  226. package/dist/core/store/tracker-preflight.d.ts +2 -2
  227. package/dist/core/telemetry/consent.d.ts +2 -2
  228. package/dist/core/telemetry/observability.d.ts +8 -19
  229. package/dist/core/telemetry/policy.d.ts +8 -23
  230. package/dist/core/telemetry/runtime.d.ts +44 -254
  231. package/dist/core/telemetry/runtime.js +2 -2
  232. package/dist/core/test/background-runs.d.ts +35 -79
  233. package/dist/core/test/run-selectors.d.ts +10 -12
  234. package/dist/core/validate/fix-planning.d.ts +19 -28
  235. package/dist/core/validate/missing-by-type.d.ts +3 -4
  236. package/dist/core/validate/missing-link-owners.d.ts +12 -16
  237. package/dist/core/validate/stale-file-classification.d.ts +5 -6
  238. package/dist/mcp/tool-definitions.d.ts +7 -30
  239. package/dist/sdk/actionability.d.ts +1 -1
  240. package/dist/sdk/agent/closed-domain-contracts.d.ts +4 -5
  241. package/dist/sdk/agent/command-recovery.d.ts +9 -13
  242. package/dist/sdk/agent/command-suggestions.d.ts +2 -2
  243. package/dist/sdk/agent/create-option-policy.d.ts +2 -2
  244. package/dist/sdk/agent/identity-config.d.ts +13 -18
  245. package/dist/sdk/agent/item-addressing.d.ts +4 -5
  246. package/dist/sdk/agent/linked-resource-recovery.d.ts +3 -4
  247. package/dist/sdk/agent/refusal-closure-census.d.ts +13 -25
  248. package/dist/sdk/agent/refusal-closure.d.ts +8 -11
  249. package/dist/sdk/agent/refusal-corpus-contracts.d.ts +15 -21
  250. package/dist/sdk/agent/refusal-reachability.d.ts +38 -52
  251. package/dist/sdk/agent/subcommand-recovery.d.ts +7 -15
  252. package/dist/sdk/agent/task-transcript-contracts.d.ts +12 -15
  253. package/dist/sdk/agent/tracker-preflight-contracts.d.ts +13 -17
  254. package/dist/sdk/agent-capability-contracts.d.ts +19 -32
  255. package/dist/sdk/agent-session-context.d.ts +1 -1
  256. package/dist/sdk/annotations.d.ts +32 -68
  257. package/dist/sdk/author-attribution.d.ts +22 -33
  258. package/dist/sdk/authoring.d.ts +1 -19
  259. package/dist/sdk/cli-bootstrap.d.ts +22 -59
  260. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +31 -57
  261. package/dist/sdk/cli-contracts/command-aliases.d.ts +7 -8
  262. package/dist/sdk/cli-contracts/command-exit-contracts.d.ts +19 -65
  263. package/dist/sdk/cli-contracts/commander-mutation-options.d.ts +2 -2
  264. package/dist/sdk/cli-contracts/commander-types.d.ts +6 -11
  265. package/dist/sdk/cli-contracts/completeness.d.ts +11 -15
  266. package/dist/sdk/cli-contracts/enum-contracts.d.ts +25 -37
  267. package/dist/sdk/cli-contracts/flag-contracts.d.ts +16 -20
  268. package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +14 -19
  269. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +29 -47
  270. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +44 -265
  271. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +11 -564
  272. package/dist/sdk/cli-contracts/tool-schema.d.ts +18 -51
  273. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +18 -37
  274. package/dist/sdk/cli-contracts.d.ts +1 -16
  275. package/dist/sdk/cli-program.d.ts +2 -2
  276. package/dist/sdk/command-line.d.ts +3 -4
  277. package/dist/sdk/command-line.js +1 -1
  278. package/dist/sdk/comments.d.ts +6 -10
  279. package/dist/sdk/compile-cache.d.ts +4 -5
  280. package/dist/sdk/completion/bash.d.ts +2 -2
  281. package/dist/sdk/completion/fish.d.ts +2 -2
  282. package/dist/sdk/completion/shared.d.ts +10 -77
  283. package/dist/sdk/completion/shared.js +1 -1
  284. package/dist/sdk/completion/zsh.d.ts +2 -2
  285. package/dist/sdk/completion.d.ts +2 -6
  286. package/dist/sdk/compose.d.ts +49 -74
  287. package/dist/sdk/config.d.ts +18 -94
  288. package/dist/sdk/config.js +1 -1
  289. package/dist/sdk/context/recency.d.ts +2 -2
  290. package/dist/sdk/context/semantic-session-attribution.d.ts +6 -25
  291. package/dist/sdk/context/usage-ledger.d.ts +9 -21
  292. package/dist/sdk/context-intent-contracts.d.ts +24 -35
  293. package/dist/sdk/context-intent-runtime.d.ts +7 -9
  294. package/dist/sdk/context-packing.d.ts +16 -34
  295. package/dist/sdk/context-relevance.d.ts +58 -93
  296. package/dist/sdk/context-signal-store.d.ts +29 -60
  297. package/dist/sdk/context-usage.d.ts +22 -69
  298. package/dist/sdk/contracts.d.ts +1 -24
  299. package/dist/sdk/core-governance.d.ts +1 -5
  300. package/dist/sdk/core.d.ts +1 -27
  301. package/dist/sdk/corpus-shape.d.ts +16 -28
  302. package/dist/sdk/define.d.ts +10 -14
  303. package/dist/sdk/dependencies.d.ts +32 -50
  304. package/dist/sdk/dependency-provenance.d.ts +19 -23
  305. package/dist/sdk/docs.d.ts +6 -10
  306. package/dist/sdk/duplicates.d.ts +8 -15
  307. package/dist/sdk/environment/agent-environment.d.ts +60 -101
  308. package/dist/sdk/environment/host-environment-errors.d.ts +1 -1
  309. package/dist/sdk/environment/project-runtime-compatibility.d.ts +15 -29
  310. package/dist/sdk/environment/source-context.d.ts +6 -7
  311. package/dist/sdk/environment/tracker-preflight.d.ts +1 -1
  312. package/dist/sdk/error-code-catalog.d.ts +9 -26
  313. package/dist/sdk/error-runtime.d.ts +6 -8
  314. package/dist/sdk/errors.d.ts +10 -17
  315. package/dist/sdk/eval.d.ts +11 -21
  316. package/dist/sdk/extension/command-options.d.ts +14 -26
  317. package/dist/sdk/extension/describe.d.ts +14 -19
  318. package/dist/sdk/extension/doctor.d.ts +8 -48
  319. package/dist/sdk/extension/install-plan.d.ts +12 -26
  320. package/dist/sdk/extension/install-runtime.d.ts +10 -11
  321. package/dist/sdk/extension/install-sources.d.ts +22 -104
  322. package/dist/sdk/extension/managed-state.d.ts +13 -18
  323. package/dist/sdk/extension/migrations.d.ts +22 -37
  324. package/dist/sdk/extension/output-ownership.d.ts +3 -30
  325. package/dist/sdk/extension/shared.d.ts +9 -15
  326. package/dist/sdk/extension/source-resolution.d.ts +13 -18
  327. package/dist/sdk/extension/static-inventory.d.ts +17 -21
  328. package/dist/sdk/extension/update-check.d.ts +7 -11
  329. package/dist/sdk/extension-command-context.d.ts +2 -3
  330. package/dist/sdk/extension-contracts.d.ts +11 -14
  331. package/dist/sdk/extension.d.ts +31 -192
  332. package/dist/sdk/files.d.ts +27 -68
  333. package/dist/sdk/flag-invocation-contracts.d.ts +13 -17
  334. package/dist/sdk/generated/generated-error-code-catalog-part-1.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/index.js +1 -1
  411. package/dist/sdk/init-agent-guidance.d.ts +13 -68
  412. package/dist/sdk/init.d.ts +24 -94
  413. package/dist/sdk/invocation-author.d.ts +1 -1
  414. package/dist/sdk/item-children.d.ts +10 -13
  415. package/dist/sdk/item-metadata-index.d.ts +1 -2
  416. package/dist/sdk/item-schedule.d.ts +8 -9
  417. package/dist/sdk/item-transaction.d.ts +46 -90
  418. package/dist/sdk/learnings.d.ts +6 -10
  419. package/dist/sdk/lifecycle/append.d.ts +7 -9
  420. package/dist/sdk/lifecycle/claim.d.ts +26 -42
  421. package/dist/sdk/lifecycle/cli-input.d.ts +1 -1
  422. package/dist/sdk/lifecycle/close-many.d.ts +14 -65
  423. package/dist/sdk/lifecycle/close.d.ts +10 -26
  424. package/dist/sdk/lifecycle/copy.d.ts +6 -10
  425. package/dist/sdk/lifecycle/create.d.ts +15 -83
  426. package/dist/sdk/lifecycle/delete.d.ts +7 -9
  427. package/dist/sdk/lifecycle/focus.d.ts +9 -11
  428. package/dist/sdk/lifecycle/item-revision.d.ts +25 -45
  429. package/dist/sdk/lifecycle/item-revision.js +1 -1
  430. package/dist/sdk/lifecycle/lifecycle-transitions.d.ts +4 -5
  431. package/dist/sdk/lifecycle/mutation-command-options.d.ts +6 -9
  432. package/dist/sdk/lifecycle/plan-mutation-receipt.d.ts +5 -13
  433. package/dist/sdk/lifecycle/plan.d.ts +34 -74
  434. package/dist/sdk/lifecycle/reopen.d.ts +8 -14
  435. package/dist/sdk/lifecycle/restore.d.ts +9 -38
  436. package/dist/sdk/lifecycle/shared-unset-fields.d.ts +23 -614
  437. package/dist/sdk/lifecycle/start-blockers.d.ts +7 -27
  438. package/dist/sdk/lifecycle/structured-mutation-plan.d.ts +8 -16
  439. package/dist/sdk/lifecycle/task-composition.d.ts +6 -14
  440. package/dist/sdk/lifecycle/update-many.d.ts +15 -65
  441. package/dist/sdk/lifecycle/update.d.ts +21 -104
  442. package/dist/sdk/lifecycle/workflow-transition.d.ts +2 -11
  443. package/dist/sdk/lifecycle-completion.d.ts +11 -14
  444. package/dist/sdk/lifecycle-policy.d.ts +23 -32
  445. package/dist/sdk/linked-artifacts.d.ts +31 -41
  446. package/dist/sdk/mcp/apps.d.ts +12 -27
  447. package/dist/sdk/mcp/authorization.d.ts +30 -63
  448. package/dist/sdk/mcp/discovery.d.ts +23 -52
  449. package/dist/sdk/mcp/executable.d.ts +3 -10
  450. package/dist/sdk/mcp/interactions.d.ts +25 -47
  451. package/dist/sdk/mcp/protocol.d.ts +32 -64
  452. package/dist/sdk/mcp/skills.d.ts +21 -71
  453. package/dist/sdk/mcp/subscriptions.d.ts +14 -28
  454. package/dist/sdk/mcp/tasks.d.ts +21 -55
  455. package/dist/sdk/mcp/transport.d.ts +7 -15
  456. package/dist/sdk/merge/driver.d.ts +13 -37
  457. package/dist/sdk/merge/index.d.ts +1 -6
  458. package/dist/sdk/merge/install.d.ts +27 -55
  459. package/dist/sdk/merge/receipt-operation.d.ts +5 -6
  460. package/dist/sdk/merge/receipt-schema.d.ts +6 -9
  461. package/dist/sdk/merge/receipts.d.ts +29 -79
  462. package/dist/sdk/merge/reconcile.d.ts +9 -18
  463. package/dist/sdk/merge/three-way.d.ts +21 -30
  464. package/dist/sdk/merge.d.ts +1 -5
  465. package/dist/sdk/mutation-events.d.ts +21 -53
  466. package/dist/sdk/mutation-guard.d.ts +15 -135
  467. package/dist/sdk/notes.d.ts +6 -10
  468. package/dist/sdk/output/fit-envelope.d.ts +21 -28
  469. package/dist/sdk/output/list-envelope.d.ts +1 -1
  470. package/dist/sdk/output/table-rows.d.ts +8 -12
  471. package/dist/sdk/output-contracts.d.ts +11 -14
  472. package/dist/sdk/output-projection.d.ts +18 -130
  473. package/dist/sdk/output-token-accounting.d.ts +8 -15
  474. package/dist/sdk/output.d.ts +10 -15
  475. package/dist/sdk/ownership-source.d.ts +4 -5
  476. package/dist/sdk/package-import-adapters.d.ts +27 -37
  477. package/dist/sdk/package-migrations.d.ts +2 -2
  478. package/dist/sdk/package-runtime-options.d.ts +3 -3
  479. package/dist/sdk/pagination.d.ts +12 -24
  480. package/dist/sdk/profile.d.ts +25 -42
  481. package/dist/sdk/provenance.d.ts +21 -32
  482. package/dist/sdk/public-surface.json +1 -1
  483. package/dist/sdk/query/activity.d.ts +24 -77
  484. package/dist/sdk/query/aggregate.d.ts +20 -95
  485. package/dist/sdk/query/calendar.d.ts +26 -74
  486. package/dist/sdk/query/complete-list.d.ts +19 -35
  487. package/dist/sdk/query/context.d.ts +69 -240
  488. package/dist/sdk/query/declared-blockers.d.ts +2 -9
  489. package/dist/sdk/query/duplicate-candidates.d.ts +3 -5
  490. package/dist/sdk/query/get.d.ts +13 -55
  491. package/dist/sdk/query/history.d.ts +18 -29
  492. package/dist/sdk/query/item-filter-options.d.ts +7 -12
  493. package/dist/sdk/query/list-filter-shared.d.ts +4 -8
  494. package/dist/sdk/query/list.d.ts +44 -168
  495. package/dist/sdk/query/multi-value-filters.d.ts +7 -9
  496. package/dist/sdk/query/next-ranking-policy.d.ts +4 -10
  497. package/dist/sdk/query/next-ready-budget.d.ts +4 -5
  498. package/dist/sdk/query/next.d.ts +27 -86
  499. package/dist/sdk/query/parsers.d.ts +4 -6
  500. package/dist/sdk/query/projection-contracts.d.ts +12 -21
  501. package/dist/sdk/query/search/corpus.d.ts +5 -20
  502. package/dist/sdk/query/search/filters.d.ts +5 -17
  503. package/dist/sdk/query/search/input.d.ts +4 -9
  504. package/dist/sdk/query/search/lexical.d.ts +5 -9
  505. package/dist/sdk/query/search/response.d.ts +5 -22
  506. package/dist/sdk/query/search/semantic.d.ts +24 -170
  507. package/dist/sdk/query/search/types.d.ts +19 -73
  508. package/dist/sdk/query/search-contracts.d.ts +24 -34
  509. package/dist/sdk/query/search-pagination.d.ts +5 -24
  510. package/dist/sdk/query/search-rendering.d.ts +8 -32
  511. package/dist/sdk/query/search.d.ts +3 -63
  512. package/dist/sdk/query/workspace-contracts.d.ts +2 -2
  513. package/dist/sdk/query.d.ts +1 -43
  514. package/dist/sdk/read-output/continuation.d.ts +5 -6
  515. package/dist/sdk/read-output/options.d.ts +3 -8
  516. package/dist/sdk/read-output/session-result.d.ts +2 -33
  517. package/dist/sdk/read-output/tail-retention.d.ts +6 -8
  518. package/dist/sdk/read-output-budget.d.ts +14 -16
  519. package/dist/sdk/read-output-contracts.d.ts +59 -103
  520. package/dist/sdk/read-output-rows.d.ts +5 -9
  521. package/dist/sdk/read-output-session.d.ts +11 -14
  522. package/dist/sdk/relationship-analytics.d.ts +17 -37
  523. package/dist/sdk/relationship-context.d.ts +15 -33
  524. package/dist/sdk/relationship-history.d.ts +29 -50
  525. package/dist/sdk/relationship-kinds/contract.d.ts +11 -12
  526. package/dist/sdk/relationship-migration.d.ts +6 -10
  527. package/dist/sdk/relationships.d.ts +22 -34
  528. package/dist/sdk/reproducibility/process.d.ts +7 -11
  529. package/dist/sdk/runtime/context.d.ts +6 -22
  530. package/dist/sdk/runtime/schema-preview.d.ts +1 -1
  531. package/dist/sdk/runtime-input.d.ts +9 -20
  532. package/dist/sdk/runtime-primitives.d.ts +3 -82
  533. package/dist/sdk/runtime-public-contracts.d.ts +30 -50
  534. package/dist/sdk/runtime.d.ts +77 -302
  535. package/dist/sdk/scheduling-shortcuts.d.ts +8 -12
  536. package/dist/sdk/schema-migration.d.ts +18 -80
  537. package/dist/sdk/schema.d.ts +89 -192
  538. package/dist/sdk/search-refresh-worker.d.ts +1 -1
  539. package/dist/sdk/similarity-scoring.d.ts +6 -8
  540. package/dist/sdk/similarity.d.ts +33 -64
  541. package/dist/sdk/start-task-status.d.ts +2 -2
  542. package/dist/sdk/stats.d.ts +13 -48
  543. package/dist/sdk/structured-mutations.d.ts +18 -26
  544. package/dist/sdk/telemetry-flush.d.ts +1 -1
  545. package/dist/sdk/telemetry.d.ts +14 -20
  546. package/dist/sdk/templates.d.ts +14 -35
  547. package/dist/sdk/test/batch.d.ts +10 -25
  548. package/dist/sdk/test/execution.d.ts +44 -209
  549. package/dist/sdk/test/json-path.d.ts +2 -5
  550. package/dist/sdk/test/linked-command-detection.d.ts +10 -25
  551. package/dist/sdk/test/measurements.d.ts +10 -13
  552. package/dist/sdk/test/parsers.d.ts +16 -20
  553. package/dist/sdk/test/prerequisites.d.ts +2 -3
  554. package/dist/sdk/test/runs.d.ts +19 -52
  555. package/dist/sdk/test/trust.d.ts +8 -12
  556. package/dist/sdk/test/update.d.ts +9 -25
  557. package/dist/sdk/testing.d.ts +97 -206
  558. package/dist/sdk/traceability/source-traceability.d.ts +25 -56
  559. package/dist/sdk/tracker-root-discovery.d.ts +1 -1
  560. package/dist/sdk/workspace-contracts-cache.d.ts +2 -2
  561. package/dist/sdk/workspace-contracts.d.ts +8 -14
  562. package/dist/sdk/workspace-memory.d.ts +24 -42
  563. package/dist/sdk/workspace-recipe.d.ts +10 -14
  564. package/dist/sdk/workspace-snapshot.d.ts +26 -53
  565. package/dist/sdk/workspace-transaction-gc.d.ts +12 -16
  566. package/dist/sdk/workspace-transaction.d.ts +26 -40
  567. package/dist/sdk/workspace.d.ts +8 -10
  568. package/dist/types/index.d.ts +1 -1
  569. package/dist/types.d.ts +210 -353
  570. package/docs/CODEX_PLUGIN.md +2 -1
  571. package/docs/COMMANDS.md +8 -0
  572. package/docs/CONFIGURATION.md +33 -0
  573. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +28 -9
  574. package/docs/MUTATION_INTEGRITY.md +65 -0
  575. package/docs/README.md +2 -2
  576. package/docs/RELEASING.md +25 -0
  577. package/docs/SDK.md +33 -2
  578. package/docs/TESTING.md +11 -0
  579. package/marketplace.json +1 -1
  580. package/package.json +2 -1
  581. package/packages/pm-beads/package.json +1 -1
  582. package/packages/pm-calendar/package.json +1 -1
  583. package/packages/pm-command-kit/package.json +1 -1
  584. package/packages/pm-digital-twin/package.json +1 -1
  585. package/packages/pm-governance-audit/package.json +1 -1
  586. package/packages/pm-guide-shell/package.json +1 -1
  587. package/packages/pm-kanban/package.json +1 -1
  588. package/packages/pm-lifecycle-hooks/package.json +1 -1
  589. package/packages/pm-linked-test-adapters/package.json +1 -1
  590. package/packages/pm-search-advanced/package.json +1 -1
  591. package/packages/pm-templates/package.json +1 -1
  592. package/packages/pm-todos/package.json +1 -1
  593. package/packages/pm-vcs/package.json +1 -1
  594. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  595. package/plugins/pm-claude/package.json +1 -1
  596. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  597. package/plugins/pm-codex/package.json +1 -1
  598. package/plugins/pm-codex/plugin.json +1 -1
  599. package/runtime-dependencies.json +1 -1
  600. package/scripts/finalize-build.mjs +41 -4
  601. package/dist/cli-bundle/chunks/chunk-ASJZMYKM.js +0 -122
  602. package/dist/cli-bundle/chunks/chunk-BLUCQ4T4.js +0 -2
  603. package/dist/cli-bundle/chunks/chunk-JYQXIC6C.js +0 -3
  604. package/dist/cli-bundle/chunks/chunk-LVDFPGD7.js +0 -3
  605. package/dist/cli-bundle/chunks/chunk-UFIM5ZC5.js +0 -6
  606. package/dist/cli-bundle/chunks/item-transaction-XBIN4KYM.js +0 -2
  607. package/dist/cli-bundle/focused-chunks/chunk-CUGJ2DY2.js +0 -24
  608. package/dist/cli-bundle/focused-chunks/chunk-HLQOGAWG.js +0 -26
  609. package/dist/cli-bundle/focused-chunks/chunk-IB6TCE7N.js +0 -2
  610. package/dist/cli-bundle/focused-chunks/chunk-JU62TKJP.js +0 -82
  611. package/dist/cli-bundle/focused-chunks/chunk-MYBKRV5R.js +0 -2
  612. package/dist/cli-bundle/focused-chunks/chunk-NUFO3OR6.js +0 -44
  613. package/docs/CHATGPT_CODEX_PLUGIN_IMPLEMENTATION.md +0 -776
@@ -1,10 +1,6 @@
1
- import { type ItemRevisionConflictRowFields } from "./item-revision.js";
2
- import { type GlobalOptions } from "../runtime-primitives.js";
3
- import { collectBlockedByIds } from "../actionability.js";
4
- import { type CloseOperationOptions,type CloseOperationResult,type CloseEvidenceFollowUp,type CloseCompletionReceipt } from "../lifecycle-policy.js";
5
- import type { PmCliErrorDetails,PmCliErrorDetailValue } from "../../core/shared/errors.js";
1
+ import{type ItemRevisionConflictRowFields}from "./item-revision.js";import{type GlobalOptions}from "../runtime-primitives.js";import{collectBlockedByIds}from "../actionability.js";import{type CloseOperationOptions,type CloseOperationResult,type CloseEvidenceFollowUp,type CloseCompletionReceipt}from "../lifecycle-policy.js";import type{PmCliErrorDetails,PmCliErrorDetailValue}from "../../core/shared/errors.js";
6
2
  /** Compatibility options for command-shaped close consumers. */
7
- export interface CloseCommandOptions {
3
+ export interface CloseCommandOptions{
8
4
  /** Mutation author. */
9
5
  author?:string;
10
6
  /** Immutable history message. */
@@ -22,10 +18,9 @@ actualResult?:string;
22
18
  /** Canonical duplicate target. */
23
19
  duplicateOf?:string;
24
20
  /** Actual completion time. */
25
- completedAt?:string;
26
- }
21
+ completedAt?:string;}
27
22
  /** Compatibility result for command-shaped close consumers. */
28
- export interface CloseResult {
23
+ export interface CloseResult{
29
24
  /** Completion timestamp provenance sealed into this close event. */
30
25
  completion?:CloseCompletionReceipt;
31
26
  /** Closed item record. */
@@ -35,8 +30,7 @@ changed_fields:string[];
35
30
  /** Evidence-only update guidance when acceptance fields are missing. */
36
31
  follow_up?:CloseEvidenceFollowUp;
37
32
  /** Validation and lifecycle receipts. */
38
- warnings:string[];
39
- }
33
+ warnings:string[];}
40
34
  /**
41
35
  * Trim the merged post-close details until the error host renders them whole:
42
36
  * other failures first, then the revision change evidence, then pending ids
@@ -45,26 +39,16 @@ warnings:string[];
45
39
  */
46
40
  declare function fitPostCloseDetails(details:Record<string,PmCliErrorDetailValue>):PmCliErrorDetails;
47
41
  /** A guarded dependent whose auto-unblock refused after a bulk row's close committed. */
48
- export type DependentRevisionConflict = ItemRevisionConflictRowFields & {
49
- item_id:string;
50
- error:string;
51
- };
42
+ export type DependentRevisionConflict=ItemRevisionConflictRowFields&{item_id:string;error:string;};
52
43
  /**
53
44
  * Bulk-row fields for a row whose close committed before a guarded dependent's
54
45
  * auto-unblock refused (the refusal discloses the close in `side_effects`), or
55
46
  * undefined for any other failure (pm-gh1576).
56
47
  */
57
- export declare function committedCloseDependentConflict(error:unknown,id:string,pmRoot:string):Promise<{
58
- warnings:string[];
59
- dependent_revision_conflict:DependentRevisionConflict;
60
- } | undefined>;
48
+ export declare function committedCloseDependentConflict(error:unknown,id:string,pmRoot:string):Promise<{warnings:string[];dependent_revision_conflict:DependentRevisionConflict;}|undefined>;
61
49
  /** Public contract for test only close command, shared by SDK and presentation-layer consumers. */
62
- export declare const _testOnlyCloseCommand:{
63
- blockedByIds:typeof collectBlockedByIds;
64
- fitPostCloseDetails:typeof fitPostCloseDetails;
65
- };
50
+ export declare const _testOnlyCloseCommand:{blockedByIds:typeof collectBlockedByIds;fitPostCloseDetails:typeof fitPostCloseDetails;};
66
51
  /** Close one item through the SDK-owned lifecycle transaction and policy. */
67
- export declare function closeItem(id:string,closeReasonText:string | undefined,options:CloseOperationOptions,global:GlobalOptions):Promise<CloseOperationResult>;
52
+ export declare function closeItem(id:string,closeReasonText:string|undefined,options:CloseOperationOptions,global:GlobalOptions):Promise<CloseOperationResult>;
68
53
  /** Compatibility command-shaped wrapper over the SDK-owned close operation. */
69
- export declare function runClose(id:string,closeReasonText:string | undefined,options:CloseCommandOptions,global:GlobalOptions):Promise<CloseResult>;
70
- export {};
54
+ export declare function runClose(id:string,closeReasonText:string|undefined,options:CloseCommandOptions,global:GlobalOptions):Promise<CloseResult>;export{};
@@ -1,8 +1,6 @@
1
- import { type GlobalOptions } from "../runtime-primitives.js";
2
- import { type SimilarityAdvisory } from "../similarity.js";
3
- import type { ItemMetadata } from "../../types/index.js";
1
+ import{type GlobalOptions}from "../runtime-primitives.js";import{type SimilarityAdvisory}from "../similarity.js";import type{ItemMetadata}from "../../types/index.js";
4
2
  /** Documents the copy options payload exchanged by command, SDK, and package integrations. */
5
- export interface CopyOptions {
3
+ export interface CopyOptions{
6
4
  /** Value that configures or reports title for this contract. */
7
5
  title?:string;
8
6
  /** Value that configures or reports author for this contract. */
@@ -10,10 +8,9 @@ author?:string;
10
8
  /** Human-readable explanation suitable for logs and agent-facing output. */
11
9
  message?:string;
12
10
  /** Explicitly permit a likely duplicate when strict governance is enabled. */
13
- allowDuplicate?:boolean;
14
- }
11
+ allowDuplicate?:boolean;}
15
12
  /** Documents the copy result payload exchanged by command, SDK, and package integrations. */
16
- export interface CopyResult {
13
+ export interface CopyResult{
17
14
  /** Value that configures or reports source id for this contract. */
18
15
  source_id:string;
19
16
  /** Value that configures or reports item for this contract. */
@@ -23,7 +20,6 @@ changed_fields:string[];
23
20
  /** Value that configures or reports warnings for this contract. */
24
21
  warnings:string[];
25
22
  /** Likely existing items found before the mutation committed. */
26
- similarity_advisory?:SimilarityAdvisory;
27
- }
23
+ similarity_advisory?:SimilarityAdvisory;}
28
24
  /** Implements run copy for the public runtime surface of this module. */
29
- export declare function runCopy(sourceId:string,options:CopyOptions,global:GlobalOptions):Promise<CopyResult>;
25
+ export declare function runCopy(sourceId:string,options:CopyOptions,global:GlobalOptions):Promise<CopyResult>;
@@ -1,12 +1,6 @@
1
- import { type MutationInputAudience } from "../../core/item/literal-mutation-input.js";
2
- import { type ResolvedItemTypeDefinition,type RuntimeFieldRegistry,type GlobalOptions } from "../runtime-primitives.js";
3
- import { type SimilarityAdvisory } from "../similarity.js";
4
- import { type LifecycleTransitionSuggestion } from "./lifecycle-transitions.js";
5
- import { type CreateNullClearableOptionKey,type WithNullClears } from "./shared-unset-fields.js";
6
- import type { MutationMetadataCommandOptions,SharedLinkedResourceClearOptions,SharedLinkedResourceOptions } from "./mutation-command-options.js";
7
- import type { Comment,Dependency,ItemMetadata,LinkedDoc,LinkedFile,LinkedTest,LogNote } from "../../types/index.js";
1
+ import{type MutationInputAudience}from "../../core/item/literal-mutation-input.js";import{type ResolvedItemTypeDefinition,type RuntimeFieldRegistry,type GlobalOptions}from "../runtime-primitives.js";import{type SimilarityAdvisory}from "../similarity.js";import{type LifecycleTransitionSuggestion}from "./lifecycle-transitions.js";import{type CreateNullClearableOptionKey,type WithNullClears}from "./shared-unset-fields.js";import type{MutationMetadataCommandOptions,SharedLinkedResourceClearOptions,SharedLinkedResourceOptions}from "./mutation-command-options.js";import type{Comment,Dependency,ItemMetadata,LinkedDoc,LinkedFile,LinkedTest,LogNote}from "../../types/index.js";
8
2
  /** Documents the create command options payload exchanged by command, SDK, and package integrations. */
9
- export interface CreateCommandOptions extends MutationMetadataCommandOptions,SharedLinkedResourceOptions,SharedLinkedResourceClearOptions {
3
+ export interface CreateCommandOptions extends MutationMetadataCommandOptions,SharedLinkedResourceOptions,SharedLinkedResourceClearOptions{
10
4
  /** Value that configures or reports title for this contract. */
11
5
  title?:string;
12
6
  /** Explicit item id, normalized with the workspace prefix instead of randomly generated. */
@@ -22,7 +16,7 @@ closeReason?:string;
22
16
  /** Actual completion time when importing an already-completed item. */
23
17
  completedAt?:string;
24
18
  /** Value that configures or reports priority for this contract. */
25
- priority?:string | number;
19
+ priority?:string|number;
26
20
  /** Value that configures or reports tags for this contract. */
27
21
  tags?:string;
28
22
  /** Value that configures or reports add tags for this contract. */
@@ -42,13 +36,11 @@ schedulePreset?:string;
42
36
  /** Explicitly permit a likely duplicate when strict governance is enabled. */
43
37
  allowDuplicate?:boolean;
44
38
  /** Opt into saved session focus as parent when neither parent nor unset-parent is supplied. Defaults to false in SDK/MCP; the CLI enables it by default. */
45
- inheritFocus?:boolean;
46
- [key:string]:unknown;
47
- }
39
+ inheritFocus?:boolean;[key:string]:unknown;}
48
40
  /** Presentation-neutral input accepted by the SDK-owned create operation; clearable fields also accept `null`. */
49
- export type CreateOperationOptions = WithNullClears<CreateCommandOptions,CreateNullClearableOptionKey>;
41
+ export type CreateOperationOptions=WithNullClears<CreateCommandOptions,CreateNullClearableOptionKey>;
50
42
  /** Documents the create result payload exchanged by command, SDK, and package integrations. */
51
- export interface CreateResult {
43
+ export interface CreateResult{
52
44
  /** Value that configures or reports item for this contract. */
53
45
  item:ItemMetadata;
54
46
  /** Value that configures or reports changed fields for this contract. */
@@ -60,84 +52,24 @@ parent_source?:"focus";
60
52
  /** Value that configures or reports next transition for this contract. */
61
53
  next_transition?:LifecycleTransitionSuggestion;
62
54
  /** Likely existing items found before the mutation committed. */
63
- similarity_advisory?:SimilarityAdvisory;
64
- }
65
- declare function buildInvalidLogSeedKeysMessage(optionName:"--comment" | "--note" | "--learning",unsupportedKeys:string[]):string;
66
- declare function parseCreateUnsetTargets(raw:string[] | undefined,runtimeFieldRegistry?:RuntimeFieldRegistry):{
67
- metadataKeys:Set<string>;
68
- optionKeys:Set<string>;
69
- };
70
- declare function parseDependencies(raw:string[] | undefined,nowValue:string,prefix:string,fallbackAuthor:string):{
71
- values:Dependency[] | undefined;
72
- explicitEmpty:boolean;
73
- };
74
- declare function normalizeDependencyKindInput(raw:string | undefined):string | undefined;
75
- declare function looksLikeStructuredEntry(raw:string,keys:readonly string[]):boolean;
55
+ similarity_advisory?:SimilarityAdvisory;}
56
+ declare function buildInvalidLogSeedKeysMessage(optionName:"--comment"|"--note"|"--learning",unsupportedKeys:string[]):string;declare function parseCreateUnsetTargets(raw:string[]|undefined,runtimeFieldRegistry?:RuntimeFieldRegistry):{metadataKeys:Set<string>;optionKeys:Set<string>;};declare function parseDependencies(raw:string[]|undefined,nowValue:string,prefix:string,fallbackAuthor:string):{values:Dependency[]|undefined;explicitEmpty:boolean;};declare function normalizeDependencyKindInput(raw:string|undefined):string|undefined;declare function looksLikeStructuredEntry(raw:string,keys:readonly string[]):boolean;
76
57
  /** Implements parse log seed for the public runtime surface of this module. */
77
- export declare function parseLogSeed(optionName:"--comment" | "--note" | "--learning",raw:string[] | undefined,nowValue:string,fallbackAuthor:string):{
78
- values:LogNote[] | Comment[] | undefined;
79
- explicitEmpty:boolean;
80
- };
58
+ export declare function parseLogSeed(optionName:"--comment"|"--note"|"--learning",raw:string[]|undefined,nowValue:string,fallbackAuthor:string):{values:LogNote[]|Comment[]|undefined;explicitEmpty:boolean;};
81
59
  /** Implements parse files for the public runtime surface of this module. */
82
- export declare function parseFiles(raw:string[] | undefined):{
83
- values:LinkedFile[] | undefined;
84
- explicitEmpty:boolean;
85
- };
60
+ export declare function parseFiles(raw:string[]|undefined):{values:LinkedFile[]|undefined;explicitEmpty:boolean;};
86
61
  /** Implements parse tests for the public runtime surface of this module. */
87
- export declare function parseTests(raw:string[] | undefined):{
88
- values:LinkedTest[] | undefined;
89
- explicitEmpty:boolean;
90
- };
62
+ export declare function parseTests(raw:string[]|undefined):{values:LinkedTest[]|undefined;explicitEmpty:boolean;};
91
63
  /** Implements parse docs for the public runtime surface of this module. */
92
- export declare function parseDocs(raw:string[] | undefined):{
93
- values:LinkedDoc[] | undefined;
94
- explicitEmpty:boolean;
95
- };
96
- declare function buildHistoryMessage(baseMessage:string | undefined,explicitUnsets:string[]):string | undefined;
97
- declare function normalizeCreatePolicyOptionKey(raw:string,typeName:string,sourceLabel:string):string;
98
- interface CreateOptionValueLookup {
99
- scalarValues:Record<string,unknown>;
100
- repeatableValues:Record<string,unknown>;
101
- addTags:string[] | undefined;
102
- }
103
- declare function hasCreateOptionValue(lookup:CreateOptionValueLookup,optionKey:string):boolean;
104
- declare function collectMissingRequiredTypeOptionKeys(errors:string[],typeName:string):string[];
105
- declare function filterNonMissingTypeOptionErrors(errors:string[],typeName:string):string[];
106
- declare function typeOptionExampleValue(typeDefinition:ResolvedItemTypeDefinition,key:string):string;
64
+ export declare function parseDocs(raw:string[]|undefined):{values:LinkedDoc[]|undefined;explicitEmpty:boolean;};declare function buildHistoryMessage(baseMessage:string|undefined,explicitUnsets:string[]):string|undefined;declare function normalizeCreatePolicyOptionKey(raw:string,typeName:string,sourceLabel:string):string;interface CreateOptionValueLookup{scalarValues:Record<string,unknown>;repeatableValues:Record<string,unknown>;addTags:string[]|undefined;}
65
+ declare function hasCreateOptionValue(lookup:CreateOptionValueLookup,optionKey:string):boolean;declare function collectMissingRequiredTypeOptionKeys(errors:string[],typeName:string):string[];declare function filterNonMissingTypeOptionErrors(errors:string[],typeName:string):string[];declare function typeOptionExampleValue(typeDefinition:ResolvedItemTypeDefinition,key:string):string;
107
66
  /** Render canonical scalar flags, retaining placeholders only where the caller must supply project-specific intent. */
108
67
  declare function createExampleTokensForFlag(flag:string,typeName:string,openStatus:string):string[];
109
68
  /** Build a runnable option shape for one configured type, expressing empty required collections with explicit clear flags. */
110
69
  declare function buildTypeSpecificCreateExample(typeDefinition:ResolvedItemTypeDefinition,missingCreateFlags:string[],missingTypeOptionKeys:string[],openStatus:string):string;
111
70
  /** Require a trimmed option value while preserving title-specific recovery guidance. */
112
- export declare function requireStringOption(value:string | undefined,flag:string,audience?:MutationInputAudience):string;
113
- declare function mergeCreateOptionsWithTemplate(templateOptions:Record<string,unknown>,explicitOptions:CreateCommandOptions,runtimeFieldRegistry?:RuntimeFieldRegistry):CreateCommandOptions;
114
- declare function normalizeExtensionCommandPath(command:string):string;
115
- declare function hasTemplatesShowHandler():boolean;
116
- declare function readTemplateOptionsFromRuntimeResult(result:unknown,templateName:string):Record<string,string | string[] | number | boolean>;
117
- declare function loadCreateTemplateOptionsFromRuntime(templateName:string,global:GlobalOptions,pmRoot:string):Promise<Record<string,string | string[] | number | boolean>>;
71
+ export declare function requireStringOption(value:string|undefined,flag:string,audience?:MutationInputAudience):string;declare function mergeCreateOptionsWithTemplate(templateOptions:Record<string,unknown>,explicitOptions:CreateCommandOptions,runtimeFieldRegistry?:RuntimeFieldRegistry):CreateCommandOptions;declare function normalizeExtensionCommandPath(command:string):string;declare function hasTemplatesShowHandler():boolean;declare function readTemplateOptionsFromRuntimeResult(result:unknown,templateName:string):Record<string,string|string[]|number|boolean>;declare function loadCreateTemplateOptionsFromRuntime(templateName:string,global:GlobalOptions,pmRoot:string):Promise<Record<string,string|string[]|number|boolean>>;
118
72
  /** Implements run create for the public runtime surface of this module. */
119
73
  export declare function runCreate(input:CreateOperationOptions,global:GlobalOptions):Promise<CreateResult>;
120
74
  /** Public contract for test only create command, shared by SDK and presentation-layer consumers. */
121
- export declare const _testOnlyCreateCommand:{
122
- buildHistoryMessage:typeof buildHistoryMessage;
123
- buildInvalidLogSeedKeysMessage:typeof buildInvalidLogSeedKeysMessage;
124
- buildTypeSpecificCreateExample:typeof buildTypeSpecificCreateExample;
125
- collectMissingRequiredTypeOptionKeys:typeof collectMissingRequiredTypeOptionKeys;
126
- createExampleTokensForFlag:typeof createExampleTokensForFlag;
127
- filterNonMissingTypeOptionErrors:typeof filterNonMissingTypeOptionErrors;
128
- hasTemplatesShowHandler:typeof hasTemplatesShowHandler;
129
- hasCreateOptionValue:typeof hasCreateOptionValue;
130
- loadCreateTemplateOptionsFromRuntime:typeof loadCreateTemplateOptionsFromRuntime;
131
- looksLikeStructuredEntry:typeof looksLikeStructuredEntry;
132
- mergeCreateOptionsWithTemplate:typeof mergeCreateOptionsWithTemplate;
133
- normalizeCreatePolicyOptionKey:typeof normalizeCreatePolicyOptionKey;
134
- normalizeDependencyKindInput:typeof normalizeDependencyKindInput;
135
- parseDependencies:typeof parseDependencies;
136
- normalizeExtensionCommandPath:typeof normalizeExtensionCommandPath;
137
- parseCreateUnsetTargets:typeof parseCreateUnsetTargets;
138
- requireStringOption:typeof requireStringOption;
139
- readTemplateOptionsFromRuntimeResult:typeof readTemplateOptionsFromRuntimeResult;
140
- resolveRuntimeCreateUnsetDefinition:(token:string,registry:RuntimeFieldRegistry | undefined) => import("./shared-unset-fields.js").RuntimeUnsetFieldDefinition | undefined;
141
- typeOptionExampleValue:typeof typeOptionExampleValue;
142
- };
143
- export {};
75
+ export declare const _testOnlyCreateCommand:{buildHistoryMessage:typeof buildHistoryMessage;buildInvalidLogSeedKeysMessage:typeof buildInvalidLogSeedKeysMessage;buildTypeSpecificCreateExample:typeof buildTypeSpecificCreateExample;collectMissingRequiredTypeOptionKeys:typeof collectMissingRequiredTypeOptionKeys;createExampleTokensForFlag:typeof createExampleTokensForFlag;filterNonMissingTypeOptionErrors:typeof filterNonMissingTypeOptionErrors;hasTemplatesShowHandler:typeof hasTemplatesShowHandler;hasCreateOptionValue:typeof hasCreateOptionValue;loadCreateTemplateOptionsFromRuntime:typeof loadCreateTemplateOptionsFromRuntime;looksLikeStructuredEntry:typeof looksLikeStructuredEntry;mergeCreateOptionsWithTemplate:typeof mergeCreateOptionsWithTemplate;normalizeCreatePolicyOptionKey:typeof normalizeCreatePolicyOptionKey;normalizeDependencyKindInput:typeof normalizeDependencyKindInput;parseDependencies:typeof parseDependencies;normalizeExtensionCommandPath:typeof normalizeExtensionCommandPath;parseCreateUnsetTargets:typeof parseCreateUnsetTargets;requireStringOption:typeof requireStringOption;readTemplateOptionsFromRuntimeResult:typeof readTemplateOptionsFromRuntimeResult;resolveRuntimeCreateUnsetDefinition:(token:string,registry:RuntimeFieldRegistry|undefined)=> import("./shared-unset-fields.js").RuntimeUnsetFieldDefinition|undefined;typeOptionExampleValue:typeof typeOptionExampleValue;};export{};
@@ -1,6 +1,6 @@
1
- import { type GlobalOptions } from "../runtime-primitives.js";
1
+ import{type GlobalOptions}from "../runtime-primitives.js";
2
2
  /** Documents the delete command options payload exchanged by command, SDK, and package integrations. */
3
- export interface DeleteCommandOptions {
3
+ export interface DeleteCommandOptions{
4
4
  /** Value that configures or reports author for this contract. */
5
5
  author?:string;
6
6
  /** Human-readable explanation suitable for logs and agent-facing output. */
@@ -8,10 +8,9 @@ message?:string;
8
8
  /** Value that configures or reports force for this contract. */
9
9
  force?:boolean;
10
10
  /** Value that configures or reports dry run for this contract. */
11
- dryRun?:boolean;
12
- }
11
+ dryRun?:boolean;}
13
12
  /** Documents the delete result payload exchanged by command, SDK, and package integrations. */
14
- export interface DeleteResult {
13
+ export interface DeleteResult{
15
14
  /** Value that configures or reports item for this contract. */
16
15
  item:Record<string,unknown>;
17
16
  /** Value that configures or reports changed fields for this contract. */
@@ -21,7 +20,7 @@ dry_run:boolean;
21
20
  /** Whether the item was deleted by this invocation. */
22
21
  deleted:boolean;
23
22
  /** Stable mutation outcome used instead of echoing the item's stale lifecycle status. */
24
- outcome:"deleted" | "would_delete";
23
+ outcome:"deleted"|"would_delete";
25
24
  /** Lifecycle status the item had immediately before deletion. */
26
25
  previous_status:string;
27
26
  /** Filesystem path used for target resolution. */
@@ -31,7 +30,6 @@ history_retained:string;
31
30
  /** Explicit retention contract; tombstone GC is never implicit. */
32
31
  tombstone_retention:"retain_append_only";
33
32
  /** Value that configures or reports warnings for this contract. */
34
- warnings:string[];
35
- }
33
+ warnings:string[];}
36
34
  /** Implements run delete for the public runtime surface of this module. */
37
- export declare function runDelete(id:string,options:DeleteCommandOptions,global:GlobalOptions):Promise<DeleteResult>;
35
+ export declare function runDelete(id:string,options:DeleteCommandOptions,global:GlobalOptions):Promise<DeleteResult>;
@@ -1,19 +1,17 @@
1
- import { type GlobalOptions } from "../runtime-primitives.js";
1
+ import{type GlobalOptions}from "../runtime-primitives.js";
2
2
  /** Documents the focus options payload exchanged by command, SDK, and package integrations. */
3
- export interface FocusOptions {
3
+ export interface FocusOptions{
4
4
  /** Value that configures or reports clear for this contract. */
5
- clear?:boolean;
6
- }
5
+ clear?:boolean;}
7
6
  /** Documents the focus result payload exchanged by command, SDK, and package integrations. */
8
- export interface FocusResult {
7
+ export interface FocusResult{
9
8
  /** Value that configures or reports action for this contract. */
10
- action:"set" | "clear" | "show";
9
+ action:"set"|"clear"|"show";
11
10
  /** Value that configures or reports focused item for this contract. */
12
- focused_item:string | null;
11
+ focused_item:string|null;
13
12
  /** Value that configures or reports title for this contract. */
14
- title:string | null;
13
+ title:string|null;
15
14
  /** Human-readable explanation suitable for logs and agent-facing output. */
16
- message:string;
17
- }
15
+ message:string;}
18
16
  /** Implements run focus for the public runtime surface of this module. */
19
- export declare function runFocus(id:string | undefined,options:FocusOptions,global:GlobalOptions):Promise<FocusResult>;
17
+ export declare function runFocus(id:string|undefined,options:FocusOptions,global:GlobalOptions):Promise<FocusResult>;
@@ -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,14 @@ 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};
146
132
  /**
147
133
  * Whether an active revision scope guards writes to this tracker. An enclosing
148
134
  * SDK scope (an embedded CLI run) carries revisions the invocation's argv never
@@ -164,16 +150,10 @@ export declare function expectHashRequiresMutationError(action:string):PmCliErro
164
150
  * `PmClient.run`. Tokens follow the CLI grammar: a bare hash binds to the
165
151
  * action's `id`, and `<id>=<hash>` names the target explicitly.
166
152
  */
167
- export declare function dispatchWithExpectedItemRevisions<T>(params:{
168
- action:string;
169
- expectHash:unknown;
170
- defaultId?:string;
171
- pmRoot:string;
172
- run:() => Promise<T>;
153
+ export declare function dispatchWithExpectedItemRevisions<T>(params:{action:string;expectHash:unknown;defaultId?:string;pmRoot:string;run:()=> Promise<T>;
173
154
  /** Nested action options, consulted for modes the guard cannot cover (background test workers). */
174
155
  options?:Record<string,unknown>;
175
156
  /** Top-level background flag, consulted like `options.background`. */
176
157
  background?:unknown;
177
158
  /** Invocation whose tracker scope a revision refusal's recovery commands replay. */
178
- invocation?:ItemRevisionRecoveryInvocation;
179
- }):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]="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};
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]="222cbba7-e2df-5afb-8d75-14f9f99b3bd2")}catch{}})();import{getActiveExtensionRegistrations}from"../../core/extensions/index.js";import{URL_CREDENTIAL_PLACEHOLDER,redactUrlCredentialsInToken}from"../../core/shared/url-credentials.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");const echo=piece=>redactUrlCredentialsInToken(raw)===raw?piece:URL_CREDENTIAL_PLACEHOLDER;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(echo(token),"the item id before = is empty");const candidate=separator===-1?token:token.slice(separator+1);if(!ITEM_HASH_PATTERN.test(candidate.trim().toLowerCase()))throw invalidExpectHash(echo(candidate),"the revision is not a 64-character hexadecimal item_hash");const itemHash=normalizeExpectedItemHash(candidate);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;}