@unbrained/pm-cli 2026.11.6 → 2026.11.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (474) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +82 -48
  3. package/dist/cli/expected-revisions.js +1 -1
  4. package/dist/cli/extension-command-help.js +4 -3
  5. package/dist/cli/help-json-payload.js +1 -1
  6. package/dist/cli/main.js +1 -1
  7. package/dist/cli/register-annotations.js +1 -1
  8. package/dist/cli/register-list-query.js +5 -5
  9. package/dist/cli/runtime/annotation-option-retry.js +2 -0
  10. package/dist/cli/runtime/close-fields-retry.js +2 -0
  11. package/dist/cli/runtime/invocation-options.js +1 -1
  12. package/dist/cli-bundle/bundle-manifest.json +1 -1
  13. package/dist/cli-bundle/chunks/chunk-3A5DJZCC.js +116 -0
  14. package/dist/cli-bundle/chunks/chunk-4BMPGUTG.js +9 -0
  15. package/dist/cli-bundle/chunks/{chunk-D7KYPRK4.js → chunk-7GC6WIDR.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-DAX3AOFI.js → chunk-7V6I6X4G.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-OH6WQ7VT.js → chunk-AFZS6WFV.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-PE3ASURT.js → chunk-C4MQFWCM.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-CP43BHX3.js +31 -0
  20. package/dist/cli-bundle/chunks/{chunk-S4LPZ4TN.js → chunk-DOHZKPPC.js} +7 -7
  21. package/dist/cli-bundle/chunks/{chunk-LS3GI3H4.js → chunk-HESIRIVX.js} +2 -2
  22. package/dist/cli-bundle/chunks/chunk-JAE5MWLX.js +2 -0
  23. package/dist/cli-bundle/chunks/{chunk-335BZ75D.js → chunk-L5BU5FYN.js} +2 -2
  24. package/dist/cli-bundle/chunks/chunk-LI2HP5OX.js +3 -0
  25. package/dist/cli-bundle/chunks/chunk-LLTRUVKK.js +6 -0
  26. package/dist/cli-bundle/chunks/{chunk-X3URBPMV.js → chunk-MKW5LGVQ.js} +66 -62
  27. package/dist/cli-bundle/chunks/chunk-NH7QX2M2.js +8 -0
  28. package/dist/cli-bundle/chunks/{chunk-HRFGFIYU.js → chunk-NKO42JMT.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-7DEKAXVA.js → chunk-PE6CZ3PE.js} +2 -2
  30. package/dist/cli-bundle/chunks/chunk-RC6SSFOF.js +2 -0
  31. package/dist/cli-bundle/chunks/{chunk-TSQCUBUX.js → chunk-S4IZIMAO.js} +2 -2
  32. package/dist/cli-bundle/chunks/{chunk-UEGXWXUZ.js → chunk-XBUZENP4.js} +2 -2
  33. package/dist/cli-bundle/chunks/chunk-YGUUJHSR.js +2 -0
  34. package/dist/cli-bundle/chunks/chunk-YUTFMHSG.js +122 -0
  35. package/dist/cli-bundle/chunks/{chunk-SLC5UWCM.js → chunk-Z3LWNF7C.js} +2 -2
  36. package/dist/cli-bundle/chunks/item-revision-TUGZYYXX.js +2 -0
  37. package/dist/cli-bundle/chunks/item-transaction-2RRBAQN3.js +2 -0
  38. package/dist/cli-bundle/chunks/{mutation-admission-INMM3HHG.js → mutation-admission-FJ3D66PV.js} +2 -2
  39. package/dist/cli-bundle/chunks/{register-list-query-5Y5JKWU5.js → register-list-query-GXP77CX7.js} +11 -11
  40. package/dist/cli-bundle/chunks/register-mutation-XJ2DROUM.js +20 -0
  41. package/dist/cli-bundle/chunks/{register-operations-WJHZJFK2.js → register-operations-O5LERXM7.js} +2 -2
  42. package/dist/cli-bundle/chunks/{register-setup-RRFOS7IT.js → register-setup-4VOTYLL2.js} +2 -2
  43. package/dist/cli-bundle/chunks/{stage-E3MMV4TV.js → stage-ZDJL3FGL.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/chunk-2A3QZELL.js +26 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-MC7IE7D7.js → chunk-3HFENALW.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/chunk-4UOXVFJZ.js +2 -0
  47. package/dist/cli-bundle/focused-chunks/{chunk-7KK66ISG.js → chunk-5YPX3QKU.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-CPMSL4HS.js → chunk-6U5HP6L3.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/chunk-DIEBSC76.js +3 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-WSOAASCY.js → chunk-I4YUZW3J.js} +8 -8
  51. package/dist/cli-bundle/focused-chunks/chunk-KBRSA4OK.js +44 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-AHWJPZSJ.js → chunk-KNF2QTEZ.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/chunk-LTPT5TE7.js +24 -0
  54. package/dist/cli-bundle/focused-chunks/chunk-O7K3X4LH.js +2 -0
  55. package/dist/cli-bundle/focused-chunks/chunk-P4EHEH4C.js +2 -0
  56. package/dist/cli-bundle/focused-chunks/chunk-P6TG33FV.js +82 -0
  57. package/dist/cli-bundle/focused-chunks/chunk-PL6EO4GJ.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-PSLDGAEY.js +12 -0
  59. package/dist/cli-bundle/focused-chunks/chunk-SZ2BKK3M.js +2 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-TSHRBPTI.js +2 -0
  61. package/dist/cli-bundle/focused-chunks/chunk-ULTSMJYF.js +91 -0
  62. package/dist/cli-bundle/focused-chunks/chunk-UNNLBJRI.js +2 -0
  63. package/dist/cli-bundle/focused-chunks/chunk-UUVRYIKA.js +2 -0
  64. package/dist/cli-bundle/focused-chunks/{chunk-F62XGAAY.js → chunk-WPXMPGTY.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/chunk-Z2QWZRSL.js +26 -0
  66. package/dist/cli-bundle/focused-chunks/item-revision-XNSRDTFB.js +2 -0
  67. package/dist/cli-bundle/focused-chunks/item-transaction-Q2Z7DDCR.js +2 -0
  68. package/dist/cli-bundle/focused-chunks/mutation-admission-QWC6MLTZ.js +2 -0
  69. package/dist/cli-bundle/focused-chunks/stage-NKH5SKSZ.js +2 -0
  70. package/dist/cli-bundle/main.js +27 -26
  71. package/dist/cli-bundle/sdk-authoring.js +1 -1
  72. package/dist/cli-bundle/sdk-contracts.js +4 -4
  73. package/dist/cli-bundle/sdk-core.js +1 -1
  74. package/dist/cli-bundle/sdk-governance.js +1 -1
  75. package/dist/cli-bundle/sdk-graph.js +1 -1
  76. package/dist/cli-bundle/sdk-merge.js +57 -57
  77. package/dist/cli-bundle/sdk-query.js +1 -1
  78. package/dist/cli-bundle/sdk-runtime.js +1 -1
  79. package/dist/cli-bundle/sdk-testing.js +1 -1
  80. package/dist/cli-bundle/sdk.js +12 -12
  81. package/dist/core/extensions/flag-definition-validation.js +1 -1
  82. package/dist/core/extensions/reserved-host-flags.js +1 -1
  83. package/dist/core/history/history-stream-policy.d.ts +12 -3
  84. package/dist/core/history/history-stream-policy.js +1 -1
  85. package/dist/core/history/projection.d.ts +7 -2
  86. package/dist/core/history/projection.js +1 -1
  87. package/dist/core/item/item-format.d.ts +5 -1
  88. package/dist/core/item/item-format.js +2 -2
  89. package/dist/core/lock/lock.d.ts +1 -1
  90. package/dist/core/lock/lock.js +1 -1
  91. package/dist/core/output/output.d.ts +10 -1
  92. package/dist/core/output/output.js +7 -7
  93. package/dist/core/search/providers.d.ts +3 -2
  94. package/dist/core/search/providers.js +1 -1
  95. package/dist/core/search/vector-stores.d.ts +3 -2
  96. package/dist/core/search/vector-stores.js +1 -1
  97. package/dist/core/sentry/instrument.d.ts +2 -1
  98. package/dist/core/sentry/instrument.js +1 -1
  99. package/dist/core/store/item-mutation-precondition.d.ts +58 -0
  100. package/dist/core/store/item-mutation-precondition.js +1 -1
  101. package/dist/mcp/tool-definitions.js +1 -1
  102. package/dist/sdk/annotations.d.ts +44 -1
  103. package/dist/sdk/annotations.js +1 -1
  104. package/dist/sdk/authoring.d.ts +6 -0
  105. package/dist/sdk/authoring.js +1 -1
  106. package/dist/sdk/cli-contracts/flag-contracts.d.ts +15 -0
  107. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  108. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  109. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +6 -0
  110. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  111. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  112. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  113. package/dist/sdk/command-line.d.ts +7 -2
  114. package/dist/sdk/command-line.js +1 -1
  115. package/dist/sdk/comments.d.ts +4 -2
  116. package/dist/sdk/comments.js +1 -1
  117. package/dist/sdk/completion/bash.js +1 -1
  118. package/dist/sdk/completion/fish.js +2 -1
  119. package/dist/sdk/completion/zsh.js +4 -1
  120. package/dist/sdk/context-intent-contracts.d.ts +5 -1
  121. package/dist/sdk/context-intent-contracts.js +1 -1
  122. package/dist/sdk/contracts.d.ts +3 -0
  123. package/dist/sdk/contracts.js +1 -1
  124. package/dist/sdk/core.d.ts +14 -0
  125. package/dist/sdk/core.js +1 -1
  126. package/dist/sdk/corpus-shape.d.ts +2 -2
  127. package/dist/sdk/corpus-shape.js +1 -1
  128. package/dist/sdk/define.d.ts +14 -8
  129. package/dist/sdk/define.js +1 -1
  130. package/dist/sdk/extension/command-options.d.ts +123 -0
  131. package/dist/sdk/extension/command-options.js +2 -0
  132. package/dist/sdk/extension-contracts.d.ts +1 -2
  133. package/dist/sdk/extension-contracts.js +1 -1
  134. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  135. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  136. package/dist/sdk/governance.d.ts +8 -0
  137. package/dist/sdk/governance.js +1 -1
  138. package/dist/sdk/graph.d.ts +5 -0
  139. package/dist/sdk/graph.js +1 -1
  140. package/dist/sdk/index.d.ts +61 -1
  141. package/dist/sdk/index.js +1 -1
  142. package/dist/sdk/learnings.d.ts +4 -2
  143. package/dist/sdk/learnings.js +1 -1
  144. package/dist/sdk/lifecycle/close.js +1 -1
  145. package/dist/sdk/lifecycle/item-revision.d.ts +15 -4
  146. package/dist/sdk/lifecycle/item-revision.js +1 -1
  147. package/dist/sdk/lifecycle/restore.d.ts +1 -1
  148. package/dist/sdk/merge.d.ts +3 -0
  149. package/dist/sdk/merge.js +1 -1
  150. package/dist/sdk/notes.d.ts +4 -2
  151. package/dist/sdk/notes.js +1 -1
  152. package/dist/sdk/output/list-envelope.d.ts +18 -7
  153. package/dist/sdk/output/list-envelope.js +1 -1
  154. package/dist/sdk/output-projection.js +1 -1
  155. package/dist/sdk/public-surface.json +1 -1
  156. package/dist/sdk/query/get.d.ts +16 -6
  157. package/dist/sdk/query/get.js +1 -1
  158. package/dist/sdk/query/list.d.ts +5 -1
  159. package/dist/sdk/query/list.js +1 -1
  160. package/dist/sdk/query/search/response.js +1 -1
  161. package/dist/sdk/query/search/semantic.d.ts +11 -3
  162. package/dist/sdk/query/search/semantic.js +1 -1
  163. package/dist/sdk/query/search-rendering.d.ts +9 -3
  164. package/dist/sdk/query/search-rendering.js +1 -1
  165. package/dist/sdk/query.d.ts +11 -0
  166. package/dist/sdk/query.js +1 -1
  167. package/dist/sdk/read-output/continuation.d.ts +8 -0
  168. package/dist/sdk/read-output/continuation.js +1 -1
  169. package/dist/sdk/read-output/options.d.ts +1 -1
  170. package/dist/sdk/read-output/options.js +1 -1
  171. package/dist/sdk/read-output/surfaces.js +1 -1
  172. package/dist/sdk/read-output/tail-retention.d.ts +34 -0
  173. package/dist/sdk/read-output/tail-retention.js +2 -0
  174. package/dist/sdk/read-output-budget.d.ts +14 -2
  175. package/dist/sdk/read-output-budget.js +1 -1
  176. package/dist/sdk/read-output-contracts.d.ts +20 -4
  177. package/dist/sdk/read-output-contracts.js +1 -1
  178. package/dist/sdk/read-output-rows.d.ts +7 -3
  179. package/dist/sdk/read-output-rows.js +1 -1
  180. package/dist/sdk/runtime-input.js +1 -1
  181. package/dist/sdk/runtime.d.ts +26 -3
  182. package/dist/sdk/runtime.js +1 -1
  183. package/dist/sdk/test/execution.d.ts +29 -2
  184. package/dist/sdk/test/execution.js +1 -1
  185. package/dist/sdk/testing.d.ts +14 -1
  186. package/dist/sdk/testing.js +1 -1
  187. package/dist/sdk/traceability/source-traceability.d.ts +4 -1
  188. package/dist/sdk/traceability/source-traceability.js +1 -1
  189. package/dist/sdk/workspace-recipe.d.ts +2 -2
  190. package/dist/sdk/workspace-recipe.js +1 -1
  191. package/docs/ARCHITECTURE.md +2 -1
  192. package/docs/CLOSE_EVIDENCE_RECOVERY.md +36 -2
  193. package/docs/COMMANDS.md +14 -2
  194. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +1 -1
  195. package/docs/EXTENSIONS.md +1 -1
  196. package/docs/GET_READ_EVIDENCE.md +24 -3
  197. package/docs/MCP_OPTION_CONFORMANCE.md +13 -0
  198. package/docs/README.md +1 -1
  199. package/docs/READ_OUTPUT_CONTRACTS.md +78 -0
  200. package/docs/RELEASING.md +17 -0
  201. package/docs/SDK.md +124 -9
  202. package/docs/SDK_CONTEXT_INTEGRITY.md +2 -0
  203. package/docs/agent-task-token-baseline.json +1 -1
  204. package/docs/generated/FLAG_LEXICON_BUDGETS.md +6 -6
  205. package/marketplace.json +1 -1
  206. package/package.json +2 -1
  207. package/packages/pm-beads/package.json +1 -1
  208. package/packages/pm-calendar/package.json +1 -1
  209. package/packages/pm-command-kit/package.json +1 -1
  210. package/packages/pm-digital-twin/package.json +1 -1
  211. package/packages/pm-governance-audit/package.json +1 -1
  212. package/packages/pm-guide-shell/package.json +1 -1
  213. package/packages/pm-kanban/package.json +1 -1
  214. package/packages/pm-lifecycle-hooks/package.json +1 -1
  215. package/packages/pm-linked-test-adapters/package.json +1 -1
  216. package/packages/pm-search-advanced/package.json +1 -1
  217. package/packages/pm-templates/package.json +1 -1
  218. package/packages/pm-todos/package.json +1 -1
  219. package/packages/pm-vcs/package.json +1 -1
  220. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  221. package/plugins/pm-claude/package.json +1 -1
  222. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  223. package/plugins/pm-codex/package.json +1 -1
  224. package/plugins/pm-codex/plugin.json +1 -1
  225. package/runtime-dependencies.json +1 -1
  226. package/dist/cli/after-command-context-usage.d.ts +0 -21
  227. package/dist/cli/argv-utils.d.ts +0 -12
  228. package/dist/cli/bootstrap-args.d.ts +0 -6
  229. package/dist/cli/bundle-integrity.d.ts +0 -49
  230. package/dist/cli/command-namespaces.d.ts +0 -9
  231. package/dist/cli/commander-usage.d.ts +0 -73
  232. package/dist/cli/commands/annotations/comments.d.ts +0 -2
  233. package/dist/cli/commands/annotations/docs.d.ts +0 -6
  234. package/dist/cli/commands/annotations/files.d.ts +0 -6
  235. package/dist/cli/commands/annotations/learnings.d.ts +0 -2
  236. package/dist/cli/commands/annotations/notes.d.ts +0 -2
  237. package/dist/cli/commands/extension/describe.d.ts +0 -2
  238. package/dist/cli/commands/extension/extension.d.ts +0 -6
  239. package/dist/cli/commands/extension/scaffold.d.ts +0 -2
  240. package/dist/cli/commands/extension/shared.d.ts +0 -2
  241. package/dist/cli/commands/governance/gc.d.ts +0 -6
  242. package/dist/cli/commands/governance/health.d.ts +0 -6
  243. package/dist/cli/commands/governance/telemetry.d.ts +0 -6
  244. package/dist/cli/commands/governance/validate.d.ts +0 -9
  245. package/dist/cli/commands/history/activity.d.ts +0 -6
  246. package/dist/cli/commands/history/history-compact.d.ts +0 -7
  247. package/dist/cli/commands/history/history-redact.d.ts +0 -8
  248. package/dist/cli/commands/history/history-repair.d.ts +0 -7
  249. package/dist/cli/commands/history/history.d.ts +0 -2
  250. package/dist/cli/commands/history/restore.d.ts +0 -6
  251. package/dist/cli/commands/lifecycle/append.d.ts +0 -6
  252. package/dist/cli/commands/lifecycle/claim.d.ts +0 -2
  253. package/dist/cli/commands/lifecycle/close-many.d.ts +0 -2
  254. package/dist/cli/commands/lifecycle/close.d.ts +0 -6
  255. package/dist/cli/commands/lifecycle/copy.d.ts +0 -6
  256. package/dist/cli/commands/lifecycle/create.d.ts +0 -10
  257. package/dist/cli/commands/lifecycle/delete.d.ts +0 -6
  258. package/dist/cli/commands/lifecycle/focus.d.ts +0 -6
  259. package/dist/cli/commands/lifecycle/plan.d.ts +0 -9
  260. package/dist/cli/commands/lifecycle/update-many.d.ts +0 -6
  261. package/dist/cli/commands/lifecycle/update.d.ts +0 -10
  262. package/dist/cli/commands/query/aggregate.d.ts +0 -2
  263. package/dist/cli/commands/query/context.d.ts +0 -6
  264. package/dist/cli/commands/query/deps.d.ts +0 -6
  265. package/dist/cli/commands/query/duplicates.d.ts +0 -6
  266. package/dist/cli/commands/query/eval.d.ts +0 -6
  267. package/dist/cli/commands/query/get.d.ts +0 -6
  268. package/dist/cli/commands/query/graph.d.ts +0 -7
  269. package/dist/cli/commands/query/list.d.ts +0 -6
  270. package/dist/cli/commands/query/next.d.ts +0 -6
  271. package/dist/cli/commands/query/search.d.ts +0 -6
  272. package/dist/cli/commands/query/stats.d.ts +0 -6
  273. package/dist/cli/commands/test/test-all.d.ts +0 -6
  274. package/dist/cli/commands/test/test-runs.d.ts +0 -6
  275. package/dist/cli/commands/test/test.d.ts +0 -6
  276. package/dist/cli/commands/workspace/config.d.ts +0 -6
  277. package/dist/cli/commands/workspace/contracts.d.ts +0 -2
  278. package/dist/cli/commands/workspace/init.d.ts +0 -6
  279. package/dist/cli/commands/workspace/merge.d.ts +0 -8
  280. package/dist/cli/commands/workspace/profile.d.ts +0 -6
  281. package/dist/cli/commands/workspace/schema.d.ts +0 -7
  282. package/dist/cli/commands/workspace/upgrade.d.ts +0 -2
  283. package/dist/cli/context-intent-invocation.d.ts +0 -2
  284. package/dist/cli/description-stdin.d.ts +0 -2
  285. package/dist/cli/error-guidance.d.ts +0 -276
  286. package/dist/cli/expected-revisions.d.ts +0 -55
  287. package/dist/cli/extension-command-help.d.ts +0 -137
  288. package/dist/cli/extension-command-options.d.ts +0 -37
  289. package/dist/cli/extension-command-options.js +0 -2
  290. package/dist/cli/extension-recovery.d.ts +0 -31
  291. package/dist/cli/help-content.d.ts +0 -57
  292. package/dist/cli/help-json-payload.d.ts +0 -83
  293. package/dist/cli/invocation-profile.d.ts +0 -26
  294. package/dist/cli/main.d.ts +0 -263
  295. package/dist/cli/migration-gates.d.ts +0 -55
  296. package/dist/cli/option-values.d.ts +0 -3
  297. package/dist/cli/preflight-warnings.d.ts +0 -11
  298. package/dist/cli/register-annotations.d.ts +0 -11
  299. package/dist/cli/register-assurance.d.ts +0 -8
  300. package/dist/cli/register-files-lookup.d.ts +0 -9
  301. package/dist/cli/register-history-activity.d.ts +0 -8
  302. package/dist/cli/register-history-author.d.ts +0 -8
  303. package/dist/cli/register-history-maintenance.d.ts +0 -9
  304. package/dist/cli/register-list-query.d.ts +0 -27
  305. package/dist/cli/register-mutation-options.d.ts +0 -10
  306. package/dist/cli/register-mutation.d.ts +0 -16
  307. package/dist/cli/register-operations.d.ts +0 -85
  308. package/dist/cli/register-setup.d.ts +0 -16
  309. package/dist/cli/register-structured-mutation.d.ts +0 -15
  310. package/dist/cli/registration-helpers.d.ts +0 -2
  311. package/dist/cli/runtime/activation.d.ts +0 -51
  312. package/dist/cli/runtime/field-route-retry.d.ts +0 -15
  313. package/dist/cli/runtime/invocation-options.d.ts +0 -43
  314. package/dist/cli/runtime/projection-retry.d.ts +0 -9
  315. package/dist/cli/runtime/selection.d.ts +0 -35
  316. package/dist/cli/runtime/telemetry-outcome.d.ts +0 -20
  317. package/dist/cli/runtime-compatibility-boundary.d.ts +0 -17
  318. package/dist/cli/schema/registration.d.ts +0 -4
  319. package/dist/cli/schema-registration-helpers.d.ts +0 -24
  320. package/dist/cli/search-refresh.d.ts +0 -2
  321. package/dist/cli/stats-analytics-json.d.ts +0 -9
  322. package/dist/cli/telemetry-flush.d.ts +0 -2
  323. package/dist/cli-bundle/chunks/chunk-5GWEY4P6.js +0 -122
  324. package/dist/cli-bundle/chunks/chunk-6VRX2CM7.js +0 -2
  325. package/dist/cli-bundle/chunks/chunk-7ZRCYESH.js +0 -116
  326. package/dist/cli-bundle/chunks/chunk-AUEKTX7V.js +0 -6
  327. package/dist/cli-bundle/chunks/chunk-FRNMQM45.js +0 -2
  328. package/dist/cli-bundle/chunks/chunk-HNGLDMSZ.js +0 -9
  329. package/dist/cli-bundle/chunks/chunk-QNWUIPBO.js +0 -31
  330. package/dist/cli-bundle/chunks/chunk-WC4M2H6R.js +0 -8
  331. package/dist/cli-bundle/chunks/chunk-YKXATU2G.js +0 -3
  332. package/dist/cli-bundle/chunks/item-revision-OJJVPQY7.js +0 -2
  333. package/dist/cli-bundle/chunks/item-transaction-TBKEATN6.js +0 -2
  334. package/dist/cli-bundle/chunks/register-mutation-MDSUU3G7.js +0 -20
  335. package/dist/cli-bundle/focused-chunks/chunk-2KTJY7BV.js +0 -44
  336. package/dist/cli-bundle/focused-chunks/chunk-4PW5XWVI.js +0 -2
  337. package/dist/cli-bundle/focused-chunks/chunk-C6P6HPCX.js +0 -2
  338. package/dist/cli-bundle/focused-chunks/chunk-CZM75DE3.js +0 -2
  339. package/dist/cli-bundle/focused-chunks/chunk-D2TBEBNW.js +0 -3
  340. package/dist/cli-bundle/focused-chunks/chunk-E56OXRYH.js +0 -2
  341. package/dist/cli-bundle/focused-chunks/chunk-G4QP365K.js +0 -2
  342. package/dist/cli-bundle/focused-chunks/chunk-G5PJCR7R.js +0 -2
  343. package/dist/cli-bundle/focused-chunks/chunk-GS3JC5UU.js +0 -23
  344. package/dist/cli-bundle/focused-chunks/chunk-LW64TINU.js +0 -3
  345. package/dist/cli-bundle/focused-chunks/chunk-M6V7UMWL.js +0 -26
  346. package/dist/cli-bundle/focused-chunks/chunk-MG7C3JUY.js +0 -2
  347. package/dist/cli-bundle/focused-chunks/chunk-MK4HV4JO.js +0 -2
  348. package/dist/cli-bundle/focused-chunks/chunk-O7EI33NP.js +0 -91
  349. package/dist/cli-bundle/focused-chunks/chunk-RFTJZ5VB.js +0 -2
  350. package/dist/cli-bundle/focused-chunks/chunk-SNOXXRSJ.js +0 -2
  351. package/dist/cli-bundle/focused-chunks/chunk-UPJUTP2V.js +0 -12
  352. package/dist/cli-bundle/focused-chunks/chunk-VWWTIX5L.js +0 -3
  353. package/dist/cli-bundle/focused-chunks/chunk-XHOBYCVE.js +0 -26
  354. package/dist/cli-bundle/focused-chunks/chunk-YMGB2O4E.js +0 -81
  355. package/dist/cli-bundle/focused-chunks/item-revision-CTDO4H3I.js +0 -2
  356. package/dist/cli-bundle/focused-chunks/item-transaction-H2XACBOP.js +0 -2
  357. package/dist/cli-bundle/focused-chunks/mutation-admission-4WM7TNHZ.js +0 -2
  358. package/dist/cli-bundle/focused-chunks/stage-WV7QXR4C.js +0 -2
  359. package/dist/cli.d.ts +0 -13
  360. package/dist/core/checkpoint/checkpoint-gc.d.ts +0 -61
  361. package/dist/core/checkpoint/mutation-context.d.ts +0 -10
  362. package/dist/core/diagnostics/remediation.d.ts +0 -52
  363. package/dist/core/extensions/activation-transaction.d.ts +0 -22
  364. package/dist/core/extensions/command-visibility-tier.d.ts +0 -8
  365. package/dist/core/extensions/exporter-output-contract.d.ts +0 -12
  366. package/dist/core/extensions/extension-candidate.d.ts +0 -26
  367. package/dist/core/extensions/extension-runtime-helpers.d.ts +0 -16
  368. package/dist/core/extensions/module-graph-snapshot.d.ts +0 -19
  369. package/dist/core/extensions/preflight-ownership.d.ts +0 -5
  370. package/dist/core/extensions/read-output-contract.d.ts +0 -5
  371. package/dist/core/extensions/reserved-host-flags.d.ts +0 -18
  372. package/dist/core/extensions/service-ownership.d.ts +0 -8
  373. package/dist/core/extensions/version-diagnostics.d.ts +0 -2
  374. package/dist/core/fs/atomic-create.d.ts +0 -7
  375. package/dist/core/fs/index.d.ts +0 -6
  376. package/dist/core/fs/path-utils.d.ts +0 -2
  377. package/dist/core/history/drift-cache.d.ts +0 -4
  378. package/dist/core/history/drift-scan.d.ts +0 -51
  379. package/dist/core/history/index.d.ts +0 -6
  380. package/dist/core/history/tombstone.d.ts +0 -3
  381. package/dist/core/history/version-address.d.ts +0 -13
  382. package/dist/core/item/index.d.ts +0 -9
  383. package/dist/core/item/item-type-definition.d.ts +0 -51
  384. package/dist/core/item/toon-decode.d.ts +0 -25
  385. package/dist/core/lock/index.d.ts +0 -6
  386. package/dist/core/lock/lock-confinement.d.ts +0 -55
  387. package/dist/core/lock/lock-gc.d.ts +0 -93
  388. package/dist/core/output/mutation-projection.d.ts +0 -13
  389. package/dist/core/output/query-summary.d.ts +0 -30
  390. package/dist/core/search/staleness.d.ts +0 -23
  391. package/dist/core/sentry/sensitive-assignments.d.ts +0 -9
  392. package/dist/core/shared/conflict-markers.d.ts +0 -18
  393. package/dist/core/shared/index.d.ts +0 -9
  394. package/dist/core/shared/memo.d.ts +0 -7
  395. package/dist/core/store/index.d.ts +0 -9
  396. package/dist/core/store/settings-concurrency.d.ts +0 -7
  397. package/dist/core/telemetry/read-sampling.d.ts +0 -8
  398. package/dist/core/test/item-test-run-tracking.d.ts +0 -12
  399. package/dist/core/validate/estimate-defaults.d.ts +0 -21
  400. package/dist/core/validate/linked-artifact-reference.d.ts +0 -20
  401. package/dist/mcp/http-server.d.ts +0 -60
  402. package/dist/mcp/legacy-adapter.d.ts +0 -59
  403. package/dist/mcp/runtime-capabilities.d.ts +0 -57
  404. package/dist/mcp/server.d.ts +0 -101
  405. package/dist/sdk/cli-contracts/bootstrap-command-scanner.d.ts +0 -23
  406. package/dist/sdk/cli-contracts/registration-helpers.d.ts +0 -123
  407. package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +0 -796
  408. package/dist/sdk/cli-contracts/string-lists.d.ts +0 -9
  409. package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +0 -35
  410. package/dist/sdk/context/usage-egress.d.ts +0 -9
  411. package/dist/sdk/dependencies/context-budget-recovery.d.ts +0 -21
  412. package/dist/sdk/dependency-flag-validation.d.ts +0 -32
  413. package/dist/sdk/extension/author-manifest.d.ts +0 -22
  414. package/dist/sdk/extension/bundled-catalog.d.ts +0 -35
  415. package/dist/sdk/extension/concurrency.d.ts +0 -7
  416. package/dist/sdk/extension/copy-scope.d.ts +0 -2
  417. package/dist/sdk/extension/custom-field-collisions.d.ts +0 -6
  418. package/dist/sdk/extension/install-receipts.d.ts +0 -7
  419. package/dist/sdk/extension/install-snapshot.d.ts +0 -34
  420. package/dist/sdk/extension/managed-update-status.d.ts +0 -3
  421. package/dist/sdk/extension/runtime-summary.d.ts +0 -9
  422. package/dist/sdk/extension/scaffold.d.ts +0 -38
  423. package/dist/sdk/generated/error-code-catalog-rows.d.ts +0 -39
  424. package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +0 -8
  425. package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +0 -8
  426. package/dist/sdk/governance/assurance-limits.d.ts +0 -7
  427. package/dist/sdk/governance/defect-recurrence-signals.d.ts +0 -10
  428. package/dist/sdk/governance/health-merge-evidence.d.ts +0 -23
  429. package/dist/sdk/governance/tracked-runtime-cache.d.ts +0 -24
  430. package/dist/sdk/governance/validate-history-drift.d.ts +0 -7
  431. package/dist/sdk/history/attestation-scan.d.ts +0 -16
  432. package/dist/sdk/history-mcp.d.ts +0 -17
  433. package/dist/sdk/lifecycle/checkpoint-rollback.d.ts +0 -15
  434. package/dist/sdk/lifecycle/core-field-recovery.d.ts +0 -33
  435. package/dist/sdk/lifecycle/core-item-fields.d.ts +0 -6
  436. package/dist/sdk/lifecycle/event-validation-messages.d.ts +0 -6
  437. package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +0 -15
  438. package/dist/sdk/lifecycle/legacy-none-tokens.d.ts +0 -71
  439. package/dist/sdk/lifecycle/mcp-actions.d.ts +0 -24
  440. package/dist/sdk/lifecycle/metadata-normalizers.d.ts +0 -8
  441. package/dist/sdk/lifecycle/mutation-facet-contracts.d.ts +0 -6
  442. package/dist/sdk/lifecycle/mutation-option-validation.d.ts +0 -2
  443. package/dist/sdk/lifecycle/recurrence-parsers.d.ts +0 -34
  444. package/dist/sdk/lifecycle/release-handoff.d.ts +0 -12
  445. package/dist/sdk/lifecycle/repeatable-metadata-parsers.d.ts +0 -18
  446. package/dist/sdk/lifecycle/repeated-terminal-state.d.ts +0 -45
  447. package/dist/sdk/merge/abandoned-receipts.d.ts +0 -15
  448. package/dist/sdk/merge/history-scalar-rebase.d.ts +0 -9
  449. package/dist/sdk/merge/ignored-artifacts.d.ts +0 -13
  450. package/dist/sdk/merge/indexed-receipt-blobs.d.ts +0 -4
  451. package/dist/sdk/merge/receipt-file-boundary.d.ts +0 -23
  452. package/dist/sdk/merge/settlement-hook.d.ts +0 -12
  453. package/dist/sdk/merge/stage.d.ts +0 -13
  454. package/dist/sdk/merge/worktree-config.d.ts +0 -11
  455. package/dist/sdk/query/light-metadata.d.ts +0 -3
  456. package/dist/sdk/query/window-pagination.d.ts +0 -20
  457. package/dist/sdk/read-output/extension.d.ts +0 -7
  458. package/dist/sdk/read-output/provenance.d.ts +0 -20
  459. package/dist/sdk/read-output/surfaces.d.ts +0 -27
  460. package/dist/sdk/runtime/actions.d.ts +0 -4
  461. package/dist/sdk/runtime/mutation-admission.d.ts +0 -2
  462. package/dist/sdk/runtime/mutation-value-validation.d.ts +0 -16
  463. package/dist/sdk/runtime/schema.d.ts +0 -4
  464. package/dist/sdk/runtime-action-aliases.d.ts +0 -7
  465. package/dist/sdk/runtime-extended-actions.d.ts +0 -27
  466. package/dist/sdk/runtime-stats-options.d.ts +0 -9
  467. package/dist/sdk/test/command-args.d.ts +0 -4
  468. package/dist/sdk/test/command-resolution.d.ts +0 -5
  469. package/dist/sdk/test/entry.d.ts +0 -18
  470. package/dist/sdk/test/execution-receipts.d.ts +0 -34
  471. package/dist/sdk/test/receipt-index-snapshot.d.ts +0 -2
  472. package/dist/sdk/test/workspace-snapshot.d.ts +0 -11
  473. package/dist/sdk/traceability/runtime-files-lookup.d.ts +0 -8
  474. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +0 -472
@@ -1,8 +1,8 @@
1
- import{a as ug}from"./chunks/chunk-335BZ75D.js";import{a as Nk,b as Lk,c as Dk,d as $k}from"./chunks/chunk-YKXATU2G.js";import{a as Fk,b as Gk}from"./chunks/chunk-SLC5UWCM.js";import{b as nk,c as ik,d as sk,e as ak,f as dk,g as ck,h as lk,i as pk,j as uk,k as mk,l as fk,m as _k,n as hk,o as gk,p as yk,q as bk,r as Tk}from"./chunks/chunk-PE3ASURT.js";import{A as Ok,B as Rk,C as Ik,D as Pk,E as Mk,F as kk,G as xk,a as xs,b as gR,c as yR,d as Ed,e as Sd,f as wd,h as Ad,i as vd,j as Od,k as Rd,l as Id,m as Pd,n as Md,o as kd,p as Bd,q as qd,r as zd,s as Hd,t as Vd,u as Ck,v as Ek,w as Sk,x as wk,y as Ak,z as vk}from"./chunks/chunk-D7KYPRK4.js";import{A as ux,B as mx,C as fx,D as _x,E as hx,F as gx,G as yx,H as bx,I as Tx,J as Cx,K as Ex,L as Sx,M as wx,N as Ax,O as vx,P as Ox,Q as Rx,R as Ix,S as Px,T as Mx,U as kx,V as xx,W as Nx,X as Lx,Y as Dx,Z as $x,_ as Fx,a as Uk,b as jk,c as Bk,d as qk,e as zk,f as Hk,g as Vk,h as Kk,i as Wk,j as Yk,k as Xk,l as Jk,m as Zk,n as Qk,o as ex,p as tx,q as rx,r as ox,s as nx,t as ix,u as sx,v as ax,w as dx,x as cx,y as lx,z as px}from"./chunks/chunk-WC4M2H6R.js";import{$ as Wm,$a as j_,$b as jh,A as km,Aa as c_,Ab as fh,B as xm,Ba as l_,Bb as _h,C as Lm,Ca as p_,Cb as hh,D as Dm,Da as u_,Db as gh,E as qt,Ea as m_,Eb as yh,F as zt,Fa as f_,Fb as bh,G as Ht,Ga as __,Gb as Th,H as Vt,Ha as h_,Hb as Ch,I as Kt,Ia as g_,Ib as Eh,J as Wt,Ja as y_,Jb as Sh,K as Yt,Ka as b_,Kb as wh,L as Xt,La as T_,Lb as Ah,M as Jt,Ma as C_,Mb as vh,N as Zt,Na as E_,Nb as Oh,O as Qt,Oa as S_,Ob as Rh,P as $m,Pa as w_,Pb as Ih,Q as Fm,Qa as A_,Qb as Ph,R as Gm,Ra as v_,Rb as Mh,S as Um,Sa as O_,Sb as kh,T as jm,Ta as er,Tb as xh,U as Xe,Ua as ge,Ub as Nh,V as Bm,Va as L_,Vb as Lh,W as qm,Wa as D_,Wb as Dh,X as zm,Xa as $_,Xb as $h,Y as Hm,Ya as F_,Yb as Fh,Z as Vm,Za as G_,Zb as Gh,_ as Km,_a as U_,_b as Uh,a as $O,aa as Ym,ab as B_,ac as Bh,b as FO,ba as G0,bb as q_,bc as qh,c as GO,ca as U0,cb as z_,cc as zh,d as UO,da as j0,db as H_,dc as Hh,e as jO,ea as cf,eb as V_,ec as Vh,f as BO,fa as lf,fb as K_,fc as Kh,g as HO,ga as pf,gb as W_,gc as Wh,h as VO,ha as Zf,hb as Y_,hc as Yh,i as KO,ia as Qf,ib as X_,ic as Xh,j as WO,ja as X0,jb as J_,jc as Jh,k as Ns,ka as J0,kb as Z_,kc as Zh,l as XI,la as Z0,lb as Q_,lc as Qh,m as JI,ma as Q0,mb as eh,mc as eg,n as ZI,na as ek,nb as th,nc as tg,o as QI,oa as tk,ob as rh,oc as rg,p as eP,pa as rk,pb as oh,pc as og,q as tP,qa as ok,qb as nh,qc as ng,r as Ul,ra as e_,rb as ih,rc as ig,s as hu,sa as t_,sb as sh,sc as sg,t as gu,ta as r_,tb as ah,tc as ag,u as Tu,ua as o_,ub as dh,uc as dg,v as Cu,va as n_,vb as ch,vc as cg,w as Uu,wa as i_,wb as lh,wc as lg,x as Ku,xa as s_,xb as ph,xc as pg,y as vM,ya as a_,yb as uh,z as Ye,za as d_,zb as mh}from"./chunks/chunk-X3URBPMV.js";import{e as nP,f as iP,g as jl,h as Bl,i as Ut}from"./chunks/chunk-OH6WQ7VT.js";import{A as R0,B as I0,C as P0,D as M0,E as k0,F as x0,G as N0,H as L0,I as D0,J as $0,K as F0,L as Zm,M as Qm,N as ef,O as tf,P as rf,Q as of,R as nf,S as sf,T as af,U as df,a as cM,b as lM,c as pM,d as uM,e as mM,f as _u,g as fM,h as _M,i as hM,j as gM,k as yM,m as Nm,n as Xm,o as g0,p as y0,q as b0,r as T0,s as C0,t as E0,u as Jm,v as S0,w as w0,x as A0,y as v0,z as O0}from"./chunks/chunk-AUEKTX7V.js";import{$ as II,$a as bp,$b as Eu,$c as Y0,A as nI,Aa as Wl,Ab as nu,Ad as Vf,B as iI,Ba as Yl,Bb as iu,Bd as Kf,C as sI,Ca as Xl,Cb as su,Cd as Wf,D as aI,Da as Jl,Db as au,Dd as Yf,E as dI,Ea as Zl,Eb as du,Ec as Qu,Ed as Xf,F as We,Fa as Ql,Fb as cu,Fd as Jf,G as cI,Ga as ep,Gb as lu,Gc as em,Gd as R_,H as Nt,Ha as tp,Hb as pu,Hc as tm,Hd as I_,I as lI,Ia as rp,Ib as uu,Ic as Am,Id as P_,J as pI,Ja as op,Jb as mu,Jc as vm,Jd as M_,K as uI,Ka as np,Kb as tM,Kd as k_,L as mI,La as ip,Lb as rM,Lc as Om,Ld as x_,M as fI,Ma as sp,Mb as oM,Mc as Rm,Md as N_,N as _I,Na as ap,Nb as nM,Nc as Im,O as hI,Oa as dp,Ob as iM,Oc as Pm,P as gI,Pa as cp,Pb as sM,Pc as Mm,Q as yI,Qa as lp,Qb as aM,Qc as uf,R as bI,Ra as pp,Rb as dM,Rc as mf,S as TI,Sa as dP,Sb as fu,Sc as ff,T as CI,Ta as up,Tb as bM,Tc as _f,U as EI,Ua as mp,Ub as TM,Uc as hf,V as SI,Va as fp,Vb as CM,Vc as gf,W as wI,Wa as _p,Wb as EM,Wc as yf,X as AI,Xa as cP,Xb as SM,Xc as bf,Y as vI,Ya as hp,Yc as Tf,Z as OI,Za as gp,Zb as yu,Zc as K0,_ as RI,_a as yp,_b as bu,_c as W0,a as YR,aa as PI,ab as Tp,ac as Su,ad as Cf,b as Mt,ba as MI,bb as lP,bd as Ef,c as XR,ca as kI,cb as pP,cc as wu,cd as Sf,d as Ve,da as xI,db as uP,dc as Au,dd as wf,e as te,ea as NI,eb as mP,ec as vu,ed as Af,f as jc,fa as LI,fb as fP,fc as Ou,fd as vf,gb as _P,gc as Ru,gd as Of,ha as wl,hb as hP,hc as Iu,hd as Rf,i as Ke,ia as Al,ib as DP,ic as Pu,id as If,j as Bc,ja as vl,jb as $P,jc as Mu,jd as Pf,k as qc,ka as Ol,kb as FP,kc as ku,kd as Mf,la as Rl,lb as GP,lc as xu,ld as kf,m as he,mb as UP,mc as Nu,md as xf,n as zc,na as Il,nb as jP,nc as Lu,nd as Nf,o as Hc,oa as Pl,ob as BP,oc as Du,od as Lf,p as Vc,pa as Ml,pb as WP,pc as $u,pd as Df,q as Kc,qa as kl,qb as YP,qc as Fu,qd as $f,r as JR,ra as rP,rb as eu,rd as Ff,s as ZR,sa as oP,sb as tu,sc as wM,sd as Gf,t as QR,ta as xl,tb as XP,tc as AM,td as Uf,u as eI,ua as Nl,ub as JP,uc as Gu,v as tI,va as Ll,vb as ZP,vc as Wu,vd as jf,w as kt,wa as Dl,wb as QP,wc as Yu,wd as Bf,x as rI,xa as $l,xb as eM,xc as Xu,xd as qf,y as oI,ya as Fl,yb as ru,yc as Ju,yd as zf,z as xt,za as Gl,zb as ou,zc as Zu,zd as Hf}from"./chunks/chunk-QNWUIPBO.js";import"./chunks/chunk-UJMQP2HP.js";import{w as Rc}from"./chunks/chunk-6VRX2CM7.js";import{A as YI,Aa as _l,B as sl,C as al,Ca as hl,D as dl,Da as gl,E as cl,Ea as yl,F as Lt,Fa as bl,Ga as Tl,Ia as Cl,Ja as El,Ka as Sl,a as QO,b as eR,c as tR,d as rR,e as oR,f as nR,g as Ls,h as Ds,i as $s,j as Fs,k as Gs,la as Dt,m as DI,ma as $t,na as Ft,oa as Gt,pa as ll,ra as pl,sa as ul,ta as ml,v as HI,w as VI,y as KI,z as WI,za as fl}from"./chunks/chunk-LS3GI3H4.js";import{a as $I,b as FI,c as GI,d as UI,e as jI,f as BI,g as qI,h as Zc,i as Qc,j as el,k as tl,l as rl,m as zI,n as ol,o as nl,p as il}from"./chunks/chunk-DAX3AOFI.js";import{$a as PP,$b as e0,A as jR,Aa as Vp,Ab as IM,Ac as Tm,B as Ic,Ba as Kp,Bb as PM,Bc as Cm,C as Pc,Ca as Wp,Cb as MM,Cc as Em,D as Mc,Da as Yp,Db as kM,Dc as Bt,E as kc,Ea as Xp,Eb as xM,Ec as Sm,F as xc,Fa as Jp,Fb as NM,Fc as m0,G as Nc,Ga as Zp,Gc as f0,H as Lc,Ha as Qp,Hb as sm,Hc as _0,I as Dc,Ib as LM,Ic as wm,J as $c,Jb as DM,Jc as h0,K as Fc,Kb as $M,Kc as B0,L as Gc,La as gP,Lb as FM,Lc as q0,M as He,Ma as yP,Mb as GM,Mc as z0,N as BR,Na as bP,Nb as UM,Nc as H0,O as qR,Oa as TP,Ob as jM,Oc as V0,P as zR,Pa as CP,Pb as BM,Q as HR,Qa as EP,Qb as qM,R as VR,Ra as SP,Rb as zM,S as KR,Sa as wP,Sb as HM,T as WR,Ta as AP,Tb as VM,U as Uc,Ua as vP,Ub as KM,V as ql,Va as OP,Vb as WM,W as zl,Wa as RP,Wb as YM,X as Hl,Xa as IP,Xb as XM,Y as Vl,Yb as JM,Z as sP,Zb as ZM,_ as aP,_b as QM,a as YO,aa as Kl,ac as t0,b as XO,ba as Cp,bb as MP,bc as r0,c as JO,ca as Ep,cb as kP,cc as o0,d as ZO,da as Sp,dc as n0,e as OR,ea as wp,ec as i0,f as RR,fa as Ap,fb as xP,fc as s0,g as IR,ga as vp,gb as NP,gc as a0,h as PR,ha as Op,hb as LP,hc as d0,i as MR,ia as Rp,ic as c0,j as kR,ja as Ip,jb as qP,jc as l0,k as xR,ka as Pp,kb as zP,kc as p0,la as Mp,lb as HP,lc as u0,ma as kp,mb as VP,mc as jt,na as xp,nb as KP,nc as am,oa as Np,ob as ju,oc as dm,pa as Lp,pb as Bu,pc as cm,qa as Dp,qb as qu,qc as lm,ra as $p,rb as zu,rc as pm,sa as Fp,sb as Hu,sc as um,t as NR,ta as Gp,tb as Vu,tc as mm,u as LR,ua as Up,ub as OM,uc as fm,v as DR,va as jp,vb as rm,vc as _m,w as $R,wa as Bp,wb as om,wc as hm,x as FR,xa as qp,xb as nm,xc as gm,y as GR,ya as zp,yb as im,yc as ym,z as UR,za as Hp,zb as RM,zc as bm}from"./chunks/chunk-S4LPZ4TN.js";import{a as qO,b as zO}from"./chunks/chunk-UEGXWXUZ.js";import{$ as Sa,$a as ee,$b as wc,A as Js,Aa as Xa,Ab as cc,B as Zs,Ba as Ja,Bb as lc,C as Qs,Ca as Za,Cb as pc,D as ea,Da as Qa,Db as uc,E as ta,Ea as ed,Eb as mc,F as ra,Fa as td,Fb as fc,Ga as rd,Gb as _c,H as oa,Ha as od,Hb as hc,I as na,Ia as nd,J as ia,Ja as id,K as sa,Ka as sd,L as aa,La as ad,Lb as bR,M as da,Ma as dd,Mb as TR,N as ca,Na as cd,Nb as CR,O as la,Oa as ld,Ob as ER,P as pa,Pa as pd,Pb as SR,Q as ua,Qa as ud,Qb as wR,R as ma,Ra as md,Rb as AR,S as fa,Sa as fd,Sb as vR,T as _a,Ta as _d,U as ha,Ua as hd,Ub as gc,V as ga,Va as gd,Vb as yc,W as ya,Wa as yd,Wb as bc,X as ba,Xa as bd,Xb as Tc,Y as Ta,Ya as Td,Yb as Cc,Z as Ca,Zb as Ec,_ as Ea,_a as ze,_b as Sc,a as iR,aa as wa,ab as Cd,ac as Ac,b as sR,ba as Aa,bb as xd,bc as vc,c as aR,ca as va,cb as Nd,cc as Oc,d as Be,da as Oa,db as Ld,dc as Pt,e as dR,ea as Ra,eb as Dd,f as cR,fa as Ia,fb as $d,g as lR,ga as Pa,gb as Fd,h as It,ha as Ma,hb as Gd,i as qe,ia as ka,ib as Ud,j as pR,ja as xa,jb as jd,k as uR,ka as Na,kb as Kd,l as mR,la as La,lb as Wd,m as fR,ma as Da,mb as Yd,n as _R,na as $a,nb as Xd,o as hR,oa as Fa,ob as Jd,p as Us,pa as Ga,pb as Zd,q as js,qa as Ua,qb as Qd,r as Bs,ra as ja,rb as ec,s as qs,sa as Ba,sb as tc,t as zs,ta as qa,tb as rc,u as Hs,ua as za,ub as oc,v as Vs,va as Ha,vb as nc,w as Ks,wa as Va,wb as ic,x as Ws,xa as Ka,xb as sc,y as Ys,ya as Wa,yb as ac,z as Xs,za as Ya,zb as dc}from"./chunks/chunk-HNGLDMSZ.js";import{a as RO,b as IO,c as PO,d as MO,e as kO,f as xO,g as NO,h as LO,i as DO,j as ws,k as As,l as vs,m as Os,n as Rs,o as Is,q as Ps,s as Ms,x as ks}from"./chunks/chunk-FRNMQM45.js";import{b as AO}from"./chunks/chunk-HRFGFIYU.js";import"./chunks/chunk-IB7UB5TE.js";import{$ as OE,$b as Uv,$c as Es,A as XT,Aa as BA,Ac as Yv,B as JT,Bb as Qi,Bc as Xv,Cb as Av,Cc as Jv,Dc as Zv,Eb as vv,Ec as Qv,Fb as Ov,Fc as eO,Gb as Rv,Gc as tO,Hc as rO,Ib as Iv,Ic as oO,J as aC,Jc as nO,Ka as qA,Kc as iO,L as hC,La as zA,Lb as Pv,Lc as sO,M as gC,Ma as HA,Mc as aO,N as yC,Na as VA,Nb as Mv,Nc as dO,O as bC,Oa as KA,Oc as cO,P as AC,Pa as WA,Pc as lO,Q as vC,Qa as ev,Qc as ps,R as At,Ra as tv,Rb as kv,Rc as us,S as CE,Sa as rv,Sb as xv,Sc as ms,T as EE,Ta as vt,Tb as Nv,Tc as fs,U as SE,Ub as es,Uc as _s,Va as ov,Vb as Lv,Vc as hs,W as wE,Wa as nv,Wc as gs,Xa as iv,Xb as Dv,Xc as ys,Y as AE,Ya as sv,Yb as $v,Yc as bs,Z as vE,Za as av,Zb as Fv,Zc as Ts,_b as Gv,_c as Cs,a as DT,aa as RE,ab as dv,ac as jv,ad as Ss,ba as IE,bc as Bv,bd as pO,ca as hA,cc as qv,cd as uO,da as gA,dc as zv,dd as mO,ea as yA,eb as Ki,ec as Hv,ed as fO,fa as bA,fc as Ot,fd as _O,ga as IA,gc as Vv,gd as hO,hd as gO,i as nn,ia as qi,ic as Kv,id as yO,j as $T,ja as zi,jd as bO,k as FT,ka as Hi,kd as TO,l as GT,ld as CO,m as UT,ma as PA,n as jT,na as MA,o as BT,oa as kA,oc as ts,pa as xA,pb as gv,pc as rs,pd as Rt,q as qT,qa as NA,qb as yv,qc as os,qd as EO,ra as LA,rb as bv,rc as ns,rd as SO,s as zT,sa as DA,sb as Tv,sd as wO,t as HT,tc as is,td as vO,u as VT,ua as $A,ub as Cv,uc as ss,ud as OO,vb as Ev,vc as as,w as KT,wa as FA,wb as Sv,wc as ds,x as WT,xa as GA,xb as wv,xc as cs,ya as UA,yb as Ji,yc as ls,z as YT,za as jA,zb as Zi,zc as Wv}from"./chunks/chunk-5GWEY4P6.js";import{$ as bt,$b as xC,$c as ZC,$d as FE,$e as rS,$f as RS,$g as iw,$h as Qw,$i as mv,A as Fo,Aa as ZT,Ab as mC,Ac as zC,Ad as Ln,Ae as VE,Ag as NS,Ah as kw,Ai as TA,B as Go,Ba as QT,Bc as HC,Bd as _E,Be as KE,Bg as LS,Bh as xw,Bi as CA,C as Uo,Ca as eC,Cb as Et,Cd as Dn,Ce as WE,Ch as Nw,Ci as EA,D as jo,De as YE,Df as sS,Dh as Lw,Di as SA,E as Bo,Eb as St,Ed as hE,Ee as XE,Ef as aS,Eg as DS,Eh as Dw,Ei as wA,F as qo,Fa as hn,Fd as gE,Fe as JE,Ff as dS,Fg as $S,Fh as $w,Fi as AA,G as zo,Ga as tC,Gb as vn,Gd as yE,Ge as ZE,Gf as cS,Gg as FS,Gh as Fw,Gi as vA,H as De,Ha as rC,Hb as On,Hc as Pn,Hd as bE,He as QE,Hf as lS,Hg as GS,Hh as Gw,Hi as OA,I as $e,Ia as oC,Ib as _e,Ic as VC,Id as TE,Ie as Xn,If as pS,Ig as US,Ih as Ui,Ii as RA,J as Ho,Ja as nC,Jd as PE,Je as Jn,Jf as uS,Jg as jS,Jh as Uw,K as Vo,Kb as fC,Kc as KC,Kd as ME,Ke as D,Kf as mS,Kg as BS,L as Ko,La as gn,Ld as kE,Le as Zn,Lf as fS,Lg as qS,M as Wo,Ma as yn,Mb as _C,Md as xE,Mf as _S,Mg as zS,Mh as jw,N as Yo,Na as Ge,Nb as TC,Nd as NE,Nf as hS,Ng as HS,Nh as Bw,Ni as YA,O as Xo,Oa as iC,Ob as CC,Od as LE,Og as VS,Oh as qw,P as Jo,Pa as sC,Pb as EC,Pg as KS,Ph as zw,Q as Zo,Qa as bn,Qb as SC,Qf as gS,Qg as WS,Qh as Hw,Qi as XA,R as Qo,Ra as Tn,Rb as wC,Re as je,Rf as yS,Rg as YS,Rh as Vw,Ri as JA,S as en,Sb as OC,Se as Qn,Sf as bS,Sg as XS,T as tn,Ta as Cn,Tb as Ue,Tf as TS,Tg as JS,Th as Kw,U as rn,Ub as wt,Ud as DE,Uf as CS,Ug as ZS,Uh as Ww,Ui as ZA,V as on,Vb as RC,Vf as ES,Vg as QS,Vi,Wb as IC,Wc as WC,Wf as SS,Wg as ew,Wi as QA,Xb as PC,Xc as YC,Xd as $n,Xf as wS,Xg as tw,Xh as Yw,Xi as cv,Yb as MC,Yc as XC,Yd as $E,Yf as AS,Yg as rw,Yh as Xw,Yi as lv,Zb as z,Zd as Fn,Ze as eS,Zf as vS,Zg as ow,Zh as Jw,Zi as pv,_b as kC,_c as JC,_e as tS,_f as OS,_g as nw,_h as Zw,_i as uv,a as I,aa as Tt,ac as NC,af as ei,ah as sw,ai as eA,aj as fv,b as wT,ba as cn,bc as LC,bd as QC,bf as ti,bg as Ti,bh as aw,bi as tA,bj as _v,c as yt,ca as ln,cc as DC,cd as Mn,cf as ri,cg as Ci,ch as dw,ci as rA,cj as hv,d as AT,da as pn,dc as $C,df as oi,dg as Ei,dh as cw,di as oA,dj as Wi,e as vT,eb as En,ec as FC,ed as kn,ee as GE,ef as ni,eg as Si,eh as lw,ei as nA,ej as Yi,f as OT,fb as Sn,fd as xn,ff as ii,fg as wi,fh as pw,fi as iA,fj as Xi,g as RT,gb as wn,ge as UE,gf as si,gg as Ai,gh as uw,gi as sA,h as IT,ha as un,hc as GC,he as jE,hf as ai,hg as vi,hh as mw,hi as aA,i as PT,ib as An,id as eE,ie as Gn,if as di,ig as Oi,ih as fw,j as MT,ja as mn,jc as Rn,jd as tE,je as Un,jf as ci,jg as Ri,jh as _w,ji as dA,k as kT,ka as fn,kc as In,kd as rE,kf as li,kg as Ii,kh as hw,ki as ji,l as xT,la as _n,lb as dC,ld as oE,le as jn,lf as pi,lg as Pi,lh as gw,li as Bi,m as NT,mb as cC,md as nE,me as Bn,mf as ui,mg as Mi,mh as yw,n as LT,nd as iE,ne as qn,nf as mi,ng as ki,nh as bw,o as Io,od as sE,oe as zn,of as fi,og as xi,oh as Tw,p as Po,pd as Nn,pe as Hn,pf as oS,pg as Ni,ph as Cw,q as Mo,qd as aE,qe as BE,qf as nS,qg as Li,qh as Ew,qi as cA,r as ko,rb as lC,rd as dE,re as qE,rf as _i,rg as Di,rh as Sw,ri as lA,s as Ne,sf as iS,sg as $i,sh as ww,si as pA,t as xo,tf as hi,tg as Fi,th as Aw,ti as uA,u as L,ub as pC,ud as cE,ue as Vn,uf as gi,ug as Gi,uh as vw,v as Le,vc as UC,vd as lE,ve as Kn,vf as yi,vg as IS,vh as Ow,vi as mA,w as No,wd as pE,we as zE,wf as bi,wg as PS,wh as Rw,wi as fA,x as Lo,xb as uC,xc as jC,xd as uE,xe as Wn,xg as MS,xh as Iw,y as Do,yc as BC,yd as mE,ye as Yn,yg as kS,yh as Pw,yi as _A,z as $o,zc as qC,zd as fE,ze as HE,zg as xS,zh as Mw}from"./chunks/chunk-7ZRCYESH.js";import"./chunks/chunk-SPPHDVZE.js";import{a as Wc,b as Yc,e as Xc,f as Jc}from"./chunks/chunk-RSAN2YUU.js";import"./chunks/chunk-VS565KBX.js";import{A as me,B as ST,C as b,E as sn,F as Ct,G as fe,H as an,K as Fe,M as dn,b as hT,c as gT,d as yT,m as bT,r as TT,u as CT,y as ET}from"./chunks/chunk-O4ZLEN4T.js";import"./chunks/chunk-XAWE4EAK.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]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var H="2026-07-28",rr=["2025-11-25","2025-06-18"],re=[H],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},w={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},tr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mg(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function fg(e){if(e!==void 0){if(typeof e!="string"||!tr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:w.logLevel,allowed:[...tr]});return e}}function Je(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[w.protocolVersion,w.clientCapabilities]});let r=t[w.protocolVersion];if(typeof r!="string"||!re.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...re],requested:typeof r=="string"?r:null});let o=t[w.clientCapabilities];if(!h(o))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:w.clientCapabilities,expected:"object"});let n=mg(t[w.clientInfo]),s=fg(t[w.logLevel]);return{protocolVersion:H,clientCapabilities:o,...n?{clientInfo:n}:{},...s?{logLevel:s}:{}}}function Gx(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function Ux(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function jx(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Ze(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[w.serverInfo]:{...t}}}}function _g(e,t){return Ze({...e,resultType:"complete"},t)}function Bx(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return _g({supportedVersions:[...re],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function qx(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}(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]="d4a56906-c542-567e-9265-15184a5c330b")}catch{}})();var hg=new Set(["--help","-h","--version","-V"]);function gg(e,t){let r=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&r.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),r.push("",`MCP protocol: ${re.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${rr.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),r.join(`
2
- `)}function Vx(e,t,r){if(e.length===0)return{kind:"serve"};let o=e.find(n=>!hg.has(n));if(o!==void 0){let n=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(o)}. Run ${n} --help.
3
- `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?gg(t,r):`${r}
4
- `,stderr:""}}import{createHash as ir,createHmac as sr,timingSafeEqual as yg}from"node:crypto";(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]="15b81dd0-ef1a-58be-b6ee-5975b6778993")}catch{}})();var bg=["elicitation/create","roots/list","sampling/createMessage"],or=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},ar=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ye=32,et=64*1024,be=16*1024,Qe={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Tg(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Te(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function tt(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ye)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:ye,observed:r.length});let o={};for(let[n,s]of r){if(!ar.test(n)||!h(s))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let i=s.method;if(typeof i!="string"||!bg.includes(i))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:i??null});let a=Tg(i);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(s.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:i,params:structuredClone(s.params)}}return Te(o,et,"inputRequests"),o}function dr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ye)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:ye,observed:t.length});let r={};for(let[o,n]of t){if(!ar.test(o)||!h(n))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return Te(r,et,"inputResponses"),r}function Xx(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>be)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:be});let r=e.inputRequests===void 0?void 0:tt(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[w.serverInfo]:{...e.serverInfo}}}}function cr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function Jx(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>be/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:be/2});let o=r.toString("base64url"),n=sr("sha256",cr(t)).update(o).digest("base64url");return`${o}.${n}`}function Cg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}}function Zx(e,t,r){let[o,n,s]=e.split(".");if(!o||!n||s!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let i=Buffer.from(n,"base64url"),a=sr("sha256",cr(t)).update(o).digest();if(i.byteLength!==a.byteLength||!yg(i,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let d;try{d=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{d=null}let c=Cg(d),{expiresAt:l,method:p,parameterDigest:f,principal:_}=c;if(l<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(p!==r.method||f!==r.parameterDigest||_!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return c}function Qx(e){return Te(e,et,"request parameters"),ir("sha256").update(JSON.stringify(e)).digest("hex")}var nr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=ir("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function Eg(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function eN(e,t){return{...e,...Eg(t)}}function Sg(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function wg(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Sg)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Ag(e){let t=e.maxBytes??Qe.maxBytes,r=e.maxDepth??Qe.maxDepth,o=e.maxNodes??Qe.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function vg(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function Og(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&wg(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function tN(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Ag(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});Te(e,r,"JSON Schema");let s=[{value:e,depth:0}],i=0;for(;s.length>0;){let a=s.pop();if(i+=1,i>n||a.depth>o)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});Og(e,a.value),vg(a,s)}return structuredClone(e)}import{randomUUID as Rg}from"node:crypto";import{readFile as Ig}from"node:fs/promises";import lr 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]="f3e94896-b2a0-561c-902b-71c28ddde2a1")}catch{}})();var cN="io.modelcontextprotocol/tasks",Pg=["working","input_required","completed","failed","cancelled"],Mg=/^mcp-task-[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,kg=3600*1e3,xg=1e3,Ee=1024,Ng=30,Lg=2e3;function rt(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function Ce(e){let t=e.trim();if(!Mg.test(t))throw rt("Unknown MCP task");return t}function pr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function ur(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Ee),...h(e.data)?{data:structuredClone(e.data)}:{}}}function Dg(e){if(!Pg.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function $g(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function Fg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function Gg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function Ug(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function jg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function Bg(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?Ce(e.taskId):"",r=Dg(e.status),o=$g(e.principal),n=Fg(e.workerPid),s=Gg(e.ttlMs),i=Ug(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:pr(e.createdAt,"createdAt"),lastUpdatedAt:pr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:s,consumedInputKeys:jg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Ee)}:{},...typeof i=="number"?{pollIntervalMs:i}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=ur(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function V(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function oe(e){return e==="completed"||e==="failed"||e==="cancelled"}function qg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var ot=class{#e;#t;#r;#o;#i;constructor(t){this.#e=lr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Rg()}`),this.#i=t.workerPid??process.pid}#s(t){return lr.join(this.#e,"runtime","mcp-tasks","records",`${Ce(t)}.json`)}async#d(t){try{return Bg(JSON.parse(await Ig(this.#s(t),"utf8")))}catch(r){throw fe(r)||r instanceof SyntaxError?rt("Unknown MCP task"):r}}async#a(t){await Fe(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
5
- `)}async#n(t,r,o){let n=Ce(t),s=await je(this.#e,n,Ng,this.#t,!1,!1,Lg);try{let i=await this.#d(n);if(i.principal!==r)throw rt("Unknown MCP task");let a=o(i);return await this.#a(a),a}finally{await s()}}async create(t){let r=Ce(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?kg:t.ttlMs,s=t.pollIntervalMs??xg;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(s)||s<0)throw new u("Invalid MCP task creation options",m.invalidParams);let i=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:i,lastUpdatedAt:i,ttlMs:n,pollIntervalMs:s,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Ee)}:{}};return await this.#a(a),{...V(a),resultType:"task"}}async get(t,r){return V(await this.#n(t,r,o=>{if(oe(o.status))return o;let n=this.#r().getTime(),s=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,i=o.workerPid!==this.#i&&!qg(o.workerPid);return!s&&!i?o:{...o,status:"failed",statusMessage:s?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:s?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=tt(t.inputRequests,t.requestContext);return V(await this.#n(t.taskId,t.principal,o=>{if(oe(o.status))return o;let n=Object.keys(r).filter(s=>o.consumedInputKeys.includes(s));if(n.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Ee),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=dr(o),s=[],i=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let d={...a.inputRequests},c=a.inputResponses?{...a.inputResponses}:{};for(let[l,p]of Object.entries(n))Object.prototype.hasOwnProperty.call(d,l)&&(c[l]=p,delete d[l],s.push(l));return i=Object.keys(d).sort(),s.length===0?a:{...a,status:i.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:i.length===0?void 0:d,inputResponses:c,consumedInputKeys:[...new Set([...a.consumedInputKeys,...s])].sort()}}),{acceptedKeys:s.sort(),remainingKeys:i}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return V(await this.#n(t,r,n=>oe(n.status)?n:{...n,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(o),inputRequests:void 0,error:void 0}))}async fail(t,r,o){let n=ur(o);return V(await this.#n(t,r,s=>oe(s.status)?s:{...s,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return V(await this.#n(t,r,o=>oe(o.status)?o:{...o,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function lN(e){return new ot(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]="15cbe26a-5716-5e8c-8700-eb36a1a056d6")}catch{}})();var Se="io.modelcontextprotocol/subscriptionId",mr=256,fr=2048,zg=5e3;function Hg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),zg);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},s=>{clearTimeout(n),o(s instanceof Error?s:new Error(String(s)))})})}function nt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function Vg(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=nt(e.toolsListChanged,"toolsListChanged"),r=nt(e.promptsListChanged,"promptsListChanged"),o=nt(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>mr)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:mr});let s=new Set;for(let i of e.resourceSubscriptions){if(typeof i!="string"||i.trim().length===0||Buffer.byteLength(i,"utf8")>fr)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:fr});s.add(i)}s.size>0&&(n=[...s].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function Kg(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var _r=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new u("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=Kg(Vg(t.notifications),this.#e),o={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,o);try{await this.#o(t.id,o,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Se]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[s,i]of this.#t)i.filter[r]===!0&&n.push(this.#o(s,i,{jsonrpc:"2.0",method:o,params:{_meta:{[Se]:s}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Se]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let s=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await Hg(r.sink,o),!0}catch(i){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw i;return!1}});return r.writeQueue=s.then(()=>{},()=>{}),s}close(t){if(this.#t.delete(t))return{...Ze({resultType:"complete",_meta:{[Se]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}return 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]="3681273a-e101-57a0-9446-982c450e7183")}catch{}})();var hr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,Wg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,gr=/^[\t\x20-\x7E]*$/u,yr=new Set(["prompts/get","resources/read","tools/call"]);function Yg(e){let t=new Map;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let n=typeof o=="string"?o:o.join(", ");t.set(r.toLowerCase(),n)}return t}function A(e,t){throw new u(e,m.headerMismatch,{header:t})}function br(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&gr.test(t)&&!hr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Tr(e,t){let r=hr.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?A("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!gr.test(e)?A("Malformed MCP header value",t):e}function we(e){return Array.isArray(e)?e.some(we):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(we):!1}function Xg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!Wg.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function Cr(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,s)=>{let i=n.properties;if(i!==void 0){if(!h(i))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,d]of Object.entries(i)){if(!h(d))continue;let c=[...s,a],l=Xg(d,c,r);l&&t.push(l);for(let[p,f]of Object.entries(d))if(p!=="properties"&&p!=="x-mcp-header"&&we(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:c.join("."),keyword:p});o(d,c)}}};for(let[n,s]of Object.entries(e))if(n!=="properties"&&we(s))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Er(e,t){let r=e;for(let o of t){if(!h(r))return;r=r[o]}return r}function Sr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function Jg(e,t){let r=h(e.arguments)?e.arguments:{},o={};for(let n of Cr(t)){let s=Er(r,n.path);if(s!=null){if(!(n.type==="integer"&&typeof s=="number"&&Number.isSafeInteger(s)||n.type==="boolean"&&typeof s=="boolean"||n.type==="string"&&typeof s=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=br(s)}}return o}function _N(e){let t=h(e.request.params)?e.request.params:void 0,r=Je(t),o=e.request.method;if(typeof o!="string"||o.length===0)return A("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},s=Sr(o,t);if(yr.has(o)){if(s===void 0)return A("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=br(s)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,Jg(t,e.toolSchema)),n}function Zg(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let o=h(t.params)?t.params:void 0,n=Je(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&A("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&A("MCP method header does not match request body","Mcp-Method"),yr.has(r)){let s=e.get("mcp-name"),i=Sr(r,o);(s===void 0||i===void 0||Tr(s,"Mcp-Name")!==i)&&A("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&A("MCP SSE resumability is not supported","Last-Event-ID")}function Qg(e,t,r){return e.type==="integer"?typeof t=="number"&&Number.isSafeInteger(t)&&Number(r)===t:e.type==="boolean"?typeof t=="boolean"&&r===String(t):typeof t=="string"&&r===t}function ey(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Cr(e.toolSchema)){let o=Er(t,r.path),n=`Mcp-Param-${r.name}`,s=e.headers.get(n.toLowerCase());if(o==null){s!==void 0&&A("Unexpected MCP parameter header",n);continue}s===void 0&&A("Missing MCP parameter header",n),Qg(r,o,Tr(s,n))||A("MCP parameter header does not match request body",n)}}function hN(e){let t=Yg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";Zg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&ey({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var gN=H;import{AsyncLocalStorage as ty}from"node:async_hooks";import{createHash as wr,timingSafeEqual as ry}from"node:crypto";(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]="a7c30d99-a0e4-552e-be61-0c54a455e211")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},oy=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,ny=/^[a-z][a-z0-9_*/-]{0,255}$/u,iy=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,sy=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,vr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Or=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,ay=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,dy=/%(?![0-9A-Fa-f]{2})/u,cy=512,ly=32,py=180,uy=8192,my=8192,Rr=new ty;function S(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function fy(e,t){let r=t.toLowerCase();for(let[o,n]of Object.entries(e))if(!(o.toLowerCase()!==r||n===void 0))return typeof n=="string"?n:n.join(", ")}function EN(e){let t=S(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>S(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!vr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function SN(e){let t=S(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function wN(e,t){if(!h(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=S(t,"expected issuer").href.replace(/\/$/u,"");if(S(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let o=d=>{let c=e[d];if(typeof c!="string")throw new y(`Authorization server metadata requires ${d}`,401);return S(c,d).href},n=d=>{let c=e[d];return typeof c=="string"?S(c,d).href:void 0},s=o("authorization_endpoint"),i=o("token_endpoint"),a=n("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:i,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...a?{registration_endpoint:a}:{}}}function AN(e){return e.hasPreRegisteredClient?"pre_registered":e.metadata.client_id_metadata_document_supported?"client_id_metadata_document":e.metadata.registration_endpoint?"dynamic":"user_supplied"}function vN(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new y("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new y("Authorization response issuer mismatch",401)}function ON(e,t){let r=S(t,"client metadata document URL");if(r.pathname==="/"||!h(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);S(o,"client redirect URI",!0)}return structuredClone(e)}function RN(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>S(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Ar=class{#e=new Map;set(t,r){let o=S(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=S(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=S(t,"credential issuer").href;return this.#e.delete(r)}};function _y(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?oy.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],s=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(s))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!gy(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function hy(e){return ny.test(e)||iy.test(e)}function gy(e){if(Buffer.byteLength(e,"utf8")>cy)return!1;let t=e.split(",");if(t.length>ly)return!1;let r=new Set;for(let o of t){let n=$(o);if(n.length===0)continue;let s=n.indexOf("="),i=s>0?n.slice(0,s):"",a=s>0?n.slice(s+1):"";if(!hy(i)||!sy.test(a)||r.has(i))return!1;r.add(i)}return!0}function Ir(e){return ay.test(e)&&!dy.test(e)}function yy(e){let t=$(e),r=t.indexOf("="),o=$(r>=0?t.slice(0,r):t),n=r>=0?$(t.slice(r+1)):void 0;return Or.test(o)&&(n===void 0||Ir(n))}function by(e){let t=$(e),r=t.split(";"),o=r[0],n=r.slice(1),s=o.indexOf("="),i=$(s>0?o.slice(0,s):""),a=s>0?$(o.slice(s+1)):"";if(!(!Or.test(i)||!Ir(a)||!n.every(yy)))return{key:i,serialized:t}}function Ty(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>uy)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>py)throw new y("Invalid MCP baggage",403);let n=[];for(let s of o){let i=by(s);if(!i)throw new y("Invalid MCP baggage",403);r.has(i.key)&&n.push(i.serialized)}return n.length>0?n.join(","):void 0}function IN(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},o=Ty(r.baggage,t.baggageAllowlist??[]);return{..._y(r),...o?{baggage:o}:{}}}function PN(e,t){return Rr.run(structuredClone(e),t)}function MN(){let e=Rr.getStore();return e?{...e}:void 0}async function kN(e){let t=S(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(c=>!vr.test(c)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let n=fy(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!n)throw new y("Missing or malformed bearer token",401,o);let s=n[1];if(Buffer.byteLength(s,"utf8")>my)throw new y("Missing or malformed bearer token",401,o);let i;try{i=await e.policy.verifyAccessToken(s)}catch{throw new y("Invalid bearer token",401,o)}let a=Array.isArray(i.audience)?i.audience:[i.audience];if(i.issuer!==e.policy.issuer||!a.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let d=r.filter(c=>!i.scopes.includes(c));if(d.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${d.join(" ")}"`);return{...i,audience:[...a],scopes:[...i.scopes]}}function xN(e){let t=wr("sha256").update(e.token).digest();return r=>{let o=wr("sha256").update(r).digest();if(!ry(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(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]="46f5fe59-6b84-5c68-ad07-bb1329f4ea29")}catch{}})();var it="io.modelcontextprotocol/ui",Ae="2026-01-26",kr="text/html;profile=mcp-app",Pr=Object.freeze({specVersion:Ae,mimeTypes:[kr]});function DN(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[it];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Pr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(kr)||n!==void 0&&n!==Ae)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Pr}}});return!0}var Cy={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},xr=Object.freeze([{id:"context",name:"Context explorer",description:"Inspect bounded project context, provenance, omissions, and token accounting.",toolName:"pm_context",uri:"ui://pm/context.html"},{id:"graph",name:"Relationship graph",description:"Explore typed relationships, explaining paths, and graph-governance evidence.",toolName:"pm_graph",uri:"ui://pm/graph.html"},{id:"plan",name:"Plan and milestone view",description:"Review durable plan steps, dependencies, decisions, discoveries, and validation state.",toolName:"pm_plan",uri:"ui://pm/plan.html"},{id:"assurance",name:"Assurance dashboard",description:"Inspect validation verdicts, evidence, omissions, and actionable recovery paths.",toolName:"pm_validate",uri:"ui://pm/assurance.html"},{id:"operations",name:"Long-operation view",description:"Inspect durable test and operation results without creating a second task store.",toolName:"pm_test",uri:"ui://pm/operations.html"}].map(e=>({...e,toolMeta:{resourceUri:e.uri,visibility:["model","app"]},resourceMeta:Cy})));function $N(e){return xr.find(t=>t.uri===e)}function FN(e){let t=new Map(xr.map(r=>[r.toolName,r]));return e.map(r=>{let o=t.get(r.name);return o?{...r,_meta:{...r._meta,ui:o.toolMeta}}:{...r}})}function Mr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function GN(e){let t=Mr(e.name),r=Mr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Ae}),n=JSON.stringify(Ae);return`<!doctype html>
1
+ import{a as fg}from"./chunks/chunk-L5BU5FYN.js";import{a as Gk,b as Uk,c as jk,d as Bk}from"./chunks/chunk-LI2HP5OX.js";import{a as qk,b as zk}from"./chunks/chunk-Z3LWNF7C.js";import{b as ck,c as lk,d as pk,e as uk,f as mk,g as fk,h as _k,i as hk,j as gk,k as yk,l as bk,m as Tk,n as Ck,o as Ek,p as Sk,q as wk,r as Ak}from"./chunks/chunk-C4MQFWCM.js";import{A as kk,B as xk,C as Nk,D as Lk,E as Dk,F as $k,G as Fk,a as Ns,b as ER,c as SR,d as wd,e as Ad,f as vd,h as Od,i as Rd,j as Id,k as Pd,l as Md,m as kd,n as xd,o as Nd,p as $c,q as Fc,r as Gc,s as Uc,t as jc,u as vk,v as Ok,w as Rk,x as Ik,y as Pk,z as Mk}from"./chunks/chunk-7GC6WIDR.js";import{A as gx,B as yx,C as bx,D as Tx,E as Cx,F as Ex,G as Sx,H as wx,I as Ax,J as vx,K as Ox,L as Rx,M as Ix,N as Px,O as Mx,P as kx,Q as xx,R as Nx,S as Lx,T as Dx,U as $x,V as Fx,W as Gx,X as Ux,Y as jx,Z as Bx,_ as qx,a as Hk,b as Vk,c as Kk,d as Wk,e as Yk,f as Xk,g as Jk,h as Zk,i as Qk,j as ex,k as tx,l as rx,m as ox,n as nx,o as ix,p as sx,q as ax,r as dx,s as cx,t as lx,u as px,v as ux,w as mx,x as fx,y as _x,z as hx}from"./chunks/chunk-NH7QX2M2.js";import{$ as Xm,$a as q_,$b as qh,A as Ye,Aa as p_,Ab as hh,B as Lm,Ba as u_,Bb as gh,C as Dm,Ca as m_,Cb as yh,D as Fm,Da as f_,Db as bh,E as Ht,Ea as __,Eb as Th,F as Vt,Fa as h_,Fb as Ch,G as Kt,Ga as g_,Gb as Eh,H as Wt,Ha as y_,Hb as Sh,I as Yt,Ia as b_,Ib as wh,J as Xt,Ja as T_,Jb as Ah,K as Jt,Ka as C_,Kb as vh,L as Zt,La as E_,Lb as Oh,M as Qt,Ma as S_,Mb as Rh,N as er,Na as w_,Nb as Ih,O as tr,Oa as A_,Ob as Ph,P as Gm,Pa as v_,Pb as Mh,Q as Um,Qa as O_,Qb as kh,R as jm,Ra as R_,Rb as xh,S as Bm,Sa as I_,Sb as Nh,T as qm,Ta as rr,Tb as Lh,U as Xe,Ua as ge,Ub as Dh,V as zm,Va as $_,Vb as $h,W as Hm,Wa as F_,Wb as Fh,X as Vm,Xa as G_,Xb as Gh,Y as Km,Ya as U_,Yb as Uh,Z as Wm,Za as j_,Zb as jh,_ as Ym,_a as B_,_b as Bh,a as LO,aa as Jm,ab as z_,ac as zh,b as DO,ba as z0,bb as H_,bc as Hh,c as $O,ca as H0,cb as V_,cc as Vh,d as FO,da as V0,db as K_,dc as Kh,e as GO,ea as pf,eb as W_,ec as Wh,f as UO,fa as uf,fb as Y_,fc as Yh,g as qO,ga as mf,gb as X_,gc as Xh,h as zO,ha as e_,hb as J_,hc as Jh,i as HO,ia as t_,ib as Z_,ic as Zh,j as VO,ja as tk,jb as Q_,jc as Qh,k as Ls,ka as rk,kb as eh,kc as eg,l as Qd,la as ok,lb as th,lc as tg,m as ec,ma as nk,mb as rh,mc as rg,n as tc,na as ik,nb as oh,nc as og,o as tP,oa as sk,ob as nh,oc as ng,p as rP,pa as ak,pb as ih,pc as ig,q as oP,qa as dk,qb as sh,qc as sg,r as nP,ra as r_,rb as ah,rc as ag,s as iP,sa as o_,sb as dh,sc as dg,t as sP,ta as n_,tb as ch,tc as cg,u as Tu,ua as i_,ub as lh,uc as lg,v as Su,va as s_,vb as ph,vc as pg,w as wu,wa as a_,wb as uh,wc as ug,x as qu,xa as d_,xb as mh,xc as mg,y as Xu,ya as c_,yb as fh,z as MM,za as l_,zb as _h}from"./chunks/chunk-MKW5LGVQ.js";import{e as cP,f as lP,g as Hl,h as Vl,i as Bt}from"./chunks/chunk-AFZS6WFV.js";import{A as x0,B as N0,C as L0,D as D0,E as $0,F as F0,G as G0,H as U0,I as j0,J as B0,K as q0,L as ef,M as tf,N as rf,O as of,P as nf,Q as sf,R as af,S as df,T as cf,U as lf,a as fM,b as _M,c as hM,d as gM,e as yM,f as bu,g as bM,h as TM,i as CM,j as EM,k as SM,m as $m,n as Zm,o as E0,p as S0,q as w0,r as A0,s as v0,t as O0,u as Qm,v as R0,w as I0,x as P0,y as M0,z as k0}from"./chunks/chunk-LLTRUVKK.js";import{$ as mI,$a as up,$b as lM,$c as xm,A as Ve,Aa as FI,Ab as VP,Ac as Fu,Ad as Df,B as te,Ba as GI,Bb as KP,Bc as Gu,Bd as $f,C as tl,Ca as UI,Cb as QP,Cc as Uu,Cd as Ff,Db as eM,Dc as ju,Dd as Gf,Ea as aP,Eb as nu,Ed as Uf,F as Ke,Fa as dP,Fb as iu,Fc as IM,Fd as jf,G as rl,Ga as Fl,Gb as tM,Gc as PM,Gd as Bf,H as ol,Ha as Gl,Hb as rM,Hc as Bu,Ia as Ul,Ib as oM,Ic as Ju,Id as qf,J as he,Ja as jl,Jb as nM,Jc as Zu,Jd as zf,K as nl,Ka as Bl,Kb as iM,Kc as Qu,Kd as Hf,L as il,La as ql,Lb as su,Lc as em,Ld as Vf,M as sl,Ma as zl,Mb as au,Mc as tm,Md as Kf,N as al,Na as Zl,Nb as du,Nd as Wf,O as rI,Oa as Ql,Ob as cu,Od as Yf,P as oI,Pa as ep,Pb as lu,Pd as Xf,Q as nI,Qa as tp,Qb as pu,Qd as Jf,R as iI,Ra as rp,Rb as uu,Rc as rm,Rd as Zf,S as sI,Sa as op,Sb as mu,Sd as Qf,T as Nt,Ta as np,Tb as fu,Tc as om,Td as P_,U as aI,Ua as ip,Ub as _u,Uc as nm,Ud as M_,V as dI,Va as sp,Vb as hu,Vc as Rm,Vd as k_,W as Lt,Wa as ap,Wb as gu,Wc as Im,Wd as x_,X as cI,Xa as dp,Xb as sM,Xd as N_,Y as lI,Ya as cp,Yb as aM,Yc as Pm,Yd as L_,Z as pI,Za as lp,Zb as dM,Zc as Mm,Zd as D_,_ as uI,_a as pp,_b as cM,_c as km,a as zd,aa as We,ab as mp,ac as pM,ad as Nm,b as Hd,ba as fI,bb as fp,bc as uM,bd as ff,c as Vd,ca as Dt,cb as _p,cc as mM,cd as _f,d as Kd,da as _I,db as mP,dc as yu,dd as hf,e as Wd,ea as hI,eb as hp,ec as wM,ed as gf,fa as gI,fb as gp,fc as AM,fd as yf,g as Yd,ga as yI,gb as yp,gc as vM,gd as bf,h as Xd,ha as bI,hb as bp,hc as OM,hd as Tf,ia as TI,ib as fP,ic as RM,id as Cf,ja as CI,jb as Tp,jd as Ef,ka as EI,kb as Cp,kc as Cu,kd as Z0,l as Jd,la as SI,lb as Ep,lc as Eu,ld as Q0,m as Zd,ma as wI,mb as Sp,mc as Au,md as ek,na as AI,nb as wp,nc as vu,nd as Sf,oa as vI,ob as _P,od as wf,pa as OI,pb as hP,pc as Ou,pd as Af,qa as RI,qb as gP,qc as Ru,qd as vf,ra as II,rb as yP,rc as Iu,rd as Of,sa as PI,sb as bP,sc as Pu,sd as Rf,t as Mt,ta as MI,tb as TP,tc as Mu,td as If,ua as kI,ub as CP,uc as ku,ud as Pf,v as kt,va as xI,vb as jP,vc as xu,vd as Mf,wa as NI,wb as BP,wc as Nu,wd as kf,x as eI,xa as LI,xb as qP,xc as Lu,xd as xf,y as xt,ya as DI,yb as zP,yc as Du,yd as Nf,z as tI,za as $I,zb as HP,zc as $u,zd as Lf}from"./chunks/chunk-CP43BHX3.js";import"./chunks/chunk-UJMQP2HP.js";import{w as Bc}from"./chunks/chunk-YGUUJHSR.js";import{A as eP,Aa as Il,B as Tl,C as Cl,Ca as Pl,D as El,Da as Ml,E as Sl,Ea as kl,F as $t,Fa as xl,Ga as Nl,Ia as Ll,Ja as Dl,Ka as $l,a as JO,b as ZO,c as QO,d as eR,e as tR,f as rR,g as Ds,h as $s,i as Fs,j as Gs,k as Us,la as Ft,m as jI,ma as Gt,na as Ut,oa as jt,pa as wl,ra as Al,sa as vl,ta as Ol,v as XI,w as JI,y as ZI,z as QI,za as Rl}from"./chunks/chunk-HESIRIVX.js";import{a as BI,b as qI,c as zI,d as HI,e as VI,f as KI,g as WI,h as ul,i as ml,j as fl,k as _l,l as hl,m as YI,n as gl,o as yl,p as bl}from"./chunks/chunk-7V6I6X4G.js";import{$a as LP,$b as i0,A as VR,Aa as Xp,Ab as NM,Ac as Sm,B as qc,Ba as Jp,Bb as LM,Bc as wm,C as zc,Ca as Zp,Cb as DM,Cc as Am,D as Hc,Da as Qp,Db as $M,Dc as zt,E as Vc,Ea as eu,Eb as FM,Ec as vm,F as Kc,Fa as tu,Fb as GM,Fc as y0,G as Wc,Ga as ru,Gc as b0,H as Yc,Ha as ou,Hb as cm,Hc as T0,I as Xc,Ib as UM,Ic as Om,J as Jc,Jb as jM,Jc as C0,K as Zc,Kb as BM,Kc as K0,L as Qc,La as EP,Lb as qM,Lc as W0,M as He,Ma as SP,Mb as zM,Mc as Y0,N as KR,Na as wP,Nb as HM,Nc as X0,O as WR,Oa as AP,Ob as VM,Oc as J0,P as YR,Pa as vP,Pb as KM,Q as XR,Qa as OP,Qb as WM,R as JR,Ra as RP,Rb as YM,S as ZR,Sa as IP,Sb as XM,T as QR,Ta as PP,Tb as JM,U as el,Ua as MP,Ub as ZM,V as Kl,Va as kP,Vb as QM,W as Wl,Wa as xP,Wb as e0,X as Yl,Xa as NP,Xb as t0,Y as Xl,Yb as r0,Z as pP,Zb as o0,_ as uP,_b as n0,a as KO,aa as Jl,ac as s0,b as WO,ba as Ap,bb as DP,bc as a0,c as YO,ca as vp,cb as $P,cc as d0,d as XO,da as Op,dc as c0,e as kR,ea as Rp,ec as l0,f as xR,fa as Ip,fb as FP,fc as p0,g as NR,ga as Pp,gb as GP,gc as u0,h as LR,ha as Mp,hb as UP,hc as m0,i as DR,ia as kp,ic as f0,j as $R,ja as xp,jb as WP,jc as _0,k as FR,ka as Np,kb as YP,kc as h0,la as Lp,lb as XP,lc as g0,ma as Dp,mb as JP,mc as qt,na as $p,nb as ZP,nc as lm,oa as Fp,ob as zu,oc as pm,pa as Gp,pb as Hu,pc as um,qa as Up,qb as Vu,qc as mm,ra as jp,rb as Ku,rc as fm,sa as Bp,sb as Wu,sc as _m,t as GR,ta as qp,tb as Yu,tc as hm,u as UR,ua as zp,ub as kM,uc as gm,v as jR,va as Hp,vb as im,vc as ym,w as BR,wa as Vp,wb as sm,wc as bm,x as qR,xa as Kp,xb as am,xc as Tm,y as zR,ya as Wp,yb as dm,yc as Cm,z as HR,za as Yp,zb as xM,zc as Em}from"./chunks/chunk-DOHZKPPC.js";import{a as jO,b as BO}from"./chunks/chunk-XBUZENP4.js";import{$ as fa,$a as fd,$b as IR,A as qs,Aa as ja,Ab as ac,B as zs,Ba,Bb as dc,Ca as qa,Cb as cc,D as Hs,Da as za,Db as lc,E as Vs,Ea as Ha,Eb as pc,F as Ks,Fa as Va,Fb as uc,G as Ws,Ga as Ka,Gb as mc,H as Ys,Ha as Wa,Hb as fc,I as Xs,Ia as Ya,Ib as _c,J as Js,Ja as Xa,Jb as hc,K as Zs,Ka as Ja,Kb as gc,L as Qs,La as Za,Lb as yc,M as ea,Ma as Qa,Mb as bc,N as ta,Na as ed,Nb as Tc,O as ra,Oa as td,Ob as Cc,P as oa,Pa as rd,Pb as Ec,Q as na,Qa as od,Qb as Sc,Ra as nd,Rb as wc,S as ia,Sa as id,Sb as Ac,T as sa,Ta as sd,U as aa,Ua as ad,V as da,Va as dd,W as ca,Wa as cd,Wb as wR,X as la,Xa as ld,Xb as AR,Y as pa,Ya as pd,Yb as vR,Z as ua,Za as ud,Zb as OR,_ as ma,_a as md,_b as RR,a as oR,aa as _a,ab as _d,ac as PR,b as nR,ba as ha,bb as hd,bc as MR,c as iR,ca as ga,cb as gd,d as sR,da as ya,db as yd,dc as vc,e as aR,ea as ba,eb as bd,ec as Oc,f as dR,fa as Ta,fb as Td,fc as Rc,g as cR,ga as Ca,gb as Cd,gc as Ic,h as js,ha as Ea,hb as Ed,hc as Pc,i as lR,ia as Sa,ic as Mc,ja as wa,jb as ze,jc as kc,ka as Aa,kb as ee,kc as xc,l as pR,la as va,lb as Sd,lc as Nc,m as uR,ma as Oa,mb as Ld,mc as Lc,n as Be,na as Ra,nb as Dd,nc as Dc,o as mR,oa as Ia,ob as $d,oc as Pt,p as fR,pa as Pa,pb as Fd,q as _R,qa as Ma,qb as Gd,r as It,ra as ka,rb as Ud,s as qe,sa as xa,sb as jd,t as hR,ta as Na,tb as Bd,u as gR,ua as La,ub as qd,v as yR,va as Da,vb as rc,w as bR,wa as $a,wb as oc,x as TR,xa as Fa,xb as nc,y as CR,ya as Ga,yb as ic,z as Bs,za as Ua,zb as sc}from"./chunks/chunk-4BMPGUTG.js";import{a as vO,b as OO,c as RO,d as IO,e as PO,f as MO,g as kO,h as xO,i as NO,j as As,k as vs,l as Os,m as Rs,n as Is,o as Ps,q as Ms,s as ks,y as xs}from"./chunks/chunk-JAE5MWLX.js";import{b as SO}from"./chunks/chunk-NKO42JMT.js";import"./chunks/chunk-IB7UB5TE.js";import{$ as IE,$b as kv,$c as _s,A as ZT,Aa as UA,Ab as yv,Ad as EO,B as QT,Bc as ss,Bd as wO,Cb as bv,Cc as as,Cd as AO,Db as Tv,Dc as ds,Eb as Cv,Ec as cs,Fb as Ev,Fc as ls,Gb as Zi,Gc as ps,Hb as Qi,Hc as Vv,Ic as Kv,J as cC,Jb as es,Jc as Wv,Ka as jA,Kb as Sv,Kc as Yv,L as yC,La as BA,Lc as Xv,M as bC,Ma as qA,Mb as wv,Mc as Jv,N as TC,Na as zA,Nb as Av,Nc as Zv,O as CC,Oa as HA,Ob as vv,Oc as Qv,P as OC,Pa as VA,Pc as eO,Q as RC,Qa as ZA,Qb as Ov,Qc as tO,R as At,Ra as QA,Rc as rO,S as SE,Sa as ev,Sc as oO,T as wE,Ta as vt,Tb as Rv,Tc as nO,U as AE,Uc as iO,Va as tv,Vb as Iv,Vc as sO,W as vE,Wa as rv,Wc as aO,Xa as ov,Xc as dO,Y as OE,Ya as nv,Yc as us,Z as RE,Za as iv,Zb as Pv,Zc as ms,_b as Mv,_c as fs,a as FT,aa as PE,ab as sv,ac as ts,ad as hs,ba as ME,bc as xv,bd as gs,ca as fA,cd as ys,da as _A,dc as Nv,dd as bs,ea as hA,eb as Wi,ec as Lv,ed as Ts,fa as gA,fc as Dv,fd as Cs,ga as OA,gc as $v,gd as Es,hc as Fv,hd as Ss,i as an,ia as zi,ic as Gv,id as ws,j as GT,ja as Hi,jc as Uv,jd as cO,k as UT,ka as Vi,kc as jv,kd as lO,l as jT,lc as Bv,ld as pO,m as BT,ma as RA,mc as qv,md as uO,n as qT,na as IA,nc as Ot,nd as mO,o as zT,oa as PA,oc as zv,od as fO,pa as MA,pd as _O,q as HT,qa as kA,qc as Hv,qd as hO,ra as xA,rd as gO,s as VT,sa as NA,sd as yO,t as KT,td as bO,u as WT,ua as LA,w as YT,wa as DA,wc as rs,x as XT,xa as $A,xb as _v,xc as os,xd as Rt,ya as FA,yb as hv,yc as ns,yd as TO,z as JT,za as GA,zb as gv,zc as is,zd as CO}from"./chunks/chunk-YUTFMHSG.js";import{$ as bt,$b as LC,$c as eE,$d as UE,$e as rS,$f as RS,$g as iw,$h as rA,$i as Xi,A as Uo,Aa as eC,Ab as _C,Ac as VC,Ad as $n,Ae as Jn,Ag as NS,Ah as kw,Ai as SA,B as jo,Ba as tC,Bc as KC,Bd as gE,Be as KE,Bg as LS,Bh as xw,Bi as wA,C as Bo,Ca as rC,Cb as Et,Cd as Fn,Ce as WE,Cg as DS,Ch as Nw,Ci as AA,D as qo,De as YE,Dg as $S,Dh as Lw,Di as vA,E as zo,Eb as St,Ed as yE,Ee as XE,Eg as FS,Eh as Dw,F as Ho,Fa as yn,Fd as bE,Fe as JE,Ff as dS,Fg as GS,Fh as $w,G as Vo,Ga as oC,Gb as Rn,Gd as TE,Ge as ZE,Gf as cS,Gh as Fw,H as De,Ha as nC,Hb as In,Hc as kn,Hd as CE,He as QE,Hf as lS,Hh as Gw,I as $e,Ia as iC,Ib as _e,Ic as WC,Id as EE,Ie as eS,If as pS,Ig as US,Ih as Uw,Ii as KA,J as Ko,Ja as sC,Jd as kE,Je as tS,Jf as uS,Jg as jS,Jh as jw,K as Wo,Kb as hC,Kc as YC,Kd as xE,Ke as Zn,Kf as mS,Kg as BS,Kh as Bw,L as Yo,La as bn,Ld as NE,Le as Qn,Lf as fS,Lg as qS,Lh as qw,Li as WA,M as Xo,Ma as Tn,Mb as gC,Md as LE,Me as D,Mf as _S,Mg as zS,Mh as zw,Mi as YA,N as Jo,Na as Ge,Nb as EC,Nd as DE,Ne as ei,Nf as hS,Ng as HS,O as Zo,Oa as aC,Ob as SC,Od as $E,Of as gS,Og as VS,Oh as Hw,P as Qo,Pa as dC,Pb as wC,Pf as yS,Pg as KS,Ph as Vw,Pi as XA,Q as en,Qa as Cn,Qb as AC,Qg as WS,Qi as Ki,R as tn,Ra as En,Rb as vC,Rg as YS,Ri as JA,S as rn,Sb as IC,Sf as bS,Sg as XS,Sh as Kw,Si as av,T as on,Ta as Sn,Tb as Ue,Te as je,Tf as TS,Tg as JS,Th as Ww,Ti as dv,U as nn,Ub as wt,Ud as FE,Ue as ti,Uf as CS,Ug as ZS,Uh as Yw,Ui as cv,V as sn,Vb as PC,Vf as ES,Vg as QS,Vh as Xw,Vi as lv,Wb as MC,Wc as XC,Wf as SS,Wg as ew,Wh as Jw,Wi as pv,Xb as kC,Xc as JC,Xd as Gn,Xf as wS,Xg as tw,Xh as Zw,Xi as uv,Yb as xC,Yc as ZC,Yd as GE,Yf as AS,Yg as rw,Yh as Qw,Yi as mv,Zb as z,Zd as Un,Zf as vS,Zg as ow,Zh as eA,Zi as fv,_b as NC,_c as QC,_f as OS,_g as nw,_h as tA,_i as Yi,a as I,aa as Tt,ac as DC,af as oS,ag as IS,ah as sw,ai as oA,aj as Ji,b as vT,ba as pn,bc as $C,bd as tE,bf as nS,bg as PS,bh as aw,bi as nA,c as yt,ca as un,cc as FC,cd as xn,cf as ri,ch as dw,ci as iA,d as OT,da as mn,dc as GC,df as oi,dg as Ei,dh as cw,e as RT,eb as wn,ec as UC,ed as Nn,ee as jE,ef as ni,eg as Si,eh as lw,ei as sA,f as IT,fb as An,fd as Ln,ff as ii,fg as wi,fh as pw,fi as Bi,g as PT,gb as vn,ge as BE,gf as si,gg as Ai,gh as uw,gi as qi,h as MT,ha as fn,hc as jC,he as qE,hf as ai,hg as vi,hh as mw,i as kT,ib as On,id as rE,ie as jn,if as di,ig as Oi,ih as fw,j as xT,ja as _n,jc as Pn,jd as oE,je as Bn,jf as ci,jg as Ri,jh as _w,k as NT,ka as hn,kc as Mn,kd as nE,kf as li,kg as Ii,kh as hw,l as LT,la as gn,lb as lC,ld as iE,le as qn,lf as pi,lg as Pi,lh as gw,li as aA,m as DT,mb as pC,md as sE,me as zn,mf as ui,mg as Mi,mh as yw,mi as dA,n as $T,nd as aE,ne as Hn,nf as mi,ng as ki,nh as bw,ni as cA,o as Mo,od as dE,oe as Vn,of as fi,og as xi,oh as Tw,oi as lA,p as ko,pd as Dn,pe as Kn,pf as _i,pg as Ni,ph as Cw,q as xo,qd as cE,qe as zE,qf as hi,qg as Li,qh as Ew,qi as pA,r as No,rb as uC,rd as lE,re as HE,rf as iS,rg as Di,rh as Sw,ri as uA,s as Ne,sf as sS,sg as $i,sh as ww,t as Lo,tf as gi,tg as Fi,th as Aw,ti as mA,u as L,ub as mC,ud as pE,uf as aS,ug as Gi,uh as vw,v as Le,vc as BC,vd as uE,vf as yi,vg as Ui,vh as Ow,vi as yA,w as Do,wd as mE,we as Wn,wf as bi,wg as ji,wh as Rw,wi as bA,x as $o,xb as fC,xc as qC,xd as fE,xe as Yn,xf as Ti,xg as MS,xh as Iw,xi as TA,y as Fo,yc as zC,yd as _E,ye as VE,yf as Ci,yg as kS,yh as Pw,yi as CA,z as Go,zc as HC,zd as hE,ze as Xn,zg as xS,zh as Mw,zi as EA}from"./chunks/chunk-3A5DJZCC.js";import"./chunks/chunk-SPPHDVZE.js";import{a as dl,b as cl,e as ll,f as pl}from"./chunks/chunk-RSAN2YUU.js";import"./chunks/chunk-VS565KBX.js";import{A as me,B as AT,C as b,E as dn,F as Ct,G as fe,H as cn,K as Fe,M as ln,b as yT,c as bT,d as TT,m as CT,r as ET,u as ST,y as wT}from"./chunks/chunk-O4ZLEN4T.js";import"./chunks/chunk-XAWE4EAK.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]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var H="2026-07-28",nr=["2025-11-25","2025-06-18"],re=[H],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},w={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},or=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function _g(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function hg(e){if(e!==void 0){if(typeof e!="string"||!or.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:w.logLevel,allowed:[...or]});return e}}function Je(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[w.protocolVersion,w.clientCapabilities]});let r=t[w.protocolVersion];if(typeof r!="string"||!re.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...re],requested:typeof r=="string"?r:null});let o=t[w.clientCapabilities];if(!h(o))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:w.clientCapabilities,expected:"object"});let n=_g(t[w.clientInfo]),s=hg(t[w.logLevel]);return{protocolVersion:H,clientCapabilities:o,...n?{clientInfo:n}:{},...s?{logLevel:s}:{}}}function zx(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function Hx(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function Vx(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Ze(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[w.serverInfo]:{...t}}}}function gg(e,t){return Ze({...e,resultType:"complete"},t)}function Kx(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return gg({supportedVersions:[...re],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function Wx(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}(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]="d4a56906-c542-567e-9265-15184a5c330b")}catch{}})();var yg=new Set(["--help","-h","--version","-V"]);function bg(e,t){let r=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&r.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),r.push("",`MCP protocol: ${re.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${nr.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),r.join(`
2
+ `)}function Jx(e,t,r){if(e.length===0)return{kind:"serve"};let o=e.find(n=>!yg.has(n));if(o!==void 0){let n=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(o)}. Run ${n} --help.
3
+ `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?bg(t,r):`${r}
4
+ `,stderr:""}}import{createHash as ar,createHmac as dr,timingSafeEqual as Tg}from"node:crypto";(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]="15b81dd0-ef1a-58be-b6ee-5975b6778993")}catch{}})();var Cg=["elicitation/create","roots/list","sampling/createMessage"],ir=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},cr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,ye=32,et=64*1024,be=16*1024,Qe={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Eg(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Te(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function tt(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>ye)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:ye,observed:r.length});let o={};for(let[n,s]of r){if(!cr.test(n)||!h(s))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let i=s.method;if(typeof i!="string"||!Cg.includes(i))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:i??null});let a=Eg(i);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(s.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:i,params:structuredClone(s.params)}}return Te(o,et,"inputRequests"),o}function lr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>ye)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:ye,observed:t.length});let r={};for(let[o,n]of t){if(!cr.test(o)||!h(n))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return Te(r,et,"inputResponses"),r}function tN(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>be)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:be});let r=e.inputRequests===void 0?void 0:tt(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[w.serverInfo]:{...e.serverInfo}}}}function pr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function rN(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>be/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:be/2});let o=r.toString("base64url"),n=dr("sha256",pr(t)).update(o).digest("base64url");return`${o}.${n}`}function Sg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}}function oN(e,t,r){let[o,n,s]=e.split(".");if(!o||!n||s!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let i=Buffer.from(n,"base64url"),a=dr("sha256",pr(t)).update(o).digest();if(i.byteLength!==a.byteLength||!Tg(i,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let d;try{d=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{d=null}let c=Sg(d),{expiresAt:l,method:p,parameterDigest:f,principal:_}=c;if(l<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(p!==r.method||f!==r.parameterDigest||_!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return c}function nN(e){return Te(e,et,"request parameters"),ar("sha256").update(JSON.stringify(e)).digest("hex")}var sr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=ar("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function wg(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function iN(e,t){return{...e,...wg(t)}}function Ag(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function vg(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Ag)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Og(e){let t=e.maxBytes??Qe.maxBytes,r=e.maxDepth??Qe.maxDepth,o=e.maxNodes??Qe.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function Rg(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function Ig(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&vg(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function sN(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Og(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});Te(e,r,"JSON Schema");let s=[{value:e,depth:0}],i=0;for(;s.length>0;){let a=s.pop();if(i+=1,i>n||a.depth>o)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});Ig(e,a.value),Rg(a,s)}return structuredClone(e)}import{randomUUID as Pg}from"node:crypto";import{readFile as Mg}from"node:fs/promises";import ur 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]="f3e94896-b2a0-561c-902b-71c28ddde2a1")}catch{}})();var fN="io.modelcontextprotocol/tasks",kg=["working","input_required","completed","failed","cancelled"],xg=/^mcp-task-[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu,Ng=3600*1e3,Lg=1e3,Ee=1024,Dg=30,$g=2e3;function rt(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function Ce(e){let t=e.trim();if(!xg.test(t))throw rt("Unknown MCP task");return t}function mr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function fr(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Ee),...h(e.data)?{data:structuredClone(e.data)}:{}}}function Fg(e){if(!kg.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function Gg(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function Ug(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function jg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function Bg(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function qg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function zg(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?Ce(e.taskId):"",r=Fg(e.status),o=Gg(e.principal),n=Ug(e.workerPid),s=jg(e.ttlMs),i=Bg(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:mr(e.createdAt,"createdAt"),lastUpdatedAt:mr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:s,consumedInputKeys:qg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Ee)}:{},...typeof i=="number"?{pollIntervalMs:i}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=fr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function V(e){let t={taskId:e.taskId,status:e.status,createdAt:e.createdAt,lastUpdatedAt:e.lastUpdatedAt,ttlMs:e.ttlMs,...e.statusMessage?{statusMessage:e.statusMessage}:{},...e.pollIntervalMs===void 0?{}:{pollIntervalMs:e.pollIntervalMs}};return e.status==="input_required"?{...t,status:"input_required",inputRequests:structuredClone(e.inputRequests)}:e.status==="completed"?{...t,status:"completed",result:structuredClone(e.result)}:e.status==="failed"?{...t,status:"failed",error:structuredClone(e.error)}:e.status==="cancelled"?{...t,status:"cancelled"}:{...t,status:"working"}}function oe(e){return e==="completed"||e==="failed"||e==="cancelled"}function Hg(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var ot=class{#e;#t;#r;#o;#i;constructor(t){this.#e=ur.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Pg()}`),this.#i=t.workerPid??process.pid}#s(t){return ur.join(this.#e,"runtime","mcp-tasks","records",`${Ce(t)}.json`)}async#d(t){try{return zg(JSON.parse(await Mg(this.#s(t),"utf8")))}catch(r){throw fe(r)||r instanceof SyntaxError?rt("Unknown MCP task"):r}}async#a(t){await Fe(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
5
+ `)}async#n(t,r,o){let n=Ce(t),s=await je(this.#e,n,Dg,this.#t,!1,!1,$g);try{let i=await this.#d(n);if(i.principal!==r)throw rt("Unknown MCP task");let a=o(i);return await this.#a(a),a}finally{await s()}}async create(t){let r=Ce(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?Ng:t.ttlMs,s=t.pollIntervalMs??Lg;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(s)||s<0)throw new u("Invalid MCP task creation options",m.invalidParams);let i=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:i,lastUpdatedAt:i,ttlMs:n,pollIntervalMs:s,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Ee)}:{}};return await this.#a(a),{...V(a),resultType:"task"}}async get(t,r){return V(await this.#n(t,r,o=>{if(oe(o.status))return o;let n=this.#r().getTime(),s=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,i=o.workerPid!==this.#i&&!Hg(o.workerPid);return!s&&!i?o:{...o,status:"failed",statusMessage:s?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:s?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=tt(t.inputRequests,t.requestContext);return V(await this.#n(t.taskId,t.principal,o=>{if(oe(o.status))return o;let n=Object.keys(r).filter(s=>o.consumedInputKeys.includes(s));if(n.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Ee),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=lr(o),s=[],i=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let d={...a.inputRequests},c=a.inputResponses?{...a.inputResponses}:{};for(let[l,p]of Object.entries(n))Object.prototype.hasOwnProperty.call(d,l)&&(c[l]=p,delete d[l],s.push(l));return i=Object.keys(d).sort(),s.length===0?a:{...a,status:i.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:i.length===0?void 0:d,inputResponses:c,consumedInputKeys:[...new Set([...a.consumedInputKeys,...s])].sort()}}),{acceptedKeys:s.sort(),remainingKeys:i}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return V(await this.#n(t,r,n=>oe(n.status)?n:{...n,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(o),inputRequests:void 0,error:void 0}))}async fail(t,r,o){let n=fr(o);return V(await this.#n(t,r,s=>oe(s.status)?s:{...s,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return V(await this.#n(t,r,o=>oe(o.status)?o:{...o,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function _N(e){return new ot(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]="15cbe26a-5716-5e8c-8700-eb36a1a056d6")}catch{}})();var Se="io.modelcontextprotocol/subscriptionId",_r=256,hr=2048,Vg=5e3;function Kg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),Vg);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},s=>{clearTimeout(n),o(s instanceof Error?s:new Error(String(s)))})})}function nt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function Wg(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=nt(e.toolsListChanged,"toolsListChanged"),r=nt(e.promptsListChanged,"promptsListChanged"),o=nt(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>_r)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:_r});let s=new Set;for(let i of e.resourceSubscriptions){if(typeof i!="string"||i.trim().length===0||Buffer.byteLength(i,"utf8")>hr)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:hr});s.add(i)}s.size>0&&(n=[...s].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function Yg(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var gr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new u("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=Yg(Wg(t.notifications),this.#e),o={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,o);try{await this.#o(t.id,o,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Se]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[s,i]of this.#t)i.filter[r]===!0&&n.push(this.#o(s,i,{jsonrpc:"2.0",method:o,params:{_meta:{[Se]:s}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Se]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let s=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await Kg(r.sink,o),!0}catch(i){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw i;return!1}});return r.writeQueue=s.then(()=>{},()=>{}),s}close(t){if(this.#t.delete(t))return{...Ze({resultType:"complete",_meta:{[Se]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}return 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]="3681273a-e101-57a0-9446-982c450e7183")}catch{}})();var yr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,Xg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,br=/^[\t\x20-\x7E]*$/u,Tr=new Set(["prompts/get","resources/read","tools/call"]);function Jg(e){let t=new Map;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let n=typeof o=="string"?o:o.join(", ");t.set(r.toLowerCase(),n)}return t}function A(e,t){throw new u(e,m.headerMismatch,{header:t})}function Cr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&br.test(t)&&!yr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Er(e,t){let r=yr.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?A("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!br.test(e)?A("Malformed MCP header value",t):e}function we(e){return Array.isArray(e)?e.some(we):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(we):!1}function Zg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!Xg.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function Sr(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,s)=>{let i=n.properties;if(i!==void 0){if(!h(i))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,d]of Object.entries(i)){if(!h(d))continue;let c=[...s,a],l=Zg(d,c,r);l&&t.push(l);for(let[p,f]of Object.entries(d))if(p!=="properties"&&p!=="x-mcp-header"&&we(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:c.join("."),keyword:p});o(d,c)}}};for(let[n,s]of Object.entries(e))if(n!=="properties"&&we(s))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function wr(e,t){let r=e;for(let o of t){if(!h(r))return;r=r[o]}return r}function Ar(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function Qg(e,t){let r=h(e.arguments)?e.arguments:{},o={};for(let n of Sr(t)){let s=wr(r,n.path);if(s!=null){if(!(n.type==="integer"&&typeof s=="number"&&Number.isSafeInteger(s)||n.type==="boolean"&&typeof s=="boolean"||n.type==="string"&&typeof s=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=Cr(s)}}return o}function TN(e){let t=h(e.request.params)?e.request.params:void 0,r=Je(t),o=e.request.method;if(typeof o!="string"||o.length===0)return A("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},s=Ar(o,t);if(Tr.has(o)){if(s===void 0)return A("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=Cr(s)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,Qg(t,e.toolSchema)),n}function ey(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let o=h(t.params)?t.params:void 0,n=Je(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&A("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&A("MCP method header does not match request body","Mcp-Method"),Tr.has(r)){let s=e.get("mcp-name"),i=Ar(r,o);(s===void 0||i===void 0||Er(s,"Mcp-Name")!==i)&&A("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&A("MCP SSE resumability is not supported","Last-Event-ID")}function ty(e,t,r){return e.type==="integer"?typeof t=="number"&&Number.isSafeInteger(t)&&Number(r)===t:e.type==="boolean"?typeof t=="boolean"&&r===String(t):typeof t=="string"&&r===t}function ry(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Sr(e.toolSchema)){let o=wr(t,r.path),n=`Mcp-Param-${r.name}`,s=e.headers.get(n.toLowerCase());if(o==null){s!==void 0&&A("Unexpected MCP parameter header",n);continue}s===void 0&&A("Missing MCP parameter header",n),ty(r,o,Er(s,n))||A("MCP parameter header does not match request body",n)}}function CN(e){let t=Jg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";ey(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&ry({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var EN=H;import{AsyncLocalStorage as oy}from"node:async_hooks";import{createHash as vr,timingSafeEqual as ny}from"node:crypto";(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]="a7c30d99-a0e4-552e-be61-0c54a455e211")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},iy=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,sy=/^[a-z][a-z0-9_*/-]{0,255}$/u,ay=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,dy=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Rr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Ir=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,cy=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,ly=/%(?![0-9A-Fa-f]{2})/u,py=512,uy=32,my=180,fy=8192,_y=8192,Pr=new oy;function S(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function hy(e,t){let r=t.toLowerCase();for(let[o,n]of Object.entries(e))if(!(o.toLowerCase()!==r||n===void 0))return typeof n=="string"?n:n.join(", ")}function ON(e){let t=S(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>S(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!Rr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function RN(e){let t=S(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function IN(e,t){if(!h(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=S(t,"expected issuer").href.replace(/\/$/u,"");if(S(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let o=d=>{let c=e[d];if(typeof c!="string")throw new y(`Authorization server metadata requires ${d}`,401);return S(c,d).href},n=d=>{let c=e[d];return typeof c=="string"?S(c,d).href:void 0},s=o("authorization_endpoint"),i=o("token_endpoint"),a=n("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:i,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(d=>typeof d=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...a?{registration_endpoint:a}:{}}}function PN(e){return e.hasPreRegisteredClient?"pre_registered":e.metadata.client_id_metadata_document_supported?"client_id_metadata_document":e.metadata.registration_endpoint?"dynamic":"user_supplied"}function MN(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new y("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new y("Authorization response issuer mismatch",401)}function kN(e,t){let r=S(t,"client metadata document URL");if(r.pathname==="/"||!h(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);S(o,"client redirect URI",!0)}return structuredClone(e)}function xN(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>S(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Or=class{#e=new Map;set(t,r){let o=S(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=S(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=S(t,"credential issuer").href;return this.#e.delete(r)}};function gy(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?iy.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],s=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(s))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!by(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function yy(e){return sy.test(e)||ay.test(e)}function by(e){if(Buffer.byteLength(e,"utf8")>py)return!1;let t=e.split(",");if(t.length>uy)return!1;let r=new Set;for(let o of t){let n=$(o);if(n.length===0)continue;let s=n.indexOf("="),i=s>0?n.slice(0,s):"",a=s>0?n.slice(s+1):"";if(!yy(i)||!dy.test(a)||r.has(i))return!1;r.add(i)}return!0}function Mr(e){return cy.test(e)&&!ly.test(e)}function Ty(e){let t=$(e),r=t.indexOf("="),o=$(r>=0?t.slice(0,r):t),n=r>=0?$(t.slice(r+1)):void 0;return Ir.test(o)&&(n===void 0||Mr(n))}function Cy(e){let t=$(e),r=t.split(";"),o=r[0],n=r.slice(1),s=o.indexOf("="),i=$(s>0?o.slice(0,s):""),a=s>0?$(o.slice(s+1)):"";if(!(!Ir.test(i)||!Mr(a)||!n.every(Ty)))return{key:i,serialized:t}}function Ey(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>fy)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>my)throw new y("Invalid MCP baggage",403);let n=[];for(let s of o){let i=Cy(s);if(!i)throw new y("Invalid MCP baggage",403);r.has(i.key)&&n.push(i.serialized)}return n.length>0?n.join(","):void 0}function NN(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},o=Ey(r.baggage,t.baggageAllowlist??[]);return{...gy(r),...o?{baggage:o}:{}}}function LN(e,t){return Pr.run(structuredClone(e),t)}function DN(){let e=Pr.getStore();return e?{...e}:void 0}async function $N(e){let t=S(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(c=>!Rr.test(c)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let n=hy(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!n)throw new y("Missing or malformed bearer token",401,o);let s=n[1];if(Buffer.byteLength(s,"utf8")>_y)throw new y("Missing or malformed bearer token",401,o);let i;try{i=await e.policy.verifyAccessToken(s)}catch{throw new y("Invalid bearer token",401,o)}let a=Array.isArray(i.audience)?i.audience:[i.audience];if(i.issuer!==e.policy.issuer||!a.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let d=r.filter(c=>!i.scopes.includes(c));if(d.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${d.join(" ")}"`);return{...i,audience:[...a],scopes:[...i.scopes]}}function FN(e){let t=vr("sha256").update(e.token).digest();return r=>{let o=vr("sha256").update(r).digest();if(!ny(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(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]="46f5fe59-6b84-5c68-ad07-bb1329f4ea29")}catch{}})();var it="io.modelcontextprotocol/ui",Ae="2026-01-26",Nr="text/html;profile=mcp-app",kr=Object.freeze({specVersion:Ae,mimeTypes:[Nr]});function jN(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[it];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:kr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(Nr)||n!==void 0&&n!==Ae)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:kr}}});return!0}var Sy={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Lr=Object.freeze([{id:"context",name:"Context explorer",description:"Inspect bounded project context, provenance, omissions, and token accounting.",toolName:"pm_context",uri:"ui://pm/context.html"},{id:"graph",name:"Relationship graph",description:"Explore typed relationships, explaining paths, and graph-governance evidence.",toolName:"pm_graph",uri:"ui://pm/graph.html"},{id:"plan",name:"Plan and milestone view",description:"Review durable plan steps, dependencies, decisions, discoveries, and validation state.",toolName:"pm_plan",uri:"ui://pm/plan.html"},{id:"assurance",name:"Assurance dashboard",description:"Inspect validation verdicts, evidence, omissions, and actionable recovery paths.",toolName:"pm_validate",uri:"ui://pm/assurance.html"},{id:"operations",name:"Long-operation view",description:"Inspect durable test and operation results without creating a second task store.",toolName:"pm_test",uri:"ui://pm/operations.html"}].map(e=>({...e,toolMeta:{resourceUri:e.uri,visibility:["model","app"]},resourceMeta:Sy})));function BN(e){return Lr.find(t=>t.uri===e)}function qN(e){let t=new Map(Lr.map(r=>[r.toolName,r]));return e.map(r=>{let o=t.get(r.name);return o?{...r,_meta:{...r._meta,ui:o.toolMeta}}:{...r}})}function xr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function zN(e){let t=xr(e.name),r=xr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Ae}),n=JSON.stringify(Ae);return`<!doctype html>
6
6
  <html lang="en">
7
7
  <head>
8
8
  <meta charset="utf-8">
@@ -25,11 +25,11 @@ import{a as ug}from"./chunks/chunk-335BZ75D.js";import{a as Nk,b as Lk,c as Dk,d
25
25
  (()=>{"use strict";const MAX=24000,status=document.querySelector("#status"),result=document.querySelector("#result"),input=document.querySelector("#input"),pending=new Map();let nextId=1;const render=(node,value)=>{let text;try{text=typeof value==="string"?value:JSON.stringify(value,null,2)}catch{text="Result could not be serialized."}if(text.length>MAX)text=text.slice(0,MAX)+"\\n\\n[View truncated at "+MAX+" characters; use the authoritative pm tool with a cursor or narrower projection.]";node.textContent=text};const send=(message)=>window.parent.postMessage(message,"*");window.addEventListener("message",event=>{if(event.source!==window.parent||!event.data||event.data.jsonrpc!=="2.0")return;const message=event.data;if(message.id!==undefined&&pending.has(message.id)){pending.get(message.id)(message);pending.delete(message.id);return}if(message.method==="ui/notifications/tool-input"||message.method==="ui/notifications/tool-input-partial"){render(input,message.params?.arguments??message.params);status.textContent="Input received"}else if(message.method==="ui/notifications/tool-result"){render(result,message.params);status.textContent="Current tool result"}else if(message.method==="ui/notifications/tool-cancelled"){status.textContent="Tool call cancelled";status.classList.add("notice")}else if(message.method==="ui/notifications/host-context-changed"&&message.params?.theme){document.documentElement.style.colorScheme=message.params.theme}});const request=(method,params)=>new Promise(resolve=>{const id=nextId++;pending.set(id,resolve);send({jsonrpc:"2.0",id,method,params})});document.querySelector("#copy").addEventListener("click",async()=>{const text=result.textContent+"\\n\\n"+input.textContent;try{await navigator.clipboard.writeText(text);status.textContent="Visible evidence copied"}catch{status.textContent="Clipboard permission unavailable";status.classList.add("notice")}});request("ui/initialize",{appInfo:${o},appCapabilities:{},protocolVersion:${n}}).then(message=>{if(message.error){status.textContent="Host rejected MCP App initialization";status.classList.add("notice");return}send({jsonrpc:"2.0",method:"ui/notifications/initialized"});status.textContent="Connected \u2014 awaiting authoritative result"})})();
26
26
  </script>
27
27
  </body>
28
- </html>`}import{createHash as st}from"node:crypto";import{lstat as Ey,readdir as jr,readFile as Sy}from"node:fs/promises";import M from"node:path";import{parseDocument as wy}from"yaml";(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]="eafd8bc3-0da1-5220-8fb1-6967eecdb6bf")}catch{}})();var Nr="io.modelcontextprotocol/skills",at="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Ay=Object.freeze({revision:at,status:"draft",directoryRead:!0});function KN(e,t=!1){let r=e.clientCapabilities.extensions,o=h(r)?r[Nr]:void 0;if(!h(o)||o.revision!==at||t&&o.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Nr]:Ay}}})}var P=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Lr=100,vy=32*1024*1024,Oy=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Dr=new Set(Array.from({length:P.maxPageSize},(e,t)=>t+1));function C(e,t){throw new u(e,-32602,t)}function $r(e,t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(t),e.endsWith(".md")?"text/markdown":"text/plain"}catch{return"application/octet-stream"}}function Ry(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||C(`Skill ${t} is missing YAML frontmatter.`);let o=wy(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&C(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(s=>s.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(s){C(`Skill ${t} has unsupported YAML aliases.`,{error:String(s)})}return(typeof n!="object"||n===null||Array.isArray(n))&&C(`Skill ${t} frontmatter must be an object.`),n}async function Iy(e,t,r,o){return r>P.maxFileBytes&&C(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>P.maxFilesPerSkill&&C(`Skill exceeds ${P.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>P.maxSkillBytes&&C(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>vy&&C(`Skill origin exceeds the aggregate byte limit: ${t}.`),Sy(e)}async function Br(e,t,r){let o=M.join(e,t),n=await jr(o,{withFileTypes:!0}),s=[];for(let i of n.sort((a,d)=>a.name.localeCompare(d.name))){let a=M.posix.join(t.split(M.sep).join("/"),i.name),d=M.join(e,...a.split("/")),c=await Ey(d);c.isSymbolicLink()&&C(`Skill resource must not be a symbolic link: ${a}.`),c.isDirectory()?s.push(...await Br(e,a,r)):c.isFile()?s.push({relative:a,bytes:await Iy(d,a,c.size,r)}):C(`Skill resource must be a regular file or directory: ${a}.`)}return s}async function Fr(e,t,r){let o=new Map,n;try{n=await jr(e,{withFileTypes:!0})}catch(a){if(Ct(a))return o;throw a}let s=n.filter(a=>a.isDirectory()&&Oy.test(a.name)).sort((a,d)=>a.name.localeCompare(d.name));s.length>Lr&&C(`Skill origin exceeds ${Lr} directories.`);let i={value:0};for(let a of s){let d=await Br(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:i}),c=d.reduce((g,T)=>g+T.bytes.byteLength,0),l=d.find(g=>g.relative==="SKILL.md");if(!l)continue;let p=Ry(l.bytes.toString("utf8"),a.name);p.name!==a.name&&C(`Skill directory ${a.name} must match frontmatter name.`,{actual:p.name??null,expected:a.name}),(typeof p.description!="string"||p.description.trim().length===0)&&C(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=d.map(g=>({uri:`skill://${a.name}/${g.relative}`,digest:`sha256:${st("sha256").update(g.bytes).digest("hex")}`,size:g.bytes.byteLength})),_=st("sha256").update(f.map(g=>`${g.uri}:${g.digest}`).join(`
29
- `)).digest("hex");o.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:p,resources:f,_meta:{contractVersion:1,extensionRevision:at,origin:t,packageVersion:r,protocolVersion:H,trust:"untrusted",estimatedTokens:Math.ceil(c/4)},files:new Map(d.map(g=>[g.relative,g.bytes])),fingerprint:_})}return o}function Gr(e){let{files:t,fingerprint:r,...o}=e;return o}var Ur=class e{#e;#t;constructor(t){this.#e=t,this.#t=st("sha256").update([...t.entries()].sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>`${r}:${o.fingerprint}`).join(`
30
- `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let o=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof o!="object"||o===null||!("fingerprint"in o)||o.fingerprint!==this.#t||!("scope"in o)||o.scope!==r||!("offset"in o)||!Number.isInteger(o.offset)||Number(o.offset)<0)&&C("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof u)throw o;return C("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Fr(M.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=M.resolve(t.packageRoot,".agents","skills"),n=M.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let s=await Fr(n,"workspace",t.packageVersion);for(let[i,a]of s)r.set(i,a)}}return new e(r)}list(t={}){let r=t.limit??P.defaultPageSize;Dr.has(r)||C(`Skill list limit must be an integer from 1 to ${P.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((d,c)=>d.uri.localeCompare(c.uri)),s=n.slice(o,o+r),i=o+s.length,a=i<n.length;return{skills:s.map(Gr),hasMore:a,...a?{nextCursor:this.#o(i,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||C(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Gr(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",s=o&&n?o.files.get(n):void 0,i=o?.resources.find(c=>c.uri===t);(!o||!s||!i)&&C(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:i.digest,origin:o._meta.origin,trust:"untrusted"},d=$r(n,s);return d!=="application/octet-stream"?{contents:[{uri:t,mimeType:d,text:s.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:d,blob:s.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let s=(o?.[2]??"").replace(/\/$/u,""),i=s.length>0?`${s}/`:"",a=`skill://${o[1]}`,d=new Map;for(let T of n.resources){let E=T.uri.slice(`${a}/`.length);if(!E.startsWith(i))continue;let q=E.slice(i.length),[R,...vo]=q.split("/"),Oo=`${a}/${i}${R}`,Ro=n.files.get(`${i}${R}`);d.set(R,{uri:Oo,name:R,mimeType:vo.length>0?"inode/directory":$r(R,Ro)})}s.length>0&&d.size===0&&C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let c=r.limit??P.maxPageSize;Dr.has(c)||C(`Skill directory limit must be an integer from 1 to ${P.maxPageSize}.`);let l=this.#r(r.cursor,t),p=[...d.values()].sort((T,E)=>T.uri.localeCompare(E.uri)),f=p.slice(l,l+c),_=l+f.length,g=_<p.length;return{resources:f,hasMore:g,...g?{nextCursor:this.#o(_,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]="38023567-8a5b-5e25-8d71-5112f74d1894")}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]="2b24276b-948b-50bd-bfd9-f429cd74be70")}catch{}})();var qr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function dt(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,o)=>dt(r,`${t}[${o}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,o])=>[r,dt(o,`${t}.${r}`)])))}function ve(e){if(e.schema!==qr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Et(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,o)=>Object.freeze({action:r.action,input:dt(r.input,`operations[${o}].input`)})))})}async function zr(e,t){let r=ve(e);return St(r,t)}async function Py(e,t){return zr(e,async()=>{let r=[];for(let[o,n]of e.operations.entries())r.push(await t(n,o));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]="c234be1c-35b7-5388-8a70-a012e9a34389")}catch{}})();var Hr="pm.agent-observation/v1",Vr="pm.agent-verdict/v1",Kr="pm.agent-episode/v1";function O(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function k(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function ne(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ne(t)}return e}function My(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(k(r.command,"observation.reads.command"),O(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function ky(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(O(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,o)=>r+o,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function xy(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let o of e){if(k(o.id,"observation.tiers.id"),O(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let s of o.fields){if(F(s,"observation.tiers.fields"),n.has(s))throw new Error(`Duplicate observation tier field: ${s}.`);n.add(s)}}}function Ny(e){if(e.schema!==Hr)throw new Error(`observation.schema must be ${Hr}.`);return k(e.id,"observation.id"),O(e.version,"observation.version"),My(e.reads),ky(e.calibration),e.corpus_dependence.kind==="bounded"&&(k(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),O(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),xy(e.tiers),ne(structuredClone(e))}function rL(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function Ly(e,t,r){O(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,s]of e.tiers.entries()){o.push(s.id);let i=await t(s),a=Buffer.byteLength(I(i),"utf8"),d=Math.ceil(a/4);if(d<=Math.min(r.budget_tokens,s.max_tokens))return{status:"served",payload:i,receipt:{contract_id:e.id,contract_version:e.version,served_tier:s.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:d,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:o,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function F(e,t){let r=e.split(".");if(r.some(o=>o.length===0||o==="__proto__"||o==="prototype"||o==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Wr(e,t){let r=e;for(let o of F(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function Dy(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function $y(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function Fy(e){if(e.schema!==Vr)throw new Error(`verdict.schema must be ${Vr}.`);k(e.id,"verdict.id"),O(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){k(o.id,"verdict.predicates.id"),F(o.path,"verdict.predicates.path");let n=o.kind;if(n!=="field_equals"&&n!=="field_present"&&n!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${o.id}.`);if(t.has(o.id))throw new Error(`Duplicate verdict predicate: ${o.id}.`);$y(o),t.add(o.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(o=>!t.has(o)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return ne(structuredClone(e))}function Gy(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(i=>[i.id,i])),o=e.composition.predicate_ids.map(i=>{let a=r.get(i),d=Wr(t.state,a.path),c=a.kind==="field_present"?d!==void 0:a.kind==="field_absent"?d===void 0:I(d)===I(a.expected);return{id:i,outcome:c?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${Dy(a.path)}`,evidence_digest:yt(I(d))}}),n=o.filter(i=>i.outcome==="satisfied").length,s=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:s?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function oL(e){if(e.schema!==Kr)throw new Error(`episode.schema must be ${Kr}.`);if(k(e.id,"episode.id"),O(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)k(t,"episode.task_item_ids");O(e.limits.max_actions,"episode.limits.max_actions"),O(e.limits.max_observations,"episode.limits.max_observations"),O(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)F(t,"episode.observable_fields");for(let t of e.withheld_fields)F(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(o=>t===o||t.startsWith(`${o}.`)||o.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return Ny(e.observation),Fy(e.verdict),ve(e.recipe),ne(structuredClone(e))}function Uy(e,t,r){let o=F(t,"observation projection field"),n=e;for(let[s,i]of o.entries()){if(s===o.length-1){r!==void 0&&(n[i]=structuredClone(r));return}let a=n[i];(a===null||typeof a!="object"||Array.isArray(a))&&(n[i]={}),n=n[i]}}function jy(e,t){let r={};for(let o of t)Uy(r,o,Wr(e,o));return r}async function nL(e,t){let r=[],o=0,n=0,s=!1,i,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},d=await D(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:d.state_id});let c=async()=>{if(s)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let p=await t.readRecordedState(),f=await Ly(e.observation,async _=>jy(p.state,_.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??p.snapshot_id}),f},l=async(p=!1)=>{if(s&&!p)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),_=Gy(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),_};return{observe:()=>D(a,c),step:async p=>{if(s)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await D(a,()=>t.execute(p));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>D(a,l),close:()=>i!==void 0?i:s?Promise.reject(new Error("episode is already closed.")):(s=!0,i=D(a,()=>l(!0)).then(p=>(r.push({sequence:r.length+1,kind:"close",state_id:p.snapshot_id}),{verdict:p,trajectory:ne(structuredClone(r))})).catch(p=>{throw s=!1,p}).finally(()=>{i=void 0}),i)}}(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]="14472bc2-ebca-5b9c-9462-bd8694b630a0")}catch{}})();var G="https://schema.unbrained.dev/pm/corpus-shape/v1";function K(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function ie(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Xr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Xr(t);Object.freeze(e)}}function W(e){if(e.schema!==G)throw new TypeError(`Unsupported corpus shape schema: ${e.schema}`);if(e.name.trim().length===0||e.description.trim().length===0)throw new TypeError("Corpus shape name and description must be non-empty");if(K(e.hierarchy_depth,"hierarchy_depth"),K(e.hierarchy_fanout,"hierarchy_fanout"),ie(e.age_span_days,"age_span_days"),K(e.history_entries_per_item,"history_entries_per_item"),ie(e.comments_per_100_items,"comments_per_100_items"),ie(e.notes_per_100_items,"notes_per_100_items"),ie(e.learnings_per_100_items,"learnings_per_100_items"),K(e.author_cardinality,"author_cardinality"),K(e.component_count,"component_count"),e.edge_kind_mix.length===0||e.edge_kind_mix.some(r=>r.kind.trim().length===0||r.weight<=0))throw new TypeError("Corpus shape edge_kind_mix requires non-empty kinds with positive weights");if(e.terminal_statuses.some(r=>!e.custom_statuses.includes(r)))throw new TypeError("Corpus shape terminal_statuses must be declared in custom_statuses");let t=structuredClone(e);return Xr(t),t}var Oe=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],Y=Object.freeze({scratch:W({schema:G,name:"scratch",description:"Seconds-old, shallow project with minimal history.",hierarchy_depth:2,hierarchy_fanout:50,age_span_days:0,history_entries_per_item:1,comments_per_100_items:2,notes_per_100_items:1,learnings_per_100_items:1,edge_kind_mix:[{kind:"related",weight:1}],author_cardinality:2,component_count:1,include_cycles:!1,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),representative:W({schema:G,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:Oe,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":W({schema:G,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:Oe,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":W({schema:G,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:Oe,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":W({schema:G,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:Oe,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function By(){return Object.keys(Y).sort().map(e=>Y[e])}function qy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(Y,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(Y).join(", ")}`);return Y[t]}var Yr=new WeakMap;function Jr(e,t){if(e===0)return[];let r=Yr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),Yr.set(t,r));let o=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&o.push("related"),[...new Set(o)]}function zy(e,t,r,o=42){if(ie(t,"item index"),K(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),s=t%n,i=Math.floor(t/n),a=0,d=1;for(let E=0;E<e.hierarchy_depth;E+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+d),d=Math.min(Number.MAX_SAFE_INTEGER,d*e.hierarchy_fanout);let c=i%a,l=i-c,p=c===0?void 0:s+(l+Math.floor((c-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),_=e.age_span_days*864e5,g=new Date(f+(r===1?0:Math.round(t/(r-1)*_))).toISOString(),T=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...p===void 0?{}:{parent:`pm-s${p.toString(36).padStart(7,"0")}`},component:s,timestamp:g,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Jr(t,e),has_comment:T<e.comments_per_100_items,has_note:T<e.notes_per_100_items,has_learning:T<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var ct=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let o of r)t[o]=(t[o]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let o=this.depths.get(t.parent);this.recordMismatch(o===void 0,`parent_missing:${t.parent}`),r=(o??0)+1;let n=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,n),this.observedFanout=Math.max(this.observedFanout,n)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[o,n]of this.annotationFields)this.annotations[o]+=Number(t[n]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Jr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[i,,a]of this.annotationFields){let d=Math.floor(this.itemCount/100),c=this.itemCount%100,l=d*a+Math.max(0,a+c-100),p=d*a+Math.min(a,c),f=this.annotations[i];(f<l||f>p)&&o.push(`${i}:${f}!in[${l},${p}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let i of[...n].sort()){let a=this.edgeKinds[i]??0,d=this.expectedEdgeKinds[i]??0;a!==d&&o.push(`edge_kind:${i}:${a}!=${d}`)}let s=[...new Set(o)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:s.length===0,mismatches:s}}};function Zr(e){return new ct(e)}function Hy(e,t){let r=Zr(e);for(let o of t)r.add(o);return r.finish()}(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]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}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]="6a6b2905-b6b7-5b46-b87d-8b8287e37745")}catch{}})();async function Vy(){let e=Ge(process.cwd(),process.env.PM_PATH);await vt(e,(t,r)=>Ot(t,r,{apply_runtime_defaults:!0}))}(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]="4534b1c9-de27-5745-88f2-641b00b94714")}catch{}})();async function Ky(){await Rt()}(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]="c1cb8d82-20a6-5460-a0ff-f55312911218")}catch{}})();var Qr=["lines","branches","functions","statements"];function Wy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function Yy(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let o=r;if(typeof o.covered!="number"||typeof o.total!="number"||!Number.isInteger(o.covered)||!Number.isInteger(o.total)||o.covered<0||o.total<o.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:o.covered,total:o.total}}function Xy(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,o]of Object.entries(e)){Wy(r,o);for(let n of Qr){let s=Yy(r,n,o[n]),i=s.total-s.covered;i>0&&t.push({file:r,metric:n,uncovered:i,...s})}}return 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]="7e55d416-9cc3-51c5-8e56-6b5fd5c836a9")}catch{}})();var Jy=["captured_redacted","captured_verbatim"],Zy=[{label:"home directory",pattern:/(?:\/home\/|\/Users\/)[^/\s"']+/u},{label:"GitHub token",pattern:/\b(?:gh[oprsu]_[A-Za-z0-9_]{20,})\b/u},{label:"npm token",pattern:/\bnpm_[A-Za-z0-9]{20,}\b/u},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/u}];function v(e){return typeof e=="string"&&e.trim().length>0}function Qy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))return[{boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} must contain a JSON object.`}];let r=t,o=[];r.boundary_id!==e.id&&o.push({boundary_id:e.id,kind:"fixture_boundary_mismatch",detail:`${e.fixture_path} names ${String(r.boundary_id)} instead of ${e.id}.`}),(r.version!==1||!Jy.includes(r.capture_source)||!v(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(v)||!("input"in r)||!("observed"in r))&&o.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let n=JSON.stringify(t);for(let s of Zy)s.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${s.label}.`});return o}function eb(e,t){let r=Date.parse(e.waiver_expires_at),o=v(e.waiver_reason)&&v(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&_e(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:o&&r>=t?1:0,findings:o?r<t?[{boundary_id:e.id,kind:"expired_waiver",detail:`Boundary ${e.id} waiver expired at ${e.waiver_expires_at}.`}]:[]:[{boundary_id:e.id,kind:"invalid_waiver",detail:`Boundary ${e.id} waiver requires reason, owner, and an RFC 3339 UTC expiry.`}]}}function tb(e,t,r){if(!v(e.id)||!v(e.producer)||!v(e.consumer)||!v(e.format))return{captured:0,waived:0,findings:[{boundary_id:v(e.id)?e.id:"unknown",kind:"invalid_boundary",detail:"Each boundary requires non-empty id, producer, consumer, and format."}]};if("fixture_path"in e){let o=t[e.fixture_path],n=v(e.fixture_path)&&e.fixture_path in t?Qy(e,o):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:n.length===0?1:0,waived:0,findings:n}}return eb(e,r)}function CL(e,t,r=new Date){let o=[];if(e.version!==1||!v(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let n=new Set,s=0,i=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){o.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let d=a,c=v(d.id)?d.id:void 0;if(c!==void 0&&n.has(c)){o.push({boundary_id:c,kind:"duplicate_boundary",detail:`Boundary ${c} is inventoried more than once.`});continue}c!==void 0&&n.add(c);let l=tb(d,t,r.getTime());s+=l.captured,i+=l.waived,o.push(...l.findings)}return o.sort((a,d)=>a.boundary_id!==d.boundary_id?a.boundary_id.localeCompare(d.boundary_id):a.kind.localeCompare(d.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:s,waived_count:i,findings:o}}import X from"node:fs";import lt 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]="aacf5738-098d-50f9-b619-19e472b577ea")}catch{}})();var eo=300*1e3,rb=3;function vL(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function OL(e,t){let r=t.trim();if(!/^[a-zA-Z0-9_-][a-zA-Z0-9._-]*$/.test(r))throw new TypeError("Compile-cache generation must be a safe non-empty filename token.");X.mkdirSync(e,{recursive:!0});let o=lt.join(e,r);X.mkdirSync(o,{recursive:!0});let n=new Date;X.utimesSync(o,n,n);let s=X.readdirSync(e).filter(c=>c!==r).flatMap(c=>{try{return[{name:c,mtimeMs:X.statSync(lt.join(e,c)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&fe(l))return[];throw l}}).sort((c,l)=>l.mtimeMs-c.mtimeMs||c.name.localeCompare(l.name)),i=s.filter(c=>n.getTime()-c.mtimeMs<eo),a=Math.max(0,rb-1-i.length),d=s.filter(c=>n.getTime()-c.mtimeMs>=eo).slice(a).map(c=>c.name).sort((c,l)=>c.localeCompare(l));for(let c of d)X.rmSync(lt.join(e,c),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:d}}import{createHash as ob}from"node:crypto";(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]="ff60bc5b-bd85-5b3c-9a55-21e7e72477ac")}catch{}})();var pt=1;function J(e){e?.throwIfAborted()}function U(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function Z(e,t,r={}){let o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),s=e.edges(),i=t.list();return Object.freeze({version:pt,fingerprint:ob("sha256").update(I({nodes:n,edges:s,kinds:i})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:s,kinds:i})}function nb(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e){if(!nb(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==pt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(n=>typeof n!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Ue([]);for(let n of e.kinds)t.register(n);let r=new z(e.nodes,e.edges,t),o=Z(r,t,{createdAt:e.created_at});if(o.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:o,registry:t,graph:r}}async function x(e,t){U(e.name,"adapter name");let r=U(t.workspace,"workspace");J(t.signal);let o=await e.read({...t,workspace:r});return J(t.signal),o===null?null:ae(o)}async function Re(e,t){let r=U(t.workspace,"workspace"),o=ae(t.snapshot).snapshot,n=await x(e,{workspace:r,signal:t.signal});if(n?.snapshot.fingerprint===o.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:o.fingerprint,previous_fingerprint:n.snapshot.fingerprint,node_count:o.nodes.length,edge_count:o.edges.length};if(J(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await x(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==o.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:o.fingerprint,...n?{previous_fingerprint:n.snapshot.fingerprint}:{},node_count:o.nodes.length,edge_count:o.edges.length}}function ib(e,t={}){let r=e.map(ae),o=new Map;for(let i of r)for(let a of i.snapshot.kinds){let d=o.get(a.kind);if(d&&I(d)!==I(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new Ue([...o.values()].sort((i,a)=>i.kind.localeCompare(a.kind))),s=new z(new Set(r.flatMap(i=>[...i.snapshot.nodes])),r.flatMap(i=>[...i.snapshot.edges]),n);return Z(s,n,t)}var se=class{name;#e=new Map;constructor(t="memory"){this.name=U(t,"adapter name")}async read(t){J(t.signal);let r=this.#e.get(U(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){J(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(ae(t.snapshot).snapshot))}async clear(t){J(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(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]="e47f9bb8-f98e-5159-9116-29c3e6fedfc3")}catch{}})();function to(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function sb(e){let t=to(e.nodeCount,"nodeCount"),r=to(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),s=(e.idPrefix??"node").trim();if(!n||!s)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let i=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:i,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${s}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${s}-${o==="star"?0:a-r}`,target:`${s}-${a}`,kind:n}}}}}function j(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function ro(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=wt(),n=Z(new z(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),s=Z(new z(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),i=[];j(await x(e,{workspace:r})===null,"workspace must start empty"),i.push({name:"empty-read",passed:!0});let a=await Re(e,{workspace:r,snapshot:n});j(a.disposition==="written","first sync must write"),i.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),j((await x(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),i.push({name:"read-isolation",passed:!0}),j((await Re(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),i.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:s,expected_fingerprint:n.fingerprint}),j((await x(e,{workspace:r}))?.snapshot.fingerprint===s.fingerprint,"replacement must become visible"),i.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:n,expected_fingerprint:n.fingerprint})}catch{d=!0}return j(d,"stale compare-and-swap must fail"),i.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:s.fingerprint}),j(await x(e,{workspace:r})===null,"clear must remove the workspace"),i.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(i),clear_supported:e.clear!==void 0}}function ab(e){return ro(new se,e?{workspace: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]="58736688-35d0-545d-892e-e0ede7fedc1a")}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]="d45a8203-4501-5797-a6cc-a2e7844adec9")}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]="f5567aa1-0268-574d-907b-38d6249538ce")}catch{}})();var ut=2,db=["self_reported","independent_transport"];function Ie(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function oo(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((o,n)=>{let s=de(o,`${t}[${String(n)}]`);return r?o:s})}function mt(e,t){return e===void 0?void 0:de(e,t)}function cb(e,t){if(e===void 0)return;if(!Ie(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([o,n])=>{if(o.length===0||o.split(".").some(s=>s.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function lb(e,t,r,o,n,s){if(o==="refusal"){if(We(r)||n===void 0||s===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||s!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let i=bt(t);if(i===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[i].trim().toLowerCase();if(a==="history"){let l=Tt(t.slice(i+1));l!==void 0&&(a=Le(`history ${l}`))}let d=Nt(a);if(!We(r)||r!==0&&!d?.exit_codes.some(l=>l===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let c=xt(a).kind;if(o!==c)throw new TypeError(`${e} expected ${o}, but ${a} declares ${c}`)}function pb(e,t,r){if(!Ie(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=de(e.id,`${o}.id`),s=oo(e.args,`${o}.args`,!0),i=e.expected_exit_code;if(typeof i!="number"||!Number.isSafeInteger(i))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!kt.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let d=a,c=e.expected_accounting_mode;if(!db.includes(c))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=c;if(l==="independent_transport"&&d!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let p=oo(e.required_fields,`${o}.required_fields`);if(p.some(E=>E.split(".").some(q=>q.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=cb(e.expected_field_values,`${o}.expected_field_values`),_=mt(e.expected_error_code,`${o}.expected_error_code`),g=mt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),T=mt(e.recovery_for,`${o}.recovery_for`);return lb(o,s,i,d,_,g),{id:n,args:s,expected_exit_code:i,expected_output_kind:d,expected_accounting_mode:l,required_fields:p,...f?{expected_field_values:f}:{},..._?{expected_error_code:_}:{},...g?{expected_refusal_surface:g}:{},...T?{recovery_for:T}:{}}}function ub(e,t){if(!Ie(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=de(e.id,`tasks[${String(t)}].id`),o=de(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((i,a)=>pb(i,r,a)),s=new Map;for(let i of n){if(s.has(i.id))throw new TypeError(`tasks.${r} contains duplicate step id ${i.id}`);if(i.recovery_for!==void 0&&(s.get(i.recovery_for)?.expected_output_kind!=="refusal"||i.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${i.id} recovery_for must reference an earlier refusal and declare successful output`);s.set(i.id,i)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let i of n)if(i.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===i.id))throw new TypeError(`tasks.${r}.${i.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function nD(e){if(!Ie(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==ut)throw new TypeError(`agent-task transcript corpus version must be ${String(ut)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((o,n)=>ub(o,n)),r=new Set;for(let o of t){if(r.has(o.id))throw new TypeError(`duplicate agent-task transcript id ${o.id}`);r.add(o.id)}return{version:ut,tasks:t}}import{createHash as no}from"node:crypto";(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]="7163a078-d8be-5bca-813f-c941fcb8e406")}catch{}})();function io(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function dD(e,t){let r=io(t.migrationId,"migrationId"),o=io(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let s=new Date(n).toISOString(),i=He(e,void 0,t.registry),a=i.graph.nodes(),d=i.graph.edges().map(f=>{let _=no("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${_}`,relationshipId:`migration:${r}:${_}`,action:"add",edge:f,author:o,timestamp:s,reason:`Backfill ${r} from legacy item metadata`})}),c=no("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:d})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),p=d.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:c,nodes:a,events:Object.freeze(p),edge_count:d.length,skipped_existing_count:d.length-p.length,duplicate_dependency_rows:i.duplicateRows.length,dangling_reference_count:i.dangling.active.length+i.dangling.legacy_terminal.length})}import*as so from"node:module";(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]="7a1d7194-6ff1-5365-ab64-80b47b0176d7")}catch{}})();var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ft={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},lD=Object.freeze(Object.keys(ft));function ao(e){if(Object.hasOwn(ft,e))return ft[e]}var mb=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function fb(e,t){let r=e[t],o=t+1,n="";for(;o<e.length&&e[o]!==r;)e[o]==="\\"?o+=2:(n+=e[o],o+=1);return e[o]===r&&(o+=1),{next:o,value:n}}function _b(e){return e===void 0||e.kind==="punctuator"&&mb.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function hb(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
31
- `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function gb(e,t,r){if(e[t]!=="/"||!_b(r))return;let o=t+1,n=!1;for(;o<e.length;)if(e[o]==="\\")o+=2;else if(e[o]==="[")n=!0,o+=1;else if(e[o]==="]")n=!1,o+=1;else if(e[o]==="/"&&!n){for(o+=1;/[A-Za-z]/u.test(e.charAt(o));)o+=1;return o}else o+=1;return o}function yb(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=fb(e,t);return r==="`"?{next:n.next}:{next:n.next,token:{kind:"string",value:n.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let n=t+1;for(;/[A-Za-z0-9_$]/u.test(e[n]??"");)n+=1;return{next:n,token:{kind:"identifier",value:e.slice(t,n),offset:t}}}let o=e.startsWith("=>",t)?"=>":r;return{next:t+o.length,token:{kind:"punctuator",value:o,offset:t}}}function bb(e){let t=[],r=0;for(;r<e.length;){let o=hb(e,r);if(o!==void 0){r=o;continue}let n=gb(e,r,t.at(-1));if(n!==void 0){r=n;continue}let s=yb(e,r);s.token&&t.push(s.token),r=s.next}return t}var Tb=new Set(["object","block","pattern"]),Cb=new Set(["const","let","var"]),Eb=new Set(["}",")","]"]),Sb=new Set(["=","(","[",",",":","?","return"]);function wb(e,t,r){if([...r].reverse().find(n=>Tb.has(n.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Cb.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Sb.has(o.value)?"object":"block"}function Ab(e,t,r){let o=e[t];if(o.value==="{"){let i=wb(e,t,r);return{kind:i,...i==="object"?{member_start:!0,candidates:[]}:{}}}if(o.value==="[")return{kind:"array"};if(o.value!=="(")return;let n=e[t-1],s=e[t-2];return{kind:"paren",...n?.value==="function"||s?.value==="function"?{parameter_list:!0}:{}}}function vb(e,t,r){if(!(e?.kind!=="object"||!e.member_start||t.kind!=="identifier"&&t.kind!=="string"||r?.value!==":"||!/^[A-Za-z][A-Za-z0-9_]*$/u.test(t.value)))return{field:t.value,offset:t.offset}}function Ob(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function Rb(e){let t=bb(so.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,s]of t.entries()){let i=o.at(-1),a=vb(i,s,t[n+1]);a&&i.candidates.push(a);let d=Ab(t,n,o);if(d)o.push(d);else if(Eb.has(s.value)){let c=o.pop();c?.kind==="object"&&!Ob(t,n)&&r.push(...c.candidates)}else s.value===","&&i?.kind==="object"?i.member_start=!0:i?.kind==="object"&&s.value!==":"&&(i.member_start=!1)}return r}function Ib(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
32
- `&&t.push(r+1);return t}function Pb(e,t){let r=0,o=e.length;for(;r<o;){let n=Math.floor((r+o)/2);e[n]<=t?r=n+1:o=n}return r}function pD(e){let t=[],r=[];for(let n of[...e].sort((s,i)=>Q(s.path,i.path))){let s=Ib(n.content),i;try{i=Rb(n.content)}catch(a){r.push({kind:"invalid_source",subject:n.path,detail:`${n.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of i){let d=a.field,c=Pb(s,a.offset),l=ao(d);l?t.push({path:n.path,line:c,field:d,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(d)&&!/(?:_total|_truncated)$/u.test(d)&&r.push({kind:"unknown_recovery_field",subject:`${n.path}:${c}:${d}`,detail:`${d} resembles a recovery reference but has no typed field contract.`})}}let o=Object.fromEntries(ce.map(n=>[n,t.filter(s=>s.kind===n).length]));for(let n of ce)o[n]===0&&r.push({kind:"missing_kind_producer",subject:n,detail:`No source producer emits the ${n} recovery-reference kind.`});return t.sort((n,s)=>n.path!==s.path?Q(n.path,s.path):n.line!==s.line?n.line-s.line:Q(n.field,s.field)),r.sort((n,s)=>n.subject!==s.subject?Q(n.subject,s.subject):Q(n.kind,s.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function uD(e,t){let r=[],o=(n,s)=>{if(Array.isArray(n)){n.forEach((i,a)=>o(i,[...s,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[i,a]of Object.entries(n).sort(([d],[c])=>Q(d,c))){let d=ao(i),c=d?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...d,semantics:"behavior_preserving"}:d,l=[a].flat();c!==void 0&&l.forEach((p,f)=>{let _="nested_value_field"in c&&typeof c.nested_value_field=="string"?c.nested_value_field:void 0,g=_&&typeof p=="object"&&p!==null&&!Array.isArray(p)?p[_]:p;if(typeof g!="string"||g.trim().length===0)return;let T=[...s,i,String(f)].map(E=>encodeURIComponent(E)).join("/");r.push({id:`${e}:${c.kind}:${T}`,probe_id:e,kind:c.kind,semantics:c.semantics,value:g})}),o(a,[...s,i])}};return o(t,[]),r}function mD(e,t){let r=e.flatMap(i=>(i.owned_states??[]).map(a=>({contract:i,state:a}))),o=[],n=new Map;for(let i of t){if(n.has(i.probe_id)){o.push({kind:"duplicate_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} was supplied more than once.`});continue}n.set(i.probe_id,i)}let s=new Set(r.map(({state:i})=>i.probe_id));for(let{contract:i,state:a}of r){let d=n.get(a.probe_id);if(!d){o.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${i.code}.`});continue}d.code!==i.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${i.code}; observed ${d.code}.`}),d.exit_class!==a.expected_exit_class&&o.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${d.exit_class}.`}),a.entrypoints.includes(d.entrypoint)||o.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${d.entrypoint}.`})}for(let i of t)s.has(i.probe_id)||o.push({kind:"undeclared_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} has no catalog declaration.`});return o.sort((i,a)=>i.probe_id!==a.probe_id?i.probe_id.localeCompare(a.probe_id):i.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function fD(e,t){let r=[],o=new Set,n=new Set;for(let d of e){if(o.has(d.id)){n.add(d.id),r.push({kind:"duplicate_obligation",reference_id:d.id,detail:`Recovery obligation ${d.id} was declared more than once.`});continue}o.add(d.id)}let s=new Map;for(let d of t){if(s.has(d.id)){r.push({kind:"duplicate_observation",reference_id:d.id,detail:`Recovery reference ${d.id} was observed more than once.`});continue}s.set(d.id,d),o.has(d.id)||r.push({kind:"undeclared_observation",reference_id:d.id,detail:`Recovery observation ${d.id} has no emitted obligation.`})}for(let d of e){if(n.has(d.id))continue;let c=s.get(d.id);c?c.reachable?c.semantics!==d.semantics&&r.push({kind:"wrong_semantics",reference_id:d.id,detail:`Recovery reference ${d.value} promised ${d.semantics}; proof demonstrated ${c.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:d.id,detail:`Recovery reference ${d.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:d.id,detail:`No reachability proof was recorded for ${d.kind} ${d.value}.`})}let i=ce.map(d=>{let c=e.filter(p=>p.kind===d),l=c.filter(p=>!n.has(p.id)).map(p=>s.get(p.id)).filter(p=>p!==void 0);return{kind:d,declared:c.length,observed:l.length,passed:c.filter(p=>{let f=s.get(p.id);return!n.has(p.id)&&f?.reachable===!0&&f.semantics===p.semantics}).length}});r.sort((d,c)=>d.reference_id!==c.reference_id?d.reference_id.localeCompare(c.reference_id):d.kind.localeCompare(c.kind));let a=i.reduce((d,c)=>d+c.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:o.size===0?1:a/o.size,coverage_by_kind:i,findings:r}}function Mb(e,t){let r=new Map(ce.map(s=>[s,new Set]));for(let s of t)r.get(s.kind).add(s.value);let o=ce.map(s=>({kind:s,source_producers:e.producer_count_by_kind[s],runtime_values:r.get(s).size})),n=o.filter(({source_producers:s,runtime_values:i})=>s>0&&i===0).map(({kind:s})=>s);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((s,{runtime_values:i})=>s+i,0),coverage_by_kind:o,missing_runtime_kinds:n}}var _D=Mb;(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]="2b2197f3-7203-52c8-9cc7-f714b33a9306")}catch{}})();var gD=16,kb=Object.freeze(["bulk_ids_input_empty","bulk_ids_input_missing_path","bulk_ids_input_unreadable","invalid_argument_value","missing_lifecycle_target","missing_required_argument","projection_options_mutually_exclusive","tracker_not_initialized","tracker_root_missing","tracker_root_not_directory","tracker_root_unreadable","unknown_context_intent","unknown_field_projection","unknown_option","unknown_subcommand"]),co=18,lo=Object.freeze([...kb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function yD(e,t=co){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function bD(e,t=lo){let r=new Set(e.rows.filter(({disposition:n})=>n==="executable").map(({canonical_code:n})=>n)),o=t.filter(n=>!r.has(n));return{ok:o.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:o}}function _t(e,t){let r=e.get(t);if(r)return r;let o={kinds:new Set,probeIds:new Set};return e.set(t,o),o}function TD(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,s=0,i=0;for(let l of e){let p=_t(n,l.canonical_code??l.code);for(let f of l.owned_states??[])p.kinds.add("owned_state"),p.probeIds.add(f.probe_id)}for(let l of t){let p=o.get(l.error_code);if(p===void 0)continue;s+=1;let f=_t(n,p);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let p=o.get(l.error_code);if(p===void 0)continue;i+=1;let f=_t(n,p);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let p=l.canonical_code??l.code,f=n.get(p),_=[...f.probeIds].sort();return{code:l.code,canonical_code:p,disposition:_.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:_}}).sort((l,p)=>l.code<p.code?-1:1),d=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),c=a.length-d.length;return{ok:d.length===0,catalog_error_code_count:a.length,executable_error_code_count:c,uncovered_error_code_count:d.length,coverage_fraction:a.length===0?1:c/a.length,closed_domain_probe_count:s,grammar_probe_count:i,uncovered_error_codes:d,rows:a}}function CD(e){let t=e.rows.map(r=>`| \`${r.code}\` | \`${r.canonical_code}\` | ${r.disposition} | ${r.evidence_kinds.join(", ")||"none"} | ${r.probe_ids.length} |`);return["# Generated refusal closure census","","Tracker: `pm-f05lsg`.","","Every catalog code is listed. An `uncovered` row is an explicit closure obligation, never an omission or implied approval.","",`- Catalog error codes: ${e.catalog_error_code_count}`,`- Executable error codes: ${e.executable_error_code_count}`,`- Executable-code ratchet floor: ${co}`,`- Required executable canonical codes: ${lo.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
33
- `)}(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]="d252409d-e33e-5c9e-9671-789f0ee87312")}catch{}})();function xb(e){return[e.expected_error_code!==void 0&&e.error_code!==e.expected_error_code?{code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected error code ${e.expected_error_code}, received ${e.error_code??"<missing>"}.`}:void 0,e.expected_allowed_values!==void 0&&JSON.stringify([...e.allowed_values].sort())!==JSON.stringify([...e.expected_allowed_values].sort())?{code:"incomplete_allowed_values",probe_id:e.probe_id,detail:"The refusal's accepted domain differs from the SDK-owned domain contract."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)===0?{code:"missing_suggested_retry_args",probe_id:e.probe_id,detail:"The refusal omitted shell-free suggested retry arguments."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)>0&&JSON.stringify(e.suggested_retry_args)!==JSON.stringify(e.expected_suggested_retry_args)?{code:"suggested_retry_args_mismatch",probe_id:e.probe_id,detail:"The refusal's suggested retry arguments differ from the SDK-owned contract."}:void 0]}function Nb(e){return[e.exit_code!==me.USAGE?{code:"non_refusal_exit",probe_id:e.probe_id,detail:`${e.entrypoint} returned exit code ${e.exit_code}; a structured usage refusal must return ${me.USAGE}.`}:void 0,e.allowed_values_required!==!1&&e.allowed_values.length===0?{code:"missing_allowed_values",probe_id:e.probe_id,detail:"The refusal omitted its complete accepted value domain."}:void 0,e.allowed_values.includes(e.rejected_value)?{code:"accepted_rejected_value",probe_id:e.probe_id,detail:`${e.rejected_value} is both rejected and advertised as allowed.`}:void 0,e.suggested_retry.trim().length===0?{code:"missing_suggested_retry",probe_id:e.probe_id,detail:"The refusal omitted an executable suggested retry."}:void 0,e.retry_succeeded?void 0:{code:"retry_failed",probe_id:e.probe_id,detail:"The advertised suggested retry did not succeed."},...xb(e)]}function wD(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let s=t.length;for(let i of Nb(n))i!==void 0&&t.push(i);t.length===s&&(o+=1)}return t.sort((n,s)=>n.probe_id!==s.probe_id?n.probe_id.localeCompare(s.probe_id):n.code.localeCompare(s.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/r.size,findings: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]="39b4e1fe-a34a-5ffc-9447-eaf8c46863c7")}catch{}})();var po="not-a-declared-action";function Lb(e,t){if(e.startsWith("assurance ")&&t.name==="kind")return"measurement";switch(t.value_kind){case"integer":return"1";case"item_id":return"pm-domain";case"action":throw new Error(`Cannot synthesize a preceding action value for positional slot ${t.name}.`);default:return"example"}}function le(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function xD(e=qe.filter(t=>It.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>le(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let s=r.command.split(" "),i=le(r.command),a=s.length>1&&t.has(i)?s.map(le).join("--"):i,d=ee(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),c=Be.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${le(o.name)}`,command:r.command,refusal_args:[...s,...r.slots.slice(0,n).map(l=>Lb(r.command,l)),...d],recovery_args:[...s,"--help"],error_code:c&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:o.name,missing_argument_index:n}]})).sort((r,o)=>r.probe_id.localeCompare(o.probe_id))}function Db(e){switch(L(e)){case"assurance":case"workspace snapshot":return Be.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return De;case"merge":return $e;case"plan":return Ye;case"profile":return Xe;case"schema":return Lt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function ND(e=qe){return e.filter(({slots:t})=>t[0]?.required===!0&&t[0].value_kind==="action").map(({command:t})=>{let r=t.split(" ");return{probe_id:`unknown-subcommand-${le(t)}`,command:t,refusal_args:[...r,po],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:po,allowed_values:[...Db(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function $b(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function Fb(e,t){if(!t)return[{code:"refusal_probe_missing",probe_id:e.probe_id,detail:`${e.probe_id} has no runtime observation.`}];let r=[];return t.error_code!==e.error_code&&r.push({code:"refusal_error_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} emitted ${t.error_code||"<none>"}; expected ${e.error_code}.`}),t.exit_code!==2&&r.push({code:"refusal_exit_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} exited ${t.exit_code}; expected usage exit 2.`}),"allowed_values"in e&&!$b(t.allowed_values,e.allowed_values)&&r.push({code:"refusal_allowed_values_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} did not expose its complete action domain.`}),t.recovery_succeeded||r.push({code:"refusal_recovery_failed",probe_id:e.probe_id,detail:`${e.probe_id} help recovery did not succeed.`}),t.refusal_mutated_state&&r.push({code:"refusal_mutated_state",probe_id:e.probe_id,detail:`${e.probe_id} changed tracker state while refusing input${t.mutated_paths?.length?`: ${t.mutated_paths.join(", ")}`:"."}`}),r}function LD(e,t){let r=new Map(e.map(i=>[i.probe_id,i])),o=new Map(t.map(i=>[i.probe_id,i])),n=[...e.flatMap(i=>Fb(i,o.get(i.probe_id))),...t.filter(i=>!r.has(i.probe_id)).map(i=>({code:"unexpected_refusal_probe",probe_id:i.probe_id,detail:`${i.probe_id} has no declared grammar refusal contract.`}))];n.sort((i,a)=>i.probe_id.localeCompare(a.probe_id)||i.code.localeCompare(a.code));let s=new Set(n.map(({probe_id:i})=>i));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:i})=>!s.has(i)).length,findings: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]="d3795bc4-fbe5-5ca4-bc90-b72a2d469dc7")}catch{}})();var ht=[{probe_id:"tracker-root-missing",failure_kind:"missing_root",expected_error_code:"tracker_root_missing",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-settings-missing",failure_kind:"settings_missing",expected_error_code:"tracker_not_initialized",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-not-directory",failure_kind:"not_directory",expected_error_code:"tracker_root_not_directory",expected_exit_code:2,recovery_kind:"select_directory"},{probe_id:"tracker-root-unreadable",failure_kind:"unreadable_root",expected_error_code:"tracker_root_unreadable",expected_exit_code:1,recovery_kind:"repair_permissions"}];function $D(){return ht.map(e=>({...e}))}function Gb(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let o=t.suggested_retry_args.indexOf("init"),n=o===0||o===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!n&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function FD(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of ht){let s=t.get(n.probe_id);if(s===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let i=Gb(n,s);r.push(...i),i.length===0&&(o+=1)}return r.sort((n,s)=>n.probe_id.localeCompare(s.probe_id)||n.code.localeCompare(s.code)),{ok:r.length===0,probe_count:ht.length,closed_probe_count:o,findings: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]="29c6ca01-4b1b-56fb-9bcc-5e1c26f17aff")}catch{}})();var Pe,Ub=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function jb(e,t){if(t==="--limit")return"result-row-limit";if(t==="--node-limit")return"graph-node-limit";if(t==="--edge-limit")return"graph-edge-limit";if(t==="--output-limit")return"rendered-output-row-limit";if(t==="--output-budget")return"rendered-output-byte-budget";if(t==="--token-budget")return"context-intent-token-budget";if(t==="--full"){let r=Ub[L(e)];if(r===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return r}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(L(e))?"linked-file-path":["comments","notes","learnings"].includes(L(e))?"entry-file-input":"plan-definition-file"}function Me(){if(Pe!==void 0)return Pe;let e=te.filter(({command:n})=>ze(n)).flatMap(({command:n,family:s})=>Mt(n,ee(n)).map(i=>({command:n,family:s,concept:jb(n,i.flag),flag:i.flag,aliases:Object.freeze([...i.aliases??[]]),value_kind:i.repeatable?"list":i.flag==="--limit"?"number":i.value_type}))),t=new Set(e.flatMap(n=>n.aliases.map(s=>`${n.command}:${s}`))),r=e.filter(n=>!t.has(`${n.command}:${n.flag}`)),o=new Map;for(let n of r){let s=o.get(n.concept)??new Set;s.add(n.value_kind),o.set(n.concept,s)}return Pe=Object.freeze(r.map(n=>Object.freeze({...n,concept:o.get(n.concept)?.size===1?n.concept:`${n.concept}@${n.command}`}))),Pe}function zD(){return Object.freeze(Me().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var uo=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:102,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:36,events:34,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:31,notes:35,learnings:31,files:39,docs:30,deps:32,plan:111,test:56,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:25,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),Bb=1,mo=Object.freeze(Object.fromEntries(Object.entries({...uo,...Object.fromEntries(Ne.flatMap(({alias:e,canonical:t})=>{let r=uo[e];return r===void 0?[]:[[t,r]]}))}).map(([e,t])=>[e,t+Bb])));function fo(){let e=new Map(Object.keys(mo).map(t=>[t,0]));for(let{command:t}of Me())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(mo).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function qb(e,t,r){for(let o of e)for(let n of o.aliases){let s=t.get(`${o.command}:${n}`);s===void 0||s.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${s.flag}.`})}}function zb(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let s=e.get(n.command)??0;s===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(s<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${s} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function Hb(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let s=`${n.command}:${n.canonical_flag}`,i=o.get(s);if(!i){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([i.flag,...i.aliases]);for(let d of n.accepted_spellings)a.has(d)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${d} no longer resolves to ${n.canonical_flag}.`})}}function HD(e=Me(),t=fo(),r=[]){let o=[],n=new Map,s=new Map,i=new Map,a=new Map;for(let d of e){let c=`${d.command}:${d.flag}`;n.has(c)?o.push({code:"duplicate_canonical_flag",command:d.command,detail:`${d.flag} has more than one canonical row.`}):n.set(c,d),a.set(d.command,(a.get(d.command)??0)+1);let l=s.get(d.concept);l!==void 0&&l!==d.value_kind?o.push({code:"inconsistent_concept_kind",command:d.command,detail:`${d.concept} uses both ${l} and ${d.value_kind}.`}):s.set(d.concept,d.value_kind);let p=i.get(d.concept);p!==void 0&&p!==d.flag?o.push({code:"semantic_spelling_collision",command:d.command,detail:`${d.concept} is canonicalized by both ${p} and ${d.flag}.`}):i.set(d.concept,d.flag)}return qb(e,n,o),zb(a,t,o),Hb(e,r,o),o.sort((d,c)=>d.command.localeCompare(c.command)||d.code.localeCompare(c.code)||d.detail.localeCompare(c.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:d})=>d)).size,baseline_entry_count:r.length,findings:o}}function VD(){let e=Me(),t=fo(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:n}of e)r.set(o,n);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:n,maximum:s})=>{let i=r.get(o);return`| \`${o}\` | ${i} | ${n} | ${s} |`}),""].join(`
34
- `)}(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]="4c9a1aa8-05b6-53da-a8b1-f1a7289d39cf")}catch{}})();function WD(e){return e}function YD(e){return e}function XD(e){return e}function JD(e){return e}function ZD(e){return e}function QD(e){return e}function e1(e){return e}function t1(e){return e}function r1(e){return e}function o1(e){return e}function n1(e){return e}function i1(e){return e}function s1(e){return e}function a1(e){return{handled:!0,result:e}}function d1(){return{handled:!1}}function c1(e){return e}function l1(e){return e}function p1(e){return e}function u1(e){return e}function m1(e){return e}function f1(e){return e}function _1(e){return e}function h1(e){return e}function g1(e){return 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]="68ca9ab1-91e0-5020-859e-fc1f1f6dcc56")}catch{}})();function Vb(e={},t={}){return new ge(t).extension(void 0,{...e,migrate:!0})}function Kb(e={},t={}){return new ge(t).packageMigrate(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]="d0b86c6a-67f0-52f2-90b8-d1058e8f2284")}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]="604d7dcb-9fea-5631-8a72-b2a7ff3278f8")}catch{}})();function N(e){if(typeof e!="string"||!_e(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function Wb(e){let t=N(e.window_start),r=N(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(o=>typeof o!="string"||o.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function Yb(e,t,r,o){let n=new Map(t.map(i=>[i,[]])),s=new Set;for(let i of e){if(typeof i.id!="string"||i.id.trim().length===0||s.has(i.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");s.add(i.id);let a=n.get(i.family);if(!a||!["success","failure","pending"].includes(i.outcome)||i.cause!==void 0&&(!["product","infrastructure","unknown"].includes(i.cause)||i.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let d=N(i.started_at);if(i.repaired_at!==void 0&&(N(i.repaired_at)<d||i.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");d>=r&&d<o&&a.push(i)}return n}function L1(e,t){let{start:r,end:o}=Wb(t),n=[...Yb(e,t.families,r,o)].map(([s,i])=>{let a=i.filter(_=>_.outcome==="failure"),d=i.filter(_=>_.outcome!=="pending").length,c=d===0?null:a.length/d,l=a.filter(_=>_.repaired_at!==void 0&&N(_.repaired_at)<o),p={product:0,infrastructure:0,unknown:0};for(let _ of a)p[_.cause??"unknown"]+=1;let f=[];return d<t.min_completed_attempts&&f.push("insufficient_completed_attempts"),c!==null&&c>t.max_failure_rate&&f.push("failure_rate"),{family:s,attempts:i.length,completed:d,failed:a.length,pending:i.length-d,failure_rate:c,affected_days:[...new Set(a.map(_=>new Date(N(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(N(_.repaired_at)-N(_.started_at))/6e4).sort((_,g)=>_-g),unresolved:a.length-l.length,causes:p,violations:f,ok:f.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(o).toISOString(),ok:n.every(s=>s.ok),families: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]="773ad2b6-326e-5483-bdce-a377f935cb31")}catch{}})();function pe(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function Xb(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!pe(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let o=new Set(r.identities);if(o.size!==r.identities.length||[...o].some(n=>!pe(n)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,o)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function Jb(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let o of e){if(o===null||typeof o!="object"||!pe(o.identity)||r.has(o.identity)||!pe(o.reason)||!pe(o.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let n=o.missing_from;if(!Array.isArray(n)||n.length===0||n.length>=t.length||new Set(n).size!==n.length||[...n].some(s=>!t.includes(s)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(o.identity,o)}return r}function $1(e,t=[]){let r=Xb(e),o=[...r.keys()].sort(),n=Jb(t,o),s=[...new Set([...r.values()].flatMap(c=>[...c]))].sort(),i=[],a=new Set;for(let c of s){let l=o.filter(_=>!r.get(_).has(c));if(l.length===0)continue;let p=n.get(c),f=p!==void 0&&JSON.stringify([...p.missing_from].sort())===JSON.stringify(l);f&&a.add(c),i.push({identity:c,present_in:o.filter(_=>r.get(_).has(c)),missing_from:l,disposition:f?{reason:p.reason,evidence:p.evidence}:null})}let d=[...n.keys()].filter(c=>!a.has(c)).sort();return{schema:"pm-artifact-ledgers/1",ok:i.every(c=>c.disposition!==null)&&d.length===0,counts:Object.fromEntries(o.map(c=>[c,r.get(c).size])),findings:i,stale_exceptions:d}}(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]="fca4e9bb-3a30-512e-9929-565ab6c11c54")}catch{}})();import{createHash as ho,createHmac as Zb,randomBytes as Qb,timingSafeEqual as eT}from"node:crypto";(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]="98283845-5c48-5901-b54c-c8cc8138427b")}catch{}})();var T$="dev.unbrained.pm/progressive-tool-discovery",C$=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),tT=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),B=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),rT=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),go={core:0,standard:1,full:2,internal:3},yo=Object.freeze(["core","standard","full"]),oT=new Set(["core","standard","full","custom"]),bo=new Set(te.map(({family:e})=>e)),nT=Qb(32);function xe(e,t){if(typeof e!="string")throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),o=0;for(let n=r.next();!n.done;n=r.next())if(o+=1,o>4096)throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function To(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new b("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function Co(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new b("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function Eo(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function So(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function iT(e){if(!Array.isArray(e))throw new b("pm tool discovery candidates must be an array.",64);for(let[t,r]of e.entries()){if(r===null||typeof r!="object"||Array.isArray(r))throw new b(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new b(`pm tool discovery candidate ${t} name must be a non-empty string.`,64);if(typeof r.description!="string"||r.description.trim().length===0)throw new b(`pm tool discovery candidate ${t} description must be a non-empty string.`,64);if(r.inputSchema===null||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new b(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new b(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function E$(e){if(So(e),e.family!==void 0&&(typeof e.family!="string"||!bo.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!yo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:xe(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:To(e.limit)}:{},...e.cursor!==void 0?{cursor:xe(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:Eo(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:Co(e.outputBudget)}:{}}}function sT(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function ue(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function aT(e,t){let r=ue(e);if(r.length===0)return 0;let o=new Set(ue(t)),n=r.filter(i=>o.has(i)).length,s=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+s)}function dT(e,t){let r=ue(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=ue(t),s=r.filter(a=>n.some(d=>d.startsWith(a)||a.startsWith(d))).length,i=o.includes(e.toLowerCase())?.2:0;return Math.min(1,s/r.length+i)}function _o(e){return ho("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function wo(e,t,r){return Zb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function cT(e,t,r){let o={version:1,offset:t,signature:wo(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function lT(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8")),s=n.offset;if(n.version!==1||typeof s!="number"||!Number.isInteger(s)||s<0||s>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(wo(t,s,o),"base64url"),a=Buffer.from(n.signature,"base64url");if(a.length!==i.length||!eT(a,i))throw new Error("cursor signature does not match the request");return s}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function gt(e,t,r){return{value:sT(e),weight:t,available:r!=="unavailable",source:r}}function ke(e,t,r){return gt(e??t,r,e===void 0?"computed":"host")}function pT(e,t,r){let o=Object.hasOwn(he,e.name)?he[e.name]:"help",n=Ve(o),s=`${e.name} ${e.description} ${o} ${n}`,i=aT(t,s),a=new Set(ue(t)),d={lexical:gt(i,B.lexical,"computed"),semantic:ke(e.signals?.semantic,dT(t,s),B.semantic),graph:ke(e.signals?.graph,a.has(n)||a.has(o)?1:0,B.graph),permission:gt(1,B.permission,"authorization"),freshness:ke(e.signals?.freshness,1,B.freshness),usage:ke(e.signals?.usage,tT.includes(e.name)?1:0,B.usage)},c=Object.values(d).reduce((l,p)=>l+p.value*p.weight,0);return{name:e.name,description:e.description,command:o,tier:Ke(o),family:n,score:Number(c.toFixed(6)),signals:d,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function uT(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new b("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!yo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!bo.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!oT.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function mT(e){let t=xe(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");xe(e.cursor===void 0?"":e.cursor,"cursor");let r=To(e.limit===void 0?10:e.limit),o=Co(e.outputBudget===void 0?1200:e.outputBudget);return uT(e),{query:t,includeSchema:Eo(e.includeSchema),limit:r,budget:o,maximumTier:go[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Ao(e,t,r){let o=r??e.tools.reduce((i,a,d)=>i+(d===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},s=0;for(let i=0;i<4;i+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:s,budget:t,within_budget:!0}}),"utf8"),d=Math.ceil((a+o)/4);if(d===s)break;s=d}return s}function fT(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>pT(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&go[o.tier]<=r.maximumTier&&(t.family===void 0||o.family===t.family)).sort((o,n)=>n.score-o.score||(o.name<n.name?-1:o.name>n.name?1:0))}function _T(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[s,i]of e.entries()){let a=n+(s===0?0:1)+Buffer.byteLength(JSON.stringify(i),"utf8");if(Ao(r(s+1),t,a)>t)break;o.push(i),n=a}return o}function S$(e,t={}){iT(e),So(t);let r=mT(t),o=t.cursorIntegrityKey??nT,n=fT(e,t,r),s=_o({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),i=lT(t.cursor,s,n.length,o),a=n.slice(i,i+r.limit),d=[];r.includeSchema||d.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),i+r.limit<n.length&&d.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let c={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:n.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:B},cache:{key:_o({fingerprint:s,cursorIntegrityKey:ho("sha256").update(o).digest("hex"),limit:r.limit,offset:i,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:rT}},l=(g,T=g.length)=>{let E=i+T,q=E<n.length,R=[...d];return T<a.length&&R.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...c,tools:[...g],returned:T,has_more:q,...q?{next_cursor:cT(s,E,o)}:{},omission_receipt:{has_omissions:R.length>0,omitted:R}}},p=g=>{let T=l(g),E=Ao(T,r.budget);return{...T,token_cost:{estimated_tokens:E,budget:r.budget,within_budget:r.budget==="unbounded"||E<=r.budget}}},f=_T(a,r.budget,g=>l([],g)),_=p(f);if(a.length>0&&f.length===0){let g=p([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${g}.`,64,{required:String(g)})}if(r.budget!=="unbounded"&&_.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${_.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(_.token_cost.estimated_tokens)});return _}(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]="39336651-18af-56d7-b658-5e735a2adad5")}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]="e8053a05-36e4-58a6-ad9c-6d03ef7435db")}catch{}})();export{IO as ACTIONABILITY_ORDERING_KINDS,Fd as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,ad as ACTIVITY_FLAG_CONTRACTS,ei as AGENT_PROVENANCE_DIMENSIONS,Hs as AGGREGATE_FLAG_CONTRACTS,Ma as APPEND_FLAG_CONTRACTS,nM as ASSURANCE_ACTIONS,iM as ASSURANCE_DECLARATION_KINDS,gI as ASSURANCE_DOCUMENT_VERSION,Ja as ASSURANCE_FLAG_CONTRACTS,yI as ASSURANCE_GATE_TRIGGERS,bI as ASSURANCE_MEASUREMENT_SOURCE_KINDS,lP as ASSURANCE_PRESET_IDS,mI as AssuranceEvaluationRefusalError,uI as AssuranceMutationRefusalError,fI as AssuranceSourceResolutionError,Gn as BASELINE_ITEM_FORMAT_VERSION,Jy as BOUNDARY_FIXTURE_CAPTURE_SOURCES,Lw as BRIEF_LIST_FIELDS,ri as BUILTIN_AGENT_PROVENANCE_ADAPTERS,Y as BUILTIN_CORPUS_SHAPES,ti as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,cn as BUILTIN_ITEM_TYPE_VALUES,zt as BUILTIN_PROFILES,OC as BUILTIN_RELATIONSHIP_KINDS,Ld as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,sd as CALENDAR_FLAG_CONTRACTS,ka as CLAIM_FLAG_CONTRACTS,Tc as CLOSE_ACTION_OPTION_KEYS,Ia as CLOSE_FLAG_CONTRACTS,Pa as CLOSE_MANY_FLAG_CONTRACTS,Fa as CLOSE_TASK_FLAG_CONTRACTS,Vs as COMMENTS_FLAG_CONTRACTS,ZT as COMMON_MUTATION_COMMAND_OPTION_KEYS,bd as COMPLETION_FLAG_CONTRACTS,_n as CONFIDENCE_TEXT_VALUES,aa as CONFIG_FLAG_CONTRACTS,Dd as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,qM as CONTEXT_EVALUATION_METRIC_NAMES,cd as CONTEXT_FLAG_CONTRACTS,Tw as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,jt as CONTEXT_OUTPUT_VALUES,WM as CONTEXT_PACKING_PROFILES,LM as CONTEXT_RECENCY_EPOCH,GM as CONTEXT_RELEVANCE_SERVICE,$M as CONTEXT_RELEVANCE_SIGNAL_NAMES,JM as CONTEXT_SIGNAL_SET_VERSION,XM as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,ZM as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,cw as CONTEXT_USAGE_LIMITS,yd as CONTRACTS_FLAG_CONTRACTS,rd as COPY_FLAG_CONTRACTS,Kd as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Yd as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Wd as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,TT as CREATE_DIRECT_CLOSE_REASON_DEFAULT,Za as CREATE_FLAG_CONTRACTS,kE as CURRENT_HISTORY_HASH_ALGORITHM,Yw as CURRENT_HISTORY_ITEM_HASH_VERSION,Jw as CURRENT_HISTORY_RECORD_HASH_VERSION,Un as CURRENT_ITEM_FORMAT_VERSION,r0 as ContextSignalStore,lw as ContextUsageValidationError,RM as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,b0 as DEFAULT_CHILD_SAMPLE_LIMIT,Nw as DEFAULT_COMPACT_LIST_FIELDS,Tv as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,af as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,sP as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,bM as DEFAULT_TERMINAL_TRANSITION_POLICY,s0 as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,bR as DEFECT_ESCAPE_CLASSES,TR as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Na as DELETE_FLAG_CONTRACTS,un as DEPENDENCY_KIND_VALUES,ud as DEPS_FLAG_CONTRACTS,Xs as DOCS_FLAG_CONTRACTS,Wa as DUPLICATES_FLAG_CONTRACTS,DP as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,wR as DefectRecurrencePolicyParseError,fd as EVAL_FLAG_CONTRACTS,Qm as EVAL_METRIC_NAMES,of as EVAL_QUERY_SET_CONTRACT,nf as EVAL_QUERY_SET_EXAMPLE,rf as EVAL_QUERY_SET_SCHEMA_ID,dd as EVENTS_FLAG_CONTRACTS,Ua as EVENT_FLAG_CONTRACTS,Lo as EXECUTABLE_COMMAND_ALIASES,me as EXIT_CODE,ya as EXTENSION_ACTIVATE_FLAG_CONTRACTS,ga as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Aa as EXTENSION_ADOPT_FLAG_CONTRACTS,X0 as EXTENSION_CAPABILITIES,yT as EXTENSION_CAPABILITY_CONTRACT,hT as EXTENSION_CAPABILITY_CONTRACT_VERSION,gT as EXTENSION_CAPABILITY_LEGACY_ALIASES,Mn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,wa as EXTENSION_CATALOG_FLAG_CONTRACTS,ba as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,ha as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Sa as EXTENSION_DOCTOR_FLAG_CONTRACTS,_a as EXTENSION_EXPLORE_FLAG_CONTRACTS,da as EXTENSION_FLAG_CONTRACTS,la as EXTENSION_INIT_FLAG_CONTRACTS,ma as EXTENSION_INSTALL_FLAG_CONTRACTS,Ca as EXTENSION_MANAGE_FLAG_CONTRACTS,Ta as EXTENSION_MIGRATE_FLAG_CONTRACTS,J0 as EXTENSION_POLICY_MODES,Z0 as EXTENSION_POLICY_SURFACES,Ea as EXTENSION_RELOAD_FLAG_CONTRACTS,ek as EXTENSION_SANDBOX_PROFILES,ca as EXTENSION_SCOPE_FLAG_CONTRACTS,Q0 as EXTENSION_TRUST_MODES,fa as EXTENSION_UNINSTALL_FLAG_CONTRACTS,DR as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,NR as EXTERNAL_DEPENDENCY_SOURCE_KIND,LR as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,Xv as ExtensionCommandError,Ys as FILES_FLAG_CONTRACTS,od as FOCUS_FLAG_CONTRACTS,Va as GC_FLAG_CONTRACTS,Gw as GET_DEPTH_INPUT_VALUES,Fw as GET_DEPTH_VALUES,ld as GET_FLAG_CONTRACTS,qs as GLOBAL_FLAG_CONTRACTS,jp as GRAPH_DURABLE_CACHE_MIN_ITEMS,Up as GRAPH_DURABLE_CACHE_VERSION,md as GRAPH_FLAG_CONTRACTS,iR as GRAPH_QUERY_DEFAULTS,De as GRAPH_SUBCOMMAND_VALUES,pd as GUIDE_FLAG_CONTRACTS,Ya as HEALTH_FLAG_CONTRACTS,ta as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,rP as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,lM as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,ra as HISTORY_COMPACT_FLAG_CONTRACTS,hi as HISTORY_EVENT_CLASSIFICATION_VERSION,Js as HISTORY_FLAG_CONTRACTS,PE as HISTORY_HASH_ALGORITHMS,cv as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,Qs as HISTORY_REDACT_FLAG_CONTRACTS,ea as HISTORY_REPAIR_FLAG_CONTRACTS,yl as INIT_AGENT_GUIDANCE_MODE_VALUES,sa as INIT_FLAG_CONTRACTS,va as INSTALL_FLAG_CONTRACTS,fn as ISSUE_SEVERITY_VALUES,ed as ITEM_COMPLETE_FLAG_CONTRACTS,OP as ITEM_LATEST_TIMESTAMP_FIELDS,bT as ITEM_METADATA_KEY_ORDER,Qa as ITEM_MUTATE_FLAG_CONTRACTS,td as ITEM_REOPEN_FLAG_CONTRACTS,vs as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,As as ITEM_REVISION_CONFLICT_CODE,TP as ITEM_SCALAR_MISSING_VALUE,ln as ITEM_TYPE_VALUES,vP as ITEM_UNION_COLLECTION_FIELDS,t0 as JsonFileContextSignalStoreAdapter,Ws as LEARNINGS_FLAG_CONTRACTS,ME as LEGACY_HISTORY_HASH_ALGORITHM,Au as LINKED_TEST_ENV_NAME_PATTERN,vu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,wu as LINKED_TEST_PROTECTED_ENV_KEYS,Ou as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,xd as LIST_COMMANDER_STRING_OPTION_CONTRACTS,Dw as LIST_COMMAND_DEFAULT_PROJECTIONS,rk as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,zs as LIST_FILTER_FLAG_CONTRACTS,zR as LIST_SORT_FIELDS,HR as LIST_SORT_ORDER_VALUES,gi as MAINTENANCE_HISTORY_OPERATIONS,y0 as MAX_CHILD_PROJECTION_ITEMS,vT as MAX_WORKFLOW_POLICIES,OT as MAX_WORKFLOW_POLICY_TERMS,Ga as MEET_FLAG_CONTRACTS,G0 as MERGE_DRIVER_ARTIFACT_VALUES,Zs as MERGE_FLAG_CONTRACTS,$e as MERGE_SUBCOMMAND_VALUES,B0 as MUTATION_EVENT_WIRE_BUDGET,se as MemoryRelationshipGraphAdapter,$d as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,hd as NEXT_FLAG_CONTRACTS,Sm as NEXT_OUTPUT_VALUES,OM as NEXT_RANKING_POLICIES,Ks as NOTES_FLAG_CONTRACTS,HO as OutputEnvelopeFitError,pa as PACKAGE_FLAG_CONTRACTS,ua as PACKAGE_INIT_FLAG_CONTRACTS,$a as PAUSE_TASK_FLAG_CONTRACTS,bc as PLAN_CREATE_METADATA_PARAMETER_KEYS,ia as PLAN_FLAG_CONTRACTS,Ui as PLAN_SHOW_DEPTH_VALUES,Ye as PLAN_SUBCOMMANDS,km as PLAN_TEMPLATE_NAMES,db as PM_AGENT_TASK_ACCOUNTING_MODES,ut as PM_AGENT_TASK_TRANSCRIPT_VERSION,Mo as PM_BULK_LIFECYCLE_COMMAND_ALIASES,ts as PM_CLI_ERROR_DETAILS_LIMITS,as as PM_CLI_EXPECTED_ERROR_NAME,pR as PM_CLI_GRAMMAR_CONTRACT,sR as PM_CLI_GRAMMAR_NOUNS,Wo as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,aR as PM_CLI_SHARED_VERBS,No as PM_COMMAND_ALIAS_CONTRACTS,te as PM_COMMAND_CAPABILITY_CONTRACTS,It as PM_COMMAND_DESTINATION_CONTRACTS,aI as PM_COMMAND_EXIT_CONTRACTS,sI as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Ri as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,oI as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,qe as PM_COMMAND_POSITIONAL_CONTRACTS,jc as PM_COMMAND_VISIBILITY_CONTRACTS,XI as PM_COMPLETE_LIST_FINDING_CODES,$O as PM_CONTEXT_INTENTS_FILE,Cw as PM_CONTEXT_INTENT_CONTRACTS,Po as PM_CONTEXT_OPS_COMMAND_ALIASES,zo as PM_CORE_COMMAND_NAMES,G as PM_CORPUS_SHAPE_SCHEMA,Xo as PM_DEPRECATED_TOOL_ACTIONS,Si as PM_DIAGNOSTIC_DEGRADATION_STEPS,wi as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Ei as PM_DIAGNOSTIC_OUTPUT_CLASSES,Jo as PM_DISCOVERABLE_TOOL_ACTIONS,Kr as PM_EPISODE_SCHEMA,tI as PM_ERROR_CODE_CATALOG,JR as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,Qr as PM_EXACT_COVERAGE_METRICS,Fo as PM_EXTENSION_CAPABILITY_CONTRACTS,Ho as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,Uo as PM_EXTENSION_POLICY_MODE_CONTRACTS,qo as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,Bo as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Go as PM_EXTENSION_SERVICE_NAME_CONTRACTS,jo as PM_EXTENSION_TRUST_MODE_CONTRACTS,Ni as PM_GENERIC_REFUSAL_GUIDANCE,jI as PM_GITATTRIBUTES_END,UI as PM_GITATTRIBUTES_START,qI as PM_GITATTRIBUTES_V2_END,BI as PM_GITATTRIBUTES_V2_START,Yc as PM_GITIGNORE_END,Wc as PM_GITIGNORE_START,fM as PM_HISTORY_ATTESTATION_CONTRACT,Io as PM_HISTORY_COMMAND_ALIASES,WE as PM_HISTORY_OPERATION_ALIASES,XE as PM_HISTORY_OPERATION_CONTRACT,YE as PM_HISTORY_OPERATION_PATTERNS,Ko as PM_ITEM_ACTION_SUBCOMMANDS,VE as PM_ITEM_HISTORY_OPERATIONS,it as PM_MCP_APPS_EXTENSION,Pr as PM_MCP_APPS_SERVER_CAPABILITY,Ae as PM_MCP_APPS_SPEC_VERSION,xr as PM_MCP_APP_CONTRACTS,kr as PM_MCP_APP_MIME_TYPE,tT as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,gN as PM_MCP_HTTP_PROTOCOL_VERSION,bg as PM_MCP_INPUT_REQUEST_METHODS,rr as PM_MCP_LEGACY_PROTOCOL_VERSIONS,tr as PM_MCP_LOG_LEVELS,w as PM_MCP_META_KEYS,T$ as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,C$ as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,Vc as PM_MCP_PROMPT_CONTRACTS,H as PM_MCP_PROTOCOL_VERSION,Hc as PM_MCP_RESOURCE_CONTRACTS,at as PM_MCP_SKILLS_DRAFT_REVISION,Nr as PM_MCP_SKILLS_EXTENSION,Ay as PM_MCP_SKILLS_SERVER_CAPABILITY,P as PM_MCP_SKILL_LIMITS,Se as PM_MCP_SUBSCRIPTION_ID_META_KEY,re as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,cN as PM_MCP_TASKS_EXTENSION,Pg as PM_MCP_TASK_STATUSES,he as PM_MCP_TOOL_COMMAND_CONTRACTS,cS as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,ps as PM_MUTATION_ACTION_CONTRACTS,Ne as PM_NAMESPACED_COMMAND_ALIASES,Hr as PM_OBSERVATION_SCHEMA,Ci as PM_OUTPUT_BUDGET_CLASSES,Ti as PM_OUTPUT_DEGRADATION_STEPS,kt as PM_OUTPUT_ENVELOPE_KINDS,$t as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Vo as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Dt as PM_PACKAGE_RESOURCE_KINDS,Be as PM_POSITIONAL_ACTION_CONTRACTS,Oc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Ac as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,FS as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,XS as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,DS as PM_READ_OUTPUT_DIMENSIONS,$S as PM_READ_OUTPUT_OPTION_FLAGS,MS as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,PS as PM_READ_OUTPUT_SESSION_MIN_TOKENS,GC as PM_READ_OUTPUT_SURFACES,GS as PM_READ_OUTPUT_SURFACE_CONTRACTS,dS as PM_READ_ROW_CONTRACTS,aS as PM_READ_ROW_JQ_SELECTOR,Fi as PM_RECOVERY_ECHO_FIELDS,lD as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,kb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,lo as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,gD as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,co as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,ko as PM_RELOCATED_COMMAND_ALIASES,qd as PM_REPRODUCIBLE_PROCESS_ENV,dI as PM_SUCCESS_EXIT_CODES,Yo as PM_TOOL_ACTIONS,Cc as PM_TOOL_ACTION_PARAMETER_CONTRACTS,vc as PM_TOOL_PARAMETERS_SCHEMA,wc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Sc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,gc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Vr as PM_VERDICT_SCHEMA,KE as PM_WORKSPACE_HISTORY_OPERATIONS,qr as PM_WORKSPACE_RECIPE_SCHEMA,na as PROFILE_FLAG_CONTRACTS,Jt as PROFILE_LINT_CODES,Xt as PROFILE_LINT_DIMENSIONS,qt as PROFILE_NAMES,Xe as PROFILE_SUBCOMMANDS,b as PmCliError,ge as PmClient,JI as PmCompleteListValidationError,y as PmMcpAuthorizationError,or as PmMcpInputRequiredError,Ar as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,nr as PmMcpRequestStateReplayGuard,Ur as PmMcpSkillRegistry,_r as PmMcpSubscriptionRegistry,ot as PmMcpTaskStore,dw as QUERY_CURSOR_CONTRACT,Ra as REINDEX_FLAG_CONTRACTS,tv as REINDEX_LOCK_ID,pt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,La as RELEASE_FLAG_CONTRACTS,ja as REMIND_FLAG_CONTRACTS,At as RESERVED_ITEM_FIELD_NAMES,xa as RESTORE_FLAG_CONTRACTS,mn as RISK_VALUES,KO as RelationshipEventLog,WO as RelationshipEventStore,z as RelationshipGraph,Ue as RelationshipKindRegistry,oa as SCHEMA_FLAG_CONTRACTS,Nd as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,ok as SEARCH_EXTENSION_FLAG_DEFINITIONS,gd as SEARCH_FLAG_CONTRACTS,Hu as SEMANTIC_ATTRIBUTION_LIMITS,ET as SETTINGS_DEFAULTS,uf as SNAPSHOT_SCHEMA,$I as SOURCE_CONTEXT_ACCESS_ENV,FI as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Xu as START_BLOCKED_REFUSAL_CODE,Yu as START_BLOCKER_ENFORCEMENT_DEFAULT,Da as START_TASK_FLAG_CONTRACTS,Ka as STATS_FLAG_CONTRACTS,pn as STATUS_VALUES,Bs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,yi as SUBSTANTIVE_HISTORY_OPERATIONS,Xw as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Zw as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,xC as SUPPRESS_HOST_OUTPUT_MARKER,za as TELEMETRY_FLAG_CONTRACTS,Uf as TELEMETRY_SUBCOMMANDS,qa as TEST_ALL_FLAG_CONTRACTS,Ba as TEST_FLAG_CONTRACTS,Ha as TEST_RUNS_FLAG_CONTRACTS,Lf as TEST_RUN_MEASUREMENT_LIMIT,mc as TOOL_ACTIVITY_OPTION_CONTRACTS,tc as TOOL_AGGREGATE_OPTION_CONTRACTS,cc as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,uc as TOOL_CALENDAR_OPTION_CONTRACTS,pc as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,fc as TOOL_CONTEXT_OPTION_CONTRACTS,sc as TOOL_CREATE_OPTION_CONTRACTS,ic as TOOL_CREATE_OPTION_CONTRACT_SOURCE,_c as TOOL_DEPS_OPTION_CONTRACTS,hc as TOOL_GRAPH_OPTION_CONTRACTS,ec as TOOL_LIST_FILTER_OPTION_CONTRACTS,rc as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,nc as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,oc as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,lc as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,dc as TOOL_UPDATE_OPTION_CONTRACTS,ac as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,CT as TYPE_TO_FOLDER,AC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Xd as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Zd as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Jd as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,nd as UPDATE_FLAG_CONTRACTS,id as UPDATE_MANY_FLAG_CONTRACTS,Oa as UPGRADE_FLAG_CONTRACTS,Xa as VALIDATE_FLAG_CONTRACTS,AT as WORKFLOW_POLICY_ACTIONS,VI as WORKFLOW_POLICY_DOCUMENT_SCHEMA,HI as WORKFLOW_POLICY_SCHEMA,_d as WORKSPACE_FLAG_CONTRACTS,TA as WORKSPACE_HISTORY_ID,mf as WORKSPACE_SNAPSHOT_ACTIONS,zl as WorkspaceGraphCache,QO as WorkspaceTransactionInterruptedError,_u as _testOnly,g0 as _testOnlyAggregateCommand,Bl as _testOnlyConfigCommand,S0 as _testOnlyGetCommand,tu as _testOnlyHealthCommand,El as _testOnlyInit,bl as _testOnlyInitAgentGuidance,yk as _testOnlyItemTransaction,V0 as _testOnlyMutationEvents,f0 as _testOnlyNextCommand,F0 as _testOnlySearchCommand,dP as _testOnlySimilarity,$m as _testOnlyTemplates,uu as _testOnlyValidateCommand,Y0 as _testOnlyWorkspacePosition,Tk as abandonItemTransaction,nR as abandonWorkspaceTransaction,fP as acceptAssuranceProposals,lu as acknowledgeLinkedTests,Gl as acknowledgeUnknownAuthorHistoryEvents,Fl as acknowledgeUnknownAuthorHistoryEventsFromTransport,Cv as acquireItemMetadataDerivedIndexLock,je as acquireLock,Qn as acquireLockLease,Qk as activateExtensionForTest,JC as activateExtensions,Zu as admitStartWithOpenBlockers,Zn as agentSessionEnvironment,j_ as aggregate,wf as analyzeAgentProvenanceDescriptorCoverage,ER as analyzeDefectChangeRisk,oM as analyzeDefectRecurrenceCoverage,mp as analyzeDuplicateItems,XO as analyzeGraphImpact,Mc as analyzeHierarchyIntegrity,JO as analyzeKnowledgeGraph,lI as analyzePmCommandExitConformance,Zo as analyzePmToolActionParity,zP as analyzeReconciliationDiscard,YO as analyzeRelationshipExecution,kp as analyzeRelationshipSchedule,pg as analyzeSdkActionCoverage,Pt as analyzeSdkCliParameterCompleteness,Q_ as append,Bi as appendHistoryEntry,wA as appendWorkspaceAuditEvent,SA as appendWorkspaceHistoryChange,FT as applyAcceptanceCriteriaMutations,uP as applyAssurancePreset,vd as applyBootstrapPagerPolicy,ZP as applyClosureTimestampFix,vw as applyContextIntentProjection,Em as applyContextTagProjection,VR as applyFilterValueEcho,iv as applyHistoryPatch,Bd as applyInvocationAuthorOverride,Ql as applyPathMigrations,KS as applyReadOutputDimensions,qS as applyReadOutputIncludeModes,xS as applyReadOutputSessionReferences,SE as applyRegisteredItemFieldDefaultsAndValidation,op as applyStandaloneNote,$s as applyStoredExtensionMigrationState,UT as applyTagRemovals,SM as applyTerminalOrderingPolicy,np as artifactKey,mC as asRecordClone,uC as asRecordOrNull,He as assembleWorkspaceRelationshipGraph,tP as assertCompleteListResult,xx as assertExtensionBlueprint,kx as assertExtensionCapabilityUsage,fx as assertExtensionDeactivated,Dx as assertExtensionManifestCompatible,Lx as assertExtensionManifestMatchesBlueprint,$x as assertExtensionPreflight,Nc as assertHierarchyMutationAllowed,pM as assertHistoryCompactTarget,VP as assertHistoryRepairTarget,Xi as assertInitializedTracker,ep as assertLinkedArtifactMutationIsUnambiguous,Ux as assertMcpClientCapabilities,Gx as assertMcpProtocolHeader,ab as assertMemoryRelationshipGraphAdapterConformance,qT as assertNoUnknownCsvKeys,Su as assertNonHierarchyCardinalityMutationAllowed,_x as assertPackageManifest,xA as assertParentReferenceIsNotSelf,KN as assertPmMcpSkillsCapability,Nx as assertProjectProfile,hv as assertProjectRuntimeCompatibility,mv as assertProjectRuntimeFormatGuard,lS as assertProjectionModeChoice,Yi as assertReadableTrackerRoot,hx as assertRegisteredCommandContract,vx as assertRegisteredCommandOverride,Ex as assertRegisteredExporter,gx as assertRegisteredFlags,yx as assertRegisteredHook,Cx as assertRegisteredImporter,Sx as assertRegisteredItemField,wx as assertRegisteredItemType,Mx as assertRegisteredMigration,Ox as assertRegisteredParserOverride,Rx as assertRegisteredPreflightOverride,Ax as assertRegisteredProfile,Ix as assertRegisteredRendererOverride,bx as assertRegisteredSearchProvider,Px as assertRegisteredServiceOverride,Tx as assertRegisteredVectorStoreAdapter,MC as assertRelationshipEdgeAllowed,ro as assertRelationshipGraphAdapterConformance,DT as assertSchemaPreviewSupported,qf as assertTestMeasurementRun,zw as assertWellFormedOutputText,TI as assuranceAssertionUpdateIsLoosening,Iw as attachContextIntentReceipt,pw as attachContextUsageServingReceipt,su as attachLinkedTestMutationProvenance,iu as attachLinkedTestProvenance,Ze as attachMcpServerInfo,hS as attachOutputOmissionReceipt,Mw as attachOutputTokenAccounting,Pw as attachReadOutputContracts,NS as attachReadOutputSessionReceipt,rl as auditMergeAttributeFence,zI as auditMergeDriverConfiguration,Fp as auditWorkspaceRelationshipGraph,kN as authorizeMcpHttpRequest,Xn as boundAgentEpisodeIdentity,AS as boundReadOutputRows,ym as buildChildrenByParent,k0 as buildCompactSearchFilterSummary,KR as buildContentFilterEcho,e0 as buildContextSignalSnapshot,zy as buildCorpusShapeItemPlan,CR as buildDefectRecurrenceIndex,ul as buildExtensionDescribeResult,fl as buildExtensionInstallPlan,WR as buildGovernanceMissingFilterEcho,qA as buildInvalidTypeError,T0 as buildItemChildrenRollup,hk as buildItemCompletionMutations,FM as buildItemContextRelevanceCandidates,Ov as buildItemNotFoundError,E0 as buildItemSchedule,QP as buildLinkedFileRepairReport,SN as buildMcpAuthorizationDiscoveryUrls,_g as buildMcpCompleteResult,Bx as buildMcpDiscoverResult,RN as buildMcpDynamicRegistrationMetadata,_N as buildMcpHttpRequestHeaders,Xx as buildMcpInputRequiredResult,EN as buildMcpProtectedResourceMetadata,el as buildMergeAttributePatterns,Ec as buildPmActionToolInputSchema,TD as buildPmRefusalClosureCensus,aP as buildRelationshipContext,kv as buildSearchCorpus,Nv as buildSemanticCorpusInput,YP as buildStatusRoleWarnings,Wi as buildTrackerInitializationRecovery,Gv as buildVectorizationEmbeddingIdentity,Uv as buildVectorizationEmbeddingMetadata,x0 as buildVerboseSearchFilters,KI as buildWorkflowCompletenessCheck,a0 as buildWorkspaceMemorySnapshot,Yn as canonicalDocument,QT as canonicalizeCommandOptionKey,xk as canonicalizeCommandSuggestions,DM as canonicalizeContextRecencyCoordinate,RC as canonicalizeRelationshipKind,pD as censusPmRecoveryReferenceProducers,eP as certifyCompleteListResult,Yk as checkExtensionManifestCompatibility,Dh as claim,$h as claimNext,oP as classifyHistoryAuthorEvent,bi as classifyHistoryEvent,BP as classifyHistoryMergeReceiptReferences,qC as classifyHostEnvironmentFault,L0 as classifyImplicitSemanticFallbackReason,qn as classifyItemFormatVersion,Hf as classifyLinkedTestCommandSafety,Vf as classifyLinkedTestFailure,fE as clearActiveExtensionHooks,Vp as clearDurableGraphCache,rS as clearFocusedItem,Qf as clearWorkspaceContractsCache,Lh as close,yu as closeItem,Hh as closeTask,Id as coalesceRepeatedListFlags,PO as collectBlockedByIds,kO as collectBlockedByIdsFromCorpus,mw as collectContextUsageDeliveredItemIds,Fc as collectDanglingDependencyReferences,NO as collectDependencyBlockedIds,Dc as collectDuplicateDependencyRows,$p as collectDuplicateRelationshipEdgeGroups,N0 as collectErrorCauseCodes,Pc as collectHierarchyRelations,Cr as collectMcpHeaderAnnotations,Gc as collectMissingDependencyTargetIds,Eu as collectNewOrderingCycleWarnings,Np as collectOrderingCycles,$c as collectOrderingStorageContradictions,UO as collectPackageContextIntentContracts,Gt as collectPackageExtensionDirectories,CE as collectRegisteredItemFieldNames,UE as collectRuntimeCreateFieldValues,zA as collectRuntimeFilterValues,jE as collectRuntimeUpdateFieldValues,mm as collectSubtreeIds,kn as collectUsedExtensionCapabilities,eC as commandOptionFlagLabel,z_ as comments,S_ as commitImportedItem,gk as commitItemCompletion,_k as commitItemMutations,tR as commitWorkspaceTransaction,js as compactFlagAliasContracts,fm as compareCriticalItems,lv as comparePmDateVersions,ZO as compareRelationshipSnapshots,fC as compareTimestampStrings,xM as compileHistoryProvenanceMatcher,ww as composeContextIntentContracts,Bk as composeExtension,Wk as composeExtensionPackage,DO as computeActionabilityReport,gA as computeHistoryDiff,Pp as computeRelationshipCentrality,Ip as computeRelationshipDominators,ql as computeWorkspaceGraphFingerprint,th as config,mE as consumeAfterCommandAffectedItems,L_ as context,Rw as contextIntentRowId,Gh as copy,Kf as countFailureCategories,SS as countReadOutputRows,kh as create,pP as createAssurancePreset,tM as createAssuranceWorkspaceContext,hC as createCheckpointId,ZI as createCompleteListOptions,ZC as createCoreCommandHookContext,Zr as createCorpusShapeMeasurement,AI as createEmptyAssuranceDocument,UC as createEmptyExtensionRegistrationRegistry,Jv as createExtensionCommandError,Ns as createExtensionCommandSdk,In as createExtensionContributionInventory,Fx as createExtensionTestHarness,ji as createHistoryEntry,uO as createLazyModule,WI as createLifecycleCompletenessPolicies,xN as createMcpStaticBearerVerifier,lN as createMcpTaskStore,vv as createMutationGuardSdk,pS as createOutputOmissionReceipt,cs as createPmCliExpectedError,xs as createPmCliProgram,vi as createPmCommandOutputBudget,tw as createQueryFingerprint,sb as createRelationshipGraphScaleFixture,Z as createRelationshipGraphSnapshot,wt as createRelationshipKindRegistry,Hd as createReproducibleProcessRunner,P0 as createSearchCursorFingerprint,QC as createSerialQueue,YT as createStdinTokenResolver,vC as createUnknownSubcommandError,LT as createWorkflowPolicyEvaluator,ff as createWorkspaceSnapshot,ex as deactivateExtensionForTest,d1 as declineServiceOverride,Ow as decodeContextIntentCursor,pO as decodeHtmlEntitiesInOptions,Tr as decodeMcpHttpHeaderValue,xw as decodePmTableRows,iw as decodeQueryCursor,ow as decodeQueryCursorEnvelope,nw as decodeQueryCursorState,QS as decodeReadOutputContinuationCursor,Jk as decodeToon,FN as decoratePmMcpToolsWithApps,sp as dedupeLinkedArtifacts,wE as defaultConfigScope,UM as defaultScoreContextCandidates,f1 as defineAfterCommandHook,u1 as defineBeforeCommandHook,m1 as defineBeforeMutationHook,XD as defineCommand,o1 as defineCommandOverride,W as defineCorpusShape,oL as defineEpisodeSpecification,p1 as defineExporter,Uk as defineExtension,jk as defineExtensionBlueprint,WD as defineExtensionManifest,JD as defineFlag,l1 as defineImporter,QD as defineItemField,ZD as defineItemType,e1 as defineMigration,Ny as defineObservationContract,g1 as defineOnIndexHook,h1 as defineOnReadHook,_1 as defineOnWriteHook,n1 as defineParserOverride,Oi as definePmCommandOutputBudget,rI as definePmCommandOutputEnvelope,ZR as definePmErrorCodeCatalog,i1 as definePreflightOverride,YD as defineProjectProfile,c1 as defineRendererOverride,t1 as defineSearchProvider,s1 as defineServiceOverride,r1 as defineVectorStoreAdapter,Fy as defineVerdictContract,ve as defineWorkspaceRecipe,Uh as deleteItem,Tf as deleteWorkspaceSnapshot,kC as dependencyToRelationship,J_ as deps,mP as deriveAssuranceProposals,XP as deriveClosureTimestamp,zk as deriveExtensionCapabilities,nk as deriveMutationTransactionId,pI as derivePmBulkMutationEffect,uD as derivePmRecoveryReferenceObligations,xp as deriveRelationshipDeadlines,sl as deriveSchemaEvolutionMigrationId,oO as deriveTelemetryCommandResolution,WA as describeAllowedTransitions,DI as describeExtensionActivation,Hk as describeExtensionBlueprint,SC as describeFlagScalarValueFailure,tm as describeItemOwnershipConflict,Ps as describeItemRevisionChanges,rL as describeObservationCost,Wt as describeProfileComposition,Yt as describeProjectProfile,Sk as describeReadCompletenessControls,Zv as describeUnknownError,ci as detectAgentIdentity,mi as detectHarnessIdentity,Op as detectRelationshipCommunities,li as diagnoseAgentIdentity,Gp as diffRelationshipAuditSnapshots,Ff as diffTestRunMeasurements,Qx as digestMcpRequestParameters,YC as discoverExtensions,yn as discoverNearbyPmRoot,S$ as discoverPmTools,uv as discoverProjectRuntimeVersionPins,X_ as docs,q_ as duplicates,Bp as durableGraphCachePath,Kp as durableGraphCacheStatus,jn as effectiveItemFormatVersion,wO as emitTelemetryErrorEvent,E_ as emptyImportedDocument,EP as encodeItemScalarDecisionValue,br as encodeMcpHttpHeaderValue,kw as encodePmTableRows,rw as encodeQueryCursor,ZS as encodeReadOutputContinuationCursor,Zk as encodeToon,yA as enforceHistoryStreamPolicyForItem,bA as enforceHistoryStreamPolicyForItems,YR as enrichCliFlagInvocationContract,Mt as enrichCliFlagInvocationContracts,av as ensureMaterializedHistoryTarget,Jc as ensurePmGitignore,Wl as ensureScope,Yv as ensureSentryCommandTracing,Wv as ensureSentryInit,C_ as ensureTrackerInitialized,Ap as enumerateRelationshipPaths,Pi as estimatePmOutputTokens,OI as evaluateAssuranceAssertion,RI as evaluateAssuranceGate,CL as evaluateBoundaryFixtures,zM as evaluateContextRanking,SR as evaluateDefectGateEvidence,vI as evaluateMeasurement,tf as evaluateMetricFloors,ms as evaluateMutationGuard,Pf as evaluateProvenanceCoverage,L1 as evaluateReliabilityWindow,Of as evaluateSemanticAttributionCoverage,_p as evaluateSimilarityGovernance,KA as evaluateTransition,Gy as evaluateVerdictContract,NT as evaluateWorkflowPolicies,es as executeEmbeddingBatchesWithRetry,$v as executeVectorDelete,Fv as executeVectorReset,Dv as executeVectorUpsert,Py as executeWorkspaceRecipe,rp as expandAddGlobEntries,gp as explainSourceTraceability,hM as exportAttestation,Vh as extension,Wh as extensionActivate,Yh as extensionDeactivate,Kh as extensionList,Vb as extensionMigrate,jP as extractHistoryMergeReceiptDispositions,UP as extractHistoryMergeReceiptReferences,IN as extractMcpTraceContext,ov as extractPatchFailureContext,ru as extractReferencedPmItemIdsFromCommand,ib as federateRelationshipGraphSnapshots,K_ as files,W_ as filesDiscover,Y_ as filesLookup,fw as finalizeContextUsageDelivery,Xy as findCoverageDeficits,fp as findDuplicateClusters,Qc as findGitWorkspaceRoot,LE as findHistoryIdentityDiscontinuities,ll as findInstalledNpmPackageCandidate,$N as findPmMcpAppByUri,xo as findPmNamespacedCommand,Rp as findRedundantRelationshipEdges,Mp as findRelationshipCutStructure,up as findSimilarItems,SO as finishTelemetryCommand,VO as fitOutputEnvelope,EC as flattenFlagListValue,Ky as flushTelemetryQueue,Bh as focus,vp as forEachMatchedRelationshipEdge,Dp as formatDuplicateEdgeGroup,kc as formatHierarchyRelation,Lp as formatOrderingStorageContradiction,lR as formatPmPositionalActionFlagTip,Ym as formatProfileApplyHuman,Wm as formatProfileLintHuman,Vm as formatProfileListHuman,Km as formatProfileShowHuman,cl as formatSchemaEvolutionMigrationHuman,$0 as formatVectorIndexRecoveryWarnings,W0 as formatWorkspacePositionHuman,vh as gc,Hi as generateItemId,G_ as get,lE as getActiveCommandResult,Ew as getActiveContextIntentContracts,Nn as getActiveExtensionRegistrations,MN as getActiveMcpTraceContext,PI as getAssuranceDeclaration,dg as getContracts,eS as getFocusedItem,Cn as getHistoryPath,zO as getItemAt,Tn as getItemPath,hs as getMutationActionContract,Xc as getPmGitignoreBlock,bn as getSettingsPath,e_ as getWorkspaceContracts,CA as getWorkspaceHistoryPath,Z_ as graph,qp as graphAuditBaselinePath,Rf as groupHistoryByEpisode,a1 as handleServiceOverride,jx as hasMcpClientExtension,DN as hasPmMcpAppsCapability,ze as hasSubcommandFlagContractsForCommand,jv as hasVectorizationEmbeddingIdentityChanged,Bv as hasVectorizationVectorDimensionChanged,sA as hashDocument,aA as hashDocumentForVersion,dA as hashEmptyDocument,eA as hashHistoryPatch,Qw as hashHistoryRecord,tA as hashHistoryStream,SP as hashItemScalarDecisionValue,Ah as health,Cp as hierarchyAncestors,Ep as hierarchyDescendants,Ph as historyCompact,Mh as historyCompactBulk,NE as historyDigest,kM as historyEntryMatchesProvenance,pv as historyItemHashVersionForRuntime,Oh as historyRedact,Rh as historyRepair,Ih as historyRepairAll,MO as indexBlockedByIds,xc as indexHierarchyRelations,qv as inferConsistentVectorDimension,Ai as inferPmOutputBudgetClass,eh as init,QI as inspectCompleteListResult,jC as inspectExtensionManifestSchema,xl as inspectHistoryAuthorStream,MP as inspectMergeReceiptEvidence,_v as inspectProjectRuntimeCompatibility,Es as inspectStaleInProgressItems,ug as inspectStaticExtensionInventory,WP as inspectStatusRoleAssignments,EA as inspectWorkspaceHistoryState,_f as inspectWorkspaceSnapshot,il as installMergeFence,qx as interpretMcpResultType,Am as isAlreadyClaimedError,tO as isCommanderError,vk as isCompatibleRecoveryFlag,Rl as isErrnoError,vO as isExternalDependencyReference,OO as isExternalDependencySourceKind,fe as isFileMissingError,Li as isGenericRefusalRequired,Di as isGenericRefusalWhy,LC as isHostOutputSuppressed,ds as isItemAlreadyExistsError,Ms as isItemRevisionConflict,CP as isItemScalarMissingValue,$P as isLegacyMergeReceiptSummary,h as isMcpRecord,fs as isMutationAction,PC as isOrderingRelationshipKind,MA as isPlaceholderReferenceToken,rs as isPmCliErrorDetails,ls as isPmCliExpectedError,en as isPmExtensionCapabilityContract,rn as isPmExtensionPolicyModeContract,on as isPmExtensionPolicySurfaceContract,tn as isPmExtensionServiceNameContract,cI as isPmKnownExitCode,nI as isPmMutationReceipt,We as isPmSuccessfulExitCode,ss as isPmTokenBudgetRecovery,Qo as isPmToolAction,FP as isPreDurableCloneLocalReceiptSummary,GP as isPreDurableDispositionEligibleReference,fv as isProjectMutatingInvocation,mO as isPureSnakeCaseAlias,WS as isReadOutputBudgetExceeded,IS as isReadOutputSessionReference,Ak as isReadProjectionRecoveryFlag,mS as isReadRowContract,Rc as isRuntimeRecord,JA as isSettingsReadFallback,Ju as isStartTransition,hO as isTerminalPlanMode,qE as isTerminalStatus,On as isTimestampLiteral,ck as itemDocumentToMutationOptions,C0 as itemHasSchedule,Pn as jaccardSimilarity,V_ as learnings,wC as levenshteinDistanceWithinLimit,Al as limitAnnotationEntries,au as linkedTestTrustFingerprint,Vk as lintExtensionBlueprint,BC as lintExtensionManifestSchema,Zt as lintProjectProfile,D_ as list,ni as listAgentProvenanceAdapters,Rd as listAliasPluralKeys,$_ as listAllComplete,wv as listAllDocumentCandidatesCached,Qi as listAllItemMetadata,Av as listAllItemMetadataLight,II as listAssuranceDeclarations,LI as listAssuranceVerdicts,By as listBuiltinCorpusShapes,Nk as listCoreClosedDomainContracts,Uw as listGetProjectionFields,yP as listInvalidProvenanceHistoryStreamIds,$w as listListProjectionFields,kP as listMergeReceipts,_s as listMutationActions,q0 as listMutationEvents,fo as listPmCommandFlagBudgets,qc as listPmCommandsForFamily,Bc as listPmCommandsForTier,Me as listPmFlagLexicon,zD as listPmFlagSpellingInventory,zc as listPmMcpToolsForProfile,xD as listPmRequiredArgumentRefusalContracts,ND as listPmSubcommandRefusalContracts,Kt as listProfiles,$D as listTrackerPreflightRecoveryContracts,uk as listUpsertKeyCandidates,hf as listWorkspaceSnapshots,jO as loadContextIntentRuntimeLayers,Fm as loadCreateTemplateOptions,XC as loadExtensions,Yp as loadGraphAuditBaseline,mk as loadGuardedRuntimeSchema,yC as loadMutationCheckpoint,x as loadRelationshipGraphAdapter,Ji as locateItem,BT as looksLikeGenericKeyValueEntry,wS as mapReadOutputRows,xP as markMergeReceiptReconciled,HA as matchesRuntimeFilters,CO as maybeRunFirstUseTelemetryPrompt,Hy as measureCorpusShapePlan,Ki as measureItemMetadataReadWork,GT as mergeAdditiveTags,qk as mergeExtensionBlueprints,wP as mergeHistoryStreams,RP as mergeItemDocuments,IP as mergeJsonDocuments,Pd as mergeLinkedTestTwoTokenEntries,AP as mergeRelationshipEventStreams,Tm as mergeSortedWarnings,_O as migrateItemFilesToFormat,Iv as mutateItem,Rv as mutateItemWithHistoryContext,AA as mutateWorkspaceJsonWithHistory,U_ as next,si as normalizeAgentProvenanceAdapterValue,wl as normalizeAnnotationTransportOptions,hI as normalizeAssuranceEvaluation,_I as normalizeAssuranceMutation,Md as normalizeBootstrapInvocation,RE as normalizeBulkIdsValue,Lc as normalizeDependencyGraphTarget,UR as normalizeDependencySeedId,GR as normalizeDependencySourceKind,Os as normalizeExpectedItemHash,Rn as normalizeExtensionContributionInventory,QE as normalizeHistoryOperationForWrite,gP as normalizeInvalidHistoryProvenance,yR as normalizeItemAddressInvocation,Bn as normalizeItemFormatVersion,zi as normalizeItemId,Vn as normalizeItemMetadata,jR as normalizeItemReference,Od as normalizeLegacyExtensionActionSyntax,tp as normalizeLinkedPath,PA as normalizeParentReferenceValue,Ht as normalizeProfileName,qi as normalizeRawItemId,zS as normalizeReadOutputIncludeModeOptions,uA as normalizeReplayPatchOps,gs as normalizeSimilarityText,BE as normalizeStatusForRegistry,Hn as normalizeStatusInput,$E as normalizeStatusInputWithRegistry,eO as normalizeThrownExitCode,H_ as notes,vn as nowIso,zp as openDurableGraphCache,Zx as openMcpRequestState,nL as openPmEpisode,Sp as orderingPredecessors,wp as orderingSuccessors,YM as packContextCandidates,_m as packRankedContextItems,ig as packageActivate,ng as packageCatalog,sg as packageDeactivate,rg as packageDescribe,eg as packageDoctor,Zh as packageInstall,Xh as packageLifecycle,Jh as packageList,tg as packageManage,Kb as packageMigrate,og as packageReload,Qh as packageUninstall,aw as paginateQueryRows,Yl as parseAddEntries,Xl as parseAddGlobEntries,Ol as parseAnnotationTextInput,ik as parseAtomicMutationControls,Ad as parseBootstrapCommandName,Ed as parseBootstrapGlobalOptions,wd as parseBootstrapHelpRequest,kd as parseBootstrapTypeValue,OE as parseBulkIdsText,pm as parseContextDepth,am as parseContextFocusFields,FO as parseContextIntentDeclarations,um as parseContextSections,QM as parseContextSignalSnapshot,jT as parseCsvKv,vR as parseDefectChangeRiskRequest,rM as parseDefectRecurrenceCoverageRequest,AR as parseDefectRecurrencePolicy,ef as parseEvalMetricFloors,sf as parseEvalQuerySet,Rs as parseExpectHashSpecs,dC as parseExtensionLongFlagToken,Zp as parseGraphSubcommand,_M as parseHistoryAttestation,PM as parseHistoryProvenanceFilters,OR as parseIntegerLimit,zE as parseItemDocument,sk as parseItemMutationBatch,BA as parseLimit,Du as parseLinkedTestAssertionEqualsMap,$u as parseLinkedTestAssertionGteMap,Pu as parseLinkedTestBoolean,Mu as parseLinkedTestContextMode,Iu as parseLinkedTestEnvClear,Ru as parseLinkedTestEnvSet,Fu as parseLinkedTestJsonEntries,Lu as parseLinkedTestMinLines,Nu as parseLinkedTestRegexList,xu as parseLinkedTestStringList,ku as parseLinkedTestWorkspaceContextMode,Eg as parseMcpCachePolicy,mg as parseMcpImplementation,tt as parseMcpInputRequests,dr as parseMcpInputResponses,Vg as parseMcpSubscriptionFilter,Zl as parseMigrateEntries,PR as parseMultiValueFilter,iI as parseMutationReceipt,JT as parseOptionalNonNegativeInteger,XT as parseOptionalNumber,nD as parsePmAgentTaskTranscriptCorpus,E$ as parsePmToolDiscoveryOptions,RR as parsePriority,xR as parsePriorityFilterSet,kS as parseReadOutputSession,EE as parseRegisteredItemFieldAssignments,ae as parseRelationshipGraphSnapshot,Jl as parseRemoveEntries,hp as parseSourceLineRange,FA as parseStatusFilterCsv,MR as parseStringFilterSet,nn as parseTags,Df as parseTestRunMeasurements,IR as parseType,kR as parseTypeFilterSet,$l as parseUnknownAuthorHistoryEventCoordinates,RT as parseWorkflowPolicy,IT as parseWorkflowPolicyDocument,_0 as partitionDecisionEntries,hA as patchPathToChangedField,sn as pathExists,zh as pauseTask,Hp as persistDurableGraphResult,XA as persistSelectedItemFormat,iP as planAgentIdentityVocabularyMutation,i0 as planCompletedAtBackfill,_l as planExtensionDirectoryCopy,Gk as planItemMutationDocument,Qt as planProfileApplication,dD as planRelationshipEventBackfill,Jp as planRelationshipRemediation,al as planSchemaEvolutionMigration,Ll as planUnknownAuthorHistoryAcknowledgment,gf as planWorkspaceSnapshotRestore,mR as positionalShapeKey,fR as positionalSignatureKey,Xk as preflightExtension,bs as prepareSimilarityText,HT as preserveMutationStdinTokenFields,zT as preserveMutationStdinTokenLiterals,Fk as previewItemMutationDocument,fk as previewItemMutations,Ww as printError,Kw as printResult,bh as profile,Eh as profileApply,Sh as profileLint,Th as profileList,Ch as profileShow,uE as projectAfterCommandItemSnapshot,dm as projectContextFocusRows,Nf as projectFleetAttributionAnalytics,MM as projectHistoryProvenance,Gi as projectLeanRecoveryPayload,jw as projectPmBriefListEnvelope,Bw as projectPmBriefSearchEnvelope,is as projectPmCliErrorContextDetails,os as projectPmCliErrorDetails,ki as projectPmDiagnosticOutput,xi as projectPmDiagnosticText,kf as projectProvenanceCoverageAnalytics,pu as projectValidateCounts,_P as promoteAssuranceAssertion,uw as propagateContextUsageServingReceipt,OL as pruneCompileCacheGenerations,MI as putAssuranceDeclaration,kI as putAssuranceDeclarationBundle,gv as queryItemMetadataIndex,yv as queryLinkedFileMetadataIndex,bv as querySimilarItemMetadataIndex,$f as queryTestRunMeasurementsBelow,Sn as quoteCommandArg,En as quoteWindowsCommandArg,kk as rankCommandPaths,vl as readAnnotationEntries,pi as readAuthorEnvironment,r_ as readBooleanOption,bw as readContextUsageAffinity,o_ as readCsvListOption,Ds as readExtensionMigrationState,an as readFileIfExists,Gd as readFirstStringFromCommanderOptions,Ud as readFirstValueFromCommanderOptions,If as readHistoryAnalyticsWindow,iS as readHistoryEntries,_i as readHistorySnapshot,Ef as readImprovementLedger,Ev as readItemMetadataDerivedIndexState,Is as readItemRevision,bk as readItemTransaction,Zi as readLocatedItem,ES as readOutputBudgetCollections,JS as readOutputCollectionFingerprint,CS as readOutputContinuationRowCollections,bS as readOutputContinuationRowPaths,BS as readOutputIncludeModeOptions,TS as readOutputRowCollections,yS as readOutputRowPaths,LS as readOutputSessionRemainingTokens,Ft as readPmPackageManifest,Zf as readRequiredString,GE as readRuntimeFieldOptionValue,Vi as readSettings,bO as readSettingsSection,ZA as readSettingsWithMetadata,jd as readStringArrayFromCommanderOptions,t_ as readStringOption,Qv as readThrownExitCode,zv as readVectorizationStatusLedger,dv as readWorkflowPolicies,PT as readWorkflowPolicyField,GO as readWorkspaceContextIntentContracts,o0 as readWorkspaceContextSignals,d0 as readWorkspaceMemory,K0 as readWorkspacePosition,rR as readWorkspaceTransaction,_A as reanchorHistoryEntries,$1 as reconcileArtifactLedgers,xn as reconcileExtensionCapabilityUsage,OA as reconcileWorkspaceJsonHistory,pE as recordAfterCommandAffectedItem,NI as recordAssuranceVerdict,Bu as recordClaimSemanticAttribution,hw as recordContextUsageDelivery,_w as recordContextUsageServing,gw as recordContextUsageTouch,yw as recordContextUsageTouches,zu as recordFocusSemanticAttribution,Cf as recordImprovementObservation,qu as recordReleaseSemanticAttribution,Sv as refreshItemMetadataDerivedIndex,ol as refreshMergeAttributeFenceIfInstalled,OS as refreshReadOutputDeliveredCounts,Vv as refreshSearchArtifactsForMutation,ii as registerAgentProvenanceAdapters,$R as registerExternalDependencyResolver,oi as registerHarnessSignalDescriptors,sS as registerOutputMaterialFieldGroups,Fh as release,vS as rememberReadOutputFocusRows,xI as removeAssuranceDeclaration,dn as removeFileIfExists,cp as renameArtifactsResultKey,om as renderCalendarMarkdown,nm as renderCalendarToon,Cm as renderContextMarkdown,ml as renderExtensionDescribeMarkdown,pl as renderExtensionSurfaceMarkdown,v_ as renderGuideMarkdown,Ik as renderMissingOptionRetry,h0 as renderNextMarkdown,Lk as renderPmClosedDomainHelp,wn as renderPmCommand,$o as renderPmCommandAliasMigrationHint,Kc as renderPmCommandVisibilityMarkdown,VD as renderPmFlagLexiconMarkdown,GN as renderPmMcpAppHtml,CD as renderPmRefusalClosureCensusMarkdown,UA as renderRowsAsCsv,jA as renderRowsAsTable,Nh as reopen,sv as replayHistoryToTarget,lA as replayToCanonicalItemDocument,cA as replayToItemDocument,ZE as requireHistoryOperation,CM as requireTerminalReason,EM as requireTerminalReasonWithRecovery,nA as resealHistoryRewrite,aE as resetActiveExtensionRuntimeState,Vl as resetWorkspaceGraphCache,Jn as resolveAgentSessionContextFromSignals,kl as resolveAnnotationIndex,Il as resolveAnnotationInput,nS as resolveAuthor,fi as resolveAuthorIdentity,IA as resolveBodyFileContent,qy as resolveBuiltinCorpusShape,rm as resolveCalendarOutputFormat,QR as resolveCanonicalPmErrorCodeContract,IC as resolveCanonicalRelationshipKind,oS as resolveClaimPrincipal,IE as resolveCliBulkIdsInput,oC as resolveCommandOptionPolicyState,vL as resolveCompileCacheGeneration,n0 as resolveCompletionTimestamp,FC as resolveConfiguredPmPackageRoot,qR as resolveContentFieldFilters,Aw as resolveContextIntentContract,cm as resolveContextOutputFormat,lm as resolveContextTokenBudget,wM as resolveCreateExplicitEmptyFlag,ws as resolveDeclaredBlockers,v0 as resolveEffectiveSearchMode,Pv as resolveEmbeddingProviders,CC as resolveExtensionFlagValueContract,hl as resolveExtensionInstallSourceIdentity,cC as resolveExtensionLongFlagName,Ls as resolveExtensionMigrationStatePath,WC as resolveExtensionRoots,FR as resolveExternalDependencyReference,TC as resolveFlagValueKind,sC as resolveGlobalPmRoot,w_ as resolveGuideOutputFormat,Sf as resolveHistoryEpisodeGroupIdentity,xE as resolveHistoryHashAlgorithm,JE as resolveHistoryOperation,IM as resolveHistoryProvenanceDimensions,AO as resolveHistorySubject,nv as resolveHistoryTarget,R0 as resolveHybridSemanticWeight,gn as resolveImplicitPmRoot,_C as resolveIsoOrRelative,xO as resolveItemBlockers,RO as resolveItemExecutionRole,dk as resolveItemMutationDocument,em as resolveItemOwnershipConflict,hn as resolveItemTypeRegistry,DE as resolveItemTypesFilePath,Ck as resolveLifecycleVerbRecovery,aC as resolveLinkedResourcePositionalRecovery,Wf as resolveLinkedTestFailureExitCode,ou as resolveLinkedTestSourceRef,nu as resolveLinkedTestSourceWorkspaceRoot,du as resolveLinkedTestTrust,cu as resolveLinkedTestTrustBatch,Kg as resolveMcpAcknowledgedSubscriptionFilter,Je as resolveMcpRequestContext,Zc as resolveMergeInstallContext,Pk as resolveMisnestedCommandPath,BR as resolveMissingMetadataFilters,Rk as resolveMissingOptionPlaceholder,uS as resolveModePairedOutputOmissionReceipt,m0 as resolveNextOutputFormat,_S as resolveOutputOmissionReceipt,$C as resolvePmCliVersion,Do as resolvePmCommandAlias,Ve as resolvePmCommandCapabilityFamily,Nt as resolvePmCommandExitContract,L as resolvePmCommandOperation,Ii as resolvePmCommandOutputBudget,xt as resolvePmCommandOutputEnvelope,dR as resolvePmCommandPositionalContract,An as resolvePmCommandScopeArgs,Ke as resolvePmCommandVisibilityTier,Mi as resolvePmDiagnosticOutputBudget,eI as resolvePmErrorCodeContract,jb as resolvePmFlagSemanticConcept,Le as resolvePmHistoryOperation,Vx as resolvePmMcpExecutableInvocation,DC as resolvePmPackageRootFromModule,cR as resolvePmPositionalActionContract,Td as resolvePmPositionalActionFlagContracts,Ge as resolvePmRoot,yc as resolvePmToolCustomFieldCollision,NA as resolvePriority,Vt as resolveProfile,tl as resolveProjectMergeTypeFolders,sw as resolveQueryCursorStart,Ek as resolveReadCompletenessControls,wk as resolveReadOptionRetryArgs,HS as resolveReadOutputDimensions,YS as resolveReadOutputEncoding,RS as resolveReadOutputRecoveryBudget,US as resolveReadOutputSurface,fS as resolveReadRowContract,Ok as resolveRecoveryCommandName,AE as resolveRegisteredSearchProvider,vE as resolveRegisteredVectorStoreAdapter,zd as resolveReproducibleProcessEnvironment,Fn as resolveRuntimeFieldRegistry,$n as resolveRuntimeStatusRegistry,Mv as resolveSearchCorpusFields,A0 as resolveSearchMaxResults,M0 as resolveSearchPage,O0 as resolveSearchScoreThreshold,I0 as resolveSearchTuning,xv as resolveSemanticCorpusCharacterLimit,ju as resolveSemanticLineageIds,ev as resolveSettingsWithSemanticRuntimeDefaults,GI as resolveSourceContextWritePolicy,Wu as resolveStartTaskInProgressStatus,ee as resolveSubcommandFlagContractsForCommand,ST as resolveTelemetryErrorCategory,Kv as resolveTelemetrySourceAttribution,TM as resolveTerminalReason,pk as resolveTransactionSchema,rC as resolveTypeDefinition,tC as resolveTypeName,GA as resolveTypeSynonym,VA as resolveTypeWorkflows,Dl as resolveUnknownAuthorAcknowledgmentSelector,D0 as resolveVectorIndexRecovery,Lv as resolveVectorStores,Ic as resolveWorkspaceRelationshipKindRegistry,iC as resolveWorkspaceRoot,jh as restore,bC as restoreCheckpointItems,RA as restoreWorkspaceJsonFromHistory,bf as restoreWorkspaceSnapshot,yf as restoreWorkspaceSnapshotWithRecovery,lg as runAction,_E as runActiveBeforeMutationHooks,gE as runActiveCommandHandler,hE as runActiveOnIndexHooks,Dn as runActiveOnReadHooks,Ln as runActiveOnWriteHooks,yE as runActiveParserOverride,bE as runActivePreflightOverride,TE as runActiveServiceOverride,sm as runActivity,KC as runAfterCommandHooks,Xm as runAggregate,Ml as runAnnotationCommand,gu as runAppend,sM as runAssuranceAction,aM as runAssuranceDispatch,VC as runBeforeCommandHooks,im as runCalendar,vm as runClaim,Om as runClaimNext,bu as runClose,Tu as runCloseMany,Mm as runCloseTask,Ul as runComments,O_ as runCompletion,jl as runConfig,Bt as runContext,KM as runContextEvaluationCorpus,HM as runContextEvaluationScenario,Cu as runCopy,Gu as runCreate,Uu as runDelete,Kl as runDeps,lp as runDocs,cP as runDuplicates,df as runEval,lf as runEvent,gl as runExtension,Gs as runExtensionMigrateAction,Fs as runExtensionMigrations,yp as runFiles,Tp as runFilesDiscover,bp as runFilesLookup,xf as runFleetAttributionAnalytics,Ku as runFocus,fu as runGc,Jm as runGet,Qp as runGraph,A_ as runGuide,eu as runHealth,w0 as runHistory,yM as runHistoryAttest,cM as runHistoryCompact,uM as runHistoryCompactBulk,qP as runHistoryMaintenance,mM as runHistoryRedact,HP as runHistoryRepair,KP as runHistoryRepairAll,Sl as runInit,Tl as runInitAgentGuidance,hu as runLearnings,dp as runLinkedArtifacts,Yf as runLinkedTests,Uc as runList,cf as runMeet,U0 as runMergeDriver,nl as runMergeInstall,LP as runMergeReceiptEvidenceReport,NP as runMergeReceiptReport,j0 as runMergeReconcile,wm as runNext,Dm as runNotes,Pm as runPauseTask,xm as runPlan,Hm as runProfileApply,zm as runProfileLint,Bm as runProfileList,qm as runProfileShow,Mf as runProvenanceCoverageAnalytics,tx as runRegisteredCommandForTest,sx as runRegisteredCommandOverrideForTest,mx as runRegisteredExporterForTest,ox as runRegisteredHookForTest,ux as runRegisteredImporterForTest,px as runRegisteredMigrationForTest,rx as runRegisteredMutationGuardForTest,nx as runRegisteredParserOverrideForTest,ix as runRegisteredPreflightOverrideForTest,ax as runRegisteredRendererOverrideForTest,cx as runRegisteredSearchProviderForTest,dx as runRegisteredServiceOverrideForTest,lx as runRegisteredVectorStoreAdapterForTest,er as runReindex,Rm as runRelease,pf as runRemind,vM as runReopen,Nm as runRestore,dl as runSchemaEvolutionMigration,Zm as runSearch,Vy as runSearchRefreshWorkerEntrypoint,R_ as runStartBackgroundRun,Im as runStartTask,Gf as runStats,jf as runTelemetry,Um as runTemplatesList,Gm as runTemplatesSave,jm as runTemplatesShow,Xf as runTest,Jf as runTestAll,I_ as runTestRunsList,M_ as runTestRunsLogs,x_ as runTestRunsResume,P_ as runTestRunsStatus,k_ as runTestRunsStop,N_ as runTestRunsWorker,Qu as runUpdate,Lm as runUpdateMany,Ut as runUpgrade,mu as runValidate,cg as runWithActiveExtensions,D as runWithAgentSessionContext,YA as runWithConfigurationOnlySettings,Sw as runWithContextIntentContracts,BO as runWithDiscoveredContextIntentContracts,ai as runWithHarnessDetectionSignals,PN as runWithMcpTraceContext,Vd as runWithReproducibleProcessEnvironment,di as runWithWorkspaceHarnessSignalDescriptors,zr as runWithWorkspaceRecipe,YI as runWorkflowPolicyAction,dM as runWorkspaceTransactionGc,Xp as saveGraphAuditBaseline,JP as scanClosureTimestamps,hP as scanExtensionHostVersions,Nl as scanHistoryAuthorAttribution,zn as scanItemFormatVersions,us as scanMutationSecrets,bP as scanProvenanceResolverHealth,Ss as scanStaleInProgressItems,eM as scanStorageIntegrity,rh as schema,ch as schemaAddField,ah as schemaAddStatus,ih as schemaAddType,mh as schemaApplyPreset,fh as schemaInferTypes,oh as schemaList,ph as schemaListFields,gh as schemaRemapStatus,lh as schemaRemoveField,dh as schemaRemoveStatus,sh as schemaRemoveType,hh as schemaRenameField,_h as schemaRenameType,nh as schemaShow,uh as schemaShowField,yh as schemaShowStatus,Mk as scoreCommandPathMatch,jM as scoreContextCandidates,BM as scoreContextCandidatesWithActiveExtensions,Ts as scoreItemSimilarity,LD as scorePmGrammarRefusalClosure,wD as scorePmRefusalClosure,Cs as scorePreparedItemSimilarity,FD as scoreTrackerPreflightRecoveryClosure,rA as sealHistoryRecord,Jx as sealMcpRequestState,F_ as search,p0 as searchWorkspaceMemory,u0 as searchWorkspaceMemoryReadResult,LO as selectActionableEntries,ew as selectCursorSemanticOptions,T_ as selectImportAuthor,AN as selectMcpClientRegistrationMode,l0 as selectWorkspaceMemory,c0 as selectWorkspaceMemoryRollups,Vu as semanticAttributionAffinity,dO as sentryCaptureCliError,sO as sentryDiscardCommandSpan,aO as sentryFinishCommandSpan,lO as sentryFlush,cO as sentryLogCliUsageError,nO as sentrySetCommandContext,iO as sentryStartCommandSpan,Wn as serializeItemDocument,Dk as serializeNdjsonRows,$k as serializeNdjsonStream,Ly as serveDeclaredObservation,dE as setActiveCommandContext,cE as setActiveCommandResult,tE as setActiveExtensionCommands,eE as setActiveExtensionHooks,rE as setActiveExtensionParsers,oE as setActiveExtensionPreflight,sE as setActiveExtensionRegistrations,iE as setActiveExtensionRenderers,nE as setActiveExtensionServices,tS as setFocusedItem,yO as settingsSectionRevision,gO as shouldCompletePlanOnClose,Wp as shouldPersistDurableGraphCache,WT as shouldResolveMutationStdinTokenField,KT as shouldResolveMutationStdinTokens,rv as shouldRunSearchRefreshInForeground,pp as similarityAdvisoryWarnings,gS as sliceReadOutputRowCollection,ns as snapshotPmCliErrorContext,ip as sortLinkedArtifacts,$T as splitAcceptanceCriteria,fO as splitCommaList,Kn as splitFrontMatter,VS as stabilizeReadOutputReceiptEstimates,I as stableStringify,ak as stableUpsertValue,wT as stableValueEquals,qh as startTask,EO as startTelemetryCommand,B_ as stats,FE as statusIsTerminal,Sd as stripGlobalBootstrapTokens,z0 as subscribeMutationEventBatches,H0 as subscribeMutationEvents,nP as summarizeAgentIdentityVocabulary,Af as summarizeAgentModelProvenance,vf as summarizeAgentProvenance,VM as summarizeContextEvaluationReports,zf as summarizeContextPreflight,NM as summarizeHistoryProvenance,Cl as summarizeInitResult,PP as summarizeMergeReceipt,AM as supportsCreateExplicitEmpty,gR as supportsItemIdAlias,NC as suppressHostOutput,Re as syncRelationshipGraphAdapter,Kk as synthesizeExtensionManifest,Cd as toCompletionFlagString,bm as toContextFocusItem,hm as toContextPackingSummary,gm as toContextRankingSummary,pC as toErrorMessage,i_ as toEstimatedMinutesValue,tk as toExtensionFlagDefinitions,l_ as toImportBoolean,f_ as toImportConfidence,c_ as toImportInteger,y_ as toImportLinkedDocs,g_ as toImportLinkedFiles,b_ as toImportLinkedTests,h_ as toImportLogEntries,__ as toImportNormalizedEnum,m_ as toImportNumberMap,s_ as toImportPriority,d_ as toImportStatus,p_ as toImportStringList,u_ as toImportStringMap,a_ as toImportTags,HE as toItemRecord,n_ as toNonEmptyImportString,lC as toNonEmptyStringOrUndefined,pA as toReplayDocument,qw as toWellFormedText,ys as tokenizeSimilarityText,VT as transferMutationStdinTokenPolicy,zC as translateHostEnvironmentFault,xh as update,Bf as updateLinkedTest,ag as upgrade,wh as validate,EI as validateAssertionDefinition,wI as validateAssuranceDocument,SI as validateGateDefinition,lk as validateItemMutationRows,ap as validateLinkedPaths,vN as validateMcpAuthorizationResponseIssuer,wN as validateMcpAuthorizationServerMetadata,ON as validateMcpClientMetadataDocument,hN as validateMcpHttpRequestHeaders,tN as validateMcpJsonSchema,CI as validateMeasurementDefinition,kA as validateMissingParentReference,jS as validateReadOutputOptions,$A as validateSprintOrReleaseValue,nC as validateTypeOptions,eR as validateWorkspaceTransactionIdentity,gM as verifyAttestation,XR as verifyCliFlagInvocationParity,uR as verifyExplicitPositionalSlotCensus,fA as verifyHistoryChain,mA as verifyHistoryChainWithVersion,qO as verifyHistoryEntries,oA as verifyHistoryRecordHash,iA as verifyHistoryRewriteEvidence,hR as verifyPmCliGrammar,_R as verifyPmCommandPositionalContracts,HD as verifyPmFlagLexicon,_D as verifyPmRecoveryKindRuntimeCoverage,Mb as verifyPmRecoveryProducerRuntimeCoverage,fD as verifyPmRecoveryReferences,bD as verifyPmRefusalClosureIdentityRatchet,yD as verifyPmRefusalClosureRatchet,mD as verifyPmRefusalReachability,Qd as verifyToolOptionCliParity,LA as withCliMutationInput,ks as withExpectedItemRevisions,Us as withFlagAliasMetadata,HC as withHostEnvironmentBoundary,DA as withLiteralMutationInput,eN as withMcpCachePolicy,$i as withoutGenericRefusalExamples,kT as workflowApprovalFingerprint,xT as workflowPolicyApplies,MT as workflowPolicyFingerprint,Hl as workspaceGraphCache,oR as workspaceTransactionPlanDigest,Pl as wrapOwnershipConflict,rO as wrapThrownErrorForSentry,ui as writeAuthorEnvironment,Fe as writeFileAtomic,gC as writeMutationCheckpoint,QA as writeSettings,TO as writeSettingsSection,Vw as writeStderr,Hw as writeStdout,Hv as writeVectorizationStatusLedger,vA as writeWorkspaceJsonWithHistory};
28
+ </html>`}import{createHash as st}from"node:crypto";import{lstat as wy,readdir as qr,readFile as Ay}from"node:fs/promises";import M from"node:path";import{parseDocument as vy}from"yaml";(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]="eafd8bc3-0da1-5220-8fb1-6967eecdb6bf")}catch{}})();var Dr="io.modelcontextprotocol/skills",at="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Oy=Object.freeze({revision:at,status:"draft",directoryRead:!0});function ZN(e,t=!1){let r=e.clientCapabilities.extensions,o=h(r)?r[Dr]:void 0;if(!h(o)||o.revision!==at||t&&o.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Dr]:Oy}}})}var P=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),$r=100,Ry=32*1024*1024,Iy=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Fr=new Set(Array.from({length:P.maxPageSize},(e,t)=>t+1));function C(e,t){throw new u(e,-32602,t)}function Gr(e,t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(t),e.endsWith(".md")?"text/markdown":"text/plain"}catch{return"application/octet-stream"}}function Py(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||C(`Skill ${t} is missing YAML frontmatter.`);let o=vy(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&C(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(s=>s.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(s){C(`Skill ${t} has unsupported YAML aliases.`,{error:String(s)})}return(typeof n!="object"||n===null||Array.isArray(n))&&C(`Skill ${t} frontmatter must be an object.`),n}async function My(e,t,r,o){return r>P.maxFileBytes&&C(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>P.maxFilesPerSkill&&C(`Skill exceeds ${P.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>P.maxSkillBytes&&C(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>Ry&&C(`Skill origin exceeds the aggregate byte limit: ${t}.`),Ay(e)}async function zr(e,t,r){let o=M.join(e,t),n=await qr(o,{withFileTypes:!0}),s=[];for(let i of n.sort((a,d)=>a.name.localeCompare(d.name))){let a=M.posix.join(t.split(M.sep).join("/"),i.name),d=M.join(e,...a.split("/")),c=await wy(d);c.isSymbolicLink()&&C(`Skill resource must not be a symbolic link: ${a}.`),c.isDirectory()?s.push(...await zr(e,a,r)):c.isFile()?s.push({relative:a,bytes:await My(d,a,c.size,r)}):C(`Skill resource must be a regular file or directory: ${a}.`)}return s}async function Ur(e,t,r){let o=new Map,n;try{n=await qr(e,{withFileTypes:!0})}catch(a){if(Ct(a))return o;throw a}let s=n.filter(a=>a.isDirectory()&&Iy.test(a.name)).sort((a,d)=>a.name.localeCompare(d.name));s.length>$r&&C(`Skill origin exceeds ${$r} directories.`);let i={value:0};for(let a of s){let d=await zr(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:i}),c=d.reduce((g,T)=>g+T.bytes.byteLength,0),l=d.find(g=>g.relative==="SKILL.md");if(!l)continue;let p=Py(l.bytes.toString("utf8"),a.name);p.name!==a.name&&C(`Skill directory ${a.name} must match frontmatter name.`,{actual:p.name??null,expected:a.name}),(typeof p.description!="string"||p.description.trim().length===0)&&C(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=d.map(g=>({uri:`skill://${a.name}/${g.relative}`,digest:`sha256:${st("sha256").update(g.bytes).digest("hex")}`,size:g.bytes.byteLength})),_=st("sha256").update(f.map(g=>`${g.uri}:${g.digest}`).join(`
29
+ `)).digest("hex");o.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:p,resources:f,_meta:{contractVersion:1,extensionRevision:at,origin:t,packageVersion:r,protocolVersion:H,trust:"untrusted",estimatedTokens:Math.ceil(c/4)},files:new Map(d.map(g=>[g.relative,g.bytes])),fingerprint:_})}return o}function jr(e){let{files:t,fingerprint:r,...o}=e;return o}var Br=class e{#e;#t;constructor(t){this.#e=t,this.#t=st("sha256").update([...t.entries()].sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>`${r}:${o.fingerprint}`).join(`
30
+ `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let o=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof o!="object"||o===null||!("fingerprint"in o)||o.fingerprint!==this.#t||!("scope"in o)||o.scope!==r||!("offset"in o)||!Number.isInteger(o.offset)||Number(o.offset)<0)&&C("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof u)throw o;return C("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Ur(M.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=M.resolve(t.packageRoot,".agents","skills"),n=M.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let s=await Ur(n,"workspace",t.packageVersion);for(let[i,a]of s)r.set(i,a)}}return new e(r)}list(t={}){let r=t.limit??P.defaultPageSize;Fr.has(r)||C(`Skill list limit must be an integer from 1 to ${P.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((d,c)=>d.uri.localeCompare(c.uri)),s=n.slice(o,o+r),i=o+s.length,a=i<n.length;return{skills:s.map(jr),hasMore:a,...a?{nextCursor:this.#o(i,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||C(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),jr(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",s=o&&n?o.files.get(n):void 0,i=o?.resources.find(c=>c.uri===t);(!o||!s||!i)&&C(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:i.digest,origin:o._meta.origin,trust:"untrusted"},d=Gr(n,s);return d!=="application/octet-stream"?{contents:[{uri:t,mimeType:d,text:s.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:d,blob:s.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let s=(o?.[2]??"").replace(/\/$/u,""),i=s.length>0?`${s}/`:"",a=`skill://${o[1]}`,d=new Map;for(let T of n.resources){let E=T.uri.slice(`${a}/`.length);if(!E.startsWith(i))continue;let q=E.slice(i.length),[R,...Ro]=q.split("/"),Io=`${a}/${i}${R}`,Po=n.files.get(`${i}${R}`);d.set(R,{uri:Io,name:R,mimeType:Ro.length>0?"inode/directory":Gr(R,Po)})}s.length>0&&d.size===0&&C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let c=r.limit??P.maxPageSize;Fr.has(c)||C(`Skill directory limit must be an integer from 1 to ${P.maxPageSize}.`);let l=this.#r(r.cursor,t),p=[...d.values()].sort((T,E)=>T.uri.localeCompare(E.uri)),f=p.slice(l,l+c),_=l+f.length,g=_<p.length;return{resources:f,hasMore:g,...g?{nextCursor:this.#o(_,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]="38023567-8a5b-5e25-8d71-5112f74d1894")}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]="619dbd55-b854-5e69-b5a5-c0bcada81629")}catch{}})();var Hr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function dt(e,t){if(e===null||typeof e=="boolean"||typeof e=="string")return e;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`Workspace recipe JSON number must be finite at ${t}`);return e}if(Array.isArray(e))return Object.freeze(e.map((r,o)=>dt(r,`${t}[${o}]`)));if(typeof e!="object"||Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new Error(`Workspace recipe input must contain JSON values at ${t}`);return Object.freeze(Object.fromEntries(Object.entries(e).map(([r,o])=>[r,dt(o,`${t}.${r}`)])))}function ve(e){if(e.schema!==Hr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Et(e);if(e.operations.some(r=>r.action.trim().length===0||r.input===null||Array.isArray(r.input)))throw new Error("Workspace recipe operations require an action and object input");return Object.freeze({...t,operations:Object.freeze(e.operations.map((r,o)=>Object.freeze({action:r.action,input:dt(r.input,`operations[${o}].input`)})))})}async function Vr(e,t){let r=ve(e);return St(r,t)}async function ky(e,t){return Vr(e,async()=>{let r=[];for(let[o,n]of e.operations.entries())r.push(await t(n,o));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]="c234be1c-35b7-5388-8a70-a012e9a34389")}catch{}})();var Kr="pm.agent-observation/v1",Wr="pm.agent-verdict/v1",Yr="pm.agent-episode/v1";function O(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function k(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function ne(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))ne(t)}return e}function xy(e){if(e.length===0)throw new Error("observation.reads must declare at least one bounded read.");let t=0;for(let r of e)if(k(r.command,"observation.reads.command"),O(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function Ny(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(O(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,o)=>r+o,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function Ly(e){if(e.length===0)throw new Error("observation.tiers must declare a degradation ladder.");let t=new Set,r=Number.POSITIVE_INFINITY;for(let o of e){if(k(o.id,"observation.tiers.id"),O(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let s of o.fields){if(F(s,"observation.tiers.fields"),n.has(s))throw new Error(`Duplicate observation tier field: ${s}.`);n.add(s)}}}function Dy(e){if(e.schema!==Kr)throw new Error(`observation.schema must be ${Kr}.`);return k(e.id,"observation.id"),O(e.version,"observation.version"),xy(e.reads),Ny(e.calibration),e.corpus_dependence.kind==="bounded"&&(k(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),O(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),Ly(e.tiers),ne(structuredClone(e))}function aL(e){return{contract_id:e.id,contract_version:e.version,guaranteed_ceiling_tokens:e.reads.reduce((t,r)=>t+r.budget_tokens,0),expected_emitted_bytes:e.calibration.expected_emitted_bytes,expected_tokens:Math.ceil(e.calibration.expected_emitted_bytes/4),tolerance_bytes:e.calibration.tolerance_bytes,calibration_basis:"emitted_bytes",corpus_dependence:e.corpus_dependence}}async function $y(e,t,r){O(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,s]of e.tiers.entries()){o.push(s.id);let i=await t(s),a=Buffer.byteLength(I(i),"utf8"),d=Math.ceil(a/4);if(d<=Math.min(r.budget_tokens,s.max_tokens))return{status:"served",payload:i,receipt:{contract_id:e.id,contract_version:e.version,served_tier:s.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:d,calibration_basis:"emitted_bytes"}}}return{status:"refused",reason:"no_declared_tier_fits_budget",receipt:{contract_id:e.id,contract_version:e.version,served_tier:null,degraded:e.tiers.length>1,attempted_tiers:o,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function F(e,t){let r=e.split(".");if(r.some(o=>o.length===0||o==="__proto__"||o==="prototype"||o==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Xr(e,t){let r=e;for(let o of F(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function Fy(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function Gy(e){if(e.kind!=="field_equals")return;let t;try{t=JSON.stringify(e.expected)}catch{throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}if(t===void 0)throw new Error(`Expected value for verdict predicate ${e.id} must be JSON serializable.`)}function Uy(e){if(e.schema!==Wr)throw new Error(`verdict.schema must be ${Wr}.`);k(e.id,"verdict.id"),O(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){k(o.id,"verdict.predicates.id"),F(o.path,"verdict.predicates.path");let n=o.kind;if(n!=="field_equals"&&n!=="field_present"&&n!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${o.id}.`);if(t.has(o.id))throw new Error(`Duplicate verdict predicate: ${o.id}.`);Gy(o),t.add(o.id)}if(e.composition.operator!=="all"&&e.composition.operator!=="any")throw new Error("verdict composition operator must be all or any.");if(e.composition.predicate_ids.length!==e.predicates.length)throw new Error("verdict composition must reference every predicate exactly once.");let r=new Set(e.composition.predicate_ids);if(r.size!==e.composition.predicate_ids.length||[...r].some(o=>!t.has(o)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return ne(structuredClone(e))}function jy(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(i=>[i.id,i])),o=e.composition.predicate_ids.map(i=>{let a=r.get(i),d=Xr(t.state,a.path),c=a.kind==="field_present"?d!==void 0:a.kind==="field_absent"?d===void 0:I(d)===I(a.expected);return{id:i,outcome:c?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${Fy(a.path)}`,evidence_digest:yt(I(d))}}),n=o.filter(i=>i.outcome==="satisfied").length,s=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:s?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function dL(e){if(e.schema!==Yr)throw new Error(`episode.schema must be ${Yr}.`);if(k(e.id,"episode.id"),O(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)k(t,"episode.task_item_ids");O(e.limits.max_actions,"episode.limits.max_actions"),O(e.limits.max_observations,"episode.limits.max_observations"),O(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)F(t,"episode.observable_fields");for(let t of e.withheld_fields)F(t,"episode.withheld_fields");for(let t of e.observable_fields){let r=e.withheld_fields.find(o=>t===o||t.startsWith(`${o}.`)||o.startsWith(`${t}.`));if(r!==void 0)throw new Error(`Observable field ${t} overlaps withheld field ${r}.`)}for(let t of e.observation.tiers)for(let r of t.fields)if(!e.observable_fields.includes(r))throw new Error(`Observation tier field ${r} is not declared observable.`);return Dy(e.observation),Uy(e.verdict),ve(e.recipe),ne(structuredClone(e))}function By(e,t,r){let o=F(t,"observation projection field"),n=e;for(let[s,i]of o.entries()){if(s===o.length-1){r!==void 0&&(n[i]=structuredClone(r));return}let a=n[i];(a===null||typeof a!="object"||Array.isArray(a))&&(n[i]={}),n=n[i]}}function qy(e,t){let r={};for(let o of t)By(r,o,Xr(e,o));return r}async function cL(e,t){let r=[],o=0,n=0,s=!1,i,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},d=await D(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:d.state_id});let c=async()=>{if(s)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let p=await t.readRecordedState(),f=await $y(e.observation,async _=>qy(p.state,_.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??p.snapshot_id}),f},l=async(p=!1)=>{if(s&&!p)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),_=jy(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),_};return{observe:()=>D(a,c),step:async p=>{if(s)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await D(a,()=>t.execute(p));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>D(a,l),close:()=>i!==void 0?i:s?Promise.reject(new Error("episode is already closed.")):(s=!0,i=D(a,()=>l(!0)).then(p=>(r.push({sequence:r.length+1,kind:"close",state_id:p.snapshot_id}),{verdict:p,trajectory:ne(structuredClone(r))})).catch(p=>{throw s=!1,p}).finally(()=>{i=void 0}),i)}}(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]="1202ba19-0bcb-5478-b245-4472e361d4de")}catch{}})();var G="https://schema.unbrained.dev/pm/corpus-shape/v1";function K(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function ie(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Zr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Zr(t);Object.freeze(e)}}function W(e){if(e.schema!==G)throw new TypeError(`Unsupported corpus shape schema: ${e.schema}`);if(e.name.trim().length===0||e.description.trim().length===0)throw new TypeError("Corpus shape name and description must be non-empty");if(K(e.hierarchy_depth,"hierarchy_depth"),K(e.hierarchy_fanout,"hierarchy_fanout"),ie(e.age_span_days,"age_span_days"),K(e.history_entries_per_item,"history_entries_per_item"),ie(e.comments_per_100_items,"comments_per_100_items"),ie(e.notes_per_100_items,"notes_per_100_items"),ie(e.learnings_per_100_items,"learnings_per_100_items"),K(e.author_cardinality,"author_cardinality"),K(e.component_count,"component_count"),e.edge_kind_mix.length===0||e.edge_kind_mix.some(r=>r.kind.trim().length===0||r.weight<=0))throw new TypeError("Corpus shape edge_kind_mix requires non-empty kinds with positive weights");if(e.terminal_statuses.some(r=>!e.custom_statuses.includes(r)))throw new TypeError("Corpus shape terminal_statuses must be declared in custom_statuses");let t=structuredClone(e);return Zr(t),t}var Oe=[{kind:"implements",weight:5},{kind:"blocked_by",weight:2},{kind:"discovered_from",weight:2},{kind:"verifies",weight:2},{kind:"supersedes",weight:1},{kind:"related",weight:4}],Y=Object.freeze({scratch:W({schema:G,name:"scratch",description:"Seconds-old, shallow project with minimal history.",hierarchy_depth:2,hierarchy_fanout:50,age_span_days:0,history_entries_per_item:1,comments_per_100_items:2,notes_per_100_items:1,learnings_per_100_items:1,edge_kind_mix:[{kind:"related",weight:1}],author_cardinality:2,component_count:1,include_cycles:!1,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),representative:W({schema:G,name:"representative",description:"Medium-lived project with rich evidence and typed lineage.",hierarchy_depth:5,hierarchy_fanout:8,age_span_days:730,history_entries_per_item:12,comments_per_100_items:30,notes_per_100_items:12,learnings_per_100_items:10,edge_kind_mix:Oe,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":W({schema:G,name:"deep-graph",description:"Deep typed relationship graph with deterministic cycles.",hierarchy_depth:16,hierarchy_fanout:2,age_span_days:3650,history_entries_per_item:6,comments_per_100_items:15,notes_per_100_items:8,learnings_per_100_items:8,edge_kind_mix:Oe,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":W({schema:G,name:"multi-decade",description:"Thirty-year event history with dense per-item evolution.",hierarchy_depth:6,hierarchy_fanout:6,age_span_days:10958,history_entries_per_item:24,comments_per_100_items:40,notes_per_100_items:20,learnings_per_100_items:16,edge_kind_mix:Oe,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":W({schema:G,name:"disconnected-archive",description:"Multiple disconnected historical project components.",hierarchy_depth:4,hierarchy_fanout:10,age_span_days:7305,history_entries_per_item:8,comments_per_100_items:10,notes_per_100_items:5,learnings_per_100_items:6,edge_kind_mix:Oe,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function zy(){return Object.keys(Y).sort().map(e=>Y[e])}function Hy(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(Y,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(Y).join(", ")}`);return Y[t]}var Jr=new WeakMap;function Qr(e,t){if(e===0)return[];let r=Jr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),Jr.set(t,r));let o=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&o.push("related"),[...new Set(o)]}function Vy(e,t,r,o=42){if(ie(t,"item index"),K(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),s=t%n,i=Math.floor(t/n),a=0,d=1;for(let E=0;E<e.hierarchy_depth;E+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+d),d=Math.min(Number.MAX_SAFE_INTEGER,d*e.hierarchy_fanout);let c=i%a,l=i-c,p=c===0?void 0:s+(l+Math.floor((c-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),_=e.age_span_days*864e5,g=new Date(f+(r===1?0:Math.round(t/(r-1)*_))).toISOString(),T=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...p===void 0?{}:{parent:`pm-s${p.toString(36).padStart(7,"0")}`},component:s,timestamp:g,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Qr(t,e),has_comment:T<e.comments_per_100_items,has_note:T<e.notes_per_100_items,has_learning:T<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var ct=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let o of r)t[o]=(t[o]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let o=this.depths.get(t.parent);this.recordMismatch(o===void 0,`parent_missing:${t.parent}`),r=(o??0)+1;let n=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,n),this.observedFanout=Math.max(this.observedFanout,n)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[o,n]of this.annotationFields)this.annotations[o]+=Number(t[n]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Qr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[i,,a]of this.annotationFields){let d=Math.floor(this.itemCount/100),c=this.itemCount%100,l=d*a+Math.max(0,a+c-100),p=d*a+Math.min(a,c),f=this.annotations[i];(f<l||f>p)&&o.push(`${i}:${f}!in[${l},${p}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let i of[...n].sort()){let a=this.edgeKinds[i]??0,d=this.expectedEdgeKinds[i]??0;a!==d&&o.push(`edge_kind:${i}:${a}!=${d}`)}let s=[...new Set(o)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:s.length===0,mismatches:s}}};function eo(e){return new ct(e)}function Ky(e,t){let r=eo(e);for(let o of t)r.add(o);return r.finish()}(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]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}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]="6a6b2905-b6b7-5b46-b87d-8b8287e37745")}catch{}})();async function Wy(){let e=Ge(process.cwd(),process.env.PM_PATH);await vt(e,(t,r)=>Ot(t,r,{apply_runtime_defaults:!0}))}(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]="4534b1c9-de27-5745-88f2-641b00b94714")}catch{}})();async function Yy(){await Rt()}(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]="c1cb8d82-20a6-5460-a0ff-f55312911218")}catch{}})();var to=["lines","branches","functions","statements"];function Xy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function Jy(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let o=r;if(typeof o.covered!="number"||typeof o.total!="number"||!Number.isInteger(o.covered)||!Number.isInteger(o.total)||o.covered<0||o.total<o.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:o.covered,total:o.total}}function Zy(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new TypeError("Coverage summary must be a JSON object.");if(!("total"in e))throw new TypeError("Coverage summary is missing the total entry.");let t=[];for(let[r,o]of Object.entries(e)){Xy(r,o);for(let n of to){let s=Jy(r,n,o[n]),i=s.total-s.covered;i>0&&t.push({file:r,metric:n,uncovered:i,...s})}}return 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]="7e55d416-9cc3-51c5-8e56-6b5fd5c836a9")}catch{}})();var Qy=["captured_redacted","captured_verbatim"],eb=[{label:"home directory",pattern:/(?:\/home\/|\/Users\/)[^/\s"']+/u},{label:"GitHub token",pattern:/\b(?:gh[oprsu]_[A-Za-z0-9_]{20,})\b/u},{label:"npm token",pattern:/\bnpm_[A-Za-z0-9]{20,}\b/u},{label:"private key",pattern:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/u}];function v(e){return typeof e=="string"&&e.trim().length>0}function tb(e,t){if(typeof t!="object"||t===null||Array.isArray(t))return[{boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} must contain a JSON object.`}];let r=t,o=[];r.boundary_id!==e.id&&o.push({boundary_id:e.id,kind:"fixture_boundary_mismatch",detail:`${e.fixture_path} names ${String(r.boundary_id)} instead of ${e.id}.`}),(r.version!==1||!Qy.includes(r.capture_source)||!v(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(v)||!("input"in r)||!("observed"in r))&&o.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let n=JSON.stringify(t);for(let s of eb)s.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${s.label}.`});return o}function rb(e,t){let r=Date.parse(e.waiver_expires_at),o=v(e.waiver_reason)&&v(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&_e(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:o&&r>=t?1:0,findings:o?r<t?[{boundary_id:e.id,kind:"expired_waiver",detail:`Boundary ${e.id} waiver expired at ${e.waiver_expires_at}.`}]:[]:[{boundary_id:e.id,kind:"invalid_waiver",detail:`Boundary ${e.id} waiver requires reason, owner, and an RFC 3339 UTC expiry.`}]}}function ob(e,t,r){if(!v(e.id)||!v(e.producer)||!v(e.consumer)||!v(e.format))return{captured:0,waived:0,findings:[{boundary_id:v(e.id)?e.id:"unknown",kind:"invalid_boundary",detail:"Each boundary requires non-empty id, producer, consumer, and format."}]};if("fixture_path"in e){let o=t[e.fixture_path],n=v(e.fixture_path)&&e.fixture_path in t?tb(e,o):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:n.length===0?1:0,waived:0,findings:n}}return rb(e,r)}function vL(e,t,r=new Date){let o=[];if(e.version!==1||!v(e.inventory_scope)||!Array.isArray(e.boundaries))return{ok:!1,boundary_count:0,captured_count:0,waived_count:0,findings:[{boundary_id:"registry",kind:"invalid_registry",detail:"Boundary registry requires version 1, inventory_scope, and boundaries."}]};let n=new Set,s=0,i=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){o.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let d=a,c=v(d.id)?d.id:void 0;if(c!==void 0&&n.has(c)){o.push({boundary_id:c,kind:"duplicate_boundary",detail:`Boundary ${c} is inventoried more than once.`});continue}c!==void 0&&n.add(c);let l=ob(d,t,r.getTime());s+=l.captured,i+=l.waived,o.push(...l.findings)}return o.sort((a,d)=>a.boundary_id!==d.boundary_id?a.boundary_id.localeCompare(d.boundary_id):a.kind.localeCompare(d.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:s,waived_count:i,findings:o}}import X from"node:fs";import lt 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]="aacf5738-098d-50f9-b619-19e472b577ea")}catch{}})();var ro=300*1e3,nb=3;function ML(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function kL(e,t){let r=t.trim();if(!/^[a-zA-Z0-9_-][a-zA-Z0-9._-]*$/.test(r))throw new TypeError("Compile-cache generation must be a safe non-empty filename token.");X.mkdirSync(e,{recursive:!0});let o=lt.join(e,r);X.mkdirSync(o,{recursive:!0});let n=new Date;X.utimesSync(o,n,n);let s=X.readdirSync(e).filter(c=>c!==r).flatMap(c=>{try{return[{name:c,mtimeMs:X.statSync(lt.join(e,c)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&fe(l))return[];throw l}}).sort((c,l)=>l.mtimeMs-c.mtimeMs||c.name.localeCompare(l.name)),i=s.filter(c=>n.getTime()-c.mtimeMs<ro),a=Math.max(0,nb-1-i.length),d=s.filter(c=>n.getTime()-c.mtimeMs>=ro).slice(a).map(c=>c.name).sort((c,l)=>c.localeCompare(l));for(let c of d)X.rmSync(lt.join(e,c),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:d}}import{createHash as ib}from"node:crypto";(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]="ff60bc5b-bd85-5b3c-9a55-21e7e72477ac")}catch{}})();var pt=1;function J(e){e?.throwIfAborted()}function U(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function Z(e,t,r={}){let o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),s=e.edges(),i=t.list();return Object.freeze({version:pt,fingerprint:ib("sha256").update(I({nodes:n,edges:s,kinds:i})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:s,kinds:i})}function sb(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e){if(!sb(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==pt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(n=>typeof n!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new Ue([]);for(let n of e.kinds)t.register(n);let r=new z(e.nodes,e.edges,t),o=Z(r,t,{createdAt:e.created_at});if(o.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:o,registry:t,graph:r}}async function x(e,t){U(e.name,"adapter name");let r=U(t.workspace,"workspace");J(t.signal);let o=await e.read({...t,workspace:r});return J(t.signal),o===null?null:ae(o)}async function Re(e,t){let r=U(t.workspace,"workspace"),o=ae(t.snapshot).snapshot,n=await x(e,{workspace:r,signal:t.signal});if(n?.snapshot.fingerprint===o.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:o.fingerprint,previous_fingerprint:n.snapshot.fingerprint,node_count:o.nodes.length,edge_count:o.edges.length};if(J(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await x(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==o.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:o.fingerprint,...n?{previous_fingerprint:n.snapshot.fingerprint}:{},node_count:o.nodes.length,edge_count:o.edges.length}}function ab(e,t={}){let r=e.map(ae),o=new Map;for(let i of r)for(let a of i.snapshot.kinds){let d=o.get(a.kind);if(d&&I(d)!==I(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new Ue([...o.values()].sort((i,a)=>i.kind.localeCompare(a.kind))),s=new z(new Set(r.flatMap(i=>[...i.snapshot.nodes])),r.flatMap(i=>[...i.snapshot.edges]),n);return Z(s,n,t)}var se=class{name;#e=new Map;constructor(t="memory"){this.name=U(t,"adapter name")}async read(t){J(t.signal);let r=this.#e.get(U(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){J(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(ae(t.snapshot).snapshot))}async clear(t){J(t.signal);let r=U(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(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]="e47f9bb8-f98e-5159-9116-29c3e6fedfc3")}catch{}})();function oo(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function db(e){let t=oo(e.nodeCount,"nodeCount"),r=oo(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),s=(e.idPrefix??"node").trim();if(!n||!s)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let i=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:i,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${s}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${s}-${o==="star"?0:a-r}`,target:`${s}-${a}`,kind:n}}}}}function j(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function no(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=wt(),n=Z(new z(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),s=Z(new z(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),i=[];j(await x(e,{workspace:r})===null,"workspace must start empty"),i.push({name:"empty-read",passed:!0});let a=await Re(e,{workspace:r,snapshot:n});j(a.disposition==="written","first sync must write"),i.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),j((await x(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),i.push({name:"read-isolation",passed:!0}),j((await Re(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),i.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:s,expected_fingerprint:n.fingerprint}),j((await x(e,{workspace:r}))?.snapshot.fingerprint===s.fingerprint,"replacement must become visible"),i.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:n,expected_fingerprint:n.fingerprint})}catch{d=!0}return j(d,"stale compare-and-swap must fail"),i.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:s.fingerprint}),j(await x(e,{workspace:r})===null,"clear must remove the workspace"),i.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(i),clear_supported:e.clear!==void 0}}function cb(e){return no(new se,e?{workspace: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]="58736688-35d0-545d-892e-e0ede7fedc1a")}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]="d45a8203-4501-5797-a6cc-a2e7844adec9")}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]="f5567aa1-0268-574d-907b-38d6249538ce")}catch{}})();var ut=2,lb=["self_reported","independent_transport"];function Ie(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function de(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function io(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((o,n)=>{let s=de(o,`${t}[${String(n)}]`);return r?o:s})}function mt(e,t){return e===void 0?void 0:de(e,t)}function pb(e,t){if(e===void 0)return;if(!Ie(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([o,n])=>{if(o.length===0||o.split(".").some(s=>s.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function ub(e,t,r,o,n,s){if(o==="refusal"){if(We(r)||n===void 0||s===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||s!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let i=bt(t);if(i===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[i].trim().toLowerCase();if(a==="history"){let l=Tt(t.slice(i+1));l!==void 0&&(a=Le(`history ${l}`))}let d=Dt(a);if(!We(r)||r!==0&&!d?.exit_codes.some(l=>l===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let c=Lt(a).kind;if(o!==c)throw new TypeError(`${e} expected ${o}, but ${a} declares ${c}`)}function mb(e,t,r){if(!Ie(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=de(e.id,`${o}.id`),s=io(e.args,`${o}.args`,!0),i=e.expected_exit_code;if(typeof i!="number"||!Number.isSafeInteger(i))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!Nt.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let d=a,c=e.expected_accounting_mode;if(!lb.includes(c))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=c;if(l==="independent_transport"&&d!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let p=io(e.required_fields,`${o}.required_fields`);if(p.some(E=>E.split(".").some(q=>q.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=pb(e.expected_field_values,`${o}.expected_field_values`),_=mt(e.expected_error_code,`${o}.expected_error_code`),g=mt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),T=mt(e.recovery_for,`${o}.recovery_for`);return ub(o,s,i,d,_,g),{id:n,args:s,expected_exit_code:i,expected_output_kind:d,expected_accounting_mode:l,required_fields:p,...f?{expected_field_values:f}:{},..._?{expected_error_code:_}:{},...g?{expected_refusal_surface:g}:{},...T?{recovery_for:T}:{}}}function fb(e,t){if(!Ie(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=de(e.id,`tasks[${String(t)}].id`),o=de(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((i,a)=>mb(i,r,a)),s=new Map;for(let i of n){if(s.has(i.id))throw new TypeError(`tasks.${r} contains duplicate step id ${i.id}`);if(i.recovery_for!==void 0&&(s.get(i.recovery_for)?.expected_output_kind!=="refusal"||i.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${i.id} recovery_for must reference an earlier refusal and declare successful output`);s.set(i.id,i)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let i of n)if(i.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===i.id))throw new TypeError(`tasks.${r}.${i.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function cD(e){if(!Ie(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==ut)throw new TypeError(`agent-task transcript corpus version must be ${String(ut)}`);if(!Array.isArray(e.tasks)||e.tasks.length===0)throw new TypeError("agent-task transcript corpus tasks must be non-empty");let t=e.tasks.map((o,n)=>fb(o,n)),r=new Set;for(let o of t){if(r.has(o.id))throw new TypeError(`duplicate agent-task transcript id ${o.id}`);r.add(o.id)}return{version:ut,tasks:t}}import{createHash as so}from"node:crypto";(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]="7163a078-d8be-5bca-813f-c941fcb8e406")}catch{}})();function ao(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function mD(e,t){let r=ao(t.migrationId,"migrationId"),o=ao(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let s=new Date(n).toISOString(),i=He(e,void 0,t.registry),a=i.graph.nodes(),d=i.graph.edges().map(f=>{let _=so("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${_}`,relationshipId:`migration:${r}:${_}`,action:"add",edge:f,author:o,timestamp:s,reason:`Backfill ${r} from legacy item metadata`})}),c=so("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:d})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),p=d.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:c,nodes:a,events:Object.freeze(p),edge_count:d.length,skipped_existing_count:d.length-p.length,duplicate_dependency_rows:i.duplicateRows.length,dangling_reference_count:i.dangling.active.length+i.dangling.legacy_terminal.length})}import*as co from"node:module";(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]="7a1d7194-6ff1-5365-ab64-80b47b0176d7")}catch{}})();var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ft={suggested_retry:{kind:"suggested_retry",semantics:"recovery"},retry_command:{kind:"suggested_retry",semantics:"recovery"},candidate_command:{kind:"candidate_command",semantics:"recovery"},candidate_commands:{kind:"candidate_command",semantics:"recovery"},fallback_candidates:{kind:"candidate_command",semantics:"recovery",nested_value_field:"command"},next_best_command:{kind:"candidate_command",semantics:"recovery"},example:{kind:"example",semantics:"recovery"},examples:{kind:"example",semantics:"recovery"},next_step:{kind:"next_step",semantics:"recovery"},next_steps:{kind:"next_step",semantics:"recovery"},suggested_next_steps:{kind:"next_step",semantics:"recovery"},migration_hint:{kind:"migration_hint",semantics:"replacement"},migration_hints:{kind:"migration_hint",semantics:"replacement"},restore_with:{kind:"restore_with",semantics:"behavior_preserving"}},_D=Object.freeze(Object.keys(ft));function lo(e){if(Object.hasOwn(ft,e))return ft[e]}var _b=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function hb(e,t){let r=e[t],o=t+1,n="";for(;o<e.length&&e[o]!==r;)e[o]==="\\"?o+=2:(n+=e[o],o+=1);return e[o]===r&&(o+=1),{next:o,value:n}}function gb(e){return e===void 0||e.kind==="punctuator"&&_b.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function yb(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
31
+ `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function bb(e,t,r){if(e[t]!=="/"||!gb(r))return;let o=t+1,n=!1;for(;o<e.length;)if(e[o]==="\\")o+=2;else if(e[o]==="[")n=!0,o+=1;else if(e[o]==="]")n=!1,o+=1;else if(e[o]==="/"&&!n){for(o+=1;/[A-Za-z]/u.test(e.charAt(o));)o+=1;return o}else o+=1;return o}function Tb(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=hb(e,t);return r==="`"?{next:n.next}:{next:n.next,token:{kind:"string",value:n.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let n=t+1;for(;/[A-Za-z0-9_$]/u.test(e[n]??"");)n+=1;return{next:n,token:{kind:"identifier",value:e.slice(t,n),offset:t}}}let o=e.startsWith("=>",t)?"=>":r;return{next:t+o.length,token:{kind:"punctuator",value:o,offset:t}}}function Cb(e){let t=[],r=0;for(;r<e.length;){let o=yb(e,r);if(o!==void 0){r=o;continue}let n=bb(e,r,t.at(-1));if(n!==void 0){r=n;continue}let s=Tb(e,r);s.token&&t.push(s.token),r=s.next}return t}var Eb=new Set(["object","block","pattern"]),Sb=new Set(["const","let","var"]),wb=new Set(["}",")","]"]),Ab=new Set(["=","(","[",",",":","?","return"]);function vb(e,t,r){if([...r].reverse().find(n=>Eb.has(n.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Sb.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Ab.has(o.value)?"object":"block"}function Ob(e,t,r){let o=e[t];if(o.value==="{"){let i=vb(e,t,r);return{kind:i,...i==="object"?{member_start:!0,candidates:[]}:{}}}if(o.value==="[")return{kind:"array"};if(o.value!=="(")return;let n=e[t-1],s=e[t-2];return{kind:"paren",...n?.value==="function"||s?.value==="function"?{parameter_list:!0}:{}}}function Rb(e,t,r){if(!(e?.kind!=="object"||!e.member_start||t.kind!=="identifier"&&t.kind!=="string"||r?.value!==":"||!/^[A-Za-z][A-Za-z0-9_]*$/u.test(t.value)))return{field:t.value,offset:t.offset}}function Ib(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function Pb(e){let t=Cb(co.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,s]of t.entries()){let i=o.at(-1),a=Rb(i,s,t[n+1]);a&&i.candidates.push(a);let d=Ob(t,n,o);if(d)o.push(d);else if(wb.has(s.value)){let c=o.pop();c?.kind==="object"&&!Ib(t,n)&&r.push(...c.candidates)}else s.value===","&&i?.kind==="object"?i.member_start=!0:i?.kind==="object"&&s.value!==":"&&(i.member_start=!1)}return r}function Mb(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
32
+ `&&t.push(r+1);return t}function kb(e,t){let r=0,o=e.length;for(;r<o;){let n=Math.floor((r+o)/2);e[n]<=t?r=n+1:o=n}return r}function hD(e){let t=[],r=[];for(let n of[...e].sort((s,i)=>Q(s.path,i.path))){let s=Mb(n.content),i;try{i=Pb(n.content)}catch(a){r.push({kind:"invalid_source",subject:n.path,detail:`${n.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of i){let d=a.field,c=kb(s,a.offset),l=lo(d);l?t.push({path:n.path,line:c,field:d,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(d)&&!/(?:_total|_truncated)$/u.test(d)&&r.push({kind:"unknown_recovery_field",subject:`${n.path}:${c}:${d}`,detail:`${d} resembles a recovery reference but has no typed field contract.`})}}let o=Object.fromEntries(ce.map(n=>[n,t.filter(s=>s.kind===n).length]));for(let n of ce)o[n]===0&&r.push({kind:"missing_kind_producer",subject:n,detail:`No source producer emits the ${n} recovery-reference kind.`});return t.sort((n,s)=>n.path!==s.path?Q(n.path,s.path):n.line!==s.line?n.line-s.line:Q(n.field,s.field)),r.sort((n,s)=>n.subject!==s.subject?Q(n.subject,s.subject):Q(n.kind,s.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function gD(e,t){let r=[],o=(n,s)=>{if(Array.isArray(n)){n.forEach((i,a)=>o(i,[...s,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[i,a]of Object.entries(n).sort(([d],[c])=>Q(d,c))){let d=lo(i),c=d?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...d,semantics:"behavior_preserving"}:d,l=[a].flat();c!==void 0&&l.forEach((p,f)=>{let _="nested_value_field"in c&&typeof c.nested_value_field=="string"?c.nested_value_field:void 0,g=_&&typeof p=="object"&&p!==null&&!Array.isArray(p)?p[_]:p;if(typeof g!="string"||g.trim().length===0)return;let T=[...s,i,String(f)].map(E=>encodeURIComponent(E)).join("/");r.push({id:`${e}:${c.kind}:${T}`,probe_id:e,kind:c.kind,semantics:c.semantics,value:g})}),o(a,[...s,i])}};return o(t,[]),r}function yD(e,t){let r=e.flatMap(i=>(i.owned_states??[]).map(a=>({contract:i,state:a}))),o=[],n=new Map;for(let i of t){if(n.has(i.probe_id)){o.push({kind:"duplicate_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} was supplied more than once.`});continue}n.set(i.probe_id,i)}let s=new Set(r.map(({state:i})=>i.probe_id));for(let{contract:i,state:a}of r){let d=n.get(a.probe_id);if(!d){o.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${i.code}.`});continue}d.code!==i.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${i.code}; observed ${d.code}.`}),d.exit_class!==a.expected_exit_class&&o.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${d.exit_class}.`}),a.entrypoints.includes(d.entrypoint)||o.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${d.entrypoint}.`})}for(let i of t)s.has(i.probe_id)||o.push({kind:"undeclared_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} has no catalog declaration.`});return o.sort((i,a)=>i.probe_id!==a.probe_id?i.probe_id.localeCompare(a.probe_id):i.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function bD(e,t){let r=[],o=new Set,n=new Set;for(let d of e){if(o.has(d.id)){n.add(d.id),r.push({kind:"duplicate_obligation",reference_id:d.id,detail:`Recovery obligation ${d.id} was declared more than once.`});continue}o.add(d.id)}let s=new Map;for(let d of t){if(s.has(d.id)){r.push({kind:"duplicate_observation",reference_id:d.id,detail:`Recovery reference ${d.id} was observed more than once.`});continue}s.set(d.id,d),o.has(d.id)||r.push({kind:"undeclared_observation",reference_id:d.id,detail:`Recovery observation ${d.id} has no emitted obligation.`})}for(let d of e){if(n.has(d.id))continue;let c=s.get(d.id);c?c.reachable?c.semantics!==d.semantics&&r.push({kind:"wrong_semantics",reference_id:d.id,detail:`Recovery reference ${d.value} promised ${d.semantics}; proof demonstrated ${c.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:d.id,detail:`Recovery reference ${d.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:d.id,detail:`No reachability proof was recorded for ${d.kind} ${d.value}.`})}let i=ce.map(d=>{let c=e.filter(p=>p.kind===d),l=c.filter(p=>!n.has(p.id)).map(p=>s.get(p.id)).filter(p=>p!==void 0);return{kind:d,declared:c.length,observed:l.length,passed:c.filter(p=>{let f=s.get(p.id);return!n.has(p.id)&&f?.reachable===!0&&f.semantics===p.semantics}).length}});r.sort((d,c)=>d.reference_id!==c.reference_id?d.reference_id.localeCompare(c.reference_id):d.kind.localeCompare(c.kind));let a=i.reduce((d,c)=>d+c.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:o.size===0?1:a/o.size,coverage_by_kind:i,findings:r}}function xb(e,t){let r=new Map(ce.map(s=>[s,new Set]));for(let s of t)r.get(s.kind).add(s.value);let o=ce.map(s=>({kind:s,source_producers:e.producer_count_by_kind[s],runtime_values:r.get(s).size})),n=o.filter(({source_producers:s,runtime_values:i})=>s>0&&i===0).map(({kind:s})=>s);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((s,{runtime_values:i})=>s+i,0),coverage_by_kind:o,missing_runtime_kinds:n}}var TD=xb;(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]="2b2197f3-7203-52c8-9cc7-f714b33a9306")}catch{}})();var ED=16,Nb=Object.freeze(["bulk_ids_input_empty","bulk_ids_input_missing_path","bulk_ids_input_unreadable","invalid_argument_value","missing_lifecycle_target","missing_required_argument","projection_options_mutually_exclusive","tracker_not_initialized","tracker_root_missing","tracker_root_not_directory","tracker_root_unreadable","unknown_context_intent","unknown_field_projection","unknown_option","unknown_subcommand"]),po=18,uo=Object.freeze([...Nb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function SD(e,t=po){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function wD(e,t=uo){let r=new Set(e.rows.filter(({disposition:n})=>n==="executable").map(({canonical_code:n})=>n)),o=t.filter(n=>!r.has(n));return{ok:o.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:o}}function _t(e,t){let r=e.get(t);if(r)return r;let o={kinds:new Set,probeIds:new Set};return e.set(t,o),o}function AD(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,s=0,i=0;for(let l of e){let p=_t(n,l.canonical_code??l.code);for(let f of l.owned_states??[])p.kinds.add("owned_state"),p.probeIds.add(f.probe_id)}for(let l of t){let p=o.get(l.error_code);if(p===void 0)continue;s+=1;let f=_t(n,p);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let p=o.get(l.error_code);if(p===void 0)continue;i+=1;let f=_t(n,p);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let p=l.canonical_code??l.code,f=n.get(p),_=[...f.probeIds].sort();return{code:l.code,canonical_code:p,disposition:_.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:_}}).sort((l,p)=>l.code<p.code?-1:1),d=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),c=a.length-d.length;return{ok:d.length===0,catalog_error_code_count:a.length,executable_error_code_count:c,uncovered_error_code_count:d.length,coverage_fraction:a.length===0?1:c/a.length,closed_domain_probe_count:s,grammar_probe_count:i,uncovered_error_codes:d,rows:a}}function vD(e){let t=e.rows.map(r=>`| \`${r.code}\` | \`${r.canonical_code}\` | ${r.disposition} | ${r.evidence_kinds.join(", ")||"none"} | ${r.probe_ids.length} |`);return["# Generated refusal closure census","","Tracker: `pm-f05lsg`.","","Every catalog code is listed. An `uncovered` row is an explicit closure obligation, never an omission or implied approval.","",`- Catalog error codes: ${e.catalog_error_code_count}`,`- Executable error codes: ${e.executable_error_code_count}`,`- Executable-code ratchet floor: ${po}`,`- Required executable canonical codes: ${uo.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
33
+ `)}(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]="d252409d-e33e-5c9e-9671-789f0ee87312")}catch{}})();function Lb(e){return[e.expected_error_code!==void 0&&e.error_code!==e.expected_error_code?{code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected error code ${e.expected_error_code}, received ${e.error_code??"<missing>"}.`}:void 0,e.expected_allowed_values!==void 0&&JSON.stringify([...e.allowed_values].sort())!==JSON.stringify([...e.expected_allowed_values].sort())?{code:"incomplete_allowed_values",probe_id:e.probe_id,detail:"The refusal's accepted domain differs from the SDK-owned domain contract."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)===0?{code:"missing_suggested_retry_args",probe_id:e.probe_id,detail:"The refusal omitted shell-free suggested retry arguments."}:void 0,e.expected_suggested_retry_args!==void 0&&(e.suggested_retry_args?.length??0)>0&&JSON.stringify(e.suggested_retry_args)!==JSON.stringify(e.expected_suggested_retry_args)?{code:"suggested_retry_args_mismatch",probe_id:e.probe_id,detail:"The refusal's suggested retry arguments differ from the SDK-owned contract."}:void 0]}function Db(e){return[e.exit_code!==me.USAGE?{code:"non_refusal_exit",probe_id:e.probe_id,detail:`${e.entrypoint} returned exit code ${e.exit_code}; a structured usage refusal must return ${me.USAGE}.`}:void 0,e.allowed_values_required!==!1&&e.allowed_values.length===0?{code:"missing_allowed_values",probe_id:e.probe_id,detail:"The refusal omitted its complete accepted value domain."}:void 0,e.allowed_values.includes(e.rejected_value)?{code:"accepted_rejected_value",probe_id:e.probe_id,detail:`${e.rejected_value} is both rejected and advertised as allowed.`}:void 0,e.suggested_retry.trim().length===0?{code:"missing_suggested_retry",probe_id:e.probe_id,detail:"The refusal omitted an executable suggested retry."}:void 0,e.retry_succeeded?void 0:{code:"retry_failed",probe_id:e.probe_id,detail:"The advertised suggested retry did not succeed."},...Lb(e)]}function ID(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let s=t.length;for(let i of Db(n))i!==void 0&&t.push(i);t.length===s&&(o+=1)}return t.sort((n,s)=>n.probe_id!==s.probe_id?n.probe_id.localeCompare(s.probe_id):n.code.localeCompare(s.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/r.size,findings: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]="39b4e1fe-a34a-5ffc-9447-eaf8c46863c7")}catch{}})();var mo="not-a-declared-action";function $b(e,t){if(e.startsWith("assurance ")&&t.name==="kind")return"measurement";switch(t.value_kind){case"integer":return"1";case"item_id":return"pm-domain";case"action":throw new Error(`Cannot synthesize a preceding action value for positional slot ${t.name}.`);default:return"example"}}function le(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function FD(e=qe.filter(t=>It.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>le(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let s=r.command.split(" "),i=le(r.command),a=s.length>1&&t.has(i)?s.map(le).join("--"):i,d=ee(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),c=Be.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${le(o.name)}`,command:r.command,refusal_args:[...s,...r.slots.slice(0,n).map(l=>$b(r.command,l)),...d],recovery_args:[...s,"--help"],error_code:c&&!r.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(r.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:o.name,missing_argument_index:n}]})).sort((r,o)=>r.probe_id.localeCompare(o.probe_id))}function Fb(e){switch(L(e)){case"assurance":case"workspace snapshot":return Be.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return De;case"merge":return $e;case"plan":return Ye;case"profile":return Xe;case"schema":return $t;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function GD(e=qe){return e.filter(({slots:t})=>t[0]?.required===!0&&t[0].value_kind==="action").map(({command:t})=>{let r=t.split(" ");return{probe_id:`unknown-subcommand-${le(t)}`,command:t,refusal_args:[...r,mo],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:mo,allowed_values:[...Fb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function Gb(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function Ub(e,t){if(!t)return[{code:"refusal_probe_missing",probe_id:e.probe_id,detail:`${e.probe_id} has no runtime observation.`}];let r=[];return t.error_code!==e.error_code&&r.push({code:"refusal_error_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} emitted ${t.error_code||"<none>"}; expected ${e.error_code}.`}),t.exit_code!==2&&r.push({code:"refusal_exit_code_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} exited ${t.exit_code}; expected usage exit 2.`}),"allowed_values"in e&&!Gb(t.allowed_values,e.allowed_values)&&r.push({code:"refusal_allowed_values_mismatch",probe_id:e.probe_id,detail:`${e.probe_id} did not expose its complete action domain.`}),t.recovery_succeeded||r.push({code:"refusal_recovery_failed",probe_id:e.probe_id,detail:`${e.probe_id} help recovery did not succeed.`}),t.refusal_mutated_state&&r.push({code:"refusal_mutated_state",probe_id:e.probe_id,detail:`${e.probe_id} changed tracker state while refusing input${t.mutated_paths?.length?`: ${t.mutated_paths.join(", ")}`:"."}`}),r}function UD(e,t){let r=new Map(e.map(i=>[i.probe_id,i])),o=new Map(t.map(i=>[i.probe_id,i])),n=[...e.flatMap(i=>Ub(i,o.get(i.probe_id))),...t.filter(i=>!r.has(i.probe_id)).map(i=>({code:"unexpected_refusal_probe",probe_id:i.probe_id,detail:`${i.probe_id} has no declared grammar refusal contract.`}))];n.sort((i,a)=>i.probe_id.localeCompare(a.probe_id)||i.code.localeCompare(a.code));let s=new Set(n.map(({probe_id:i})=>i));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:i})=>!s.has(i)).length,findings: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]="d3795bc4-fbe5-5ca4-bc90-b72a2d469dc7")}catch{}})();var ht=[{probe_id:"tracker-root-missing",failure_kind:"missing_root",expected_error_code:"tracker_root_missing",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-settings-missing",failure_kind:"settings_missing",expected_error_code:"tracker_not_initialized",expected_exit_code:3,recovery_kind:"initialize"},{probe_id:"tracker-root-not-directory",failure_kind:"not_directory",expected_error_code:"tracker_root_not_directory",expected_exit_code:2,recovery_kind:"select_directory"},{probe_id:"tracker-root-unreadable",failure_kind:"unreadable_root",expected_error_code:"tracker_root_unreadable",expected_exit_code:1,recovery_kind:"repair_permissions"}];function BD(){return ht.map(e=>({...e}))}function jb(e,t){let r=[];t.error_code!==e.expected_error_code&&r.push({code:"error_code_mismatch",probe_id:e.probe_id,detail:`Expected ${e.expected_error_code}, received ${t.error_code}.`}),t.exit_code!==e.expected_exit_code&&r.push({code:"exit_code_mismatch",probe_id:e.probe_id,detail:`Expected exit ${e.expected_exit_code}, received ${t.exit_code}.`}),t.recovery_kind!==e.recovery_kind&&r.push({code:"recovery_kind_mismatch",probe_id:e.probe_id,detail:`Expected ${e.recovery_kind}, received ${t.recovery_kind}.`});let o=t.suggested_retry_args.indexOf("init"),n=o===0||o===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!n&&r.push({code:"missing_init_recovery",probe_id:e.probe_id,detail:"Missing and uninitialized roots must emit a tokenized init retry."}),(t.unsafe_init_recommended||e.recovery_kind!=="initialize"&&t.suggested_retry_args.includes("init"))&&r.push({code:"unsafe_init_recovery",probe_id:e.probe_id,detail:"A tracker root that cannot be initialized safely must not recommend initialization."}),t.retry_succeeded||r.push({code:"retry_failed",probe_id:e.probe_id,detail:"The emitted retry or safe alternate-root recovery did not execute successfully."}),r}function qD(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of ht){let s=t.get(n.probe_id);if(s===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let i=jb(n,s);r.push(...i),i.length===0&&(o+=1)}return r.sort((n,s)=>n.probe_id.localeCompare(s.probe_id)||n.code.localeCompare(s.code)),{ok:r.length===0,probe_count:ht.length,closed_probe_count:o,findings: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]="41419a34-fcd7-5d1a-a427-4e9e634f9379")}catch{}})();var Pe,Bb=Object.freeze({list:"list-item-projection","list-all":"list-item-projection","list-draft":"list-item-projection","list-open":"list-item-projection","list-in-progress":"list-item-projection","list-blocked":"list-item-projection","list-closed":"list-item-projection","list-canceled":"list-item-projection",get:"get-item-projection",graph:"graph-detail-projection",search:"search-result-projection",history:"history-entry-projection",events:"mutation-event-projection",activity:"activity-entry-projection",deps:"dependency-graph-projection",health:"health-diagnostic-projection",validate:"validation-diagnostic-projection",contracts:"contract-catalog-projection"});function qb(e,t){if(t==="--limit")return"result-row-limit";if(t==="--node-limit")return"graph-node-limit";if(t==="--edge-limit")return"graph-edge-limit";if(t==="--output-limit")return"rendered-output-row-limit";if(t==="--output-budget")return"rendered-output-byte-budget";if(t==="--token-budget")return"context-intent-token-budget";if(t==="--full"){let r=Bb[L(e)];if(r===void 0)throw new Error(`Command ${e} exposes --full without a registered projection concept.`);return r}return t!=="--file"?t.slice(2):["create","update","update-many"].includes(L(e))?"linked-file-path":["comments","notes","learnings"].includes(L(e))?"entry-file-input":"plan-definition-file"}function Me(){if(Pe!==void 0)return Pe;let e=te.filter(({command:n})=>ze(n)).flatMap(({command:n,family:s})=>xt(n,ee(n)).map(i=>({command:n,family:s,concept:qb(n,i.flag),flag:i.flag,aliases:Object.freeze([...i.aliases??[]]),value_kind:i.repeatable?"list":i.flag==="--limit"?"number":i.value_type}))),t=new Set(e.flatMap(n=>n.aliases.map(s=>`${n.command}:${s}`))),r=e.filter(n=>!t.has(`${n.command}:${n.flag}`)),o=new Map;for(let n of r){let s=o.get(n.concept)??new Set;s.add(n.value_kind),o.set(n.concept,s)}return Pe=Object.freeze(r.map(n=>Object.freeze({...n,concept:o.get(n.concept)?.size===1?n.concept:`${n.concept}@${n.command}`}))),Pe}function YD(){return Object.freeze(Me().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var fo=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:102,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:36,events:34,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:32,notes:36,learnings:32,files:39,docs:30,deps:32,plan:111,test:56,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:39,release:25,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),zb=1,_o=Object.freeze(Object.fromEntries(Object.entries({...fo,...Object.fromEntries(Ne.flatMap(({alias:e,canonical:t})=>{let r=fo[e];return r===void 0?[]:[[t,r]]}))}).map(([e,t])=>[e,t+zb])));function ho(){let e=new Map(Object.keys(_o).map(t=>[t,0]));for(let{command:t}of Me())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(_o).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function Hb(e,t,r){for(let o of e)for(let n of o.aliases){let s=t.get(`${o.command}:${n}`);s===void 0||s.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${s.flag}.`})}}function Vb(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let s=e.get(n.command)??0;s===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(s<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${s} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function Kb(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let s=`${n.command}:${n.canonical_flag}`,i=o.get(s);if(!i){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([i.flag,...i.aliases]);for(let d of n.accepted_spellings)a.has(d)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${d} no longer resolves to ${n.canonical_flag}.`})}}function XD(e=Me(),t=ho(),r=[]){let o=[],n=new Map,s=new Map,i=new Map,a=new Map;for(let d of e){let c=`${d.command}:${d.flag}`;n.has(c)?o.push({code:"duplicate_canonical_flag",command:d.command,detail:`${d.flag} has more than one canonical row.`}):n.set(c,d),a.set(d.command,(a.get(d.command)??0)+1);let l=s.get(d.concept);l!==void 0&&l!==d.value_kind?o.push({code:"inconsistent_concept_kind",command:d.command,detail:`${d.concept} uses both ${l} and ${d.value_kind}.`}):s.set(d.concept,d.value_kind);let p=i.get(d.concept);p!==void 0&&p!==d.flag?o.push({code:"semantic_spelling_collision",command:d.command,detail:`${d.concept} is canonicalized by both ${p} and ${d.flag}.`}):i.set(d.concept,d.flag)}return Hb(e,n,o),Vb(a,t,o),Kb(e,r,o),o.sort((d,c)=>d.command.localeCompare(c.command)||d.code.localeCompare(c.code)||d.detail.localeCompare(c.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:d})=>d)).size,baseline_entry_count:r.length,findings:o}}function JD(){let e=Me(),t=ho(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:n}of e)r.set(o,n);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:n,maximum:s})=>{let i=r.get(o);return`| \`${o}\` | ${i} | ${n} | ${s} |`}),""].join(`
34
+ `)}(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]="3f3a5dca-8370-52d7-b279-dc6f9f0aeadf")}catch{}})();function QD(e){return e}function e1(e){return e}function t1(e){return e}function r1(e){return e}function o1(e){return e}function n1(e){return e}function i1(e){return e}function s1(e){return e}function a1(e){return e}function d1(e){return e}function c1(e){return e}function l1(e){return e}function p1(e){return e}function u1(e){return{handled:!0,result:e}}function m1(){return{handled:!1}}function f1(e){return e}function _1(e){return e}function h1(e){return e}function g1(e){return e}function y1(e){return e}function b1(e){return e}function T1(e){return e}function C1(e){return e}function E1(e){return 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]="68ca9ab1-91e0-5020-859e-fc1f1f6dcc56")}catch{}})();function Wb(e={},t={}){return new ge(t).extension(void 0,{...e,migrate:!0})}function Yb(e={},t={}){return new ge(t).packageMigrate(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]="c96e4de9-16ef-581a-aa4b-6450917c2c65")}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]="604d7dcb-9fea-5631-8a72-b2a7ff3278f8")}catch{}})();function N(e){if(typeof e!="string"||!_e(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function Xb(e){let t=N(e.window_start),r=N(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(o=>typeof o!="string"||o.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function Jb(e,t,r,o){let n=new Map(t.map(i=>[i,[]])),s=new Set;for(let i of e){if(typeof i.id!="string"||i.id.trim().length===0||s.has(i.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");s.add(i.id);let a=n.get(i.family);if(!a||!["success","failure","pending"].includes(i.outcome)||i.cause!==void 0&&(!["product","infrastructure","unknown"].includes(i.cause)||i.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let d=N(i.started_at);if(i.repaired_at!==void 0&&(N(i.repaired_at)<d||i.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");d>=r&&d<o&&a.push(i)}return n}function j1(e,t){let{start:r,end:o}=Xb(t),n=[...Jb(e,t.families,r,o)].map(([s,i])=>{let a=i.filter(_=>_.outcome==="failure"),d=i.filter(_=>_.outcome!=="pending").length,c=d===0?null:a.length/d,l=a.filter(_=>_.repaired_at!==void 0&&N(_.repaired_at)<o),p={product:0,infrastructure:0,unknown:0};for(let _ of a)p[_.cause??"unknown"]+=1;let f=[];return d<t.min_completed_attempts&&f.push("insufficient_completed_attempts"),c!==null&&c>t.max_failure_rate&&f.push("failure_rate"),{family:s,attempts:i.length,completed:d,failed:a.length,pending:i.length-d,failure_rate:c,affected_days:[...new Set(a.map(_=>new Date(N(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(N(_.repaired_at)-N(_.started_at))/6e4).sort((_,g)=>_-g),unresolved:a.length-l.length,causes:p,violations:f,ok:f.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(o).toISOString(),ok:n.every(s=>s.ok),families: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]="773ad2b6-326e-5483-bdce-a377f935cb31")}catch{}})();function pe(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function Zb(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!pe(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let o=new Set(r.identities);if(o.size!==r.identities.length||[...o].some(n=>!pe(n)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,o)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function Qb(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let o of e){if(o===null||typeof o!="object"||!pe(o.identity)||r.has(o.identity)||!pe(o.reason)||!pe(o.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let n=o.missing_from;if(!Array.isArray(n)||n.length===0||n.length>=t.length||new Set(n).size!==n.length||[...n].some(s=>!t.includes(s)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(o.identity,o)}return r}function q1(e,t=[]){let r=Zb(e),o=[...r.keys()].sort(),n=Qb(t,o),s=[...new Set([...r.values()].flatMap(c=>[...c]))].sort(),i=[],a=new Set;for(let c of s){let l=o.filter(_=>!r.get(_).has(c));if(l.length===0)continue;let p=n.get(c),f=p!==void 0&&JSON.stringify([...p.missing_from].sort())===JSON.stringify(l);f&&a.add(c),i.push({identity:c,present_in:o.filter(_=>r.get(_).has(c)),missing_from:l,disposition:f?{reason:p.reason,evidence:p.evidence}:null})}let d=[...n.keys()].filter(c=>!a.has(c)).sort();return{schema:"pm-artifact-ledgers/1",ok:i.every(c=>c.disposition!==null)&&d.length===0,counts:Object.fromEntries(o.map(c=>[c,r.get(c).size])),findings:i,stale_exceptions:d}}(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]="15d63d97-9126-59ae-be28-b77fdfd07b9c")}catch{}})();import{createHash as yo,createHmac as eT,randomBytes as tT,timingSafeEqual as rT}from"node:crypto";(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]="98283845-5c48-5901-b54c-c8cc8138427b")}catch{}})();var v$="dev.unbrained.pm/progressive-tool-discovery",O$=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),oT=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),B=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),nT=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),bo={core:0,standard:1,full:2,internal:3},To=Object.freeze(["core","standard","full"]),iT=new Set(["core","standard","full","custom"]),Co=new Set(te.map(({family:e})=>e)),sT=tT(32);function xe(e,t){if(typeof e!="string")throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);let r=e[Symbol.iterator](),o=0;for(let n=r.next();!n.done;n=r.next())if(o+=1,o>4096)throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function Eo(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new b("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function So(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new b("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function wo(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function Ao(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function aT(e){if(!Array.isArray(e))throw new b("pm tool discovery candidates must be an array.",64);for(let[t,r]of e.entries()){if(r===null||typeof r!="object"||Array.isArray(r))throw new b(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new b(`pm tool discovery candidate ${t} name must be a non-empty string.`,64);if(typeof r.description!="string"||r.description.trim().length===0)throw new b(`pm tool discovery candidate ${t} description must be a non-empty string.`,64);if(r.inputSchema===null||typeof r.inputSchema!="object"||Array.isArray(r.inputSchema))throw new b(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new b(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function R$(e){if(Ao(e),e.family!==void 0&&(typeof e.family!="string"||!Co.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!To.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:xe(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:Eo(e.limit)}:{},...e.cursor!==void 0?{cursor:xe(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:wo(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:So(e.outputBudget)}:{}}}function dT(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function ue(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function cT(e,t){let r=ue(e);if(r.length===0)return 0;let o=new Set(ue(t)),n=r.filter(i=>o.has(i)).length,s=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+s)}function lT(e,t){let r=ue(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=ue(t),s=r.filter(a=>n.some(d=>d.startsWith(a)||a.startsWith(d))).length,i=o.includes(e.toLowerCase())?.2:0;return Math.min(1,s/r.length+i)}function go(e){return yo("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function vo(e,t,r){return eT("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function pT(e,t,r){let o={version:1,offset:t,signature:vo(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function uT(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8")),s=n.offset;if(n.version!==1||typeof s!="number"||!Number.isInteger(s)||s<0||s>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(vo(t,s,o),"base64url"),a=Buffer.from(n.signature,"base64url");if(a.length!==i.length||!rT(a,i))throw new Error("cursor signature does not match the request");return s}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function gt(e,t,r){return{value:dT(e),weight:t,available:r!=="unavailable",source:r}}function ke(e,t,r){return gt(e??t,r,e===void 0?"computed":"host")}function mT(e,t,r){let o=Object.hasOwn(he,e.name)?he[e.name]:"help",n=Ve(o),s=`${e.name} ${e.description} ${o} ${n}`,i=cT(t,s),a=new Set(ue(t)),d={lexical:gt(i,B.lexical,"computed"),semantic:ke(e.signals?.semantic,lT(t,s),B.semantic),graph:ke(e.signals?.graph,a.has(n)||a.has(o)?1:0,B.graph),permission:gt(1,B.permission,"authorization"),freshness:ke(e.signals?.freshness,1,B.freshness),usage:ke(e.signals?.usage,oT.includes(e.name)?1:0,B.usage)},c=Object.values(d).reduce((l,p)=>l+p.value*p.weight,0);return{name:e.name,description:e.description,command:o,tier:Ke(o),family:n,score:Number(c.toFixed(6)),signals:d,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function fT(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new b("pm tool discovery cursorIntegrityKey must contain at least 32 bytes.",64);if(e.tier!==void 0&&(typeof e.tier!="string"||!To.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!Co.has(e.family)))throw new b("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!iT.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function _T(e){let t=xe(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");xe(e.cursor===void 0?"":e.cursor,"cursor");let r=Eo(e.limit===void 0?10:e.limit),o=So(e.outputBudget===void 0?1200:e.outputBudget);return fT(e),{query:t,includeSchema:wo(e.includeSchema),limit:r,budget:o,maximumTier:bo[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Oo(e,t,r){let o=r??e.tools.reduce((i,a,d)=>i+(d===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},s=0;for(let i=0;i<4;i+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:s,budget:t,within_budget:!0}}),"utf8"),d=Math.ceil((a+o)/4);if(d===s)break;s=d}return s}function hT(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>mT(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&bo[o.tier]<=r.maximumTier&&(t.family===void 0||o.family===t.family)).sort((o,n)=>n.score-o.score||(o.name<n.name?-1:o.name>n.name?1:0))}function gT(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[s,i]of e.entries()){let a=n+(s===0?0:1)+Buffer.byteLength(JSON.stringify(i),"utf8");if(Oo(r(s+1),t,a)>t)break;o.push(i),n=a}return o}function I$(e,t={}){aT(e),Ao(t);let r=_T(t),o=t.cursorIntegrityKey??sT,n=hT(e,t,r),s=go({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),i=uT(t.cursor,s,n.length,o),a=n.slice(i,i+r.limit),d=[];r.includeSchema||d.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),i+r.limit<n.length&&d.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let c={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:n.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:B},cache:{key:go({fingerprint:s,cursorIntegrityKey:yo("sha256").update(o).digest("hex"),limit:r.limit,offset:i,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:nT}},l=(g,T=g.length)=>{let E=i+T,q=E<n.length,R=[...d];return T<a.length&&R.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...c,tools:[...g],returned:T,has_more:q,...q?{next_cursor:pT(s,E,o)}:{},omission_receipt:{has_omissions:R.length>0,omitted:R}}},p=g=>{let T=l(g),E=Oo(T,r.budget);return{...T,token_cost:{estimated_tokens:E,budget:r.budget,within_budget:r.budget==="unbounded"||E<=r.budget}}},f=gT(a,r.budget,g=>l([],g)),_=p(f);if(a.length>0&&f.length===0){let g=p([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${g}.`,64,{required:String(g)})}if(r.budget!=="unbounded"&&_.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${_.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(_.token_cost.estimated_tokens)});return _}(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]="e02d896b-ffa2-5bfa-83dc-d567e1ecd8be")}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]="438f2063-2307-5945-b1a8-67c0fc24091b")}catch{}})();export{OO as ACTIONABILITY_ORDERING_KINDS,Ud as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,cd as ACTIVITY_FLAG_CONTRACTS,ri as AGENT_PROVENANCE_DIMENSIONS,Ks as AGGREGATE_FLAG_CONTRACTS,xa as APPEND_FLAG_CONTRACTS,cM as ASSURANCE_ACTIONS,lM as ASSURANCE_DECLARATION_KINDS,EI as ASSURANCE_DOCUMENT_VERSION,Qa as ASSURANCE_FLAG_CONTRACTS,SI as ASSURANCE_GATE_TRIGGERS,wI as ASSURANCE_MEASUREMENT_SOURCE_KINDS,_P as ASSURANCE_PRESET_IDS,yI as AssuranceEvaluationRefusalError,gI as AssuranceMutationRefusalError,bI as AssuranceSourceResolutionError,jn as BASELINE_ITEM_FORMAT_VERSION,Qy as BOUNDARY_FIXTURE_CAPTURE_SOURCES,iR as BRIEF_LIST_FIELDS,ni as BUILTIN_AGENT_PROVENANCE_ADAPTERS,Y as BUILTIN_CORPUS_SHAPES,oi as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,pn as BUILTIN_ITEM_TYPE_VALUES,Vt as BUILTIN_PROFILES,IC as BUILTIN_RELATIONSHIP_KINDS,$d as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,dd as CALENDAR_FLAG_CONTRACTS,Na as CLAIM_FLAG_CONTRACTS,Ic as CLOSE_ACTION_OPTION_KEYS,Ma as CLOSE_FLAG_CONTRACTS,ka as CLOSE_MANY_FLAG_CONTRACTS,Ua as CLOSE_TASK_FLAG_CONTRACTS,Ws as COMMENTS_FLAG_CONTRACTS,eC as COMMON_MUTATION_COMMAND_OPTION_KEYS,Cd as COMPLETION_FLAG_CONTRACTS,gn as CONFIDENCE_TEXT_VALUES,ca as CONFIG_FLAG_CONTRACTS,Fd as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,WM as CONTEXT_EVALUATION_METRIC_NAMES,pd as CONTEXT_FLAG_CONTRACTS,Aw as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,qt as CONTEXT_OUTPUT_VALUES,QM as CONTEXT_PACKING_PROFILES,UM as CONTEXT_RECENCY_EPOCH,zM as CONTEXT_RELEVANCE_SERVICE,BM as CONTEXT_RELEVANCE_SIGNAL_NAMES,r0 as CONTEXT_SIGNAL_SET_VERSION,t0 as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,o0 as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,fw as CONTEXT_USAGE_LIMITS,Td as CONTRACTS_FLAG_CONTRACTS,nd as COPY_FLAG_CONTRACTS,rc as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,nc as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,oc as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,ET as CREATE_DIRECT_CLOSE_REASON_DEFAULT,ed as CREATE_FLAG_CONTRACTS,NE as CURRENT_HISTORY_HASH_ALGORITHM,Kw as CURRENT_HISTORY_ITEM_HASH_VERSION,Yw as CURRENT_HISTORY_RECORD_HASH_VERSION,Bn as CURRENT_ITEM_FORMAT_VERSION,a0 as ContextSignalStore,_w as ContextUsageValidationError,xM as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,w0 as DEFAULT_CHILD_SAMPLE_LIMIT,nR as DEFAULT_COMPACT_LIST_FIELDS,yv as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,cf as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,pP as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,wM as DEFAULT_TERMINAL_TRANSITION_POLICY,p0 as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,wR as DEFECT_ESCAPE_CLASSES,AR as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Da as DELETE_FLAG_CONTRACTS,fn as DEPENDENCY_KIND_VALUES,fd as DEPS_FLAG_CONTRACTS,Zs as DOCS_FLAG_CONTRACTS,Xa as DUPLICATES_FLAG_CONTRACTS,jP as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,IR as DefectRecurrencePolicyParseError,hd as EVAL_FLAG_CONTRACTS,tf as EVAL_METRIC_NAMES,sf as EVAL_QUERY_SET_CONTRACT,af as EVAL_QUERY_SET_EXAMPLE,nf as EVAL_QUERY_SET_SCHEMA_ID,ld as EVENTS_FLAG_CONTRACTS,Ba as EVENT_FLAG_CONTRACTS,$o as EXECUTABLE_COMMAND_ALIASES,me as EXIT_CODE,Ta as EXTENSION_ACTIVATE_FLAG_CONTRACTS,ba as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Oa as EXTENSION_ADOPT_FLAG_CONTRACTS,tk as EXTENSION_CAPABILITIES,TT as EXTENSION_CAPABILITY_CONTRACT,yT as EXTENSION_CAPABILITY_CONTRACT_VERSION,bT as EXTENSION_CAPABILITY_LEGACY_ALIASES,xn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,va as EXTENSION_CATALOG_FLAG_CONTRACTS,Ca as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,ya as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Aa as EXTENSION_DOCTOR_FLAG_CONTRACTS,ga as EXTENSION_EXPLORE_FLAG_CONTRACTS,la as EXTENSION_FLAG_CONTRACTS,ua as EXTENSION_INIT_FLAG_CONTRACTS,_a as EXTENSION_INSTALL_FLAG_CONTRACTS,Sa as EXTENSION_MANAGE_FLAG_CONTRACTS,Ea as EXTENSION_MIGRATE_FLAG_CONTRACTS,rk as EXTENSION_POLICY_MODES,ok as EXTENSION_POLICY_SURFACES,wa as EXTENSION_RELOAD_FLAG_CONTRACTS,ik as EXTENSION_SANDBOX_PROFILES,pa as EXTENSION_SCOPE_FLAG_CONTRACTS,nk as EXTENSION_TRUST_MODES,ha as EXTENSION_UNINSTALL_FLAG_CONTRACTS,jR as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,GR as EXTERNAL_DEPENDENCY_SOURCE_KIND,UR as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,Wv as ExtensionCommandError,Js as FILES_FLAG_CONTRACTS,id as FOCUS_FLAG_CONTRACTS,Wa as GC_FLAG_CONTRACTS,cR as GET_DEPTH_INPUT_VALUES,dR as GET_DEPTH_VALUES,ud as GET_FLAG_CONTRACTS,Hs as GLOBAL_FLAG_CONTRACTS,Hp as GRAPH_DURABLE_CACHE_MIN_ITEMS,zp as GRAPH_DURABLE_CACHE_VERSION,_d as GRAPH_FLAG_CONTRACTS,oR as GRAPH_QUERY_DEFAULTS,De as GRAPH_SUBCOMMAND_VALUES,md as GUIDE_FLAG_CONTRACTS,Ja as HEALTH_FLAG_CONTRACTS,oa as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,aP as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,_M as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,na as HISTORY_COMPACT_FLAG_CONTRACTS,yi as HISTORY_EVENT_CLASSIFICATION_VERSION,Qs as HISTORY_FLAG_CONTRACTS,kE as HISTORY_HASH_ALGORITHMS,av as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,ta as HISTORY_REDACT_FLAG_CONTRACTS,ra as HISTORY_REPAIR_FLAG_CONTRACTS,kl as INIT_AGENT_GUIDANCE_MODE_VALUES,da as INIT_FLAG_CONTRACTS,Ra as INSTALL_FLAG_CONTRACTS,hn as ISSUE_SEVERITY_VALUES,rd as ITEM_COMPLETE_FLAG_CONTRACTS,kP as ITEM_LATEST_TIMESTAMP_FIELDS,CT as ITEM_METADATA_KEY_ORDER,td as ITEM_MUTATE_FLAG_CONTRACTS,od as ITEM_REOPEN_FLAG_CONTRACTS,Os as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,vs as ITEM_REVISION_CONFLICT_CODE,AP as ITEM_SCALAR_MISSING_VALUE,un as ITEM_TYPE_VALUES,MP as ITEM_UNION_COLLECTION_FIELDS,s0 as JsonFileContextSignalStoreAdapter,Xs as LEARNINGS_FLAG_CONTRACTS,xE as LEGACY_HISTORY_HASH_ALGORITHM,Ru as LINKED_TEST_ENV_NAME_PATTERN,Iu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Ou as LINKED_TEST_PROTECTED_ENV_KEYS,Pu as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Ld as LIST_COMMANDER_STRING_OPTION_CONTRACTS,sR as LIST_COMMAND_DEFAULT_PROJECTIONS,ak as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,Vs as LIST_FILTER_FLAG_CONTRACTS,YR as LIST_SORT_FIELDS,XR as LIST_SORT_ORDER_VALUES,bi as MAINTENANCE_HISTORY_OPERATIONS,S0 as MAX_CHILD_PROJECTION_ITEMS,RT as MAX_WORKFLOW_POLICIES,IT as MAX_WORKFLOW_POLICY_TERMS,ja as MEET_FLAG_CONTRACTS,z0 as MERGE_DRIVER_ARTIFACT_VALUES,ea as MERGE_FLAG_CONTRACTS,$e as MERGE_SUBCOMMAND_VALUES,K0 as MUTATION_EVENT_WIRE_BUDGET,se as MemoryRelationshipGraphAdapter,Gd as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,yd as NEXT_FLAG_CONTRACTS,vm as NEXT_OUTPUT_VALUES,kM as NEXT_RANKING_POLICIES,Ys as NOTES_FLAG_CONTRACTS,qO as OutputEnvelopeFitError,ma as PACKAGE_FLAG_CONTRACTS,fa as PACKAGE_INIT_FLAG_CONTRACTS,Ga as PAUSE_TASK_FLAG_CONTRACTS,Rc as PLAN_CREATE_METADATA_PARAMETER_KEYS,aa as PLAN_FLAG_CONTRACTS,js as PLAN_SHOW_DEPTH_VALUES,Ye as PLAN_SUBCOMMANDS,Lm as PLAN_TEMPLATE_NAMES,lb as PM_AGENT_TASK_ACCOUNTING_MODES,ut as PM_AGENT_TASK_TRANSCRIPT_VERSION,xo as PM_BULK_LIFECYCLE_COMMAND_ALIASES,rs as PM_CLI_ERROR_DETAILS_LIMITS,ds as PM_CLI_EXPECTED_ERROR_NAME,hR as PM_CLI_GRAMMAR_CONTRACT,pR as PM_CLI_GRAMMAR_NOUNS,Xo as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,uR as PM_CLI_SHARED_VERBS,Do as PM_COMMAND_ALIAS_CONTRACTS,te as PM_COMMAND_CAPABILITY_CONTRACTS,It as PM_COMMAND_DESTINATION_CONTRACTS,uI as PM_COMMAND_EXIT_CONTRACTS,pI as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Pi as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,dI as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,qe as PM_COMMAND_POSITIONAL_CONTRACTS,tl as PM_COMMAND_VISIBILITY_CONTRACTS,tP as PM_COMPLETE_LIST_FINDING_CODES,LO as PM_CONTEXT_INTENTS_FILE,vw as PM_CONTEXT_INTENT_CONTRACTS,ko as PM_CONTEXT_OPS_COMMAND_ALIASES,Vo as PM_CORE_COMMAND_NAMES,G as PM_CORPUS_SHAPE_SCHEMA,Zo as PM_DEPRECATED_TOOL_ACTIONS,Ai as PM_DIAGNOSTIC_DEGRADATION_STEPS,vi as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,wi as PM_DIAGNOSTIC_OUTPUT_CLASSES,Qo as PM_DISCOVERABLE_TOOL_ACTIONS,Yr as PM_EPISODE_SCHEMA,sI as PM_ERROR_CODE_CATALOG,rI as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,to as PM_EXACT_COVERAGE_METRICS,Uo as PM_EXTENSION_CAPABILITY_CONTRACTS,Ko as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,Bo as PM_EXTENSION_POLICY_MODE_CONTRACTS,Ho as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,zo as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,jo as PM_EXTENSION_SERVICE_NAME_CONTRACTS,qo as PM_EXTENSION_TRUST_MODE_CONTRACTS,Di as PM_GENERIC_REFUSAL_GUIDANCE,VI as PM_GITATTRIBUTES_END,HI as PM_GITATTRIBUTES_START,WI as PM_GITATTRIBUTES_V2_END,KI as PM_GITATTRIBUTES_V2_START,cl as PM_GITIGNORE_END,dl as PM_GITIGNORE_START,bM as PM_HISTORY_ATTESTATION_CONTRACT,Mo as PM_HISTORY_COMMAND_ALIASES,XE as PM_HISTORY_OPERATION_ALIASES,ZE as PM_HISTORY_OPERATION_CONTRACT,JE as PM_HISTORY_OPERATION_PATTERNS,Yo as PM_ITEM_ACTION_SUBCOMMANDS,WE as PM_ITEM_HISTORY_OPERATIONS,it as PM_MCP_APPS_EXTENSION,kr as PM_MCP_APPS_SERVER_CAPABILITY,Ae as PM_MCP_APPS_SPEC_VERSION,Lr as PM_MCP_APP_CONTRACTS,Nr as PM_MCP_APP_MIME_TYPE,oT as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,EN as PM_MCP_HTTP_PROTOCOL_VERSION,Cg as PM_MCP_INPUT_REQUEST_METHODS,nr as PM_MCP_LEGACY_PROTOCOL_VERSIONS,or as PM_MCP_LOG_LEVELS,w as PM_MCP_META_KEYS,v$ as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,O$ as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,sl as PM_MCP_PROMPT_CONTRACTS,H as PM_MCP_PROTOCOL_VERSION,il as PM_MCP_RESOURCE_CONTRACTS,at as PM_MCP_SKILLS_DRAFT_REVISION,Dr as PM_MCP_SKILLS_EXTENSION,Oy as PM_MCP_SKILLS_SERVER_CAPABILITY,P as PM_MCP_SKILL_LIMITS,Se as PM_MCP_SUBSCRIPTION_ID_META_KEY,re as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,fN as PM_MCP_TASKS_EXTENSION,kg as PM_MCP_TASK_STATUSES,he as PM_MCP_TOOL_COMMAND_CONTRACTS,pS as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,us as PM_MUTATION_ACTION_CONTRACTS,Ne as PM_NAMESPACED_COMMAND_ALIASES,Kr as PM_OBSERVATION_SCHEMA,Si as PM_OUTPUT_BUDGET_CLASSES,Ei as PM_OUTPUT_DEGRADATION_STEPS,Nt as PM_OUTPUT_ENVELOPE_KINDS,Gt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Wo as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Ft as PM_PACKAGE_RESOURCE_KINDS,Be as PM_POSITIONAL_ACTION_CONTRACTS,Dc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Nc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,BS as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,tw as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,US as PM_READ_OUTPUT_DIMENSIONS,jS as PM_READ_OUTPUT_OPTION_FLAGS,LS as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,NS as PM_READ_OUTPUT_SESSION_MIN_TOKENS,jC as PM_READ_OUTPUT_SURFACES,qS as PM_READ_OUTPUT_SURFACE_CONTRACTS,MS as PM_READ_OUTPUT_TAIL_RETENTION_POLICIES,lS as PM_READ_ROW_CONTRACTS,cS as PM_READ_ROW_JQ_SELECTOR,Ui as PM_RECOVERY_ECHO_FIELDS,_D as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,Nb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,uo as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,ED as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,po as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,No as PM_RELOCATED_COMMAND_ALIASES,Fc as PM_REPRODUCIBLE_PROCESS_ENV,mI as PM_SUCCESS_EXIT_CODES,Jo as PM_TOOL_ACTIONS,Pc as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Lc as PM_TOOL_PARAMETERS_SCHEMA,xc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,kc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,vc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Wr as PM_VERDICT_SCHEMA,YE as PM_WORKSPACE_HISTORY_OPERATIONS,Hr as PM_WORKSPACE_RECIPE_SCHEMA,sa as PROFILE_FLAG_CONTRACTS,Qt as PROFILE_LINT_CODES,Zt as PROFILE_LINT_DIMENSIONS,Ht as PROFILE_NAMES,Xe as PROFILE_SUBCOMMANDS,b as PmCliError,ge as PmClient,rP as PmCompleteListValidationError,y as PmMcpAuthorizationError,ir as PmMcpInputRequiredError,Or as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,sr as PmMcpRequestStateReplayGuard,Br as PmMcpSkillRegistry,gr as PmMcpSubscriptionRegistry,ot as PmMcpTaskStore,mw as QUERY_CURSOR_CONTRACT,Pa as REINDEX_FLAG_CONTRACTS,QA as REINDEX_LOCK_ID,pt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,$a as RELEASE_FLAG_CONTRACTS,qa as REMIND_FLAG_CONTRACTS,At as RESERVED_ITEM_FIELD_NAMES,La as RESTORE_FLAG_CONTRACTS,_n as RISK_VALUES,HO as RelationshipEventLog,VO as RelationshipEventStore,z as RelationshipGraph,Ue as RelationshipKindRegistry,ia as SCHEMA_FLAG_CONTRACTS,Dd as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,dk as SEARCH_EXTENSION_FLAG_DEFINITIONS,bd as SEARCH_FLAG_CONTRACTS,Wu as SEMANTIC_ATTRIBUTION_LIMITS,wT as SETTINGS_DEFAULTS,ff as SNAPSHOT_SCHEMA,BI as SOURCE_CONTEXT_ACCESS_ENV,qI as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Qu as START_BLOCKED_REFUSAL_CODE,Zu as START_BLOCKER_ENFORCEMENT_DEFAULT,Fa as START_TASK_FLAG_CONTRACTS,Ya as STATS_FLAG_CONTRACTS,mn as STATUS_VALUES,zs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Ti as SUBSTANTIVE_HISTORY_OPERATIONS,Ww as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Xw as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,LC as SUPPRESS_HOST_OUTPUT_MARKER,Va as TELEMETRY_FLAG_CONTRACTS,Bf as TELEMETRY_SUBCOMMANDS,Ha as TEST_ALL_FLAG_CONTRACTS,za as TEST_FLAG_CONTRACTS,Ka as TEST_RUNS_FLAG_CONTRACTS,$f as TEST_RUN_MEASUREMENT_LIMIT,Ec as TOOL_ACTIVITY_OPTION_CONTRACTS,lc as TOOL_AGGREGATE_OPTION_CONTRACTS,yc as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Cc as TOOL_CALENDAR_OPTION_CONTRACTS,Tc as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Sc as TOOL_CONTEXT_OPTION_CONTRACTS,_c as TOOL_CREATE_OPTION_CONTRACTS,fc as TOOL_CREATE_OPTION_CONTRACT_SOURCE,wc as TOOL_DEPS_OPTION_CONTRACTS,Ac as TOOL_GRAPH_OPTION_CONTRACTS,cc as TOOL_LIST_FILTER_OPTION_CONTRACTS,pc as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,mc as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,uc as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,bc as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,gc as TOOL_UPDATE_OPTION_CONTRACTS,hc as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,ST as TYPE_TO_FOLDER,OC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,ic as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,ac as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,sc as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,sd as UPDATE_FLAG_CONTRACTS,ad as UPDATE_MANY_FLAG_CONTRACTS,Ia as UPGRADE_FLAG_CONTRACTS,Za as VALIDATE_FLAG_CONTRACTS,OT as WORKFLOW_POLICY_ACTIONS,JI as WORKFLOW_POLICY_DOCUMENT_SCHEMA,XI as WORKFLOW_POLICY_SCHEMA,gd as WORKSPACE_FLAG_CONTRACTS,yA as WORKSPACE_HISTORY_ID,_f as WORKSPACE_SNAPSHOT_ACTIONS,Wl as WorkspaceGraphCache,JO as WorkspaceTransactionInterruptedError,bu as _testOnly,E0 as _testOnlyAggregateCommand,Vl as _testOnlyConfigCommand,R0 as _testOnlyGetCommand,iu as _testOnlyHealthCommand,Dl as _testOnlyInit,xl as _testOnlyInitAgentGuidance,Sk as _testOnlyItemTransaction,J0 as _testOnlyMutationEvents,b0 as _testOnlyNextCommand,q0 as _testOnlySearchCommand,mP as _testOnlySimilarity,Gm as _testOnlyTemplates,hu as _testOnlyValidateCommand,ek as _testOnlyWorkspacePosition,Ak as abandonItemTransaction,rR as abandonWorkspaceTransaction,bP as acceptAssuranceProposals,fu as acknowledgeLinkedTests,zl as acknowledgeUnknownAuthorHistoryEvents,ql as acknowledgeUnknownAuthorHistoryEventsFromTransport,bv as acquireItemMetadataDerivedIndexLock,je as acquireLock,ti as acquireLockLease,nx as activateExtensionForTest,QC as activateExtensions,tm as admitStartWithOpenBlockers,ei as agentSessionEnvironment,q_ as aggregate,vf as analyzeAgentProvenanceDescriptorCoverage,OR as analyzeDefectChangeRisk,dM as analyzeDefectRecurrenceCoverage,gp as analyzeDuplicateItems,WO as analyzeGraphImpact,Hc as analyzeHierarchyIntegrity,YO as analyzeKnowledgeGraph,_I as analyzePmCommandExitConformance,en as analyzePmToolActionParity,YP as analyzeReconciliationDiscard,KO as analyzeRelationshipExecution,Dp as analyzeRelationshipSchedule,mg as analyzeSdkActionCoverage,Pt as analyzeSdkCliParameterCompleteness,th as append,qi as appendHistoryEntry,EA as appendWorkspaceAuditEvent,CA as appendWorkspaceHistoryChange,UT as applyAcceptanceCriteriaMutations,gP as applyAssurancePreset,Rd as applyBootstrapPagerPolicy,oM as applyClosureTimestampFix,Mw as applyContextIntentProjection,Am as applyContextTagProjection,JR as applyFilterValueEcho,ov as applyHistoryPatch,$c as applyInvocationAuthorOverride,op as applyPathMigrations,JS as applyReadOutputDimensions,KS as applyReadOutputIncludeModes,$S as applyReadOutputSessionReferences,AE as applyRegisteredItemFieldDefaultsAndValidation,ap as applyStandaloneNote,Fs as applyStoredExtensionMigrationState,BT as applyTagRemovals,RM as applyTerminalOrderingPolicy,dp as artifactKey,_C as asRecordClone,fC as asRecordOrNull,He as assembleWorkspaceRelationshipGraph,sP as assertCompleteListResult,Fx as assertExtensionBlueprint,$x as assertExtensionCapabilityUsage,bx as assertExtensionDeactivated,jx as assertExtensionManifestCompatible,Ux as assertExtensionManifestMatchesBlueprint,Bx as assertExtensionPreflight,Wc as assertHierarchyMutationAllowed,hM as assertHistoryCompactTarget,JP as assertHistoryRepairTarget,Ji as assertInitializedTracker,np as assertLinkedArtifactMutationIsUnambiguous,Hx as assertMcpClientCapabilities,zx as assertMcpProtocolHeader,cb as assertMemoryRelationshipGraphAdapterConformance,HT as assertNoUnknownCsvKeys,vu as assertNonHierarchyCardinalityMutationAllowed,Tx as assertPackageManifest,MA as assertParentReferenceIsNotSelf,ZN as assertPmMcpSkillsCapability,Gx as assertProjectProfile,fv as assertProjectRuntimeCompatibility,pv as assertProjectRuntimeFormatGuard,uS as assertProjectionModeChoice,Xi as assertReadableTrackerRoot,Cx as assertRegisteredCommandContract,Mx as assertRegisteredCommandOverride,Ox as assertRegisteredExporter,Ex as assertRegisteredFlags,Sx as assertRegisteredHook,vx as assertRegisteredImporter,Rx as assertRegisteredItemField,Ix as assertRegisteredItemType,Dx as assertRegisteredMigration,kx as assertRegisteredParserOverride,xx as assertRegisteredPreflightOverride,Px as assertRegisteredProfile,Nx as assertRegisteredRendererOverride,wx as assertRegisteredSearchProvider,Lx as assertRegisteredServiceOverride,Ax as assertRegisteredVectorStoreAdapter,xC as assertRelationshipEdgeAllowed,no as assertRelationshipGraphAdapterConformance,FT as assertSchemaPreviewSupported,Hf as assertTestMeasurementRun,Bw as assertWellFormedOutputText,AI as assuranceAssertionUpdateIsLoosening,Nw as attachContextIntentReceipt,hw as attachContextUsageServingReceipt,lu as attachLinkedTestMutationProvenance,cu as attachLinkedTestProvenance,Ze as attachMcpServerInfo,yS as attachOutputOmissionReceipt,Dw as attachOutputTokenAccounting,Lw as attachReadOutputContracts,FS as attachReadOutputSessionReceipt,hl as auditMergeAttributeFence,YI as auditMergeDriverConfiguration,Bp as auditWorkspaceRelationshipGraph,$N as authorizeMcpHttpRequest,Zn as boundAgentEpisodeIdentity,OS as boundReadOutputRows,Cm as buildChildrenByParent,$0 as buildCompactSearchFilterSummary,ZR as buildContentFilterEcho,i0 as buildContextSignalSnapshot,Vy as buildCorpusShapeItemPlan,vR as buildDefectRecurrenceIndex,vl as buildExtensionDescribeResult,Rl as buildExtensionInstallPlan,QR as buildGovernanceMissingFilterEcho,jA as buildInvalidTypeError,A0 as buildItemChildrenRollup,Ck as buildItemCompletionMutations,qM as buildItemContextRelevanceCandidates,Av as buildItemNotFoundError,O0 as buildItemSchedule,nM as buildLinkedFileRepairReport,RN as buildMcpAuthorizationDiscoveryUrls,gg as buildMcpCompleteResult,Kx as buildMcpDiscoverResult,xN as buildMcpDynamicRegistrationMetadata,TN as buildMcpHttpRequestHeaders,tN as buildMcpInputRequiredResult,ON as buildMcpProtectedResourceMetadata,fl as buildMergeAttributePatterns,Mc as buildPmActionToolInputSchema,AD as buildPmRefusalClosureCensus,uP as buildRelationshipContext,Pv as buildSearchCorpus,kv as buildSemanticCorpusInput,eM as buildStatusRoleWarnings,Yi as buildTrackerInitializationRecovery,$v as buildVectorizationEmbeddingIdentity,Fv as buildVectorizationEmbeddingMetadata,F0 as buildVerboseSearchFilters,ZI as buildWorkflowCompletenessCheck,u0 as buildWorkspaceMemorySnapshot,Jn as canonicalDocument,tC as canonicalizeCommandOptionKey,Fk as canonicalizeCommandSuggestions,jM as canonicalizeContextRecencyCoordinate,PC as canonicalizeRelationshipKind,hD as censusPmRecoveryReferenceProducers,iP as certifyCompleteListResult,ex as checkExtensionManifestCompatibility,Fh as claim,Gh as claimNext,dP as classifyHistoryAuthorEvent,Ci as classifyHistoryEvent,KP as classifyHistoryMergeReceiptReferences,HC as classifyHostEnvironmentFault,U0 as classifyImplicitSemanticFallbackReason,Hn as classifyItemFormatVersion,Kf as classifyLinkedTestCommandSafety,Wf as classifyLinkedTestFailure,hE as clearActiveExtensionHooks,Xp as clearDurableGraphCache,nS as clearFocusedItem,t_ as clearWorkspaceContractsCache,$h as close,Cu as closeItem,Kh as closeTask,Md as coalesceRepeatedListFlags,RO as collectBlockedByIds,PO as collectBlockedByIdsFromCorpus,yw as collectContextUsageDeliveredItemIds,Zc as collectDanglingDependencyReferences,kO as collectDependencyBlockedIds,Xc as collectDuplicateDependencyRows,jp as collectDuplicateRelationshipEdgeGroups,G0 as collectErrorCauseCodes,zc as collectHierarchyRelations,Sr as collectMcpHeaderAnnotations,Qc as collectMissingDependencyTargetIds,Au as collectNewOrderingCycleWarnings,Fp as collectOrderingCycles,Jc as collectOrderingStorageContradictions,FO as collectPackageContextIntentContracts,jt as collectPackageExtensionDirectories,SE as collectRegisteredItemFieldNames,BE as collectRuntimeCreateFieldValues,BA as collectRuntimeFilterValues,qE as collectRuntimeUpdateFieldValues,hm as collectSubtreeIds,Nn as collectUsedExtensionCapabilities,rC as commandOptionFlagLabel,V_ as comments,A_ as commitImportedItem,Ek as commitItemCompletion,Tk as commitItemMutations,QO as commitWorkspaceTransaction,qs as compactFlagAliasContracts,gm as compareCriticalItems,dv as comparePmDateVersions,XO as compareRelationshipSnapshots,hC as compareTimestampStrings,FM as compileHistoryProvenanceMatcher,Iw as composeContextIntentContracts,Kk as composeExtension,Qk as composeExtensionPackage,NO as computeActionabilityReport,_A as computeHistoryDiff,Np as computeRelationshipCentrality,xp as computeRelationshipDominators,Kl as computeWorkspaceGraphFingerprint,oh as config,_E as consumeAfterCommandAffectedItems,$_ as context,xw as contextIntentRowId,jh as copy,Yf as countFailureCategories,AS as countReadOutputRows,Nh as create,hP as createAssurancePreset,sM as createAssuranceWorkspaceContext,yC as createCheckpointId,oP as createCompleteListOptions,eE as createCoreCommandHookContext,eo as createCorpusShapeMeasurement,PI as createEmptyAssuranceDocument,BC as createEmptyExtensionRegistrationRegistry,Yv as createExtensionCommandError,Ls as createExtensionCommandSdk,Mn as createExtensionContributionInventory,qx as createExtensionTestHarness,Bi as createHistoryEntry,lO as createLazyModule,QI as createLifecycleCompletenessPolicies,FN as createMcpStaticBearerVerifier,_N as createMcpTaskStore,wv as createMutationGuardSdk,mS as createOutputOmissionReceipt,ls as createPmCliExpectedError,Ns as createPmCliProgram,Ri as createPmCommandOutputBudget,sw as createQueryFingerprint,db as createRelationshipGraphScaleFixture,Z as createRelationshipGraphSnapshot,wt as createRelationshipKindRegistry,Uc as createReproducibleProcessRunner,L0 as createSearchCursorFingerprint,tE as createSerialQueue,JT as createStdinTokenResolver,RC as createUnknownSubcommandError,$T as createWorkflowPolicyEvaluator,hf as createWorkspaceSnapshot,ix as deactivateExtensionForTest,m1 as declineServiceOverride,kw as decodeContextIntentCursor,cO as decodeHtmlEntitiesInOptions,Er as decodeMcpHttpHeaderValue,Fw as decodePmTableRows,lw as decodeQueryCursor,dw as decodeQueryCursorEnvelope,cw as decodeQueryCursorState,nw as decodeReadOutputContinuationCursor,rx as decodeToon,qN as decoratePmMcpToolsWithApps,lp as dedupeLinkedArtifacts,vE as defaultConfigScope,HM as defaultScoreContextCandidates,b1 as defineAfterCommandHook,g1 as defineBeforeCommandHook,y1 as defineBeforeMutationHook,t1 as defineCommand,d1 as defineCommandOverride,W as defineCorpusShape,dL as defineEpisodeSpecification,h1 as defineExporter,Hk as defineExtension,Vk as defineExtensionBlueprint,QD as defineExtensionManifest,r1 as defineFlag,_1 as defineImporter,n1 as defineItemField,o1 as defineItemType,i1 as defineMigration,Dy as defineObservationContract,E1 as defineOnIndexHook,C1 as defineOnReadHook,T1 as defineOnWriteHook,c1 as defineParserOverride,Ii as definePmCommandOutputBudget,aI as definePmCommandOutputEnvelope,oI as definePmErrorCodeCatalog,l1 as definePreflightOverride,e1 as defineProjectProfile,f1 as defineRendererOverride,s1 as defineSearchProvider,p1 as defineServiceOverride,a1 as defineVectorStoreAdapter,Uy as defineVerdictContract,ve as defineWorkspaceRecipe,Bh as deleteItem,Ef as deleteWorkspaceSnapshot,NC as dependencyToRelationship,Q_ as deps,yP as deriveAssuranceProposals,tM as deriveClosureTimestamp,Yk as deriveExtensionCapabilities,ck as deriveMutationTransactionId,hI as derivePmBulkMutationEffect,gD as derivePmRecoveryReferenceObligations,$p as deriveRelationshipDeadlines,Tl as deriveSchemaEvolutionMigrationId,tO as deriveTelemetryCommandResolution,VA as describeAllowedTransitions,jI as describeExtensionActivation,Xk as describeExtensionBlueprint,AC as describeFlagScalarValueFailure,nm as describeItemOwnershipConflict,Ms as describeItemRevisionChanges,aL as describeObservationCost,Xt as describeProfileComposition,Jt as describeProjectProfile,Rk as describeReadCompletenessControls,Xv as describeUnknownError,pi as detectAgentIdentity,_i as detectHarnessIdentity,Mp as detectRelationshipCommunities,ui as diagnoseAgentIdentity,qp as diffRelationshipAuditSnapshots,Uf as diffTestRunMeasurements,nN as digestMcpRequestParameters,JC as discoverExtensions,Tn as discoverNearbyPmRoot,I$ as discoverPmTools,lv as discoverProjectRuntimeVersionPins,Z_ as docs,H_ as duplicates,Vp as durableGraphCachePath,Jp as durableGraphCacheStatus,qn as effectiveItemFormatVersion,EO as emitTelemetryErrorEvent,w_ as emptyImportedDocument,OP as encodeItemScalarDecisionValue,Cr as encodeMcpHttpHeaderValue,$w as encodePmTableRows,aw as encodeQueryCursor,ow as encodeReadOutputContinuationCursor,ox as encodeToon,hA as enforceHistoryStreamPolicyForItem,gA as enforceHistoryStreamPolicyForItems,eI as enrichCliFlagInvocationContract,xt as enrichCliFlagInvocationContracts,iv as ensureMaterializedHistoryTarget,pl as ensurePmGitignore,Zl as ensureScope,Kv as ensureSentryCommandTracing,Vv as ensureSentryInit,S_ as ensureTrackerInitialized,Ip as enumerateRelationshipPaths,ki as estimatePmOutputTokens,kI as evaluateAssuranceAssertion,xI as evaluateAssuranceGate,vL as evaluateBoundaryFixtures,YM as evaluateContextRanking,RR as evaluateDefectGateEvidence,MI as evaluateMeasurement,of as evaluateMetricFloors,fs as evaluateMutationGuard,kf as evaluateProvenanceCoverage,j1 as evaluateReliabilityWindow,If as evaluateSemanticAttributionCoverage,bp as evaluateSimilarityGovernance,HA as evaluateTransition,jy as evaluateVerdictContract,DT as evaluateWorkflowPolicies,ts as executeEmbeddingBatchesWithRetry,Lv as executeVectorDelete,Dv as executeVectorReset,Nv as executeVectorUpsert,ky as executeWorkspaceRecipe,sp as expandAddGlobEntries,Cp as explainSourceTraceability,CM as exportAttestation,Wh as extension,Xh as extensionActivate,Jh as extensionDeactivate,Yh as extensionList,Wb as extensionMigrate,VP as extractHistoryMergeReceiptDispositions,HP as extractHistoryMergeReceiptReferences,NN as extractMcpTraceContext,tv as extractPatchFailureContext,su as extractReferencedPmItemIdsFromCommand,ab as federateRelationshipGraphSnapshots,Y_ as files,X_ as filesDiscover,J_ as filesLookup,bw as finalizeContextUsageDelivery,Zy as findCoverageDeficits,yp as findDuplicateClusters,ml as findGitWorkspaceRoot,$E as findHistoryIdentityDiscontinuities,wl as findInstalledNpmPackageCandidate,BN as findPmMcpAppByUri,Lo as findPmNamespacedCommand,kp as findRedundantRelationshipEdges,Lp as findRelationshipCutStructure,hp as findSimilarItems,CO as finishTelemetryCommand,zO as fitOutputEnvelope,wC as flattenFlagListValue,Yy as flushTelemetryQueue,zh as focus,Pp as forEachMatchedRelationshipEdge,Up as formatDuplicateEdgeGroup,Vc as formatHierarchyRelation,Gp as formatOrderingStorageContradiction,_R as formatPmPositionalActionFlagTip,Jm as formatProfileApplyHuman,Xm as formatProfileLintHuman,Wm as formatProfileListHuman,Ym as formatProfileShowHuman,Sl as formatSchemaEvolutionMigrationHuman,B0 as formatVectorIndexRecoveryWarnings,Q0 as formatWorkspacePositionHuman,Rh as gc,Vi as generateItemId,j_ as get,uE as getActiveCommandResult,Ow as getActiveContextIntentContracts,Dn as getActiveExtensionRegistrations,DN as getActiveMcpTraceContext,LI as getAssuranceDeclaration,lg as getContracts,rS as getFocusedItem,Sn as getHistoryPath,BO as getItemAt,En as getItemPath,gs as getMutationActionContract,ll as getPmGitignoreBlock,Cn as getSettingsPath,r_ as getWorkspaceContracts,bA as getWorkspaceHistoryPath,eh as graph,Kp as graphAuditBaselinePath,Pf as groupHistoryByEpisode,u1 as handleServiceOverride,Vx as hasMcpClientExtension,jN as hasPmMcpAppsCapability,ze as hasSubcommandFlagContractsForCommand,Gv as hasVectorizationEmbeddingIdentityChanged,Uv as hasVectorizationVectorDimensionChanged,nA as hashDocument,iA as hashDocumentForVersion,sA as hashEmptyDocument,Zw as hashHistoryPatch,Jw as hashHistoryRecord,Qw as hashHistoryStream,RP as hashItemScalarDecisionValue,Oh as health,Ap as hierarchyAncestors,vp as hierarchyDescendants,kh as historyCompact,xh as historyCompactBulk,DE as historyDigest,$M as historyEntryMatchesProvenance,cv as historyItemHashVersionForRuntime,Ih as historyRedact,Ph as historyRepair,Mh as historyRepairAll,IO as indexBlockedByIds,Kc as indexHierarchyRelations,jv as inferConsistentVectorDimension,Oi as inferPmOutputBudgetClass,rh as init,nP as inspectCompleteListResult,qC as inspectExtensionManifestSchema,Fl as inspectHistoryAuthorStream,DP as inspectMergeReceiptEvidence,mv as inspectProjectRuntimeCompatibility,Ss as inspectStaleInProgressItems,fg as inspectStaticExtensionInventory,QP as inspectStatusRoleAssignments,TA as inspectWorkspaceHistoryState,gf as inspectWorkspaceSnapshot,bl as installMergeFence,Wx as interpretMcpResultType,Rm as isAlreadyClaimedError,Qv as isCommanderError,Mk as isCompatibleRecoveryFlag,Wd as isErrnoError,wO as isExternalDependencyReference,AO as isExternalDependencySourceKind,fe as isFileMissingError,$i as isGenericRefusalRequired,Fi as isGenericRefusalWhy,$C as isHostOutputSuppressed,cs as isItemAlreadyExistsError,ks as isItemRevisionConflict,vP as isItemScalarMissingValue,BP as isLegacyMergeReceiptSummary,h as isMcpRecord,_s as isMutationAction,kC as isOrderingRelationshipKind,IA as isPlaceholderReferenceToken,os as isPmCliErrorDetails,ps as isPmCliExpectedError,rn as isPmExtensionCapabilityContract,nn as isPmExtensionPolicyModeContract,sn as isPmExtensionPolicySurfaceContract,on as isPmExtensionServiceNameContract,fI as isPmKnownExitCode,cI as isPmMutationReceipt,We as isPmSuccessfulExitCode,as as isPmTokenBudgetRecovery,tn as isPmToolAction,qP as isPreDurableCloneLocalReceiptSummary,zP as isPreDurableDispositionEligibleReference,uv as isProjectMutatingInvocation,pO as isPureSnakeCaseAlias,QS as isReadOutputBudgetExceeded,xS as isReadOutputSessionReference,Pk as isReadProjectionRecoveryFlag,ZS as isReadResultOmittedForBudget,_S as isReadRowContract,Bc as isRuntimeRecord,YA as isSettingsReadFallback,em as isStartTransition,fO as isTerminalPlanMode,HE as isTerminalStatus,In as isTimestampLiteral,fk as itemDocumentToMutationOptions,v0 as itemHasSchedule,kn as jaccardSimilarity,W_ as learnings,vC as levenshteinDistanceWithinLimit,Hd as limitAnnotationEntries,pu as linkedTestTrustFingerprint,Jk as lintExtensionBlueprint,zC as lintExtensionManifestSchema,er as lintProjectProfile,F_ as list,si as listAgentProvenanceAdapters,Pd as listAliasPluralKeys,G_ as listAllComplete,Ev as listAllDocumentCandidatesCached,es as listAllItemMetadata,Sv as listAllItemMetadataLight,NI as listAssuranceDeclarations,UI as listAssuranceVerdicts,zy as listBuiltinCorpusShapes,Gk as listCoreClosedDomainContracts,lR as listGetProjectionFields,SP as listInvalidProvenanceHistoryStreamIds,aR as listListProjectionFields,$P as listMergeReceipts,hs as listMutationActions,W0 as listMutationEvents,ho as listPmCommandFlagBudgets,ol as listPmCommandsForFamily,rl as listPmCommandsForTier,Me as listPmFlagLexicon,YD as listPmFlagSpellingInventory,nl as listPmMcpToolsForProfile,FD as listPmRequiredArgumentRefusalContracts,GD as listPmSubcommandRefusalContracts,Yt as listProfiles,BD as listTrackerPreflightRecoveryContracts,gk as listUpsertKeyCandidates,yf as listWorkspaceSnapshots,GO as loadContextIntentRuntimeLayers,Um as loadCreateTemplateOptions,ZC as loadExtensions,Qp as loadGraphAuditBaseline,yk as loadGuardedRuntimeSchema,TC as loadMutationCheckpoint,x as loadRelationshipGraphAdapter,Zi as locateItem,zT as looksLikeGenericKeyValueEntry,vS as mapReadOutputRows,FP as markMergeReceiptReconciled,qA as matchesRuntimeFilters,bO as maybeRunFirstUseTelemetryPrompt,Ky as measureCorpusShapePlan,Wi as measureItemMetadataReadWork,jT as mergeAdditiveTags,Wk as mergeExtensionBlueprints,IP as mergeHistoryStreams,xP as mergeItemDocuments,NP as mergeJsonDocuments,kd as mergeLinkedTestTwoTokenEntries,PP as mergeRelationshipEventStreams,Sm as mergeSortedWarnings,mO as migrateItemFilesToFormat,Ov as mutateItem,vv as mutateItemWithHistoryContext,SA as mutateWorkspaceJsonWithHistory,B_ as next,di as normalizeAgentProvenanceAdapterValue,zd as normalizeAnnotationTransportOptions,CI as normalizeAssuranceEvaluation,TI as normalizeAssuranceMutation,xd as normalizeBootstrapInvocation,PE as normalizeBulkIdsValue,Yc as normalizeDependencyGraphTarget,HR as normalizeDependencySeedId,zR as normalizeDependencySourceKind,kt as normalizeDirectExtensionCommandOptions,Rs as normalizeExpectedItemHash,Pn as normalizeExtensionContributionInventory,tS as normalizeHistoryOperationForWrite,EP as normalizeInvalidHistoryProvenance,SR as normalizeItemAddressInvocation,zn as normalizeItemFormatVersion,Hi as normalizeItemId,Wn as normalizeItemMetadata,VR as normalizeItemReference,Id as normalizeLegacyExtensionActionSyntax,ip as normalizeLinkedPath,RA as normalizeParentReferenceValue,Kt as normalizeProfileName,zi as normalizeRawItemId,WS as normalizeReadOutputIncludeModeOptions,lA as normalizeReplayPatchOps,ys as normalizeSimilarityText,zE as normalizeStatusForRegistry,Kn as normalizeStatusInput,GE as normalizeStatusInputWithRegistry,Zv as normalizeThrownExitCode,K_ as notes,Rn as nowIso,Wp as openDurableGraphCache,oN as openMcpRequestState,cL as openPmEpisode,Op as orderingPredecessors,Rp as orderingSuccessors,e0 as packContextCandidates,ym as packRankedContextItems,ag as packageActivate,sg as packageCatalog,dg as packageDeactivate,ng as packageDescribe,rg as packageDoctor,eg as packageInstall,Zh as packageLifecycle,Qh as packageList,og as packageManage,Yb as packageMigrate,ig as packageReload,tg as packageUninstall,uw as paginateQueryRows,Ql as parseAddEntries,ep as parseAddGlobEntries,Kd as parseAnnotationTextInput,lk as parseAtomicMutationControls,Od as parseBootstrapCommandName,wd as parseBootstrapGlobalOptions,vd as parseBootstrapHelpRequest,Nd as parseBootstrapTypeValue,IE as parseBulkIdsText,fm as parseContextDepth,lm as parseContextFocusFields,DO as parseContextIntentDeclarations,_m as parseContextSections,n0 as parseContextSignalSnapshot,qT as parseCsvKv,MR as parseDefectChangeRiskRequest,aM as parseDefectRecurrenceCoverageRequest,PR as parseDefectRecurrencePolicy,rf as parseEvalMetricFloors,df as parseEvalQuerySet,Is as parseExpectHashSpecs,lC as parseExtensionLongFlagToken,ru as parseGraphSubcommand,TM as parseHistoryAttestation,LM as parseHistoryProvenanceFilters,kR as parseIntegerLimit,VE as parseItemDocument,pk as parseItemMutationBatch,UA as parseLimit,Gu as parseLinkedTestAssertionEqualsMap,Uu as parseLinkedTestAssertionGteMap,xu as parseLinkedTestBoolean,Nu as parseLinkedTestContextMode,ku as parseLinkedTestEnvClear,Mu as parseLinkedTestEnvSet,ju as parseLinkedTestJsonEntries,Fu as parseLinkedTestMinLines,$u as parseLinkedTestRegexList,Du as parseLinkedTestStringList,Lu as parseLinkedTestWorkspaceContextMode,wg as parseMcpCachePolicy,_g as parseMcpImplementation,tt as parseMcpInputRequests,lr as parseMcpInputResponses,Wg as parseMcpSubscriptionFilter,rp as parseMigrateEntries,LR as parseMultiValueFilter,lI as parseMutationReceipt,QT as parseOptionalNonNegativeInteger,ZT as parseOptionalNumber,cD as parsePmAgentTaskTranscriptCorpus,R$ as parsePmToolDiscoveryOptions,xR as parsePriority,FR as parsePriorityFilterSet,DS as parseReadOutputSession,wE as parseRegisteredItemFieldAssignments,ae as parseRelationshipGraphSnapshot,tp as parseRemoveEntries,Tp as parseSourceLineRange,DA as parseStatusFilterCsv,DR as parseStringFilterSet,an as parseTags,Ff as parseTestRunMeasurements,NR as parseType,$R as parseTypeFilterSet,Bl as parseUnknownAuthorHistoryEventCoordinates,PT as parseWorkflowPolicy,MT as parseWorkflowPolicyDocument,T0 as partitionDecisionEntries,fA as patchPathToChangedField,dn as pathExists,Vh as pauseTask,Yp as persistDurableGraphResult,WA as persistSelectedItemFormat,lP as planAgentIdentityVocabularyMutation,l0 as planCompletedAtBackfill,Il as planExtensionDirectoryCopy,zk as planItemMutationDocument,tr as planProfileApplication,mD as planRelationshipEventBackfill,tu as planRelationshipRemediation,Cl as planSchemaEvolutionMigration,Ul as planUnknownAuthorHistoryAcknowledgment,bf as planWorkspaceSnapshotRestore,yR as positionalShapeKey,bR as positionalSignatureKey,tx as preflightExtension,Ts as prepareSimilarityText,KT as preserveMutationStdinTokenFields,VT as preserveMutationStdinTokenLiterals,qk as previewItemMutationDocument,bk as previewItemMutations,Vw as printError,Hw as printResult,Ch as profile,wh as profileApply,Ah as profileLint,Eh as profileList,Sh as profileShow,fE as projectAfterCommandItemSnapshot,pm as projectContextFocusRows,Df as projectFleetAttributionAnalytics,DM as projectHistoryProvenance,ji as projectLeanRecoveryPayload,Gw as projectPmBriefListEnvelope,Uw as projectPmBriefSearchEnvelope,ss as projectPmCliErrorContextDetails,ns as projectPmCliErrorDetails,Ni as projectPmDiagnosticOutput,Li as projectPmDiagnosticText,Nf as projectProvenanceCoverageAnalytics,_u as projectValidateCounts,TP as promoteAssuranceAssertion,gw as propagateContextUsageServingReceipt,kL as pruneCompileCacheGenerations,DI as putAssuranceDeclaration,$I as putAssuranceDeclarationBundle,_v as queryItemMetadataIndex,hv as queryLinkedFileMetadataIndex,gv as querySimilarItemMetadataIndex,Gf as queryTestRunMeasurementsBelow,An as quoteCommandArg,wn as quoteWindowsCommandArg,$k as rankCommandPaths,Vd as readAnnotationEntries,mi as readAuthorEnvironment,n_ as readBooleanOption,ww as readContextUsageAffinity,i_ as readCsvListOption,$s as readExtensionMigrationState,cn as readFileIfExists,jd as readFirstStringFromCommanderOptions,Bd as readFirstValueFromCommanderOptions,Mf as readHistoryAnalyticsWindow,aS as readHistoryEntries,gi as readHistorySnapshot,wf as readImprovementLedger,Tv as readItemMetadataDerivedIndexState,Ps as readItemRevision,wk as readItemTransaction,Qi as readLocatedItem,wS as readOutputBudgetCollections,rw as readOutputCollectionFingerprint,SS as readOutputContinuationRowCollections,CS as readOutputContinuationRowPaths,VS as readOutputIncludeModeOptions,kS as readOutputRetainsTail,ES as readOutputRowCollections,TS as readOutputRowPaths,GS as readOutputSessionRemainingTokens,Ut as readPmPackageManifest,e_ as readRequiredString,jE as readRuntimeFieldOptionValue,Ki as readSettings,gO as readSettingsSection,XA as readSettingsWithMetadata,qd as readStringArrayFromCommanderOptions,o_ as readStringOption,Jv as readThrownExitCode,Bv as readVectorizationStatusLedger,sv as readWorkflowPolicies,kT as readWorkflowPolicyField,$O as readWorkspaceContextIntentContracts,d0 as readWorkspaceContextSignals,m0 as readWorkspaceMemory,Z0 as readWorkspacePosition,eR as readWorkspaceTransaction,mA as reanchorHistoryEntries,q1 as reconcileArtifactLedgers,Ln as reconcileExtensionCapabilityUsage,AA as reconcileWorkspaceJsonHistory,mE as recordAfterCommandAffectedItem,GI as recordAssuranceVerdict,Hu as recordClaimSemanticAttribution,Cw as recordContextUsageDelivery,Tw as recordContextUsageServing,Ew as recordContextUsageTouch,Sw as recordContextUsageTouches,Ku as recordFocusSemanticAttribution,Sf as recordImprovementObservation,Vu as recordReleaseSemanticAttribution,Cv as refreshItemMetadataDerivedIndex,gl as refreshMergeAttributeFenceIfInstalled,IS as refreshReadOutputDeliveredCounts,zv as refreshSearchArtifactsForMutation,ai as registerAgentProvenanceAdapters,BR as registerExternalDependencyResolver,ii as registerHarnessSignalDescriptors,dS as registerOutputMaterialFieldGroups,Uh as release,RS as rememberReadOutputFocusRows,FI as removeAssuranceDeclaration,ln as removeFileIfExists,mp as renameArtifactsResultKey,sm as renderCalendarMarkdown,am as renderCalendarToon,wm as renderContextMarkdown,Ol as renderExtensionDescribeMarkdown,Al as renderExtensionSurfaceMarkdown,R_ as renderGuideMarkdown,Nk as renderMissingOptionRetry,C0 as renderNextMarkdown,Uk as renderPmClosedDomainHelp,vn as renderPmCommand,Go as renderPmCommandAliasMigrationHint,al as renderPmCommandVisibilityMarkdown,JD as renderPmFlagLexiconMarkdown,zN as renderPmMcpAppHtml,vD as renderPmRefusalClosureCensusMarkdown,FA as renderRowsAsCsv,GA as renderRowsAsTable,Dh as reopen,nv as replayHistoryToTarget,dA as replayToCanonicalItemDocument,aA as replayToItemDocument,eS as requireHistoryOperation,vM as requireTerminalReason,OM as requireTerminalReasonWithRecovery,rA as resealHistoryRewrite,cE as resetActiveExtensionRuntimeState,Xl as resetWorkspaceGraphCache,Qn as resolveAgentSessionContextFromSignals,Zd as resolveAnnotationIndex,Yd as resolveAnnotationInput,sS as resolveAuthor,hi as resolveAuthorIdentity,OA as resolveBodyFileContent,Hy as resolveBuiltinCorpusShape,im as resolveCalendarOutputFormat,nI as resolveCanonicalPmErrorCodeContract,MC as resolveCanonicalRelationshipKind,iS as resolveClaimPrincipal,ME as resolveCliBulkIdsInput,iC as resolveCommandOptionPolicyState,ML as resolveCompileCacheGeneration,c0 as resolveCompletionTimestamp,UC as resolveConfiguredPmPackageRoot,WR as resolveContentFieldFilters,Pw as resolveContextIntentContract,um as resolveContextOutputFormat,mm as resolveContextTokenBudget,IM as resolveCreateExplicitEmptyFlag,As as resolveDeclaredBlockers,M0 as resolveEffectiveSearchMode,Rv as resolveEmbeddingProviders,Mt as resolveExtensionFlagOptionKey,SC as resolveExtensionFlagValueContract,Pl as resolveExtensionInstallSourceIdentity,pC as resolveExtensionLongFlagName,Ds as resolveExtensionMigrationStatePath,XC as resolveExtensionRoots,qR as resolveExternalDependencyReference,EC as resolveFlagValueKind,dC as resolveGlobalPmRoot,v_ as resolveGuideOutputFormat,Af as resolveHistoryEpisodeGroupIdentity,LE as resolveHistoryHashAlgorithm,QE as resolveHistoryOperation,NM as resolveHistoryProvenanceDimensions,SO as resolveHistorySubject,rv as resolveHistoryTarget,x0 as resolveHybridSemanticWeight,bn as resolveImplicitPmRoot,gC as resolveIsoOrRelative,MO as resolveItemBlockers,vO as resolveItemExecutionRole,mk as resolveItemMutationDocument,om as resolveItemOwnershipConflict,yn as resolveItemTypeRegistry,FE as resolveItemTypesFilePath,vk as resolveLifecycleVerbRecovery,cC as resolveLinkedResourcePositionalRecovery,Xf as resolveLinkedTestFailureExitCode,au as resolveLinkedTestSourceRef,du as resolveLinkedTestSourceWorkspaceRoot,uu as resolveLinkedTestTrust,mu as resolveLinkedTestTrustBatch,Yg as resolveMcpAcknowledgedSubscriptionFilter,Je as resolveMcpRequestContext,ul as resolveMergeInstallContext,Lk as resolveMisnestedCommandPath,KR as resolveMissingMetadataFilters,xk as resolveMissingOptionPlaceholder,fS as resolveModePairedOutputOmissionReceipt,y0 as resolveNextOutputFormat,gS as resolveOutputOmissionReceipt,GC as resolvePmCliVersion,Fo as resolvePmCommandAlias,Ve as resolvePmCommandCapabilityFamily,Dt as resolvePmCommandExitContract,L as resolvePmCommandOperation,Mi as resolvePmCommandOutputBudget,Lt as resolvePmCommandOutputEnvelope,mR as resolvePmCommandPositionalContract,On as resolvePmCommandScopeArgs,Ke as resolvePmCommandVisibilityTier,xi as resolvePmDiagnosticOutputBudget,iI as resolvePmErrorCodeContract,qb as resolvePmFlagSemanticConcept,Le as resolvePmHistoryOperation,Jx as resolvePmMcpExecutableInvocation,FC as resolvePmPackageRootFromModule,fR as resolvePmPositionalActionContract,Ed as resolvePmPositionalActionFlagContracts,Ge as resolvePmRoot,Oc as resolvePmToolCustomFieldCollision,kA as resolvePriority,Wt as resolveProfile,_l as resolveProjectMergeTypeFolders,pw as resolveQueryCursorStart,Ok as resolveReadCompletenessControls,Ik as resolveReadOptionRetryArgs,YS as resolveReadOutputDimensions,ew as resolveReadOutputEncoding,PS as resolveReadOutputRecoveryBudget,zS as resolveReadOutputSurface,hS as resolveReadRowContract,kk as resolveRecoveryCommandName,OE as resolveRegisteredSearchProvider,RE as resolveRegisteredVectorStoreAdapter,Gc as resolveReproducibleProcessEnvironment,Un as resolveRuntimeFieldRegistry,Gn as resolveRuntimeStatusRegistry,Iv as resolveSearchCorpusFields,P0 as resolveSearchMaxResults,D0 as resolveSearchPage,k0 as resolveSearchScoreThreshold,N0 as resolveSearchTuning,Mv as resolveSemanticCorpusCharacterLimit,zu as resolveSemanticLineageIds,ZA as resolveSettingsWithSemanticRuntimeDefaults,zI as resolveSourceContextWritePolicy,Ju as resolveStartTaskInProgressStatus,ee as resolveSubcommandFlagContractsForCommand,AT as resolveTelemetryErrorCategory,Hv as resolveTelemetrySourceAttribution,AM as resolveTerminalReason,hk as resolveTransactionSchema,nC as resolveTypeDefinition,oC as resolveTypeName,$A as resolveTypeSynonym,zA as resolveTypeWorkflows,jl as resolveUnknownAuthorAcknowledgmentSelector,j0 as resolveVectorIndexRecovery,xv as resolveVectorStores,qc as resolveWorkspaceRelationshipKindRegistry,aC as resolveWorkspaceRoot,qh as restore,CC as restoreCheckpointItems,vA as restoreWorkspaceJsonFromHistory,Cf as restoreWorkspaceSnapshot,Tf as restoreWorkspaceSnapshotWithRecovery,ug as runAction,gE as runActiveBeforeMutationHooks,bE as runActiveCommandHandler,yE as runActiveOnIndexHooks,Fn as runActiveOnReadHooks,$n as runActiveOnWriteHooks,TE as runActiveParserOverride,CE as runActivePreflightOverride,EE as runActiveServiceOverride,cm as runActivity,YC as runAfterCommandHooks,Zm as runAggregate,Jd as runAnnotationCommand,Tu as runAppend,pM as runAssuranceAction,uM as runAssuranceDispatch,WC as runBeforeCommandHooks,dm as runCalendar,Im as runClaim,Pm as runClaimNext,Eu as runClose,Su as runCloseMany,Nm as runCloseTask,Qd as runComments,I_ as runCompletion,Hl as runConfig,zt as runContext,ZM as runContextEvaluationCorpus,XM as runContextEvaluationScenario,wu as runCopy,Bu as runCreate,qu as runDelete,Jl as runDeps,fp as runDocs,fP as runDuplicates,lf as runEval,uf as runEvent,Ml as runExtension,Us as runExtensionMigrateAction,Gs as runExtensionMigrations,Ep as runFiles,wp as runFilesDiscover,Sp as runFilesLookup,Lf as runFleetAttributionAnalytics,Xu as runFocus,yu as runGc,Qm as runGet,ou as runGraph,O_ as runGuide,nu as runHealth,I0 as runHistory,SM as runHistoryAttest,fM as runHistoryCompact,gM as runHistoryCompactBulk,WP as runHistoryMaintenance,yM as runHistoryRedact,XP as runHistoryRepair,ZP as runHistoryRepairAll,$l as runInit,Nl as runInitAgentGuidance,ec as runLearnings,up as runLinkedArtifacts,Jf as runLinkedTests,el as runList,pf as runMeet,H0 as runMergeDriver,yl as runMergeInstall,UP as runMergeReceiptEvidenceReport,GP as runMergeReceiptReport,V0 as runMergeReconcile,Om as runNext,tc as runNotes,xm as runPauseTask,Dm as runPlan,Km as runProfileApply,Vm as runProfileLint,zm as runProfileList,Hm as runProfileShow,xf as runProvenanceCoverageAnalytics,sx as runRegisteredCommandForTest,px as runRegisteredCommandOverrideForTest,yx as runRegisteredExporterForTest,dx as runRegisteredHookForTest,gx as runRegisteredImporterForTest,hx as runRegisteredMigrationForTest,ax as runRegisteredMutationGuardForTest,cx as runRegisteredParserOverrideForTest,lx as runRegisteredPreflightOverrideForTest,ux as runRegisteredRendererOverrideForTest,fx as runRegisteredSearchProviderForTest,mx as runRegisteredServiceOverrideForTest,_x as runRegisteredVectorStoreAdapterForTest,rr as runReindex,Mm as runRelease,mf as runRemind,MM as runReopen,$m as runRestore,El as runSchemaEvolutionMigration,ef as runSearch,Wy as runSearchRefreshWorkerEntrypoint,P_ as runStartBackgroundRun,km as runStartTask,jf as runStats,qf as runTelemetry,Bm as runTemplatesList,jm as runTemplatesSave,qm as runTemplatesShow,Zf as runTest,Qf as runTestAll,M_ as runTestRunsList,x_ as runTestRunsLogs,L_ as runTestRunsResume,k_ as runTestRunsStatus,N_ as runTestRunsStop,D_ as runTestRunsWorker,rm as runUpdate,Fm as runUpdateMany,Bt as runUpgrade,gu as runValidate,pg as runWithActiveExtensions,D as runWithAgentSessionContext,KA as runWithConfigurationOnlySettings,Rw as runWithContextIntentContracts,UO as runWithDiscoveredContextIntentContracts,ci as runWithHarnessDetectionSignals,LN as runWithMcpTraceContext,jc as runWithReproducibleProcessEnvironment,li as runWithWorkspaceHarnessSignalDescriptors,Vr as runWithWorkspaceRecipe,eP as runWorkflowPolicyAction,mM as runWorkspaceTransactionGc,eu as saveGraphAuditBaseline,rM as scanClosureTimestamps,CP as scanExtensionHostVersions,Gl as scanHistoryAuthorAttribution,Vn as scanItemFormatVersions,ms as scanMutationSecrets,wP as scanProvenanceResolverHealth,ws as scanStaleInProgressItems,iM as scanStorageIntegrity,nh as schema,ph as schemaAddField,ch as schemaAddStatus,ah as schemaAddType,_h as schemaApplyPreset,hh as schemaInferTypes,ih as schemaList,mh as schemaListFields,bh as schemaRemapStatus,uh as schemaRemoveField,lh as schemaRemoveStatus,dh as schemaRemoveType,yh as schemaRenameField,gh as schemaRenameType,sh as schemaShow,fh as schemaShowField,Th as schemaShowStatus,Dk as scoreCommandPathMatch,VM as scoreContextCandidates,KM as scoreContextCandidatesWithActiveExtensions,Cs as scoreItemSimilarity,UD as scorePmGrammarRefusalClosure,ID as scorePmRefusalClosure,Es as scorePreparedItemSimilarity,qD as scoreTrackerPreflightRecoveryClosure,eA as sealHistoryRecord,rN as sealMcpRequestState,U_ as search,h0 as searchWorkspaceMemory,g0 as searchWorkspaceMemoryReadResult,xO as selectActionableEntries,iw as selectCursorSemanticOptions,E_ as selectImportAuthor,PN as selectMcpClientRegistrationMode,_0 as selectWorkspaceMemory,f0 as selectWorkspaceMemoryRollups,Yu as semanticAttributionAffinity,sO as sentryCaptureCliError,nO as sentryDiscardCommandSpan,iO as sentryFinishCommandSpan,dO as sentryFlush,aO as sentryLogCliUsageError,rO as sentrySetCommandContext,oO as sentryStartCommandSpan,Xn as serializeItemDocument,jk as serializeNdjsonRows,Bk as serializeNdjsonStream,$y as serveDeclaredObservation,lE as setActiveCommandContext,pE as setActiveCommandResult,oE as setActiveExtensionCommands,rE as setActiveExtensionHooks,nE as setActiveExtensionParsers,iE as setActiveExtensionPreflight,dE as setActiveExtensionRegistrations,aE as setActiveExtensionRenderers,sE as setActiveExtensionServices,oS as setFocusedItem,hO as settingsSectionRevision,_O as shouldCompletePlanOnClose,Zp as shouldPersistDurableGraphCache,XT as shouldResolveMutationStdinTokenField,YT as shouldResolveMutationStdinTokens,ev as shouldRunSearchRefreshInForeground,_p as similarityAdvisoryWarnings,bS as sliceReadOutputRowCollection,is as snapshotPmCliErrorContext,cp as sortLinkedArtifacts,GT as splitAcceptanceCriteria,uO as splitCommaList,Yn as splitFrontMatter,XS as stabilizeReadOutputReceiptEstimates,I as stableStringify,uk as stableUpsertValue,vT as stableValueEquals,Hh as startTask,TO as startTelemetryCommand,z_ as stats,UE as statusIsTerminal,Ad as stripGlobalBootstrapTokens,Y0 as subscribeMutationEventBatches,X0 as subscribeMutationEvents,cP as summarizeAgentIdentityVocabulary,Of as summarizeAgentModelProvenance,Rf as summarizeAgentProvenance,JM as summarizeContextEvaluationReports,Vf as summarizeContextPreflight,GM as summarizeHistoryProvenance,Ll as summarizeInitResult,LP as summarizeMergeReceipt,PM as supportsCreateExplicitEmpty,ER as supportsItemIdAlias,DC as suppressHostOutput,Re as syncRelationshipGraphAdapter,Zk as synthesizeExtensionManifest,Sd as toCompletionFlagString,Em as toContextFocusItem,bm as toContextPackingSummary,Tm as toContextRankingSummary,mC as toErrorMessage,a_ as toEstimatedMinutesValue,sk as toExtensionFlagDefinitions,u_ as toImportBoolean,h_ as toImportConfidence,p_ as toImportInteger,T_ as toImportLinkedDocs,b_ as toImportLinkedFiles,C_ as toImportLinkedTests,y_ as toImportLogEntries,g_ as toImportNormalizedEnum,__ as toImportNumberMap,d_ as toImportPriority,l_ as toImportStatus,m_ as toImportStringList,f_ as toImportStringMap,c_ as toImportTags,KE as toItemRecord,s_ as toNonEmptyImportString,uC as toNonEmptyStringOrUndefined,cA as toReplayDocument,jw as toWellFormedText,bs as tokenizeSimilarityText,WT as transferMutationStdinTokenPolicy,VC as translateHostEnvironmentFault,Lh as update,zf as updateLinkedTest,cg as upgrade,vh as validate,OI as validateAssertionDefinition,II as validateAssuranceDocument,RI as validateGateDefinition,_k as validateItemMutationRows,pp as validateLinkedPaths,MN as validateMcpAuthorizationResponseIssuer,IN as validateMcpAuthorizationServerMetadata,kN as validateMcpClientMetadataDocument,CN as validateMcpHttpRequestHeaders,sN as validateMcpJsonSchema,vI as validateMeasurementDefinition,PA as validateMissingParentReference,HS as validateReadOutputOptions,LA as validateSprintOrReleaseValue,sC as validateTypeOptions,ZO as validateWorkspaceTransactionIdentity,EM as verifyAttestation,tI as verifyCliFlagInvocationParity,gR as verifyExplicitPositionalSlotCensus,uA as verifyHistoryChain,pA as verifyHistoryChainWithVersion,jO as verifyHistoryEntries,tA as verifyHistoryRecordHash,oA as verifyHistoryRewriteEvidence,CR as verifyPmCliGrammar,TR as verifyPmCommandPositionalContracts,XD as verifyPmFlagLexicon,TD as verifyPmRecoveryKindRuntimeCoverage,xb as verifyPmRecoveryProducerRuntimeCoverage,bD as verifyPmRecoveryReferences,wD as verifyPmRefusalClosureIdentityRatchet,SD as verifyPmRefusalClosureRatchet,yD as verifyPmRefusalReachability,dc as verifyToolOptionCliParity,xA as withCliMutationInput,xs as withExpectedItemRevisions,Bs as withFlagAliasMetadata,KC as withHostEnvironmentBoundary,NA as withLiteralMutationInput,iN as withMcpCachePolicy,Gi as withoutGenericRefusalExamples,NT as workflowApprovalFingerprint,LT as workflowPolicyApplies,xT as workflowPolicyFingerprint,Yl as workspaceGraphCache,tR as workspaceTransactionPlanDigest,Xd as wrapOwnershipConflict,eO as wrapThrownErrorForSentry,fi as writeAuthorEnvironment,Fe as writeFileAtomic,bC as writeMutationCheckpoint,JA as writeSettings,yO as writeSettingsSection,zw as writeStderr,qw as writeStdout,qv as writeVectorizationStatusLedger,wA as writeWorkspaceJsonWithHistory};
35
35
  //# sourceMappingURL=sdk.js.map