@unbrained/pm-cli 2026.11.9 → 2026.11.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (589) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +16 -0
  3. package/dist/cli/error-guidance.js +4 -4
  4. package/dist/cli/main.js +1 -1
  5. package/dist/cli/public.d.ts +1 -1
  6. package/dist/cli/register-history-maintenance.js +2 -2
  7. package/dist/cli/register-setup.js +1 -1
  8. package/dist/cli-bundle/bundle-manifest.json +1 -1
  9. package/dist/cli-bundle/chunks/{chunk-G6Q4VQSI.js → chunk-4AASUCHO.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-EZRLW4R6.js → chunk-4FLAKTZW.js} +2 -2
  11. package/dist/cli-bundle/chunks/chunk-5CAMQHEW.js +3 -0
  12. package/dist/cli-bundle/chunks/{chunk-3BMIAI4P.js → chunk-7NAAW5EX.js} +2 -2
  13. package/dist/cli-bundle/chunks/chunk-BSJSGDA3.js +3 -0
  14. package/dist/cli-bundle/chunks/{chunk-XKY4LUXN.js → chunk-CZETQYKO.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-ASJZMYKM.js → chunk-D727C4RO.js} +3 -3
  16. package/dist/cli-bundle/chunks/{chunk-6V4PGJBZ.js → chunk-EHDGHFMJ.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-GZVOOHTO.js → chunk-F6FBGLR7.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-O2M3TNFY.js → chunk-F7P2NZEG.js} +5 -5
  19. package/dist/cli-bundle/chunks/{chunk-YK5GAWOT.js → chunk-FYD6LSJA.js} +2 -2
  20. package/dist/cli-bundle/chunks/chunk-L4WWG2H6.js +6 -0
  21. package/dist/cli-bundle/chunks/{chunk-YV5ALMG2.js → chunk-NNE63MSM.js} +2 -2
  22. package/dist/cli-bundle/chunks/{chunk-Z3QEEOAM.js → chunk-NZAFLDSH.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-MSJ7IHMJ.js → chunk-OJ2KEDUX.js} +2 -2
  24. package/dist/cli-bundle/chunks/{chunk-ELNWRSGZ.js → chunk-T2MNRM3S.js} +2 -2
  25. package/dist/cli-bundle/chunks/{chunk-VATZTJE3.js → chunk-TBBWPEF5.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-GDQ2T2OR.js → chunk-U7LILCUN.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-BLUCQ4T4.js → chunk-UFPLZ6LZ.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-JK7O7MFO.js → chunk-UL64P6MR.js} +3 -3
  29. package/dist/cli-bundle/chunks/{chunk-GCPP37N6.js → chunk-WNEUWDUE.js} +46 -46
  30. package/dist/cli-bundle/chunks/{chunk-5VRJPPUC.js → chunk-X7NM5HVQ.js} +2 -2
  31. package/dist/cli-bundle/chunks/{chunk-IGT252ES.js → chunk-YSWD2NXB.js} +2 -2
  32. package/dist/cli-bundle/chunks/{item-revision-Y5CE3EIN.js → item-revision-M7KXLQXF.js} +2 -2
  33. package/dist/cli-bundle/chunks/item-transaction-4N5P34GO.js +2 -0
  34. package/dist/cli-bundle/chunks/{mutation-admission-TAQN2AKK.js → mutation-admission-374UR7NI.js} +2 -2
  35. package/dist/cli-bundle/chunks/{register-list-query-XMQYFUFI.js → register-list-query-GSB7PP5P.js} +2 -2
  36. package/dist/cli-bundle/chunks/{register-mutation-OBVCFLDK.js → register-mutation-ZBF6ITYK.js} +2 -2
  37. package/dist/cli-bundle/chunks/{register-operations-CGNFZ6DR.js → register-operations-PWF6GOHE.js} +2 -2
  38. package/dist/cli-bundle/chunks/{register-setup-LFB5ERXH.js → register-setup-QDZ2Y3CI.js} +2 -2
  39. package/dist/cli-bundle/chunks/{stage-NQHF6JPC.js → stage-67WGPKPH.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-HNFY3XLC.js → chunk-2Y4H4LIX.js} +2 -2
  41. package/dist/cli-bundle/focused-chunks/{chunk-UIKLNSW3.js → chunk-3DWNH72D.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/chunk-3K2MYE7R.js +26 -0
  43. package/dist/cli-bundle/focused-chunks/{chunk-CUGJ2DY2.js → chunk-56MIAFEN.js} +3 -3
  44. package/dist/cli-bundle/focused-chunks/{chunk-Q45LDP7P.js → chunk-67M7E2Z3.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/{chunk-XLSTFUXM.js → chunk-BE2GK2G7.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-C3DO4ZGZ.js → chunk-HTMQDNVC.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-QWUWNFQO.js → chunk-LY3JXL25.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-IS5FLEZW.js → chunk-PAGW6A2X.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-4FWMXQN3.js → chunk-QCHCEFTO.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/{chunk-AH5IST3V.js → chunk-QHGGO7SY.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/chunk-QK7FX4O5.js +44 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-RNZUORGI.js → chunk-RFMKS7VD.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-MYBKRV5R.js → chunk-U7HWWEJ2.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/chunk-UIZVD36C.js +2 -0
  55. package/dist/cli-bundle/focused-chunks/{chunk-J7PWHKZK.js → chunk-WJHDUON5.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-LDMBNTOG.js → chunk-WK773UVA.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/chunk-ZBOCYFBE.js +82 -0
  58. package/dist/cli-bundle/focused-chunks/{item-revision-M6FOLME2.js → item-revision-XC4ZJ7MY.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{item-transaction-H6VA5JGB.js → item-transaction-CVGK4RJP.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{mutation-admission-PRTQWQK6.js → mutation-admission-N27D5H64.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/{stage-7T77PSJD.js → stage-KPK2UHVO.js} +2 -2
  62. package/dist/cli-bundle/main.js +26 -26
  63. package/dist/cli-bundle/sdk-authoring.js +1 -1
  64. package/dist/cli-bundle/sdk-contracts.js +1 -1
  65. package/dist/cli-bundle/sdk-core.js +1 -1
  66. package/dist/cli-bundle/sdk-governance.js +1 -1
  67. package/dist/cli-bundle/sdk-graph.js +1 -1
  68. package/dist/cli-bundle/sdk-merge.js +51 -51
  69. package/dist/cli-bundle/sdk-query.js +1 -1
  70. package/dist/cli-bundle/sdk-runtime.js +1 -1
  71. package/dist/cli-bundle/sdk-testing.js +1 -1
  72. package/dist/cli-bundle/sdk.js +1 -1
  73. package/dist/core/checkpoint/mutation-checkpoint.d.ts +12 -20
  74. package/dist/core/config/nested-settings.d.ts +14 -45
  75. package/dist/core/config/nested-settings.js +1 -1
  76. package/dist/core/config/positional-value.d.ts +11 -14
  77. package/dist/core/config/positional-value.js +1 -1
  78. package/dist/core/extensions/activation-summary-markdown.d.ts +4 -5
  79. package/dist/core/extensions/activation-summary.d.ts +7 -15
  80. package/dist/core/extensions/capability-usage.d.ts +7 -23
  81. package/dist/core/extensions/command-hook-context.d.ts +4 -7
  82. package/dist/core/extensions/command-metadata-contract.d.ts +2 -2
  83. package/dist/core/extensions/contribution-inventory.d.ts +3 -25
  84. package/dist/core/extensions/extension-capability-aliases.d.ts +7 -10
  85. package/dist/core/extensions/extension-hook-runtime.d.ts +2 -2
  86. package/dist/core/extensions/extension-policy.d.ts +12 -47
  87. package/dist/core/extensions/extension-registries.d.ts +2 -2
  88. package/dist/core/extensions/extension-types.d.ts +332 -545
  89. package/dist/core/extensions/flag-definition-validation.d.ts +11 -13
  90. package/dist/core/extensions/flag-value-types.d.ts +11 -13
  91. package/dist/core/extensions/index.d.ts +15 -20
  92. package/dist/core/extensions/item-field-types.d.ts +5 -5
  93. package/dist/core/extensions/item-fields.d.ts +4 -7
  94. package/dist/core/extensions/loader.d.ts +5 -69
  95. package/dist/core/extensions/manifest-parser.d.ts +3 -3
  96. package/dist/core/extensions/manifest-schema.d.ts +10 -13
  97. package/dist/core/extensions/registration-contracts.d.ts +2 -4
  98. package/dist/core/extensions/registration-validation.d.ts +1 -1
  99. package/dist/core/extensions/registration-values.d.ts +5 -7
  100. package/dist/core/extensions/runtime-registrations.d.ts +6 -6
  101. package/dist/core/extensions/version-compat.d.ts +9 -10
  102. package/dist/core/fs/fs-utils.d.ts +4 -6
  103. package/dist/core/fs/host-environment-errors.d.ts +8 -10
  104. package/dist/core/governance/content-fields.d.ts +10 -14
  105. package/dist/core/governance/issue-codes.d.ts +12 -18
  106. package/dist/core/governance/metadata-coverage.d.ts +24 -34
  107. package/dist/core/history/digest.d.ts +3 -3
  108. package/dist/core/history/event-classification.d.ts +5 -5
  109. package/dist/core/history/event-index.d.ts +14 -35
  110. package/dist/core/history/history-compact-bulk.d.ts +10 -13
  111. package/dist/core/history/history-diff.d.ts +6 -11
  112. package/dist/core/history/history-rewrite.d.ts +24 -40
  113. package/dist/core/history/history-storage-stats.d.ts +9 -17
  114. package/dist/core/history/history-stream-policy.d.ts +8 -11
  115. package/dist/core/history/history.d.ts +10 -44
  116. package/dist/core/history/identity.d.ts +4 -5
  117. package/dist/core/history/operation-contract.d.ts +5 -15
  118. package/dist/core/history/projection.d.ts +10 -14
  119. package/dist/core/history/read.d.ts +6 -7
  120. package/dist/core/history/replay.d.ts +16 -37
  121. package/dist/core/history/workspace-history.d.ts +27 -60
  122. package/dist/core/io/body-file.d.ts +2 -2
  123. package/dist/core/io/bulk-ids-input.d.ts +7 -8
  124. package/dist/core/item/actionability.d.ts +16 -22
  125. package/dist/core/item/dependency-reference.d.ts +2 -2
  126. package/dist/core/item/id.d.ts +5 -9
  127. package/dist/core/item/item-format-version.d.ts +11 -13
  128. package/dist/core/item/item-format.d.ts +11 -59
  129. package/dist/core/item/item-record.d.ts +2 -2
  130. package/dist/core/item/literal-mutation-input.d.ts +2 -2
  131. package/dist/core/item/parent-reference-policy.d.ts +4 -7
  132. package/dist/core/item/parse.d.ts +10 -26
  133. package/dist/core/item/plan-lifecycle.d.ts +3 -3
  134. package/dist/core/item/priority.d.ts +2 -2
  135. package/dist/core/item/sprint-release-format.d.ts +3 -7
  136. package/dist/core/item/status-filter.d.ts +5 -7
  137. package/dist/core/item/status.d.ts +3 -4
  138. package/dist/core/item/type-registry.d.ts +17 -24
  139. package/dist/core/item/type-synonyms.d.ts +1 -1
  140. package/dist/core/lock/lock-owner.d.ts +8 -10
  141. package/dist/core/lock/lock.d.ts +19 -67
  142. package/dist/core/output/output-control.d.ts +5 -6
  143. package/dist/core/output/output.d.ts +10 -19
  144. package/dist/core/output/tabular.d.ts +2 -2
  145. package/dist/core/packages/manifest.d.ts +13 -17
  146. package/dist/core/packages/root.d.ts +3 -3
  147. package/dist/core/policy/workflow-policy-schema.d.ts +2 -310
  148. package/dist/core/policy/workflow-policy-store.d.ts +5 -14
  149. package/dist/core/policy/workflow-policy.d.ts +25 -52
  150. package/dist/core/profile/profile-describe.d.ts +8 -11
  151. package/dist/core/profile/profile-lint.d.ts +11 -13
  152. package/dist/core/profile/profile-plan.d.ts +30 -49
  153. package/dist/core/profile/profile-presets.d.ts +25 -36
  154. package/dist/core/reproducibility/context.d.ts +6 -7
  155. package/dist/core/schema/fields-file.d.ts +14 -21
  156. package/dist/core/schema/item-types-file.d.ts +16 -22
  157. package/dist/core/schema/runtime-field-filters.d.ts +2 -2
  158. package/dist/core/schema/runtime-field-values.d.ts +6 -13
  159. package/dist/core/schema/runtime-schema.d.ts +19 -31
  160. package/dist/core/schema/status-defs-file.d.ts +15 -25
  161. package/dist/core/schema/status-token.d.ts +1 -1
  162. package/dist/core/schema/type-inference.d.ts +6 -8
  163. package/dist/core/schema/type-presets.d.ts +5 -5
  164. package/dist/core/schema/type-workflows.d.ts +11 -16
  165. package/dist/core/search/background-refresh.d.ts +6 -12
  166. package/dist/core/search/bm25.d.ts +11 -19
  167. package/dist/core/search/cache.d.ts +19 -41
  168. package/dist/core/search/corpus.d.ts +16 -19
  169. package/dist/core/search/embedding-batches.d.ts +12 -17
  170. package/dist/core/search/eval-thresholds.d.ts +3 -3
  171. package/dist/core/search/eval.d.ts +16 -34
  172. package/dist/core/search/http-client.d.ts +14 -18
  173. package/dist/core/search/providers.d.ts +22 -39
  174. package/dist/core/search/relevance.d.ts +14 -19
  175. package/dist/core/search/semantic-defaults.d.ts +4 -5
  176. package/dist/core/search/vector-stores.d.ts +35 -57
  177. package/dist/core/search/vectorization-metadata.d.ts +9 -11
  178. package/dist/core/sentry/helpers.d.ts +6 -31
  179. package/dist/core/sentry/instrument.d.ts +6 -59
  180. package/dist/core/session/session-state.d.ts +12 -32
  181. package/dist/core/shared/agent-session-context.d.ts +10 -17
  182. package/dist/core/shared/author.d.ts +48 -69
  183. package/dist/core/shared/command-line.d.ts +3 -3
  184. package/dist/core/shared/command-types.d.ts +3 -4
  185. package/dist/core/shared/constants.d.ts +14 -32
  186. package/dist/core/shared/error-details.d.ts +5 -18
  187. package/dist/core/shared/errors.d.ts +42 -83
  188. package/dist/core/shared/html-entity-decode.d.ts +1 -1
  189. package/dist/core/shared/item-metadata-contract.d.ts +2 -2
  190. package/dist/core/shared/lazy-module.d.ts +1 -1
  191. package/dist/core/shared/levenshtein.d.ts +1 -1
  192. package/dist/core/shared/numeric-parsers.d.ts +1 -1
  193. package/dist/core/shared/option-alias-visibility.d.ts +2 -2
  194. package/dist/core/shared/output-unicode.d.ts +1 -1
  195. package/dist/core/shared/primitives.d.ts +10 -10
  196. package/dist/core/shared/secret-rules.d.ts +7 -93
  197. package/dist/core/shared/serial-queue.d.ts +7 -9
  198. package/dist/core/shared/serialization.d.ts +1 -1
  199. package/dist/core/shared/split-comma-list.d.ts +4 -5
  200. package/dist/core/shared/text-normalization.d.ts +1 -1
  201. package/dist/core/shared/time.d.ts +6 -20
  202. package/dist/core/store/item-format-migration.d.ts +4 -5
  203. package/dist/core/store/item-metadata-cache.d.ts +22 -27
  204. package/dist/core/store/item-metadata-query-index.d.ts +20 -61
  205. package/dist/core/store/item-metadata-read-work.d.ts +3 -7
  206. package/dist/core/store/item-mutation-precondition.d.ts +19 -35
  207. package/dist/core/store/item-store.d.ts +18 -141
  208. package/dist/core/store/paths.d.ts +5 -10
  209. package/dist/core/store/settings-read-cache.d.ts +7 -9
  210. package/dist/core/store/settings-sections.d.ts +15 -19
  211. package/dist/core/store/settings-validator.d.ts +27 -143
  212. package/dist/core/store/settings-validator.js +1 -1
  213. package/dist/core/store/settings.d.ts +19 -94
  214. package/dist/core/store/sqlite-runtime.d.ts +3 -3
  215. package/dist/core/store/tracker-preflight.d.ts +2 -2
  216. package/dist/core/telemetry/consent.d.ts +2 -2
  217. package/dist/core/telemetry/observability.d.ts +8 -19
  218. package/dist/core/telemetry/policy.d.ts +8 -23
  219. package/dist/core/telemetry/runtime.d.ts +44 -254
  220. package/dist/core/test/background-runs.d.ts +35 -79
  221. package/dist/core/test/run-selectors.d.ts +10 -12
  222. package/dist/core/validate/fix-planning.d.ts +19 -28
  223. package/dist/core/validate/missing-by-type.d.ts +3 -4
  224. package/dist/core/validate/missing-link-owners.d.ts +12 -16
  225. package/dist/core/validate/stale-file-classification.d.ts +5 -6
  226. package/dist/mcp/tool-definitions.d.ts +7 -30
  227. package/dist/sdk/actionability.d.ts +1 -1
  228. package/dist/sdk/agent/closed-domain-contracts.d.ts +4 -5
  229. package/dist/sdk/agent/command-recovery.d.ts +9 -13
  230. package/dist/sdk/agent/command-suggestions.d.ts +2 -2
  231. package/dist/sdk/agent/create-option-policy.d.ts +2 -2
  232. package/dist/sdk/agent/identity-config.d.ts +13 -18
  233. package/dist/sdk/agent/item-addressing.d.ts +4 -5
  234. package/dist/sdk/agent/linked-resource-recovery.d.ts +3 -4
  235. package/dist/sdk/agent/refusal-closure-census.d.ts +13 -25
  236. package/dist/sdk/agent/refusal-closure.d.ts +8 -11
  237. package/dist/sdk/agent/refusal-corpus-contracts.d.ts +15 -21
  238. package/dist/sdk/agent/refusal-reachability.d.ts +38 -52
  239. package/dist/sdk/agent/subcommand-recovery.d.ts +7 -15
  240. package/dist/sdk/agent/task-transcript-contracts.d.ts +12 -15
  241. package/dist/sdk/agent/tracker-preflight-contracts.d.ts +13 -17
  242. package/dist/sdk/agent-capability-contracts.d.ts +19 -32
  243. package/dist/sdk/agent-session-context.d.ts +1 -1
  244. package/dist/sdk/annotations.d.ts +32 -68
  245. package/dist/sdk/author-attribution.d.ts +22 -33
  246. package/dist/sdk/authoring.d.ts +1 -19
  247. package/dist/sdk/cli-bootstrap.d.ts +22 -59
  248. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +31 -57
  249. package/dist/sdk/cli-contracts/command-aliases.d.ts +7 -8
  250. package/dist/sdk/cli-contracts/command-exit-contracts.d.ts +19 -65
  251. package/dist/sdk/cli-contracts/commander-mutation-options.d.ts +2 -2
  252. package/dist/sdk/cli-contracts/commander-types.d.ts +6 -11
  253. package/dist/sdk/cli-contracts/completeness.d.ts +11 -15
  254. package/dist/sdk/cli-contracts/enum-contracts.d.ts +25 -37
  255. package/dist/sdk/cli-contracts/flag-contracts.d.ts +16 -20
  256. package/dist/sdk/cli-contracts/flag-lexicon-contracts.d.ts +14 -19
  257. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +29 -47
  258. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +44 -265
  259. package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +11 -564
  260. package/dist/sdk/cli-contracts/tool-schema.d.ts +18 -51
  261. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +18 -37
  262. package/dist/sdk/cli-contracts.d.ts +1 -16
  263. package/dist/sdk/cli-program.d.ts +2 -2
  264. package/dist/sdk/command-line.d.ts +3 -4
  265. package/dist/sdk/comments.d.ts +6 -10
  266. package/dist/sdk/compile-cache.d.ts +4 -5
  267. package/dist/sdk/completion/bash.d.ts +2 -2
  268. package/dist/sdk/completion/fish.d.ts +2 -2
  269. package/dist/sdk/completion/shared.d.ts +10 -77
  270. package/dist/sdk/completion/shared.js +1 -1
  271. package/dist/sdk/completion/zsh.d.ts +2 -2
  272. package/dist/sdk/completion.d.ts +2 -6
  273. package/dist/sdk/compose.d.ts +49 -74
  274. package/dist/sdk/config.d.ts +18 -94
  275. package/dist/sdk/config.js +1 -1
  276. package/dist/sdk/context/recency.d.ts +2 -2
  277. package/dist/sdk/context/semantic-session-attribution.d.ts +6 -25
  278. package/dist/sdk/context/usage-ledger.d.ts +9 -21
  279. package/dist/sdk/context-intent-contracts.d.ts +24 -35
  280. package/dist/sdk/context-intent-runtime.d.ts +7 -9
  281. package/dist/sdk/context-packing.d.ts +16 -34
  282. package/dist/sdk/context-relevance.d.ts +58 -93
  283. package/dist/sdk/context-signal-store.d.ts +29 -60
  284. package/dist/sdk/context-usage.d.ts +22 -69
  285. package/dist/sdk/contracts.d.ts +1 -24
  286. package/dist/sdk/core-governance.d.ts +1 -5
  287. package/dist/sdk/core.d.ts +1 -27
  288. package/dist/sdk/corpus-shape.d.ts +16 -28
  289. package/dist/sdk/define.d.ts +10 -14
  290. package/dist/sdk/dependencies.d.ts +32 -50
  291. package/dist/sdk/dependency-provenance.d.ts +19 -23
  292. package/dist/sdk/docs.d.ts +6 -10
  293. package/dist/sdk/duplicates.d.ts +8 -15
  294. package/dist/sdk/environment/agent-environment.d.ts +60 -101
  295. package/dist/sdk/environment/host-environment-errors.d.ts +1 -1
  296. package/dist/sdk/environment/project-runtime-compatibility.d.ts +15 -29
  297. package/dist/sdk/environment/source-context.d.ts +6 -7
  298. package/dist/sdk/environment/tracker-preflight.d.ts +1 -1
  299. package/dist/sdk/error-code-catalog.d.ts +9 -26
  300. package/dist/sdk/error-runtime.d.ts +6 -8
  301. package/dist/sdk/errors.d.ts +10 -17
  302. package/dist/sdk/eval.d.ts +11 -21
  303. package/dist/sdk/extension/command-options.d.ts +14 -26
  304. package/dist/sdk/extension/describe.d.ts +14 -19
  305. package/dist/sdk/extension/doctor.d.ts +8 -48
  306. package/dist/sdk/extension/install-plan.d.ts +12 -26
  307. package/dist/sdk/extension/install-runtime.d.ts +10 -11
  308. package/dist/sdk/extension/install-sources.d.ts +22 -104
  309. package/dist/sdk/extension/managed-state.d.ts +13 -18
  310. package/dist/sdk/extension/migrations.d.ts +22 -37
  311. package/dist/sdk/extension/output-ownership.d.ts +3 -30
  312. package/dist/sdk/extension/shared.d.ts +9 -15
  313. package/dist/sdk/extension/source-resolution.d.ts +13 -18
  314. package/dist/sdk/extension/static-inventory.d.ts +17 -21
  315. package/dist/sdk/extension/update-check.d.ts +7 -11
  316. package/dist/sdk/extension-command-context.d.ts +2 -3
  317. package/dist/sdk/extension-contracts.d.ts +11 -14
  318. package/dist/sdk/extension.d.ts +31 -192
  319. package/dist/sdk/files.d.ts +27 -68
  320. package/dist/sdk/flag-invocation-contracts.d.ts +13 -17
  321. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  322. package/dist/sdk/generated-error-code-catalog.d.ts +1 -1
  323. package/dist/sdk/governance/artifact-ledgers.d.ts +9 -16
  324. package/dist/sdk/governance/assurance-action-contracts.d.ts +1 -1
  325. package/dist/sdk/governance/assurance-action.d.ts +13 -45
  326. package/dist/sdk/governance/assurance-mutation-error.d.ts +12 -17
  327. package/dist/sdk/governance/assurance-presets.d.ts +10 -21
  328. package/dist/sdk/governance/assurance-runtime.d.ts +5 -6
  329. package/dist/sdk/governance/assurance.d.ts +97 -154
  330. package/dist/sdk/governance/boundary-fixtures.d.ts +17 -23
  331. package/dist/sdk/governance/closure-timestamps.d.ts +5 -15
  332. package/dist/sdk/governance/coverage-assurance.d.ts +5 -6
  333. package/dist/sdk/governance/defect-recurrence-coverage.d.ts +13 -23
  334. package/dist/sdk/governance/defect-recurrence-graph.d.ts +9 -13
  335. package/dist/sdk/governance/defect-recurrence.d.ts +43 -67
  336. package/dist/sdk/governance/extension-host-version.d.ts +8 -10
  337. package/dist/sdk/governance/gc.d.ts +12 -20
  338. package/dist/sdk/governance/health/projection.d.ts +8 -23
  339. package/dist/sdk/governance/health.d.ts +23 -167
  340. package/dist/sdk/governance/hierarchy-validation.d.ts +2 -18
  341. package/dist/sdk/governance/linked-file-report.d.ts +6 -10
  342. package/dist/sdk/governance/merge-receipt-history.d.ts +12 -16
  343. package/dist/sdk/governance/provenance-health.d.ts +17 -23
  344. package/dist/sdk/governance/reindex.d.ts +13 -116
  345. package/dist/sdk/governance/reliability.d.ts +13 -17
  346. package/dist/sdk/governance/stale-work.d.ts +8 -11
  347. package/dist/sdk/governance/status-role-diagnostics.d.ts +4 -6
  348. package/dist/sdk/governance/storage-integrity.d.ts +16 -23
  349. package/dist/sdk/governance/upgrade.d.ts +17 -57
  350. package/dist/sdk/governance/validate-item-reader.d.ts +3 -11
  351. package/dist/sdk/governance/validate-normalization.d.ts +2 -2
  352. package/dist/sdk/governance/validate.d.ts +29 -175
  353. package/dist/sdk/governance/workflow-completeness.d.ts +5 -17
  354. package/dist/sdk/governance/workflow-policy.d.ts +8 -16
  355. package/dist/sdk/governance/workspace-position.d.ts +12 -43
  356. package/dist/sdk/governance.d.ts +1 -39
  357. package/dist/sdk/graph/adapter.d.ts +23 -41
  358. package/dist/sdk/graph/analytics.d.ts +20 -31
  359. package/dist/sdk/graph/assembly.d.ts +24 -35
  360. package/dist/sdk/graph/cache.d.ts +13 -25
  361. package/dist/sdk/graph/cardinality-integrity.d.ts +4 -6
  362. package/dist/sdk/graph/centrality.d.ts +14 -20
  363. package/dist/sdk/graph/conformance.d.ts +12 -19
  364. package/dist/sdk/graph/deadline-scheduling.d.ts +14 -20
  365. package/dist/sdk/graph/durable-cache.d.ts +11 -14
  366. package/dist/sdk/graph/governance-contracts.d.ts +2 -2
  367. package/dist/sdk/graph/governance.d.ts +22 -36
  368. package/dist/sdk/graph/hierarchy-integrity.d.ts +18 -26
  369. package/dist/sdk/graph/index.d.ts +1 -17
  370. package/dist/sdk/graph/lifecycle-coverage.d.ts +8 -12
  371. package/dist/sdk/graph/mutation-advisory.d.ts +5 -16
  372. package/dist/sdk/graph/query-contracts.d.ts +1 -2
  373. package/dist/sdk/graph/remediation.d.ts +11 -18
  374. package/dist/sdk/graph/run.d.ts +73 -115
  375. package/dist/sdk/graph/scheduling.d.ts +8 -15
  376. package/dist/sdk/graph/traversal.d.ts +9 -15
  377. package/dist/sdk/graph/workspace-relationship-kind-registry.d.ts +2 -2
  378. package/dist/sdk/graph.d.ts +1 -12
  379. package/dist/sdk/guide-topics.d.ts +7 -10
  380. package/dist/sdk/guide.d.ts +21 -43
  381. package/dist/sdk/history/attestation-command.d.ts +7 -10
  382. package/dist/sdk/history/attestation-contract.d.ts +19 -34
  383. package/dist/sdk/history/attestation.d.ts +2 -3
  384. package/dist/sdk/history/maintenance.d.ts +17 -27
  385. package/dist/sdk/history/salvage.d.ts +5 -22
  386. package/dist/sdk/history/subject.d.ts +5 -11
  387. package/dist/sdk/history-analytics.d.ts +28 -59
  388. package/dist/sdk/history-compact.d.ts +25 -66
  389. package/dist/sdk/history-provenance.d.ts +16 -33
  390. package/dist/sdk/history-read.d.ts +9 -16
  391. package/dist/sdk/history-redact.d.ts +19 -74
  392. package/dist/sdk/history-redact.js +1 -1
  393. package/dist/sdk/history-repair.d.ts +26 -71
  394. package/dist/sdk/improvement-ledger-validation.d.ts +2 -2
  395. package/dist/sdk/improvement-ledger.d.ts +20 -39
  396. package/dist/sdk/index.d.ts +1 -268
  397. package/dist/sdk/init-agent-guidance.d.ts +13 -68
  398. package/dist/sdk/init.d.ts +24 -94
  399. package/dist/sdk/invocation-author.d.ts +1 -1
  400. package/dist/sdk/item-children.d.ts +10 -13
  401. package/dist/sdk/item-metadata-index.d.ts +1 -2
  402. package/dist/sdk/item-schedule.d.ts +8 -9
  403. package/dist/sdk/item-transaction.d.ts +46 -90
  404. package/dist/sdk/learnings.d.ts +6 -10
  405. package/dist/sdk/lifecycle/append.d.ts +7 -9
  406. package/dist/sdk/lifecycle/claim.d.ts +26 -42
  407. package/dist/sdk/lifecycle/cli-input.d.ts +1 -1
  408. package/dist/sdk/lifecycle/close-many.d.ts +14 -65
  409. package/dist/sdk/lifecycle/close.d.ts +10 -26
  410. package/dist/sdk/lifecycle/copy.d.ts +6 -10
  411. package/dist/sdk/lifecycle/create.d.ts +15 -83
  412. package/dist/sdk/lifecycle/delete.d.ts +7 -9
  413. package/dist/sdk/lifecycle/focus.d.ts +9 -11
  414. package/dist/sdk/lifecycle/item-revision.d.ts +25 -45
  415. package/dist/sdk/lifecycle/lifecycle-transitions.d.ts +4 -5
  416. package/dist/sdk/lifecycle/mutation-command-options.d.ts +6 -9
  417. package/dist/sdk/lifecycle/plan-mutation-receipt.d.ts +5 -13
  418. package/dist/sdk/lifecycle/plan.d.ts +34 -74
  419. package/dist/sdk/lifecycle/reopen.d.ts +8 -14
  420. package/dist/sdk/lifecycle/restore.d.ts +9 -38
  421. package/dist/sdk/lifecycle/shared-unset-fields.d.ts +23 -614
  422. package/dist/sdk/lifecycle/start-blockers.d.ts +7 -27
  423. package/dist/sdk/lifecycle/structured-mutation-plan.d.ts +8 -16
  424. package/dist/sdk/lifecycle/task-composition.d.ts +6 -14
  425. package/dist/sdk/lifecycle/update-many.d.ts +15 -65
  426. package/dist/sdk/lifecycle/update.d.ts +21 -104
  427. package/dist/sdk/lifecycle/workflow-transition.d.ts +2 -11
  428. package/dist/sdk/lifecycle-completion.d.ts +11 -14
  429. package/dist/sdk/lifecycle-policy.d.ts +23 -32
  430. package/dist/sdk/linked-artifacts.d.ts +31 -41
  431. package/dist/sdk/mcp/apps.d.ts +12 -27
  432. package/dist/sdk/mcp/authorization.d.ts +30 -63
  433. package/dist/sdk/mcp/discovery.d.ts +23 -52
  434. package/dist/sdk/mcp/executable.d.ts +3 -10
  435. package/dist/sdk/mcp/interactions.d.ts +25 -47
  436. package/dist/sdk/mcp/protocol.d.ts +32 -64
  437. package/dist/sdk/mcp/skills.d.ts +21 -71
  438. package/dist/sdk/mcp/subscriptions.d.ts +14 -28
  439. package/dist/sdk/mcp/tasks.d.ts +21 -55
  440. package/dist/sdk/mcp/transport.d.ts +7 -15
  441. package/dist/sdk/merge/driver.d.ts +13 -37
  442. package/dist/sdk/merge/index.d.ts +1 -6
  443. package/dist/sdk/merge/install.d.ts +27 -55
  444. package/dist/sdk/merge/receipt-operation.d.ts +5 -6
  445. package/dist/sdk/merge/receipt-schema.d.ts +6 -9
  446. package/dist/sdk/merge/receipts.d.ts +29 -79
  447. package/dist/sdk/merge/reconcile.d.ts +9 -18
  448. package/dist/sdk/merge/three-way.d.ts +21 -30
  449. package/dist/sdk/merge.d.ts +1 -5
  450. package/dist/sdk/mutation-events.d.ts +21 -53
  451. package/dist/sdk/mutation-guard.d.ts +15 -135
  452. package/dist/sdk/notes.d.ts +6 -10
  453. package/dist/sdk/output/fit-envelope.d.ts +21 -28
  454. package/dist/sdk/output/list-envelope.d.ts +1 -1
  455. package/dist/sdk/output/table-rows.d.ts +8 -12
  456. package/dist/sdk/output-contracts.d.ts +11 -14
  457. package/dist/sdk/output-projection.d.ts +18 -130
  458. package/dist/sdk/output-token-accounting.d.ts +8 -15
  459. package/dist/sdk/output.d.ts +10 -15
  460. package/dist/sdk/ownership-source.d.ts +4 -5
  461. package/dist/sdk/package-import-adapters.d.ts +27 -37
  462. package/dist/sdk/package-migrations.d.ts +2 -2
  463. package/dist/sdk/package-runtime-options.d.ts +3 -3
  464. package/dist/sdk/pagination.d.ts +12 -24
  465. package/dist/sdk/profile.d.ts +25 -42
  466. package/dist/sdk/provenance.d.ts +21 -32
  467. package/dist/sdk/query/activity.d.ts +24 -77
  468. package/dist/sdk/query/aggregate.d.ts +20 -95
  469. package/dist/sdk/query/calendar.d.ts +26 -74
  470. package/dist/sdk/query/complete-list.d.ts +19 -35
  471. package/dist/sdk/query/context.d.ts +69 -240
  472. package/dist/sdk/query/declared-blockers.d.ts +2 -9
  473. package/dist/sdk/query/duplicate-candidates.d.ts +3 -5
  474. package/dist/sdk/query/get.d.ts +13 -55
  475. package/dist/sdk/query/history.d.ts +18 -29
  476. package/dist/sdk/query/item-filter-options.d.ts +7 -12
  477. package/dist/sdk/query/list-filter-shared.d.ts +4 -8
  478. package/dist/sdk/query/list.d.ts +44 -168
  479. package/dist/sdk/query/multi-value-filters.d.ts +7 -9
  480. package/dist/sdk/query/next-ranking-policy.d.ts +4 -10
  481. package/dist/sdk/query/next-ready-budget.d.ts +4 -5
  482. package/dist/sdk/query/next.d.ts +27 -86
  483. package/dist/sdk/query/parsers.d.ts +4 -6
  484. package/dist/sdk/query/projection-contracts.d.ts +12 -21
  485. package/dist/sdk/query/search/corpus.d.ts +5 -20
  486. package/dist/sdk/query/search/filters.d.ts +5 -17
  487. package/dist/sdk/query/search/input.d.ts +4 -9
  488. package/dist/sdk/query/search/lexical.d.ts +5 -9
  489. package/dist/sdk/query/search/response.d.ts +5 -22
  490. package/dist/sdk/query/search/semantic.d.ts +24 -170
  491. package/dist/sdk/query/search/types.d.ts +19 -73
  492. package/dist/sdk/query/search-contracts.d.ts +24 -34
  493. package/dist/sdk/query/search-pagination.d.ts +5 -24
  494. package/dist/sdk/query/search-rendering.d.ts +8 -32
  495. package/dist/sdk/query/search.d.ts +3 -63
  496. package/dist/sdk/query/workspace-contracts.d.ts +2 -2
  497. package/dist/sdk/query.d.ts +1 -43
  498. package/dist/sdk/read-output/continuation.d.ts +5 -6
  499. package/dist/sdk/read-output/options.d.ts +3 -8
  500. package/dist/sdk/read-output/session-result.d.ts +2 -33
  501. package/dist/sdk/read-output/tail-retention.d.ts +6 -8
  502. package/dist/sdk/read-output-budget.d.ts +14 -16
  503. package/dist/sdk/read-output-contracts.d.ts +59 -103
  504. package/dist/sdk/read-output-rows.d.ts +5 -9
  505. package/dist/sdk/read-output-session.d.ts +11 -14
  506. package/dist/sdk/relationship-analytics.d.ts +17 -37
  507. package/dist/sdk/relationship-context.d.ts +15 -33
  508. package/dist/sdk/relationship-history.d.ts +29 -50
  509. package/dist/sdk/relationship-kinds/contract.d.ts +11 -12
  510. package/dist/sdk/relationship-migration.d.ts +6 -10
  511. package/dist/sdk/relationships.d.ts +22 -34
  512. package/dist/sdk/reproducibility/process.d.ts +7 -11
  513. package/dist/sdk/runtime/context.d.ts +6 -22
  514. package/dist/sdk/runtime/schema-preview.d.ts +1 -1
  515. package/dist/sdk/runtime-input.d.ts +9 -20
  516. package/dist/sdk/runtime-primitives.d.ts +3 -82
  517. package/dist/sdk/runtime-public-contracts.d.ts +30 -50
  518. package/dist/sdk/runtime.d.ts +77 -302
  519. package/dist/sdk/scheduling-shortcuts.d.ts +8 -12
  520. package/dist/sdk/schema-migration.d.ts +18 -80
  521. package/dist/sdk/schema.d.ts +89 -192
  522. package/dist/sdk/search-refresh-worker.d.ts +1 -1
  523. package/dist/sdk/similarity-scoring.d.ts +6 -8
  524. package/dist/sdk/similarity.d.ts +33 -64
  525. package/dist/sdk/start-task-status.d.ts +2 -2
  526. package/dist/sdk/stats.d.ts +13 -48
  527. package/dist/sdk/structured-mutations.d.ts +18 -26
  528. package/dist/sdk/telemetry-flush.d.ts +1 -1
  529. package/dist/sdk/telemetry.d.ts +14 -20
  530. package/dist/sdk/templates.d.ts +14 -35
  531. package/dist/sdk/test/batch.d.ts +10 -25
  532. package/dist/sdk/test/execution.d.ts +44 -209
  533. package/dist/sdk/test/json-path.d.ts +2 -5
  534. package/dist/sdk/test/linked-command-detection.d.ts +10 -25
  535. package/dist/sdk/test/measurements.d.ts +10 -13
  536. package/dist/sdk/test/parsers.d.ts +16 -20
  537. package/dist/sdk/test/prerequisites.d.ts +2 -3
  538. package/dist/sdk/test/runs.d.ts +19 -52
  539. package/dist/sdk/test/trust.d.ts +8 -12
  540. package/dist/sdk/test/update.d.ts +9 -25
  541. package/dist/sdk/testing.d.ts +97 -206
  542. package/dist/sdk/traceability/source-traceability.d.ts +25 -56
  543. package/dist/sdk/tracker-root-discovery.d.ts +1 -1
  544. package/dist/sdk/workspace-contracts-cache.d.ts +2 -2
  545. package/dist/sdk/workspace-contracts.d.ts +8 -14
  546. package/dist/sdk/workspace-memory.d.ts +24 -42
  547. package/dist/sdk/workspace-recipe.d.ts +10 -14
  548. package/dist/sdk/workspace-snapshot.d.ts +26 -53
  549. package/dist/sdk/workspace-transaction-gc.d.ts +12 -16
  550. package/dist/sdk/workspace-transaction.d.ts +26 -40
  551. package/dist/sdk/workspace.d.ts +8 -10
  552. package/dist/types/index.d.ts +1 -1
  553. package/dist/types.d.ts +210 -353
  554. package/docs/COMMANDS.md +8 -0
  555. package/docs/CONFIGURATION.md +17 -0
  556. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +28 -9
  557. package/docs/RELEASING.md +25 -0
  558. package/docs/SDK.md +17 -2
  559. package/docs/TESTING.md +11 -0
  560. package/marketplace.json +1 -1
  561. package/package.json +1 -1
  562. package/packages/pm-beads/package.json +1 -1
  563. package/packages/pm-calendar/package.json +1 -1
  564. package/packages/pm-command-kit/package.json +1 -1
  565. package/packages/pm-digital-twin/package.json +1 -1
  566. package/packages/pm-governance-audit/package.json +1 -1
  567. package/packages/pm-guide-shell/package.json +1 -1
  568. package/packages/pm-kanban/package.json +1 -1
  569. package/packages/pm-lifecycle-hooks/package.json +1 -1
  570. package/packages/pm-linked-test-adapters/package.json +1 -1
  571. package/packages/pm-search-advanced/package.json +1 -1
  572. package/packages/pm-templates/package.json +1 -1
  573. package/packages/pm-todos/package.json +1 -1
  574. package/packages/pm-vcs/package.json +1 -1
  575. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  576. package/plugins/pm-claude/package.json +1 -1
  577. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  578. package/plugins/pm-codex/package.json +1 -1
  579. package/plugins/pm-codex/plugin.json +1 -1
  580. package/runtime-dependencies.json +1 -1
  581. package/scripts/finalize-build.mjs +41 -4
  582. package/dist/cli-bundle/chunks/chunk-JYQXIC6C.js +0 -3
  583. package/dist/cli-bundle/chunks/chunk-LVDFPGD7.js +0 -3
  584. package/dist/cli-bundle/chunks/chunk-UFIM5ZC5.js +0 -6
  585. package/dist/cli-bundle/chunks/item-transaction-XBIN4KYM.js +0 -2
  586. package/dist/cli-bundle/focused-chunks/chunk-HLQOGAWG.js +0 -26
  587. package/dist/cli-bundle/focused-chunks/chunk-IB6TCE7N.js +0 -2
  588. package/dist/cli-bundle/focused-chunks/chunk-JU62TKJP.js +0 -82
  589. package/dist/cli-bundle/focused-chunks/chunk-NUFO3OR6.js +0 -44
@@ -1,4 +1,4 @@
1
- import{$ as vi,Ad as U,Ae as je,Ba as dr,Bb as xi,Bd as Jt,Ca as lr,Cc as ki,Cd as Ee,Da as Ii,Dd as pr,Di as Er,Ea as ur,Ei as Sr,Fa as it,Fb as Ri,Gb as $,Hc as Kt,Id as Qt,Ii as ji,Je as Li,Ka as Gt,Li as nn,Mi as vr,Ni as Tr,Oa as mr,Oi as zi,Pa as me,Pd as lt,Qa as we,Qi as yt,Ra as $e,Rb as be,Sa as st,Ta as te,Te as Se,Ti as ze,Ue as gr,Ui as Y,Vi as gt,X as Ei,Y as Si,_i as Ui,b as nt,ba as ot,c as _i,cc as ct,d as hi,dc as fr,dj as rn,ee as _r,fe as Ni,fi as Zt,gb as q,gd as Oi,h as yi,ji as en,ke as hr,ki as tn,l as gi,le as Mi,lf as Pi,li as pt,m as wi,mi as Fi,nf as wr,pb as Ci,pd as fe,pe as yr,qb as E,rf as br,sb as at,sf as mt,t as bi,tb as Fe,td as Di,ti as _t,ub as S,uf as ft,vb as Ai,vi as ht,wd as Xt,xd as dt,ye as ce,ze as ut,zf as $i}from"./chunk-GCPP37N6.js";import{A as m,B as Yt,C as p,D as Ti,E as j,G as P,H as C,K as T,L as cr,M as rt,m as sr,u as ee,z as ar}from"./chunk-O4ZLEN4T.js";(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]="42b217a3-31c0-561a-b7cb-b1a584b2edd5")}catch{}})();var Ld=new Set(["rename-type","rename-field","remap-status",...hi]);function Pd(e,t){if(t&&!Ld.has(e))throw new p(`schema ${e} does not support --dry-run. Preview is supported for rename-type, rename-field, remap-status and workflow-policy actions. Remove --dry-run only when you intend to apply changes.`,m.USAGE,{code:"invalid_argument_value",examples:["pm schema rename-type Spike --to Experiment --dry-run"]})}(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]="8dd367eb-617e-5645-8f8a-57862f8385f7")}catch{}})();var on=new WeakSet,Ir=new WeakMap,Hi=new WeakSet;function Cr(e){return Hi.add(e),e}function Ar(e){return Hi.has(e)}function wt(e){on.add(e);for(let[t,n]of Object.entries(e)){if(!Array.isArray(n))continue;let r=[...n];Reflect.set(e,t,r),on.add(r)}return e}function qi(e,t){return on.has(e)||t!==void 0&&Ir.get(e)?.has(t)===!0}function $d(e,t){let n=new Set(t);Ir.set(e,n);for(let r of n){let o=Reflect.get(e,r);if(!Array.isArray(o))continue;let i=[...o];Reflect.set(e,r,i),on.add(i)}return e}function Bi(e,t){if(Ar(e)&&Cr(t),qi(e))return wt(t);let n=Ir.get(e);return n?$d(t,n):t}function _w(e){return qi(e)?"sdk":"cli"}function Vi(e,t){return e==="cli"?`--${t}`:t.replace(/-([a-z])/gu,(n,r)=>r.toUpperCase())}function bt(e){return`Pass unset: ["${e}"] to clear it`}function sn(e,t,n=""){return e==="cli"?`--${t} must not be empty${n}`:`${Vi("sdk",t)} must not be empty. ${bt(t)}, or omit ${Vi("sdk",t)}.`}(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]="e35626b8-0818-5b4b-8fc2-57426b51a2d1")}catch{}})();var de="-",Fd=/^[A-Za-z0-9_.-]+$/u,xr=new Set(["actual_result","body","cmd","command","customer_impact","description","environment","expected_result","impact","location","message","note","outcome","repro_steps","resolution","text","title","unblock_note","value","why_now"]);function Yi(e,t){if(e.startsWith("```")||e.includes(`
1
+ import{$ as vi,Ad as U,Ae as je,Ba as dr,Bb as xi,Bd as Jt,Ca as lr,Cc as ki,Cd as Ee,Da as Ii,Dd as pr,Di as Er,Ea as ur,Ei as Sr,Fa as it,Fb as Ri,Gb as $,Hc as Kt,Id as Qt,Ii as ji,Je as Li,Ka as Gt,Li as nn,Mi as vr,Ni as Tr,Oa as mr,Oi as zi,Pa as me,Pd as lt,Qa as we,Qi as yt,Ra as $e,Rb as be,Sa as st,Ta as te,Te as Se,Ti as ze,Ue as gr,Ui as Y,Vi as gt,X as Ei,Y as Si,_i as Ui,b as nt,ba as ot,c as _i,cc as ct,d as hi,dc as fr,dj as rn,ee as _r,fe as Ni,fi as Zt,gb as q,gd as Oi,h as yi,ji as en,ke as hr,ki as tn,l as gi,le as Mi,lf as Pi,li as pt,m as wi,mi as Fi,nf as wr,pb as Ci,pd as fe,pe as yr,qb as E,rf as br,sb as at,sf as mt,t as bi,tb as Fe,td as Di,ti as _t,ub as S,uf as ft,vb as Ai,vi as ht,wd as Xt,xd as dt,ye as ce,ze as ut,zf as $i}from"./chunk-WNEUWDUE.js";import{A as m,B as Yt,C as p,D as Ti,E as j,G as P,H as C,K as T,L as cr,M as rt,m as sr,u as ee,z as ar}from"./chunk-O4ZLEN4T.js";(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]="42b217a3-31c0-561a-b7cb-b1a584b2edd5")}catch{}})();var Ld=new Set(["rename-type","rename-field","remap-status",...hi]);function Pd(e,t){if(t&&!Ld.has(e))throw new p(`schema ${e} does not support --dry-run. Preview is supported for rename-type, rename-field, remap-status and workflow-policy actions. Remove --dry-run only when you intend to apply changes.`,m.USAGE,{code:"invalid_argument_value",examples:["pm schema rename-type Spike --to Experiment --dry-run"]})}(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]="8dd367eb-617e-5645-8f8a-57862f8385f7")}catch{}})();var on=new WeakSet,Ir=new WeakMap,Hi=new WeakSet;function Cr(e){return Hi.add(e),e}function Ar(e){return Hi.has(e)}function wt(e){on.add(e);for(let[t,n]of Object.entries(e)){if(!Array.isArray(n))continue;let r=[...n];Reflect.set(e,t,r),on.add(r)}return e}function qi(e,t){return on.has(e)||t!==void 0&&Ir.get(e)?.has(t)===!0}function $d(e,t){let n=new Set(t);Ir.set(e,n);for(let r of n){let o=Reflect.get(e,r);if(!Array.isArray(o))continue;let i=[...o];Reflect.set(e,r,i),on.add(i)}return e}function Bi(e,t){if(Ar(e)&&Cr(t),qi(e))return wt(t);let n=Ir.get(e);return n?$d(t,n):t}function _w(e){return qi(e)?"sdk":"cli"}function Vi(e,t){return e==="cli"?`--${t}`:t.replace(/-([a-z])/gu,(n,r)=>r.toUpperCase())}function bt(e){return`Pass unset: ["${e}"] to clear it`}function sn(e,t,n=""){return e==="cli"?`--${t} must not be empty${n}`:`${Vi("sdk",t)} must not be empty. ${bt(t)}, or omit ${Vi("sdk",t)}.`}(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]="e35626b8-0818-5b4b-8fc2-57426b51a2d1")}catch{}})();var de="-",Fd=/^[A-Za-z0-9_.-]+$/u,xr=new Set(["actual_result","body","cmd","command","customer_impact","description","environment","expected_result","impact","location","message","note","outcome","repro_steps","resolution","text","title","unblock_note","value","why_now"]);function Yi(e,t){if(e.startsWith("```")||e.includes(`
2
2
  `))return!0;let n=t.map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|");return new RegExp(`^(?:[-*+]\\s+)?(?:${n})\\s*[:=]`,"i").test(e)}function Gi(e){let t=e.trim();if(t==="")return[];let n=(Hd(t)??t.split(",")).map(r=>r.trim()).filter(Boolean).map(r=>r.toLowerCase());return Array.from(new Set(n)).sort((r,o)=>r.localeCompare(o))}function Ki(e){if(!Array.isArray(e)||e.length===0)return[];let t=[];for(let n of e)if(typeof n=="string")for(let r of Gi(n))t.push(r);return Array.from(new Set(t)).sort((n,r)=>n.localeCompare(r))}function Xi(e){return Array.isArray(e)?e.filter(t=>typeof t=="string").map(t=>t.trim().toLowerCase()).filter(Boolean):[]}function jd(e){return typeof e!="string"?[]:e.split(";").map(t=>t.trim()).filter(Boolean)}function zd(e,t,n){let r=e.map(s=>s.trim()).filter(Boolean);for(let s of t??[]){let a=s.trim();if(a.includes(";"))throw new p('Acceptance criteria added with --add-ac cannot contain ";" because semicolons delimit stored criteria',m.USAGE,{code:"acceptance_criteria_semicolon_forbidden",required:"Pass one semicolon-free criterion per --add-ac value",why:"A semicolon inside one criterion would be re-read as multiple criteria",nextSteps:["Split the text into repeated --add-ac values, or replace the semicolon with punctuation that is not the storage delimiter"]});a.length>0&&!r.includes(a)&&r.push(a)}let o=[],i=r;for(let s of n??[]){let a=s.trim();if(a.length!==0){if(!i.includes(a)){o.push(a);continue}i=i.filter(c=>c!==a)}}return{criteria:i,unmatchedRemovals:o}}function Ud(e,t){let n=Xi(e);if(!t||t.length===0)return Array.from(new Set(n)).sort((o,i)=>o.localeCompare(i));let r=new Set(n);for(let o of Ki(t))r.add(o);return Array.from(r).sort((o,i)=>o.localeCompare(i))}function Vd(e,t){let n=Array.from(new Set(Xi(e))).sort((o,i)=>o.localeCompare(i));if(!t||t.length===0)return n;let r=new Set(Ki(t));return r.size===0?n:n.filter(o=>!r.has(o))}function Hd(e){if(!e.startsWith("["))return null;let t;try{t=JSON.parse(e)}catch{return null}return t.map(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean"?String(n):"").filter(n=>n.length>0)}function Rr(e){return e.replace(/\r\n/g,`
3
3
  `)}function Ji(e){let t=Rr(e).trim();if(!t.startsWith("```"))return e;let n=t.split(`
4
4
  `);return n.length<2||n.at(-1)?.trim()!=="```"?e:n.slice(1,-1).join(`
@@ -7,7 +7,7 @@ import{$ as vi,Ad as U,Ae as je,Ba as dr,Bb as xi,Bd as Jt,Ca as lr,Cc as ki,Cd
7
7
  `).map(i=>i.trim()).filter(i=>i.length>0);for(let i of o){let s=i.match(/^(?:[-*+]\s+)?([a-zA-Z0-9_.-]+)\s*(=|:)\s*(.*)$/);if(s){let a=s[1].trim();n[a]=Qi(s[3].trim()),r=a;continue}if(r&&xr.has(r.toLowerCase())){n[r]=`${n[r]}
8
8
  ${i}`;continue}return null}return n}function kr(e,t){let n=Ji(e).trim();if(!n)throw new p(`${t} cannot be empty`,m.USAGE);let r=Yd(n);if(r)return r;let o={},i,s=qd(n);for(let a of s){let c=Bd(a),d=a.slice(0,Math.max(c,0)).trim();if(d!==""&&i!==void 0&&xr.has(i.toLowerCase())&&!Fd.test(d)){o[i]=`${o[i]},${a}`;continue}if(c>=0){let l=a.slice(0,c).trim();if(!l)throw new p(Wi(e,t),m.USAGE);let u=Qi(a.slice(c+1).trim());o[l]=u,i=l;continue}if(i&&xr.has(i.toLowerCase())){o[i]=`${o[i]},${a}`;continue}throw new p(Wi(e,t),m.USAGE)}return o}var Gd=/^[A-Za-z]:[\\/]/,Kd=/^(?:[-*+]\s+)?[A-Za-z_][A-Za-z0-9_.-]*\s*=/;function Xd(e){let t=e.trim();return Gd.test(t)?!1:Kd.test(t)}function bw(e,t,n,r){if(!(r||!e.includes(",")))throw new p(`${t} received an ambiguous comma-bearing bare ${n}. Repeat ${t} for multiple values, or quote or escape literal commas in a structured key=<value> entry.`,m.USAGE,{code:"bare_comma_entry_ambiguous",required:`Use one ${t} per bare ${n}, or quote or escape literal commas in a structured key=<value> entry.`})}function Jd(e,t,n){let r=new Set(n.map(i=>i.toLowerCase())),o=Object.keys(e).filter(i=>!r.has(i.toLowerCase()));if(o.length>0)throw new p(`${t} does not recognize key${o.length>1?"s":""} ${o.map(i=>`"${i}"`).join(", ")}. Allowed keys: ${n.join(", ")}.`,m.USAGE);for(let i of Object.keys(e)){let s=i.toLowerCase();if(s!==i){if(Object.hasOwn(e,s))throw new p(`${t} provides key "${i}" more than once after case normalization.`,m.USAGE);e[s]=e[i],delete e[i]}}}async function Qd(e){if(process.stdin.isTTY===!0)throw new p(`${e} value "${de}" requires piped stdin input. Pipe content into the command, or end manual stdin with Ctrl+D (Unix/macOS) or Ctrl+Z then Enter (Windows).`,m.USAGE);return process.stdin.setEncoding("utf8"),await new Promise((t,n)=>{let r="";process.stdin.on("data",o=>{r+=o}),process.stdin.on("end",()=>{t(Rr(r))}),process.stdin.on("error",o=>{n(o)})})}var ve=Symbol("all-mutation-stdin-fields"),G=new WeakMap;function Ew(e){return Ar(e)?e:wt(Et({...e}))}function Et(e){return G.set(e,ve),e}function Zd(e,t){let n=G.get(e);return n===ve||G.set(e,new Set([...n??[],...t])),e}function St(e,t){Bi(e,t);let n=G.get(e);return n===void 0||G.set(t,n===ve?n:new Set(n)),t}function Sw(e,t){let n=G.get(e),r=G.get(t);return n===void 0||r===ve?t:n===ve?(G.set(t,n),t):(G.set(t,new Set([...r??[],...n])),t)}function el(e){return G.get(e)!==ve}function an(e,t){let n=G.get(e);return n!==ve&&!n?.has(t)}function tl(e){let t;for(let n of e){if(n.resolveToken===!1||n.value===void 0)continue;let r=(Array.isArray(n.value)?n.value:[n.value]).filter(o=>o.trim()===de).length;if(r>1)throw new p(`${n.optionName} accepts "${de}" stdin token at most once per command invocation`,m.USAGE);if(r!==0){if(t!==void 0&&t!==n.optionName)throw new p(`Only one option may use "${de}" stdin token per command invocation. Already used by ${t}.`,m.USAGE);t=n.optionName}}}async function vw(e,t,n){let r=e,o=[...t,...n];tl(o.map(([a,c])=>({value:r[a],optionName:c,resolveToken:an(e,a)})));let i=Ue(),s={...r};for(let[a,c]of t)s[a]=await i.resolveValue(r[a],c,an(e,a));for(let[a,c]of n)s[a]=await i.resolveList(r[a],c,an(e,a));return Et(St(e,s))}function Ue(){let e,t,n=async r=>{if(t&&t!==r)throw new p(`Only one option may use "${de}" stdin token per command invocation. Already used by ${t}.`,m.USAGE);return t=r,e||(e=Qd(r)),await e};return{resolveValue:async(r,o,i=!0)=>{if(!i)return r;if(r!==void 0)return r.trim()!==de?r:await n(o)},resolveList:async(r,o,i=!0)=>{if(!i)return r;if(!r)return;let s=r.map((d,l)=>d.trim()===de?l:-1).filter(d=>d>=0);if(s.length===0)return r;if(s.length>1)throw new p(`${o} accepts "${de}" stdin token at most once per command invocation`,m.USAGE);let a=await n(o),c=[...r];return c[s[0]]=a,c}}}function nl(e,t){let n=Number(e);if(!Number.isFinite(n))throw new p(`Invalid ${t} value "${e}"`,m.USAGE);return n}function rl(e,t){let n=e.trim(),r=Number(n);if(n===""||!Number.isInteger(r)||r<0)throw new p(`Invalid ${t} value "${e}". Expected a non-negative integer.`,m.USAGE);return r}(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]="ccb1b39b-3dde-511b-8133-d4747bb6e55e")}catch{}})();function Rw(e){try{return e()}catch(t){throw!(t instanceof p)||t.exitCode!==m.USAGE?t:new p(`${t.message} No changes were made.`,m.USAGE,{...t.context,code:t.code==="linked_test_command_not_executable"?t.code:"invalid_argument_value",reason:"test_option_invalid",changed:!1,required:t.context.required??t.message})}}function ol(e,t){if(e[t]==="'"){let n=e.indexOf("'",t+1);return n<0?void 0:n+1}for(let n=t+1;n<e.length;n+=1){if(e[n]==='"')return n+1;if(e[n]==="\\"){n+=1;continue}if(e[n]==="`"||e.startsWith("$(",n))return}}function il(e,t){let n=t;for(;n<e.length;){let r=e[n];if(/\s/u.test(r)||";&|".includes(r))return n;if(r==="\\"){n+=2;continue}if(r==="'"||r==='"'){let o=ol(e,n);if(o===void 0)return;n=o;continue}if("<>()`".includes(r))return;n+=1}return n===e.length?n:void 0}function Or(e,t){let n=t;for(;n<e.length;){if(/\s/u.test(e[n])){n+=1;continue}if(e[n]!=="#")return n;let r=e.indexOf(`
9
9
  `,n);if(r<0)return e.length;n=r+1}return n}function sl(e,t){let n=Or(e,t),r=e[n];return r===void 0||!";&|".includes(r)?n:(n+=1,r!==";"&&e[n]===r&&(n+=1),Or(e,n))}function al(e){let t=e.trim(),n=Or(t,0);if(t.length===0)return!1;for(;n<t.length;){if(!/[A-Za-z_]/u.test(t[n]))return!1;let r=n+1;for(;r<t.length&&/[A-Za-z0-9_]/u.test(t[r]);)r+=1;if(t[r]!=="=")return!1;let o=il(t,r+1);if(o===void 0)return!1;n=sl(t,o)}return!0}function Dr(e){if(!(e===void 0||!al(e)))throw new p("Linked-test command contains only variable assignments or comments and has no executable command.",m.USAGE,{code:"linked_test_command_not_executable",required:'Supply an actual test command with --add "command=<actual command>" or --add-json. Environment assignments may precede that command.',examples:['pm test <id> --add "command=node --version"'],nextSteps:["Remove any already-stored assignment-only entry with --remove-index, then register the actual test command."]})}function kw(e){if(Dr(e.command),!(e.pm_context_mode!=="none"||e.workspace_context_mode==="isolated"||e.workspace_context_mode==="snapshot"))throw new p("pm_context_mode=none requires workspace_context_mode=isolated or snapshot so implicit tracker discovery cannot reach the source workspace.",m.USAGE,{code:"linked_test_context_invalid",required:"Set workspace_context_mode to isolated or snapshot when pm_context_mode is none.",examples:[q(["test","<id>","--add-json",JSON.stringify({command:e.command,pm_context_mode:"none",workspace_context_mode:"isolated"})])]})}function Ow(e,t){return e.command===t.command&&e.path===t.path&&e.scope===t.scope&&e.pm_context_mode===t.pm_context_mode&&e.workspace_context_mode===t.workspace_context_mode}var vt=["command","cmd","path","scope","timeout","timeout_seconds","pm_context_mode","workspace_context_mode","env_set","env_clear","shared_host_safe","assert_stdout_contains","assert_stdout_regex","assert_stderr_contains","assert_stderr_regex","assert_stdout_min_lines","assert_json_field_equals","assert_json_field_gte","note"],cl=new Set(vt);function Dw(e){return Yi(e,vt)}function Zi(e,t){let n={},r=[];for(let[o,i]of Object.entries(e)){let s=o.toLowerCase();if(!cl.has(s)){r.push(o);continue}if(Object.hasOwn(n,s))throw new p(`${t} provides key "${o}" more than once after case normalization`,m.USAGE);n[s]=i}if(r.length>0)throw new p(`${t} does not recognize key${r.length>1?"s":""} ${r.map(o=>`"${o}"`).join(", ")}. Allowed keys: ${vt.join(", ")}.`,m.USAGE);if(n.cmd!==void 0){if(n.command!==void 0&&n.command.trim()!==n.cmd.trim())throw new p(`${t} command and cmd must match when both are provided`,m.USAGE);let{cmd:o,...i}=n;return{...i,command:i.command??o}}return n}(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]="b58016fa-9817-5421-a4a3-78d1b1d22937")}catch{}})();function es(e){if(!e?.trim())return!1;try{return Dr(e.trim()),!0}catch{return!1}}function dl(e){try{let{command:t,...n}=Zi(kr(e,"--add"),"--add");return es(t)?["--add",e]:["command=<actual command>",...Object.entries(n).map(([r,o])=>`${r}=${JSON.stringify(o)}`)].join(",")}catch{return}}function ll(e){for(let t=0;t<e.length;t+=1){let n=e[t];if(Si.has(n)&&n!=="--all")continue;let r=n.split("=",1)[0];if(!Ei.has(r)||["--author","--path","--pm-path"].includes(r))return!1;if(!n.includes("=")){let o=e[++t];if(o===void 0||o.startsWith("-"))return!1}}return!0}function ul(e,t){let n=vi(t);if(n===void 0)return;let r=bi(t.slice(n));if((r?.alias??t[n])!==e)return;let o=n+(r?.canonical_argv.length??1),i=t[o],s=t[o+1];if(!(!i||i==="add"||i.startsWith("-"))&&!(!s||s.startsWith("-"))&&ll(t.slice(o+2)))return{idIndex:o,value:s}}function ml(e,t){let n=/^[A-Za-z_][A-Za-z0-9_]*=/u.exec(t)?.[0];if(e==="test")return n?["command=","cmd="].includes(n)?dl(t):vt.includes(n.slice(0,-1))?`command=<actual command>,${t}`:void 0:es(t)?["--add-json",JSON.stringify({command:t})]:"command=<actual command>";if(!(n&&n!=="path="))return["--add",n?t:`path=${JSON.stringify(t)}`]}function fl(e,t){if(e===void 0||!["files","docs","test"].includes(e))return;let n=ul(e,t);if(!n)return;let{idIndex:r,value:o}=n,i=t[r],s=ml(e,o);if(s!==void 0)return typeof s=="string"?{itemId:i,value:o,templateArgs:[...t.slice(0,r+1),"--add",s,...t.slice(r+2)]}:{itemId:i,value:o,retryArgs:[...t.slice(0,r+1),...s,...t.slice(r+2)]}}import{readFile as pl}from"node:fs/promises";import ts 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]="7cc00705-c03e-5a18-9bec-af2585939ed8")}catch{}})();function Yw(e){if(e!==void 0){if(typeof e!="string")throw new p("--rollback requires a non-empty checkpoint ID string",m.USAGE);return ns(e)}}function ns(e){let t=e.trim();if(!t)throw new p("--rollback requires a non-empty checkpoint ID",m.USAGE);if(!/^[a-zA-Z0-9._-]+$/.test(t))throw new p("--rollback checkpoint ID must match [a-zA-Z0-9._-]+",m.USAGE);return t}function _l(e,t){let n=t.replace(/[-:.TZ]/g,"").slice(0,14),r=Math.random().toString(36).slice(2,8);return`${e}-${n}-${r}`}function hl(e,t){return ts.join(e,"checkpoints",t)}function rs(e,t,n){return ts.join(hl(e,t),`${n}.json`)}async function yl(e,t,n,r){let o=rs(e,t,n),i=`${JSON.stringify(r,null,2)}
10
- `;if(!await Ci(o,i)&&await C(o)!==i)throw new p(`Checkpoint ${n} already exists with different contents; use a new checkpoint ID.`,m.CONFLICT);return o}function gl(e,t){if(!Array.isArray(e.items))throw new p(`Checkpoint ${t} is missing items`,m.GENERIC_FAILURE);return e.items.map(n=>{if(!n||typeof n!="object")throw new p(`Checkpoint ${t} contains an invalid item entry`,m.GENERIC_FAILURE);let r=n;if(typeof r.id!="string"||r.id.trim().length===0)throw new p(`Checkpoint ${t} contains an item entry without ID`,m.GENERIC_FAILURE);if(typeof r.target_updated_at!="string"||r.target_updated_at.trim().length===0)throw new p(`Checkpoint ${t} contains an item entry without target_updated_at`,m.GENERIC_FAILURE);return{id:r.id.trim(),target_updated_at:r.target_updated_at.trim()}})}async function wl(e,t,n,r){let o=ns(n),i=rs(e,t,o);if(!await j(i))throw new p(`Checkpoint ${o} not found`,m.NOT_FOUND);let s=await pl(i,"utf8"),a;try{a=JSON.parse(s)}catch(l){throw new p(`Checkpoint ${o} contains invalid JSON: ${S(l)}`,m.GENERIC_FAILURE)}if(!a||typeof a!="object")throw new p(`Checkpoint ${o} is invalid`,m.GENERIC_FAILURE);let c=a;if(c.schema_version!==r)throw new p(`Checkpoint ${o} has unsupported schema version. Inspect pm history and use an explicit pm restore only after reviewing later edits.`,m.GENERIC_FAILURE);let d=gl(c,o);return{record:c,items:d,path:i,id:typeof c.id=="string"?c.id:o,created_at:typeof c.created_at=="string"?c.created_at:$(),author:typeof c.author=="string"?c.author:"unknown"}}async function bl(e,t){let n=[],r=[];for(let o of e)try{let i=await t(o.id,o.target_updated_at);n.push({id:o.id,status:i.skipped?"skipped":"restored",changed_fields:i.changed_fields,warnings:i.warnings}),i.skipped||r.push(o.id)}catch(i){n.push({id:o.id,status:"failed",error:S(i)})}return{rows:n,restored_ids:r,failed_count:n.filter(o=>o.status==="failed").length}}(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]="e23f9ca6-9fa6-566b-9bfb-7cbe6d449a59")}catch{}})();var Qw=[{code:"unknown_lifecycle_action"}];function El(e,t){let n=e.trim().toLowerCase();if(n.length===0)return;let r=Math.floor(n.length/3);return t.map(o=>({candidate:o,distance:be(n,o.toLowerCase(),r)??Number.POSITIVE_INFINITY})).filter(({distance:o})=>Number.isFinite(o)).sort((o,i)=>o.distance!==i.distance?o.distance-i.distance:o.candidate.localeCompare(i.candidate))[0]?.candidate}function os(e){return["pm",...e].map(t=>/^[A-Za-z0-9_./:@=-]+$/u.test(t)?t:JSON.stringify(t)).join(" ")}function Sl(e){let t=e.command_path.trim().replaceAll(/\s+/gu," "),n=e.token.trim(),r=n.length===0?"<empty>":n,o=[...new Set(e.allowed.map(f=>f.trim()))].filter(Boolean).sort((f,_)=>f.localeCompare(_));if(t.length===0||r.length===0||o.length===0)throw new TypeError("Unknown-subcommand contracts require a path, token, and allowed set");let i=t.split(" "),s=e.trailing_args??[],a=e.display_name??`pm ${t}`,c=e.token_kind??"subcommand",d=e.retry_command?void 0:El(r,o),l=os([...i,r,...s]),u=e.retry_command??(d?os([...i,d,...s]):void 0);return new p(`Unknown ${a} ${c} "${r}". Allowed: ${o.join(", ")}${e.message_suffix??""}`,e.exit_code??m.USAGE,{code:"unknown_subcommand",reason:"unknown_positional_token",value:r,examples:[...u?[u]:[],...e.examples??[],`pm ${t} --help`],nextSteps:u?[`Retry with the suggested command: ${u}`]:["Choose one value from recovery.allowed_values."],recovery:{attempted_command:l,allowed_values:o,suggested_retry:u,fallback_candidates:e.fallback_candidates}})}(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]="4e02447f-3fb0-5f7c-9512-be2b348fd082")}catch{}})();var Te=new Set(sr),cn=Object.freeze({get size(){return Te.size},has(e){return Te.has(e)},entries(){return Te.entries()},keys(){return Te.keys()},values(){return Te.values()},forEach(e,t){Te.forEach(n=>e.call(t,n,n,cn))},[Symbol.iterator](){return Te.values()}});function is(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}function ss(e){return typeof e!="string"?null:ki(e)}function vl(e){try{return structuredClone(e)}catch{return e}}function Tl(e){let t=e.trim(),n=t.indexOf("=");if(n<=0)throw new p(`--field entries must use name=value syntax, received: ${e}`,m.USAGE);let r=t.slice(0,n).trim(),o=t.slice(n+1);return{key:r,value:o}}function Il(e,t,n){try{let r=JSON.parse(e);if(n==="array"&&Array.isArray(r)||n==="object"&&typeof r=="object"&&r!==null&&!Array.isArray(r))return r}catch{}throw new p(`--field ${t}=... must be valid JSON ${n}`,m.USAGE)}function Cl(e,t,n){if(t==="string")return n;if(t==="number"){let r=n.trim();if(r.length===0)throw new p(`--field ${e}=... must be a number`,m.USAGE);let o=Number(r);if(!Number.isFinite(o))throw new p(`--field ${e}=... must be a number`,m.USAGE);return o}if(t==="boolean"){let r=n.trim().toLowerCase();if(r==="true"||r==="1"||r==="yes")return!0;if(r==="false"||r==="0"||r==="no")return!1;throw new p(`--field ${e}=... must be one of true|false|1|0|yes|no`,m.USAGE)}return t==="string_array"?n.split(/[\n,|]/u).map(r=>r.trim()).filter(r=>r.length>0):Il(n,e,t)}function Nr(e){let t=new Map;if(!e)return t;for(let n of e.item_fields)for(let r of n.fields){let o=is(r.name),i=ss(r.type);if(!o||!i)continue;let s=t.get(o);if(s&&s.type!==i)throw new p(`Extension item field "${o}" is declared with conflicting types: ${s.type}, ${i}`,m.USAGE,{code:"extension_item_field_type_conflict",nextSteps:["Make every active extension declaration for this field use the same type."]});t.set(o,{name:o,type:i})}return t}function as(e){if(cn.has(e))throw new p(`Extension item field "${e}" collides with built-in item metadata "${e}"; rename the extension field with an extension-specific prefix. Reserved fields: ${[...cn].sort((t,n)=>t.localeCompare(n)).join(", ")}.`,m.USAGE,{code:"extension_item_field_reserved",nextSteps:["Rename the extension item field, preferably with an extension-specific prefix."]})}function Tt(e){return[...Nr(e).keys()].sort((t,n)=>t.localeCompare(n))}function Al(e,t,n,r){if(!e||e.length===0)return{};let o=Nr(t),i={};for(let s of e){let{key:a,value:c}=Tl(s),d=o.get(a);if(!d)throw xl(a,o,n,r);as(d.name),i[d.name]=Cl(d.name,d.type,c)}return i}function xl(e,t,n,r){if(cn.has(e)){let s=n?.(e)??{recovery:{provided_fields:[e]},nextSteps:["Core metadata has no generic --field mutation path. Use the owning lifecycle, evidence, or importer API; inspect pm update <id> --help for declared mutation flags."]};return new p(`--field ${e} is a core item field, not an extension field`,m.USAGE,{code:"core_item_field_requires_dedicated_flag",field:e,...s})}let o=r?.(e);if(o!==void 0){let s=o.recovery?.suggested_flags?.[0];return new p(s===void 0?`--field ${e} is a project-schema field, not an extension field`:`--field ${e} is a project-schema field; set it with its declared flag ${s}`,m.USAGE,{code:"project_schema_field_requires_declared_flag",field:e,changed:!1,...o})}let i=[...t.keys()].sort((s,a)=>s.localeCompare(a));return new p(`--field ${e} is not declared by an active extension item-field registration`,m.USAGE,{code:"extension_item_field_unknown",field:e,recovery:{provided_fields:[e]},nextSteps:i.length>0?[`Use one of the declared fields: ${i.join(", ")}`]:["Activate an extension that calls registerItemFields before setting extension fields."]})}function Rl(e,t){return t==="string"?typeof e=="string":t==="number"?typeof e=="number"&&Number.isFinite(e):t==="boolean"?typeof e=="boolean":t==="array"?Array.isArray(e):t==="string_array"?Array.isArray(e)&&e.every(n=>typeof n=="string"):typeof e=="object"&&e!==null&&!Array.isArray(e)}function kl(e,t){return!t||t.length===0?!0:t.some(n=>Object.is(n,e))}function Ol(e,t,n={}){if(t){Nr(t);for(let r of t.item_fields)for(let o of r.fields){let i=is(o.name);if(!i)continue;as(i),!(i in e)&&!n.skipDefaultFields?.has(i)&&Object.prototype.hasOwnProperty.call(o,"default")&&(e[i]=vl(o.default));let s=e[i];if(s===void 0)continue;let a=ss(o.type);if(a&&!Rl(s,a))throw new TypeError(`Item field "${i}" must be of type ${a}`);let c=Array.isArray(o.values)?o.values:void 0;if(!kl(s,c))throw new TypeError(`Item field "${i}" must match one of the configured allowed values`)}}}(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]="7a401405-3370-53a5-811d-5e52287f1d2a")}catch{}})();var cs=new Set(["item_format"]),ds=new Set(["definition_of_done","metadata_required_fields","lifecycle_stale_blocker_reason_patterns","lifecycle_closure_like_blocked_reason_patterns","lifecycle_closure_like_resolution_patterns","lifecycle_closure_like_actual_result_patterns"]),Dl=new Set(["history_missing_stream_policy","sprint_release_format_policy","parent_reference_policy","metadata_validation_profile","governance_preset","governance_ownership_enforcement","governance_create_mode_default","governance_close_validation_default","governance_require_close_reason","governance_create_default_type","governance_workflow_enforcement","governance_start_blocker_enforcement","governance_parent_reference_policy","governance_metadata_validation_profile","governance_force_required_for_stale_lock","test_result_tracking","untrusted_linked_test_execution","telemetry_tracking","agent_identity_vocabulary"]),Nl=new Set(["governance_require_close_reason","governance_force_required_for_stale_lock","test_result_tracking","untrusted_linked_test_execution","telemetry_tracking"]),Ml={off:"disabled",on:"enabled",true:"enabled",false:"disabled",enabled:"enabled",disabled:"disabled"};function Ll(e){let t=e.trim().toLowerCase().replaceAll("-","_");if(cs.has(t)||ds.has(t)||Dl.has(t)||t==="context")return t}function Pl(e){let t=e.trim().toLowerCase();return Ml[t]??e}function ob(e,t){let n=Ll(e);return n===void 0?{routable:!1,reason:`Unknown config key "${e}" cannot route a positional value.`}:n==="context"?{routable:!1,reason:"Config set context does not accept a positional value. Use --default-depth, --activity-limit, --stale-threshold-days, or --section-<name> flags."}:cs.has(n)?{routable:!0,flag:"format",value:t}:ds.has(n)?{routable:!0,flag:"criterion",values:[t]}:{routable:!0,flag:"policy",value:Nl.has(n)?Pl(t):t}}function $l(e){return/^telemetry[-_]tracking$/u.test(e??"")?"global":"project"}(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]="cb883ffc-c431-5bf9-a973-931a8a0a940c")}catch{}})();function pe(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return t.length>0?t:null}function sb(e,t){let n=pe(t);return!e||!n?null:[...e.assurance_providers??[]].reverse().find(r=>pe(r.definition.id)===n)??null}function Fl(e,t){let n=pe(t);return!e||!n?null:[...e.search_providers].reverse().find(r=>(pe(r.runtime_definition?.name)??pe(r.definition?.name))===n)??null}function jl(e,t){let n=pe(t);return!e||!n?null:[...e.vector_store_adapters].reverse().find(r=>(pe(r.runtime_definition?.name)??pe(r.definition?.name))===n)??null}function ab(e){return e.runtime_definition??e.definition}import{readFile as zl}from"node:fs/promises";(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]="4441095d-0acd-5780-8758-7df94396cb8e")}catch{}})();var Ul=e=>zl(e,"utf8"),Vl=async e=>await Ue().resolveValue("-",e);function Mr(e){return[...new Set(e.split(/[,\r\n]+/).map(t=>t.trim()).filter(t=>t.length>0))]}function Hl(e){let t=[];for(let r of e)if(typeof r=="string")t.push(r);else if(typeof r=="number"&&Number.isFinite(r))t.push(String(r));else return"";let n=Mr(t.join(`
10
+ `;if(!await Ci(o,i)&&await C(o)!==i)throw new p(`Checkpoint ${n} already exists with different contents; use a new checkpoint ID.`,m.CONFLICT);return o}function gl(e,t){if(!Array.isArray(e.items))throw new p(`Checkpoint ${t} is missing items`,m.GENERIC_FAILURE);return e.items.map(n=>{if(!n||typeof n!="object")throw new p(`Checkpoint ${t} contains an invalid item entry`,m.GENERIC_FAILURE);let r=n;if(typeof r.id!="string"||r.id.trim().length===0)throw new p(`Checkpoint ${t} contains an item entry without ID`,m.GENERIC_FAILURE);if(typeof r.target_updated_at!="string"||r.target_updated_at.trim().length===0)throw new p(`Checkpoint ${t} contains an item entry without target_updated_at`,m.GENERIC_FAILURE);return{id:r.id.trim(),target_updated_at:r.target_updated_at.trim()}})}async function wl(e,t,n,r){let o=ns(n),i=rs(e,t,o);if(!await j(i))throw new p(`Checkpoint ${o} not found`,m.NOT_FOUND);let s=await pl(i,"utf8"),a;try{a=JSON.parse(s)}catch(l){throw new p(`Checkpoint ${o} contains invalid JSON: ${S(l)}`,m.GENERIC_FAILURE)}if(!a||typeof a!="object")throw new p(`Checkpoint ${o} is invalid`,m.GENERIC_FAILURE);let c=a;if(c.schema_version!==r)throw new p(`Checkpoint ${o} has unsupported schema version. Inspect pm history and use an explicit pm restore only after reviewing later edits.`,m.GENERIC_FAILURE);let d=gl(c,o);return{record:c,items:d,path:i,id:typeof c.id=="string"?c.id:o,created_at:typeof c.created_at=="string"?c.created_at:$(),author:typeof c.author=="string"?c.author:"unknown"}}async function bl(e,t){let n=[],r=[];for(let o of e)try{let i=await t(o.id,o.target_updated_at);n.push({id:o.id,status:i.skipped?"skipped":"restored",changed_fields:i.changed_fields,warnings:i.warnings}),i.skipped||r.push(o.id)}catch(i){n.push({id:o.id,status:"failed",error:S(i)})}return{rows:n,restored_ids:r,failed_count:n.filter(o=>o.status==="failed").length}}(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]="e23f9ca6-9fa6-566b-9bfb-7cbe6d449a59")}catch{}})();var Qw=[{code:"unknown_lifecycle_action"}];function El(e,t){let n=e.trim().toLowerCase();if(n.length===0)return;let r=Math.floor(n.length/3);return t.map(o=>({candidate:o,distance:be(n,o.toLowerCase(),r)??Number.POSITIVE_INFINITY})).filter(({distance:o})=>Number.isFinite(o)).sort((o,i)=>o.distance!==i.distance?o.distance-i.distance:o.candidate.localeCompare(i.candidate))[0]?.candidate}function os(e){return["pm",...e].map(t=>/^[A-Za-z0-9_./:@=-]+$/u.test(t)?t:JSON.stringify(t)).join(" ")}function Sl(e){let t=e.command_path.trim().replaceAll(/\s+/gu," "),n=e.token.trim(),r=n.length===0?"<empty>":n,o=[...new Set(e.allowed.map(f=>f.trim()))].filter(Boolean).sort((f,_)=>f.localeCompare(_));if(t.length===0||r.length===0||o.length===0)throw new TypeError("Unknown-subcommand contracts require a path, token, and allowed set");let i=t.split(" "),s=e.trailing_args??[],a=e.display_name??`pm ${t}`,c=e.token_kind??"subcommand",d=e.retry_command?void 0:El(r,o),l=os([...i,r,...s]),u=e.retry_command??(d?os([...i,d,...s]):void 0);return new p(`Unknown ${a} ${c} "${r}". Allowed: ${o.join(", ")}${e.message_suffix??""}`,e.exit_code??m.USAGE,{code:"unknown_subcommand",reason:"unknown_positional_token",value:r,examples:[...u?[u]:[],...e.examples??[],`pm ${t} --help`],nextSteps:u?[`Retry with the suggested command: ${u}`]:["Choose one value from recovery.allowed_values."],recovery:{attempted_command:l,allowed_values:o,suggested_retry:u,fallback_candidates:e.fallback_candidates}})}(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]="4e02447f-3fb0-5f7c-9512-be2b348fd082")}catch{}})();var Te=new Set(sr),cn=Object.freeze({get size(){return Te.size},has(e){return Te.has(e)},entries(){return Te.entries()},keys(){return Te.keys()},values(){return Te.values()},forEach(e,t){Te.forEach(n=>e.call(t,n,n,cn))},[Symbol.iterator](){return Te.values()}});function is(e){if(typeof e!="string")return null;let t=e.trim();return t.length>0?t:null}function ss(e){return typeof e!="string"?null:ki(e)}function vl(e){try{return structuredClone(e)}catch{return e}}function Tl(e){let t=e.trim(),n=t.indexOf("=");if(n<=0)throw new p(`--field entries must use name=value syntax, received: ${e}`,m.USAGE);let r=t.slice(0,n).trim(),o=t.slice(n+1);return{key:r,value:o}}function Il(e,t,n){try{let r=JSON.parse(e);if(n==="array"&&Array.isArray(r)||n==="object"&&typeof r=="object"&&r!==null&&!Array.isArray(r))return r}catch{}throw new p(`--field ${t}=... must be valid JSON ${n}`,m.USAGE)}function Cl(e,t,n){if(t==="string")return n;if(t==="number"){let r=n.trim();if(r.length===0)throw new p(`--field ${e}=... must be a number`,m.USAGE);let o=Number(r);if(!Number.isFinite(o))throw new p(`--field ${e}=... must be a number`,m.USAGE);return o}if(t==="boolean"){let r=n.trim().toLowerCase();if(r==="true"||r==="1"||r==="yes")return!0;if(r==="false"||r==="0"||r==="no")return!1;throw new p(`--field ${e}=... must be one of true|false|1|0|yes|no`,m.USAGE)}return t==="string_array"?n.split(/[\n,|]/u).map(r=>r.trim()).filter(r=>r.length>0):Il(n,e,t)}function Nr(e){let t=new Map;if(!e)return t;for(let n of e.item_fields)for(let r of n.fields){let o=is(r.name),i=ss(r.type);if(!o||!i)continue;let s=t.get(o);if(s&&s.type!==i)throw new p(`Extension item field "${o}" is declared with conflicting types: ${s.type}, ${i}`,m.USAGE,{code:"extension_item_field_type_conflict",nextSteps:["Make every active extension declaration for this field use the same type."]});t.set(o,{name:o,type:i})}return t}function as(e){if(cn.has(e))throw new p(`Extension item field "${e}" collides with built-in item metadata "${e}"; rename the extension field with an extension-specific prefix. Reserved fields: ${[...cn].sort((t,n)=>t.localeCompare(n)).join(", ")}.`,m.USAGE,{code:"extension_item_field_reserved",nextSteps:["Rename the extension item field, preferably with an extension-specific prefix."]})}function Tt(e){return[...Nr(e).keys()].sort((t,n)=>t.localeCompare(n))}function Al(e,t,n,r){if(!e||e.length===0)return{};let o=Nr(t),i={};for(let s of e){let{key:a,value:c}=Tl(s),d=o.get(a);if(!d)throw xl(a,o,n,r);as(d.name),i[d.name]=Cl(d.name,d.type,c)}return i}function xl(e,t,n,r){if(cn.has(e)){let s=n?.(e)??{recovery:{provided_fields:[e]},nextSteps:["Core metadata has no generic --field mutation path. Use the owning lifecycle, evidence, or importer API; inspect pm update <id> --help for declared mutation flags."]};return new p(`--field ${e} is a core item field, not an extension field`,m.USAGE,{code:"core_item_field_requires_dedicated_flag",field:e,...s})}let o=r?.(e);if(o!==void 0){let s=o.recovery?.suggested_flags?.[0];return new p(s===void 0?`--field ${e} is a project-schema field, not an extension field`:`--field ${e} is a project-schema field; set it with its declared flag ${s}`,m.USAGE,{code:"project_schema_field_requires_declared_flag",field:e,changed:!1,...o})}let i=[...t.keys()].sort((s,a)=>s.localeCompare(a));return new p(`--field ${e} is not declared by an active extension item-field registration`,m.USAGE,{code:"extension_item_field_unknown",field:e,recovery:{provided_fields:[e]},nextSteps:i.length>0?[`Use one of the declared fields: ${i.join(", ")}`]:["Activate an extension that calls registerItemFields before setting extension fields."]})}function Rl(e,t){return t==="string"?typeof e=="string":t==="number"?typeof e=="number"&&Number.isFinite(e):t==="boolean"?typeof e=="boolean":t==="array"?Array.isArray(e):t==="string_array"?Array.isArray(e)&&e.every(n=>typeof n=="string"):typeof e=="object"&&e!==null&&!Array.isArray(e)}function kl(e,t){return!t||t.length===0?!0:t.some(n=>Object.is(n,e))}function Ol(e,t,n={}){if(t){Nr(t);for(let r of t.item_fields)for(let o of r.fields){let i=is(o.name);if(!i)continue;as(i),!(i in e)&&!n.skipDefaultFields?.has(i)&&Object.prototype.hasOwnProperty.call(o,"default")&&(e[i]=vl(o.default));let s=e[i];if(s===void 0)continue;let a=ss(o.type);if(a&&!Rl(s,a))throw new TypeError(`Item field "${i}" must be of type ${a}`);let c=Array.isArray(o.values)?o.values:void 0;if(!kl(s,c))throw new TypeError(`Item field "${i}" must match one of the configured allowed values`)}}}(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]="a95f85c5-ca4a-5156-8ce4-3dc9070ea468")}catch{}})();var cs=new Set(["item_format"]),ds=new Set(["definition_of_done","metadata_required_fields","lifecycle_stale_blocker_reason_patterns","lifecycle_closure_like_blocked_reason_patterns","lifecycle_closure_like_resolution_patterns","lifecycle_closure_like_actual_result_patterns"]),Dl=new Set(["history_missing_stream_policy","sprint_release_format_policy","parent_reference_policy","metadata_validation_profile","governance_preset","governance_ownership_enforcement","governance_create_mode_default","governance_close_validation_default","governance_require_close_reason","governance_create_default_type","governance_workflow_enforcement","governance_start_blocker_enforcement","governance_parent_reference_policy","governance_metadata_validation_profile","governance_force_required_for_stale_lock","test_result_tracking","untrusted_linked_test_execution","telemetry_tracking","agent_identity_vocabulary"]),Nl=new Set(["governance_require_close_reason","governance_force_required_for_stale_lock","test_result_tracking","untrusted_linked_test_execution","telemetry_tracking"]),Ml={off:"disabled",on:"enabled",true:"enabled",false:"disabled",enabled:"enabled",disabled:"disabled"};function Ll(e){let t=e.trim().toLowerCase().replaceAll("-","_");if(cs.has(t)||ds.has(t)||Dl.has(t)||t==="context")return t}function Pl(e){let t=e.trim().toLowerCase();return Ml[t]??e}function ob(e,t){let n=Ll(e);return n===void 0?{routable:!1,reason:`Unknown config key "${e}" cannot route a positional value.`}:n==="context"?{routable:!1,reason:"Config set context does not accept a positional value. Use --default-depth, --activity-limit, --stale-threshold-days, or --section-<name> flags."}:cs.has(n)?{routable:!0,flag:"format",value:t}:ds.has(n)?{routable:!0,flag:"criterion",values:[t]}:{routable:!0,flag:"policy",value:Nl.has(n)?Pl(t):t}}function $l(e){return e==="telemetry.enabled"||/^telemetry[-_]tracking$/u.test(e??"")?"global":"project"}(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]="cb883ffc-c431-5bf9-a973-931a8a0a940c")}catch{}})();function pe(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return t.length>0?t:null}function sb(e,t){let n=pe(t);return!e||!n?null:[...e.assurance_providers??[]].reverse().find(r=>pe(r.definition.id)===n)??null}function Fl(e,t){let n=pe(t);return!e||!n?null:[...e.search_providers].reverse().find(r=>(pe(r.runtime_definition?.name)??pe(r.definition?.name))===n)??null}function jl(e,t){let n=pe(t);return!e||!n?null:[...e.vector_store_adapters].reverse().find(r=>(pe(r.runtime_definition?.name)??pe(r.definition?.name))===n)??null}function ab(e){return e.runtime_definition??e.definition}import{readFile as zl}from"node:fs/promises";(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]="4441095d-0acd-5780-8758-7df94396cb8e")}catch{}})();var Ul=e=>zl(e,"utf8"),Vl=async e=>await Ue().resolveValue("-",e);function Mr(e){return[...new Set(e.split(/[,\r\n]+/).map(t=>t.trim()).filter(t=>t.length>0))]}function Hl(e){let t=[];for(let r of e)if(typeof r=="string")t.push(r);else if(typeof r=="number"&&Number.isFinite(r))t.push(String(r));else return"";let n=Mr(t.join(`
11
11
  `));return n.length>0?n.join(","):""}function ls(e){if(e===void 0)return;if(typeof e=="number")return Number.isFinite(e)?String(e):"";if(Array.isArray(e))return Hl(e);if(typeof e!="string")return"";let t=Mr(e);return t.length>0?t.join(","):""}async function ql(e,t="--ids",n={}){if(e===void 0)return;let r=e.trim(),o=e;try{if(r==="-")o=await(n.readStdin??Vl)(t);else if(r.startsWith("@")){let s=r.slice(1).trim();if(s.length===0)throw new p(`${t} @path requires a non-empty file path.`,m.USAGE,{code:"bulk_ids_input_missing_path",required:`Pass ${t} @<path>, ${t} -, or inline IDs.`});o=await(n.readFile??Ul)(s)}}catch(s){if(s instanceof p)throw s;let a=s instanceof Error?s.message:String(s);throw new p(`${t} could not read ${r==="-"?"stdin":`"${r.slice(1).trim()}"`}: ${a}`,m.NOT_FOUND,{code:"bulk_ids_input_unreadable",required:`Provide readable newline/comma-delimited IDs via ${t} -, ${t} @<path>, or inline argv text.`,nextSteps:[`Retry with inline IDs: ${t} pm-a1b2,pm-c3d4`,`Or pipe IDs: pm list --id-only | pm update-many ${t} - --dry-run`]})}let i=ls(o);if(i!=="")return i;throw new p(`${t} requires at least one non-empty item ID.`,m.USAGE,{code:"bulk_ids_input_empty",required:"Provide one or more comma- or newline-delimited IDs through argv, stdin, or @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]="1dcf0d72-10da-51b6-b9f6-ab47bebcbf64")}catch{}})();function us(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Lr(e){if(e==="/body"||e.startsWith("/body/"))return"body";if(e==="/metadata"||e.startsWith("/metadata/")||e==="/front_matter"||e.startsWith("/front_matter/")){let n=e.replace(/^\/(?:metadata|front_matter)\/?/,"").split("/")[0];return n?us(n):"metadata"}let t=e.replace(/^\//,"").split("/")[0];return t?us(t):"root"}function dn(e,t){return t==="body"?e.body:t==="metadata"?e.metadata:t==="root"?e:e.metadata[t]}function Bl(e,t){let n=t?.windowStartIndex??0,r=t?.field;if(e.length===0||n>=e.length)return[];let o=Fi(),i=[];for(let s=0;s<e.length;s+=1){let a=e[s],c=o,d=_t(o,a.patch),l;d.ok?(l=d.document,o=l):l=c;let u=new Set;for(let _ of a.patch)u.add(Lr(_.path)),_.from!==void 0&&u.add(Lr(_.from));let f=[...u].sort((_,y)=>_.localeCompare(y));if(s>=n)if(r!==void 0){if(!u.has(r))continue;let _={field:r,before:dn(c,r),after:dn(l,r)};i.push({index:s+1,ts:a.ts,op:a.op,author:a.author,patch_ops:a.patch.length,changed_fields:[r],changes:[_]})}else{let _=f.map(y=>({field:y,before:dn(c,y),after:dn(l,y)}));i.push({index:s+1,ts:a.ts,op:a.op,author:a.author,patch_ops:a.patch.length,changed_fields:f,changes:_})}}return i}import Wl from"node:fs/promises";import Yl 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]="fd3a41f0-4e82-59ab-bb8c-ed796c96a0d7")}catch{}})();function Gl(e){return[...new Set(e.filter(t=>t.trim().length>0))].sort((t,n)=>t.localeCompare(n))}function Kl(e,t){return new p(`Missing history stream for ${e}. ${t} requires history streams when settings.history.missing_stream is strict_error.`,m.NOT_FOUND)}async function Xl(e,t){return await Ti(Yl.dirname(e)),await(await Wl.open(e,"a")).close(),U({path:e,scope:"project",op:`${t}:history:auto_create`})}async function ln(e){return ms({pmRoot:e.pmRoot,settings:e.settings,itemIds:[e.itemId],commandLabel:e.commandLabel})}async function ms(e){let t=Gl(e.itemIds),n=[],r=[];for(let o of t){let i=te(e.pmRoot,o);if(!await j(i)){if(e.settings.history.missing_stream==="strict_error")throw Kl(o,e.commandLabel);r.push(...await Xl(i,e.commandLabel)),r.push(`history_stream_auto_created:${o}`),n.push(o)}}return{auto_created_ids:n,warnings:r}}import{readFile as Jl}from"node:fs/promises";(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]="80805c6b-9b9a-5dad-b94b-d7dbd365fe5e")}catch{}})();var Ql=e=>Jl(e,"utf8");async function Zl(e,t,n=Ql){if(t!==void 0)throw new p("--body and --body-file are mutually exclusive; provide the body inline with --body or from a file with --body-file, not both.",m.USAGE,{code:"body_file_conflicts_with_body",required:"Choose exactly one body source.",why:"Both --body and --body-file set the item body; allowing both would make the effective body ambiguous.",nextSteps:["Re-run with only --body <text> or only --body-file <path>."]});let r=e.trim();if(r.length===0)throw new p("--body-file requires a file path.",m.USAGE,{code:"body_file_missing_path",required:"Pass a readable file path: --body-file <path>.",why:"An empty --body-file value has no file to read the body from."});if(r==="-")return await Ue().resolveValue("-","--body-file");try{return await n(r)}catch(o){let i=o?.code,s=i==="EISDIR",a=i?` (${i})`:"";throw new p(s?`--body-file "${r}" is a directory, not a file. Point it at a readable file.`:`--body-file could not read "${r}"${a}. Check that the file exists and is readable.`,m.NOT_FOUND,{code:"body_file_unreadable",required:"Point --body-file at an existing, readable file.",why:`The body content is loaded from the file at the supplied path, so an unreadable path cannot produce a body${i?` (underlying error: ${i})`:""}.`,nextSteps:[`Verify the path: ls -l "${r}"`,"Or pipe the body with --body-file -.","Or pass the body inline with --body <text>."]})}}import eu from"node:crypto";import un 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]="664124e5-715d-5f86-ae69-89f203db76c3")}catch{}})();function ps(e){let t=[],n=!1;for(let r of(e??"").toLowerCase()){let o=r.charCodeAt(0),i=o>=48&&o<=57,s=o>=97&&o<=122;if(!i&&!s){n=t.length>0;continue}n&&(t.push("-"),n=!1),t.push(r)}return t.length===0?"pm-":`${t.join("")}-`}function Ve(e){let t=e.trim().toLowerCase();return t.startsWith("#")&&(t=t.slice(1)),t}function le(e,t){let n=ps(t),r=Ve(e);return r.startsWith(n)?r:`${n}${r}`}function tu(e){let t=Ri(e);if(t!==void 0)return t;let n="";for(let r=0;r<e;r+=1)n+=eu.randomInt(0,36).toString(36);return n}async function nu(e,t,n){let r=[...new Set(Object.values(n))].flatMap(o=>[un.join(e,o,`${t}.md`),un.join(e,o,`${t}.toon`)]);return r.push(un.join(e,"history",`${t}.jsonl`)),(await Promise.all(r.map(o=>j(o)))).some(Boolean)}var fs=4,_s=12;function ru(e){return typeof e!="number"||!Number.isFinite(e)?fs:Math.min(_s,Math.max(fs,Math.trunc(e)))}async function ou(e,t,n={}){let r=ru(n.tokenLength),o=Math.min(r+6,_s),i=0;for(;r<=o;){for(let s=0;s<32;s+=1){let a=`${ps(t)}${tu(r)}`;if(!await(n.probeExisting===!1?j(un.join(e,"history",`${a}.jsonl`)):nu(e,a,n.typeToFolder??ee)))return a;i+=1}r+=1}throw new Error(`Unable to generate unique id after ${i} attempts`)}(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]="0394e0c1-ff68-5553-b022-1e8b6fff04f0")}catch{}})();var iu=new Set(["none","null","undefined"]);function jb(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="warn"||t==="strict_error")return t;if(t==="strict")return"strict_error";throw new p("Config set parent-reference-policy requires --policy with one of: warn, strict_error (alias: strict)",m.USAGE)}function su(e,t="cli"){let n=t==="sdk";if(typeof e!="string")throw new p(n?`parent must be a string. ${bt("parent")}.`:"--parent must be a string. Use --unset parent to clear this field.",m.USAGE);let r=e.trim();if(r.length===0)throw new p(sn(t,"parent",". Use --parent none to unset."),m.USAGE);if(hs(r))throw new p(n?`parent must not be the placeholder "${r}". ${bt("parent")}, or omit parent.`:`--parent must not use placeholder token "${r}". Use --unset parent to clear this field.`,m.USAGE);return r}function hs(e){return iu.has(e.trim().toLowerCase())}function au(e,t,n="cli"){if(t==="strict_error")throw new p(`Parent item "${e}" was not found. Create it first or ${n==="sdk"?"omit parent":"use --parent none"}.`,m.USAGE);return{warnings:[`validation_warning:parent_reference_missing:${e}`]}}function cu(e,t,n,r="cli"){let o=le(e,n),i=le(t,n);if(o!==i)return;let s=t!==i||e!==o?` (normalized from parent "${t}" and item "${e}")`:"";throw new p(`Parent item "${i}" cannot be the same as item "${o}"${s}. ${r==="sdk"?`${bt("parent")}.`:"Use --unset parent to clear this field."}`,m.USAGE)}(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]="a59d5b7f-9764-53c5-a014-1119868be8ea")}catch{}})();var Pr={critical:0,high:1,medium:2,low:3,minimal:4},ys=Object.keys(Pr),du=`numbers 0..4 (0=critical, 1=high, 2=medium, 3=low, 4=minimal) or names (${ys.join(", ")}), case-insensitive`;function mn(e){return new p(`Invalid priority "${e}". Accepted values: ${du}.`,m.USAGE,{code:"invalid_argument_value",field:"priority",value:e,allowed:["0","1","2","3","4",...ys]})}function lu(e){if(typeof e=="number"){if(Number.isInteger(e)&&e>=0&&e<=4)return e;throw mn(String(e))}if(typeof e!="string")throw mn(String(e));let t=e.trim();if(t.length===0)throw mn(e);let n=t.toLowerCase();if(Object.prototype.hasOwnProperty.call(Pr,n))return Pr[n];if(/^[0-4]$/.test(t))return Number(t);throw mn(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]="e363ee89-b438-5c8e-bb06-f4d05cc814cc")}catch{}})();function uu(e){let t={...e};for(let[n,r]of Object.entries(t))Array.isArray(r)&&Reflect.set(t,n,[...r]);return Cr(St(e,t))}function mu(e){return wt(Et(St(e,{...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]="6012e77b-7cdd-5496-a668-c9240a811b1a")}catch{}})();var fu=/^[A-Za-z0-9][A-Za-z0-9._/-]*$/,pu=64;function Xb(e){let t=e?.trim().toLowerCase().replaceAll("-","_");if(t==="warn"||t==="strict_error")return t;if(t==="strict")return"strict_error";throw new p("Config set sprint-release-format-policy requires --policy with one of: warn, strict_error (alias: strict)",m.USAGE)}function _u(e,t,n,r="cli"){let o=t.trim();if(o.length===0)throw new p(sn(r,e,`. Use --${e} none to unset.`),m.USAGE);if(o.length<=pu&&fu.test(o))return{value:o,warnings:[]};let i="Expected 1-64 characters matching [A-Za-z0-9][A-Za-z0-9._/-]* (no spaces).";if(n==="strict_error")throw new p(`Invalid ${r==="sdk"?e:`--${e}`} value "${o}". ${i}`,m.USAGE);return{value:o,warnings:[`validation_warning:${e}_format:${o}`]}}(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]="14e6c7b4-3161-5f82-b797-f06a879d1370")}catch{}})();var gs={open:"open_status",closed:"close_status",canceled:"canceled_status",cancelled:"canceled_status"},ws="all";function nE(e){if(typeof e!="string")return!1;let t=e.split(",").map(n=>n.trim().toLowerCase()).filter(n=>n.length>0);return t.length===1&&t[0]===ws}function hu(e,t){let n=e.trim().toLowerCase();if(n.length===0)return;let r=gs[n];return r?t[r]:yr(e,t)}function yu(e){let t=new Set(Object.keys(gs));for(let n of e.definitions){t.add(n.id);for(let r of n.aliases)t.add(r)}return[...t]}function gu(e,t){let n=e.trim().toLowerCase(),r,o=Number.POSITIVE_INFINITY;for(let i of yu(t)){let s=be(n,i.toLowerCase(),2);s!==null&&s<o&&(r=i,o=s)}return r}function wu(e,t,n){if(typeof e!="string")return;let r=n?.strict===!0,o=n?.flagLabel??"--status",i=e.split(",").map(a=>a.trim()).filter(a=>a.length>0);if(i.length===0)return;if(i.filter(a=>a.trim().toLowerCase()===ws).length>0){if(i.length===1)return;throw new p(`Invalid ${o} value "all". Use it by itself, or omit ${o} to search every status.`,m.USAGE)}let s=[];for(let a of i){let c=hu(a,t);if(c===void 0){if(r){let d=gu(a,t);throw new p(`Invalid ${o} value "${a}". Use open|closed|canceled or a configured status id${d?`. Did you mean "${d}"?`:"."}`,m.USAGE)}s.push(a);continue}s.push(c)}return[...new Set(s)]}(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]="50f77f3f-b2b0-5ae2-b669-6ed50bbdd530")}catch{}})();var bu={bug:"Issue",bugfix:"Issue",defect:"Issue",incident:"Issue",enhancement:"Feature",story:"Feature",userstory:"Feature","user-story":"Feature","user story":"Feature",change:"Chore",ticket:"Task",todo:"Task"};function Eu(e){if(e!==void 0)return bu[e.trim().toLowerCase()]}(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]="c628dcf9-d98f-566e-9f93-cc81e737691c")}catch{}})();function Es(e){let t=[],n=new Set;for(let r of e)for(let o of Object.keys(r))n.has(o)||(n.add(o),t.push(o));return t}function $r(e){return e==null?"":Array.isArray(e)?e.map(t=>$r(t)).join(";"):typeof e=="object"?JSON.stringify(e):String(e)}function bs(e){return/[",\r\n]/.test(e)?`"${e.replace(/"/g,'""')}"`:e}function Su(e){if(e.length===0)return"";let t=Es(e),n=[t.map(r=>bs(r)).join(",")];for(let r of e)n.push(t.map(o=>bs($r(r[o]))).join(","));return n.join(`
12
12
  `)}function vu(e){if(e.length===0)return"";let t=Es(e),n=e.map(s=>t.map(a=>$r(s[a]))),r=t.map((s,a)=>Math.max(s.length,...n.map(c=>c[a].length))),o=(s,a)=>s.padEnd(r[a]),i=[t.map((s,a)=>o(s,a)).join(" | ")];i.push(r.map(s=>"-".repeat(s)).join("-+-"));for(let s of n)i.push(s.map((a,c)=>o(a,c)).join(" | "));return i.join(`
13
13
  `)}(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]="b84fee06-5bbd-57f9-9643-f283d6c87afa")}catch{}})();function Tu(e,t="--limit"){if(e===void 0)return;let n=Number(e);if(!Number.isFinite(n)||n<0)throw new p(`${t} must be a non-negative number`,m.USAGE);return Math.floor(n)}(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]="158d5065-075c-5355-a65c-f3edc9c5f1f0")}catch{}})();var Iu=new Map(ot.map(e=>[e.toLowerCase(),e])),Cu=/^[A-Za-z][A-Za-z0-9_-]*$/;function Ss(e,t){if(!Cu.test(e))throw new Error(`${t} "${e}" is not a valid identifier. Use a single letter-led token of letters, digits, hyphen, or underscore with no spaces or punctuation (e.g. "Spike" or "code-review").`)}function Fr(e){return Iu.get(e.trim().toLowerCase())}function Is(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function Au(e){return e.replace(/[\\"`$]/g,t=>`\\${t}`)}function Cs(e){let t=new Map;for(let n of e){let r=n.trim();if(r.length===0)continue;let o=r.toLowerCase();t.has(o)||t.set(o,r)}return[...t.values()].sort((n,r)=>n.localeCompare(r))}function uE(e){let t=(e.name??"").trim();if(t.length===0)throw new Error("Type name must not be empty.");Ss(t,"Type name");let n=Fr(t);if(n)throw new Error(`Cannot redefine built-in item type "${n}". Built-in types are reserved: ${ot.join(", ")}.`);let r=e.description?.trim(),o=e.defaultStatus?.trim(),i=e.folder?.trim(),s=i&&i.length>0?ur(i):void 0,a=Cs(e.aliases??[]);for(let c of a){Ss(c,"Alias");let d=Fr(c);if(d)throw new Error(`Alias "${c}" collides with built-in item type "${d}". Built-in types are reserved: ${ot.join(", ")}.`)}return{name:t,description:r&&r.length>0?r:void 0,defaultStatus:o&&o.length>0?o:void 0,folder:s,aliases:a}}function mE(e,t){let n=e.name.toLowerCase(),r=new Map;for(let i of t.definitions){if(typeof i.name!="string")continue;let s=i.name.trim();if(!(s.length===0||s.toLowerCase()===n)){r.set(s.toLowerCase(),s);for(let a of Is(i.aliases))a.trim().length>0&&r.set(a.trim().toLowerCase(),s)}}let o=r.get(n);if(o)throw new Error(`Type name "${e.name}" collides with an alias of existing item type "${o}".`);for(let i of e.aliases){let s=r.get(i.toLowerCase());if(s)throw new Error(`Alias "${i}" already maps to existing item type "${s}".`)}}function vs(e,t){return typeof t=="string"&&t.trim().length>0?ur(t).toLowerCase():Ii(e).toLowerCase()}function fE(e,t,n){let r=e.name.toLowerCase(),o=vs(e.name,e.folder),i=a=>{throw new Error(`Item type "${e.name}" would store items in folder "${o}", which already belongs to existing item type "${a}". Pass a distinct --folder to keep their storage separate.`)};for(let a of t.definitions){if(typeof a.name!="string")continue;let c=a.name.trim();c.length===0||c.toLowerCase()===r||vs(c,a.folder)===o&&i(c)}let s=n?.get(o);s!==void 0&&s.toLowerCase()!==r&&i(s)}function pE(e){if(e==null||e.trim().length===0)return{definitions:[]};let t;try{t=JSON.parse(e)}catch{throw new Error("schema/types.json contains invalid JSON.")}return{definitions:xu(t)}}function xu(e){let t=Ru(e);if(!t)return[];let n=[];for(let r of t){if(typeof r!="object"||r===null||Array.isArray(r))continue;let o=r;typeof o.name!="string"||o.name.trim().length===0||n.push(o)}return n}function Ru(e){if(Array.isArray(e))return e;if(typeof e!="object"||e===null)return;let t=e;if(Array.isArray(t.definitions))return t.definitions;if(typeof t.item_types=="object"&&t.item_types!==null){let n=t.item_types;if(Array.isArray(n.definitions))return n.definitions}}function _E(e,t){let n=t.name.toLowerCase(),r=e.definitions.slice(),o=r.findIndex(c=>typeof c.name=="string"&&c.name.trim().toLowerCase()===n),i=o>=0?r[o]:void 0,s=Cs([...Is(i?.aliases),...t.aliases]),a={...i,name:t.name};return t.folder!==void 0&&(a.folder=t.folder),s.length>0?a.aliases=s:a.aliases!==void 0&&delete a.aliases,Ts(a,"description",t.description),Ts(a,"default_status",t.defaultStatus),o>=0?r[o]=a:r.push(a),r.sort((c,d)=>c.name.localeCompare(d.name)),{file:{definitions:r},definition:a,replaced:o>=0,...i&&typeof i.name=="string"?{previousName:i.name}:{}}}function hE(e,t){let n=(t??"").trim();if(n.length===0)throw new Error("Type name must not be empty.");let r=Fr(n);if(r)throw new Error(`Cannot remove built-in item type "${r}". Built-in types are reserved: ${ot.join(", ")}.`);let o=n.toLowerCase(),i=e.definitions.slice(),s=i.findIndex(c=>typeof c.name=="string"&&c.name.trim().toLowerCase()===o);if(s<0)return{file:{definitions:i},removed:!1};let[a]=i.splice(s,1);return{file:{definitions:i},removed:!0,definition:a}}function Ts(e,t,n){let r=e;n!==void 0&&(r[t]=n)}function yE(e){return`${JSON.stringify({definitions:e.definitions},null,2)}
@@ -119,4 +119,4 @@ Enable telemetry now? [${e?"Y/n":"y/N"}] `,n=Py.createInterface({input:$y,output
119
119
  `)){let r=n.trim();if(r.length!==0)try{let o=JSON.parse(r);o&&typeof o=="object"&&typeof o.endpoint=="string"&&o.endpoint.trim().length>0&&"payload"in o&&typeof o.attempts=="number"&&Number.isFinite(o.attempts)&&((typeof o.id!="string"||o.id.length===0)&&(o.id=Gg(o)),t.push(o))}catch{}}return t}function Kg(e,t){if(typeof e.enqueued_at!="string"||e.enqueued_at.trim().length===0)return!1;let n=Date.parse(e.enqueued_at);return Number.isNaN(n)?!1:n<t}function mi(e,t){let n=Id(t),r=[],o=0;for(let i of e){if(JSON.stringify(i).length>nr||Kg(i,n)||i.attempts>=rd){o+=1;continue}r.push(i)}if(r.length>Hc){let i=r.length-Hc;return o+=i,{entries:r.slice(i),prunedCount:o}}return{entries:r,prunedCount:o}}async function Xg(e,t){let n=t.map(o=>JSON.stringify(o)).join(`
120
120
  `),r=n.length>0?`${n}
121
121
  `:"";for(let o=0;;o+=1)try{await T(Bt(e),r,{createParentDirectories:!se(process.env[ue])});return}catch(i){let s=od[o];if(s===void 0||!Ad(i))throw i;await xd(s)}}async function Jc(e,t,n,r){return ge(async()=>{let o=await C(Bt(e)),i=o===null?[]:ui(o),s=[];for(let c of i){if(n.has(c.id))continue;let d=r.get(c.id);s.push(d?{...c,attempts:d.attempts,next_attempt_after:d.next_attempt_after}:c)}let{entries:a}=mi(s,t);return await Xg(e,a),a.length},e)}async function Jg(e,t){let n=await C(Bt(e));if(n===null||n.trim().length===0){await Zn(e,{pending_otel_spans:0},null);return}let r=ui(n),{entries:o,prunedCount:i}=mi(r,t),s=o.filter(y=>li(y.next_attempt_after)).slice(0,ng);if(s.length===0){let y=i>0?await Jc(e,t,new Set,new Map):o.length;await Zn(e,{pending_otel_spans:y},null);return}let a=$(),c=new Set,d=new Map,l=0,u;await Promise.all(s.map(async y=>{try{let g=await hd(y.endpoint,{"content-type":"application/json"},JSON.stringify(y.payload));if(g<200||g>=300)throw new Error(`local_otel_export_http_${g}`);c.add(y.id),l+=1}catch(g){u=g instanceof Error?k(Un(g.message),"redacted"):"local_otel_export_failed";let h=y.attempts+1;d.set(y.id,{attempts:h,next_attempt_after:vd(h)})}}));let f=await Jc(e,t,c,d),_={pending_otel_spans:f,last_otel_attempt_at:a};l>0&&(_.last_otel_success_at=a),u!==void 0?(_.last_otel_failure_at=a,_.last_otel_failure_error=u):f===0&&(_.last_otel_failure_at=void 0,_.last_otel_failure_error=void 0),await Zn(e,_,null)}async function Rd(e,t,n){try{await tw(e,t,n)}catch{}try{await Jg(e,n)}catch{}}async function Qg(e,t=lg,n=z().endpoint){try{let r=kg(e),o=await Xy(r,{withFileTypes:!0}),i=Date.now(),s=new Set([Ut("events.jsonl",n),Ut("state.json",n)]),a=c=>{if(!s.has(c))return/^\.events(?:\.[a-f0-9]{16})?\.jsonl\.\d+\.\d+\.[a-f0-9]+\.tmp$/.test(c)?i-Math.max(0,t):/^(?:events\.[a-f0-9]{16}\.jsonl|state\.[a-f0-9]{16}\.json)$/.test(c)?i-ug:void 0};await Promise.all(o.map(async c=>{let d=c.isFile()?a(c.name):void 0;if(d===void 0)return;let l=O.join(r,c.name);(await ed(l)).mtimeMs<d&&await ni(l,{force:!0})}))}catch{}}async function ge(e,t=me(process.cwd()),n=5e3){let r=Yc.catch(()=>{}).then(()=>Oi(async()=>{let o=await Se(t,"telemetry-queue",60,"telemetry",!1,!1,n,{createParentDirectories:!se(process.env[ue])});try{return nn(t),await e()}finally{await o()}}));return Yc=r.catch(()=>{}),r}async function ir(e,t=z().endpoint){let n=await C(qt(e,t));return n===null||n.trim().length===0?[]:Sd(n)}async function Jo(e,t,n,r=z().endpoint){return ge(async()=>{let o=await ir(e,r),{entries:i}=or(o,n),s=i.filter(a=>!t.has(a.event.event_id));return await Cd(e,s,r),s},e)}async function Zg(e,t,n,r,o=z().endpoint){return ge(async()=>{let i=await ir(e,o),{entries:s}=or(i,r),a=s.map(c=>{if(!t.has(c.event.event_id))return c;let d=c.attempts+1;return{...c,attempts:d,last_attempt_at:n,next_attempt_after:vd(d)}});return await Cd(e,a,o),a},e)}function ew(e,t){return t===null?e:zn(e)}async function tw(e,t,n){let r=z().endpoint;await Qg(e,void 0,r);let o=(r??t).trim(),i=ew(o,r),s=h=>Zn(e,h,r);if(o.length===0)return;let a=await C(qt(e,r));if(a===null||a.trim().length===0){await s({endpoint:i,queue_entries:0});return}let c=Sd(a);if(c.length===0){await s({endpoint:i,queue_entries:0});return}let{entries:d,prunedCount:l}=or(c,n);if(d.length===0){let h=await Jo(e,new Set,n,r);await s({endpoint:i,queue_entries:h.length});return}let u=d.filter(h=>Td(h)).slice(0,rg);if(u.length===0){let h=l>0?await Jo(e,new Set,n,r):d;await s({endpoint:i,queue_entries:h.length});return}let f=new Set(u.map(h=>h.event.event_id)),_=$(),y={"content-type":"application/json"},g=process.env.PM_TELEMETRY_INGEST_KEY?.trim();g&&(y["x-pm-telemetry-key"]=g);try{let h=await hd(o,y,JSON.stringify({schema_version:tr,events:u.map(w=>w.event)}));if(h<200||h>=300)throw new Error(`telemetry_flush_http_${h}`)}catch(h){let w=await Zg(e,f,_,n,r),b=h instanceof Error?k(Un(h.message),"redacted"):"telemetry_flush_failed";await s({endpoint:i,queue_entries:w.length,last_attempted_flush_at:_,last_failed_flush_at:_,last_failed_flush_error:b});return}try{let h=await Jo(e,f,n,r);await s({endpoint:i,queue_entries:h.length,last_attempted_flush_at:_,last_successful_flush_at:_,last_failed_flush_at:void 0,last_failed_flush_error:void 0})}catch(h){let w=h instanceof Error?k(Un(h.message),"redacted"):"telemetry_flush_failed",b=await ir(e,r).catch(()=>d);await s({endpoint:i,queue_entries:b.length,last_attempted_flush_at:_,last_failed_flush_at:_,last_failed_flush_error:w})}}async function nw(e){let t=ii(e);se(process.env[ue])||await Ko(O.dirname(t),{recursive:!0});try{return await Ko(t),!0}catch(n){if(typeof n!="object"||n===null||!("code"in n)||n.code!=="EEXIST")throw n}try{let n=await ed(t);return Date.now()-n.mtimeMs<id?!1:(await ni(t,{recursive:!0,force:!0}),await Ko(t),!0)}catch{return!1}}function rw(e,t){try{return Date.now()-Zc(e).mtimeMs<t}catch{return!1}}function kd(e){try{Ky(e,{recursive:!0,force:!0})}catch{}}function ow(e){if(typeof e!="object"||e===null||!("code"in e))return;let t=e.code;return typeof t=="string"?t:void 0}function iw(e){try{return Go(e),!0}catch(t){if(ow(t)==="EEXIST"||!P(t))return!1}try{return Go(O.dirname(e),{recursive:!0}),Go(e),!0}catch{return!1}}function sw(e){if(rw(ii(e),id))return!1;let t=cd(e);try{if(Date.now()-Zc(t).mtimeMs<mg)return!1;kd(t)}catch(n){if(!P(n))return!1}return iw(t)}function ti(e){kd(cd(e))}async function aw(e,t,n){let r=await nw(e);if(ti(e),!r)return!1;try{await Rd(e,t,n)}finally{try{await ni(ii(e),{recursive:!0,force:!0})}catch{}}return!0}async function Qc(e,t){let n=new Set;try{let{entries:r}=or(await ir(e),t);for(let o of r.filter(Td))n.add(`event:${o.event.event_id}`)}catch{}try{let r=await C(Bt(e));if(r!==null)for(let o of mi(ui(r),t).entries)li(o.next_attempt_after)&&n.add(`span:${o.id}`)}catch{}return n}function fi(e,t,n){if(!Tr(e)){if(Dg())return Xo=Xo.then(()=>Rd(e,t,n)),Xo;try{if(!sw(e))return;let r=Gy(process.execPath,[Og()],{detached:!0,stdio:"ignore",cwd:ri.tmpdir(),env:{...process.env,PM_GLOBAL_PATH:e,[ue]:"1"}});r.on("error",()=>{ti(e)}),r.unref()}catch{ti(e)}}}async function MI(e=me(process.cwd())){if(!K().telemetry_disabled)try{await vr(e,async()=>{let t=se(process.env[ue]),n=!0;for(;n;){if(!(await Y(e)).telemetry.enabled)return;let r=await ge(()=>di(e),e);if(!r)return;let o=t?await Qc(e,r.retentionDays):new Set;if(!await aw(e,r.endpoint,r.retentionDays)||!t)return;let i=await Qc(e,r.retentionDays);n=i.size>0&&(i.size!==o.size||[...i].some(s=>!o.has(s)))}},()=>se(process.env[ue]))}catch{}}async function cw(e){if(K().telemetry_disabled||e.command==="telemetry"&&e.args.some(t=>t.trim().toLowerCase()==="clear"))return null;try{let t=me(process.cwd());if(!(await Y(t)).telemetry.enabled)return null;let n=e.global.noExtensions===!0||Di(e.command),r=await ge(async()=>{let o=await di(t);if(!o)return null;let{installationId:i,endpoint:s,retentionDays:a,captureLevel:c}=o,d=yd(e.pm_version),l=wd(e.global),u=F(i,e.pm_root),f=F(i,process.cwd()),_=jg(),y=$(),g={schema_version:tr,event_id:J.randomUUID(),event_type:"command_start",occurred_at:y,installation_id:i,session_id:rr,command:e.command,payload:Hg({captureLevel:c,context:e,pmVersion:d,sourceContext:l,pmRootHash:u,cwdHash:f,installationId:i})},h=await Vc(t,e.command,n);h===1&&await er(t,g);let w=De(e.command),b={...h<1?{sample_rate:h}:{},started_at:y,started_at_ms:Date.now(),command:e.command,command_taxonomy:w,pm_version:d,source_context:l.source_context,source_context_source:l.source_context_source,installation_id:i,pm_root_hash:u,cwd_hash:f,endpoint:s,retention_days:a,global_pm_root:t,capture_level:c,otel_traces_endpoint:_??void 0,otel_trace_id:_?J.randomBytes(16).toString("hex"):void 0,otel_span_id:_?J.randomBytes(8).toString("hex"):void 0};return h<1&&Qn.set(b,g),b},t,oi);return r&&r.sample_rate===void 0&&fi(t,r.endpoint,r.retention_days),r}catch{return null}}async function dw(e,t){if(!(!e||K().telemetry_disabled))try{if(!await ge(async()=>{let n=await Y(e.global_pm_root);if(K().telemetry_disabled||!n.telemetry.enabled||n.telemetry.installation_id!==e.installation_id)return Qn.delete(e),!1;let r=Qn.get(e),o=t.ok?e.sample_rate??1:1;if(r){if(Qn.delete(e),J.randomBytes(6).readUIntBE(0,6)/281474976710656>=o)return!1;r.payload.sample_rate=o,await er(e.global_pm_root,r)}let i=$(),s=Math.max(0,Date.now()-e.started_at_ms),a=si(Fo({ok:t.ok,errorCode:t.error_code,errorMessage:t.error,exitCode:t.exit_code})),c=gd({ok:t.ok,errorCode:a,errorCategory:t.error_category}),d=ai(t.exit_code,t.ok),l=t.command_resolution??Ze({ok:t.ok,errorCode:a,errorCategory:c}),u=t.resolution_stage??"execute",f={schema_version:tr,event_id:J.randomUUID(),event_type:"command_finish",occurred_at:i,installation_id:e.installation_id,session_id:rr,command:e.command,payload:{...r?{sample_rate:o}:{},...qg({captureLevel:e.capture_level,pmVersion:e.pm_version,sourceContext:{source_context:e.source_context,source_context_source:e.source_context_source},outcome:t,durationMs:s,startedAt:e.started_at,command:e.command,installationId:e.installation_id,commandTaxonomy:e.command_taxonomy,exitCode:d,errorCode:a,errorCategory:c,commandResolution:l,resolutionStage:u})}};await er(e.global_pm_root,f);let _=Ug(e,{...t,exit_code:d,error_code:a,error_category:c},i,s,o);return _&&await Yg(e.global_pm_root,_),!0},e.global_pm_root,oi))return;await fi(e.global_pm_root,e.endpoint,e.retention_days)}catch{}}async function lw(e){if(!K().telemetry_disabled)try{let t=me(process.cwd());if(!(await Y(t)).telemetry.enabled)return;let n=await ge(async()=>{let r=await di(t);if(!r)return null;let{installationId:o,captureLevel:i}=r,s=yd(e.pm_version),a=wd(e.global),c=F(o,e.pm_root),d=F(o,process.cwd()),l=$(),u=si(Fo({ok:!1,errorCode:e.error_code,errorMessage:e.error_message,exitCode:e.exit_code})),f=e.error_category??Yt(u),_=ai(e.exit_code,!1),y=e.command.trim().length>0?e.command:"<unknown>",g=De(y),h=e.command_resolution??Ze({ok:!1,errorCode:u,errorCategory:f}),w=e.resolution_stage??"unknown",b={schema_version:tr,event_id:J.randomUUID(),event_type:"command_error",occurred_at:l,installation_id:o,session_id:rr,command:k(y,"redacted"),payload:Bg({captureLevel:i,pmVersion:s,sourceContext:a,command:y,commandTaxonomy:g,commandResolution:h,resolutionStage:w,args:e.args,options:e.options,pmRootHash:c,cwdHash:d,installationId:o,errorCode:u,errorCategory:f,exitCode:_,errorMessage:e.error_message})};return await er(t,b),r},t,oi);n&&await fi(t,n.endpoint,n.retentionDays)}catch{}}(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]="79bb744c-f468-5333-b39a-552bf8639096")}catch{}})();(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]="e216fd39-09ee-5a04-b0b5-44f518db4f93")}catch{}})();function aR(e){let t=e?.trim()??"";return/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(t)||/^(?:github|gitlab|jira|linear):/iu.test(t)}function cR(e){let t=e?.trim().toLowerCase();return t==="global"||t==="external"}export{Pd as a,Ar as b,qi as c,$d as d,_w as e,Vi as f,sn as g,Yi as h,Gi as i,jd as j,zd as k,Ud as l,Vd as m,kr as n,Xd as o,bw as p,Jd as q,Ew as r,Et as s,Zd as t,St as u,Sw as v,el as w,an as x,vw as y,Ue as z,nl as A,rl as B,Rw as C,Dr as D,kw as E,Ow as F,vt as G,Dw as H,Zi as I,fl as J,Yw as K,_l as L,yl as M,wl as N,bl as O,Qw as P,Sl as Q,cn as R,Tt as S,Al as T,Ol as U,ob as V,$l as W,sb as X,Fl as Y,jl as Z,ab as _,Mr as $,ls as aa,ql as ba,Lr as ca,Bl as da,ln as ea,ms as fa,Zl as ga,ps as ha,Ve as ia,le as ja,ou as ka,jb as la,su as ma,hs as na,au as oa,cu as pa,lu as qa,uu as ra,mu as sa,Xb as ta,_u as ua,nE as va,wu as wa,Eu as xa,Su as ya,vu as za,Tu as Aa,Fr as Ba,Au as Ca,uE as Da,mE as Ea,fE as Fa,pE as Ga,_E as Ha,hE as Ia,yE as Ja,Ou as Ka,Du as La,Nu as Ma,Mu as Na,Lu as Oa,Pu as Pa,He as Qa,Ms as Ra,um as Sa,FE as Ta,It as Ua,bm as Va,Us as Wa,Vr as Xa,Vs as Ya,YE as Za,Sm as _a,Tm as $a,Im as ab,Cm as bb,Am as cb,Hr as db,lS as eb,bS as fb,ES as gb,SS as hb,vS as ib,TS as jb,IS as kb,CS as lb,AS as mb,Mm as nb,Lm as ob,Pm as pb,xS as qb,Vm as rb,RS as sb,kS as tb,Jr as ub,Zr as vb,pv as wb,FS as xb,jS as yb,zS as zb,sa as Ab,nf as Bb,ao as Cb,ZS as Db,co as Eb,Mt as Fb,Ye as Gb,Lt as Hb,Vf as Ib,ga as Jb,Hf as Kb,Bv as Lb,mo as Mb,wa as Nb,Xf as Ob,Wv as Pb,Jf as Qb,Qf as Rb,Qv as Sb,xn as Tb,Ca as Ub,_o as Vb,up as Wb,mp as Xb,tT as Yb,Aa as Zb,Ge as _b,ho as $b,go as ac,Nn as bc,fT as cc,Co as dc,Ln as ec,Ma as fc,Pn as gc,Ao as hc,xo as ic,Ro as jc,ko as kc,za as lc,Ua as mc,Pa as nc,c_ as oc,$n as pc,Je as qc,Ut as rc,u_ as sc,zn as tc,LT as uc,K as vc,ke as wc,y_ as xc,Ja as yc,Qa as zc,Za as Ac,b_ as Bc,VT as Cc,T_ as Dc,HT as Ec,qT as Fc,Vt as Gc,wc as Hc,lh as Ic,Ht as Jc,n0 as Kc,r0 as Lc,uh as Mc,mh as Nc,o0 as Oc,i0 as Pc,Ze as Qc,vh as Rc,Th as Sc,Ih as Tc,Ch as Uc,kh as Vc,Oh as Wc,Nh as Xc,Qh as Yc,Ic as Zc,ey as _c,ty as $c,ny as ad,E0 as bd,Vo as cd,Ac as dd,Cc as ed,iy as fd,sy as gd,xc as hd,dy as id,fy as jd,_y as kd,yy as ld,gy as md,Sy as nd,Ty as od,Iy as pd,Jn as qd,My as rd,Ly as sd,By as td,tr as ud,rd as vd,ge as wd,MI as xd,cw as yd,dw as zd,lw as Ad,aR as Bd,cR as Cd};
122
- //# sourceMappingURL=chunk-ASJZMYKM.js.map
122
+ //# sourceMappingURL=chunk-D727C4RO.js.map
@@ -1,2 +1,2 @@
1
- import{b as R}from"./chunk-G6Q4VQSI.js";import{Ua as E,Wa as D,Ya as T,Za as H}from"./chunk-ASJZMYKM.js";import{Fa as c,Md as g,Na as y,Ui as x,ej as M,fi as _,hi as I,ii as v,pd as p,qi as b,uf as u,ui as w}from"./chunk-GCPP37N6.js";import{A as f,C as l}from"./chunk-O4ZLEN4T.js";(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]="eb2e6046-156c-56ee-a03a-ecaa1cccfb45")}catch{}})();function K(e,t){let i=w(e),s=e.length>0?e[e.length-1].after_hash:v(),a=t===void 0||i.item_hash_version===void 0?void 0:I(t,i.item_hash_version,g(e.at(-1)?.hash_algorithm)),n=t===void 0?void 0:a===void 0?_(t):a[Math.max(0,a.indexOf(s))],o=n===void 0?void 0:n===s,r=[...i.errors];return o===!1&&r.push("verify_failed:current_item_hash_mismatch"),{ok:r.length===0,entries:e.length,errors:r,latest_after_hash:e.length>0?e[e.length-1].after_hash:void 0,current_item_hash:n,current_matches_latest:o}}async function Q(e,t,i={}){let s=y(i.cwd??process.cwd(),i.pmRoot);await M(s);let a=await x(s),n=c(a,p()),o=await R(s,e,a,n.type_to_folder),r=await u(o.historyPath,o.id);if(r.length===0)throw new l(`No history exists for ${o.id}; point-in-time reads are unavailable.`,f.NOT_FOUND);let d=D(t,r),C=H(T(r,d.historyIndex),d),m=b(C,{schema:a.schema});if(m.metadata.id!==o.id)throw new l(`History target resolved to item ${m.metadata.id}, expected ${o.id}.`,f.GENERIC_FAILURE);let k=r[d.historyIndex],h=E(r,!0);return{document:m,reconstructed:!0,as_of_version:h===null?null:h+d.historyIndex+1,as_of_timestamp:k.ts,target:d,history_length:r.length}}(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]="e524f0ad-faad-5d89-b8f5-1283979919ad")}catch{}})();export{K as a,Q as b};
2
- //# sourceMappingURL=chunk-6V4PGJBZ.js.map
1
+ import{b as R}from"./chunk-4AASUCHO.js";import{Ua as E,Wa as D,Ya as T,Za as H}from"./chunk-D727C4RO.js";import{Fa as c,Md as g,Na as y,Ui as x,ej as M,fi as _,hi as I,ii as v,pd as p,qi as b,uf as u,ui as w}from"./chunk-WNEUWDUE.js";import{A as f,C as l}from"./chunk-O4ZLEN4T.js";(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]="eb2e6046-156c-56ee-a03a-ecaa1cccfb45")}catch{}})();function K(e,t){let i=w(e),s=e.length>0?e[e.length-1].after_hash:v(),a=t===void 0||i.item_hash_version===void 0?void 0:I(t,i.item_hash_version,g(e.at(-1)?.hash_algorithm)),n=t===void 0?void 0:a===void 0?_(t):a[Math.max(0,a.indexOf(s))],o=n===void 0?void 0:n===s,r=[...i.errors];return o===!1&&r.push("verify_failed:current_item_hash_mismatch"),{ok:r.length===0,entries:e.length,errors:r,latest_after_hash:e.length>0?e[e.length-1].after_hash:void 0,current_item_hash:n,current_matches_latest:o}}async function Q(e,t,i={}){let s=y(i.cwd??process.cwd(),i.pmRoot);await M(s);let a=await x(s),n=c(a,p()),o=await R(s,e,a,n.type_to_folder),r=await u(o.historyPath,o.id);if(r.length===0)throw new l(`No history exists for ${o.id}; point-in-time reads are unavailable.`,f.NOT_FOUND);let d=D(t,r),C=H(T(r,d.historyIndex),d),m=b(C,{schema:a.schema});if(m.metadata.id!==o.id)throw new l(`History target resolved to item ${m.metadata.id}, expected ${o.id}.`,f.GENERIC_FAILURE);let k=r[d.historyIndex],h=E(r,!0);return{document:m,reconstructed:!0,as_of_version:h===null?null:h+d.historyIndex+1,as_of_timestamp:k.ts,target:d,history_length:r.length}}(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]="e524f0ad-faad-5d89-b8f5-1283979919ad")}catch{}})();export{K as a,Q as b};
2
+ //# sourceMappingURL=chunk-EHDGHFMJ.js.map
@@ -1,2 +1,2 @@
1
- import{ga as p,ha as i,ia as v,ja as _}from"./chunk-Z3QEEOAM.js";import{Pa as h}from"./chunk-GCPP37N6.js";import u from"node:fs/promises";import c 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]="846100a9-4314-5f7c-b892-fa16e09bee5b")}catch{}})();function f(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}function y(e){return e!=="invalid"&&e!=="unreadable"}function j(e){let t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))throw new SyntaxError("Invalid settings object");let r=t.extensions;if(r===void 0)return{enabled:[],disabled:[]};if(typeof r!="object"||r===null||Array.isArray(r))throw new SyntaxError("Invalid extensions settings");let n=r;if(n.enabled!==void 0&&(!Array.isArray(n.enabled)||!n.enabled.every(a=>typeof a=="string"))||n.disabled!==void 0&&(!Array.isArray(n.disabled)||!n.disabled.every(a=>typeof a=="string")))throw new SyntaxError("Invalid extension enablement lists");return{enabled:n.enabled??[],disabled:n.disabled??[]}}async function S(e){let t;try{t=await u.readFile(e,"utf8")}catch(r){return f(r)?{status:"absent",enabled:[],disabled:[]}:{status:"unreadable",enabled:[],disabled:[],error:{code:"settings_unreadable",path:e}}}try{return{status:"ok",...j(t)}}catch{return{status:"invalid",enabled:[],disabled:[],error:{code:"settings_invalid",path:e}}}}async function A(e){let t;try{t=await u.readFile(e,"utf8")}catch(r){if(f(r))try{if((await u.stat(c.dirname(e))).isDirectory())return{status:"absent",entries:[]}}catch(n){if(f(n))return{status:"absent",entries:[]}}return{status:"unreadable",entries:[],error:{code:"managed_state_unreadable",path:e}}}try{let r=JSON.parse(t),n=_(r);if(!n||typeof r!="object"||r===null||!Array.isArray(r.entries)||n.entries.length!==r.entries.length)throw new SyntaxError("Invalid managed extension state");return{status:"ok",entries:n.entries}}catch{return{status:"invalid",entries:[],error:{code:"managed_state_invalid",path:e}}}}async function I(e){try{return{directories:(await u.readdir(e,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).sort((t,r)=>t.localeCompare(r))}}catch(t){return f(t)?{directories:[]}:{directories:[],error:{code:"extensions_unreadable",path:e}}}}async function D(e){let t;try{t=await u.readFile(e,"utf8")}catch(r){return f(r)?{manifest:null,error:{code:"manifest_invalid",path:e}}:{manifest:null,error:{code:"manifest_unreadable",path:e}}}try{let r=v(JSON.parse(t));return r?{manifest:r}:{manifest:null,error:{code:"manifest_invalid",path:e}}}catch{return{manifest:null,error:{code:"manifest_invalid",path:e}}}}function M(e){let t=e.manifest?.name??e.directory,r=new Set(p(e.settings.enabled)),n=new Set(p(e.settings.disabled)),a=!y(e.settings.status)||!e.manifest?null:!n.has(t)&&(r.size===0||r.has(t)),o=y(e.managed.status)?e.managed.entries.some(d=>i(d.name)===i(t)||i(d.directory)===i(e.directory)):null;return{name:t,directory:e.directory,scope:e.scope,installed:!0,status:e.manifest?a===!1?"inactive":"installed":"malformed_manifest",configured_enabled:a,managed:o,runtime_active:null,...e.manifest?{version:e.manifest.version}:{}}}async function R(e){let t=e.scope??"project",r=t==="global"?h(e.cwd??process.cwd()):e.pmRoot,n=c.join(r,"extensions"),a=await S(c.join(r,"settings.json")),o=await A(c.join(n,".managed-extensions.json")),d=await I(n),l=[];for(let s of[a,o,d])s.error&&l.push(s.error);let m=e.name?.trim(),b=[];for(let s of d.directories){let x=c.join(n,s,"manifest.json"),g=await D(x);g.error&&l.push(g.error);let w=M({directory:s,scope:t,manifest:g.manifest,settings:a,managed:o});m&&![w.name,s].some(E=>i(E)===i(m))||b.push(w)}return m&&b.length===0&&l.every(s=>s.code!=="extensions_unreadable")&&b.push({name:m,directory:null,scope:t,installed:!1,status:"absent",configured_enabled:y(a.status)?!1:null,managed:y(o.status)?!1:null,runtime_active:null}),{scope:t,complete:l.length===0,settings_status:a.status,managed_state_status:o.status,extensions:b,errors:l}}export{R as a};
2
- //# sourceMappingURL=chunk-GZVOOHTO.js.map
1
+ import{ga as p,ha as i,ia as v,ja as _}from"./chunk-NZAFLDSH.js";import{Pa as h}from"./chunk-WNEUWDUE.js";import u from"node:fs/promises";import c 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]="846100a9-4314-5f7c-b892-fa16e09bee5b")}catch{}})();function f(e){return typeof e=="object"&&e!==null&&"code"in e&&e.code==="ENOENT"}function y(e){return e!=="invalid"&&e!=="unreadable"}function j(e){let t=JSON.parse(e);if(typeof t!="object"||t===null||Array.isArray(t))throw new SyntaxError("Invalid settings object");let r=t.extensions;if(r===void 0)return{enabled:[],disabled:[]};if(typeof r!="object"||r===null||Array.isArray(r))throw new SyntaxError("Invalid extensions settings");let n=r;if(n.enabled!==void 0&&(!Array.isArray(n.enabled)||!n.enabled.every(a=>typeof a=="string"))||n.disabled!==void 0&&(!Array.isArray(n.disabled)||!n.disabled.every(a=>typeof a=="string")))throw new SyntaxError("Invalid extension enablement lists");return{enabled:n.enabled??[],disabled:n.disabled??[]}}async function S(e){let t;try{t=await u.readFile(e,"utf8")}catch(r){return f(r)?{status:"absent",enabled:[],disabled:[]}:{status:"unreadable",enabled:[],disabled:[],error:{code:"settings_unreadable",path:e}}}try{return{status:"ok",...j(t)}}catch{return{status:"invalid",enabled:[],disabled:[],error:{code:"settings_invalid",path:e}}}}async function A(e){let t;try{t=await u.readFile(e,"utf8")}catch(r){if(f(r))try{if((await u.stat(c.dirname(e))).isDirectory())return{status:"absent",entries:[]}}catch(n){if(f(n))return{status:"absent",entries:[]}}return{status:"unreadable",entries:[],error:{code:"managed_state_unreadable",path:e}}}try{let r=JSON.parse(t),n=_(r);if(!n||typeof r!="object"||r===null||!Array.isArray(r.entries)||n.entries.length!==r.entries.length)throw new SyntaxError("Invalid managed extension state");return{status:"ok",entries:n.entries}}catch{return{status:"invalid",entries:[],error:{code:"managed_state_invalid",path:e}}}}async function I(e){try{return{directories:(await u.readdir(e,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).sort((t,r)=>t.localeCompare(r))}}catch(t){return f(t)?{directories:[]}:{directories:[],error:{code:"extensions_unreadable",path:e}}}}async function D(e){let t;try{t=await u.readFile(e,"utf8")}catch(r){return f(r)?{manifest:null,error:{code:"manifest_invalid",path:e}}:{manifest:null,error:{code:"manifest_unreadable",path:e}}}try{let r=v(JSON.parse(t));return r?{manifest:r}:{manifest:null,error:{code:"manifest_invalid",path:e}}}catch{return{manifest:null,error:{code:"manifest_invalid",path:e}}}}function M(e){let t=e.manifest?.name??e.directory,r=new Set(p(e.settings.enabled)),n=new Set(p(e.settings.disabled)),a=!y(e.settings.status)||!e.manifest?null:!n.has(t)&&(r.size===0||r.has(t)),o=y(e.managed.status)?e.managed.entries.some(d=>i(d.name)===i(t)||i(d.directory)===i(e.directory)):null;return{name:t,directory:e.directory,scope:e.scope,installed:!0,status:e.manifest?a===!1?"inactive":"installed":"malformed_manifest",configured_enabled:a,managed:o,runtime_active:null,...e.manifest?{version:e.manifest.version}:{}}}async function R(e){let t=e.scope??"project",r=t==="global"?h(e.cwd??process.cwd()):e.pmRoot,n=c.join(r,"extensions"),a=await S(c.join(r,"settings.json")),o=await A(c.join(n,".managed-extensions.json")),d=await I(n),l=[];for(let s of[a,o,d])s.error&&l.push(s.error);let m=e.name?.trim(),b=[];for(let s of d.directories){let x=c.join(n,s,"manifest.json"),g=await D(x);g.error&&l.push(g.error);let w=M({directory:s,scope:t,manifest:g.manifest,settings:a,managed:o});m&&![w.name,s].some(E=>i(E)===i(m))||b.push(w)}return m&&b.length===0&&l.every(s=>s.code!=="extensions_unreadable")&&b.push({name:m,directory:null,scope:t,installed:!1,status:"absent",configured_enabled:y(a.status)?!1:null,managed:y(o.status)?!1:null,runtime_active:null}),{scope:t,complete:l.length===0,settings_status:a.status,managed_state_status:o.status,extensions:b,errors:l}}export{R as a};
2
+ //# sourceMappingURL=chunk-F6FBGLR7.js.map