@unbrained/pm-cli 2026.11.6 → 2026.11.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (474) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +82 -48
  3. package/dist/cli/expected-revisions.js +1 -1
  4. package/dist/cli/extension-command-help.js +4 -3
  5. package/dist/cli/help-json-payload.js +1 -1
  6. package/dist/cli/main.js +1 -1
  7. package/dist/cli/register-annotations.js +1 -1
  8. package/dist/cli/register-list-query.js +5 -5
  9. package/dist/cli/runtime/annotation-option-retry.js +2 -0
  10. package/dist/cli/runtime/close-fields-retry.js +2 -0
  11. package/dist/cli/runtime/invocation-options.js +1 -1
  12. package/dist/cli-bundle/bundle-manifest.json +1 -1
  13. package/dist/cli-bundle/chunks/chunk-3A5DJZCC.js +116 -0
  14. package/dist/cli-bundle/chunks/chunk-4BMPGUTG.js +9 -0
  15. package/dist/cli-bundle/chunks/{chunk-D7KYPRK4.js → chunk-7GC6WIDR.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-DAX3AOFI.js → chunk-7V6I6X4G.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-OH6WQ7VT.js → chunk-AFZS6WFV.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-PE3ASURT.js → chunk-C4MQFWCM.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-CP43BHX3.js +31 -0
  20. package/dist/cli-bundle/chunks/{chunk-S4LPZ4TN.js → chunk-DOHZKPPC.js} +7 -7
  21. package/dist/cli-bundle/chunks/{chunk-LS3GI3H4.js → chunk-HESIRIVX.js} +2 -2
  22. package/dist/cli-bundle/chunks/chunk-JAE5MWLX.js +2 -0
  23. package/dist/cli-bundle/chunks/{chunk-335BZ75D.js → chunk-L5BU5FYN.js} +2 -2
  24. package/dist/cli-bundle/chunks/chunk-LI2HP5OX.js +3 -0
  25. package/dist/cli-bundle/chunks/chunk-LLTRUVKK.js +6 -0
  26. package/dist/cli-bundle/chunks/{chunk-X3URBPMV.js → chunk-MKW5LGVQ.js} +66 -62
  27. package/dist/cli-bundle/chunks/chunk-NH7QX2M2.js +8 -0
  28. package/dist/cli-bundle/chunks/{chunk-HRFGFIYU.js → chunk-NKO42JMT.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-7DEKAXVA.js → chunk-PE6CZ3PE.js} +2 -2
  30. package/dist/cli-bundle/chunks/chunk-RC6SSFOF.js +2 -0
  31. package/dist/cli-bundle/chunks/{chunk-TSQCUBUX.js → chunk-S4IZIMAO.js} +2 -2
  32. package/dist/cli-bundle/chunks/{chunk-UEGXWXUZ.js → chunk-XBUZENP4.js} +2 -2
  33. package/dist/cli-bundle/chunks/chunk-YGUUJHSR.js +2 -0
  34. package/dist/cli-bundle/chunks/chunk-YUTFMHSG.js +122 -0
  35. package/dist/cli-bundle/chunks/{chunk-SLC5UWCM.js → chunk-Z3LWNF7C.js} +2 -2
  36. package/dist/cli-bundle/chunks/item-revision-TUGZYYXX.js +2 -0
  37. package/dist/cli-bundle/chunks/item-transaction-2RRBAQN3.js +2 -0
  38. package/dist/cli-bundle/chunks/{mutation-admission-INMM3HHG.js → mutation-admission-FJ3D66PV.js} +2 -2
  39. package/dist/cli-bundle/chunks/{register-list-query-5Y5JKWU5.js → register-list-query-GXP77CX7.js} +11 -11
  40. package/dist/cli-bundle/chunks/register-mutation-XJ2DROUM.js +20 -0
  41. package/dist/cli-bundle/chunks/{register-operations-WJHZJFK2.js → register-operations-O5LERXM7.js} +2 -2
  42. package/dist/cli-bundle/chunks/{register-setup-RRFOS7IT.js → register-setup-4VOTYLL2.js} +2 -2
  43. package/dist/cli-bundle/chunks/{stage-E3MMV4TV.js → stage-ZDJL3FGL.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/chunk-2A3QZELL.js +26 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-MC7IE7D7.js → chunk-3HFENALW.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/chunk-4UOXVFJZ.js +2 -0
  47. package/dist/cli-bundle/focused-chunks/{chunk-7KK66ISG.js → chunk-5YPX3QKU.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-CPMSL4HS.js → chunk-6U5HP6L3.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/chunk-DIEBSC76.js +3 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-WSOAASCY.js → chunk-I4YUZW3J.js} +8 -8
  51. package/dist/cli-bundle/focused-chunks/chunk-KBRSA4OK.js +44 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-AHWJPZSJ.js → chunk-KNF2QTEZ.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/chunk-LTPT5TE7.js +24 -0
  54. package/dist/cli-bundle/focused-chunks/chunk-O7K3X4LH.js +2 -0
  55. package/dist/cli-bundle/focused-chunks/chunk-P4EHEH4C.js +2 -0
  56. package/dist/cli-bundle/focused-chunks/chunk-P6TG33FV.js +82 -0
  57. package/dist/cli-bundle/focused-chunks/chunk-PL6EO4GJ.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-PSLDGAEY.js +12 -0
  59. package/dist/cli-bundle/focused-chunks/chunk-SZ2BKK3M.js +2 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-TSHRBPTI.js +2 -0
  61. package/dist/cli-bundle/focused-chunks/chunk-ULTSMJYF.js +91 -0
  62. package/dist/cli-bundle/focused-chunks/chunk-UNNLBJRI.js +2 -0
  63. package/dist/cli-bundle/focused-chunks/chunk-UUVRYIKA.js +2 -0
  64. package/dist/cli-bundle/focused-chunks/{chunk-F62XGAAY.js → chunk-WPXMPGTY.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/chunk-Z2QWZRSL.js +26 -0
  66. package/dist/cli-bundle/focused-chunks/item-revision-XNSRDTFB.js +2 -0
  67. package/dist/cli-bundle/focused-chunks/item-transaction-Q2Z7DDCR.js +2 -0
  68. package/dist/cli-bundle/focused-chunks/mutation-admission-QWC6MLTZ.js +2 -0
  69. package/dist/cli-bundle/focused-chunks/stage-NKH5SKSZ.js +2 -0
  70. package/dist/cli-bundle/main.js +27 -26
  71. package/dist/cli-bundle/sdk-authoring.js +1 -1
  72. package/dist/cli-bundle/sdk-contracts.js +4 -4
  73. package/dist/cli-bundle/sdk-core.js +1 -1
  74. package/dist/cli-bundle/sdk-governance.js +1 -1
  75. package/dist/cli-bundle/sdk-graph.js +1 -1
  76. package/dist/cli-bundle/sdk-merge.js +57 -57
  77. package/dist/cli-bundle/sdk-query.js +1 -1
  78. package/dist/cli-bundle/sdk-runtime.js +1 -1
  79. package/dist/cli-bundle/sdk-testing.js +1 -1
  80. package/dist/cli-bundle/sdk.js +12 -12
  81. package/dist/core/extensions/flag-definition-validation.js +1 -1
  82. package/dist/core/extensions/reserved-host-flags.js +1 -1
  83. package/dist/core/history/history-stream-policy.d.ts +12 -3
  84. package/dist/core/history/history-stream-policy.js +1 -1
  85. package/dist/core/history/projection.d.ts +7 -2
  86. package/dist/core/history/projection.js +1 -1
  87. package/dist/core/item/item-format.d.ts +5 -1
  88. package/dist/core/item/item-format.js +2 -2
  89. package/dist/core/lock/lock.d.ts +1 -1
  90. package/dist/core/lock/lock.js +1 -1
  91. package/dist/core/output/output.d.ts +10 -1
  92. package/dist/core/output/output.js +7 -7
  93. package/dist/core/search/providers.d.ts +3 -2
  94. package/dist/core/search/providers.js +1 -1
  95. package/dist/core/search/vector-stores.d.ts +3 -2
  96. package/dist/core/search/vector-stores.js +1 -1
  97. package/dist/core/sentry/instrument.d.ts +2 -1
  98. package/dist/core/sentry/instrument.js +1 -1
  99. package/dist/core/store/item-mutation-precondition.d.ts +58 -0
  100. package/dist/core/store/item-mutation-precondition.js +1 -1
  101. package/dist/mcp/tool-definitions.js +1 -1
  102. package/dist/sdk/annotations.d.ts +44 -1
  103. package/dist/sdk/annotations.js +1 -1
  104. package/dist/sdk/authoring.d.ts +6 -0
  105. package/dist/sdk/authoring.js +1 -1
  106. package/dist/sdk/cli-contracts/flag-contracts.d.ts +15 -0
  107. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  108. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  109. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +6 -0
  110. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  111. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  112. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  113. package/dist/sdk/command-line.d.ts +7 -2
  114. package/dist/sdk/command-line.js +1 -1
  115. package/dist/sdk/comments.d.ts +4 -2
  116. package/dist/sdk/comments.js +1 -1
  117. package/dist/sdk/completion/bash.js +1 -1
  118. package/dist/sdk/completion/fish.js +2 -1
  119. package/dist/sdk/completion/zsh.js +4 -1
  120. package/dist/sdk/context-intent-contracts.d.ts +5 -1
  121. package/dist/sdk/context-intent-contracts.js +1 -1
  122. package/dist/sdk/contracts.d.ts +3 -0
  123. package/dist/sdk/contracts.js +1 -1
  124. package/dist/sdk/core.d.ts +14 -0
  125. package/dist/sdk/core.js +1 -1
  126. package/dist/sdk/corpus-shape.d.ts +2 -2
  127. package/dist/sdk/corpus-shape.js +1 -1
  128. package/dist/sdk/define.d.ts +14 -8
  129. package/dist/sdk/define.js +1 -1
  130. package/dist/sdk/extension/command-options.d.ts +123 -0
  131. package/dist/sdk/extension/command-options.js +2 -0
  132. package/dist/sdk/extension-contracts.d.ts +1 -2
  133. package/dist/sdk/extension-contracts.js +1 -1
  134. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  135. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  136. package/dist/sdk/governance.d.ts +8 -0
  137. package/dist/sdk/governance.js +1 -1
  138. package/dist/sdk/graph.d.ts +5 -0
  139. package/dist/sdk/graph.js +1 -1
  140. package/dist/sdk/index.d.ts +61 -1
  141. package/dist/sdk/index.js +1 -1
  142. package/dist/sdk/learnings.d.ts +4 -2
  143. package/dist/sdk/learnings.js +1 -1
  144. package/dist/sdk/lifecycle/close.js +1 -1
  145. package/dist/sdk/lifecycle/item-revision.d.ts +15 -4
  146. package/dist/sdk/lifecycle/item-revision.js +1 -1
  147. package/dist/sdk/lifecycle/restore.d.ts +1 -1
  148. package/dist/sdk/merge.d.ts +3 -0
  149. package/dist/sdk/merge.js +1 -1
  150. package/dist/sdk/notes.d.ts +4 -2
  151. package/dist/sdk/notes.js +1 -1
  152. package/dist/sdk/output/list-envelope.d.ts +18 -7
  153. package/dist/sdk/output/list-envelope.js +1 -1
  154. package/dist/sdk/output-projection.js +1 -1
  155. package/dist/sdk/public-surface.json +1 -1
  156. package/dist/sdk/query/get.d.ts +16 -6
  157. package/dist/sdk/query/get.js +1 -1
  158. package/dist/sdk/query/list.d.ts +5 -1
  159. package/dist/sdk/query/list.js +1 -1
  160. package/dist/sdk/query/search/response.js +1 -1
  161. package/dist/sdk/query/search/semantic.d.ts +11 -3
  162. package/dist/sdk/query/search/semantic.js +1 -1
  163. package/dist/sdk/query/search-rendering.d.ts +9 -3
  164. package/dist/sdk/query/search-rendering.js +1 -1
  165. package/dist/sdk/query.d.ts +11 -0
  166. package/dist/sdk/query.js +1 -1
  167. package/dist/sdk/read-output/continuation.d.ts +8 -0
  168. package/dist/sdk/read-output/continuation.js +1 -1
  169. package/dist/sdk/read-output/options.d.ts +1 -1
  170. package/dist/sdk/read-output/options.js +1 -1
  171. package/dist/sdk/read-output/surfaces.js +1 -1
  172. package/dist/sdk/read-output/tail-retention.d.ts +34 -0
  173. package/dist/sdk/read-output/tail-retention.js +2 -0
  174. package/dist/sdk/read-output-budget.d.ts +14 -2
  175. package/dist/sdk/read-output-budget.js +1 -1
  176. package/dist/sdk/read-output-contracts.d.ts +20 -4
  177. package/dist/sdk/read-output-contracts.js +1 -1
  178. package/dist/sdk/read-output-rows.d.ts +7 -3
  179. package/dist/sdk/read-output-rows.js +1 -1
  180. package/dist/sdk/runtime-input.js +1 -1
  181. package/dist/sdk/runtime.d.ts +26 -3
  182. package/dist/sdk/runtime.js +1 -1
  183. package/dist/sdk/test/execution.d.ts +29 -2
  184. package/dist/sdk/test/execution.js +1 -1
  185. package/dist/sdk/testing.d.ts +14 -1
  186. package/dist/sdk/testing.js +1 -1
  187. package/dist/sdk/traceability/source-traceability.d.ts +4 -1
  188. package/dist/sdk/traceability/source-traceability.js +1 -1
  189. package/dist/sdk/workspace-recipe.d.ts +2 -2
  190. package/dist/sdk/workspace-recipe.js +1 -1
  191. package/docs/ARCHITECTURE.md +2 -1
  192. package/docs/CLOSE_EVIDENCE_RECOVERY.md +36 -2
  193. package/docs/COMMANDS.md +14 -2
  194. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +1 -1
  195. package/docs/EXTENSIONS.md +1 -1
  196. package/docs/GET_READ_EVIDENCE.md +24 -3
  197. package/docs/MCP_OPTION_CONFORMANCE.md +13 -0
  198. package/docs/README.md +1 -1
  199. package/docs/READ_OUTPUT_CONTRACTS.md +78 -0
  200. package/docs/RELEASING.md +17 -0
  201. package/docs/SDK.md +124 -9
  202. package/docs/SDK_CONTEXT_INTEGRITY.md +2 -0
  203. package/docs/agent-task-token-baseline.json +1 -1
  204. package/docs/generated/FLAG_LEXICON_BUDGETS.md +6 -6
  205. package/marketplace.json +1 -1
  206. package/package.json +2 -1
  207. package/packages/pm-beads/package.json +1 -1
  208. package/packages/pm-calendar/package.json +1 -1
  209. package/packages/pm-command-kit/package.json +1 -1
  210. package/packages/pm-digital-twin/package.json +1 -1
  211. package/packages/pm-governance-audit/package.json +1 -1
  212. package/packages/pm-guide-shell/package.json +1 -1
  213. package/packages/pm-kanban/package.json +1 -1
  214. package/packages/pm-lifecycle-hooks/package.json +1 -1
  215. package/packages/pm-linked-test-adapters/package.json +1 -1
  216. package/packages/pm-search-advanced/package.json +1 -1
  217. package/packages/pm-templates/package.json +1 -1
  218. package/packages/pm-todos/package.json +1 -1
  219. package/packages/pm-vcs/package.json +1 -1
  220. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  221. package/plugins/pm-claude/package.json +1 -1
  222. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  223. package/plugins/pm-codex/package.json +1 -1
  224. package/plugins/pm-codex/plugin.json +1 -1
  225. package/runtime-dependencies.json +1 -1
  226. package/dist/cli/after-command-context-usage.d.ts +0 -21
  227. package/dist/cli/argv-utils.d.ts +0 -12
  228. package/dist/cli/bootstrap-args.d.ts +0 -6
  229. package/dist/cli/bundle-integrity.d.ts +0 -49
  230. package/dist/cli/command-namespaces.d.ts +0 -9
  231. package/dist/cli/commander-usage.d.ts +0 -73
  232. package/dist/cli/commands/annotations/comments.d.ts +0 -2
  233. package/dist/cli/commands/annotations/docs.d.ts +0 -6
  234. package/dist/cli/commands/annotations/files.d.ts +0 -6
  235. package/dist/cli/commands/annotations/learnings.d.ts +0 -2
  236. package/dist/cli/commands/annotations/notes.d.ts +0 -2
  237. package/dist/cli/commands/extension/describe.d.ts +0 -2
  238. package/dist/cli/commands/extension/extension.d.ts +0 -6
  239. package/dist/cli/commands/extension/scaffold.d.ts +0 -2
  240. package/dist/cli/commands/extension/shared.d.ts +0 -2
  241. package/dist/cli/commands/governance/gc.d.ts +0 -6
  242. package/dist/cli/commands/governance/health.d.ts +0 -6
  243. package/dist/cli/commands/governance/telemetry.d.ts +0 -6
  244. package/dist/cli/commands/governance/validate.d.ts +0 -9
  245. package/dist/cli/commands/history/activity.d.ts +0 -6
  246. package/dist/cli/commands/history/history-compact.d.ts +0 -7
  247. package/dist/cli/commands/history/history-redact.d.ts +0 -8
  248. package/dist/cli/commands/history/history-repair.d.ts +0 -7
  249. package/dist/cli/commands/history/history.d.ts +0 -2
  250. package/dist/cli/commands/history/restore.d.ts +0 -6
  251. package/dist/cli/commands/lifecycle/append.d.ts +0 -6
  252. package/dist/cli/commands/lifecycle/claim.d.ts +0 -2
  253. package/dist/cli/commands/lifecycle/close-many.d.ts +0 -2
  254. package/dist/cli/commands/lifecycle/close.d.ts +0 -6
  255. package/dist/cli/commands/lifecycle/copy.d.ts +0 -6
  256. package/dist/cli/commands/lifecycle/create.d.ts +0 -10
  257. package/dist/cli/commands/lifecycle/delete.d.ts +0 -6
  258. package/dist/cli/commands/lifecycle/focus.d.ts +0 -6
  259. package/dist/cli/commands/lifecycle/plan.d.ts +0 -9
  260. package/dist/cli/commands/lifecycle/update-many.d.ts +0 -6
  261. package/dist/cli/commands/lifecycle/update.d.ts +0 -10
  262. package/dist/cli/commands/query/aggregate.d.ts +0 -2
  263. package/dist/cli/commands/query/context.d.ts +0 -6
  264. package/dist/cli/commands/query/deps.d.ts +0 -6
  265. package/dist/cli/commands/query/duplicates.d.ts +0 -6
  266. package/dist/cli/commands/query/eval.d.ts +0 -6
  267. package/dist/cli/commands/query/get.d.ts +0 -6
  268. package/dist/cli/commands/query/graph.d.ts +0 -7
  269. package/dist/cli/commands/query/list.d.ts +0 -6
  270. package/dist/cli/commands/query/next.d.ts +0 -6
  271. package/dist/cli/commands/query/search.d.ts +0 -6
  272. package/dist/cli/commands/query/stats.d.ts +0 -6
  273. package/dist/cli/commands/test/test-all.d.ts +0 -6
  274. package/dist/cli/commands/test/test-runs.d.ts +0 -6
  275. package/dist/cli/commands/test/test.d.ts +0 -6
  276. package/dist/cli/commands/workspace/config.d.ts +0 -6
  277. package/dist/cli/commands/workspace/contracts.d.ts +0 -2
  278. package/dist/cli/commands/workspace/init.d.ts +0 -6
  279. package/dist/cli/commands/workspace/merge.d.ts +0 -8
  280. package/dist/cli/commands/workspace/profile.d.ts +0 -6
  281. package/dist/cli/commands/workspace/schema.d.ts +0 -7
  282. package/dist/cli/commands/workspace/upgrade.d.ts +0 -2
  283. package/dist/cli/context-intent-invocation.d.ts +0 -2
  284. package/dist/cli/description-stdin.d.ts +0 -2
  285. package/dist/cli/error-guidance.d.ts +0 -276
  286. package/dist/cli/expected-revisions.d.ts +0 -55
  287. package/dist/cli/extension-command-help.d.ts +0 -137
  288. package/dist/cli/extension-command-options.d.ts +0 -37
  289. package/dist/cli/extension-command-options.js +0 -2
  290. package/dist/cli/extension-recovery.d.ts +0 -31
  291. package/dist/cli/help-content.d.ts +0 -57
  292. package/dist/cli/help-json-payload.d.ts +0 -83
  293. package/dist/cli/invocation-profile.d.ts +0 -26
  294. package/dist/cli/main.d.ts +0 -263
  295. package/dist/cli/migration-gates.d.ts +0 -55
  296. package/dist/cli/option-values.d.ts +0 -3
  297. package/dist/cli/preflight-warnings.d.ts +0 -11
  298. package/dist/cli/register-annotations.d.ts +0 -11
  299. package/dist/cli/register-assurance.d.ts +0 -8
  300. package/dist/cli/register-files-lookup.d.ts +0 -9
  301. package/dist/cli/register-history-activity.d.ts +0 -8
  302. package/dist/cli/register-history-author.d.ts +0 -8
  303. package/dist/cli/register-history-maintenance.d.ts +0 -9
  304. package/dist/cli/register-list-query.d.ts +0 -27
  305. package/dist/cli/register-mutation-options.d.ts +0 -10
  306. package/dist/cli/register-mutation.d.ts +0 -16
  307. package/dist/cli/register-operations.d.ts +0 -85
  308. package/dist/cli/register-setup.d.ts +0 -16
  309. package/dist/cli/register-structured-mutation.d.ts +0 -15
  310. package/dist/cli/registration-helpers.d.ts +0 -2
  311. package/dist/cli/runtime/activation.d.ts +0 -51
  312. package/dist/cli/runtime/field-route-retry.d.ts +0 -15
  313. package/dist/cli/runtime/invocation-options.d.ts +0 -43
  314. package/dist/cli/runtime/projection-retry.d.ts +0 -9
  315. package/dist/cli/runtime/selection.d.ts +0 -35
  316. package/dist/cli/runtime/telemetry-outcome.d.ts +0 -20
  317. package/dist/cli/runtime-compatibility-boundary.d.ts +0 -17
  318. package/dist/cli/schema/registration.d.ts +0 -4
  319. package/dist/cli/schema-registration-helpers.d.ts +0 -24
  320. package/dist/cli/search-refresh.d.ts +0 -2
  321. package/dist/cli/stats-analytics-json.d.ts +0 -9
  322. package/dist/cli/telemetry-flush.d.ts +0 -2
  323. package/dist/cli-bundle/chunks/chunk-5GWEY4P6.js +0 -122
  324. package/dist/cli-bundle/chunks/chunk-6VRX2CM7.js +0 -2
  325. package/dist/cli-bundle/chunks/chunk-7ZRCYESH.js +0 -116
  326. package/dist/cli-bundle/chunks/chunk-AUEKTX7V.js +0 -6
  327. package/dist/cli-bundle/chunks/chunk-FRNMQM45.js +0 -2
  328. package/dist/cli-bundle/chunks/chunk-HNGLDMSZ.js +0 -9
  329. package/dist/cli-bundle/chunks/chunk-QNWUIPBO.js +0 -31
  330. package/dist/cli-bundle/chunks/chunk-WC4M2H6R.js +0 -8
  331. package/dist/cli-bundle/chunks/chunk-YKXATU2G.js +0 -3
  332. package/dist/cli-bundle/chunks/item-revision-OJJVPQY7.js +0 -2
  333. package/dist/cli-bundle/chunks/item-transaction-TBKEATN6.js +0 -2
  334. package/dist/cli-bundle/chunks/register-mutation-MDSUU3G7.js +0 -20
  335. package/dist/cli-bundle/focused-chunks/chunk-2KTJY7BV.js +0 -44
  336. package/dist/cli-bundle/focused-chunks/chunk-4PW5XWVI.js +0 -2
  337. package/dist/cli-bundle/focused-chunks/chunk-C6P6HPCX.js +0 -2
  338. package/dist/cli-bundle/focused-chunks/chunk-CZM75DE3.js +0 -2
  339. package/dist/cli-bundle/focused-chunks/chunk-D2TBEBNW.js +0 -3
  340. package/dist/cli-bundle/focused-chunks/chunk-E56OXRYH.js +0 -2
  341. package/dist/cli-bundle/focused-chunks/chunk-G4QP365K.js +0 -2
  342. package/dist/cli-bundle/focused-chunks/chunk-G5PJCR7R.js +0 -2
  343. package/dist/cli-bundle/focused-chunks/chunk-GS3JC5UU.js +0 -23
  344. package/dist/cli-bundle/focused-chunks/chunk-LW64TINU.js +0 -3
  345. package/dist/cli-bundle/focused-chunks/chunk-M6V7UMWL.js +0 -26
  346. package/dist/cli-bundle/focused-chunks/chunk-MG7C3JUY.js +0 -2
  347. package/dist/cli-bundle/focused-chunks/chunk-MK4HV4JO.js +0 -2
  348. package/dist/cli-bundle/focused-chunks/chunk-O7EI33NP.js +0 -91
  349. package/dist/cli-bundle/focused-chunks/chunk-RFTJZ5VB.js +0 -2
  350. package/dist/cli-bundle/focused-chunks/chunk-SNOXXRSJ.js +0 -2
  351. package/dist/cli-bundle/focused-chunks/chunk-UPJUTP2V.js +0 -12
  352. package/dist/cli-bundle/focused-chunks/chunk-VWWTIX5L.js +0 -3
  353. package/dist/cli-bundle/focused-chunks/chunk-XHOBYCVE.js +0 -26
  354. package/dist/cli-bundle/focused-chunks/chunk-YMGB2O4E.js +0 -81
  355. package/dist/cli-bundle/focused-chunks/item-revision-CTDO4H3I.js +0 -2
  356. package/dist/cli-bundle/focused-chunks/item-transaction-H2XACBOP.js +0 -2
  357. package/dist/cli-bundle/focused-chunks/mutation-admission-4WM7TNHZ.js +0 -2
  358. package/dist/cli-bundle/focused-chunks/stage-WV7QXR4C.js +0 -2
  359. package/dist/cli.d.ts +0 -13
  360. package/dist/core/checkpoint/checkpoint-gc.d.ts +0 -61
  361. package/dist/core/checkpoint/mutation-context.d.ts +0 -10
  362. package/dist/core/diagnostics/remediation.d.ts +0 -52
  363. package/dist/core/extensions/activation-transaction.d.ts +0 -22
  364. package/dist/core/extensions/command-visibility-tier.d.ts +0 -8
  365. package/dist/core/extensions/exporter-output-contract.d.ts +0 -12
  366. package/dist/core/extensions/extension-candidate.d.ts +0 -26
  367. package/dist/core/extensions/extension-runtime-helpers.d.ts +0 -16
  368. package/dist/core/extensions/module-graph-snapshot.d.ts +0 -19
  369. package/dist/core/extensions/preflight-ownership.d.ts +0 -5
  370. package/dist/core/extensions/read-output-contract.d.ts +0 -5
  371. package/dist/core/extensions/reserved-host-flags.d.ts +0 -18
  372. package/dist/core/extensions/service-ownership.d.ts +0 -8
  373. package/dist/core/extensions/version-diagnostics.d.ts +0 -2
  374. package/dist/core/fs/atomic-create.d.ts +0 -7
  375. package/dist/core/fs/index.d.ts +0 -6
  376. package/dist/core/fs/path-utils.d.ts +0 -2
  377. package/dist/core/history/drift-cache.d.ts +0 -4
  378. package/dist/core/history/drift-scan.d.ts +0 -51
  379. package/dist/core/history/index.d.ts +0 -6
  380. package/dist/core/history/tombstone.d.ts +0 -3
  381. package/dist/core/history/version-address.d.ts +0 -13
  382. package/dist/core/item/index.d.ts +0 -9
  383. package/dist/core/item/item-type-definition.d.ts +0 -51
  384. package/dist/core/item/toon-decode.d.ts +0 -25
  385. package/dist/core/lock/index.d.ts +0 -6
  386. package/dist/core/lock/lock-confinement.d.ts +0 -55
  387. package/dist/core/lock/lock-gc.d.ts +0 -93
  388. package/dist/core/output/mutation-projection.d.ts +0 -13
  389. package/dist/core/output/query-summary.d.ts +0 -30
  390. package/dist/core/search/staleness.d.ts +0 -23
  391. package/dist/core/sentry/sensitive-assignments.d.ts +0 -9
  392. package/dist/core/shared/conflict-markers.d.ts +0 -18
  393. package/dist/core/shared/index.d.ts +0 -9
  394. package/dist/core/shared/memo.d.ts +0 -7
  395. package/dist/core/store/index.d.ts +0 -9
  396. package/dist/core/store/settings-concurrency.d.ts +0 -7
  397. package/dist/core/telemetry/read-sampling.d.ts +0 -8
  398. package/dist/core/test/item-test-run-tracking.d.ts +0 -12
  399. package/dist/core/validate/estimate-defaults.d.ts +0 -21
  400. package/dist/core/validate/linked-artifact-reference.d.ts +0 -20
  401. package/dist/mcp/http-server.d.ts +0 -60
  402. package/dist/mcp/legacy-adapter.d.ts +0 -59
  403. package/dist/mcp/runtime-capabilities.d.ts +0 -57
  404. package/dist/mcp/server.d.ts +0 -101
  405. package/dist/sdk/cli-contracts/bootstrap-command-scanner.d.ts +0 -23
  406. package/dist/sdk/cli-contracts/registration-helpers.d.ts +0 -123
  407. package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +0 -796
  408. package/dist/sdk/cli-contracts/string-lists.d.ts +0 -9
  409. package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +0 -35
  410. package/dist/sdk/context/usage-egress.d.ts +0 -9
  411. package/dist/sdk/dependencies/context-budget-recovery.d.ts +0 -21
  412. package/dist/sdk/dependency-flag-validation.d.ts +0 -32
  413. package/dist/sdk/extension/author-manifest.d.ts +0 -22
  414. package/dist/sdk/extension/bundled-catalog.d.ts +0 -35
  415. package/dist/sdk/extension/concurrency.d.ts +0 -7
  416. package/dist/sdk/extension/copy-scope.d.ts +0 -2
  417. package/dist/sdk/extension/custom-field-collisions.d.ts +0 -6
  418. package/dist/sdk/extension/install-receipts.d.ts +0 -7
  419. package/dist/sdk/extension/install-snapshot.d.ts +0 -34
  420. package/dist/sdk/extension/managed-update-status.d.ts +0 -3
  421. package/dist/sdk/extension/runtime-summary.d.ts +0 -9
  422. package/dist/sdk/extension/scaffold.d.ts +0 -38
  423. package/dist/sdk/generated/error-code-catalog-rows.d.ts +0 -39
  424. package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +0 -8
  425. package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +0 -8
  426. package/dist/sdk/governance/assurance-limits.d.ts +0 -7
  427. package/dist/sdk/governance/defect-recurrence-signals.d.ts +0 -10
  428. package/dist/sdk/governance/health-merge-evidence.d.ts +0 -23
  429. package/dist/sdk/governance/tracked-runtime-cache.d.ts +0 -24
  430. package/dist/sdk/governance/validate-history-drift.d.ts +0 -7
  431. package/dist/sdk/history/attestation-scan.d.ts +0 -16
  432. package/dist/sdk/history-mcp.d.ts +0 -17
  433. package/dist/sdk/lifecycle/checkpoint-rollback.d.ts +0 -15
  434. package/dist/sdk/lifecycle/core-field-recovery.d.ts +0 -33
  435. package/dist/sdk/lifecycle/core-item-fields.d.ts +0 -6
  436. package/dist/sdk/lifecycle/event-validation-messages.d.ts +0 -6
  437. package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +0 -15
  438. package/dist/sdk/lifecycle/legacy-none-tokens.d.ts +0 -71
  439. package/dist/sdk/lifecycle/mcp-actions.d.ts +0 -24
  440. package/dist/sdk/lifecycle/metadata-normalizers.d.ts +0 -8
  441. package/dist/sdk/lifecycle/mutation-facet-contracts.d.ts +0 -6
  442. package/dist/sdk/lifecycle/mutation-option-validation.d.ts +0 -2
  443. package/dist/sdk/lifecycle/recurrence-parsers.d.ts +0 -34
  444. package/dist/sdk/lifecycle/release-handoff.d.ts +0 -12
  445. package/dist/sdk/lifecycle/repeatable-metadata-parsers.d.ts +0 -18
  446. package/dist/sdk/lifecycle/repeated-terminal-state.d.ts +0 -45
  447. package/dist/sdk/merge/abandoned-receipts.d.ts +0 -15
  448. package/dist/sdk/merge/history-scalar-rebase.d.ts +0 -9
  449. package/dist/sdk/merge/ignored-artifacts.d.ts +0 -13
  450. package/dist/sdk/merge/indexed-receipt-blobs.d.ts +0 -4
  451. package/dist/sdk/merge/receipt-file-boundary.d.ts +0 -23
  452. package/dist/sdk/merge/settlement-hook.d.ts +0 -12
  453. package/dist/sdk/merge/stage.d.ts +0 -13
  454. package/dist/sdk/merge/worktree-config.d.ts +0 -11
  455. package/dist/sdk/query/light-metadata.d.ts +0 -3
  456. package/dist/sdk/query/window-pagination.d.ts +0 -20
  457. package/dist/sdk/read-output/extension.d.ts +0 -7
  458. package/dist/sdk/read-output/provenance.d.ts +0 -20
  459. package/dist/sdk/read-output/surfaces.d.ts +0 -27
  460. package/dist/sdk/runtime/actions.d.ts +0 -4
  461. package/dist/sdk/runtime/mutation-admission.d.ts +0 -2
  462. package/dist/sdk/runtime/mutation-value-validation.d.ts +0 -16
  463. package/dist/sdk/runtime/schema.d.ts +0 -4
  464. package/dist/sdk/runtime-action-aliases.d.ts +0 -7
  465. package/dist/sdk/runtime-extended-actions.d.ts +0 -27
  466. package/dist/sdk/runtime-stats-options.d.ts +0 -9
  467. package/dist/sdk/test/command-args.d.ts +0 -4
  468. package/dist/sdk/test/command-resolution.d.ts +0 -5
  469. package/dist/sdk/test/entry.d.ts +0 -18
  470. package/dist/sdk/test/execution-receipts.d.ts +0 -34
  471. package/dist/sdk/test/receipt-index-snapshot.d.ts +0 -2
  472. package/dist/sdk/test/workspace-snapshot.d.ts +0 -11
  473. package/dist/sdk/traceability/runtime-files-lookup.d.ts +0 -8
  474. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +0 -472
@@ -1,2 +0,0 @@
1
- import{B as ke,C as Me,E as W,H as Re,J as Ie,K as Ce,M as Ne,a as Oe,p as J}from"./chunk-2KTJY7BV.js";import"./chunk-XHOBYCVE.js";import"./chunk-CZM75DE3.js";import{A as Ae,B as L,C as Te,y as k,z as K}from"./chunk-WSOAASCY.js";import"./chunk-SNOXXRSJ.js";import"./chunk-AHWJPZSJ.js";import"./chunk-IDAYTYNN.js";import"./chunk-MG7C3JUY.js";import"./chunk-F62XGAAY.js";import"./chunk-SVOOGGAK.js";import"./chunk-CPMSL4HS.js";import{N as we,Q as ge}from"./chunk-LW64TINU.js";import"./chunk-MC7IE7D7.js";import"./chunk-C6P6HPCX.js";import{Ea as $e}from"./chunk-UPJUTP2V.js";import"./chunk-G5PJCR7R.js";import"./chunk-E56OXRYH.js";import{z as x}from"./chunk-GS3JC5UU.js";import"./chunk-D2TBEBNW.js";import{fa as pe,la as le}from"./chunk-MK4HV4JO.js";import"./chunk-G4QP365K.js";import"./chunk-7KK66ISG.js";import"./chunk-GHQVM6K6.js";import{Q as Ee,h as q,t as $}from"./chunk-O7EI33NP.js";import{$a as Se,I as ve,Xa as _e,fb as be,ha as S,sa as T,wa as G}from"./chunk-YMGB2O4E.js";import"./chunk-RFTJZ5VB.js";import{c as me,e as F,f as fe,i as he}from"./chunk-VWWTIX5L.js";import"./chunk-4PW5XWVI.js";import"./chunk-I5LGPUWH.js";import"./chunk-C3O6JJPO.js";import{Ga as ue,ra as D,wc as ye,xc as P,ya as de}from"./chunk-M6V7UMWL.js";import"./chunk-EGN2HFRU.js";import"./chunk-FOA7XKWP.js";import{A as l,E as j,G as ce,H as O,l as oe,q as E,s as ae,x as se,z as m}from"./chunk-G6ERMFJ5.js";import X from"node:crypto";import{constants as V}from"node:fs";import{cp as nt,lstat as Fe,mkdir as rt,mkdtemp as Pe,open as it,readdir as ot,realpath as xe,rm as Ge,stat as Z,writeFile as qe}from"node:fs/promises";import{tmpdir as Ke}from"node:os";import d from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="01728cbc-2037-50d2-8318-5f106714b8da")}catch{}})();var He=new Set(["id","title","description","type","status","priority","tags","body","deadline","estimated_minutes","acceptance_criteria","definition_of_ready","order","rank","assignee",...oe,"affected_version","fixed_version","component","regression","customer_impact","close_reason","completed_at","dependencies","comments","notes","learnings","files","tests","docs","reminders","events","type_options"]);(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6456f85b-e076-5048-9c21-03d477267259")}catch{}})();function z(e,t,r){let n=e?.estimatedMinutes;if(!(n===void 0||typeof n=="string"))throw new l(`Mutation ${r+1} ${t} option "estimatedMinutes" must be a string.`,m.USAGE,{code:"mutation_option_value_invalid",required:'Pass estimatedMinutes as a string, for example "45", in raw mutation options.',why:"Raw options use the create/update command option types; item documents accept numeric estimated_minutes instead.",nextSteps:["Quote the estimatedMinutes value or use an item document with numeric estimated_minutes, then retry the transaction."]})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a17df3f5-aee8-5734-b1ce-b643482be3a7")}catch{}})();var Xe=["op","id","reason","options","unique","match"],Ze=[...Xe,"ref"],en=[...Ze,"item"];var je="[a-z][a-z0-9._-]{0,63}",tn=new RegExp(`^${je}$`,"u"),nn=new RegExp(`(^|,)id=@(${je})(?=,|$)`,"gu"),Ue=e=>e.slice(2).replaceAll(/-([a-z])/gu,(t,r)=>r.toUpperCase());var Qe=new Set(["created_at","updated_at","closed_at","version","format_version","path","author","collection_counts","notes_count","tests_count"]),rn=new Set([...Qe,"completed_at","id"]),on={create:we.map(e=>e.target),update:ge.map(e=>e.target),close:pe.map(e=>Ue(e.flag)).filter(e=>e!=="reason"),release:le.map(e=>Ue(e.flag))};function et(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function tt(e,t){return e<t?-1:+(e!==t)}function B(e){return Array.isArray(e)?e.map(B):et(e)?Object.fromEntries(Object.entries(e).sort(([t],[r])=>tt(t,r)).map(([t,r])=>[t,B(r)])):e}function v(e){return typeof e=="string"?e.trim():JSON.stringify(B(e))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="49806fc6-ff49-5b67-9b3f-c182ace00c20")}catch{}})();async function at(e,t){if(!Se(e))return{schema:F(t.schema),typeDefinitionsFromFile:[]};let r=await gt(e,t.schema);return{schema:r.schema,typeDefinitionsFromFile:r.type_definitions_from_file??[]}}async function st(e,t,r,n){let i=D({...t,item_types:{...t.item_types,definitions:[...t.item_types?.definitions??[],...r.typeDefinitionsFromFile]}},P());return(await Ee(e,t.item_format,i.type_to_folder,void 0,r.schema)).flatMap(a=>{let o=a[n];return o==null?[]:[{id:a.id,value:o}]})}function Q(e){let t=new Map,r=async n=>{let i=await be(e),a=await at(e,i),o=new Map;for(let s of await st(e,i,a,n)){let c=v(s.value);o.set(c,[...o.get(c)??[],s.id])}return o};return{lookup(n){let i=t.get(n)??r(n);return t.set(n,i),i},async recordCreate(n){for(let[i,a]of t){let o=n[i];if(o==null)continue;let s=await a,c=v(o);s.set(c,[...s.get(c)??[],String(n.id)])}},invalidate(){t.clear()}}}async function ct(e,t){let r=v(t.value),n=(await e.lookup(t.key)).get(r)??[];if(n.length!==0)throw new l(`Upsert key "${t.key}" value ${JSON.stringify(r)} now matches existing item ${n.join(", ")}; the plan was resolved before it existed.`,m.CONFLICT,{code:"upsert_key_conflict",required:"Re-plan the document so the row updates the existing item instead of creating a duplicate.",why:"Keyed upsert is resolved before the writer lock, so every remaining create is re-checked under the lock; concurrent imports therefore cannot create two items for one key value.",nextSteps:["Re-run pm item mutate with the same document and --upsert-key; the re-plan turns the row into an update of the existing item.","Inspect the existing item first when its content should win over the document row."]})}function dt(e,t,r){let n=e.metadata[r.key],i=v(r.value);if(v(n)!==i)throw new l(`Item ${t} no longer carries upsert key "${r.key}" value ${JSON.stringify(i)}; the plan selected it before the key changed.`,m.CONFLICT,{code:"upsert_match_changed",required:"Re-plan the document so the row is resolved against the current key values.",why:"Keyed upsert selects its target before the writer lock, so the update re-reads the key under the lock instead of updating a mismatched item blindly.",nextSteps:["Re-run pm item mutate with the same document and --upsert-key; the re-plan creates or re-targets the row from the current key values."]})}function De(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=e;return typeof t.key=="string"&&t.key.trim().length>0&&t.value!==void 0&&t.value!==null}function C(e,t){let r={...e,...t};return e===void 0?r:x(e,r)}async function g(e,t){try{let r=(await J(t,{},{pmRoot:e})).item;return{id:r.id,closedAt:r.closed_at,updatedAt:r.updated_at,assignee:r.assignee,claimPrincipal:r.claim_principal}}catch(r){if(r instanceof l&&r.exitCode===m.NOT_FOUND)return;throw r}}function ee(e,t){let r=e.id.replaceAll(/[^a-zA-Z0-9._-]/gu,"_"),n=X.createHash("sha256").update(ue(e)).digest("hex").slice(0,12);return`${t+1}-${e.op}-${r}-${n}`}function ut(e,t){let r=e.id.replaceAll(/[^a-zA-Z0-9._-]/gu,"_");return`${t+1}-${e.op}-${r}`}function h(e,t,r){return`bulk-item-transaction ${e} ${t} ${r}`}async function A(e,t,r,n){let i=await S(d.join(e,"history",`${t}.jsonl`),t),a=h(r,n,"apply"),o=h(r,n,"compensate");for(let s=i.length-1;s>=0;s-=1){let c=i[s].message;if(c===a)return!0;if(c===o)return!1}return!1}async function te(e,t){let r=await g(e,t.id);if(r?.updatedAt===void 0)throw new l(`Bulk ${t.op} target ${t.id} does not exist or has no restorable version`,m.NOT_FOUND);let n=await S(d.join(e,"history",`${r.id}.jsonl`),r.id);if(n.length===0)throw new l(`Bulk ${t.op} target ${t.id} has no restorable history`,m.NOT_FOUND);return{target_updated_at:r.updatedAt,target_version:String(q(n)+n.length),target_history_hash:T(n),target_history_length:n.length}}function b(e,t,r){return new l(`Transaction ${e.transactionId} cannot safely compensate incomplete step ${r}; review item ${t} history before recovery.`,m.CONFLICT,{code:"transaction_partial_mutation",item_id:t,required:"Reconcile the item's partial or intervening changes before resuming this transaction.",why:"The retained history does not prove exclusive ownership of the changes to undo. The journal remains compensating instead of claiming a rollback or overwriting another writer.",nextSteps:[`Run pm history ${t} and inspect this transaction's retained compensation data before explicitly restoring or reconciling the item.`]})}function Le(e,t){let r=`bulk-item-transaction ${t} `;return[e.message,e.context?.item_transaction_step].some(n=>typeof n=="string"&&n.startsWith(r))}function pt(e,t,r){let{expectedHistory:n,length:i,version:a}=t;if(T(e)===n)return!1;if(typeof i!="number"||!Number.isSafeInteger(i)||i<1||T(e.slice(0,i))!==n||a!==String(q(e)+i))throw b(r,r.itemId,r.stepId);let o=h(r.transactionId,r.stepId,"apply"),s=e.slice(i),c=p=>p.message===o||p.context?.item_transaction_step===o,u=h(r.transactionId,r.stepId,"compensate");if(s.filter(p=>c(p)||p.message===u).at(-1)?.message===u)return!1;let f=s.filter(c);if(f.length===0)return!1;let _=e.at(-1).after_hash===f.at(-1).after_hash&&s.every(p=>Le(p,r.transactionId));if(f.length!==s.length&&!_)throw b(r,r.itemId,r.stepId);return!0}async function N(e,t,r,n){let i=n!==null&&typeof n=="object"&&!Array.isArray(n)?n:void 0;if(i===void 0||typeof i.target_updated_at!="string")return;let a=i.target_updated_at,o=await g(e.pmRoot,t);if(o===void 0)return;let s=await S(d.join(e.pmRoot,"history",`${o.id}.jsonl`),o.id),c=i.target_history_hash;if(typeof c=="string"){if(!pt(s,{expectedHistory:c,length:i.target_history_length,version:i.target_version},{...e,itemId:o.id,stepId:r}))return}else{if(o.updatedAt===a)return;if(!await A(e.pmRoot,o.id,e.transactionId,r))throw b(e,o.id,r)}let u=()=>Ce(t,typeof i.target_version=="string"?i.target_version:a,{force:!0,author:e.author,message:h(e.transactionId,r,"compensate")},{pmRoot:e.pmRoot});await $({pmRoot:e.pmRoot,id:o.id,validate:f=>{if(G(f)!==s.at(-1).after_hash)throw b(e,o.id,r)}},u)}function Je(e,t,r){return{id:r,async inspect(){let n=await g(e.pmRoot,t.id);if(n===void 0)return{state:"pending"};if(n.closedAt!==void 0){let i=await S(d.join(e.pmRoot,"history",`${n.id}.jsonl`),n.id),a=`Compensated: interrupted bulk transaction ${e.transactionId}`;if(i.filter(o=>o.op==="close").at(-1)?.patch.some(o=>o.op==="add"||o.op==="replace"?o.path==="/metadata/close_reason"&&o.value===a:!1)??!1)throw new l(`Created item ${n.id} remains closed by transaction compensation; explicitly reopen or reconcile it before retrying.`,m.CONFLICT,{code:"transaction_create_compensated",item_id:n.id,required:"Review the compensated item and explicitly reopen it before retrying the same document.",why:"This item's latest closure belongs to transaction compensation. Automatically reopening it could overwrite later lifecycle decisions.",nextSteps:[`Run pm item reopen ${n.id} "Retry compensated creation" after reviewing its history, then retry the transaction.`]})}return{state:"applied",result:{id:n.id,op:"create"}}},async apply(){t.unique!==void 0&&await ct(e.uniqueIndex,t.unique);let n=await ke(C(t.options,{author:e.author,id:t.id,message:h(e.transactionId,r,"apply")}),{pmRoot:e.pmRoot}),i=n.item;return e.onCreateWarnings?.(String(i.id),n.warnings),await e.uniqueIndex.recordCreate(i),{id:String(i.id),op:"create"}},async compensate(){await lt(e,t.id,r)}}}async function lt(e,t,r){let n=await g(e.pmRoot,t);if(n===void 0||e.createCompensation==="close"&&n.closedAt!==void 0)return;let i=await S(d.join(e.pmRoot,"history",`${n.id}.jsonl`),n.id),a=h(e.transactionId,r,"apply"),o=h(e.transactionId,r,"compensate"),s=i.filter(c=>c.message===a||c.message===o).at(-1);if(s?.message!==o){if(s===void 0||!i.every(c=>Le(c,e.transactionId)))throw b(e,n.id,r);await $({pmRoot:e.pmRoot,id:n.id,validate:c=>{if(G(c)!==i.at(-1).after_hash)throw b(e,n.id,r)}},async()=>{let c={force:!0,author:e.author,message:o};e.createCompensation==="delete"?await Ie(t,c,{pmRoot:e.pmRoot}):await W(t,`Compensated: interrupted bulk transaction ${e.transactionId}`,c,{pmRoot:e.pmRoot})})}}function mt(e,t,r){return{id:r,compensatePending:!0,async inspect(){let n=await g(e.pmRoot,t.id);return n===void 0?{state:"pending"}:await A(e.pmRoot,n.id,e.transactionId,r)?{state:"applied",result:{id:n.id,op:"update"}}:{state:"pending"}},async prepareCompensation(){return te(e.pmRoot,t)},async apply(){let n=()=>Me(t.id,C(t.options,{author:e.author,message:h(e.transactionId,r,"apply")}),{pmRoot:e.pmRoot}),i=t.match,a=i,o=(await $({pmRoot:e.pmRoot,id:String((await J(t.id,{},{pmRoot:e.pmRoot})).item.id),validate:s=>{a!==void 0&&dt(s,t.id,a)},committed:s=>{i!==void 0&&(a={key:i.key,value:structuredClone(s.metadata[i.key])})},historyContext:{item_transaction_step:h(e.transactionId,r,"apply")}},n)).item;return e.uniqueIndex.invalidate(),{id:String(o.id),op:"update"}},async compensate(n){await N(e,t.id,r,n)}}}function ft(e,t,r){return{id:r,async inspect(){let n=await g(e.pmRoot,t.id);return n===void 0?{state:"pending"}:await A(e.pmRoot,n.id,e.transactionId,r)?{state:"applied",result:{id:n.id,op:"close"}}:n.closedAt===void 0?{state:"pending"}:{state:"applied",result:{id:n.id,op:"close"}}},async prepareCompensation(){return te(e.pmRoot,t)},async apply(){let n=(await W(t.id,t.reason,C(t.options,{author:e.author,message:h(e.transactionId,r,"apply")}),{pmRoot:e.pmRoot})).item;return e.uniqueIndex.invalidate(),{id:String(n.id),op:"close"}},async compensate(n){await N(e,t.id,r,n)}}}function ht(e,t,r){return{id:r,async inspect(){let n=await g(e.pmRoot,t.id);return n===void 0?{state:"pending"}:await A(e.pmRoot,n.id,e.transactionId,r)?{state:"applied",result:{id:n.id,op:"release"}}:n.assignee!==void 0||n.claimPrincipal!==void 0?{state:"pending"}:{state:"applied",result:{id:n.id,op:"release"}}},async prepareCompensation(){return te(e.pmRoot,t)},async apply(){let n=(await Re(t.id,C(t.options,{author:e.author,message:h(e.transactionId,r,"apply")}),{pmRoot:e.pmRoot})).item;return e.uniqueIndex.invalidate(),{id:String(n.id),op:"release"}},async compensate(n){await N(e,t.id,r,n)}}}function ne(e,t,r){let n=ee(t,r);switch(t.op){case"create":return Je(e,t,n);case"update":return mt(e,t,n);case"close":return ft(e,t,n);case"release":return ht(e,t,n)}}function yt(e,t){if(e===null||typeof e!="object"||Array.isArray(e))throw new TypeError(`Bulk mutation ${t+1} must be an object`);if(!["create","update","close","release"].includes(e.op))throw new TypeError(`Bulk mutation ${t+1} op must be create, update, close, or release`);if(typeof e.id!="string"||e.id.trim().length===0)throw new TypeError(`Bulk mutation ${t+1} requires a non-empty id`);if(e.op==="close"&&(typeof e.reason!="string"||e.reason.trim().length===0))throw new TypeError(`Bulk close mutation ${t+1} requires a non-empty reason`);if(e.op==="create"&&e.unique!==void 0&&!De(e.unique))throw new TypeError(`Bulk create mutation ${t+1} unique must be an object with a non-empty key and a value`);if(e.op==="update"&&e.match!==void 0&&!De(e.match))throw new TypeError(`Bulk update mutation ${t+1} match must be an object with a non-empty key and a value`);z(e.options,e.op,t)}function We(e){if(e.length===0)throw new TypeError("Bulk item transaction requires at least one mutation");let t=new Map;for(let[r,n]of e.entries()){if(yt(n,r),n.op!=="create"||n.unique===void 0)continue;let{key:i,value:a}=n.unique,o=t.get(i)??new Map,s=v(a),c=o.get(s);if(c!==void 0)throw new l(`Bulk create mutations ${c+1} and ${r+1} share the upsert key value ${JSON.stringify(s)} for "${i}".`,m.USAGE,{code:"upsert_key_duplicate",required:"Each create must carry a distinct unique key value within one batch.",why:"Direct SDK batches must preserve the same uniqueness invariant as planned document rows."});o.set(s,r),t.set(i,o)}}function ze(e){let t=[...e];return We(t),t.map(r=>{let n=structuredClone(r);return r.options!==void 0&&n.options!==void 0&&x(r.options,n.options),n})}function Be(e,t=""){return e===null||typeof e!="object"?[]:Object.entries(e).flatMap(([r,n])=>{let i=`${t}/${r.replaceAll("~","~0").replaceAll("/","~1")}`;return/^(created_at|updated_at|closed_at|completed_at|timestamp)$/u.test(r)?[i]:Be(n,i)})}async function Y(e,t,r){try{return await r()}catch(n){throw n instanceof l?new l(n.message,n.exitCode,{...n.context,transaction_operation:{index:t,op:e.op,id:e.id}}):n}}function Ve(e,t,r,n){let i=d.relative(e,t),a=i.split(d.sep);return a[0]==="extensions"&&a[2]==="node_modules"&&!n.some(o=>i===o||i.startsWith(`${o}${d.sep}`)||o.startsWith(`${i}${d.sep}`))?!1:["locks","runtime","search"].includes(i.split(d.sep)[0])?n.some(o=>i===o||i.startsWith(`${o}${d.sep}`)||o.startsWith(`${i}${d.sep}`)):i===""||r===void 0||r.some(o=>i===o||i.startsWith(`${o}${d.sep}`)||o.startsWith(`${i}${d.sep}`))}async function R(e,t){let r=await Fe(t);if(r.isSymbolicLink())await Z(t);else if(r.isDirectory()||r.isFile())return r;throw O(d.relative(e,t))}async function wt(e,t){let r=await it(t,V.O_RDONLY|V.O_NOFOLLOW|V.O_NONBLOCK);try{let n=await r.stat();if(!n.isFile())throw O(d.relative(e,t));let i=X.createHash("sha256");if(n.size>0)for await(let a of r.createReadStream({highWaterMark:64*1024,end:n.size-1,autoClose:!1}))i.update(a);return i.digest()}finally{await r.close()}}async function H(e,t,r){let n=X.createHash("sha256");async function i(a){for(let o of(await ot(a)).sort()){let s=d.join(a,o);Ve(e,s,t,r)&&((await R(e,s)).isDirectory()?await i(s):(n.update(JSON.stringify(d.relative(e,s))),n.update(await wt(e,s))))}}return await i(e),n.digest("hex")}function M(){return new l("Tracker changed while preparing the transaction preview; retry against stable state.",m.CONFLICT,{code:"transaction_preview_snapshot_changed"})}async function re(e){if(!j(e))return!1;let t=e.path;if(typeof t!="string")return!1;let r=d.resolve(t),n=r;for(;;)try{let i=await Fe(n);return n!==r&&i.isDirectory()}catch(i){if(!j(i))return!1;let a=d.dirname(n);if(a===n)return!1;n=a}}async function I(e,t){let r=d.join(e,t);try{let n=e;for(let i of t.split(d.sep).slice(0,-1))n=d.join(n,i),await R(e,n);if(!(await R(e,r)).isFile())throw O(t);return await ce(r,O(t))}catch(n){if(await re(n))return;throw n}}async function Ye(e,t,r,n){let i=F(r);for(let[a,o]of Object.entries(i.files)){let s=d.relative(e,fe(e,o,me[a]));if(s===""||!d.resolve(e,s).startsWith(d.join(e,d.sep)))throw new l("Transaction preview requires schema files inside the selected tracker root; relocate the configured schema file before retrying.",m.USAGE,{code:"transaction_preview_external_schema",field:`schema.files.${a}`});i.files[a]=s;let c=await I(e,s);if(n?.set(s,c),c!==void 0){let u=d.join(t,s);await rt(d.dirname(u),{recursive:!0}),await qe(u,c)}}return he(t,i)}async function gt(e,t){await Z(e);let r=await Pe(d.join(Ke(),"pm-schema-plan-"));try{let n=await xe(e);return await Ye(n,d.join(r,"configuration"),t)}catch(n){throw await re(n)?M():n}finally{await Ge(r,{recursive:!0,force:!0})}}async function vt(e,t,r){let n=new Map,i=await I(e,E);n.set(E,i);let a;try{a=JSON.parse(i??"null")}catch{a=null}let o=_e(a),s=o.success?o.data:void 0,c=await Ye(e,t,s?.schema,n),u=c.schema,f=d.relative(e,ve(e));n.set(f,await I(e,f));let _=D({...se,item_types:{definitions:[...s?.item_types?.definitions??[],...c.type_definitions_from_file??[]]}},r),p=de(e)===e?[...ae.filter(Boolean),E,Oe,"transactions",..._.folders,...n.keys()].map(w=>d.normalize(w)):void 0,y=s===void 0?void 0:JSON.stringify({...a,schema:{...s.schema,files:u.files}});return{configuration:n,ownedPaths:p,stagedSettings:y,registryFolders:_.folders}}async function _t(e,t,r){await Z(e);try{let n=await xe(e),i=await vt(n,d.join(d.dirname(t),"configuration"),r),a=[...i.configuration.keys(),...i.registryFolders].map(u=>d.normalize(u)),o=await H(n,i.ownedPaths,a);await nt(n,t,{recursive:!0,dereference:!1,filter:async u=>Ve(n,u,i.ownedPaths,a)?(await R(n,u),!0):!1});let[s,c]=await Promise.all([H(n,i.ownedPaths,a),H(t,i.ownedPaths,a)]);if(o!==s||o!==c)throw M();for(let[u,f]of i.configuration)if(await I(t,u)!==f)throw M();i.stagedSettings!==void 0&&await qe(d.join(t,E),i.stagedSettings)}catch(n){throw await re(n)?M():n}}async function jn(e){let t=k(e),r=ze(e.mutations),n=P(),i=await Pe(d.join(Ke(),"pm-transaction-preview-")),a=d.join(i,"tracker");try{await _t(t.pmRoot,a,n);let o=!1,s=[],c=[],u=new Set;return await Ne({path:a,noExtensions:!0},async()=>{ye(n);let f={...t,pmRoot:a,createCompensation:"close",uniqueIndex:Q(a)},_=r.map((p,y)=>{let w=ne({...f,onCreateWarnings:(U,ie)=>{ie.length>0&&s.push({index:y,id:U,op:"create",warnings:ie})}},p,y);return{...w,inspect:()=>Y(p,y,()=>w.inspect()),prepareCompensation:()=>Y(p,y,async()=>w.prepareCompensation?.()),apply:()=>Y(p,y,async()=>{let U=await w.apply();return u.add(y),U})}});if(await K({...t,pmRoot:a,steps:_,onTransition:({transition:p})=>{p==="committed"&&(o=!0)}}),o)for(let[p,y]of r.entries()){let w=(await $e(y.id,{path:a},{full:!0})).item;c.push({index:p,id:String(w.id),op:y.op,execution:u.has(p)?"applied":"adopted",item:w,commit_time_fields:Be(w)})}}),{records:c,validated:o,state:o?"staged_snapshot":"replayed_committed_plan",warnings:s,unresolved_commit_constraints:["concurrent_tracker_changes","extension_mutation_guards_and_hooks","derived_extension_dependencies_excluded","generated_timestamps_and_provenance"]}}finally{await Ge(i,{recursive:!0,force:!0})}}async function St(e){let t=k(e),r=ze(e.mutations),n=e.createCompensation??"close";if(!["close","delete"].includes(n))throw new TypeError("Bulk item transaction createCompensation must be close or delete");let i={...t,createCompensation:n,uniqueIndex:Q(t.pmRoot)},a=await K({...t,steps:r.map((s,c)=>ne(i,s,c)),recoveryData:JSON.parse(JSON.stringify({kind:"item-mutations-v1",mutations:r,createCompensation:n})),...e.lockTtlSeconds===void 0?{}:{lockTtlSeconds:e.lockTtlSeconds},...e.lockWaitMs===void 0?{}:{lockWaitMs:e.lockWaitMs},...e.onTransition===void 0?{}:{onTransition:e.onTransition}}),o={};for(let[s,c]of r.entries()){let u=ee(c,s),f=a.results[u];o[ut(c,s)]=f}return{transactionId:a.transactionId,status:"committed",recovered:a.recovered,results:o}}function bt(e){let t=[];return e.evidence!==void 0&&Object.keys(e.evidence).length>0&&t.push({op:"update",id:e.id,options:e.evidence}),t.push({op:"close",id:e.id,reason:e.reason,...e.closeOptions===void 0?{}:{options:e.closeOptions}},{op:"release",id:e.id,...e.releaseOptions===void 0?{}:{options:e.releaseOptions}}),t}function Dn(e){return St({pmRoot:e.pmRoot,transactionId:e.transactionId,author:e.author,mutations:bt(e),...e.lockTtlSeconds===void 0?{}:{lockTtlSeconds:e.lockTtlSeconds},...e.lockWaitMs===void 0?{}:{lockWaitMs:e.lockWaitMs},...e.onTransition===void 0?{}:{onTransition:e.onTransition}})}var Fn={buildCreateStep:Je,bulkHistoryMarker:h,compensateByRestore:N,deriveStepId:ee,isUpdateMarkerApplied:A,readItemSnapshot:g};async function Pn(e,t){let r=await Ae(e,t);return r===void 0?void 0:{journal:r,planDigest:L(r)}}function Et(e,t){let r=t.recoveryData;if(r===null||typeof r!="object"||Array.isArray(r)||r.kind!=="item-mutations-v1"||!Array.isArray(r.mutations)||!["close","delete"].includes(String(r.createCompensation)))throw new l("Transaction has no supported item recovery plan",m.CONFLICT,{code:"transaction_recovery_plan_missing",required:"Resume with the original plan and its original adapter.",why:"Legacy or foreign journals cannot safely reconstruct item compensation."});let n=r.mutations;We(n);let i={...e,createCompensation:r.createCompensation,uniqueIndex:Q(e.pmRoot)};return n.map((a,o)=>ne(i,a,o))}async function xn(e){let t=k(e),r=await Te({...e,...t,resolveSteps:n=>Et({...e,...t},n)});return{journal:r,planDigest:L(r)}}export{Fn as _testOnlyItemTransaction,xn as abandonItemTransaction,bt as buildItemCompletionMutations,Dn as commitItemCompletion,St as commitItemMutations,st as listUpsertKeyCandidates,gt as loadGuardedRuntimeSchema,jn as previewItemMutations,Pn as readItemTransaction,at as resolveTransactionSchema};
2
- //# sourceMappingURL=item-transaction-H2XACBOP.js.map
@@ -1,2 +0,0 @@
1
- import{s as E,x as N}from"./chunk-MG7C3JUY.js";import"./chunk-CPMSL4HS.js";import{N as y,Q as C}from"./chunk-LW64TINU.js";import"./chunk-GS3JC5UU.js";import"./chunk-D2TBEBNW.js";import{Ca as h,Ia as w}from"./chunk-MK4HV4JO.js";import"./chunk-O7EI33NP.js";import{fb as A,k as R}from"./chunk-YMGB2O4E.js";import"./chunk-RFTJZ5VB.js";import{l as T,m as O}from"./chunk-VWWTIX5L.js";import"./chunk-4PW5XWVI.js";import"./chunk-I5LGPUWH.js";import"./chunk-C3O6JJPO.js";import{a as g,xa as _}from"./chunk-M6V7UMWL.js";import{A as f}from"./chunk-G6ERMFJ5.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="d19ff816-7570-5e8a-a4de-ad2ca48f0df0")}catch{}})();function b(t,o,r,a=!1){let d=[...r].map(n=>({candidate:n,distance:g(o,n,3)})).filter(n=>n.distance!==null).sort((n,i)=>n.distance-i.distance||n.candidate.localeCompare(i.candidate))[0]?.candidate,s=a?`Put mutation fields under options (options.${o}).`:d?`Did you mean "${d}"?`:"Use the declared command options or the field option for registered item fields.";throw new f(`Unknown ${t} ${a?"argument":"option"} "${o}". ${s} No changes were made.`,2,{code:"invalid_argument_value",reason:"unknown_mutation_option",changed:!1,field:o,required:s,nextSteps:[s]})}async function j(t,o,r,a,d){if(E(o))return;let s=t==="create"?y:C,n=(t==="create"?h:w).map(({flag:e})=>e.slice(2).replace(/-([a-z])/gu,(m,v)=>v.toUpperCase())),i=new Set([...s.flatMap(e=>[e.target,...e.keys]),...n]),l=["outputInclude","outputLimit","outputBudget","outputFormat","outputSession","outputCursor"];for(let e of["author","message","force","fullChangedFields","idOnly",...l])i.add(e);let S=new Set(["action","options","path","cwd","author","force","noExtensions","no_extensions","fullChangedFields","idOnly",...l,...d,...t==="update"?["id"]:[]]);for(let e of Object.keys(o))S.has(e)||b(t,e,i,i.has(e));let u=o.options;if(u!==void 0&&!N(u))throw new f("Mutation options must be an object. No changes were made.",2,{code:"invalid_argument_value",changed:!1});let c=[...new Set([...Object.keys(u??{}),...Object.keys(r)])].filter(e=>!i.has(e));if(c.length===0)return;let p=T((await A(_(process.cwd(),a))).schema).command_to_fields.get(t)??[];for(let e of p)i.add(O(e));for(let e of c)p.some(m=>R({[e]:!0},m)===!0)||b(t,e,i)}export{j as assertNativeMutationOptions};
2
- //# sourceMappingURL=mutation-admission-4WM7TNHZ.js.map
@@ -1,2 +0,0 @@
1
- import{c as w,j as y}from"./chunk-AHWJPZSJ.js";import{b as g}from"./chunk-IDAYTYNN.js";import"./chunk-GHQVM6K6.js";import"./chunk-YMGB2O4E.js";import"./chunk-VWWTIX5L.js";import"./chunk-4PW5XWVI.js";import{xa as h}from"./chunk-M6V7UMWL.js";import{b as u}from"./chunk-FOA7XKWP.js";import{A as f,z as d}from"./chunk-G6ERMFJ5.js";import{execFile as _}from"node:child_process";import{realpath as b}from"node:fs/promises";import l from"node:path";import{promisify as x}from"node:util";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7f4b2fc8-c9c6-51ff-a345-b76b8abdacf4")}catch{}})();var R=x(_);function c(e){return new f(`Automatic merge settlement refused: ${e}`,d.CONFLICT,{code:"merge_settlement_review_required",recovery:{suggested_retry:"pm merge reconcile --dry-run"},nextSteps:["Inspect receipts, repair streams and Git changes. Resolve competing values or unrelated drift explicitly, then run pm merge reconcile and stage the reviewed artifacts manually."]})}async function $(e){let t=process.env.GIT_INDEX_FILE;if(t===void 0)return;let a=(await e(["rev-parse","--path-format=absolute","--git-path","index"])).stdout.trim();if(l.resolve(t)!==l.resolve(a))throw c("an alternate Git index requires explicit manual settlement")}async function I(e,t){if(t.length===0)return[];let a=t.map(s=>`:(literal)${s}`),o=new Set((await e(["ls-files","--cached","-z","--",...a])).stdout.split("\0")),i=t.filter(s=>!o.has(s)).map(s=>`:(literal)${s}`);if(i.length>0&&(await e(["diff","--cached","--name-only","--diff-filter=D","-z","--",...i])).stdout.length>0)throw c("a receipt has a staged deletion that requires explicit review");return i}async function G(e){let{git:t,preview:a,paths:o,newReceiptPathspecs:i}=e,s=!1;try{i.length>0&&(s=!0,await t(["add","--",...i]));let n=await e.apply();if(!n.ok||JSON.stringify(n.receipts.summaries)!==JSON.stringify(a.receipts.summaries)||n.repair.streams.some(p=>!a.repair.streams.some(m=>m.id===p.id)))throw c("reconciliation changed or did not finish; inspect the audit artifacts before staging");return o.length>0&&await t(["add","--",...o.map(p=>`:(literal)${p}`)]),{...n,staged_paths:o,guidance:["Lossless reconciliation artifacts are staged for the merge commit. Review git diff --cached before committing."]}}catch(n){throw s&&await t(["reset","--quiet","--",...i]),n}}function k(e){if(e.repair.totals.failed>0||e.receipts.missing_history_references_after>0||e.receipts.summaries.some(t=>t.conflict_fields.length>0)||e.repair.streams.some(t=>t.merge_receipt_proof?.trusted!==!0)||e.validation.checks.some(t=>t.name!=="history_drift"&&t.status!=="ok"))throw c("only fully authenticated receipt-backed repairs without discarded values can be staged")}async function S(e){try{return{...e,path:await b(h(process.cwd(),e.path))}}catch{throw c("the tracker root cannot be resolved")}}async function F(e){let{preview:t}=e;k(t);let{path:a}=await S(e.global),o=await w(a);if(o===null)throw c("a Git workspace is required");let i=r=>R("git",r,{cwd:o,env:u(),timeout:1e4});if(await $(i),(await i(["ls-files","--unmerged","-z"])).stdout.length>0)throw c("Git still has unresolved paths");let s=[...new Set([...[...new Set([...t.repair.streams.map(r=>r.id),...t.receipts.summaries.map(r=>r.item_id)])].map(r=>l.join(a,"history",`${r}.jsonl`)),...t.receipts.summaries.map(r=>l.join(a,"merge-receipts",`${r.receipt_id}.json`))])].map(r=>l.relative(o,r).replaceAll("\\","/"));if(s.some(g))throw c("reconciliation artifacts must belong to this Git workspace");let n=await y(o,s);if(n.length>0)throw new f(`Automatic merge settlement refused: required artifacts are ignored by Git: ${n.map(r=>`${r.path} (${r.source}:${r.line}: ${r.pattern})`).join(", ")}. Remove or narrow the owning ignore rules because merge receipts must travel with the commit.`,d.CONFLICT,{code:"merge_settlement_review_required",reason:"ignored_merge_artifacts",paths:n.map(r=>r.path),nextSteps:["Remove or narrow the named ignore rules, preserve receipt and history files, then retry pm merge reconcile --stage --dry-run before applying pm merge reconcile --stage. Do not force-add ignored proof as a substitute for fixing the shared policy."]});let p=s.map(r=>`:(literal)${r}`),m=t.receipts.summaries.map(r=>l.relative(o,l.join(a,"merge-receipts",`${r.receipt_id}.json`)).replaceAll("\\","/"));if(p.length>0)try{await i(["diff","--quiet","--",...p])}catch{throw c("reconciliation paths have unstaged edits or Git cannot verify their index state")}let v=await I(i,m);return e.dryRun?{...t,staged_paths:[]}:G({...e,git:i,paths:s,newReceiptPathspecs:v})}export{S as resolveMergeSettlementGlobal,F as stageLosslessMergeReconciliation};
2
- //# sourceMappingURL=stage-WV7QXR4C.js.map
package/dist/cli.d.ts DELETED
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
- declare function enableNodeCompileCache():void;
3
- declare function findPackageJson(startPath:string):string | undefined;
4
- declare function printFastVersionIfRequested():boolean;
5
- declare function readPackageVersionForPath(startPath:string):string | undefined;
6
- /** Public contract for test only, shared by SDK and presentation-layer consumers. */
7
- export declare const _testOnly:{
8
- enableNodeCompileCache:typeof enableNodeCompileCache;
9
- findPackageJson:typeof findPackageJson;
10
- printFastVersionIfRequested:typeof printFastVersionIfRequested;
11
- readPackageVersionForPath:typeof readPackageVersionForPath;
12
- };
13
- export {};
@@ -1,61 +0,0 @@
1
- /**
2
- * @module core/checkpoint/checkpoint-gc
3
- *
4
- * Age-based garbage collector for bulk-mutation rollback checkpoints written by
5
- * `update-many`/`close-many` under `checkpoints/<subdir>/<id>.json`.
6
- *
7
- * Safety-first policy (mirroring the stale-lock sweep in `lock/lock-gc.ts`): a
8
- * checkpoint whose JSON cannot be read or whose `created_at` cannot be parsed is
9
- * RETAINED rather than deleted. We only prune checkpoints whose age can be
10
- * conclusively determined from their own `created_at` field and that exceed the
11
- * configured `checkpoints.retention_days` policy.
12
- *
13
- * Staleness formula: (now_ms - Date.parse(created_at)) > retention_days * 86_400_000.
14
- * A zero/negative age (a future `created_at`) is always treated as active.
15
- */
16
- /** Documents the checkpoint gc scan entry payload exchanged by command, SDK, and package integrations. */
17
- export interface CheckpointGcEntry {
18
- /** Relative path like "checkpoints/update-many/update-many-20260619-abc123.json". */
19
- file:string;
20
- /** Parsed `created_at`, or null when missing/unparseable. */
21
- created_at:string | null;
22
- /** floor((now - created_at)/1000), null when unparseable. */
23
- age_seconds:number | null;
24
- /** True only when classified as expired (older than the retention window). */
25
- stale:boolean;
26
- /** Value that configures or reports reason for this contract. */
27
- reason:"expired" | "active" | "unparseable";
28
- }
29
- /** Documents the checkpoint gc hooks payload exchanged by command, SDK, and package integrations. */
30
- export interface CheckpointGcHooks {
31
- /** Value that configures or reports on read for this contract. */
32
- onRead?:(checkpointPath:string) => Promise<string[]> | string[];
33
- /** Value that configures or reports on write for this contract. */
34
- onWrite?:(checkpointPath:string) => Promise<string[]> | string[];
35
- }
36
- /** Documents the checkpoint gc options payload exchanged by command, SDK, and package integrations. */
37
- export interface CheckpointGcOptions {
38
- /** Value that configures or reports dry run for this contract. */
39
- dryRun:boolean;
40
- /** Prune checkpoints older than this many days. Negative values are clamped to zero (prune everything aged); a non-finite value (NaN/Infinity) disables pruning entirely so bad input never deletes recoverable checkpoints. */
41
- retentionDays:number;
42
- /** Epoch ms; defaults to Date.now() — injectable for deterministic tests. */
43
- now?:number;
44
- /** Value that configures or reports hooks for this contract. */
45
- hooks?:CheckpointGcHooks;
46
- }
47
- /** Documents the checkpoint gc result payload exchanged by command, SDK, and package integrations. */
48
- export interface CheckpointGcResult {
49
- /** Number of *.json checkpoint files examined. */
50
- scanned:number;
51
- /** Relative paths removed (or would-remove under dryRun), sorted by file name asc. */
52
- removed:string[];
53
- /** Relative paths retained (active OR unparseable — never delete what we can't reason about). */
54
- retained:string[];
55
- /** Value that configures or reports warnings for this contract. */
56
- warnings:string[];
57
- /** One per scanned checkpoint file, sorted by file name asc. */
58
- entries:CheckpointGcEntry[];
59
- }
60
- /** Implements run checkpoint gc for the public runtime surface of this module. */
61
- export declare function runCheckpointGc(pmRoot:string,options:CheckpointGcOptions):Promise<CheckpointGcResult>;
@@ -1,10 +0,0 @@
1
- interface CheckpointMutationContext {
2
- pmRoot:string;
3
- itemId:string;
4
- checkpointId:string;
5
- }
6
- /** Carry checkpoint identity through nested lifecycle writers in this async operation only. */
7
- export declare function withCheckpointMutation<T>(context:CheckpointMutationContext,operation:() => Promise<T>):Promise<T>;
8
- /** Read checkpoint attribution only for the matching tracker and item at commit time. */
9
- export declare function checkpointMutationHistoryContext(pmRoot:string,itemId:string):Record<string,unknown> | undefined;
10
- export {};
@@ -1,52 +0,0 @@
1
- /**
2
- * Shared machine-executable remediation registry.
3
- *
4
- * `pm health` and `pm validate` both emit stable, colon-delimited warning tokens
5
- * (for example `history_drift_missing_stream:pm-abcd` or
6
- * `validate_resolution_missing_fields:3`). Agents that gate on these commands
7
- * previously had to hardcode the mapping from a warning code to the `pm` command
8
- * that fixes it. This module is the single source of truth for that mapping so
9
- * `pm health --json` (per-check `remediation_map`) and `pm validate --fix-hints`
10
- * (per-check `fix_hints`) can both surface executable remediation without any
11
- * duplicated, drift-prone lookup tables.
12
- *
13
- * Semantics of {@link RemediationEntry.command}: the suggested next `pm` command
14
- * an operator/agent should run to resolve findings with that code. Per-item
15
- * findings use an `<id>` placeholder (callers that have the concrete id may
16
- * substitute it); findings whose only fix is a manual file edit point at the
17
- * most useful diagnostic/repair command and describe the manual step in
18
- * {@link RemediationEntry.summary}.
19
- */
20
- /** Maps a stable diagnostic warning code to the command and summary that resolve it. */
21
- export interface RemediationEntry {
22
- /** Stable warning-code prefix this entry resolves. A warning matches when it equals this code or begins with `<code>:`. Registry codes are mutually exclusive under that colon-boundary rule (no code is a `:`-delimited prefix of another — e.g. `settings:id_prefix_empty` is distinct from a bare `settings`, which is intentionally not registered), so `resolveRemediation` uses first-match with no ordering dependency. */
23
- readonly code:string;
24
- /** Executable `pm` command (or imperative) that resolves the finding. May contain an `<id>` placeholder. */
25
- readonly command:string;
26
- /** One-line description of what the command does / which manual step it covers. */
27
- readonly summary:string;
28
- }
29
- /** Registry of every non-extension `pm health` / `pm validate` warning code and its remediation. Extension findings keep their richer, contextual `details.triage.remediation` produced by the extension health triage and are intentionally excluded here (see pm-0hnu: "all non-extension checks"). */
30
- export declare const REMEDIATION_REGISTRY:readonly RemediationEntry[];
31
- /**
32
- * Resolve the remediation entry for a warning token, or `undefined` when no
33
- * entry is registered. A warning matches an entry when it equals the entry code
34
- * or begins with `<code>:` (the colon boundary keeps sibling codes such as
35
- * `validate_lifecycle_dependency_cycles` and
36
- * `validate_lifecycle_dependency_cycles_error` disjoint).
37
- *
38
- * First match is intentional and correct: registry codes are mutually exclusive
39
- * under the colon-boundary rule, so at most one entry can ever match a warning
40
- * and order is irrelevant. That invariant is enforced by a test (see
41
- * remediation-registry.spec.ts "keeps every registry code mutually exclusive"),
42
- * which is why this stays a simple linear scan rather than a longest-prefix
43
- * search — a longest-prefix tie-break is unreachable with disjoint codes.
44
- *
45
- * Accepts unknown input defensively (this is an exported helper SDK consumers
46
- * may call from untyped JS): a non-string `warning` resolves to `undefined`.
47
- */
48
- export declare function resolveRemediation(warning:string):RemediationEntry | undefined;
49
- /** Build a compact `remediation_map` (code -> command) for a set of warning tokens. First match wins per code; unknown codes are skipped. Used by `pm health --json` per-check details and as the source of deduped executable commands for `pm validate --fix-hints`. */
50
- export declare function buildRemediationMap(warnings:Iterable<string>):Record<string,string>;
51
- /** Build a deduped, ordered list of executable remediation commands for a set of warning tokens (one command per distinct matched code). Used by `pm validate --fix-hints` for checks that do not already emit per-row remediation commands. */
52
- export declare function buildRemediationCommands(warnings:Iterable<string>):string[];
@@ -1,22 +0,0 @@
1
- /**
2
- * @module core/extensions/activation-transaction
3
- *
4
- * Captures and restores extension registries around one activation attempt.
5
- */
6
- import type { ExtensionCommandRegistry,ExtensionHookRegistry,ExtensionParserRegistry,ExtensionPreflightRegistry,ExtensionRegistrationRegistry,ExtensionRendererRegistry,ExtensionServiceRegistry } from "./extension-types.js";
7
- interface MutableExtensionActivationState {
8
- hooks:ExtensionHookRegistry;
9
- commands:ExtensionCommandRegistry;
10
- parsers:ExtensionParserRegistry;
11
- preflight:ExtensionPreflightRegistry;
12
- services:ExtensionServiceRegistry;
13
- renderers:ExtensionRendererRegistry;
14
- registrations:ExtensionRegistrationRegistry;
15
- }
16
- /**
17
- * Return a rollback operation that restores every mutable registry to its
18
- * current length, making one extension activation atomic without cloning
19
- * handlers or user values.
20
- */
21
- export declare function captureExtensionActivationRollback(state:MutableExtensionActivationState):() => void;
22
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * @module core/extensions/command-visibility-tier
3
- *
4
- * Validates extension command visibility metadata.
5
- */
6
- import type { CommandDefinition } from "./extension-types.js";
7
- /** Validate optional command metadata strings and the closed visibility tier. */
8
- export declare function assertCommandDefinitionMetadataStrings(definition:CommandDefinition):void;
@@ -1,12 +0,0 @@
1
- /**
2
- * @module core/extensions/exporter-output-contract
3
- *
4
- * Validates SDK-declared exporter artifact channels independently from extension activation.
5
- */
6
- import type { CommandHandlerContext,ExporterRegistrationOptions,ImportExportContext,RegisteredExporterArtifactOutputContract } from "./extension-types.js";
7
- /** Validates and normalizes the public artifact-channel metadata for one exporter registration. */
8
- export declare function normalizeExporterArtifactOutput(value:unknown):RegisteredExporterArtifactOutputContract;
9
- /** Enforces importer/exporter channel ownership and applies the stdout-specific derived description. */
10
- export declare function resolveImportExportArtifactOutput(method:"registerImporter" | "registerExporter",resolvedOptions:ExporterRegistrationOptions,descriptionWasDeclared:boolean):RegisteredExporterArtifactOutputContract | undefined;
11
- /** Snapshots a host command invocation into the stable importer/exporter context contract. */
12
- export declare function buildImportExportContext(context:CommandHandlerContext,registration:string,action:"import" | "export"):ImportExportContext;
@@ -1,26 +0,0 @@
1
- /**
2
- * @module core/extensions/extension-candidate
3
- *
4
- * Projects static scan evidence into an import-ready extension candidate.
5
- */
6
- import type { ExtensionCandidate,ExtensionContributionInventory,ExtensionLayer,ExtensionManifest } from "./extension-types.js";
7
- /** Managed package identity attached to a discovered extension directory. */
8
- export interface ExtensionCandidateSourceIdentity {
9
- /** Registry package name when known. */
10
- package_name?:string;
11
- /** Install-source aliases accepted by lifecycle commands. */
12
- aliases:string[];
13
- /** Persisted install-time contribution snapshot. */
14
- contributions?:ExtensionContributionInventory;
15
- }
16
- /** Build an import-ready discovery candidate only after every static gate passes. */
17
- export declare function buildReadyExtensionCandidate(params:{
18
- layer:ExtensionLayer;
19
- directory:string;
20
- manifestPath:string;
21
- entryPath:string;
22
- manifest:ExtensionManifest;
23
- sourceIdentity:ExtensionCandidateSourceIdentity | undefined;
24
- extensionReady:boolean;
25
- enabledForLoad:boolean;
26
- }):ExtensionCandidate | null;
@@ -1,16 +0,0 @@
1
- /**
2
- * @module core/extensions/extension-runtime-helpers
3
- *
4
- * Implements extension runtime contracts and governance for Extension Runtime Helpers.
5
- */
6
- import type { GlobalOptions } from "../shared/command-types.js";
7
- /** Implements normalize command name for the public runtime surface of this module. */
8
- export declare function normalizeCommandName(command:string):string;
9
- /** Implements default global options for the public runtime surface of this module. */
10
- export declare function defaultGlobalOptions():GlobalOptions;
11
- /** Implements clone command options snapshot for the public runtime surface of this module. */
12
- export declare function cloneCommandOptionsSnapshot(options:Record<string,unknown> | undefined):Record<string,unknown>;
13
- /** Implements clone global options snapshot for the public runtime surface of this module. */
14
- export declare function cloneGlobalOptionsSnapshot(options:GlobalOptions | undefined):GlobalOptions;
15
- /** Implements clone context snapshot for the public runtime surface of this module. */
16
- export declare function cloneContextSnapshot<T>(value:T):T;
@@ -1,19 +0,0 @@
1
- /** Extension paths and identity required to create a complete graph snapshot. */
2
- export interface ExtensionModuleGraphSnapshotSource {
3
- /** Extension precedence layer used to keep snapshot directories distinct. */
4
- layer:string;
5
- /** Extension directory identifier used to keep snapshot directories distinct. */
6
- directory:string;
7
- /** Absolute path to the extension manifest inside its source directory. */
8
- manifest_path:string;
9
- /** Absolute path to the extension entry module. */
10
- entry_path:string;
11
- }
12
- /**
13
- * Copy an extension directory into a fresh graph root and return its entry path.
14
- *
15
- * Copying the complete directory gives every relative transitive import a new
16
- * absolute URL, preventing a same-process install verification from reusing
17
- * stale ESM cache entries.
18
- */
19
- export declare function snapshotExtensionModuleGraph(snapshotRoot:string,extension:ExtensionModuleGraphSnapshotSource):Promise<string>;
@@ -1,5 +0,0 @@
1
- import type { ExtensionPreflightRegistry,PreflightOverride,RegisteredExtensionPreflightOverride,ScopedPreflightOverrideDefinition } from "./extension-types.js";
2
- /** Normalize one callback or scoped definition into a registered handler payload. */
3
- export declare function normalizePreflightOverride(override:PreflightOverride | ScopedPreflightOverrideDefinition):Pick<RegisteredExtensionPreflightOverride,"run" | "commands">;
4
- /** Report pairwise overlap while permitting disjoint scoped ownership. */
5
- export declare function collectPreflightCollisionWarnings(preflight:ExtensionPreflightRegistry):string[];
@@ -1,5 +0,0 @@
1
- import type { ExtensionCommandReadOutput } from "./extension-types.js";
2
- /** Reject malformed, ambiguous or unsafe row declarations and retain an immutable snapshot. */
3
- export declare function normalizeExtensionReadOutput(value:unknown,command?:string,action?:string):ExtensionCommandReadOutput | undefined;
4
- /** Preserve native dispatch authority when packages declare custom read commands. */
5
- export declare function isNativeExtensionOutputCommand(command:string):boolean;
@@ -1,18 +0,0 @@
1
- /**
2
- * @module core/extensions/reserved-host-flags
3
- *
4
- * Declares the pm host flags that extension commands must never shadow.
5
- */
6
- /** Describes one host-owned flag spelling reserved from extension registration. */
7
- export interface ReservedExtensionHostFlag {
8
- /** Canonical long flag owned by the pm host. */
9
- flag:string;
10
- /** Compatibility aliases that are equally host-owned. */
11
- aliases?:readonly string[];
12
- /** Optional value label retained by the public CLI contract projection. */
13
- value_name?:string;
14
- }
15
- /** Host-owned flags inherited by every subcommand, including extension commands. */
16
- export declare const RESERVED_EXTENSION_HOST_FLAGS:readonly ReservedExtensionHostFlag[];
17
- /** Every canonical and aliased host flag spelling reserved from extensions. */
18
- export declare const RESERVED_EXTENSION_HOST_FLAG_NAMES:ReadonlySet<string>;
@@ -1,8 +0,0 @@
1
- /**
2
- * @module core/extensions/service-ownership
3
- *
4
- * Validates host-enforced ownership metadata for extension service overrides.
5
- */
6
- import type { ServiceOverrideOwnership } from "./extension-types.js";
7
- /** Validate one service ownership declaration and return its normalized pass-through flag. */
8
- export declare function normalizeServiceOverrideOwnership(ownership:ServiceOverrideOwnership):boolean;
@@ -1,2 +0,0 @@
1
- /** Explain one version-bound finding without changing package enablement or compatibility policy. */
2
- export declare function extensionVersionRemediation(warning:string):string | undefined;
@@ -1,7 +0,0 @@
1
- /**
2
- * Stage bytes beside the destination, then atomically link them into an absent
3
- * pathname. A competing creator wins without being overwritten. Hard-link
4
- * failures other than EEXIST propagate; no unsafe overwrite fallback is used.
5
- * Publication provides atomic visibility, not fsync-backed power-loss durability.
6
- */
7
- export declare function createFileAtomic(targetPath:string,contents:string):Promise<boolean>;
@@ -1,6 +0,0 @@
1
- /**
2
- * @module core/fs/index
3
- *
4
- * Provides filesystem helpers for Index.
5
- */
6
- export * from "./fs-utils.js";
@@ -1,2 +0,0 @@
1
- /** Implements check whether path within directory for the public runtime surface of this module. */
2
- export declare function isPathWithinDirectory(directory:string,targetPath:string):boolean;
@@ -1,4 +0,0 @@
1
- /** Remove the derived drift cache after a history mutation; a missing or concurrently removed cache is already invalidated. */
2
- export declare function invalidateHistoryDriftCache(pmRoot:string):Promise<void>;
3
- /** Resolve a conventional tracker root from a history stream path and invalidate its derived verification cache. */
4
- export declare function invalidateHistoryDriftCacheForPath(historyPath:string):Promise<void>;
@@ -1,51 +0,0 @@
1
- import { type HistoryIdentityDiscontinuity } from "./identity.js";
2
- import type { ItemMetadata } from "../../types/index.js";
3
- /** Documents the drift scan result payload exchanged by command, SDK, and package integrations. */
4
- export interface DriftScanResult {
5
- /** Repeated genesis ordinals and observed sequence, keyed by affected item. */
6
- identityDiscontinuities?:Array<HistoryIdentityDiscontinuity & {
7
- item_id:string;
8
- }>;
9
- /** Value that configures or reports missing streams for this contract. */
10
- missingStreams:string[];
11
- /** Value that configures or reports unreadable streams for this contract. */
12
- unreadableStreams:string[];
13
- /** Value that configures or reports hash mismatches for this contract. */
14
- hashMismatches:string[];
15
- /** Value that configures or reports chain mismatches for this contract. */
16
- chainMismatches:string[];
17
- /** Streams written with a hash capability newer than this runtime understands. */
18
- versionSkews:string[];
19
- /** Value that configures or reports drifted items for this contract. */
20
- driftedItems:string[];
21
- /** Governed singleton files whose JSON differs from workspace-history replay. */
22
- workspaceStateMismatches:string[];
23
- /** Governed singleton files absent from disk. */
24
- workspaceStateMissing:string[];
25
- /** Governed singleton files unreadable as safe workspace-local JSON. */
26
- workspaceStateUnreadable:string[];
27
- }
28
- /** Controls how cached history stream verification is trusted when the file stat tuple still matches a previous scan. */
29
- export type DriftCacheHitVerification = "content_hash" | "metadata";
30
- /** Documents the history drift scan options shared by health, validate, and repair callers. */
31
- export interface DriftScanOptions {
32
- /** Value that configures or reports cache hit verification for this contract. */
33
- cacheHitVerification?:DriftCacheHitVerification;
34
- }
35
- /** Strictly verify one item using the shared stream verifier without reading or writing the corpus cache or inspecting workspace histories and documents. */
36
- export declare function scanItemHistoryDrift(pmRoot:string,item:ItemMetadata & {
37
- body:string;
38
- }):Promise<DriftScanResult>;
39
- /**
40
- * Scan every item's history stream for drift (missing/unreadable streams, broken
41
- * hash chains, and item/history hash mismatches).
42
- *
43
- * Full chain re-verification of a large history tree is the dominant cost of
44
- * `pm health`. We cache the per-stream verification keyed by the history file's
45
- * mtime/ctime/size plus content hash. Strict callers keep recomputing the
46
- * content hash on metadata hits; latency-sensitive health checks can opt into
47
- * trusting the stat tuple and skip rereading unchanged streams.
48
- */
49
- export declare function scanHistoryDrift(pmRoot:string,items:Array<ItemMetadata & {
50
- body:string;
51
- }>,options?:DriftScanOptions):Promise<DriftScanResult>;
@@ -1,6 +0,0 @@
1
- /**
2
- * @module core/history/index
3
- *
4
- * Implements append-only history and replay behavior for Index.
5
- */
6
- export * from "./history.js";
@@ -1,3 +0,0 @@
1
- import { PmCliError } from "../shared/errors.js";
2
- /** Return a bounded recovery error only when verified history proves deletion. */
3
- export declare function buildDeletedItemError(pmRoot:string,rawId:string,idPrefix:string):Promise<PmCliError | undefined>;
@@ -1,13 +0,0 @@
1
- /**
2
- * @module core/history/version-address
3
- * Stable ordinal addressing for streams whose retained prefix is a checkpoint.
4
- */
5
- import type { HistoryEntry } from "../../types/index.js";
6
- /**
7
- * Return the number added to physical one-based positions to obtain durable
8
- * version addresses. Legacy checkpoints cannot prove their original ordinal;
9
- * refusing them prevents silently selecting a different historical state.
10
- */
11
- export declare function historyVersionOffset(history:readonly HistoryEntry[],allowUnknown:true):number | null;
12
- /** Resolve a required durable offset, refusing ambiguous legacy checkpoints. */
13
- export declare function historyVersionOffset(history:readonly HistoryEntry[],allowUnknown?:false):number;
@@ -1,9 +0,0 @@
1
- /**
2
- * @module core/item/index
3
- *
4
- * Defines item parsing, formatting, and lifecycle helpers for Index.
5
- */
6
- export * from "./id.js";
7
- export * from "./item-format.js";
8
- export * from "./parse.js";
9
- export * from "./type-registry.js";
@@ -1,51 +0,0 @@
1
- /**
2
- * @module core/item/item-type-definition
3
- *
4
- * Defines item parsing, formatting, and lifecycle helpers for Item Type Definition.
5
- */
6
- import type { ItemTypeCommandOptionPolicy,ItemTypeDefinition,ItemTypeOptionDefinition } from "../../types/index.js";
7
- /**
8
- * Shared, pure normalization for {@link ItemTypeDefinition} objects, single-sourced
9
- * across the runtime item-type registry and settings persistence (pm-v798).
10
- *
11
- * The only genuine difference between the two callers is how a command-option
12
- * policy's `command` field is resolved:
13
- * - the runtime registry consumes untrusted extension/file definitions, so it
14
- * must trim+lowercase and reject anything that is not "create"/"update";
15
- * - settings persistence operates on already-validated definitions, so it keeps
16
- * the typed `command` value verbatim.
17
- *
18
- * That single difference is injected via {@link NormalizeItemTypeDefinitionOptions.resolvePolicyCommand};
19
- * everything else (name trim, optional folder, aliases, required_create_* fields,
20
- * options normalization, policy dedupe key + stable sort) is shared.
21
- */
22
- /** Dedupe + sort a string list: trim, drop blanks, unique, locale-sorted. */
23
- export declare function normalizeItemTypeStringList(values:string[] | undefined):string[];
24
- /** Normalize one type-option definition, or null when its key is blank. */
25
- export declare function normalizeItemTypeOption(option:ItemTypeOptionDefinition):ItemTypeOptionDefinition | null;
26
- /** Resolves a raw policy `command` value to the canonical "create"/"update" type, or null to drop the policy. Lets each layer plug in its own strictness. */
27
- export type ResolvePolicyCommand = (command:string) => ItemTypeCommandOptionPolicy["command"] | null;
28
- /** Pass-through resolver used by settings persistence: the value is already typed "create" | "update" by the settings validator, so it is kept verbatim. */
29
- export declare const keepPolicyCommand:ResolvePolicyCommand;
30
- /** Strict resolver used by the runtime registry: trims + lowercases and rejects anything other than "create"/"update". */
31
- export declare const strictPolicyCommand:ResolvePolicyCommand;
32
- /** Normalize one command-option policy, or null when invalid (blank option / rejected command). */
33
- export declare function normalizeItemTypeCommandOptionPolicy(policy:ItemTypeCommandOptionPolicy,resolvePolicyCommand:ResolvePolicyCommand):ItemTypeCommandOptionPolicy | null;
34
- /** Dedupe by `${command}:${option-lowercased}` and stable-sort by command then option. */
35
- export declare function normalizeItemTypeCommandOptionPolicies(policies:ItemTypeCommandOptionPolicy[] | undefined,resolvePolicyCommand:ResolvePolicyCommand):ItemTypeCommandOptionPolicy[];
36
- /** Documents the normalize item type definition options payload exchanged by command, SDK, and package integrations. */
37
- export interface NormalizeItemTypeDefinitionOptions {
38
- /** How to resolve a raw policy `command` value (defaults to {@link keepPolicyCommand}). */
39
- resolvePolicyCommand?:ResolvePolicyCommand;
40
- }
41
- /** Validate an execution role before a settings or extension definition enters scheduling. Unknown values fail instead of silently enabling dispatch. */
42
- export declare function parseItemExecutionRole(value:unknown):ItemTypeDefinition["execution_role"];
43
- /**
44
- * Normalize a full {@link ItemTypeDefinition}, returning null when the name is blank.
45
- *
46
- * Optional collection fields (`folder`, `aliases`, `required_create_fields`,
47
- * `required_create_repeatables`, `options`, `command_option_policies`) are only
48
- * emitted when present on the input (presence-preserving) so the distinction
49
- * between "unset" and "set-but-empty" survives the round-trip.
50
- */
51
- export declare function normalizeItemTypeDefinition(definition:ItemTypeDefinition,options?:NormalizeItemTypeDefinitionOptions):ItemTypeDefinition | null;
@@ -1,25 +0,0 @@
1
- /** Public contract for toon scalar bracket escape upstream pr, shared by SDK and presentation-layer consumers. */
2
- export declare const TOON_SCALAR_BRACKET_ESCAPE_UPSTREAM_PR:"https://github.com/toon-format/toon/pull/314";
3
- /** Historical tracking for the scalar-bracket decoder defect fixed upstream in TOON 2.3.1. */
4
- export declare const TOON_SCALAR_BRACKET_ESCAPE_TRACKING:{
5
- readonly dependency:"@toon-format/toon";
6
- readonly affected_versions:"<=2.3.0";
7
- readonly resolved_version:"2.3.1";
8
- readonly upstream_pr:"https://github.com/toon-format/toon/pull/314";
9
- readonly workaround_status:"removed";
10
- };
11
- /** Documents the toon decode result payload exchanged by command, SDK, and package integrations. */
12
- export interface ToonDecodeResult {
13
- /** The decoded TOON document. */
14
- value:unknown;
15
- /** Always false since TOON 2.3.1 fixed strict scalar-bracket decoding upstream. */
16
- usedScalarBracketEscape:boolean;
17
- }
18
- /**
19
- * Decode a TOON item document with the dependency's strict parser.
20
- *
21
- * TOON 2.3.1 resolves the quoted scalar bracket defect previously handled by a
22
- * local retry. Keeping one strict decode path avoids masking malformed input and
23
- * records `usedScalarBracketEscape: false` for result-shape compatibility.
24
- */
25
- export declare function decodeToonItemContent(content:string):ToonDecodeResult;
@@ -1,6 +0,0 @@
1
- /**
2
- * @module core/lock/index
3
- *
4
- * Coordinates tracker lock ownership and cleanup for Index.
5
- */
6
- export * from "./lock.js";