@unbrained/pm-cli 2026.9.7 → 2026.9.9

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 (746) hide show
  1. package/.agents/skills/pm-developer/SKILL.md +12 -4
  2. package/.agents/skills/pm-developer/references/MULTI_AGENT_MERGE.md +19 -10
  3. package/.agents/skills/pm-extensions/SKILL.md +6 -0
  4. package/.agents/skills/pm-sdk/SKILL.md +11 -2
  5. package/.agents/skills/pm-user/SKILL.md +7 -2
  6. package/.agents/skills/pm-user/references/ECOSYSTEM_PLANNING.md +95 -0
  7. package/.claude-plugin/marketplace.json +2 -2
  8. package/CHANGELOG.md +231 -182
  9. package/dist/cli/after-command-context-usage.js +1 -48
  10. package/dist/cli/argv-utils.js +1 -40
  11. package/dist/cli/bootstrap-args.js +1 -9
  12. package/dist/cli/bundle-integrity.js +2 -110
  13. package/dist/cli/commander-usage.js +11 -771
  14. package/dist/cli/commands/activity.js +1 -9
  15. package/dist/cli/commands/aggregate.js +1 -5
  16. package/dist/cli/commands/append.js +1 -5
  17. package/dist/cli/commands/claim.js +1 -5
  18. package/dist/cli/commands/close-many.js +1 -5
  19. package/dist/cli/commands/close.js +1 -9
  20. package/dist/cli/commands/comments.js +1 -5
  21. package/dist/cli/commands/config.js +1 -9
  22. package/dist/cli/commands/context.js +1 -9
  23. package/dist/cli/commands/contracts.js +1 -5
  24. package/dist/cli/commands/copy.js +1 -9
  25. package/dist/cli/commands/create.js +1 -9
  26. package/dist/cli/commands/delete.js +1 -9
  27. package/dist/cli/commands/deps.js +1 -9
  28. package/dist/cli/commands/docs.js +1 -9
  29. package/dist/cli/commands/duplicates.js +1 -9
  30. package/dist/cli/commands/eval.js +1 -9
  31. package/dist/cli/commands/extension/describe.js +1 -5
  32. package/dist/cli/commands/extension/scaffold.js +1 -5
  33. package/dist/cli/commands/extension/shared.js +1 -5
  34. package/dist/cli/commands/extension.js +1 -9
  35. package/dist/cli/commands/files.js +1 -9
  36. package/dist/cli/commands/focus.js +1 -9
  37. package/dist/cli/commands/gc.js +1 -9
  38. package/dist/cli/commands/get.js +1 -9
  39. package/dist/cli/commands/graph.js +1 -10
  40. package/dist/cli/commands/health.js +1 -9
  41. package/dist/cli/commands/history-compact.js +1 -10
  42. package/dist/cli/commands/history-redact.js +1 -11
  43. package/dist/cli/commands/history-repair.js +1 -10
  44. package/dist/cli/commands/history.js +1 -5
  45. package/dist/cli/commands/index.js +1 -58
  46. package/dist/cli/commands/init-agent-guidance.js +1 -9
  47. package/dist/cli/commands/init.js +1 -9
  48. package/dist/cli/commands/learnings.js +1 -5
  49. package/dist/cli/commands/lifecycle-transitions.js +1 -5
  50. package/dist/cli/commands/list.js +1 -9
  51. package/dist/cli/commands/merge.js +1 -11
  52. package/dist/cli/commands/next.js +1 -9
  53. package/dist/cli/commands/notes.js +1 -5
  54. package/dist/cli/commands/plan.js +1 -9
  55. package/dist/cli/commands/profile.js +1 -9
  56. package/dist/cli/commands/restore.js +1 -9
  57. package/dist/cli/commands/scheduling-shortcuts.js +1 -9
  58. package/dist/cli/commands/schema.js +1 -10
  59. package/dist/cli/commands/search.js +1 -9
  60. package/dist/cli/commands/stats.js +1 -9
  61. package/dist/cli/commands/telemetry.js +1 -9
  62. package/dist/cli/commands/test-all.js +1 -9
  63. package/dist/cli/commands/test-runs.js +1 -9
  64. package/dist/cli/commands/test.js +1 -9
  65. package/dist/cli/commands/update-many.js +1 -5
  66. package/dist/cli/commands/update.js +1 -9
  67. package/dist/cli/commands/upgrade.js +1 -5
  68. package/dist/cli/commands/validate.js +1 -15
  69. package/dist/cli/context-intent-invocation.js +1 -20
  70. package/dist/cli/description-stdin.js +1 -17
  71. package/dist/cli/error-guidance.js +1 -1353
  72. package/dist/cli/extension-command-help.js +5 -636
  73. package/dist/cli/extension-command-options.js +1 -427
  74. package/dist/cli/extension-recovery.js +1 -126
  75. package/dist/cli/help-content.js +2 -1001
  76. package/dist/cli/help-json-payload.js +4 -570
  77. package/dist/cli/main.d.ts +4 -0
  78. package/dist/cli/main.js +5 -2573
  79. package/dist/cli/migration-gates.js +1 -289
  80. package/dist/cli/public.js +1 -20
  81. package/dist/cli/register-annotations.js +1 -270
  82. package/dist/cli/register-assurance.js +1 -62
  83. package/dist/cli/register-files-lookup.js +1 -56
  84. package/dist/cli/register-history-activity.d.ts +8 -0
  85. package/dist/cli/register-history-activity.js +2 -0
  86. package/dist/cli/register-history-author.js +1 -38
  87. package/dist/cli/register-history-maintenance.d.ts +9 -0
  88. package/dist/cli/register-history-maintenance.js +2 -0
  89. package/dist/cli/register-list-query.js +10 -943
  90. package/dist/cli/register-mutation-options.js +1 -9
  91. package/dist/cli/register-mutation.d.ts +0 -5
  92. package/dist/cli/register-mutation.js +19 -1893
  93. package/dist/cli/register-operations.js +1 -920
  94. package/dist/cli/register-setup.js +1 -716
  95. package/dist/cli/register-structured-mutation.js +1 -196
  96. package/dist/cli/registration-helpers.js +1 -5
  97. package/dist/cli/runtime-compatibility-boundary.js +4 -42
  98. package/dist/cli/schema-registration-helpers.js +1 -73
  99. package/dist/cli/search-refresh.js +1 -13
  100. package/dist/cli/stats-analytics-json.js +1 -68
  101. package/dist/cli/telemetry-flush.js +1 -10
  102. package/dist/cli-bundle/bundle-manifest.json +164 -156
  103. package/dist/cli-bundle/chunks/{chunk-NPN5I67J.js → chunk-3IPRM75M.js} +3 -3
  104. package/dist/cli-bundle/chunks/chunk-4VL5P22L.js +2 -0
  105. package/dist/cli-bundle/chunks/chunk-AAFBV3U3.js +29 -0
  106. package/dist/cli-bundle/chunks/chunk-D3YVILJJ.js +20 -0
  107. package/dist/cli-bundle/chunks/{chunk-WYRZZ5ZE.js → chunk-DEZPZOQ7.js} +2 -2
  108. package/dist/cli-bundle/chunks/chunk-ECBLPN7B.js +3 -0
  109. package/dist/cli-bundle/chunks/chunk-J6ERHBV2.js +235 -0
  110. package/dist/cli-bundle/chunks/chunk-JUNJ5EKI.js +2 -0
  111. package/dist/cli-bundle/chunks/chunk-L5RCDKQ2.js +2 -0
  112. package/dist/cli-bundle/chunks/chunk-NSAPNEYH.js +2 -0
  113. package/dist/cli-bundle/chunks/chunk-OHNLSGGV.js +79 -0
  114. package/dist/cli-bundle/chunks/chunk-WQKMSFBV.js +5 -0
  115. package/dist/cli-bundle/chunks/{chunk-BAX2BYUW.js → chunk-XZ6T7YPP.js} +256 -150
  116. package/dist/cli-bundle/chunks/{chunk-JT6XF6GE.js → chunk-Z3XVXUVF.js} +4 -4
  117. package/dist/cli-bundle/chunks/register-list-query-UIHRCS6D.js +11 -0
  118. package/dist/cli-bundle/chunks/register-mutation-WHWMGRVX.js +20 -0
  119. package/dist/cli-bundle/chunks/register-operations-64YZYTC5.js +2 -0
  120. package/dist/cli-bundle/chunks/register-setup-PERI45EM.js +2 -0
  121. package/dist/cli-bundle/focused-chunks/chunk-2W4XIYOB.js +2 -0
  122. package/dist/cli-bundle/focused-chunks/chunk-2WSBXIGF.js +12 -0
  123. package/dist/cli-bundle/focused-chunks/chunk-5FHTCOHS.js +3 -0
  124. package/dist/cli-bundle/focused-chunks/chunk-7N6DOREF.js +26 -0
  125. package/dist/cli-bundle/focused-chunks/{chunk-3BZEOXLT.js → chunk-7PC4R5QB.js} +2 -2
  126. package/dist/cli-bundle/focused-chunks/chunk-BUCJUZVG.js +6 -0
  127. package/dist/cli-bundle/focused-chunks/chunk-FE3BABLJ.js +2 -0
  128. package/dist/cli-bundle/focused-chunks/chunk-IWITF53W.js +2 -0
  129. package/dist/cli-bundle/focused-chunks/chunk-OQUGRHKV.js +10 -0
  130. package/dist/cli-bundle/focused-chunks/{chunk-M6PBRFSH.js → chunk-PNKIANFZ.js} +2 -2
  131. package/dist/cli-bundle/focused-chunks/{chunk-LIJIA4TY.js → chunk-QQQ4SAUO.js} +3 -3
  132. package/dist/cli-bundle/focused-chunks/chunk-TTYXF5YD.js +177 -0
  133. package/dist/cli-bundle/focused-chunks/chunk-XNR3DM6J.js +2 -0
  134. package/dist/cli-bundle/focused-chunks/chunk-XSS3APUF.js +9 -0
  135. package/dist/cli-bundle/focused-chunks/chunk-YCDQ2N23.js +8 -0
  136. package/dist/cli-bundle/focused-chunks/chunk-YJUXGS57.js +20 -0
  137. package/dist/cli-bundle/focused-chunks/chunk-ZTCE4UO6.js +58 -0
  138. package/dist/cli-bundle/main.js +20 -20
  139. package/dist/cli-bundle/sdk-authoring.js +1 -1
  140. package/dist/cli-bundle/sdk-contracts.js +2 -2
  141. package/dist/cli-bundle/sdk-core.js +37 -37
  142. package/dist/cli-bundle/sdk-governance.js +1 -1
  143. package/dist/cli-bundle/sdk-graph.js +1 -1
  144. package/dist/cli-bundle/sdk-merge.js +42 -42
  145. package/dist/cli-bundle/sdk-query.js +1 -1
  146. package/dist/cli-bundle/sdk-runtime.js +1 -1
  147. package/dist/cli-bundle/sdk-testing.js +1 -1
  148. package/dist/cli-bundle/sdk.js +11 -11
  149. package/dist/cli.js +1 -104
  150. package/dist/core/checkpoint/checkpoint-gc.js +1 -169
  151. package/dist/core/checkpoint/mutation-checkpoint.js +2 -133
  152. package/dist/core/config/nested-settings.js +1 -534
  153. package/dist/core/config/positional-value.js +1 -109
  154. package/dist/core/diagnostics/remediation.js +1 -506
  155. package/dist/core/extensions/activation-summary-markdown.js +2 -145
  156. package/dist/core/extensions/activation-summary.js +1 -92
  157. package/dist/core/extensions/activation-transaction.js +1 -46
  158. package/dist/core/extensions/capability-usage.js +1 -173
  159. package/dist/core/extensions/command-hook-context.js +1 -13
  160. package/dist/core/extensions/command-metadata-contract.js +1 -22
  161. package/dist/core/extensions/command-visibility-tier.js +1 -29
  162. package/dist/core/extensions/contribution-inventory.js +1 -173
  163. package/dist/core/extensions/exporter-output-contract.js +1 -66
  164. package/dist/core/extensions/extension-candidate.js +1 -18
  165. package/dist/core/extensions/extension-capability-aliases.js +1 -158
  166. package/dist/core/extensions/extension-hook-runtime.js +1 -699
  167. package/dist/core/extensions/extension-policy.js +1 -599
  168. package/dist/core/extensions/extension-registries.js +1 -62
  169. package/dist/core/extensions/extension-runtime-helpers.js +1 -33
  170. package/dist/core/extensions/extension-types.js +1 -102
  171. package/dist/core/extensions/flag-definition-validation.js +1 -52
  172. package/dist/core/extensions/flag-value-types.js +1 -64
  173. package/dist/core/extensions/index.js +1 -526
  174. package/dist/core/extensions/item-field-types.js +1 -39
  175. package/dist/core/extensions/item-fields.js +1 -261
  176. package/dist/core/extensions/loader.js +1 -2223
  177. package/dist/core/extensions/manifest-schema.js +1 -69
  178. package/dist/core/extensions/module-graph-snapshot.js +1 -33
  179. package/dist/core/extensions/preflight-ownership.js +1 -41
  180. package/dist/core/extensions/registration-validation.js +1 -82
  181. package/dist/core/extensions/registration-values.js +1 -209
  182. package/dist/core/extensions/reserved-host-flags.js +1 -36
  183. package/dist/core/extensions/runtime-registrations.js +1 -67
  184. package/dist/core/extensions/service-ownership.js +1 -19
  185. package/dist/core/extensions/version-compat.js +1 -216
  186. package/dist/core/fs/fs-utils.js +2 -158
  187. package/dist/core/fs/host-environment-errors.js +1 -141
  188. package/dist/core/fs/index.js +1 -9
  189. package/dist/core/fs/path-utils.js +1 -17
  190. package/dist/core/governance/content-fields.js +1 -160
  191. package/dist/core/governance/issue-codes.js +1 -151
  192. package/dist/core/governance/metadata-coverage.js +1 -358
  193. package/dist/core/history/drift-cache.js +3 -72
  194. package/dist/core/history/drift-scan.js +1 -342
  195. package/dist/core/history/event-classification.js +1 -109
  196. package/dist/core/history/event-index.js +8 -784
  197. package/dist/core/history/history-compact-bulk.js +1 -104
  198. package/dist/core/history/history-diff.js +1 -158
  199. package/dist/core/history/history-rewrite.d.ts +6 -1
  200. package/dist/core/history/history-rewrite.js +1 -107
  201. package/dist/core/history/history-storage-stats.js +1 -102
  202. package/dist/core/history/history-stream-policy.js +1 -62
  203. package/dist/core/history/history.js +2 -617
  204. package/dist/core/history/identity.js +1 -30
  205. package/dist/core/history/index.js +1 -9
  206. package/dist/core/history/projection.js +1 -196
  207. package/dist/core/history/read.d.ts +9 -0
  208. package/dist/core/history/read.js +1 -57
  209. package/dist/core/history/replay.js +2 -439
  210. package/dist/core/history/version-address.js +1 -32
  211. package/dist/core/history/workspace-history.js +2 -433
  212. package/dist/core/io/body-file.js +1 -62
  213. package/dist/core/io/bulk-ids-input.js +1 -112
  214. package/dist/core/item/actionability.js +1 -327
  215. package/dist/core/item/dependency-reference.js +1 -20
  216. package/dist/core/item/id.js +1 -112
  217. package/dist/core/item/index.js +1 -12
  218. package/dist/core/item/item-format-version.js +1 -78
  219. package/dist/core/item/item-format.js +5 -1473
  220. package/dist/core/item/item-record.js +1 -23
  221. package/dist/core/item/item-type-definition.js +1 -133
  222. package/dist/core/item/parent-reference-policy.js +1 -57
  223. package/dist/core/item/parse.js +2 -603
  224. package/dist/core/item/plan-lifecycle.js +1 -19
  225. package/dist/core/item/priority.js +1 -61
  226. package/dist/core/item/sprint-release-format.js +1 -38
  227. package/dist/core/item/status-filter.js +1 -115
  228. package/dist/core/item/status.js +1 -43
  229. package/dist/core/item/toon-decode.js +1 -29
  230. package/dist/core/item/type-registry.js +1 -715
  231. package/dist/core/item/type-synonyms.js +1 -38
  232. package/dist/core/lock/index.js +1 -9
  233. package/dist/core/lock/lock-gc.js +1 -240
  234. package/dist/core/lock/lock.js +3 -590
  235. package/dist/core/output/mutation-projection.js +1 -217
  236. package/dist/core/output/output-control.js +1 -25
  237. package/dist/core/output/output.js +11 -494
  238. package/dist/core/output/query-summary.js +1 -58
  239. package/dist/core/output/tabular.js +1 -77
  240. package/dist/core/packages/manifest.js +1 -244
  241. package/dist/core/packages/root.js +1 -84
  242. package/dist/core/policy/workflow-policy-schema.d.ts +312 -0
  243. package/dist/core/policy/workflow-policy-schema.js +2 -0
  244. package/dist/core/policy/workflow-policy-store.d.ts +24 -0
  245. package/dist/core/policy/workflow-policy-store.js +2 -0
  246. package/dist/core/policy/workflow-policy.d.ts +139 -0
  247. package/dist/core/policy/workflow-policy.js +2 -0
  248. package/dist/core/profile/profile-describe.js +1 -83
  249. package/dist/core/profile/profile-lint.js +1 -415
  250. package/dist/core/profile/profile-plan.js +0 -0
  251. package/dist/core/profile/profile-presets.js +1 -370
  252. package/dist/core/reproducibility/context.js +1 -82
  253. package/dist/core/schema/fields-file.js +2 -288
  254. package/dist/core/schema/item-types-file.js +2 -296
  255. package/dist/core/schema/runtime-field-filters.js +1 -49
  256. package/dist/core/schema/runtime-field-values.js +1 -313
  257. package/dist/core/schema/runtime-schema.js +2 -826
  258. package/dist/core/schema/status-defs-file.js +2 -227
  259. package/dist/core/schema/status-token.js +1 -31
  260. package/dist/core/schema/type-inference.js +1 -95
  261. package/dist/core/schema/type-presets.js +1 -87
  262. package/dist/core/schema/type-workflows.js +1 -104
  263. package/dist/core/search/background-refresh.js +2 -286
  264. package/dist/core/search/bm25.js +1 -146
  265. package/dist/core/search/cache.js +2 -534
  266. package/dist/core/search/corpus.js +1 -311
  267. package/dist/core/search/embedding-batches.js +1 -163
  268. package/dist/core/search/eval.js +1 -225
  269. package/dist/core/search/http-client.js +1 -75
  270. package/dist/core/search/providers.js +1 -242
  271. package/dist/core/search/relevance.js +1 -244
  272. package/dist/core/search/semantic-defaults.js +1 -199
  273. package/dist/core/search/staleness.js +1 -30
  274. package/dist/core/search/vector-stores.js +2 -664
  275. package/dist/core/search/vectorization-metadata.js +1 -81
  276. package/dist/core/sentry/helpers.js +1 -272
  277. package/dist/core/sentry/instrument.js +1 -387
  278. package/dist/core/session/session-state.js +1 -260
  279. package/dist/core/shared/agent-session-context.js +1 -133
  280. package/dist/core/shared/author.js +1 -1172
  281. package/dist/core/shared/command-types.js +1 -4
  282. package/dist/core/shared/conflict-markers.js +1 -31
  283. package/dist/core/shared/constants.js +1 -405
  284. package/dist/core/shared/errors.js +1 -20
  285. package/dist/core/shared/html-entity-decode.js +1 -131
  286. package/dist/core/shared/index.js +1 -12
  287. package/dist/core/shared/item-metadata-contract.js +1 -89
  288. package/dist/core/shared/lazy-module.js +1 -16
  289. package/dist/core/shared/levenshtein.js +1 -61
  290. package/dist/core/shared/memo.js +1 -19
  291. package/dist/core/shared/numeric-parsers.js +1 -20
  292. package/dist/core/shared/option-alias-visibility.js +1 -67
  293. package/dist/core/shared/primitives.js +1 -127
  294. package/dist/core/shared/serial-queue.js +1 -79
  295. package/dist/core/shared/serialization.js +1 -210
  296. package/dist/core/shared/split-comma-list.js +1 -30
  297. package/dist/core/shared/text-normalization.js +1 -38
  298. package/dist/core/shared/time.js +1 -306
  299. package/dist/core/store/index.js +1 -12
  300. package/dist/core/store/item-format-migration.js +1 -125
  301. package/dist/core/store/item-metadata-cache.js +1 -1116
  302. package/dist/core/store/item-metadata-query-index.js +9 -394
  303. package/dist/core/store/item-metadata-read-work.js +1 -43
  304. package/dist/core/store/item-store.js +1 -693
  305. package/dist/core/store/paths.d.ts +1 -1
  306. package/dist/core/store/paths.js +1 -214
  307. package/dist/core/store/settings-read-cache.js +1 -85
  308. package/dist/core/store/settings-validator.d.ts +1 -0
  309. package/dist/core/store/settings-validator.js +1 -421
  310. package/dist/core/store/settings.js +3 -1309
  311. package/dist/core/store/tracker-preflight.js +1 -141
  312. package/dist/core/telemetry/consent.js +5 -108
  313. package/dist/core/telemetry/observability.js +1 -246
  314. package/dist/core/telemetry/runtime.js +4 -1988
  315. package/dist/core/test/background-runs.js +4 -945
  316. package/dist/core/test/item-test-run-tracking.js +1 -63
  317. package/dist/core/test/run-selectors.js +1 -120
  318. package/dist/core/validate/estimate-defaults.js +1 -89
  319. package/dist/core/validate/fix-planning.js +1 -189
  320. package/dist/core/validate/linked-artifact-reference.js +1 -36
  321. package/dist/core/validate/missing-by-type.js +1 -34
  322. package/dist/core/validate/missing-link-owners.js +1 -95
  323. package/dist/core/validate/stale-file-classification.js +1 -82
  324. package/dist/mcp/http-server.js +5 -448
  325. package/dist/mcp/legacy-adapter.js +1 -77
  326. package/dist/mcp/runtime-capabilities.js +1 -200
  327. package/dist/mcp/server.js +4 -1233
  328. package/dist/mcp/tool-definitions.js +1 -804
  329. package/dist/sdk/actionability.js +1 -13
  330. package/dist/sdk/agent/closed-domain-contracts.js +1 -161
  331. package/dist/sdk/agent/command-recovery.js +1 -59
  332. package/dist/sdk/agent/command-suggestions.js +1 -66
  333. package/dist/sdk/agent/create-option-policy.js +1 -31
  334. package/dist/sdk/agent/identity-config.js +1 -106
  335. package/dist/sdk/agent/item-addressing.js +1 -207
  336. package/dist/sdk/agent/refusal-closure-census.js +1 -151
  337. package/dist/sdk/agent/refusal-closure.js +1 -133
  338. package/dist/sdk/agent/refusal-corpus-contracts.js +1 -193
  339. package/dist/sdk/agent/refusal-reachability.js +1 -593
  340. package/dist/sdk/agent/subcommand-recovery.js +1 -83
  341. package/dist/sdk/agent/task-transcript-contracts.js +1 -197
  342. package/dist/sdk/agent/tracker-preflight-contracts.js +1 -126
  343. package/dist/sdk/agent-capability-contracts.js +1 -428
  344. package/dist/sdk/agent-session-context.js +1 -9
  345. package/dist/sdk/annotations.js +1 -448
  346. package/dist/sdk/author-attribution.js +1 -468
  347. package/dist/sdk/authoring.js +1 -20
  348. package/dist/sdk/cli-bootstrap.js +1 -838
  349. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +1 -1
  350. package/dist/sdk/cli-contracts/agent-output-contracts.js +4 -476
  351. package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -79
  352. package/dist/sdk/cli-contracts/command-aliases.d.ts +4 -0
  353. package/dist/sdk/cli-contracts/command-aliases.js +1 -107
  354. package/dist/sdk/cli-contracts/command-exit-contracts.js +1 -151
  355. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1081
  356. package/dist/sdk/cli-contracts/commander-types.js +1 -159
  357. package/dist/sdk/cli-contracts/completeness.js +1 -393
  358. package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
  359. package/dist/sdk/cli-contracts/enum-contracts.js +1 -222
  360. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1947
  361. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -347
  362. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -986
  363. package/dist/sdk/cli-contracts/registration-helpers.js +7 -990
  364. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +5 -0
  365. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -2090
  366. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +1 -324
  367. package/dist/sdk/cli-contracts/string-lists.js +1 -16
  368. package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -461
  369. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -2167
  370. package/dist/sdk/cli-contracts/tool-schema.d.ts +3 -1
  371. package/dist/sdk/cli-contracts/tool-schema.js +1 -1664
  372. package/dist/sdk/cli-contracts/typed-action-inputs.js +1 -4
  373. package/dist/sdk/cli-contracts.d.ts +1 -1
  374. package/dist/sdk/cli-contracts.js +1 -17
  375. package/dist/sdk/cli-program.js +1 -49
  376. package/dist/sdk/command-line.d.ts +2 -5
  377. package/dist/sdk/command-line.js +1 -78
  378. package/dist/sdk/comments.js +1 -133
  379. package/dist/sdk/compile-cache.js +1 -73
  380. package/dist/sdk/completion.js +174 -839
  381. package/dist/sdk/compose.js +1 -1090
  382. package/dist/sdk/config.js +1 -1204
  383. package/dist/sdk/context/recency.js +1 -33
  384. package/dist/sdk/context/semantic-session-attribution.js +1 -82
  385. package/dist/sdk/context/usage-egress.js +1 -29
  386. package/dist/sdk/context/usage-ledger.js +3 -185
  387. package/dist/sdk/context-intent-contracts.js +1 -709
  388. package/dist/sdk/context-intent-runtime.js +1 -115
  389. package/dist/sdk/context-packing.js +1 -218
  390. package/dist/sdk/context-relevance.js +1 -503
  391. package/dist/sdk/context-signal-store.js +2 -426
  392. package/dist/sdk/context-usage.js +1 -367
  393. package/dist/sdk/contracts.js +1 -23
  394. package/dist/sdk/core-governance.js +1 -14
  395. package/dist/sdk/core.js +1 -14
  396. package/dist/sdk/corpus-shape.js +1 -401
  397. package/dist/sdk/define.js +1 -220
  398. package/dist/sdk/dependencies.js +1 -718
  399. package/dist/sdk/dependency-flag-validation.js +1 -156
  400. package/dist/sdk/dependency-provenance.js +1 -135
  401. package/dist/sdk/docs.js +1 -14
  402. package/dist/sdk/duplicates.js +1 -40
  403. package/dist/sdk/environment/agent-environment.js +1 -466
  404. package/dist/sdk/environment/host-environment-errors.js +1 -8
  405. package/dist/sdk/environment/project-runtime-compatibility.js +1 -481
  406. package/dist/sdk/environment/source-context.js +1 -28
  407. package/dist/sdk/environment/tracker-preflight.js +1 -9
  408. package/dist/sdk/error-code-catalog.js +1 -153
  409. package/dist/sdk/error-runtime.js +1 -58
  410. package/dist/sdk/errors.js +1 -58
  411. package/dist/sdk/eval.js +1 -190
  412. package/dist/sdk/extension/author-manifest.js +1 -92
  413. package/dist/sdk/extension/bundled-catalog.js +1 -332
  414. package/dist/sdk/extension/concurrency.js +1 -25
  415. package/dist/sdk/extension/copy-scope.d.ts +2 -0
  416. package/dist/sdk/extension/copy-scope.js +2 -0
  417. package/dist/sdk/extension/custom-field-collisions.js +1 -30
  418. package/dist/sdk/extension/describe.js +3 -189
  419. package/dist/sdk/extension/doctor.js +1 -606
  420. package/dist/sdk/extension/install-plan.d.ts +69 -0
  421. package/dist/sdk/extension/install-plan.js +2 -0
  422. package/dist/sdk/extension/install-receipts.d.ts +7 -0
  423. package/dist/sdk/extension/install-receipts.js +2 -0
  424. package/dist/sdk/extension/install-runtime.js +3 -313
  425. package/dist/sdk/extension/install-snapshot.js +1 -66
  426. package/dist/sdk/extension/install-sources.js +5 -1057
  427. package/dist/sdk/extension/managed-state.js +2 -252
  428. package/dist/sdk/extension/migrations.js +2 -174
  429. package/dist/sdk/extension/output-ownership.js +1 -25
  430. package/dist/sdk/extension/runtime-summary.js +1 -18
  431. package/dist/sdk/extension/scaffold.js +4 -2308
  432. package/dist/sdk/extension/shared.js +1 -147
  433. package/dist/sdk/extension/source-resolution.js +1 -65
  434. package/dist/sdk/extension/update-check.js +1 -67
  435. package/dist/sdk/extension-command-context.js +1 -44
  436. package/dist/sdk/extension-contracts.js +1 -73
  437. package/dist/sdk/extension.d.ts +7 -2
  438. package/dist/sdk/extension.js +1 -2196
  439. package/dist/sdk/files.js +1 -535
  440. package/dist/sdk/flag-invocation-contracts.d.ts +0 -5
  441. package/dist/sdk/flag-invocation-contracts.js +1 -344
  442. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -2224
  443. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -2236
  444. package/dist/sdk/generated-error-code-catalog.js +1 -16
  445. package/dist/sdk/governance/assurance-action-contracts.js +1 -4
  446. package/dist/sdk/governance/assurance-action.js +1 -411
  447. package/dist/sdk/governance/assurance-limits.js +1 -10
  448. package/dist/sdk/governance/assurance-mutation-error.js +1 -81
  449. package/dist/sdk/governance/assurance-presets.js +1 -135
  450. package/dist/sdk/governance/assurance-runtime.js +1 -238
  451. package/dist/sdk/governance/assurance.js +4 -1182
  452. package/dist/sdk/governance/boundary-fixtures.js +1 -200
  453. package/dist/sdk/governance/coverage-assurance.js +1 -60
  454. package/dist/sdk/governance/defect-recurrence-coverage.js +1 -188
  455. package/dist/sdk/governance/defect-recurrence-graph.js +1 -120
  456. package/dist/sdk/governance/defect-recurrence-signals.js +1 -24
  457. package/dist/sdk/governance/defect-recurrence.js +1 -623
  458. package/dist/sdk/governance/extension-host-version.js +1 -115
  459. package/dist/sdk/governance/gc.js +1 -368
  460. package/dist/sdk/governance/health.js +1 -2367
  461. package/dist/sdk/governance/hierarchy-validation.js +1 -108
  462. package/dist/sdk/governance/linked-file-report.js +1 -71
  463. package/dist/sdk/governance/merge-receipt-history.js +1 -206
  464. package/dist/sdk/governance/provenance-health.js +1 -282
  465. package/dist/sdk/governance/reindex.js +4 -761
  466. package/dist/sdk/governance/stale-work.js +1 -82
  467. package/dist/sdk/governance/status-role-diagnostics.js +1 -35
  468. package/dist/sdk/governance/storage-integrity.js +1 -280
  469. package/dist/sdk/governance/tracked-runtime-cache.js +1 -106
  470. package/dist/sdk/governance/upgrade.js +2 -327
  471. package/dist/sdk/governance/validate-history-drift.js +1 -81
  472. package/dist/sdk/governance/validate-item-reader.js +1 -17
  473. package/dist/sdk/governance/validate-normalization.js +1 -36
  474. package/dist/sdk/governance/validate.d.ts +3 -1
  475. package/dist/sdk/governance/validate.js +1 -2261
  476. package/dist/sdk/governance/workflow-completeness.d.ts +32 -0
  477. package/dist/sdk/governance/workflow-completeness.js +2 -0
  478. package/dist/sdk/governance/workflow-policy.d.ts +47 -0
  479. package/dist/sdk/governance/workflow-policy.js +4 -0
  480. package/dist/sdk/governance/workspace-position.js +1 -163
  481. package/dist/sdk/governance.d.ts +2 -0
  482. package/dist/sdk/governance.js +1 -31
  483. package/dist/sdk/graph/adapter.js +1 -181
  484. package/dist/sdk/graph/analytics.js +1 -474
  485. package/dist/sdk/graph/assembly.js +1 -377
  486. package/dist/sdk/graph/cache.js +1 -160
  487. package/dist/sdk/graph/centrality.js +1 -258
  488. package/dist/sdk/graph/conformance.js +1 -130
  489. package/dist/sdk/graph/deadline-scheduling.d.ts +90 -0
  490. package/dist/sdk/graph/deadline-scheduling.js +2 -0
  491. package/dist/sdk/graph/durable-cache.d.ts +1 -1
  492. package/dist/sdk/graph/durable-cache.js +1 -361
  493. package/dist/sdk/graph/governance-contracts.js +1 -34
  494. package/dist/sdk/graph/governance.d.ts +13 -1
  495. package/dist/sdk/graph/governance.js +1 -735
  496. package/dist/sdk/graph/hierarchy-integrity.js +1 -310
  497. package/dist/sdk/graph/index.d.ts +3 -2
  498. package/dist/sdk/graph/index.js +1 -26
  499. package/dist/sdk/graph/lifecycle-coverage.d.ts +32 -0
  500. package/dist/sdk/graph/lifecycle-coverage.js +2 -0
  501. package/dist/sdk/graph/mutation-advisory.js +1 -176
  502. package/dist/sdk/graph/remediation.js +1 -197
  503. package/dist/sdk/graph/run.d.ts +15 -1
  504. package/dist/sdk/graph/run.js +1 -768
  505. package/dist/sdk/graph/scheduling.js +1 -124
  506. package/dist/sdk/graph/traversal.js +1 -284
  507. package/dist/sdk/graph/workspace-relationship-kind-registry.js +1 -27
  508. package/dist/sdk/graph.js +1 -15
  509. package/dist/sdk/guide-topics.js +1 -707
  510. package/dist/sdk/guide.js +1 -279
  511. package/dist/sdk/history/maintenance.d.ts +71 -0
  512. package/dist/sdk/history/maintenance.js +2 -0
  513. package/dist/sdk/history/salvage.js +2 -247
  514. package/dist/sdk/history/subject.d.ts +19 -0
  515. package/dist/sdk/history/subject.js +2 -0
  516. package/dist/sdk/history-analytics.js +1 -282
  517. package/dist/sdk/history-compact.js +1 -527
  518. package/dist/sdk/history-mcp.js +1 -68
  519. package/dist/sdk/history-provenance.js +1 -182
  520. package/dist/sdk/history-read.js +1 -96
  521. package/dist/sdk/history-redact.d.ts +1 -14
  522. package/dist/sdk/history-redact.js +1 -643
  523. package/dist/sdk/history-repair.d.ts +5 -0
  524. package/dist/sdk/history-repair.js +1 -657
  525. package/dist/sdk/improvement-ledger-validation.js +1 -62
  526. package/dist/sdk/improvement-ledger.js +2 -257
  527. package/dist/sdk/index.d.ts +4 -1
  528. package/dist/sdk/index.js +1 -183
  529. package/dist/sdk/init-agent-guidance.js +2 -496
  530. package/dist/sdk/init.js +2 -820
  531. package/dist/sdk/invocation-author.js +1 -39
  532. package/dist/sdk/item-children.js +1 -90
  533. package/dist/sdk/item-metadata-index.js +1 -15
  534. package/dist/sdk/item-schedule.js +1 -27
  535. package/dist/sdk/item-transaction.js +1 -396
  536. package/dist/sdk/learnings.js +1 -29
  537. package/dist/sdk/lifecycle/append.js +2 -53
  538. package/dist/sdk/lifecycle/claim.d.ts +2 -0
  539. package/dist/sdk/lifecycle/claim.js +1 -242
  540. package/dist/sdk/lifecycle/close-many.js +1 -438
  541. package/dist/sdk/lifecycle/close.js +1 -468
  542. package/dist/sdk/lifecycle/copy.js +1 -212
  543. package/dist/sdk/lifecycle/create.js +1 -1949
  544. package/dist/sdk/lifecycle/delete.js +1 -45
  545. package/dist/sdk/lifecycle/event-validation-messages.js +1 -91
  546. package/dist/sdk/lifecycle/focus.js +1 -91
  547. package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -24
  548. package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -149
  549. package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -40
  550. package/dist/sdk/lifecycle/mcp-actions.d.ts +2 -0
  551. package/dist/sdk/lifecycle/mcp-actions.js +1 -51
  552. package/dist/sdk/lifecycle/metadata-normalizers.js +1 -46
  553. package/dist/sdk/lifecycle/mutation-command-options.js +1 -9
  554. package/dist/sdk/lifecycle/plan.js +1 -1606
  555. package/dist/sdk/lifecycle/recurrence-parsers.d.ts +1 -1
  556. package/dist/sdk/lifecycle/recurrence-parsers.js +1 -147
  557. package/dist/sdk/lifecycle/reopen.js +1 -68
  558. package/dist/sdk/lifecycle/repeatable-metadata-parsers.js +1 -143
  559. package/dist/sdk/lifecycle/restore.d.ts +1 -0
  560. package/dist/sdk/lifecycle/restore.js +1 -330
  561. package/dist/sdk/lifecycle/shared-unset-fields.js +1 -295
  562. package/dist/sdk/lifecycle/update-many.js +1 -861
  563. package/dist/sdk/lifecycle/update.js +1 -2136
  564. package/dist/sdk/lifecycle-completion.js +1 -92
  565. package/dist/sdk/lifecycle-policy.js +1 -120
  566. package/dist/sdk/linked-artifacts.js +1 -530
  567. package/dist/sdk/mcp/apps.js +4 -133
  568. package/dist/sdk/mcp/authorization.js +1 -404
  569. package/dist/sdk/mcp/discovery.js +1 -494
  570. package/dist/sdk/mcp/interactions.js +1 -336
  571. package/dist/sdk/mcp/protocol.d.ts +7 -0
  572. package/dist/sdk/mcp/protocol.js +1 -184
  573. package/dist/sdk/mcp/skills.js +1 -389
  574. package/dist/sdk/mcp/subscriptions.js +1 -211
  575. package/dist/sdk/mcp/tasks.js +2 -430
  576. package/dist/sdk/mcp/transport.js +1 -260
  577. package/dist/sdk/merge/abandoned-receipts.js +1 -46
  578. package/dist/sdk/merge/driver.js +1 -212
  579. package/dist/sdk/merge/index.js +1 -16
  580. package/dist/sdk/merge/install.js +3 -561
  581. package/dist/sdk/merge/receipt-file-boundary.js +1 -46
  582. package/dist/sdk/merge/receipt-operation.js +1 -96
  583. package/dist/sdk/merge/receipt-schema.js +1 -397
  584. package/dist/sdk/merge/receipts.js +4 -525
  585. package/dist/sdk/merge/reconcile.js +1 -352
  586. package/dist/sdk/merge/three-way.js +3 -775
  587. package/dist/sdk/merge.js +1 -10
  588. package/dist/sdk/mutation-events.js +1 -292
  589. package/dist/sdk/mutation-guard.js +1 -216
  590. package/dist/sdk/notes.js +1 -139
  591. package/dist/sdk/output-contracts.js +1 -172
  592. package/dist/sdk/output-projection.js +1 -430
  593. package/dist/sdk/output-token-accounting.js +1 -140
  594. package/dist/sdk/output.js +1 -64
  595. package/dist/sdk/ownership-source.js +1 -21
  596. package/dist/sdk/package-import-adapters.js +1 -442
  597. package/dist/sdk/package-migrations.js +1 -20
  598. package/dist/sdk/package-runtime-options.js +1 -80
  599. package/dist/sdk/pagination.js +1 -162
  600. package/dist/sdk/profile.js +1 -454
  601. package/dist/sdk/provenance.js +1 -258
  602. package/dist/sdk/public-surface.json +1 -1
  603. package/dist/sdk/query/activity.js +1 -401
  604. package/dist/sdk/query/aggregate.d.ts +16 -0
  605. package/dist/sdk/query/aggregate.js +1 -390
  606. package/dist/sdk/query/calendar.js +1 -964
  607. package/dist/sdk/query/complete-list.js +1 -215
  608. package/dist/sdk/query/context.js +1 -1702
  609. package/dist/sdk/query/duplicate-candidates.js +1 -70
  610. package/dist/sdk/query/get.js +1 -450
  611. package/dist/sdk/query/history.js +1 -186
  612. package/dist/sdk/query/item-filter-options.js +1 -9
  613. package/dist/sdk/query/light-metadata.js +1 -18
  614. package/dist/sdk/query/list-filter-shared.js +1 -81
  615. package/dist/sdk/query/list.js +1 -1304
  616. package/dist/sdk/query/multi-value-filters.js +1 -78
  617. package/dist/sdk/query/next.js +1 -513
  618. package/dist/sdk/query/parsers.js +1 -44
  619. package/dist/sdk/query/projection-contracts.js +1 -184
  620. package/dist/sdk/query/search-contracts.d.ts +27 -0
  621. package/dist/sdk/query/search-contracts.js +1 -230
  622. package/dist/sdk/query/search-pagination.js +1 -35
  623. package/dist/sdk/query/search-rendering.js +1 -105
  624. package/dist/sdk/query/search.d.ts +6 -4
  625. package/dist/sdk/query/search.js +2 -1987
  626. package/dist/sdk/query.js +1 -35
  627. package/dist/sdk/read-output/continuation.js +1 -194
  628. package/dist/sdk/read-output-budget.js +1 -135
  629. package/dist/sdk/read-output-contracts.d.ts +1 -1
  630. package/dist/sdk/read-output-contracts.js +1 -1225
  631. package/dist/sdk/read-output-rows.js +1 -186
  632. package/dist/sdk/read-output-session.js +1 -208
  633. package/dist/sdk/relationship-analytics.js +1 -410
  634. package/dist/sdk/relationship-context.js +1 -284
  635. package/dist/sdk/relationship-history.js +4 -519
  636. package/dist/sdk/relationship-kinds/contract.js +1 -22
  637. package/dist/sdk/relationship-migration.js +1 -77
  638. package/dist/sdk/relationships.js +1 -579
  639. package/dist/sdk/reproducibility/process.js +1 -87
  640. package/dist/sdk/runtime-action-aliases.js +1 -59
  641. package/dist/sdk/runtime-extended-actions.js +1 -177
  642. package/dist/sdk/runtime-input.js +1 -614
  643. package/dist/sdk/runtime-primitives.js +1 -84
  644. package/dist/sdk/runtime-public-contracts.d.ts +2 -1
  645. package/dist/sdk/runtime-public-contracts.js +1 -4
  646. package/dist/sdk/runtime-stats-options.js +1 -38
  647. package/dist/sdk/runtime.d.ts +4 -0
  648. package/dist/sdk/runtime.js +1 -1928
  649. package/dist/sdk/scheduling-shortcuts.js +1 -63
  650. package/dist/sdk/schema-migration.js +3 -856
  651. package/dist/sdk/schema.d.ts +2 -1
  652. package/dist/sdk/schema.js +1 -1376
  653. package/dist/sdk/search-refresh-worker.js +1 -18
  654. package/dist/sdk/similarity-scoring.js +1 -53
  655. package/dist/sdk/similarity.js +1 -326
  656. package/dist/sdk/start-task-status.js +1 -14
  657. package/dist/sdk/stats.js +1 -270
  658. package/dist/sdk/structured-mutations.js +1 -580
  659. package/dist/sdk/telemetry-flush.js +1 -13
  660. package/dist/sdk/telemetry.js +1 -405
  661. package/dist/sdk/templates.js +2 -292
  662. package/dist/sdk/test/batch.js +2 -509
  663. package/dist/sdk/test/entry.js +1 -70
  664. package/dist/sdk/test/execution.js +6 -2211
  665. package/dist/sdk/test/linked-command-detection.js +1 -546
  666. package/dist/sdk/test/measurements.js +1 -91
  667. package/dist/sdk/test/parsers.js +1 -545
  668. package/dist/sdk/test/runs.js +1 -193
  669. package/dist/sdk/test/trust.js +2 -206
  670. package/dist/sdk/testing.js +4 -1391
  671. package/dist/sdk/traceability/runtime-files-lookup.js +1 -32
  672. package/dist/sdk/traceability/source-traceability.js +1 -292
  673. package/dist/sdk/tracker-root-discovery.js +1 -9
  674. package/dist/sdk/workspace-contracts-cache.js +1 -28
  675. package/dist/sdk/workspace-contracts.js +1 -33
  676. package/dist/sdk/workspace-memory.js +2 -318
  677. package/dist/sdk/workspace-recipe.js +1 -71
  678. package/dist/sdk/workspace-snapshot.js +4 -613
  679. package/dist/sdk/workspace-transaction-gc.js +1 -149
  680. package/dist/sdk/workspace-transaction.js +2 -363
  681. package/dist/sdk/workspace.js +3 -127
  682. package/dist/types/index.js +1 -9
  683. package/dist/types.d.ts +4 -0
  684. package/dist/types.js +1 -245
  685. package/docs/AGENT_GUIDE.md +1 -1
  686. package/docs/COMMANDS.md +10 -0
  687. package/docs/CONFIGURATION.md +12 -1
  688. package/docs/CONTEXT_ALGORITHM_PORTFOLIO.md +167 -0
  689. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +9 -3
  690. package/docs/EXTENSIONS.md +1 -0
  691. package/docs/HISTORY_MAINTENANCE.md +125 -0
  692. package/docs/MCP_2026_07_28_CONFORMANCE.md +20 -10
  693. package/docs/PACKAGE_EVIDENCE.md +92 -0
  694. package/docs/PLANNING_MEASUREMENTS.md +183 -0
  695. package/docs/README.md +4 -0
  696. package/docs/READ_OUTPUT_CONTRACTS.md +5 -0
  697. package/docs/SCRIPTING.md +21 -0
  698. package/docs/TESTING.md +33 -0
  699. package/docs/WORKFLOW_POLICIES.md +129 -0
  700. package/docs/generated/FLAG_LEXICON_BUDGETS.md +7 -7
  701. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +11 -5
  702. package/marketplace.json +2 -2
  703. package/package.json +5 -5
  704. package/packages/pm-beads/package.json +1 -1
  705. package/packages/pm-calendar/package.json +1 -1
  706. package/packages/pm-command-kit/package.json +1 -1
  707. package/packages/pm-digital-twin/package.json +1 -1
  708. package/packages/pm-governance-audit/package.json +1 -1
  709. package/packages/pm-guide-shell/package.json +1 -1
  710. package/packages/pm-kanban/package.json +1 -1
  711. package/packages/pm-lifecycle-hooks/package.json +1 -1
  712. package/packages/pm-linked-test-adapters/package.json +1 -1
  713. package/packages/pm-search-advanced/package.json +1 -1
  714. package/packages/pm-templates/package.json +1 -1
  715. package/packages/pm-todos/package.json +1 -1
  716. package/packages/pm-vcs/package.json +1 -1
  717. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  718. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  719. package/scripts/finalize-build.mjs +45 -3
  720. package/dist/cli-bundle/chunks/chunk-AZDFJGH6.js +0 -9
  721. package/dist/cli-bundle/chunks/chunk-CKOL5U7J.js +0 -77
  722. package/dist/cli-bundle/chunks/chunk-JX4DH4WC.js +0 -3
  723. package/dist/cli-bundle/chunks/chunk-OF76PSDQ.js +0 -5
  724. package/dist/cli-bundle/chunks/chunk-QUWFABDM.js +0 -232
  725. package/dist/cli-bundle/chunks/chunk-QWRRFYK3.js +0 -2
  726. package/dist/cli-bundle/chunks/chunk-RWWBOWJ5.js +0 -2
  727. package/dist/cli-bundle/chunks/chunk-WGAOYSYH.js +0 -40
  728. package/dist/cli-bundle/chunks/chunk-WI2AYPA7.js +0 -2
  729. package/dist/cli-bundle/chunks/register-list-query-5JL52D33.js +0 -11
  730. package/dist/cli-bundle/chunks/register-mutation-ZPG7KMVP.js +0 -20
  731. package/dist/cli-bundle/chunks/register-operations-I5W3KMGB.js +0 -2
  732. package/dist/cli-bundle/chunks/register-setup-H4SVAVX7.js +0 -2
  733. package/dist/cli-bundle/focused-chunks/chunk-AL5ON6K6.js +0 -2
  734. package/dist/cli-bundle/focused-chunks/chunk-CHC2IDXA.js +0 -6
  735. package/dist/cli-bundle/focused-chunks/chunk-CK6QFAPZ.js +0 -20
  736. package/dist/cli-bundle/focused-chunks/chunk-EZR3GHFE.js +0 -2
  737. package/dist/cli-bundle/focused-chunks/chunk-H2WJWK7L.js +0 -56
  738. package/dist/cli-bundle/focused-chunks/chunk-NTPY5GSO.js +0 -3
  739. package/dist/cli-bundle/focused-chunks/chunk-P5O7MP5Y.js +0 -2
  740. package/dist/cli-bundle/focused-chunks/chunk-PDMW2E36.js +0 -177
  741. package/dist/cli-bundle/focused-chunks/chunk-PEFABF7E.js +0 -26
  742. package/dist/cli-bundle/focused-chunks/chunk-QTVCLMSZ.js +0 -6
  743. package/dist/cli-bundle/focused-chunks/chunk-QTZRBUYA.js +0 -8
  744. package/dist/cli-bundle/focused-chunks/chunk-SGQST3PQ.js +0 -12
  745. package/dist/cli-bundle/focused-chunks/chunk-UKHASMMP.js +0 -10
  746. package/dist/cli-bundle/focused-chunks/chunk-ZPEKQHOC.js +0 -2
@@ -1,5 +1,5 @@
1
- import{A as $v,B as Ih,C as vh,D as Fv,E as jv,a as us,b as ps,c as fs,d as ms,e as Rv,f as Iv,g as ir,h as yh,i as bh,j as Ch,l as Th,m as wh,n as Sh,o as Eh,p as Ah,q as xh,r as Oh,s as Rh,t as vv,u as Pv,v as kv,w as Mv,x as Nv,y as Lv,z as Dv}from"./chunks/chunk-RWWBOWJ5.js";import{A as AP,B as xP,C as OP,D as RP,E as IP,F as vP,G as PP,H as kP,I as MP,J as NP,K as LP,L as DP,M as $P,N as FP,O as jP,P as GP,Q as UP,R as BP,S as qP,T as zP,U as VP,V as HP,W as KP,X as WP,Y as XP,a as Qv,b as eP,c as tP,d as rP,e as nP,f as oP,g as iP,h as sP,i as aP,j as cP,k as dP,l as lP,m as uP,n as pP,o as fP,p as mP,q as _P,r as hP,s as gP,t as yP,u as bP,v as CP,w as TP,x as wP,y as SP,z as EP}from"./chunks/chunk-JT6XF6GE.js";import{a as Gv,b as Uv,c as Bv,d as qv}from"./chunks/chunk-NPN5I67J.js";import{a as zv,b as Vv,c as Hv,d as Kv,e as Wv,f as Xv,g as Yv,h as Jv,i as Zv}from"./chunks/chunk-WI2AYPA7.js";import{$ as Qt,$a as qm,$b as q_,A as fx,Aa as um,Ab as h_,Ac as hh,B as au,Ba as pm,Bb as g_,Bc as gh,C as Zu,Ca as fm,Cb as y_,D as Qu,Da as mm,Db as b_,E as ep,Ea as _m,Eb as C_,F as tp,Fa as hm,Fb as T_,G as rp,Ga as gm,Gb as w_,H as xp,Ha as ym,Hb as S_,I as He,Ia as bm,Ib as E_,J as Op,Ja as Cm,Jb as A_,K as Rp,Ka as Tm,Kb as x_,L as Ip,La as wm,Lb as O_,M as vp,Ma as Sm,Mb as R_,N as Pp,Na as Em,Nb as I_,O as kp,Oa as Am,Ob as v_,P as ev,Pa as xm,Pb as P_,Q as tv,Qa as Om,Qb as k_,R as rv,Ra as Rm,Rb as M_,S as zt,Sa as Im,Sb as N_,T as Vt,Ta as vm,Tb as L_,U as Ht,Ua as Pm,Ub as D_,V as Kt,Va as or,Vb as $_,W as Wt,Wa as me,Wb as F_,X as Xt,Xa as jm,Xb as j_,Y as Yt,Ya as Gm,Yb as G_,Z as Jt,Za as Um,Zb as U_,_ as Zt,_a as Bm,_b as B_,a as Uc,aa as er,ab as zm,ac as z_,b as Bc,ba as df,bb as Vm,bc as V_,c as qc,ca as lf,cb as Hm,cc as H_,d as GA,da as uf,db as Km,dc as K_,e as UA,ea as pf,eb as Wm,ec as W_,f as Vc,fa as ff,fb as Xm,fc as X_,g as WA,ga as Ke,gb as Ym,gc as Y_,h as XA,ha as mf,hb as Jm,hc as J_,i as YA,ia as _f,ib as Zm,ic as Z_,j as JA,ja as hf,jb as Qm,jc as Q_,k as ZA,ka as gf,kb as e_,kc as eh,l as QA,la as yf,lb as t_,lc as th,m as ex,ma as bf,mb as r_,mc as rh,n as tx,na as Cf,nb as n_,nc as nh,o as rx,oa as Tf,ob as o_,oc as oh,p as nx,pa as uv,pb as i_,pc as ih,q as ox,qa as pv,qb as s_,qc as sh,r as ix,ra as fv,rb as a_,rc as ah,s as sx,sa as mv,sb as c_,sc as ch,t as ax,ta as _v,tb as d_,tc as dh,u as Yc,ua as im,ub as l_,uc as lh,v as cx,va as sm,vb as u_,vc as uh,w as dx,wa as am,wb as p_,wc as ph,x as lx,xa as cm,xb as f_,xc as fh,y as ux,ya as dm,yb as m_,yc as mh,z as px,za as lm,zb as __,zc as _h}from"./chunks/chunk-BAX2BYUW.js";import{a as qt,f as jI,g as GI,h as Lp,i as Dp}from"./chunks/chunk-JX4DH4WC.js";import{A as ZI,B as QI,C as Kp,D as Wp,E as Xp,b as su,c as NR,d as RI,e as kI,f as MI,g as NI,h as LI,i as DI,j as Mp,k as $I,l as qp,m as zp,n as Vp,o as Hp,p as UI,q as BI,r as qI,s as zI,t as VI,u as HI,v as KI,w as WI,x as XI,y as YI,z as JI}from"./chunks/chunk-OF76PSDQ.js";import{$a as vl,$b as CI,$c as sf,$d as Wf,A as Yx,Aa as LO,Ab as nu,Ac as hp,Ad as Tv,B as Jx,Ba as DO,Bb as ou,Bc as gp,Bd as wv,C as Zx,Ca as $O,Cb as OR,Cc as yp,Cd as rr,D as Qx,Da as FO,Db as RR,Dc as bp,Dd as Sv,E as dO,Ea as jO,Eb as IR,Ec as Cp,Ed as Ev,Fa as GO,Fb as vR,Fc as Tp,Fd as nr,Ga as UO,Gb as PR,Gc as wp,Gd as Av,Ha as BO,Hb as kR,Hc as Sp,Hd as xv,Ia as qO,Ib as MR,Ic as vI,J as Hd,Ja as zO,Jb as cu,Jc as PI,Jd as vf,Ka as VO,Kb as du,Kc as Ep,Kd as Pf,La as HO,Lb as lu,Ld as kf,Ma as KO,Mb as uu,Md as Mf,Na as WO,Nb as pu,Nd as Nf,Oa as XO,Oc as Ap,Od as Lf,Pa as YO,Pb as fu,Pd as Df,Qa as JO,Qb as mu,Qc as FI,Qd as $f,Ra as ZO,Rb as _u,Rc as Np,Rd as Ff,Sa as Sl,Sb as hu,Sc as Yp,Sd as jf,Ta as El,Tb as gu,Tc as Jp,Td as Gf,Ua as QO,Ub as Hu,Uc as Zp,Ud as Uf,Va as eR,Vb as Ku,Vc as Qp,Vd as Bf,Wa as Al,Wb as Wu,Wc as ef,Wd as qf,Xa as xl,Xb as Xu,Xc as tf,Xd as zf,Ya as Ol,Yb as gI,Yc as rf,Yd as Vf,Za as Rl,Zb as yI,Zc as nf,Zd as Hf,_a as Il,_b as bI,_c as of,_d as Kf,a as Ex,aa as lO,ab as Pl,ac as TI,ad as af,ae as Ov,b as Ax,ba as uO,bb as kl,bc as Yu,bd as cf,be as Xf,c as xx,ca as Kd,cb as Ml,cc as Ju,cd as cv,ce as Yf,d as Ox,da as Wd,db as Nl,dc as wI,dd as dv,de as Jf,e as Rx,ea as Xd,eb as Ll,ec as SI,ed as lv,ee as Zf,f as Ix,fa as Yd,fb as Dl,fc as EI,fd as wf,fe as Qf,g as vx,ga as Jd,gb as $l,gc as Ve,gd as hv,ge as em,h as Px,ha as Zd,hb as Fl,hc as AI,hd as tr,he as tm,i as kx,ia as Qd,ib as jl,ic as Bt,id as gv,ie as rm,j as Mx,ja as TO,jb as Gl,jc as xI,jd as We,je as nm,k as Nx,ka as wO,kb as Ul,kc as OI,kd as re,ke as om,l as Lx,la as SO,lb as Bl,ld as Sf,le as km,m as Dx,ma as EO,mb as ql,mc as np,me as Mm,n as $x,na as AO,nb as zl,nc as op,ne as Nm,o as Fx,oa as xO,ob as Vl,oc as II,od as Xe,oe as Lm,p as jx,pa as OO,pb as Hl,pc as ip,pd as Ef,pe as Dm,q as Gx,qa as RO,qb as Kl,qc as sp,qd as Af,qe as $m,r as Ux,ra as IO,rb as Wl,rc as ap,re as Fm,s as Bx,sa as vO,sb as Xl,sc as cp,sd as fe,t as qx,ta as PO,tb as Yl,tc as dp,td as xf,u as zx,ua as kO,ub as Jl,uc as lp,ud as Of,v as Vx,va as MO,vb as Zl,vc as up,vd as Rf,w as Hx,wb as Ql,wc as pp,wd as If,x as Kx,xb as eu,xc as fp,xd as yv,y as Wx,ya as NO,yb as tu,yc as mp,yd as bv,z as Xx,zb as ru,zc as _p,zd as Cv}from"./chunks/chunk-WGAOYSYH.js";import{Ba as hl,Ca as gl,Da as yl,Ea as bl,Fa as Cl,H as cl,Ha as Tl,I as dl,Ia as wl,J as ll,Ja as $p,K as ul,Ka as Fp,L as Lt,La as jp,Na as Gp,Oa as Up,Pa as Bp,a as HA,b as KA,c as Hc,d as Kc,f as Wc,g as Xc,h as pO,i as fO,j as mO,k as _O,l as hO,m as gO,n as yO,o as bO,oa as Dt,p as el,pa as $t,q as tl,qa as Ft,r as rl,ra as jt,s as nl,sa as pl,t as ol,u as CO,ua as fl,v as il,va as ml,w as sl,wa as _l,x as al}from"./chunks/chunk-CKOL5U7J.js";import{$ as pd,$b as pI,A as wx,Aa as Fd,Ab as jR,Ac as mI,B as Sx,Ba as jd,Bb as GR,Bc as _I,Ca as Gd,Cb as UR,Cc as Vu,D as Jc,Da as Ud,Db as BR,Dc as hI,E as eO,Ea as Bd,Eb as qR,Ec as nv,F as tO,Fa as qd,Fb as zR,Fc as ov,G as rO,Ga as zd,Gb as VR,Gc as iv,H as nO,Ha as Vd,Hb as HR,Hc as sv,I as oO,Ib as KR,Ic as av,J as iO,Ja as tR,Jb as WR,K as sO,Ka as rR,Kb as XR,L as aO,La as nR,Lb as YR,M as Zc,Ma as oR,Mb as JR,N as Qc,Na as iR,Nb as ZR,O as ed,Oa as sR,Ob as QR,P as td,Pa as aR,Pb as eI,Q as rd,Qa as cR,Qb as tI,R as nd,Ra as dR,Rb as rI,S as od,Sa as lR,Sb as nI,T as id,Ta as uR,Tb as oI,U as sd,Ua as pR,Ub as iI,V as ad,Va as fR,Vb as sI,W as cd,Wb as aI,X as ze,Xb as cI,Y as dd,Yb as dI,Z as ld,Zb as lI,_ as ud,_b as uI,aa as cO,ac as wu,b as PA,ba as fd,bc as Su,c as kA,ca as md,cb as mR,cc as Eu,d as MA,da as _d,db as _R,dc as Au,e as NA,ea as hd,eb as hR,ec as xu,f as LA,fa as gd,fb as gR,fc as Ou,ga as yd,gb as yR,gc as Gt,ha as bd,hb as bR,hc as Ru,ia as Cd,ic as Iu,j as DA,ja as Td,jc as vu,k as $A,ka as wd,kb as CR,kc as Pu,l as zc,la as Sd,lb as TR,lc as ku,m as FA,ma as Ed,mb as wR,mc as Mu,n as jA,na as Ad,nb as SR,nc as Nu,o as BA,oa as xd,ob as ER,oc as Lu,p as qA,pa as Od,pb as AR,pc as Du,q as zA,qa as Rd,qb as xR,qc as $u,r as VA,ra as Id,rb as iu,rc as Fu,s as mx,sa as vd,sb as yu,sc as ju,t as _x,ta as Pd,tb as bu,tc as Gu,u as hx,ua as kd,ub as Cu,uc as Uu,v as gx,va as Md,vb as Tu,vc as Bu,w as yx,wa as Nd,wb as LR,wc as qu,x as bx,xa as Ld,xb as DR,xc as Ut,y as Cx,ya as Dd,yb as $R,yc as zu,z as Tx,za as $d,zb as FR,zc as fI}from"./chunks/chunk-AZDFJGH6.js";import{$ as eC,$a as Wn,$d as jT,$e as QT,$f as bi,$g as fS,$h as VS,$i as wE,$j as rs,$k as zs,$l as va,$m as qe,Ab as AC,Ac as qC,Ad as PT,Ae as No,Af as Wo,Ag as Gw,Aj as NE,Ak as gs,Al as na,Am as nc,B as qb,Bb as xC,Bc as zC,Be as Lo,Bf as Xo,Bg as Uw,Bk as ys,Bl as oa,Bm as oc,C as L,Cb as OC,Cc as VC,Ce as Do,Cf as Yo,Cg as Bw,Ci as nE,Cj as LE,Ck as bs,Cl as ia,Cm as ic,D as zb,Db as V,Dc as HC,De as $o,Df as Jo,Dg as qw,Di as oE,Dj as DE,Dk as Cs,Dl as sa,Dm as sc,E as b,Eb as RC,Ec as KC,Ee as zT,Ef as Zo,Eg as zw,Eh as NS,Ei as iE,Ej as $E,Ek as Ts,El as aa,Em as ac,Fc as ro,Fe as VT,Ff as Qo,Fg as Vw,Fh as LS,Fi as sE,Fj as FE,Fk as ws,Fl as ca,Fm as cc,G as Vb,Gc as WC,Gd as kT,Ge as Fe,Gf as ei,Gg as Hw,Gh as DS,Gi as aE,Gj as jE,Gk as Ss,Gl as da,Gm as dc,H as Hb,Hc as XC,He as HT,Hf as ti,Hg as Kw,Hh as $S,Hi as cE,Hj as GE,Hk as Es,Hl as la,Hm as lc,Ic as YC,Id as so,Ie as Fo,If as je,Ig as Ww,Ij as UE,Ik as As,Il as ua,Im as uc,Jc as JC,Jd as MT,Je as jo,Jf as Ge,Jg as Xw,Jh as FS,Jj as BE,Jk as xs,Jl as pa,Jm as pc,K as Kb,Kc as ZC,Kd as ao,Ke as Go,Kf as ri,Kg as Yw,Kh as jS,Ki as dE,Kj as qE,Kk as Os,Kl as fa,Km as fc,La as pC,Lc as QC,Le as Uo,Lf as ni,Lg as Jw,Li as lE,Lj as zE,Lk as Rs,Ll as ma,Lm as mc,Ma as fC,Mc as eT,Md as NT,Mf as oi,Mg as Zw,Mh as GS,Mi as qi,Mj as Pt,Mk as Is,Ml as _a,Mm as _c,N as Wb,Na as mC,Nc as tT,Nd as LT,Nf as ii,Ng as Qw,Ni as uE,Nj as VE,Nk as vs,Nl as ha,Nm as hc,O as Et,Oc as no,Od as DT,Of as si,Og as eS,Oh as US,Oi as pE,Oj as HE,Ok as Ps,Ol as ga,Om as gc,Pb as IC,Pc as rT,Pd as co,Pf as ai,Pg as tS,Ph as BS,Pi as fE,Pj as KE,Pk as ks,Pl as ya,Pm as yc,Q as At,Qa as Vn,Qb as Jn,Qc as oo,Qd as lo,Qf as ci,Qg as rS,Qh as qS,Qi as mE,Qj as WE,Qk as Ms,Ql as ba,Qm as bc,R as Dn,Ra as _C,Rb as Zn,Rd as uo,Re as Bo,Rf as di,Rg as nS,Rh as zS,Ri as vt,Rj as XE,Rk as Ns,Rl as Ca,Rm as Cc,S as $n,Sa as hC,Sb as vC,Sc as nT,Sd as po,Se as qo,Sf as li,Sg as oS,Sh as Pi,Si as zi,Sj as YE,Sk as Ls,Sl as Ta,Sm as Tc,T as xt,Ta as gC,Tb as PC,Tc as oT,Td as fo,Te as zo,Tf as ui,Tg as iS,Th as ki,Ti as _E,Tj as JE,Tk as Ds,Tl as wa,Tm as wc,Ua as yC,Ub as v,Uc as iT,Ud as mo,Uf as pi,Ug as sS,Uh as Mi,Ui as hE,Uj as ZE,Uk as $s,Ul as Sa,Um as Sc,V as Xb,Vb as kC,Vc as sT,Vd as _o,Ve as KT,Vf as fi,Vg as aS,Vh as Ni,Vi as gE,Vj as QE,Vk as Fs,Vl as Ea,Vm as Ec,Wa as Hn,Wb as Rt,Wc as aT,Wd as $T,We as WT,Wf as mi,Wg as cS,Wh as Li,Wi as yE,Wj as Ji,Wk as js,Wl as Aa,Wm as Ac,X as Yb,Xa as Kn,Xb as MC,Xc as It,Xd as FT,Xe as XT,Xf as _i,Xg as dS,Xh as Di,Xj as Zi,Xk as Gs,Xl as xa,Xm as xc,Y as Jb,Ya as De,Yc as cT,Ye as YT,Yf as hi,Yg as lS,Yh as $i,Yi as bE,Yj as Qi,Yk as Us,Yl as Oa,Ym as Oc,Z as Zb,Za as bC,Zb as NC,Zc as dT,Zd as ho,Ze as JT,Zf as gi,Zg as uS,Zh as Fi,Zi as CE,Zj as es,Zk as Bs,Zl as Ra,Zm as Rc,_ as Qb,_c as lT,_d as go,_e as ZT,_f as yi,_g as pS,_h as ji,_i as TE,_j as ts,_k as qs,_l as Ia,aa as tC,ab as Xn,ad as uT,ae as yo,af as ew,ag as Ci,ah as mS,aj as Vi,al as Vs,am as Pa,an as te,ba as rC,bd as pT,be as bo,bf as tw,bg as Ti,bh as _S,bi as Gi,bj as Hi,bk as ns,bl as Hs,bm as ka,bn as Ic,c as Mn,ca as nC,cb as Yn,ce as GT,cf as rw,cg as wi,ch as hS,ci as Ui,cj as Ki,ck as os,cl as Ks,cm as Ma,d as St,da as oC,de as Co,df as nw,dg as Si,dh as gS,di as Bi,dj as Wi,dk as is,dl as uA,dm as Na,dn as wA,e as pe,ea as iC,ed as io,ee as To,ef as ow,eg as Ei,ej as Xi,ek as ss,el as pA,em as La,en as SA,f as Nn,fd as fT,fe as D,ff as iw,fg as Ai,fh as yS,fi as HS,fk as as,fl as Ue,fm as Da,g as Le,ga as sC,gd as mT,ge as wo,gf as sw,gg as xi,gh as bS,gi as KS,gj as Yi,gk as cs,gl as fA,gm as $a,h as Ln,ha as aC,hd as _T,hf as aw,hg as Oi,hi as WS,hj as SE,hk as ds,hl as mA,hm as Fa,hn as EA,ia as cC,id as hT,if as cw,ig as Ri,ii as XS,ik as ls,il as _A,im as ja,in as AA,j as $b,ja as dC,jd as gT,jf as dw,jg as Sw,jh as CS,ji as YS,jj as EE,jk as eA,jl as Mt,jm as Ga,jn as xA,k as Fb,ka as lC,kc as LC,kd as yT,kf as lw,kg as Ew,kh as TS,kj as AE,kk as tA,kl as Be,km as Ua,kn as OA,l as jb,la as uC,lc as DC,lf as uw,lg as Aw,lh as wS,li as JS,lj as xE,lk as rA,ll as hA,lm as Ba,ln as RA,ma as Fn,mc as $C,md as bT,me as UT,mf as pw,mg as xw,mh as SS,mk as nA,ml as gA,mm as qa,mn as IA,na as jn,nd as CT,ne as BT,nf as fw,ng as Ow,nh as ES,ni as ZS,nj as OE,nk as oA,nl as yA,nm as za,nn as vA,oa as Gn,ob as CC,oc as FC,od as TT,oe as qT,of as mw,og as Rw,oh as AS,oi as QS,ok as iA,ol as bA,om as Va,on as vc,pb as TC,pc as jC,pd as wT,pe as So,pf as _w,pg as Iw,ph as xS,pi as eE,pk as sA,pl as CA,pm as Ha,pn as Pc,qb as wC,qe as Eo,qf as hw,qg as vw,qh as OS,qi as tE,qj as RE,qk as aA,ql as TA,qm as Ka,qn as kc,rc as GC,rd as ST,re as Ao,rf as gw,rg as Pw,rh as RS,ri as rE,rl as Ws,rm as Wa,rn as Mc,s as Gb,sa as Un,sc as Qn,sd as ET,se as xo,sf as yw,sg as kw,sh as IS,sj as IE,sl as Xs,sm as Xa,sn as Nc,te as Oo,tf as bw,tg as Mw,th as vS,tl as Ys,tm as Ya,tn as Lc,u as Ub,ua as Bn,uc as eo,ud as AT,ue as Ro,uf as Cw,ug as Nw,uh as PS,uk as kt,ul as Js,um as Ja,un as Dc,va as qn,vc as to,vd as xT,ve as Io,vf as Tw,vg as Lw,vh as kS,vk as cA,vl as Zs,vm as Za,vn as $c,wa as zn,wb as SC,wd as OT,we as vo,wf as ww,wg as Dw,wj as vE,wk as dA,wl as Qs,wm as Qa,wn as Fc,x as Bb,xb as $e,xd as RT,xe as Po,xf as Vo,xg as $w,xh as MS,xj as PE,xk as lA,xl as ea,xm as ec,xn as jc,yb as Ot,yc as UC,yd as IT,ye as ko,yf as Ho,yg as Fw,yh as Ii,yj as kE,yk as _s,yl as ta,ym as tc,yn as Gc,zb as EC,zc as BC,zd as vT,ze as Mo,zf as Ko,zg as jw,zh as vi,zj as ME,zk as hs,zl as ra,zm as rc,zn as Nt}from"./chunks/chunk-QUWFABDM.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]="0ec82581-c626-544c-9deb-ec5e810fd7e9")}catch{}})();var H="2026-07-28",YP=["2025-11-25","2025-06-18"],Ye=[H],f={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},O={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},p=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ph(e){if(e===void 0)return;if(!_(e))throw new p("Invalid MCP clientInfo metadata",f.invalidParams,{field:O.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 p("Invalid MCP clientInfo metadata",f.invalidParams,{field:O.clientInfo,required:["name","version"]});let n={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(n.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(n.websiteUrl=e.websiteUrl.trim().slice(0,2048)),n}function Je(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new p("Missing required MCP request metadata",f.invalidParams,{required:[O.protocolVersion,O.clientCapabilities]});let r=t[O.protocolVersion];if(typeof r!="string"||!Ye.includes(r))throw new p("Unsupported protocol version",f.unsupportedProtocolVersion,{supported:[...Ye],requested:typeof r=="string"?r:null});let n=t[O.clientCapabilities];if(!_(n))throw new p("Invalid MCP client capabilities metadata",f.invalidParams,{field:O.clientCapabilities,expected:"object"});let o=Ph(t[O.clientInfo]);return{protocolVersion:H,clientCapabilities:n,...o?{clientInfo:o}:{}}}function JP(e,t){if(t!==e.protocolVersion)throw new p("MCP protocol header does not match request metadata",f.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function ZP(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new p("Missing required client capability",f.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function QP(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function Ze(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[O.serverInfo]:{...t}}}}function kh(e,t){return Ze({...e,resultType:"complete"},t)}function ek(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new p("Invalid MCP discovery cache TTL",f.invalidParams,{ttlMs:t});return kh({supportedVersions:[...Ye],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function tk(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new p("Modern MCP result is missing resultType",f.invalidParams,{required:"resultType"})}import{createHash as cr,createHmac as dr,timingSafeEqual as Mh}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]="469f704b-12eb-524d-bcc8-fb8f9f1775f2")}catch{}})();var Nh=["elicitation/create","roots/list","sampling/createMessage"],sr=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},lr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,_e=32,et=64*1024,he=16*1024,Qe={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Lh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function ge(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new p(`Invalid ${r}: value is not JSON serializable`,f.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new p(`Invalid ${r}: payload exceeds the protocol bound`,f.invalidParams,{field:r,maximumBytes:t})}function tt(e,t){if(!_(e))throw new p("Invalid MCP inputRequests",f.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>_e)throw new p("Invalid MCP inputRequests count",f.invalidParams,{minimum:1,maximum:_e,observed:r.length});let n={};for(let[o,i]of r){if(!lr.test(o)||!_(i))throw new p("Invalid MCP input request entry",f.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!Nh.includes(s))throw new p("Unsupported MCP input request method",f.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=Lh(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new p("Missing required client capability",f.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new p("Invalid MCP input request parameters",f.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return ge(n,et,"inputRequests"),n}function ur(e){if(!_(e))throw new p("Invalid MCP inputResponses",f.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>_e)throw new p("Invalid MCP inputResponses count",f.invalidParams,{maximum:_e,observed:t.length});let r={};for(let[n,o]of t){if(!lr.test(n)||!_(o))throw new p("Invalid MCP input response entry",f.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return ge(r,et,"inputResponses"),r}function ik(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>he)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",f.invalidParams,{field:"requestState",maximumBytes:he});let r=e.inputRequests===void 0?void 0:tt(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new p("InputRequiredResult requires inputRequests or requestState",f.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[O.serverInfo]:{...e.serverInfo}}}}function pr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new p("MCP requestState signing key must contain at least 32 bytes",f.invalidParams,{minimumBytes:32});return t}function sk(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 p("Invalid MCP requestState payload",f.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>he/2)throw new p("MCP requestState payload exceeds the protocol bound",f.invalidParams,{maximumBytes:he/2});let n=r.toString("base64url"),o=dr("sha256",pr(t)).update(n).digest("base64url");return`${n}.${o}`}function Dh(e){if(!_(e)||e.version!==1)throw new p("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new p("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new p("Invalid MCP requestState payload",f.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function ak(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new p("Invalid MCP requestState encoding",f.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=dr("sha256",pr(t)).update(n).digest();if(s.byteLength!==a.byteLength||!Mh(s,a))throw new p("Invalid MCP requestState signature",f.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=Dh(c),{expiresAt:l,method:u,parameterDigest:m,principal:g}=d;if(l<(r.nowMs??Date.now()))throw new p("Expired MCP requestState",f.invalidParams,{field:"requestState",expiredAt:l});if(u!==r.method||m!==r.parameterDigest||g!==r.principal)throw new p("MCP requestState binding mismatch",f.invalidParams,{field:"requestState"});return d}function ck(e){return ge(e,et,"request parameters"),cr("sha256").update(JSON.stringify(e)).digest("hex")}var ar=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new p("Invalid MCP replay guard capacity",f.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=cr("sha256").update(t).digest("hex");if(this.#e.has(r))throw new p("MCP requestState replay detected",f.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function $h(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new p("Invalid MCP cache policy",f.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function dk(e,t){return{...e,...$h(t)}}function Fh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function jh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(Fh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function Gh(e){let t=e.maxBytes??Qe.maxBytes,r=e.maxDepth??Qe.maxDepth,n=e.maxNodes??Qe.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new p("Invalid MCP JSON Schema work bounds",f.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new p("Invalid MCP JSON Schema work bounds",f.invalidParams);if(!Number.isSafeInteger(n)||n<1)throw new p("Invalid MCP JSON Schema work bounds",f.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function Uh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function Bh(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&jh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",f.invalidParams,{reference:r})}function lk(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=Gh(t);if(typeof e!="boolean"&&!_(e))throw new p("Invalid MCP JSON Schema root",f.invalidParams,{expected:"object or boolean"});ge(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>o||a.depth>n)throw new p("MCP JSON Schema exceeds validation work bounds",f.invalidParams,{maximumDepth:n,maximumNodes:o});Bh(e,a.value),Uh(a,i)}return structuredClone(e)}import{randomUUID as qh}from"node:crypto";import{readFile as zh}from"node:fs/promises";import fr 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]="1774674f-4d33-5a24-9d97-522c55b861c0")}catch{}})();var yk="io.modelcontextprotocol/tasks",Vh=["working","input_required","completed","failed","cancelled"],Hh=/^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,Kh=3600*1e3,Wh=1e3,be=1024,Xh=30,Yh=2e3;function rt(e){return new p(e,f.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ye(e){let t=e.trim();if(!Hh.test(t))throw rt("Unknown MCP task");return t}function mr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new p("Corrupt MCP task record",f.invalidParams,{field:t});return e}function _r(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new p("Corrupt MCP task error",f.invalidParams);return{code:e.code,message:e.message.slice(0,be),..._(e.data)?{data:structuredClone(e.data)}:{}}}function Jh(e){if(!Vh.includes(e))throw new p("Corrupt MCP task record",f.invalidParams);return e}function Zh(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",f.invalidParams);return e}function Qh(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",f.invalidParams);return e}function eg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",f.invalidParams);return e}function tg(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new p("Corrupt MCP task record",f.invalidParams);return e}}function rg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",f.invalidParams);return[...e]}function ng(e){if(!_(e)||e.version!==1)throw new p("Corrupt MCP task record",f.invalidParams);let t=typeof e.taskId=="string"?ye(e.taskId):"",r=Jh(e.status),n=Zh(e.principal),o=Qh(e.workerPid),i=eg(e.ttlMs),s=tg(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:n,workerPid:o,createdAt:mr(e.createdAt,"createdAt"),lastUpdatedAt:mr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:rg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,be)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(_(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),_(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),_(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=_r(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new p("Corrupt MCP task status payload",f.invalidParams,{status:a.status});return a}function K(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 ne(e){return e==="completed"||e==="failed"||e==="cancelled"}function og(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var nt=class{#e;#t;#r;#n;#i;constructor(t){this.#e=fr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#n=t.taskIdFactory??(()=>`mcp-task-${qh()}`),this.#i=t.workerPid??process.pid}#s(t){return fr.join(this.#e,"runtime","mcp-tasks","records",`${ye(t)}.json`)}async#c(t){try{return ng(JSON.parse(await zh(this.#s(t),"utf8")))}catch(r){throw pe(r)||r instanceof SyntaxError?rt("Unknown MCP task"):r}}async#a(t){await Le(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
2
- `)}async#o(t,r,n){let o=ye(t),i=await Fe(this.#e,o,Xh,this.#t,!1,!1,Yh);try{let s=await this.#c(o);if(s.principal!==r)throw rt("Unknown MCP task");let a=n(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=ye(this.#n()),n=t.principal.trim(),o=t.ttlMs===void 0?Kh:t.ttlMs,i=t.pollIntervalMs??Wh;if(n.length===0||o!==null&&(!Number.isSafeInteger(o)||o<0)||!Number.isSafeInteger(i)||i<0)throw new p("Invalid MCP task creation options",f.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:o,pollIntervalMs:i,principal:n,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,be)}:{}};return await this.#a(a),{...K(a),resultType:"task"}}async get(t,r){return K(await this.#o(t,r,n=>{if(ne(n.status))return n;let o=this.#r().getTime(),i=n.ttlMs!==null&&Date.parse(n.createdAt)+n.ttlMs<=o,s=n.workerPid!==this.#i&&!og(n.workerPid);return!i&&!s?n:{...n,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"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 K(await this.#o(t.taskId,t.principal,n=>{if(ne(n.status))return n;let o=Object.keys(r).filter(i=>n.consumedInputKeys.includes(i));if(o.length>0)throw new p("MCP task input request keys must be unique for the task lifetime",f.invalidParams,{reused:o});return{...n,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,be),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,n){let o=ur(n),i=[],s=[];return await this.#o(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,u]of Object.entries(o))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=u,delete c[l],i.push(l));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}async takeInputResponses(t,r){let n={};return await this.#o(t,r,o=>(n=structuredClone(o.inputResponses??{}),Object.keys(n).length===0?o:{...o,inputResponses:void 0})),n}async complete(t,r,n){return K(await this.#o(t,r,o=>ne(o.status)?o:{...o,status:"completed",statusMessage:"Task completed.",lastUpdatedAt:this.#r().toISOString(),result:structuredClone(n),inputRequests:void 0,error:void 0}))}async fail(t,r,n){let o=_r(n);return K(await this.#o(t,r,i=>ne(i.status)?i:{...i,status:"failed",statusMessage:o.message,lastUpdatedAt:this.#r().toISOString(),error:o,inputRequests:void 0,result:void 0}))}async cancel(t,r){return K(await this.#o(t,r,n=>ne(n.status)?n:{...n,status:"cancelled",statusMessage:"Task cancelled by the client.",lastUpdatedAt:this.#r().toISOString(),inputRequests:void 0,result:void 0,error:void 0}))}};function bk(e){return new nt(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]="cb791784-bde2-5b1d-b5df-038282816043")}catch{}})();var Ce="io.modelcontextprotocol/subscriptionId",hr=256,gr=2048,ig=5e3;function sg(e,t){return new Promise((r,n)=>{let o=setTimeout(()=>n(new Error("MCP subscription sink write timed out")),ig);o.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(o),r()},i=>{clearTimeout(o),n(i instanceof Error?i:new Error(String(i)))})})}function ot(e,t){if(e!==void 0){if(typeof e!="boolean")throw new p("Invalid MCP subscription filter",f.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function ag(e){if(!_(e))throw new p("Invalid MCP subscription filter",f.invalidParams,{field:"notifications",expected:"object"});let t=ot(e.toolsListChanged,"toolsListChanged"),r=ot(e.promptsListChanged,"promptsListChanged"),n=ot(e.resourcesListChanged,"resourcesListChanged"),o;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>hr)throw new p("Invalid MCP resource subscriptions",f.invalidParams,{field:"notifications.resourceSubscriptions",maximum:hr});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>gr)throw new p("Invalid MCP resource subscription URI",f.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:gr});i.add(s)}i.size>0&&(o=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...n?{resourcesListChanged:n}:{},...o?{resourceSubscriptions:o}:{}}}function cg(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 yr=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 p("MCP subscription id is already active",f.invalidParams,{subscriptionId:t.id});let r=cg(ag(t.notifications),this.#e),n={filter:r,sink:t.sink,writeQueue:Promise.resolve()};this.#t.set(t.id,n);try{await this.#n(t.id,n,{jsonrpc:"2.0",method:"notifications/subscriptions/acknowledged",params:{_meta:{[Ce]:t.id},notifications:structuredClone(r)}},!0)}catch(o){throw this.#t.delete(t.id),o}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,n=`notifications/${t}/list_changed`,o=[];for(let[i,s]of this.#t)s.filter[r]===!0&&o.push(this.#n(i,s,{jsonrpc:"2.0",method:n,params:{_meta:{[Ce]:i}}}));return(await Promise.all(o)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[n,o]of this.#t)o.filter.resourceSubscriptions?.includes(t)&&r.push(this.#n(n,o,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Ce]:n},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#n(t,r,n,o=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await sg(r.sink,n),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),o)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...Ze({resultType:"complete",_meta:{[Ce]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let n=this.close(r);t.push({id:r,result:n})}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]="5ffe7128-0fbb-59af-89ef-74d5d799a00d")}catch{}})();var br=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,dg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,Cr=/^[\t\x20-\x7E]*$/u,Tr=new Set(["prompts/get","resources/read","tools/call"]);function lg(e){let t=new Map;for(let[r,n]of Object.entries(e)){if(n===void 0)continue;let o=typeof n=="string"?n:n.join(", ");t.set(r.toLowerCase(),o)}return t}function A(e,t){throw new p(e,f.headerMismatch,{header:t})}function wr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&Cr.test(t)&&!br.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Sr(e,t){let r=br.exec(e);if(r){let n=r[1],o=Buffer.from(n,"base64");return o.toString("base64")!==n||o.length===0?A("Malformed MCP Base64 header value",t):o.toString("utf8")}return e.length===0||e.trim()!==e||!Cr.test(e)?A("Malformed MCP header value",t):e}function Te(e){return Array.isArray(e)?e.some(Te):_(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Te):!1}function ug(e,t,r){let n=e["x-mcp-header"];if(n===void 0)return;let o=e.type;if(typeof n!="string"||!dg.test(n)||!["boolean","integer","string"].includes(String(o))||r.has(n.toLowerCase()))throw new p("Invalid MCP x-mcp-header annotation",f.invalidParams,{field:t.join("."),annotation:n});return r.add(n.toLowerCase()),{name:n,path:t,type:o}}function Er(e){if(!_(e))throw new p("Invalid MCP tool schema",f.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,n=(o,i)=>{let s=o.properties;if(s!==void 0){if(!_(s))throw new p("Invalid MCP tool schema properties",f.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!_(c))continue;let d=[...i,a],l=ug(c,d,r);l&&t.push(l);for(let[u,m]of Object.entries(c))if(u!=="properties"&&u!=="x-mcp-header"&&Te(m))throw new p("MCP x-mcp-header is not statically reachable",f.invalidParams,{field:d.join("."),keyword:u});n(c,d)}}};for(let[o,i]of Object.entries(e))if(o!=="properties"&&Te(i))throw new p("MCP x-mcp-header is not statically reachable",f.invalidParams,{field:"inputSchema",keyword:o});return n(e,[]),t}function Ar(e,t){let r=e;for(let n of t){if(!_(r))return;r=r[n]}return r}function xr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function pg(e,t){let r=_(e.arguments)?e.arguments:{},n={};for(let o of Er(t)){let i=Ar(r,o.path);if(i==null)continue;if(!(o.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||o.type==="boolean"&&typeof i=="boolean"||o.type==="string"&&typeof i=="string"))throw new p("Invalid MCP custom header argument",f.invalidParams,{field:o.path.join("."),expected:o.type});n[`Mcp-Param-${o.name}`]=wr(i)}return n}function Ek(e){let t=_(e.request.params)?e.request.params:void 0,r=Je(t),n=e.request.method;if(typeof n!="string"||n.length===0)return A("Missing MCP request method","Mcp-Method");let o={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":n},i=xr(n,t);if(Tr.has(n)){if(i===void 0)return A("Missing MCP request name","Mcp-Name");o["Mcp-Name"]=wr(i)}return n==="tools/call"&&e.toolSchema!==void 0&&Object.assign(o,pg(t,e.toolSchema)),o}function fg(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let n=_(t.params)?t.params:void 0,o=Je(n).protocolVersion;if(e.get("mcp-protocol-version")!==o&&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 i=e.get("mcp-name"),s=xr(r,n);(i===void 0||s===void 0||Sr(i,"Mcp-Name")!==s)&&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 mg(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 _g(e){let t=_(e.params.arguments)?e.params.arguments:{};for(let r of Er(e.toolSchema)){let n=Ar(t,r.path),o=`Mcp-Param-${r.name}`,i=e.headers.get(o.toLowerCase());if(n==null){i!==void 0&&A("Unexpected MCP parameter header",o);continue}i===void 0&&A("Missing MCP parameter header",o),mg(r,n,Sr(i,o))||A("MCP parameter header does not match request body",o)}}function Ak(e){let t=lg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";fg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&_g({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var xk=H;import{AsyncLocalStorage as hg}from"node:async_hooks";import{createHash as Or,timingSafeEqual as gg}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]="a9aefc86-a8ce-5ecf-bb54-e5fa3ea277c7")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,n){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=n}},yg=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,bg=/^[a-z][a-z0-9_*/-]{0,255}$/u,Cg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Tg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Ir=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,vr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,wg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,Sg=/%(?![0-9A-Fa-f]{2})/u,Eg=512,Ag=32,xg=180,Og=8192,Rg=8192,Pr=new hg;function E(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let n;try{n=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let o=n.hostname==="127.0.0.1"||n.hostname==="localhost";if(n.hash.length>0||n.protocol!=="https:"&&!(r&&o&&n.protocol==="http:"))throw new y(`Invalid ${t}`,401);return n}function Ig(e,t){let r=t.toLowerCase();for(let[n,o]of Object.entries(e))if(!(n.toLowerCase()!==r||o===void 0))return typeof o=="string"?o:o.join(", ")}function Pk(e){let t=E(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(o=>E(o,"authorization server issuer").href.replace(/\/$/u,"")),n=[...new Set(e.scopes??[])];if(n.some(o=>!Ir.test(o)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...n.length>0?{scopes_supported:n.sort()}:{}}}function kk(e){let t=E(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),n=t.origin;return r?[`${n}/.well-known/oauth-authorization-server/${r}`,`${n}/.well-known/openid-configuration/${r}`,`${n}/${r}/.well-known/openid-configuration`]:[`${n}/.well-known/oauth-authorization-server`,`${n}/.well-known/openid-configuration`]}function Mk(e,t){if(!_(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=E(t,"expected issuer").href.replace(/\/$/u,"");if(E(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 l=e[d];if(typeof l!="string")throw new y(`Authorization server metadata requires ${d}`,401);return E(l,d).href},i=d=>{let l=e[d];return typeof l=="string"?E(l,d).href:void 0},s=o("authorization_endpoint"),a=o("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,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}:{},...c?{registration_endpoint:c}:{}}}function Nk(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 Lk(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 Dk(e,t){let r=E(t,"client metadata document URL");if(r.pathname==="/"||!_(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 n of e.redirect_uris){if(typeof n!="string")throw new y("Invalid client redirect URI",401);E(n,"client redirect URI",!0)}return structuredClone(e)}function $k(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=>E(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 Rr=class{#e=new Map;set(t,r){let n=E(t,"credential issuer").href;this.#e.set(n,structuredClone(r))}get(t){let r=E(t,"credential issuer").href,n=this.#e.get(r);return n?structuredClone(n):void 0}delete(t){let r=E(t,"credential issuer").href;return this.#e.delete(r)}};function vg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let n=typeof t=="string"?yg.exec(t):null;if(!n)throw new y("Invalid MCP traceparent",403);let o=n[1],i=n[2];if(/^0+$/u.test(o)||/^0+$/u.test(i))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!kg(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 Pg(e){return bg.test(e)||Cg.test(e)}function kg(e){if(Buffer.byteLength(e,"utf8")>Eg)return!1;let t=e.split(",");if(t.length>Ag)return!1;let r=new Set;for(let n of t){let o=$(n);if(o.length===0)continue;let i=o.indexOf("="),s=i>0?o.slice(0,i):"",a=i>0?o.slice(i+1):"";if(!Pg(s)||!Tg.test(a)||r.has(s))return!1;r.add(s)}return!0}function kr(e){return wg.test(e)&&!Sg.test(e)}function Mg(e){let t=$(e),r=t.indexOf("="),n=$(r>=0?t.slice(0,r):t),o=r>=0?$(t.slice(r+1)):void 0;return vr.test(n)&&(o===void 0||kr(o))}function Ng(e){let t=$(e),r=t.split(";"),n=r[0],o=r.slice(1),i=n.indexOf("="),s=$(i>0?n.slice(0,i):""),a=i>0?$(n.slice(i+1)):"";if(!(!vr.test(s)||!kr(a)||!o.every(Mg)))return{key:s,serialized:t}}function Lg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>Og)throw new y("Invalid MCP baggage",403);let r=new Set(t),n=e.split(",");if(n.length>xg)throw new y("Invalid MCP baggage",403);let o=[];for(let i of n){let s=Ng(i);if(!s)throw new y("Invalid MCP baggage",403);r.has(s.key)&&o.push(s.serialized)}return o.length>0?o.join(","):void 0}function Fk(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},n=Lg(r.baggage,t.baggageAllowlist??[]);return{...vg(r),...n?{baggage:n}:{}}}function jk(e,t){return Pr.run(structuredClone(e),t)}function Gk(){let e=Pr.getStore();return e?{...e}:void 0}async function Uk(e){let t=E(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(u=>!Ir.test(u)))throw new y("Invalid authorization scope",401);let n=`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,n);let s=Ig(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new y("Missing or malformed bearer token",401,n);let a=s[1];if(Buffer.byteLength(a,"utf8")>Rg)throw new y("Missing or malformed bearer token",401,n);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new y("Invalid bearer token",401,n)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,n);let l=r.filter(u=>!c.scopes.includes(u));if(l.length>0)throw new y("Bearer token has insufficient scope",403,`${n}, scope="${l.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function Bk(e){let t=Or("sha256").update(e.token).digest();return r=>{let n=Or("sha256").update(r).digest();if(!gg(t,n))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]="e6c49c89-781e-59a3-9c19-6a1c40424587")}catch{}})();var it="io.modelcontextprotocol/ui",we="2026-01-26",Lr="text/html;profile=mcp-app",Mr=Object.freeze({specVersion:we,mimeTypes:[Lr]});function Vk(e){let t=e.clientCapabilities.extensions;if(!_(t))return!1;let r=t[it];if(r===void 0)return!1;if(!_(r))throw new p("Invalid MCP Apps client capability",f.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Mr}}});let n=r.mimeTypes,o=r.specVersion;if(!Array.isArray(n)||!n.includes(Lr)||o!==void 0&&o!==we)throw new p("Unsupported MCP Apps client capability",f.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[it]:Mr}}});return!0}var Dg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Dr=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:Dg})));function Hk(e){return Dr.find(t=>t.uri===e)}function Kk(e){let t=new Map(Dr.map(r=>[r.toolName,r]));return e.map(r=>{let n=t.get(r.name);return n?{...r,_meta:{...r._meta,ui:n.toolMeta}}:{...r}})}function Nr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function Wk(e){let t=Nr(e.name),r=Nr(e.description),n=JSON.stringify({name:`pm-${e.id}-view`,version:we}),o=JSON.stringify(we);return`<!doctype html>
1
+ import{A as Rh,B as Ih,C as pk,D as mk,a as as,b as cs,c as ds,d as ls,e as rk,f as ok,g as gh,h as yh,i as bh,k as Ch,l as Th,m as wh,n as Sh,o as Eh,p as Ah,q as vh,r as Oh,s as nk,t as ik,u as sk,v as ak,w as ck,x as dk,y as lk,z as uk}from"./chunks/chunk-JUNJ5EKI.js";import{A as Qk,B as eM,C as tM,D as rM,E as oM,F as nM,G as iM,H as sM,I as aM,J as cM,K as dM,L as lM,M as uM,N as pM,O as mM,P as fM,Q as _M,R as hM,S as gM,T as yM,U as bM,V as CM,W as TM,X as wM,Y as SM,a as Ok,b as Rk,c as Ik,d as Pk,e as kk,f as Mk,g as xk,h as Nk,i as Lk,j as Dk,k as $k,l as Fk,m as jk,n as Gk,o as Uk,p as Bk,q as qk,r as zk,s as Vk,t as Hk,u as Kk,v as Wk,w as Xk,x as Yk,y as Jk,z as Zk}from"./chunks/chunk-Z3XVXUVF.js";import{a as fk,b as _k,c as hk,d as gk}from"./chunks/chunk-3IPRM75M.js";import{a as yk,b as bk,c as Ck,d as Tk,e as wk,f as Sk,g as Ek,h as Ak,i as vk}from"./chunks/chunk-L5RCDKQ2.js";import{$ as or,$a as Kf,$b as K_,A as xv,Aa as _f,Ab as C_,B as iu,Ba as hf,Bb as T_,C as Ju,Ca as gf,Cb as w_,D as Zu,Da as yf,Db as S_,E as Qu,Ea as bf,Eb as E_,F as ep,Fa as Cf,Fb as A_,G as Ep,Ga as Tf,Gb as v_,H as We,Ha as wf,Hb as O_,I as Ap,Ia as Sf,Ib as R_,J as vp,Ja as Ef,Jb as I_,K as Op,Ka as Af,Kb as P_,L as Rp,La as vf,Lb as k_,M as Ip,Ma as Of,Mb as M_,N as Pp,Na as Rf,Nb as x_,O as OP,Oa as If,Ob as N_,P as RP,Pa as Pf,Pb as L_,Q as IP,Qa as ar,Qb as D_,R as Kt,Ra as _e,Rb as $_,S as Wt,Sa as Ff,Sb as F_,T as Xt,Ta as jf,Tb as j_,U as Yt,Ua as Gf,Ub as G_,V as Jt,Va as Uf,Vb as U_,W as Zt,Wa as Bf,Wb as B_,X as Qt,Xa as qf,Xb as q_,Y as er,Ya as zf,Yb as z_,Z as tr,Za as Vf,Zb as V_,_ as rr,_a as Hf,_b as H_,a as $c,aa as sm,ab as Wf,ac as W_,b as Fc,ba as am,bb as Xf,bc as X_,c as jc,ca as cm,cb as Yf,cc as Y_,d as sv,da as dm,db as Jf,dc as J_,e as av,ea as lm,eb as Zf,ec as Z_,f as Gc,fa as Xe,fb as Qf,fc as Q_,g as fv,ga as um,gb as e_,gc as eh,h as _v,ha as pm,hb as t_,hc as th,i as hv,ia as mm,ib as r_,ic as rh,j as gv,ja as fm,jb as o_,jc as oh,k as yv,ka as _m,kb as n_,kc as nh,l as bv,la as hm,lb as i_,lc as ih,m as Cv,ma as gm,mb as s_,mc as sh,n as Tv,na as ym,nb as a_,nc as ah,o as wv,oa as qP,ob as c_,oc as ch,p as Sv,pa as of,pb as d_,pc as dh,q as Ev,qa as nf,qb as l_,qc as lh,r as Av,ra as sf,rb as u_,rc as uh,s as vv,sa as af,sb as p_,sc as ph,t as Ov,ta as cf,tb as m_,tc as mh,u as Vc,ua as df,ub as f_,uc as fh,v as Rv,va as lf,vb as __,vc as _h,w as Iv,wa as uf,wb as h_,wc as hh,x as Pv,xa as pf,xb as g_,y as kv,ya as mf,yb as y_,z as Mv,za as ff,zb as b_}from"./chunks/chunk-XZ6T7YPP.js";import{a as Ht,f as uP,g as pP,h as xp,i as Np}from"./chunks/chunk-ECBLPN7B.js";import{A as SP,B as EP,C as AP,D as vP,E as Vp,F as Hp,G as Kp,H as FP,I as bm,J as jP,K as GP,L as UP,M as BP,b as nu,c as sI,d as Yu,e as eP,f as nP,g as iP,h as sP,i as aP,j as cP,k as kp,l as dP,m as Up,n as Bp,o as qp,p as zp,q as mP,r as fP,s as _P,t as hP,u as gP,v as yP,w as bP,x as CP,y as TP,z as wP}from"./chunks/chunk-WQKMSFBV.js";import{$a as eu,$b as mp,$c as WP,A as hO,Aa as Ol,Ab as VI,Ac as rm,Ad as Vm,B as gO,Ba as Rl,Bb as HI,Bc as om,Bd as Hm,C as yO,Ca as Il,Cb as KI,Cc as nm,Cd as tk,D as bO,Da as Pl,Db as Wu,Dc as im,Dd as Km,E as IO,Ea as kl,Eb as Xu,Ec as LP,Ed as Wm,Fa as Ml,Fb as WI,Fc as DP,Fd as Xm,Ga as xl,Gb as XI,Gc as $P,Gd as Ym,Ha as Nl,Hb as YI,Hc as Cm,Hd as Jm,Ia as Ll,Ib as Ke,Ic as zP,Id as Zm,J as Bd,Ja as Dl,Jb as JI,Jc as nr,Jd as Qm,Ka as $l,Kb as Vt,Kc as VP,Kd as ef,La as Fl,Lb as ZI,Lc as Ye,Ld as tf,Ma as jl,Mb as QI,Mc as re,Md as rf,Na as Gl,Nc as Tm,Nd as kf,Oa as Ul,Ob as tp,Od as Mf,Pa as Bl,Pb as rp,Pd as xf,Qa as ql,Qb as tP,Qc as Je,Qd as Nf,Ra as zl,Rb as op,Rc as wm,Rd as Lf,Sa as Vl,Sb as np,Sc as Sm,Sd as Df,Ta as Hl,Tb as ip,Td as $f,Ua as Kl,Ub as sp,Uc as fe,Va as Wl,Vb as ap,Vc as Em,Wa as Xl,Wb as cp,Wc as Am,Xa as Yl,Xb as dp,Xc as vm,Ya as Jl,Yb as lp,Yc as Om,Za as Zl,Zb as up,Zc as HP,_a as Ql,_b as pp,_c as KP,a as zv,aa as PO,ab as tu,ac as fp,ad as XP,b as Vv,ba as kO,bb as ru,bc as _p,bd as YP,c as Hv,ca as qd,cb as QR,cc as hp,cd as ir,d as Kv,da as zd,db as eI,dc as gp,dd as JP,e as Wv,ea as Vd,eb as tI,ec as yp,ed as ZP,f as Xv,fa as Hd,fb as rI,fc as bp,fd as sr,g as Yv,ga as Kd,gb as oI,gc as Cp,gd as QP,h as Jv,ha as Wd,hb as nI,hc as Tp,hd as ek,i as Zv,ia as Xd,ib as iI,ic as rP,j as Qv,ja as uR,jb as su,jc as oP,jd as Rm,k as eO,ka as pR,kb as au,kc as wp,kd as Im,l as tO,la as mR,lb as cu,ld as Pm,m as rO,ma as fR,mb as du,md as km,n as oO,na as _R,nb as lu,nd as Mm,o as nO,oa as hR,oc as Sp,od as xm,p as iO,pa as gR,pb as uu,pd as Nm,q as sO,qa as SR,qb as pu,qc as lP,qd as Lm,r as aO,ra as ER,rb as mu,rc as Mp,rd as Dm,s as cO,sa as Tl,sb as fu,sc as Wp,sd as $m,t as dO,ta as wl,tb as _u,tc as Xp,td as Fm,u as lO,ua as AR,ub as zu,uc as Yp,ud as jm,v as uO,va as vR,vb as Vu,vc as Jp,vd as Gm,w as pO,wa as Sl,wb as Hu,wc as Zp,wd as Um,x as mO,xa as El,xb as Ku,xc as Qp,xd as Bm,y as fO,ya as Al,yb as qI,yc as em,yd as qm,z as _O,za as vl,zb as zI,zc as tm,zd as zm}from"./chunks/chunk-AAFBV3U3.js";import{Aa as dl,Ba as ll,Ca as ul,H as UO,Ha as pl,I as BO,Ia as ml,Ja as fl,K as qO,Ka as _l,L as zO,La as hl,M as VO,Ma as gl,N as nl,Na as yl,O as il,P as sl,Pa as bl,Q as al,Qa as Cl,R as Ft,Ra as Lp,Sa as Dp,Ta as $p,Va as Fp,Wa as jp,Xa as Gp,a as pv,b as mv,c as Uc,d as Bc,f as qc,g as zc,h as MO,i as xO,j as NO,k as LO,l as DO,m as $O,n as FO,o as jO,p as Yd,q as Jd,r as Zd,s as Qd,t as el,u as GO,ua as jt,v as tl,va as Gt,w as rl,wa as Ut,x as ol,xa as Bt,ya as cl}from"./chunks/chunk-OHNLSGGV.js";import{$ as dd,$a as aR,$b as dI,$c as Bu,A as CO,Aa as Dd,Ac as DI,B as TO,Ba as $d,Bc as $I,C as wO,Ca as Fd,Cc as FI,D as SO,Da as jd,Dc as Cu,E as EO,Ea as Gd,Ec as Tu,F as AO,Fa as Ud,Fb as GR,Fc as wu,G as vO,Gb as UR,Gc as Su,H as OO,Hb as BR,Hc as Eu,I as Kc,Ia as HO,Ib as qR,Ic as Au,J as Wc,Ja as KO,Jb as zR,Jc as qt,K as Xc,Ka as WO,Kb as VR,Kc as vu,L as Yc,La as XO,Lc as Ou,M as Jc,Ma as YO,Mc as Ru,N as Zc,Na as JO,Nb as HR,Nc as Iu,O as Qc,Oa as ZO,Ob as KR,Oc as Pu,P as ed,Pa as QO,Pb as WR,Pc as ku,Q as td,Qa as eR,Qb as XR,Qc as Mu,R as rd,Ra as tR,Rb as YR,Rc as xu,S as od,Sa as rR,Sb as JR,Sc as Nu,T as He,Ta as oR,Tb as ZR,Tc as Lu,U as nd,Ua as nR,Ub as ou,Uc as Du,V as id,Vb as hu,Vc as $u,W as sd,Wb as gu,Wc as Fu,X as ad,Xb as yu,Xc as ju,Y as RO,Ya as iR,Yb as bu,Yc as Gu,Zb as aI,Zc as Uu,_ as cd,_a as sR,_b as cI,_c as zt,aa as ld,ac as lI,ad as jI,b as ZA,ba as ud,bb as cR,bc as uI,bd as GI,c as QA,ca as pd,cb as dR,cc as pI,cd as UI,d as ev,da as md,db as lR,dc as mI,dd as qu,e as tv,ea as fd,ec as fI,ed as BI,f as rv,fa as _d,fb as yR,fc as _I,fd as PP,ga as hd,gb as bR,gc as hI,gd as kP,h as ov,ha as gd,hb as CR,hc as gI,hd as MP,i as nv,ia as yd,ib as TR,ic as yI,id as xP,j as iv,ja as bd,jb as wR,jc as bI,jd as NP,k as cv,ka as Cd,kb as OR,kc as CI,l as dv,la as Td,lb as RR,lc as TI,m as lv,ma as wd,mb as IR,mc as wI,n as uv,na as Sd,nb as PR,nc as SI,o as Nv,oa as Ed,ob as kR,oc as EI,p as Lv,pa as Ad,pb as MR,pc as AI,q as Dv,qa as vd,qb as xR,qc as vI,r as $v,ra as Od,rb as NR,rc as OI,s as Fv,sa as Rd,sb as LR,sc as RI,t as jv,ta as Id,tb as DR,tc as II,u as Gv,ua as Pd,ub as $R,uc as PI,v as Uv,va as kd,vb as FR,vc as kI,w as Bv,wa as Md,wb as jR,wc as MI,x as qv,xa as xd,xc as xI,ya as Nd,yc as NI,z as Hc,za as Ld,zc as LI}from"./chunks/chunk-D3YVILJJ.js";import{$ as Xb,$b as MC,$c as sT,$d as Sn,$f as si,$g as nS,$h as WS,$i as RE,$k as fs,$l as ea,$m as ec,A as Ub,Aa as Yo,Ac as dn,Ad as AT,Ae as Dn,Af as mw,Ag as ki,Ah as PS,Ai as mE,Aj as Ui,Al as Us,Am as Oa,An as te,Ba as Jo,Bc as ln,Bd as vT,Be as $n,Bf as fw,Bg as Mi,Bi as fE,Bj as Bi,Bk as Qi,Bl as Bs,Bm as Ra,Bn as Ac,Ca as Zo,Cb as SC,Cd as OT,Ce as Fn,Cf as _w,Cg as xi,Ci as _E,Cj as qi,Ck as es,Cl as qs,Cm as Ia,D as Bb,Db as je,Dd as RT,De as jn,Df as hw,Dg as Nw,Dh as kS,Di as hE,Dj as zi,Dk as ts,Dl as MA,Dm as Pa,Dn as qA,Eb as Rt,Ec as UC,Ed as IT,Ee as Gn,Ef as gw,Eg as Lw,Eh as MS,Ej as Vi,Ek as rs,El as xA,Em as ka,En as zA,Fb as EC,Fc as BC,Fd as PT,Fe as Un,Ff as yw,Fg as Dw,Fh as xS,Fi as gE,Fk as os,Fl as qe,Fm as Ma,Gb as AC,Gc as qC,Gd as kT,Ge as Bn,Gf as bw,Gg as $w,Gh as NS,Gj as Hi,Gk as ns,Gl as NA,Gm as xa,H as qb,Hb as vC,Hc as zC,He as qn,Hf as Cw,Hg as Fw,Hh as LS,Hi as yE,Hj as zE,Hk as is,Hl as LA,Hm as Na,Hn as VA,I as L,Ib as OC,Ic as VC,Ie as zn,If as Tw,Ig as jw,Ih as DS,Ii as bE,Ik as ss,Il as DA,Im as La,In as HA,J as zb,Jb as V,Jc as HC,Je as Vn,Jf as ww,Jg as Gw,Jh as $S,Ji as CE,Jj as VE,Jk as TA,Jl as Dt,Jm as Da,Jn as KA,K as b,Kb as RC,Kc as KC,Ke as zT,Kf as Sw,Kg as Uw,Kh as FS,Ki as TE,Kj as HE,Kk as wA,Kl as ze,Km as $a,Kn as WA,Lc as un,Le as VT,Lf as Ew,Lg as Bw,Lh as jS,Li as wE,Lj as KE,Lk as SA,Ll as $A,Lm as Fa,Ln as XA,M as Vb,Mc as WC,Md as MT,Me as Ge,Mf as Aw,Mg as qw,Mh as GS,Mk as EA,Ml as FA,Mm as ja,Mn as YA,N as Hb,Nc as XC,Ne as Hn,Nf as vw,Ng as zw,Nh as US,Nj as WE,Nk as AA,Nl as jA,Nm as Ga,Nn as JA,Oc as YC,Od as _n,Oe as HT,Of as Ow,Og as Vw,Oh as BS,Ok as vA,Ol as GA,Om as Ua,On as vc,Pc as JC,Pd as xT,Pe as Kn,Pf as Rw,Pg as Hw,Ph as qS,Pk as OA,Pl as UA,Pm as Ba,Pn as Oc,Q as Kb,Qc as ZC,Qd as hn,Qe as Wn,Qf as Iw,Qg as Kw,Qj as XE,Qk as RA,Ql as BA,Qm as qa,Qn as Rc,Ra as pC,Rc as QC,Re as Xn,Rf as Pw,Rg as Ww,Rh as zS,Rl as zs,Rm as za,Rn as Ic,Sa as mC,Sc as eT,Sd as NT,Se as Yn,Sf as kw,Sg as Xw,Sh as Ni,Sj as YE,Sl as Vs,Sm as Va,Sn as Pc,T as Wb,Ta as fC,Tc as tT,Td as LT,Tf as Mw,Tg as Yw,Th as Li,Tl as Hs,Tm as Ha,Tn as kc,U as At,Uc as pn,Ud as DT,Uf as xw,Ug as Jw,Uk as Lt,Ul as Ks,Um as Ka,Un as Mc,Vb as IC,Vc as rT,Vd as gn,Vf as ei,Vg as Zw,Vk as IA,Vl as Ws,Vm as Wa,Vn as xc,W as vt,Wa as Qo,Wb as sn,Wc as mn,Wd as yn,Wf as ti,Wg as Qw,Wi as SE,Wj as JE,Wk as PA,Wl as Xs,Wm as Xa,Wn as Nc,X as zo,Xa as _C,Xb as an,Xd as bn,Xf as ri,Xg as eS,Xi as EE,Xj as ZE,Xk as kA,Xl as Ys,Xm as Ya,Xn as Lc,Y as Vo,Ya as hC,Yb as PC,Yc as oT,Yd as Cn,Yf as oi,Yg as tS,Yh as VS,Yi as AE,Yj as QE,Yk as us,Yl as Js,Ym as Ja,Yn as Dc,Z as Ot,Za as gC,Zb as kC,Zc as nT,Zd as Tn,Zf as ni,Zg as rS,Zh as HS,Zi as vE,Zj as eA,Zk as ps,Zl as Zs,Zm as Za,Zn as $t,_a as yC,_b as P,_c as iT,_d as wn,_f as ii,_g as oS,_h as KS,_i as OE,_j as tA,_k as ms,_l as Qs,_m as Qa,ab as en,ac as It,ad as aT,ae as $T,af as kt,ag as Ue,ah as iS,ak as rA,al as _s,am as ta,an as tc,b as Do,ba as Yb,bb as tn,bc as xC,bd as Pt,be as FT,bf as Mt,bg as Be,bh as sS,bi as XS,bk as oA,bl as hs,bm as ra,bn as rc,c as De,ca as Jb,cb as Fe,cd as cT,cf as Jn,cg as ai,ch as aS,ci as YS,cj as IE,ck as nA,cl as gs,cm as oa,cn as oc,d as $o,da as Zb,db as bC,dc as NC,dd as dT,de as En,df as Zn,dg as ci,dh as cS,dj as PE,dk as iA,dl as ys,dm as na,dn as nc,e as Fo,ea as Qb,ed as lT,ee as An,ef as Qn,eg as di,eh as dS,ei as JS,ej as ji,ek as sA,el as bs,em as ia,en as ic,f as jo,fa as eC,fb as rn,fe as jT,fg as li,fh as lS,fj as kE,fk as aA,fl as Cs,fm as sa,fn as sc,g as Go,ga as tC,gb as on,gd as uT,ge as vn,gf as KT,gg as ui,gh as uS,gi as ZS,gj as ME,gk as cA,gl as Ts,gm as aa,gn as ac,ha as rC,hd as pT,he as On,hf as WT,hg as pi,hh as pS,hi as QS,hj as xE,hk as dA,hl as ws,hm as ca,hn as cc,i as Uo,ia as oC,ib as nn,ie as GT,if as XT,ig as mi,ih as mS,ii as eE,ij as NE,ik as lA,il as Ss,im as da,in as dc,j as Et,ja as nC,je as Rn,jf as YT,jg as fi,jh as fS,ji as tE,jj as xt,jk as uA,jl as Es,jm as la,jn as lc,k as me,ka as iC,kd as fn,ke as In,kf as JT,kg as _i,kh as _S,ki as rE,kk as Nt,kl as As,km as ua,kn as uc,l as Bo,ld as mT,le as D,lf as ZT,lg as hi,lh as hS,li as oE,lk as pA,ll as vs,lm as pa,ln as pc,m as $e,ma as sC,md as fT,me as Pn,mf as QT,mg as gi,mh as gS,mi as nE,mj as LE,mk as mA,ml as Os,mm as ma,mn as mc,n as qo,na as aC,nd as _T,nf as ew,ng as yi,nh as yS,ni as iE,nk as fA,nl as Rs,nm as fa,nn as fc,oa as cC,od as hT,of as tw,og as bi,oh as bS,oi as sE,ok as _A,ol as Is,om as _a,on as _c,p as $b,pa as dC,pd as gT,pf as rw,pg as Ci,ph as CS,pi as aE,pk as hA,pl as Ps,pm as ha,pn as hc,q as Fb,qa as lC,qc as LC,qd as yT,qf as ow,qg as Ti,qh as TS,qi as cE,qj as Gi,qk as gA,ql as ks,qm as ga,qn as gc,r as jb,ra as uC,rc as DC,rf as nw,rg as wi,rh as wS,ri as dE,rj as DE,rk as yA,rl as Ms,rm as ya,rn as yc,sa as Ho,sc as $C,sd as bT,se as UT,sf as iw,sg as Si,sh as SS,si as lE,sj as $E,sk as bA,sl as xs,sm as ba,sn as bc,ta as Ko,td as CT,te as BT,tf as sw,tg as Ei,th as ES,ti as uE,tj as FE,tk as CA,tl as Ns,tm as Ca,tn as Cc,ua as Wo,ub as CC,uc as FC,ud as TT,ue as qT,uf as aw,ug as Ai,uh as AS,uj as jE,uk as Ki,ul as Ls,um as Ta,un as Tc,vb as TC,vc as jC,vd as wT,ve as kn,vf as cw,vg as vi,vh as vS,vi as Di,vk as Wi,vl as Ds,vm as wa,vn as wc,wb as wC,we as Mn,wf as dw,wg as Oi,wh as OS,wi as $i,wj as GE,wk as Xi,wl as $s,wm as Sa,wn as Sc,xc as GC,xd as ST,xe as xn,xf as lw,xg as Ri,xh as RS,xi as Fi,xj as UE,xk as Yi,xl as Fs,xm as Ea,xn as Ec,y as Gb,ya as Xo,yc as cn,yd as ET,ye as Nn,yf as uw,yg as Ii,yj as BE,yk as Ji,yl as js,ym as Aa,ze as Ln,zf as pw,zg as Pi,zh as IS,zi as pE,zj as qE,zk as Zi,zl as Gs,zm as va,zn as Ve}from"./chunks/chunk-J6ERHBV2.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]="08485124-a2f1-5bb5-9316-533a3f7888bc")}catch{}})();var H="2026-07-28",EM=["2025-11-25","2025-06-18"],Ze=[H],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},A={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},cr=["debug","info","notice","warning","error","critical","alert","emergency"],p=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function _(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ph(e){if(e===void 0)return;if(!_(e))throw new p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.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 p("Invalid MCP clientInfo metadata",m.invalidParams,{field:A.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 kh(e){if(e!==void 0){if(typeof e!="string"||!cr.includes(e))throw new p("Invalid MCP logLevel metadata",m.invalidParams,{field:A.logLevel,allowed:[...cr]});return e}}function Qe(e){let t=_(e)?e._meta:void 0;if(!_(t))throw new p("Missing required MCP request metadata",m.invalidParams,{required:[A.protocolVersion,A.clientCapabilities]});let r=t[A.protocolVersion];if(typeof r!="string"||!Ze.includes(r))throw new p("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...Ze],requested:typeof r=="string"?r:null});let o=t[A.clientCapabilities];if(!_(o))throw new p("Invalid MCP client capabilities metadata",m.invalidParams,{field:A.clientCapabilities,expected:"object"});let n=Ph(t[A.clientInfo]),i=kh(t[A.logLevel]);return{protocolVersion:H,clientCapabilities:o,...n?{clientInfo:n}:{},...i?{logLevel:i}:{}}}function AM(e,t){if(t!==e.protocolVersion)throw new p("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function vM(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function OM(e,t){let r=e.clientCapabilities.extensions;return _(r)&&_(r[t])}function et(e,t){let r=_(e._meta)?e._meta:{};return{...e,_meta:{...r,[A.serverInfo]:{...t}}}}function Mh(e,t){return et({...e,resultType:"complete"},t)}function RM(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new p("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Mh({supportedVersions:[...Ze],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function IM(e,t){if(_(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new p("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}import{createHash as ur,createHmac as pr,timingSafeEqual as xh}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]="6505e714-d1f3-5794-88c8-51c1644acec9")}catch{}})();var Nh=["elicitation/create","roots/list","sampling/createMessage"],dr=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},mr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,he=32,rt=64*1024,ge=16*1024,tt={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Lh(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function ye(e,t,r){let o;try{o=JSON.stringify(e)}catch{throw new p(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new p(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function ot(e,t){if(!_(e))throw new p("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>he)throw new p("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:he,observed:r.length});let o={};for(let[n,i]of r){if(!mr.test(n)||!_(i))throw new p("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let s=i.method;if(typeof s!="string"||!Nh.includes(s))throw new p("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:s??null});let a=Lh(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new p("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!_(i.params))throw new p("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:s,params:structuredClone(i.params)}}return ye(o,rt,"inputRequests"),o}function fr(e){if(!_(e))throw new p("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>he)throw new p("Invalid MCP inputResponses count",m.invalidParams,{maximum:he,observed:t.length});let r={};for(let[o,n]of t){if(!mr.test(o)||!_(n))throw new p("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return ye(r,rt,"inputResponses"),r}function xM(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ge)throw new p("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ge});let r=e.inputRequests===void 0?void 0:ot(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new p("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[A.serverInfo]:{...e.serverInfo}}}}function _r(e){let t=Buffer.from(e);if(t.byteLength<32)throw new p("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function NM(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 p("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ge/2)throw new p("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ge/2});let o=r.toString("base64url"),n=pr("sha256",_r(t)).update(o).digest("base64url");return`${o}.${n}`}function Dh(e){if(!_(e)||e.version!==1)throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new p("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:i}}function LM(e,t,r){let[o,n,i]=e.split(".");if(!o||!n||i!==void 0)throw new p("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(n,"base64url"),a=pr("sha256",_r(t)).update(o).digest();if(s.byteLength!==a.byteLength||!xh(s,a))throw new p("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(o,"base64url").toString("utf8"))}catch{c=null}let d=Dh(c),{expiresAt:l,method:u,parameterDigest:f,principal:g}=d;if(l<(r.nowMs??Date.now()))throw new p("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(u!==r.method||f!==r.parameterDigest||g!==r.principal)throw new p("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function DM(e){return ye(e,rt,"request parameters"),ur("sha256").update(JSON.stringify(e)).digest("hex")}var lr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new p("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=ur("sha256").update(t).digest("hex");if(this.#e.has(r))throw new p("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 $h(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new p("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function $M(e,t){return{...e,...$h(t)}}function Fh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function jh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Fh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Gh(e){let t=e.maxBytes??tt.maxBytes,r=e.maxDepth??tt.maxDepth,o=e.maxNodes??tt.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new p("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function Uh(e,t){let r=Array.isArray(e.value)?e.value:_(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function Bh(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&jh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function FM(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Gh(t);if(typeof e!="boolean"&&!_(e))throw new p("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});ye(e,r,"JSON Schema");let i=[{value:e,depth:0}],s=0;for(;i.length>0;){let a=i.pop();if(s+=1,s>n||a.depth>o)throw new p("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});Bh(e,a.value),Uh(a,i)}return structuredClone(e)}import{randomUUID as qh}from"node:crypto";import{readFile as zh}from"node:fs/promises";import hr 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]="7f5b3ba6-07cf-5317-8f62-63e84f561232")}catch{}})();var HM="io.modelcontextprotocol/tasks",Vh=["working","input_required","completed","failed","cancelled"],Hh=/^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,Kh=3600*1e3,Wh=1e3,Ce=1024,Xh=30,Yh=2e3;function nt(e){return new p(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function be(e){let t=e.trim();if(!Hh.test(t))throw nt("Unknown MCP task");return t}function gr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new p("Corrupt MCP task record",m.invalidParams,{field:t});return e}function yr(e){if(!_(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new p("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Ce),..._(e.data)?{data:structuredClone(e.data)}:{}}}function Jh(e){if(!Vh.includes(e))throw new p("Corrupt MCP task record",m.invalidParams);return e}function Zh(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",m.invalidParams);return e}function Qh(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",m.invalidParams);return e}function eg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",m.invalidParams);return e}function tg(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new p("Corrupt MCP task record",m.invalidParams);return e}}function rg(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",m.invalidParams);return[...e]}function og(e){if(!_(e)||e.version!==1)throw new p("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?be(e.taskId):"",r=Jh(e.status),o=Zh(e.principal),n=Qh(e.workerPid),i=eg(e.ttlMs),s=tg(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:gr(e.createdAt,"createdAt"),lastUpdatedAt:gr(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:i,consumedInputKeys:rg(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Ce)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(_(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),_(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),_(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=yr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new p("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function K(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 ng(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var it=class{#e;#t;#r;#o;#i;constructor(t){this.#e=hr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${qh()}`),this.#i=t.workerPid??process.pid}#s(t){return hr.join(this.#e,"runtime","mcp-tasks","records",`${be(t)}.json`)}async#c(t){try{return og(JSON.parse(await zh(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?nt("Unknown MCP task"):r}}async#a(t){await $e(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
2
+ `)}async#n(t,r,o){let n=be(t),i=await Ge(this.#e,n,Xh,this.#t,!1,!1,Yh);try{let s=await this.#c(n);if(s.principal!==r)throw nt("Unknown MCP task");let a=o(s);return await this.#a(a),a}finally{await i()}}async create(t){let r=be(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?Kh:t.ttlMs,i=t.pollIntervalMs??Wh;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(i)||i<0)throw new p("Invalid MCP task creation options",m.invalidParams);let s=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:s,lastUpdatedAt:s,ttlMs:n,pollIntervalMs:i,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Ce)}:{}};return await this.#a(a),{...K(a),resultType:"task"}}async get(t,r){return K(await this.#n(t,r,o=>{if(oe(o.status))return o;let n=this.#r().getTime(),i=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,s=o.workerPid!==this.#i&&!ng(o.workerPid);return!i&&!s?o:{...o,status:"failed",statusMessage:i?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:i?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=ot(t.inputRequests,t.requestContext);return K(await this.#n(t.taskId,t.principal,o=>{if(oe(o.status))return o;let n=Object.keys(r).filter(i=>o.consumedInputKeys.includes(i));if(n.length>0)throw new p("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,Ce),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=fr(o),i=[],s=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,u]of Object.entries(n))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=u,delete c[l],i.push(l));return s=Object.keys(c).sort(),i.length===0?a:{...a,status:s.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:s.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...i])].sort()}}),{acceptedKeys:i.sort(),remainingKeys:s}}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 K(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=yr(o);return K(await this.#n(t,r,i=>oe(i.status)?i:{...i,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return K(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 KM(e){return new it(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]="f87864d3-e499-57f7-b1e3-4ea3f30b7725")}catch{}})();var Te="io.modelcontextprotocol/subscriptionId",br=256,Cr=2048,ig=5e3;function sg(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),ig);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},i=>{clearTimeout(n),o(i instanceof Error?i:new Error(String(i)))})})}function st(e,t){if(e!==void 0){if(typeof e!="boolean")throw new p("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function ag(e){if(!_(e))throw new p("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=st(e.toolsListChanged,"toolsListChanged"),r=st(e.promptsListChanged,"promptsListChanged"),o=st(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>br)throw new p("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:br});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>Cr)throw new p("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:Cr});i.add(s)}i.size>0&&(n=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function cg(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 Tr=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 p("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=cg(ag(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:{[Te]: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[i,s]of this.#t)s.filter[r]===!0&&n.push(this.#o(i,s,{jsonrpc:"2.0",method:o,params:{_meta:{[Te]:i}}}));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:{[Te]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let i=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await sg(r.sink,o),!0}catch(s){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw s;return!1}});return r.writeQueue=i.then(()=>{},()=>{}),i}close(t){if(this.#t.delete(t))return{...et({resultType:"complete",_meta:{[Te]: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]="7d591d0b-f009-519c-8024-c6fa18effb8e")}catch{}})();var wr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,dg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,Sr=/^[\t\x20-\x7E]*$/u,Er=new Set(["prompts/get","resources/read","tools/call"]);function lg(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 v(e,t){throw new p(e,m.headerMismatch,{header:t})}function Ar(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&Sr.test(t)&&!wr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function vr(e,t){let r=wr.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?v("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!Sr.test(e)?v("Malformed MCP header value",t):e}function we(e){return Array.isArray(e)?e.some(we):_(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(we):!1}function ug(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!dg.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new p("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 Or(e){if(!_(e))throw new p("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,i)=>{let s=n.properties;if(s!==void 0){if(!_(s))throw new p("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!_(c))continue;let d=[...i,a],l=ug(c,d,r);l&&t.push(l);for(let[u,f]of Object.entries(c))if(u!=="properties"&&u!=="x-mcp-header"&&we(f))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:u});o(c,d)}}};for(let[n,i]of Object.entries(e))if(n!=="properties"&&we(i))throw new p("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Rr(e,t){let r=e;for(let o of t){if(!_(r))return;r=r[o]}return r}function Ir(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function pg(e,t){let r=_(e.arguments)?e.arguments:{},o={};for(let n of Or(t)){let i=Rr(r,n.path);if(i==null)continue;if(!(n.type==="integer"&&typeof i=="number"&&Number.isSafeInteger(i)||n.type==="boolean"&&typeof i=="boolean"||n.type==="string"&&typeof i=="string"))throw new p("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=Ar(i)}return o}function ZM(e){let t=_(e.request.params)?e.request.params:void 0,r=Qe(t),o=e.request.method;if(typeof o!="string"||o.length===0)return v("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},i=Ir(o,t);if(Er.has(o)){if(i===void 0)return v("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=Ar(i)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,pg(t,e.toolSchema)),n}function mg(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&v("Missing MCP request method","Mcp-Method");let o=_(t.params)?t.params:void 0,n=Qe(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&v("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&v("MCP method header does not match request body","Mcp-Method"),Er.has(r)){let i=e.get("mcp-name"),s=Ir(r,o);(i===void 0||s===void 0||vr(i,"Mcp-Name")!==s)&&v("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&v("MCP SSE resumability is not supported","Last-Event-ID")}function fg(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 _g(e){let t=_(e.params.arguments)?e.params.arguments:{};for(let r of Or(e.toolSchema)){let o=Rr(t,r.path),n=`Mcp-Param-${r.name}`,i=e.headers.get(n.toLowerCase());if(o==null){i!==void 0&&v("Unexpected MCP parameter header",n);continue}i===void 0&&v("Missing MCP parameter header",n),fg(r,o,vr(i,n))||v("MCP parameter header does not match request body",n)}}function QM(e){let t=lg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";mg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&_g({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var e0=H;import{AsyncLocalStorage as hg}from"node:async_hooks";import{createHash as Pr,timingSafeEqual as gg}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]="6a5310f6-3add-5108-b39f-61607918dc9f")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},yg=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,bg=/^[a-z][a-z0-9_*/-]{0,255}$/u,Cg=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Tg=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Mr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,xr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,wg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,Sg=/%(?![0-9A-Fa-f]{2})/u,Eg=512,Ag=32,vg=180,Og=8192,Rg=8192,Nr=new hg;function E(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 Ig(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 i0(e){let t=E(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=>E(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!Mr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function s0(e){let t=E(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 a0(e,t){if(!_(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=E(t,"expected issuer").href.replace(/\/$/u,"");if(E(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 n=d=>{let l=e[d];if(typeof l!="string")throw new y(`Authorization server metadata requires ${d}`,401);return E(l,d).href},i=d=>{let l=e[d];return typeof l=="string"?E(l,d).href:void 0},s=n("authorization_endpoint"),a=n("token_endpoint"),c=i("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:a,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}:{},...c?{registration_endpoint:c}:{}}}function c0(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 d0(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 l0(e,t){let r=E(t,"client metadata document URL");if(r.pathname==="/"||!_(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);E(o,"client redirect URI",!0)}return structuredClone(e)}function u0(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=>E(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 kr=class{#e=new Map;set(t,r){let o=E(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=E(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=E(t,"credential issuer").href;return this.#e.delete(r)}};function Pg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?yg.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],i=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(i))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Mg(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 kg(e){return bg.test(e)||Cg.test(e)}function Mg(e){if(Buffer.byteLength(e,"utf8")>Eg)return!1;let t=e.split(",");if(t.length>Ag)return!1;let r=new Set;for(let o of t){let n=$(o);if(n.length===0)continue;let i=n.indexOf("="),s=i>0?n.slice(0,i):"",a=i>0?n.slice(i+1):"";if(!kg(s)||!Tg.test(a)||r.has(s))return!1;r.add(s)}return!0}function Lr(e){return wg.test(e)&&!Sg.test(e)}function xg(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 xr.test(o)&&(n===void 0||Lr(n))}function Ng(e){let t=$(e),r=t.split(";"),o=r[0],n=r.slice(1),i=o.indexOf("="),s=$(i>0?o.slice(0,i):""),a=i>0?$(o.slice(i+1)):"";if(!(!xr.test(s)||!Lr(a)||!n.every(xg)))return{key:s,serialized:t}}function Lg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>Og)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>vg)throw new y("Invalid MCP baggage",403);let n=[];for(let i of o){let s=Ng(i);if(!s)throw new y("Invalid MCP baggage",403);r.has(s.key)&&n.push(s.serialized)}return n.length>0?n.join(","):void 0}function p0(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},o=Lg(r.baggage,t.baggageAllowlist??[]);return{...Pg(r),...o?{baggage:o}:{}}}function m0(e,t){return Nr.run(structuredClone(e),t)}function f0(){let e=Nr.getStore();return e?{...e}:void 0}async function _0(e){let t=E(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(u=>!Mr.test(u)))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 s=Ig(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new y("Missing or malformed bearer token",401,o);let a=s[1];if(Buffer.byteLength(a,"utf8")>Rg)throw new y("Missing or malformed bearer token",401,o);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new y("Invalid bearer token",401,o)}let d=Array.isArray(c.audience)?c.audience:[c.audience];if(c.issuer!==e.policy.issuer||!d.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let l=r.filter(u=>!c.scopes.includes(u));if(l.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${l.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function h0(e){let t=Pr("sha256").update(e.token).digest();return r=>{let o=Pr("sha256").update(r).digest();if(!gg(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]="4f17095e-2dba-530c-935c-1803ed359510")}catch{}})();var at="io.modelcontextprotocol/ui",Se="2026-01-26",Fr="text/html;profile=mcp-app",Dr=Object.freeze({specVersion:Se,mimeTypes:[Fr]});function b0(e){let t=e.clientCapabilities.extensions;if(!_(t))return!1;let r=t[at];if(r===void 0)return!1;if(!_(r))throw new p("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[at]:Dr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(Fr)||n!==void 0&&n!==Se)throw new p("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[at]:Dr}}});return!0}var Dg={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},jr=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:Dg})));function C0(e){return jr.find(t=>t.uri===e)}function T0(e){let t=new Map(jr.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 $r(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function w0(e){let t=$r(e.name),r=$r(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Se}),n=JSON.stringify(Se);return`<!doctype html>
3
3
  <html lang="en">
4
4
  <head>
5
5
  <meta charset="utf-8">
@@ -19,15 +19,15 @@ import{A as $v,B as Ih,C as vh,D as Fv,E as jv,a as us,b as ps,c as fs,d as ms,e
19
19
  <button type="button" id="copy">Copy visible evidence</button>
20
20
  </main>
21
21
  <script>
22
- (()=>{"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:${n},appCapabilities:{},protocolVersion:${o}}).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"})})();
22
+ (()=>{"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"})})();
23
23
  </script>
24
24
  </body>
25
- </html>`}import{createHash as st}from"node:crypto";import{lstat as $g,readdir as zr,readFile as Fg}from"node:fs/promises";import k from"node:path";import{parseDocument as jg}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]="5f60bc89-c81b-57ee-a8f2-0d0b18d0af1b")}catch{}})();var $r="io.modelcontextprotocol/skills",at="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Gg=Object.freeze({revision:at,status:"draft",directoryRead:!0});function rM(e,t=!1){let r=e.clientCapabilities.extensions,n=_(r)?r[$r]:void 0;if(!_(n)||n.revision!==at||t&&n.directoryRead!==!0)throw new p("Missing or incompatible Skills over MCP draft capability",f.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[$r]:Gg}}})}var P=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Fr=100,Ug=32*1024*1024,Bg=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,jr=new Set(Array.from({length:P.maxPageSize},(e,t)=>t+1));function T(e,t){throw new p(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 qg(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||T(`Skill ${t} is missing YAML frontmatter.`);let n=jg(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});n.errors.length>0&&T(`Skill ${t} has invalid YAML frontmatter.`,{errors:n.errors.map(i=>i.message)});let o;try{o=n.toJS({maxAliasCount:0})}catch(i){T(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof o!="object"||o===null||Array.isArray(o))&&T(`Skill ${t} frontmatter must be an object.`),o}async function zg(e,t,r,n){return r>P.maxFileBytes&&T(`Skill resource exceeds the per-file limit: ${t}.`),n.files+=1,n.files>P.maxFilesPerSkill&&T(`Skill exceeds ${P.maxFilesPerSkill} files.`),n.skillBytes+=r,n.skillBytes>P.maxSkillBytes&&T(`Skill exceeds the aggregate byte limit: ${t}.`),n.originBytes.value+=r,n.originBytes.value>Ug&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),Fg(e)}async function Vr(e,t,r){let n=k.join(e,t),o=await zr(n,{withFileTypes:!0}),i=[];for(let s of o.sort((a,c)=>a.name.localeCompare(c.name))){let a=k.posix.join(t.split(k.sep).join("/"),s.name),c=k.join(e,...a.split("/")),d=await $g(c);d.isSymbolicLink()&&T(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await Vr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await zg(c,a,d.size,r)}):T(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function Ur(e,t,r){let n=new Map,o;try{o=await zr(e,{withFileTypes:!0})}catch(a){if(St(a))return n;throw a}let i=o.filter(a=>a.isDirectory()&&Bg.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>Fr&&T(`Skill origin exceeds ${Fr} directories.`);let s={value:0};for(let a of i){let c=await Vr(k.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((h,C)=>h+C.bytes.byteLength,0),l=c.find(h=>h.relative==="SKILL.md");if(!l)continue;let u=qg(l.bytes.toString("utf8"),a.name);u.name!==a.name&&T(`Skill directory ${a.name} must match frontmatter name.`,{actual:u.name??null,expected:a.name}),(typeof u.description!="string"||u.description.trim().length===0)&&T(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let m=c.map(h=>({uri:`skill://${a.name}/${h.relative}`,digest:`sha256:${st("sha256").update(h.bytes).digest("hex")}`,size:h.bytes.byteLength})),g=st("sha256").update(m.map(h=>`${h.uri}:${h.digest}`).join(`
26
- `)).digest("hex");n.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:u,resources:m,_meta:{contractVersion:1,extensionRevision:at,origin:t,packageVersion:r,protocolVersion:H,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(h=>[h.relative,h.bytes])),fingerprint:g})}return n}function Br(e){let{files:t,fingerprint:r,...n}=e;return n}var qr=class e{#e;#t;constructor(t){this.#e=t,this.#t=st("sha256").update([...t.entries()].sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>`${r}:${n.fingerprint}`).join(`
27
- `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let n=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof n!="object"||n===null||!("fingerprint"in n)||n.fingerprint!==this.#t||!("scope"in n)||n.scope!==r||!("offset"in n)||!Number.isInteger(n.offset)||Number(n.offset)<0)&&T("Skill cursor is invalid or stale."),Number(n.offset)}catch(n){if(n instanceof p)throw n;return T("Skill cursor is invalid or stale.")}}#n(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Ur(k.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let n=k.resolve(t.packageRoot,".agents","skills"),o=k.resolve(t.workspaceRoot,".agents","skills");if(o!==n){let i=await Ur(o,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??P.defaultPageSize;jr.has(r)||T(`Skill list limit must be an integer from 1 to ${P.maxPageSize}.`);let n=this.#r(t.cursor,"skills/list"),o=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=o.slice(n,n+r),s=n+i.length,a=s<o.length;return{skills:i.map(Br),hasMore:a,...a?{nextCursor:this.#n(s,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),n=r?this.#e.get(r[1]):void 0;return n||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Br(n)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),n=r?this.#e.get(r[1]):void 0,o=r?.[2]??"",i=n&&o?n.files.get(o):void 0,s=n?.resources.find(d=>d.uri===t);(!n||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:n._meta.origin,trust:"untrusted"},c=Gr(o,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let n=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),o=n?this.#e.get(n[1]):void 0;o||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(n?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${n[1]}`,c=new Map;for(let C of o.resources){let w=C.uri.slice(`${a}/`.length);if(!w.startsWith(s))continue;let z=w.slice(s.length),[I,...wt]=z.split("/"),Pn=`${a}/${s}${I}`,kn=o.files.get(`${s}${I}`);c.set(I,{uri:Pn,name:I,mimeType:wt.length>0?"inode/directory":Gr(I,kn)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??P.maxPageSize;jr.has(d)||T(`Skill directory limit must be an integer from 1 to ${P.maxPageSize}.`);let l=this.#r(r.cursor,t),u=[...c.values()].sort((C,w)=>C.uri.localeCompare(w.uri)),m=u.slice(l,l+d),g=l+m.length,h=g<u.length;return{resources:m,hasMore:h,...h?{nextCursor:this.#n(g,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]="cc0d4dd1-20e8-59d4-acb5-9f8ed639d35f")}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]="f48b9002-59dc-54d3-95de-36bf0d11b39a")}catch{}})();var Hr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function ct(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,n)=>ct(r,`${t}[${n}]`)));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,n])=>[r,ct(n,`${t}.${r}`)])))}function Se(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,n)=>Object.freeze({action:r.action,input:ct(r.input,`operations[${n}].input`)})))})}async function Kr(e,t){let r=Se(e);return At(r,t)}async function Vg(e,t){return Kr(e,async()=>{let r=[];for(let[n,o]of e.operations.entries())r.push(await t(o,n));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]="38cb0b88-262f-5061-b95a-f4532bc52613")}catch{}})();var Wr="pm.agent-observation/v1",Xr="pm.agent-verdict/v1",Yr="pm.agent-episode/v1";function R(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function M(e,t){if(e.trim().length===0)throw new Error(`${t} must not be empty.`)}function oe(e){if(e!==null&&typeof e=="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))oe(t)}return e}function Hg(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(M(r.command,"observation.reads.command"),R(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 Kg(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(R(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,n)=>r+n,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 Wg(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 n of e){if(M(n.id,"observation.tiers.id"),R(n.max_tokens,"observation.tiers.max_tokens"),t.has(n.id))throw new Error(`Duplicate observation tier: ${n.id}.`);if(t.add(n.id),n.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=n.max_tokens;let o=new Set;for(let i of n.fields){if(F(i,"observation.tiers.fields"),o.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);o.add(i)}}}function Xg(e){if(e.schema!==Wr)throw new Error(`observation.schema must be ${Wr}.`);return M(e.id,"observation.id"),R(e.version,"observation.version"),Hg(e.reads),Kg(e.calibration),e.corpus_dependence.kind==="bounded"&&(M(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),R(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),Wg(e.tiers),oe(structuredClone(e))}function uM(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 Yg(e,t,r){R(r.budget_tokens,"observation request budget_tokens");let n=[];for(let[o,i]of e.tiers.entries()){n.push(i.id);let s=await t(i),a=Buffer.byteLength(v(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:o>0,attempted_tiers:n,emitted_bytes:a,estimated_tokens:c,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:n,emitted_bytes:null,estimated_tokens:null,calibration_basis:"emitted_bytes"}}}function F(e,t){let r=e.split(".");if(r.some(n=>n.length===0||n==="__proto__"||n==="prototype"||n==="constructor"))throw new Error(`${t} must be a safe, non-empty dot-separated path.`);return r}function Jr(e,t){let r=e;for(let n of F(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,n))return;r=r[n]}return r}function Jg(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function Zg(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 Qg(e){if(e.schema!==Xr)throw new Error(`verdict.schema must be ${Xr}.`);M(e.id,"verdict.id"),R(e.version,"verdict.version");let t=new Set;for(let n of e.predicates){M(n.id,"verdict.predicates.id"),F(n.path,"verdict.predicates.path");let o=n.kind;if(o!=="field_equals"&&o!=="field_present"&&o!=="field_absent")throw new Error(`Unsupported verdict predicate kind for ${n.id}.`);if(t.has(n.id))throw new Error(`Duplicate verdict predicate: ${n.id}.`);Zg(n),t.add(n.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(n=>!t.has(n)))throw new Error("verdict composition contains duplicate or unknown predicate ids.");return oe(structuredClone(e))}function ey(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(s=>[s.id,s])),n=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=Jr(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:v(c)===v(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${Jg(a.path)}`,evidence_digest:Rt(v(c))}}),o=n.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?o===n.length:o>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:o/n.length,policy:"verdict_only_no_reward",predicates:n}}function pM(e){if(e.schema!==Yr)throw new Error(`episode.schema must be ${Yr}.`);if(M(e.id,"episode.id"),R(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)M(t,"episode.task_item_ids");R(e.limits.max_actions,"episode.limits.max_actions"),R(e.limits.max_observations,"episode.limits.max_observations"),R(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(n=>t===n||t.startsWith(`${n}.`)||n.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 Xg(e.observation),Qg(e.verdict),Se(e.recipe),oe(structuredClone(e))}function ty(e,t,r){let n=F(t,"observation projection field"),o=e;for(let[i,s]of n.entries()){if(i===n.length-1){r!==void 0&&(o[s]=structuredClone(r));return}let a=o[s];(a===null||typeof a!="object"||Array.isArray(a))&&(o[s]={}),o=o[s]}}function ry(e,t){let r={};for(let n of t)ty(r,n,Jr(e,n));return r}async function fM(e,t){let r=[],n=0,o=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await D(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let u=await t.readRecordedState(),m=await Yg(e.observation,async g=>ry(u.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:m.receipt.served_tier??u.snapshot_id}),m},l=async(u=!1)=>{if(i&&!u)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let m=await t.readRecordedState(),g=ey(e.verdict,m);return r.push({sequence:r.length+1,kind:"verdict",state_id:m.snapshot_id}),g};return{observe:()=>D(a,d),step:async u=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");n+=1;let m=await D(a,()=>t.execute(u));return r.push({sequence:r.length+1,kind:"action",state_id:m.state_id}),m},score:()=>D(a,l),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=D(a,()=>l(!0)).then(m=>(r.push({sequence:r.length+1,kind:"close",state_id:m.snapshot_id}),{verdict:m,trajectory:oe(structuredClone(r))})).catch(m=>{throw i=!1,m}).finally(()=>{s=void 0}),s)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fa4eb88d-f50e-59fa-be7f-0cfb42931a73")}catch{}})();var j="https://schema.unbrained.dev/pm/corpus-shape/v1";function W(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 Qr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Qr(t);Object.freeze(e)}}function X(e){if(e.schema!==j)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(W(e.hierarchy_depth,"hierarchy_depth"),W(e.hierarchy_fanout,"hierarchy_fanout"),ie(e.age_span_days,"age_span_days"),W(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"),W(e.author_cardinality,"author_cardinality"),W(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 Qr(t),t}var Ee=[{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:X({schema:j,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:X({schema:j,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:Ee,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":X({schema:j,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:Ee,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":X({schema:j,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:Ee,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":X({schema:j,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:Ee,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function ny(){return Object.keys(Y).sort().map(e=>Y[e])}function oy(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 Zr=new WeakMap;function en(e,t){if(e===0)return[];let r=Zr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(o=>Array.from({length:o.weight},()=>o.kind)),Zr.set(t,r));let n=[r[e%r.length]];return t.include_cycles&&e>2&&e%17===0&&n.push("related"),[...new Set(n)]}function iy(e,t,r,n=42){if(ie(t,"item index"),W(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let o=Math.min(e.component_count,r),i=t%o,s=Math.floor(t/o),a=0,c=1;for(let w=0;w<e.hierarchy_depth;w+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,l=s-d,u=d===0?void 0:i+(l+Math.floor((d-1)/e.hierarchy_fanout))*o,m=Date.UTC(2026,0,1),g=e.age_span_days*864e5,h=new Date(m+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),C=(t*37+n)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...u===void 0?{}:{parent:`pm-s${u.toString(36).padStart(7,"0")}`},component:i,timestamp:h,author:`pm-corpus-agent-${(t+n)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:en(t,e),has_comment:C<e.comments_per_100_items,has_note:C<e.notes_per_100_items,has_learning:C<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 dt=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 n of r)t[n]=(t[n]??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 n=this.depths.get(t.parent);this.recordMismatch(n===void 0,`parent_missing:${t.parent}`),r=(n??0)+1;let o=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,o),this.observedFanout=Math.max(this.observedFanout,o)}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[n,o]of this.annotationFields)this.annotations[n]+=Number(t[o]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,en(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),n=[...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[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,l=c*a+Math.max(0,a+d-100),u=c*a+Math.min(a,d),m=this.annotations[s];(m<l||m>u)&&n.push(`${s}:${m}!in[${l},${u}]`)}let o=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...o].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&n.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...new Set(n)];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:i.length===0,mismatches:i}}};function tn(e){return new dt(e)}function sy(e,t){let r=tn(e);for(let n of t)r.add(n);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]="cea03617-5e90-5683-a9d1-289087ed4646")}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]="8c9a34bd-b77a-55ab-a5d1-3594cecfeb3f")}catch{}})();async function ay(){let e=De(process.cwd(),process.env.PM_PATH);await vt(e,(t,r)=>Pt(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]="a108f4d2-80c3-540e-821c-5acdf68eb7fa")}catch{}})();async function cy(){await kt()}(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]="340305b6-e3c8-5daa-bfbe-4a9c62a6d039")}catch{}})();var rn=["lines","branches","functions","statements"];function dy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function ly(e,t,r){if(typeof r!="object"||r===null||Array.isArray(r))throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);let n=r;if(typeof n.covered!="number"||typeof n.total!="number"||!Number.isInteger(n.covered)||!Number.isInteger(n.total)||n.covered<0||n.total<n.covered)throw new TypeError(`Coverage entry ${e} has invalid ${t} counts.`);return{covered:n.covered,total:n.total}}function uy(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,n]of Object.entries(e)){dy(r,n);for(let o of rn){let i=ly(r,o,n[o]),s=i.total-i.covered;s>0&&t.push({file:r,metric:o,uncovered:s,...i})}}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]="3edb1f4f-d26e-51a8-b62a-caffdd3ac44b")}catch{}})();var py=["captured_redacted","captured_verbatim"],fy=[{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 x(e){return typeof e=="string"&&e.trim().length>0}function my(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,n=[];r.boundary_id!==e.id&&n.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||!py.includes(r.capture_source)||!x(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(x)||!("input"in r)||!("observed"in r))&&n.push({boundary_id:e.id,kind:"invalid_fixture",detail:`${e.fixture_path} lacks captured provenance, redaction metadata, input, or observed output.`});let o=JSON.stringify(t);for(let i of fy)i.pattern.test(o)&&n.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${i.label}.`});return n}function _y(e,t){let r=Date.parse(e.waiver_expires_at),n=x(e.waiver_reason)&&x(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&xt(e.waiver_expires_at)&&Number.isFinite(r);return{captured:0,waived:n&&r>=t?1:0,findings:n?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 hy(e,t,r){if(!x(e.id)||!x(e.producer)||!x(e.consumer)||!x(e.format))return{captured:0,waived:0,findings:[{boundary_id:x(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 n=t[e.fixture_path],o=x(e.fixture_path)&&e.fixture_path in t?my(e,n):[{boundary_id:e.id,kind:"missing_fixture",detail:`Boundary ${e.id} fixture ${String(e.fixture_path)} is missing.`}];return{captured:o.length===0?1:0,waived:0,findings:o}}return _y(e,r)}function vM(e,t,r=new Date){let n=[];if(e.version!==1||!x(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 o=new Set,i=0,s=0;for(let a of e.boundaries){if(typeof a!="object"||a===null||Array.isArray(a)){n.push({boundary_id:"unknown",kind:"invalid_boundary",detail:"Each boundary must be a JSON object."});continue}let c=a,d=x(c.id)?c.id:void 0;if(d!==void 0&&o.has(d)){n.push({boundary_id:d,kind:"duplicate_boundary",detail:`Boundary ${d} is inventoried more than once.`});continue}d!==void 0&&o.add(d);let l=hy(c,t,r.getTime());i+=l.captured,s+=l.waived,n.push(...l.findings)}return n.sort((a,c)=>a.boundary_id!==c.boundary_id?a.boundary_id.localeCompare(c.boundary_id):a.kind.localeCompare(c.kind)),{ok:n.length===0,boundary_count:e.boundaries.length,captured_count:i,waived_count:s,findings:n}}import J 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]="611e9aba-d08e-5c1a-89c9-c7fda0cc9bc9")}catch{}})();var nn=300*1e3,gy=3;function LM(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function DM(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.");J.mkdirSync(e,{recursive:!0});let n=lt.join(e,r);J.mkdirSync(n,{recursive:!0});let o=new Date;J.utimesSync(n,o,o);let i=J.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:J.statSync(lt.join(e,d)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&pe(l))return[];throw l}}).sort((d,l)=>l.mtimeMs-d.mtimeMs||d.name.localeCompare(l.name)),s=i.filter(d=>o.getTime()-d.mtimeMs<nn),a=Math.max(0,gy-1-s.length),c=i.filter(d=>o.getTime()-d.mtimeMs>=nn).slice(a).map(d=>d.name).sort((d,l)=>d.localeCompare(l));for(let d of c)J.rmSync(lt.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import on from"node:fs";import xe 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]="f9737b75-b285-5fe9-a9ce-63e7c07626cb")}catch{}})();var se="@unbrained/pm-cli",yy=new Set(["append","claim","changelog","close","close-many","close-task","comments","config","copy","create","dedupe-merge","delete","deps","docs","extension","event","events","files","focus","gc","history-author-acknowledge","history-compact","history-redact","history-repair","init","install","item","learnings","meet","merge","normalize","notes","package","packages","pause-task","plan","profile","reindex","release","remind","restore","schema","start-task","test","test-all","test-runs","test-runs-worker","telemetry","templates","twin","update","update-many","upgrade","vcs","workspace"]),sn=new Set(["--author","--output-budget","--output-format","--output-include","--output-limit","--output-session","--path","--pm-path"]),ft=/\b(\d{4})\.(\d{1,2})\.(\d{1,2})(?:-(\d+))?\b/u,Re="2026.8.31";function S(e,t){return e.some(r=>t.includes(r.split("=",1)[0]))}function ut(e,t){return["activate","adopt","adopt-all","deactivate","init","install","migrate","reload","uninstall"].includes(t[0]??"")||S(e,["--activate","--adopt","--adopt-all","--deactivate","--fix-managed-state","--init","--install","--output","--reload","--scaffold","--uninstall"])}var by={changelog:(e,t)=>{if(t[0]==="generate")return!S(e,["--check"]);let r=e.indexOf("export");return t[0]==="export"&&(S(e,["--output"])||r>=0&&e[r+1]!==void 0&&!e[r+1].startsWith("-"))},comments:e=>S(e,["--add","--delete","--edit","--file","--stdin"]),config:(e,t)=>(t[0]==="project"||t[0]==="global"?t[1]:t[0])==="set",deps:()=>!1,docs:e=>S(e,["--add","--add-glob","--migrate","--remove"]),duplicates:()=>!1,events:()=>!1,extension:ut,files:(e,t)=>S(e,["--add","--add-glob","--migrate","--remove"])||t[0]==="discover"&&S(e,["--apply"]),health:e=>!S(e,["--check-only","--no-refresh","--skip-vectors"]),learnings:e=>S(e,["--add","--delete","--edit","--file","--stdin"]),merge:(e,t)=>t[0]!=="report",notes:e=>S(e,["--add","--delete","--edit","--file","--stdin"]),package:ut,packages:ut,profile:(e,t)=>t[0]==="apply",schema:(e,t)=>["add-field","add-status","add-type","remove-field","remove-status","remove-type","remap-status","rename-field","rename-type"].includes(t[0]??"")&&!(S(e,["--infer"])&&!S(e,["--apply"])),telemetry:(e,t)=>t.slice(0,2).some(r=>["clear","flush"].includes(r)),templates:(e,t)=>t[0]==="save",test:e=>S(e,["--add","--add-json","--background","--measure","--remove","--resume","--run","--stop"]),validate:e=>S(e,["--auto-fix","--prune-missing"]),vcs:(e,t)=>["abandon","create","merge","propose","ref-create"].includes(t[0]??""),workspace:(e,t)=>t[0]==="snapshot"&&["create","delete","restore"].includes(t[1]??"")};function Oe(e){let t=e.match(ft);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]??0)]:null}function G(e,t){let r=Oe(e),n=Oe(t);if(!r||!n)return null;for(let o=0;o<r.length;o+=1){let i=r[o]-n[o];if(i!==0)return Math.sign(i)}return 0}function Ae(e){return G(e,Re)!==-1?3:2}function Cy(e,t){if(t===3)return e.filter(r=>r.history_epoch_compatible===!1).map(r=>({...r,declaration:r.declaration??r.version})).sort((r,n)=>G(r.version,n.version))[0]}function pt(e){try{let t=JSON.parse(on.readFileSync(e,"utf8"));return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:null}catch{return null}}function Ty(e){let t=[...e.matchAll(/(<=|<)\s*v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/gu)].map(n=>({inclusive:n[1]==="<=",version:n[2]})),r=e.match(/\b\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?\s+-\s+v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/u);return r?[...t,{inclusive:!0,version:r[1]}]:t}function wy(e){let t=e.split("||").map(r=>Ty(r));return{bounded:t.some(r=>r.length>0),compatible:t.some(r=>r.every(n=>{let o=G(Re,n.version);return o!==null&&(n.inclusive?o!==1:o===-1)}))}}function Sy(e){return["dependencies","devDependencies","optionalDependencies","peerDependencies"].flatMap(t=>{let r=e[t];if(typeof r!="object"||r===null)return[];let n=r[se],o=typeof n=="string"?n.trim():"",i=/^[<!]/u.test(o)?void 0:o.match(ft)?.[0];if(!i)return[];let s=/^(?:=|v)?\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?$/u.test(o),a=wy(o);return[{version:i,constraint:s?"exact":a.bounded?"range":"minimum",...s?{}:{declaration:o},history_epoch_compatible:s?G(i,Re)!==-1:a.compatible}]})}function Ey(e){let r=pt(xe.join(e,"package-lock.json"))?.packages;if(typeof r!="object"||r===null)return;let n=r["node_modules/@unbrained/pm-cli"];if(typeof n!="object"||n===null)return;let o=n.version;return typeof o=="string"?o:void 0}function Ay(e,t){try{let r=on.readFileSync(xe.join(e,t),"utf8").split(/\r?\n/u),n=r.findIndex(c=>c.includes(se));if(n<0)return;let o=r[n].match(/^\s*/u)[0].length,i=[r[n]];for(let c=n+1;c<r.length;c+=1){let d=r[c],l=d.trim(),u=d.match(/^\s*/u)[0].length;if(l.length>0&&u<=o)break;i.push(d)}return i.join(`
28
- `).match(/^\s*version(?::\s*|\s+)["']?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/mu)?.[1]??i[0].match(ft)?.[0]}catch{return}}function xy(e){let t=[],r=pt(xe.join(e,"package.json"));r&&t.push(...Sy(r).map(s=>({...s,source:"package.json"})));let o=pt(xe.join(e,"node_modules","@unbrained","pm-cli","package.json"))?.version;typeof o=="string"&&Oe(o)&&t.push({version:o,source:"installed-package",constraint:"exact",history_epoch_compatible:Ae(o)===3});let i=Ey(e);i&&Oe(i)&&t.push({version:i,source:"package-lock.json",constraint:"exact",history_epoch_compatible:Ae(i)===3});for(let s of["pnpm-lock.yaml","yarn.lock"]){let a=Ay(e,s);a&&t.push({version:a,source:s,constraint:"exact",history_epoch_compatible:Ae(a)===3})}return t}function an(e){for(let t=0;t<e.length;t+=1){let r=e[t];if(sn.has(r)){t+=1;continue}if(!r.startsWith("-"))return{command:r.toLowerCase(),index:t}}}function Oy(e){let t=an(e);if(!t||S(e,["--help","-h","--dry-run"]))return!1;let{command:r,index:n}=t,o=[];for(let s=n+1;s<e.length;s+=1){let a=e[s];if(sn.has(a)){s+=1;continue}a.startsWith("-")||o.push(a.toLowerCase())}let i=by[r];return i?i(e,o):yy.has(r)}function Ry(e){let t=an(e.argv)?.command,r=Oy(e.argv),n=xy(e.projectRoot).filter(l=>G(l.version,e.executingVersion)!==null).sort((l,u)=>G(u.version,l.version)),o=n[0],i=o!==void 0&&G(e.executingVersion,o.version)===-1,s=Ae(e.executingVersion),a=Cy(n,s),c=r&&a!==void 0,d=i&&!r?{code:"project_runtime_stale_read",executing_version:e.executingVersion,project_version:o.version,source:o.source,message:"This read is using an older pm runtime than the project requires.",next_steps:[`Run the command through the project's installed ${se} ${o.version}.`,"Install the project dependencies with its declared package manager if the local executable is missing."]}:void 0;return{compatible:!r||!i&&!c||e.allowStale===!0,executing_version:e.executingVersion,...o?{project_version:o.version,source:o.source}:{},...t?{command:t}:{},mutating:r,stale:i,history_epoch_incompatible:c,writer_item_hash_version:s,...a?{incompatible_project_version:a.declaration,incompatible_source:a.source}:{},...d?{warning:d}:{},override_applied:r&&(i||c)&&e.allowStale===!0}}function BM(e){let t=Ry(e);if(t.compatible)return t;throw t.history_epoch_incompatible?new b(`pm ${t.executing_version} cannot write item-hash epoch ${t.writer_item_hash_version} into a project pinned to pm ${t.incompatible_project_version}.`,L.CONFLICT,{code:"project_runtime_history_epoch_incompatible",reason:t.incompatible_source,why:`The pinned runtime cannot read item_hash_version ${t.writer_item_hash_version}; allowing the write would break its health and validation gates.`,nextSteps:[`Upgrade the project's ${se} pin to ${Re} or newer before mutating tracker history.`,"For an intentional coordinated migration only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]}):new b(`pm ${t.executing_version} cannot mutate a project pinned to newer pm ${t.project_version}.`,L.CONFLICT,{code:"project_runtime_stale_mutation",reason:t.source,why:"An older runtime can write storage, history, and merge contracts it does not understand.",nextSteps:[`Run this command through the project's installed ${se} ${t.project_version}.`,"For an intentional recovery only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]})}import{createHash as Iy}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]="4586a8b2-07c8-53d4-9c5d-ca557ee07977")}catch{}})();var mt=1;function Z(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 Q(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let o=e.nodes(),i=e.edges(),s=t.list();return Object.freeze({version:mt,fingerprint:Iy("sha256").update(v({nodes:o,edges:i,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:o,edges:i,kinds:s})}function vy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ce(e){if(!vy(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==mt)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(o=>typeof o!="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 $e([]);for(let o of e.kinds)t.register(o);let r=new V(e.nodes,e.edges,t),n=Q(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function N(e,t){U(e.name,"adapter name");let r=U(t.workspace,"workspace");Z(t.signal);let n=await e.read({...t,workspace:r});return Z(t.signal),n===null?null:ce(n)}async function Ie(e,t){let r=U(t.workspace,"workspace"),n=ce(t.snapshot).snapshot,o=await N(e,{workspace:r,signal:t.signal});if(o?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:o.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(Z(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:o?.snapshot.fingerprint??null}),(await N(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...o?{previous_fingerprint:o.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Py(e,t={}){let r=e.map(ce),n=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=n.get(a.kind);if(c&&v(c)!==v(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);n.set(a.kind,a)}let o=new $e([...n.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new V(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),o);return Q(i,o,t)}var ae=class{name;#e=new Map;constructor(t="memory"){this.name=U(t,"adapter name")}async read(t){Z(t.signal);let r=this.#e.get(U(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){Z(t.signal);let r=U(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(ce(t.snapshot).snapshot))}async clear(t){Z(t.signal);let r=U(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.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]="423d6e5d-93e5-5f29-93e0-11ddca9c3156")}catch{}})();function cn(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function ky(e){let t=cn(e.nodeCount,"nodeCount"),r=cn(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let o=(e.kind??"related").trim(),i=(e.idPrefix??"node").trim();if(!o||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${n==="star"?0:a-r}`,target:`${i}-${a}`,kind:o}}}}}function B(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function dn(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=Ot(),o=Q(new V(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),i=Q(new V(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];B(await N(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await Ie(e,{workspace:r,snapshot:o});B(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),B((await N(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),B((await Ie(e,{workspace:r,snapshot:o})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:o.fingerprint}),B((await N(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let d=!1;try{await e.replace({workspace:r,snapshot:o,expected_fingerprint:o.fingerprint})}catch{d=!0}return B(d,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:i.fingerprint}),B(await N(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function My(e){return dn(new ae,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]="20842b89-cef6-542e-b069-76c22b340f1d")}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]="5133d678-01f4-5164-aea7-2cc5ed42dd58")}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]="006109f8-cb09-5a91-8929-7ac7521753b6")}catch{}})();var _t=2,Ny=["self_reported","independent_transport"];function ve(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 ln(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((n,o)=>{let i=de(n,`${t}[${String(o)}]`);return r?n:i})}function ht(e,t){return e===void 0?void 0:de(e,t)}function Ly(e,t){if(e===void 0)return;if(!ve(e)||Object.keys(e).length===0)throw new TypeError(`${t} must be a non-empty object`);let r=Object.entries(e).map(([n,o])=>{if(n.length===0||n.split(".").some(i=>i.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(o!==null&&typeof o!="string"&&typeof o!="boolean"&&(typeof o!="number"||!Number.isFinite(o)))throw new TypeError(`${t} values must be JSON primitives`);return[n,o]});return Object.fromEntries(r)}function Dy(e,t,r,n,o,i){if(n==="refusal"){if(Ve(r)||o===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(o!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=ir(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=Bt(s);if(!Ve(r)||r!==0&&!a?.exit_codes.some(d=>d===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let c=nr(s).kind;if(n!==c)throw new TypeError(`${e} expected ${n}, but ${s} declares ${c}`)}function $y(e,t,r){if(!ve(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let n=`tasks.${t}.steps[${String(r)}]`,o=de(e.id,`${n}.id`),i=ln(e.args,`${n}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${n}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!rr.includes(a))throw new TypeError(`${n}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!Ny.includes(d))throw new TypeError(`${n}.expected_accounting_mode is unsupported`);let l=d;if(l==="independent_transport"&&c!=="refusal")throw new TypeError(`${n} independent_transport accounting is supported only for refusal steps`);let u=ln(e.required_fields,`${n}.required_fields`);if(u.some(w=>w.split(".").some(z=>z.length===0)))throw new TypeError(`${n}.required_fields must contain dot-separated own-property paths`);let m=Ly(e.expected_field_values,`${n}.expected_field_values`),g=ht(e.expected_error_code,`${n}.expected_error_code`),h=ht(e.expected_refusal_surface,`${n}.expected_refusal_surface`),C=ht(e.recovery_for,`${n}.recovery_for`);return Dy(n,i,s,c,g,h),{id:o,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:l,required_fields:u,...m?{expected_field_values:m}:{},...g?{expected_error_code:g}:{},...h?{expected_refusal_surface:h}:{},...C?{recovery_for:C}:{}}}function Fy(e,t){if(!ve(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=de(e.id,`tasks[${String(t)}].id`),n=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 o=e.steps.map((s,a)=>$y(s,r,a)),i=new Map;for(let s of o){if(i.has(s.id))throw new TypeError(`tasks.${r} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(i.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);i.set(s.id,s)}if(o.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of o)if(s.expected_output_kind==="refusal"&&!o.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${r}.${s.id} refusal must have a later successful recovery_for step`);return{id:r,description:n,steps:o}}function _N(e){if(!ve(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==_t)throw new TypeError(`agent-task transcript corpus version must be ${String(_t)}`);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((n,o)=>Fy(n,o)),r=new Set;for(let n of t){if(r.has(n.id))throw new TypeError(`duplicate agent-task transcript id ${n.id}`);r.add(n.id)}return{version:_t,tasks:t}}import{createHash as un}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]="54a3448c-719c-5404-a9b9-c3072a2fdce2")}catch{}})();function pn(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function bN(e,t){let r=pn(t.migrationId,"migrationId"),n=pn(t.author,"author"),o=Date.parse(t.timestamp);if(!Number.isFinite(o))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(o).toISOString(),s=ze(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(m=>{let g=un("sha256").update(JSON.stringify([r,m.kind,m.source,m.target,m.createdAt??null,m.author??null,m.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:m,author:n,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=un("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(m=>typeof m=="string").map(m=>m.trim()).filter(Boolean)),u=c.filter(m=>!l.has(m.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(u),edge_count:c.length,skipped_existing_count:c.length-u.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as fn 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]="4f4e7daa-14aa-5dad-8a30-79a4d76159d4")}catch{}})();var le=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],gt={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"}},TN=Object.freeze(Object.keys(gt));function mn(e){if(Object.hasOwn(gt,e))return gt[e]}var jy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function ee(e,t){return e<t?-1:e>t?1:0}function Gy(e,t){let r=e[t],n=t+1,o="";for(;n<e.length&&e[n]!==r;)e[n]==="\\"?n+=2:(o+=e[n],n+=1);return e[n]===r&&(n+=1),{next:n,value:o}}function Uy(e){return e===void 0||e.kind==="punctuator"&&jy.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function By(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
29
- `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function qy(e,t,r){if(e[t]!=="/"||!Uy(r))return;let n=t+1,o=!1;for(;n<e.length;)if(e[n]==="\\")n+=2;else if(e[n]==="[")o=!0,n+=1;else if(e[n]==="]")o=!1,n+=1;else if(e[n]==="/"&&!o){for(n+=1;/[A-Za-z]/u.test(e.charAt(n));)n+=1;return n}else n+=1;return n}function zy(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let o=Gy(e,t);return r==="`"?{next:o.next}:{next:o.next,token:{kind:"string",value:o.value,offset:t+1}}}if(/[A-Za-z_$]/u.test(r)){let o=t+1;for(;/[A-Za-z0-9_$]/u.test(e[o]??"");)o+=1;return{next:o,token:{kind:"identifier",value:e.slice(t,o),offset:t}}}let n=e.startsWith("=>",t)?"=>":r;return{next:t+n.length,token:{kind:"punctuator",value:n,offset:t}}}function Vy(e){let t=[],r=0;for(;r<e.length;){let n=By(e,r);if(n!==void 0){r=n;continue}let o=qy(e,r,t.at(-1));if(o!==void 0){r=o;continue}let i=zy(e,r);i.token&&t.push(i.token),r=i.next}return t}var Hy=new Set(["object","block","pattern"]),Ky=new Set(["const","let","var"]),Wy=new Set(["}",")","]"]),Xy=new Set(["=","(","[",",",":","?","return"]);function Yy(e,t,r){if([...r].reverse().find(i=>Hy.has(i.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&Ky.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Xy.has(o.value)?"object":"block"}function Jy(e,t,r){let n=e[t];if(n.value==="{"){let a=Yy(e,t,r);return{kind:a,...a==="object"?{member_start:!0,candidates:[]}:{}}}if(n.value==="[")return{kind:"array"};if(n.value!=="(")return;let o=e[t-1],i=e[t-2];return{kind:"paren",...o?.value==="function"||i?.value==="function"?{parameter_list:!0}:{}}}function Zy(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 Qy(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function eb(e){let t=Vy(fn.stripTypeScriptTypes(e,{mode:"strip"})),r=[],n=[];for(let[o,i]of t.entries()){let s=n.at(-1),a=Zy(s,i,t[o+1]);a&&s.candidates.push(a);let c=Jy(t,o,n);if(c)n.push(c);else if(Wy.has(i.value)){let d=n.pop();d?.kind==="object"&&!Qy(t,o)&&r.push(...d.candidates)}else i.value===","&&s?.kind==="object"?s.member_start=!0:s?.kind==="object"&&i.value!==":"&&(s.member_start=!1)}return r}function tb(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
30
- `&&t.push(r+1);return t}function rb(e,t){let r=0,n=e.length;for(;r<n;){let o=Math.floor((r+n)/2);e[o]<=t?r=o+1:n=o}return r}function wN(e){let t=[],r=[];for(let o of[...e].sort((i,s)=>ee(i.path,s.path))){let i=tb(o.content),s;try{s=eb(o.content)}catch(a){r.push({kind:"invalid_source",subject:o.path,detail:`${o.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of s){let c=a.field,d=rb(i,a.offset),l=mn(c);l?t.push({path:o.path,line:d,field:c,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${o.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let n=Object.fromEntries(le.map(o=>[o,t.filter(i=>i.kind===o).length]));for(let o of le)n[o]===0&&r.push({kind:"missing_kind_producer",subject:o,detail:`No source producer emits the ${o} recovery-reference kind.`});return t.sort((o,i)=>o.path!==i.path?ee(o.path,i.path):o.line!==i.line?o.line-i.line:ee(o.field,i.field)),r.sort((o,i)=>o.subject!==i.subject?ee(o.subject,i.subject):ee(o.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:n,producers:t,findings:r}}function SN(e,t){let r=[],n=(o,i)=>{if(Array.isArray(o)){o.forEach((s,a)=>n(s,[...i,String(a)]));return}if(!(typeof o!="object"||o===null))for(let[s,a]of Object.entries(o).sort(([c],[d])=>ee(c,d))){let c=mn(s),d=c?.kind==="migration_hint"&&o.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,l=[a].flat();d!==void 0&&l.forEach((u,m)=>{let g="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,h=g&&typeof u=="object"&&u!==null&&!Array.isArray(u)?u[g]:u;if(typeof h!="string"||h.trim().length===0)return;let C=[...i,s,String(m)].map(w=>encodeURIComponent(w)).join("/");r.push({id:`${e}:${d.kind}:${C}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:h})}),n(a,[...i,s])}};return n(t,[]),r}function EN(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),n=[],o=new Map;for(let s of t){if(o.has(s.probe_id)){n.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}o.set(s.probe_id,s)}let i=new Set(r.map(({state:s})=>s.probe_id));for(let{contract:s,state:a}of r){let c=o.get(a.probe_id);if(!c){n.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&n.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&n.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||n.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let s of t)i.has(s.probe_id)||n.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return n.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:n.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:n}}function AN(e,t){let r=[],n=new Set,o=new Set;for(let c of e){if(n.has(c.id)){o.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}n.add(c.id)}let i=new Map;for(let c of t){if(i.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}i.set(c.id,c),n.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(o.has(c.id))continue;let d=i.get(c.id);d?d.reachable?d.semantics!==c.semantics&&r.push({kind:"wrong_semantics",reference_id:c.id,detail:`Recovery reference ${c.value} promised ${c.semantics}; proof demonstrated ${d.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:c.id,detail:`Recovery reference ${c.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:c.id,detail:`No reachability proof was recorded for ${c.kind} ${c.value}.`})}let s=le.map(c=>{let d=e.filter(u=>u.kind===c),l=d.filter(u=>!o.has(u.id)).map(u=>i.get(u.id)).filter(u=>u!==void 0);return{kind:c,declared:d.length,observed:l.length,passed:d.filter(u=>{let m=i.get(u.id);return!o.has(u.id)&&m?.reachable===!0&&m.semantics===u.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.passed,0);return{ok:r.length===0,declared_reference_count:e.length,observed_reference_count:t.length,pass_fraction:n.size===0?1:a/n.size,coverage_by_kind:s,findings:r}}function nb(e,t){let r=new Map(le.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let n=le.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),o=n.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&o.length===0,source_producer_count:e.producer_count,runtime_value_count:n.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:n,missing_runtime_kinds:o}}var xN=nb;(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]="a1efaf49-c6ca-53dd-8fad-eb2540c20cc8")}catch{}})();var RN=16,ob=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"]),_n=18,hn=Object.freeze([...ob,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function IN(e,t=_n){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function vN(e,t=hn){let r=new Set(e.rows.filter(({disposition:o})=>o==="executable").map(({canonical_code:o})=>o)),n=t.filter(o=>!r.has(o));return{ok:n.length===0,required_canonical_codes:[...t],missing_required_canonical_codes:n}}function yt(e,t){let r=e.get(t);if(r)return r;let n={kinds:new Set,probeIds:new Set};return e.set(t,n),n}function PN(e,t,r){let n=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),o=new Map,i=0,s=0;for(let l of e){let u=yt(o,l.canonical_code??l.code);for(let m of l.owned_states??[])u.kinds.add("owned_state"),u.probeIds.add(m.probe_id)}for(let l of t){let u=n.get(l.error_code);if(u===void 0)continue;i+=1;let m=yt(o,u);m.kinds.add("closed_domain"),m.probeIds.add(l.probe_id)}for(let l of r){let u=n.get(l.error_code);if(u===void 0)continue;s+=1;let m=yt(o,u);m.kinds.add("grammar"),m.probeIds.add(l.probe_id)}let a=e.map(l=>{let u=l.canonical_code??l.code,m=o.get(u),g=[...m.probeIds].sort();return{code:l.code,canonical_code:u,disposition:g.length>0?"executable":"uncovered",evidence_kinds:[...m.kinds].sort(),probe_ids:g}}).sort((l,u)=>l.code<u.code?-1:1),c=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function kN(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: ${_n}`,`- Required executable canonical codes: ${hn.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(`
31
- `)}(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]="0ec8c375-e58e-5ce4-b0aa-8a8a4dfa0778")}catch{}})();function ib(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 sb(e){return[e.exit_code!==L.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 ${L.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."},...ib(e)]}function LN(e){let t=[],r=new Set,n=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let o of e){if(r.has(o.probe_id)){t.push({code:"duplicate_probe",probe_id:o.probe_id,detail:`${o.probe_id} was supplied more than once.`});continue}r.add(o.probe_id);let i=t.length;for(let s of sb(o))s!==void 0&&t.push(s);t.length===i&&(n+=1)}return t.sort((o,i)=>o.probe_id!==i.probe_id?o.probe_id.localeCompare(i.probe_id):o.code.localeCompare(i.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:n,closure_fraction:r.size===0?0:n/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]="2e90ea29-2708-5af8-b390-599be97718e7")}catch{}})();var gn="not-a-declared-action";function ab(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 bt(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function qN(e=Be.filter(t=>Mt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){return e.flatMap(t=>t.slots.flatMap((r,n)=>{if(!r.required)return[];let o=t.command.split(" "),i=te(t.command).flatMap(a=>a.required?[a.flag,...a.value_name?["example"]:[]]:[]),s=Ue.some(a=>a.command===t.command);return[{probe_id:`required-argument-${bt(t.command)}-${bt(r.name)}`,command:t.command,refusal_args:[...o,...t.slots.slice(0,n).map(a=>ab(t.command,a)),...i],recovery_args:[...o,"--help"],error_code:s&&!t.command.startsWith("assurance ")?"invalid_argument_value":/^extension (?:activate|adopt|deactivate|uninstall)$/u.test(t.command)?"missing_lifecycle_target":"missing_required_argument",missing_argument:r.name,missing_argument_index:n}]})).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function cb(e){switch(e){case"assurance":case"workspace snapshot":return Ue.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return je;case"merge":return Ge;case"plan":return He;case"profile":return Ke;case"schema":return Lt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function zN(e=Be){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-${bt(t)}`,command:t,refusal_args:[...r,gn],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:gn,allowed_values:[...cb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function db(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((n,o)=>n===r[o])}function lb(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&&!db(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 VN(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),n=new Map(t.map(s=>[s.probe_id,s])),o=[...e.flatMap(s=>lb(s,n.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];o.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(o.map(({probe_id:s})=>s));return{ok:o.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).length,findings:o}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="941a11a9-f756-56b3-9dc1-8afd78bc9328")}catch{}})();var Ct=[{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 KN(){return Ct.map(e=>({...e}))}function ub(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 n=t.suggested_retry_args.indexOf("init"),o=n===0||n===2&&t.suggested_retry_args[0]==="--pm-path"&&t.suggested_retry_args[1]?.length>0;return e.recovery_kind==="initialize"&&!o&&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 WN(e){let t=new Map(e.map(o=>[o.probe_id,o])),r=[],n=0;for(let o of Ct){let i=t.get(o.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:o.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=ub(o,i);r.push(...s),s.length===0&&(n+=1)}return r.sort((o,i)=>o.probe_id.localeCompare(i.probe_id)||o.code.localeCompare(i.code)),{ok:r.length===0,probe_count:Ct.length,closed_probe_count:n,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]="3fdfd4c8-a7ef-5469-acf5-bc2577fd141a")}catch{}})();var Pe,pb=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 fb(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=pb[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(e)?"linked-file-path":["comments","notes","learnings"].includes(e)?"entry-file-input":"plan-definition-file"}function ke(){if(Pe!==void 0)return Pe;let t=re.filter(({command:i})=>qe(i)).flatMap(({command:i,family:s})=>tr(i,te(i)).map(a=>({command:i,family:s,concept:fb(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),n=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),o=new Map;for(let i of n){let s=o.get(i.concept)??new Set;s.add(i.value_kind),o.set(i.concept,s)}return Pe=Object.freeze(n.map(i=>Object.freeze({...i,concept:o.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),Pe}function QN(){return Object.freeze(ke().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var yn=Object.freeze({init:30,config:36,extension:53,package:54,packages:54,install:26,upgrade:29,create:100,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:37,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:35,events:33,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:27,schema:40,profile:22,activity:35,restore:23,update:105,"update-many":146,close:31,"close-many":72,delete:24,append:25,comments:31,notes:35,learnings:31,files:39,docs:30,deps:32,plan:109,test:53,"test-all":40,telemetry:21,stats:29,health:36,validate:45,assurance:30,gc:22,workspace:23,contracts:29,claim:38,release:23,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":25});function bn(){let e=new Map(Object.keys(yn).map(t=>[t,0]));for(let{command:t}of ke())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(yn).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function mb(e,t,r){for(let n of e)for(let o of n.aliases){let i=t.get(`${n.command}:${o}`);i===void 0||i.flag===n.flag||r.push({code:"alias_collision",command:n.command,detail:`${o} aliases ${n.flag} but is canonical for ${i.flag}.`})}}function _b(e,t,r){let n=new Set(t.map(({command:o})=>o));for(let o of e.keys())n.has(o)||r.push({code:"missing_budget",command:o,detail:`${o} has canonical flags but no persisted budget.`});for(let o of t){let i=e.get(o.command)??0;i===0&&r.push({code:"stale_budget",command:o.command,detail:`${o.command} has a persisted budget but no canonical flags.`}),!(i<=o.maximum)&&r.push({code:"budget_exceeded",command:o.command,detail:`${i} canonical flags exceed the ratcheted maximum ${o.maximum}.`})}}function hb(e,t,r){let n=new Map(e.map(o=>[`${o.command}:${o.flag}`,o]));for(let o of t){let i=`${o.command}:${o.canonical_flag}`,s=n.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:o.command,detail:`${o.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of o.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:o.command,detail:`${c} no longer resolves to ${o.canonical_flag}.`})}}function e0(e=ke(),t=bn(),r=[]){let n=[],o=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;o.has(d)?n.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):o.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let l=i.get(c.concept);l!==void 0&&l!==c.value_kind?n.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${l} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let u=s.get(c.concept);u!==void 0&&u!==c.flag?n.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${u} and ${c.flag}.`}):s.set(c.concept,c.flag)}return mb(e,o,n),_b(a,t,n),hb(e,r,n),n.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:n.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:n}}function t0(){let e=ke(),t=bn(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:i}of e)r.set(o,i);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:i,maximum:s})=>{let a=r.get(o);return`| \`${o}\` | ${a} | ${i} | ${s} |`}),""].join(`
32
- `)}(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]="e37a2da9-966f-5044-bc5e-d27ddb07e65b")}catch{}})();function n0(e){return e}function o0(e){return e}function i0(e){return e}function s0(e){return e}function a0(e){return e}function c0(e){return e}function d0(e){return e}function l0(e){return e}function u0(e){return e}function p0(e){return e}function f0(e){return e}function m0(e){return e}function _0(e){return e}function h0(e){return{handled:!0,result:e}}function g0(){return{handled:!1}}function y0(e){return e}function b0(e){return e}function C0(e){return e}function T0(e){return e}function w0(e){return e}function S0(e){return e}function E0(e){return e}function A0(e){return e}function x0(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]="5bbfab95-010d-5507-ab01-f8f43943d295")}catch{}})();function gb(e={},t={}){return new me(t).extension(void 0,{...e,migrate:!0})}function yb(e={},t={}){return new me(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]="bca95ba2-258c-5be2-8428-dcb8dbc87ef0")}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]="5e2aaa83-a109-5e44-b9b3-316501ffadf4")}catch{}})();import{createHash as Tn,createHmac as bb,randomBytes as Cb,timingSafeEqual as Tb}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]="4853ebbf-f28a-55f1-b306-aa75cb9355ae")}catch{}})();var hL="dev.unbrained.pm/progressive-tool-discovery",gL=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),wb=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),q=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),Sb=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),wn={core:0,standard:1,full:2,internal:3},Sn=Object.freeze(["core","standard","full"]),Eb=new Set(["core","standard","full","custom"]),En=new Set(re.map(({family:e})=>e)),Ab=Cb(32);function Ne(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](),n=0;for(let o=r.next();!o.done;o=r.next())if(n+=1,n>4096)throw new b(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function An(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 xn(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 On(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function Rn(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function xb(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 yL(e){if(Rn(e),e.family!==void 0&&(typeof e.family!="string"||!En.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"||!Sn.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Ne(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:An(e.limit)}:{},...e.cursor!==void 0?{cursor:Ne(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:On(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:xn(e.outputBudget)}:{}}}function Ob(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 Rb(e,t){let r=ue(e);if(r.length===0)return 0;let n=new Set(ue(t)),o=r.filter(s=>n.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,o/r.length+i)}function Ib(e,t){let r=ue(e);if(r.length===0)return 0;let n=t.toLowerCase(),o=ue(t),i=r.filter(a=>o.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=n.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function Cn(e){return Tn("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function In(e,t,r){return bb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function vb(e,t,r){let n={version:1,offset:t,signature:In(e,t,r)};return Buffer.from(JSON.stringify(n),"utf8").toString("base64url")}function Pb(e,t,r,n){if(e===void 0)return 0;try{let o=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));if(o.version!==1||!Number.isInteger(o.offset)||(o.offset??-1)<0||Number(o.offset)>r||typeof o.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(In(t,o.offset,n),"base64url"),s=Buffer.from(o.signature,"base64url");if(s.length!==i.length||!Tb(s,i))throw new Error("cursor signature does not match the request");return o.offset}catch(o){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(o)})}}function Tt(e,t,r){return{value:Ob(e),weight:t,available:r!=="unavailable",source:r}}function Me(e,t,r){return Tt(e??t,r,e===void 0?"computed":"host")}function kb(e,t,r){let n=Object.hasOwn(fe,e.name)?fe[e.name]:"help",o=We(n),i=`${e.name} ${e.description} ${n} ${o}`,s=Rb(t,i),a=new Set(ue(t)),c={lexical:Tt(s,q.lexical,"computed"),semantic:Me(e.signals?.semantic,Ib(t,i),q.semantic),graph:Me(e.signals?.graph,a.has(o)||a.has(n)?1:0,q.graph),permission:Tt(1,q.permission,"authorization"),freshness:Me(e.signals?.freshness,1,q.freshness),usage:Me(e.signals?.usage,wb.includes(e.name)?1:0,q.usage)},d=Object.values(c).reduce((l,u)=>l+u.value*u.weight,0);return{name:e.name,description:e.description,command:n,tier:Xe(n),family:o,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function Mb(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"||!Sn.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"||!En.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"||!Eb.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function Nb(e){let r=Ne(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Ne(e.cursor===void 0?"":e.cursor,"cursor");let n=An(e.limit===void 0?10:e.limit),o=xn(e.outputBudget===void 0?1200:e.outputBudget);return Mb(e),{query:r,includeSchema:On(e.includeSchema),limit:n,budget:o,maximumTier:wn[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function vn(e,t,r){let n=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),o={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...o,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+n)/4);if(c===i)break;i=c}return i}function Lb(e,t,r){return e.filter(n=>n.authorized!==!1).map(n=>kb(n,r.query,r.includeSchema)).filter(n=>n.tier!=="internal"&&wn[n.tier]<=r.maximumTier&&(t.family===void 0||n.family===t.family)).sort((n,o)=>o.score-n.score||(n.name<o.name?-1:n.name>o.name?1:0))}function Db(e,t,r){if(t==="unbounded")return[...e];let n=[],o=0;for(let[i,s]of e.entries()){let a=o+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(vn(r(i+1),t,a)>t)break;n.push(s),o=a}return n}function bL(e,t={}){xb(e),Rn(t);let r=Nb(t),n=t.cursorIntegrityKey??Ab,o=Lb(e,t,r),i=Cn({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:o}),s=Pb(t.cursor,i,o.length,n),a=o.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<o.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={result_type:"pm_tool_discovery",contract_version:1,query:r.query,profile:r.profile,total:o.length,ranking_policy:{version:1,formula:"weighted_sum_then_name",weights:q},cache:{key:Cn({fingerprint:i,cursorIntegrityKey:Tn("sha256").update(n).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:Sb}},l=(h,C=h.length)=>{let w=s+C,z=w<o.length,I=[...c];return C<a.length&&I.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...h],returned:C,has_more:z,...z?{next_cursor:vb(i,w,n)}:{},omission_receipt:{has_omissions:I.length>0,omitted:I}}},u=h=>{let C=l(h),w=vn(C,r.budget);return{...C,token_cost:{estimated_tokens:w,budget:r.budget,within_budget:r.budget==="unbounded"||w<=r.budget}}},m=Db(a,r.budget,h=>l([],h)),g=u(m);if(a.length>0&&m.length===0){let h=u([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 ${h}.`,64,{required:String(h)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}(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]="affe6060-5129-5914-9d4e-46c300d49080")}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]="ea74fa78-184f-55e7-8c8e-fb912f4d26d8")}catch{}})();export{rR as ACTIONABILITY_ORDERING_KINDS,Cs as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,_c as ACTIVITY_FLAG_CONTRACTS,So as AGENT_PROVENANCE_DIMENSIONS,Qs as AGGREGATE_FLAG_CONTRACTS,ja as APPEND_FLAG_CONTRACTS,vR as ASSURANCE_ACTIONS,PR as ASSURANCE_DECLARATION_KINDS,Ix as ASSURANCE_DOCUMENT_VERSION,ic as ASSURANCE_FLAG_CONTRACTS,vx as ASSURANCE_GATE_TRIGGERS,Px as ASSURANCE_MEASUREMENT_SOURCE_KINDS,Wx as ASSURANCE_PRESET_IDS,Ax as AssuranceEvaluationRefusalError,Ex as AssuranceMutationRefusalError,xx as AssuranceSourceResolutionError,co as BASELINE_ITEM_FORMAT_VERSION,py as BOUNDARY_FIXTURE_CAPTURE_SOURCES,_R as BRIEF_LIST_FIELDS,Ao as BUILTIN_AGENT_PROVENANCE_ADAPTERS,Y as BUILTIN_CORPUS_SHAPES,Eo as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,Fn as BUILTIN_ITEM_TYPE_VALUES,Vt as BUILTIN_PROFILES,SC as BUILTIN_RELATIONSHIP_KINDS,gs as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,mc as CALENDAR_FLAG_CONTRACTS,Ga as CLAIM_FLAG_CONTRACTS,Mc as CLOSE_ACTION_OPTION_KEYS,$a as CLOSE_FLAG_CONTRACTS,Fa as CLOSE_MANY_FLAG_CONTRACTS,Ha as CLOSE_TASK_FLAG_CONTRACTS,ea as COMMENTS_FLAG_CONTRACTS,pC as COMMON_MUTATION_COMMAND_OPTION_KEYS,Oc as COMPLETION_FLAG_CONTRACTS,zn as CONFIDENCE_TEXT_VALUES,_a as CONFIG_FLAG_CONTRACTS,ys as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,qR as CONTEXT_EVALUATION_METRIC_NAMES,gc as CONTEXT_FLAG_CONTRACTS,Gt as CONTEXT_OUTPUT_VALUES,WR as CONTEXT_PACKING_PROFILES,LR as CONTEXT_RECENCY_EPOCH,jR as CONTEXT_RELEVANCE_SERVICE,$R as CONTEXT_RELEVANCE_SIGNAL_NAMES,JR as CONTEXT_SIGNAL_SET_VERSION,YR as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,ZR as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,Ww as CONTEXT_USAGE_LIMITS,xc as CONTRACTS_FLAG_CONTRACTS,lc as COPY_FLAG_CONTRACTS,Es as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,xs as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,As as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,Ub as CREATE_DIRECT_CLOSE_REASON_DEFAULT,sc as CREATE_FLAG_CONTRACTS,CS as CURRENT_HISTORY_ITEM_HASH_VERSION,wS as CURRENT_HISTORY_RECORD_HASH_VERSION,lo as CURRENT_ITEM_FORMAT_VERSION,rI as ContextSignalStore,Xw as ContextUsageValidationError,gx as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,MI as DEFAULT_CHILD_SAMPLE_LIMIT,mR as DEFAULT_COMPACT_LIST_FIELDS,yE as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Wp as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,gI as DEFAULT_TERMINAL_TRANSITION_POLICY,sI as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,EA as DEFECT_ESCAPE_CLASSES,AA as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ba as DELETE_FLAG_CONTRACTS,Un as DEPENDENCY_KIND_VALUES,Cc as DEPS_FLAG_CONTRACTS,oa as DOCS_FLAG_CONTRACTS,rc as DUPLICATES_FLAG_CONTRACTS,GO as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,wc as EVAL_FLAG_CONTRACTS,zp as EVAL_QUERY_SET_CONTRACT,Vp as EVAL_QUERY_SET_EXAMPLE,qp as EVAL_QUERY_SET_SCHEMA_ID,hc as EVENTS_FLAG_CONTRACTS,Wa as EVENT_FLAG_CONTRACTS,Ho as EXECUTABLE_COMMAND_ALIASES,L as EXIT_CODE,xa as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Aa as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Ma as EXTENSION_ADOPT_FLAG_CONTRACTS,WA as EXTENSION_CAPABILITIES,jb as EXTENSION_CAPABILITY_CONTRACT,$b as EXTENSION_CAPABILITY_CONTRACT_VERSION,Fb as EXTENSION_CAPABILITY_LEGACY_ALIASES,Qn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,ka as EXTENSION_CATALOG_FLAG_CONTRACTS,Oa as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Ea as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Pa as EXTENSION_DOCTOR_FLAG_CONTRACTS,Sa as EXTENSION_EXPLORE_FLAG_CONTRACTS,ha as EXTENSION_FLAG_CONTRACTS,ya as EXTENSION_INIT_FLAG_CONTRACTS,Ta as EXTENSION_INSTALL_FLAG_CONTRACTS,Ia as EXTENSION_MANAGE_FLAG_CONTRACTS,Ra as EXTENSION_MIGRATE_FLAG_CONTRACTS,XA as EXTENSION_POLICY_MODES,YA as EXTENSION_POLICY_SURFACES,va as EXTENSION_RELOAD_FLAG_CONTRACTS,ZA as EXTENSION_SANDBOX_PROFILES,ga as EXTENSION_SCOPE_FLAG_CONTRACTS,JA as EXTENSION_TRUST_MODES,wa as EXTENSION_UNINSTALL_FLAG_CONTRACTS,rO as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,eO as EXTERNAL_DEPENDENCY_SOURCE_KIND,tO as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,na as FILES_FLAG_CONTRACTS,uc as FOCUS_FLAG_CONTRACTS,ec as GC_FLAG_CONTRACTS,yR as GET_DEPTH_VALUES,yc as GET_FLAG_CONTRACTS,Js as GLOBAL_FLAG_CONTRACTS,Md as GRAPH_DURABLE_CACHE_MIN_ITEMS,kd as GRAPH_DURABLE_CACHE_VERSION,Tc as GRAPH_FLAG_CONTRACTS,je as GRAPH_SUBCOMMAND_VALUES,bc as GUIDE_FLAG_CONTRACTS,nc as HEALTH_FLAG_CONTRACTS,da as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,lO as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,pv as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,la as HISTORY_COMPACT_FLAG_CONTRACTS,Fo as HISTORY_EVENT_CLASSIFICATION_VERSION,ia as HISTORY_FLAG_CONTRACTS,Re as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,aa as HISTORY_REDACT_FLAG_CONTRACTS,ca as HISTORY_REPAIR_FLAG_CONTRACTS,$p as INIT_AGENT_GUIDANCE_MODE_VALUES,ma as INIT_FLAG_CONTRACTS,Na as INSTALL_FLAG_CONTRACTS,qn as ISSUE_SEVERITY_VALUES,cc as ITEM_COMPLETE_FLAG_CONTRACTS,PO as ITEM_LATEST_TIMESTAMP_FIELDS,Gb as ITEM_METADATA_KEY_ORDER,ac as ITEM_MUTATE_FLAG_CONTRACTS,dc as ITEM_REOPEN_FLAG_CONTRACTS,EO as ITEM_SCALAR_MISSING_VALUE,jn as ITEM_TYPE_VALUES,vO as ITEM_UNION_COLLECTION_FIELDS,tI as JsonFileContextSignalStoreAdapter,ra as LEARNINGS_FLAG_CONTRACTS,lp as LINKED_TEST_ENV_NAME_PATTERN,up as LINKED_TEST_PM_CONTEXT_MODE_VALUES,dp as LINKED_TEST_PROTECTED_ENV_KEYS,pp as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,_s as LIST_COMMANDER_STRING_OPTION_CONTRACTS,hR as LIST_COMMAND_DEFAULT_PROJECTIONS,ex as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,Zs as LIST_FILTER_FLAG_CONTRACTS,wR as LIST_SORT_FIELDS,SR as LIST_SORT_ORDER_VALUES,jo as MAINTENANCE_HISTORY_OPERATIONS,kI as MAX_CHILD_PROJECTION_ITEMS,Ka as MEET_FLAG_CONTRACTS,ev as MERGE_DRIVER_ARTIFACT_VALUES,sa as MERGE_FLAG_CONTRACTS,Ge as MERGE_SUBCOMMAND_VALUES,nv as MUTATION_EVENT_WIRE_BUDGET,ae as MemoryRelationshipGraphAdapter,bs as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Ec as NEXT_FLAG_CONTRACTS,zu as NEXT_OUTPUT_VALUES,ta as NOTES_FLAG_CONTRACTS,ba as PACKAGE_FLAG_CONTRACTS,Ca as PACKAGE_INIT_FLAG_CONTRACTS,Va as PAUSE_TASK_FLAG_CONTRACTS,kc as PLAN_CREATE_METADATA_PARAMETER_KEYS,fa as PLAN_FLAG_CONTRACTS,Op as PLAN_SHOW_DEPTH_VALUES,He as PLAN_SUBCOMMANDS,Rp as PLAN_TEMPLATE_NAMES,Ny as PM_AGENT_TASK_ACCOUNTING_MODES,_t as PM_AGENT_TASK_TRANSCRIPT_VERSION,Uc as PM_CLI_EXPECTED_ERROR_NAME,hA as PM_CLI_GRAMMAR_CONTRACT,uA as PM_CLI_GRAMMAR_NOUNS,ii as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,pA as PM_CLI_SHARED_VERBS,Vo as PM_COMMAND_ALIAS_CONTRACTS,re as PM_COMMAND_CAPABILITY_CONTRACTS,Mt as PM_COMMAND_DESTINATION_CONTRACTS,SI as PM_COMMAND_EXIT_CONTRACTS,wI as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Si as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,Ev as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,Be as PM_COMMAND_POSITIONAL_CONTRACTS,Sf as PM_COMMAND_VISIBILITY_CONTRACTS,rx as PM_COMPLETE_LIST_FINDING_CODES,cx as PM_CONTEXT_INTENTS_FILE,iS as PM_CONTEXT_INTENT_CONTRACTS,ti as PM_CORE_COMMAND_NAMES,j as PM_CORPUS_SHAPE_SCHEMA,ai as PM_DEPRECATED_TOOL_ACTIONS,yi as PM_DIAGNOSTIC_DEGRADATION_STEPS,bi as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,gi as PM_DIAGNOSTIC_OUTPUT_CLASSES,ci as PM_DISCOVERABLE_TOOL_ACTIONS,Yr as PM_EPISODE_SCHEMA,wv as PM_ERROR_CODE_CATALOG,yv as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,rn as PM_EXACT_COVERAGE_METRICS,Xo as PM_EXTENSION_CAPABILITY_CONTRACTS,ri as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,Jo as PM_EXTENSION_POLICY_MODE_CONTRACTS,ei as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,Qo as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Yo as PM_EXTENSION_SERVICE_NAME_CONTRACTS,Zo as PM_EXTENSION_TRUST_MODE_CONTRACTS,gO as PM_GITATTRIBUTES_END,hO as PM_GITATTRIBUTES_START,bO as PM_GITATTRIBUTES_V2_END,yO as PM_GITATTRIBUTES_V2_START,Kc as PM_GITIGNORE_END,Hc as PM_GITIGNORE_START,oi as PM_ITEM_ACTION_SUBCOMMANDS,it as PM_MCP_APPS_EXTENSION,Mr as PM_MCP_APPS_SERVER_CAPABILITY,we as PM_MCP_APPS_SPEC_VERSION,Dr as PM_MCP_APP_CONTRACTS,Lr as PM_MCP_APP_MIME_TYPE,wb as PM_MCP_ENTRY_TOOL_NAMES,f as PM_MCP_ERROR_CODES,xk as PM_MCP_HTTP_PROTOCOL_VERSION,Nh as PM_MCP_INPUT_REQUEST_METHODS,YP as PM_MCP_LEGACY_PROTOCOL_VERSIONS,O as PM_MCP_META_KEYS,hL as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,gL as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,Rf as PM_MCP_PROMPT_CONTRACTS,H as PM_MCP_PROTOCOL_VERSION,Of as PM_MCP_RESOURCE_CONTRACTS,at as PM_MCP_SKILLS_DRAFT_REVISION,$r as PM_MCP_SKILLS_EXTENSION,Gg as PM_MCP_SKILLS_SERVER_CAPABILITY,P as PM_MCP_SKILL_LIMITS,Ce as PM_MCP_SUBSCRIPTION_ID_META_KEY,Ye as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,yk as PM_MCP_TASKS_EXTENSION,Vh as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,YT as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,Ji as PM_MUTATION_ACTION_CONTRACTS,Wr as PM_OBSERVATION_SCHEMA,hi as PM_OUTPUT_BUDGET_CLASSES,_i as PM_OUTPUT_DEGRADATION_STEPS,rr as PM_OUTPUT_ENVELOPE_KINDS,$t as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,ni as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Dt as PM_PACKAGE_RESOURCE_KINDS,Ue as PM_POSITIONAL_ACTION_CONTRACTS,Gc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Fc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,Dw as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,Sw as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,Mw as PM_READ_OUTPUT_DIMENSIONS,Lw as PM_READ_OUTPUT_OPTION_FLAGS,Rw as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,Ow as PM_READ_OUTPUT_SESSION_MIN_TOKENS,Nw as PM_READ_OUTPUT_SURFACES,$w as PM_READ_OUTPUT_SURFACE_CONTRACTS,XT as PM_READ_ROW_CONTRACTS,WT as PM_READ_ROW_JQ_SELECTOR,TN as PM_RECOVERY_REFERENCE_FIELDS,le as PM_RECOVERY_REFERENCE_KINDS,ob as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,hn as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,RN as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,_n as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,us as PM_REPRODUCIBLE_PROCESS_ENV,EI as PM_SUCCESS_EXIT_CODES,si as PM_TOOL_ACTIONS,Nc as PM_TOOL_ACTION_PARAMETER_CONTRACTS,jc as PM_TOOL_PARAMETERS_SCHEMA,$c as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Dc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,vc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Xr as PM_VERDICT_SCHEMA,Hr as PM_WORKSPACE_RECIPE_SCHEMA,pa as PROFILE_FLAG_CONTRACTS,Zt as PROFILE_LINT_CODES,Jt as PROFILE_LINT_DIMENSIONS,zt as PROFILE_NAMES,Ke as PROFILE_SUBCOMMANDS,b as PmCliError,me as PmClient,nx as PmCompleteListValidationError,y as PmMcpAuthorizationError,sr as PmMcpInputRequiredError,Rr as PmMcpIssuerCredentialStore,p as PmMcpProtocolError,ar as PmMcpRequestStateReplayGuard,qr as PmMcpSkillRegistry,yr as PmMcpSubscriptionRegistry,nt as PmMcpTaskStore,pw as QUERY_CURSOR_CONTRACT,Da as REINDEX_FLAG_CONTRACTS,fE as REINDEX_LOCK_ID,mt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,qa as RELEASE_FLAG_CONTRACTS,Xa as REMIND_FLAG_CONTRACTS,It as RESERVED_ITEM_FIELD_NAMES,Ua as RESTORE_FLAG_CONTRACTS,Bn as RISK_VALUES,GA as RelationshipEventLog,UA as RelationshipEventStore,V as RelationshipGraph,$e as RelationshipKindRegistry,ua as SCHEMA_FLAG_CONTRACTS,hs as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,tx as SEARCH_EXTENSION_FLAG_DEFINITIONS,Ac as SEARCH_FLAG_CONTRACTS,xu as SEMANTIC_ATTRIBUTION_LIMITS,qb as SETTINGS_DEFAULTS,Qp as SNAPSHOT_SCHEMA,fO as SOURCE_CONTEXT_ACCESS_ENV,mO as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,za as START_TASK_FLAG_CONTRACTS,tc as STATS_FLAG_CONTRACTS,Gn as STATUS_VALUES,Ys as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Go as SUBSTANTIVE_HISTORY_OPERATIONS,TS as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,SS as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,sC as SUPPRESS_HOST_OUTPUT_MARKER,Za as TELEMETRY_FLAG_CONTRACTS,Xf as TELEMETRY_SUBCOMMANDS,Ja as TEST_ALL_FLAG_CONTRACTS,Ya as TEST_FLAG_CONTRACTS,Qa as TEST_RUNS_FLAG_CONTRACTS,zf as TEST_RUN_MEASUREMENT_LIMIT,zs as TOOL_ACTIVITY_OPTION_CONTRACTS,ks as TOOL_AGGREGATE_OPTION_CONTRACTS,Gs as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,qs as TOOL_CALENDAR_OPTION_CONTRACTS,Bs as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Vs as TOOL_CONTEXT_OPTION_CONTRACTS,$s as TOOL_CREATE_OPTION_CONTRACTS,Ds as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Hs as TOOL_DEPS_OPTION_CONTRACTS,Ks as TOOL_GRAPH_OPTION_CONTRACTS,Ps as TOOL_LIST_FILTER_OPTION_CONTRACTS,Ms as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Ls as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Ns as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Us as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,js as TOOL_UPDATE_OPTION_CONTRACTS,Fs as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,Bb as TYPE_TO_FOLDER,oC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Os as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Is as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Rs as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,pc as UPDATE_FLAG_CONTRACTS,fc as UPDATE_MANY_FLAG_CONTRACTS,La as UPGRADE_FLAG_CONTRACTS,oc as VALIDATE_FLAG_CONTRACTS,Sc as WORKSPACE_FLAG_CONTRACTS,Pi as WORKSPACE_HISTORY_ID,ef as WORKSPACE_SNAPSHOT_ACTIONS,ld as WorkspaceGraphCache,HA as WorkspaceTransactionInterruptedError,zc as _testOnly,NR as _testOnlyAggregateCommand,Dp as _testOnlyConfigCommand,$I as _testOnlyGetCommand,El as _testOnlyHealthCommand,Up as _testOnlyInit,Fp as _testOnlyInitAgentGuidance,Zv as _testOnlyItemTransaction,av as _testOnlyMutationEvents,mI as _testOnlyNextCommand,QI as _testOnlySearchCommand,II as _testOnlySimilarity,df as _testOnlyTemplates,nu as _testOnlyValidateCommand,lv as _testOnlyWorkspacePosition,Zx as acceptAssuranceProposals,tu as acknowledgeLinkedTests,Qd as acknowledgeUnknownAuthorHistoryEvents,Zd as acknowledgeUnknownAuthorHistoryEventsFromTransport,bE as acquireItemMetadataDerivedIndexLock,Fe as acquireLock,lP as activateExtensionForTest,FC as activateExtensions,wo as agentSessionEnvironment,Vm as aggregate,Mf as analyzeAgentProvenanceDescriptorCoverage,OA as analyzeDefectChangeRisk,IR as analyzeDefectRecurrenceCoverage,sp as analyzeDuplicateItems,qA as analyzeGraphImpact,ed as analyzeHierarchyIntegrity,zA as analyzeKnowledgeGraph,xI as analyzePmCommandExitConformance,di as analyzePmToolActionParity,KO as analyzeReconciliationDiscard,BA as analyzeRelationshipExecution,Ad as analyzeRelationshipSchedule,gh as analyzeSdkActionCoverage,Nt as analyzeSdkCliParameterCompleteness,n_ as append,vi as appendHistoryEntry,Li as appendWorkspaceAuditEvent,Ni as appendWorkspaceHistoryChange,mT as applyAcceptanceCriteriaMutations,Yx as applyAssurancePreset,wh as applyBootstrapPagerPolicy,lS as applyContextIntentProjection,qu as applyContextTagProjection,ER as applyFilterValueEcho,MA as applyHistoryPatch,Ih as applyInvocationAuthorOverride,vl as applyPathMigrations,Vw as applyReadOutputDimensions,Uw as applyReadOutputIncludeModes,vw as applyReadOutputSessionReferences,lT as applyRegisteredItemFieldDefaultsAndValidation,Nl as applyStandaloneNote,yl as applyStoredExtensionMigrationState,hT as applyTagRemovals,TI as applyTerminalOrderingPolicy,Ll as artifactKey,Wb as asRecordClone,Kb as asRecordOrNull,ze as assembleWorkspaceRelationshipGraph,ax as assertCompleteListResult,zP as assertExtensionBlueprint,qP as assertExtensionCapabilityUsage,AP as assertExtensionDeactivated,KP as assertExtensionManifestCompatible,HP as assertExtensionManifestMatchesBlueprint,WP as assertExtensionPreflight,nd as assertHierarchyMutationAllowed,fv as assertHistoryCompactTarget,XO as assertHistoryRepairTarget,Ki as assertInitializedTracker,Pl as assertLinkedArtifactMutationIsUnambiguous,ZP as assertMcpClientCapabilities,JP as assertMcpProtocolHeader,My as assertMemoryRelationshipGraphAdapterConformance,bT as assertNoUnknownCsvKeys,xP as assertPackageManifest,XS as assertParentReferenceIsNotSelf,rM as assertPmMcpSkillsCapability,VP as assertProjectProfile,BM as assertProjectRuntimeCompatibility,JT as assertProjectionModeChoice,Hi as assertReadableTrackerRoot,OP as assertRegisteredCommandContract,$P as assertRegisteredCommandOverride,MP as assertRegisteredExporter,RP as assertRegisteredFlags,IP as assertRegisteredHook,kP as assertRegisteredImporter,NP as assertRegisteredItemField,LP as assertRegisteredItemType,BP as assertRegisteredMigration,FP as assertRegisteredParserOverride,jP as assertRegisteredPreflightOverride,DP as assertRegisteredProfile,GP as assertRegisteredRendererOverride,vP as assertRegisteredSearchProvider,UP as assertRegisteredServiceOverride,PP as assertRegisteredVectorStoreAdapter,OC as assertRelationshipEdgeAllowed,dn as assertRelationshipGraphAdapterConformance,kx as assuranceAssertionUpdateIsLoosening,fS as attachContextIntentReceipt,Yw as attachContextUsageServingReceipt,Jl as attachLinkedTestMutationProvenance,Yl as attachLinkedTestProvenance,Ze as attachMcpServerInfo,nw as attachOutputOmissionReceipt,_S as attachOutputTokenAccounting,mS as attachReadOutputContracts,Pw as attachReadOutputSessionReceipt,ol as auditMergeAttributeFence,CO as auditMergeDriverConfiguration,vd as auditWorkspaceRelationshipGraph,Uk as authorizeMcpHttpRequest,Co as boundAgentEpisodeIdentity,Tw as boundReadOutputRows,ju as buildChildrenByParent,UI as buildCompactSearchFilterSummary,AR as buildContentFilterEcho,eI as buildContextSignalSnapshot,iy as buildCorpusShapeItemPlan,xA as buildDefectRecurrenceIndex,ml as buildExtensionDescribeResult,xR as buildGovernanceMissingFilterEcho,nE as buildInvalidTypeError,NI as buildItemChildrenRollup,Yv as buildItemCompletionMutations,FR as buildItemContextRelevanceCandidates,AE as buildItemNotFoundError,DI as buildItemSchedule,QO as buildLinkedFileRepairReport,kk as buildMcpAuthorizationDiscoveryUrls,kh as buildMcpCompleteResult,ek as buildMcpDiscoverResult,$k as buildMcpDynamicRegistrationMetadata,Ek as buildMcpHttpRequestHeaders,ik as buildMcpInputRequiredResult,Pk as buildMcpProtectedResourceMetadata,rl as buildMergeAttributePatterns,Lc as buildPmActionToolInputSchema,PN as buildPmRefusalClosureCensus,cO as buildRelationshipContext,vE as buildSearchCorpus,kE as buildSemanticCorpusInput,ZO as buildStatusRoleWarnings,Vi as buildTrackerInitializationRecovery,FE as buildVectorizationEmbeddingIdentity,jE as buildVectorizationEmbeddingMetadata,BI as buildVerboseSearchFilters,aI as buildWorkspaceMemorySnapshot,bo as canonicalDocument,fC as canonicalizeCommandOptionKey,DR as canonicalizeContextRecencyCoordinate,EC as canonicalizeRelationshipKind,wN as censusPmRecoveryReferenceProducers,sx as certifyCompleteListResult,cP as checkExtensionManifestCompatibility,G_ as claim,U_ as claimNext,uO as classifyHistoryAuthorEvent,Uo as classifyHistoryEvent,HO as classifyHistoryMergeReceiptReferences,CC as classifyHostEnvironmentFault,YI as classifyImplicitSemanticFallbackReason,fo as classifyItemFormatVersion,Zf as classifyLinkedTestCommandSafety,Qf as classifyLinkedTestFailure,tT as clearActiveExtensionHooks,Fd as clearDurableGraphCache,qT as clearFocusedItem,Yc as clearWorkspaceContractsCache,j_ as close,Yu as closeItem,X_ as closeTask,Ah as coalesceRepeatedListFlags,nR as collectBlockedByIds,iR as collectBlockedByIdsFromCorpus,Zw as collectContextUsageDeliveredItemIds,ad as collectDanglingDependencyReferences,aR as collectDependencyBlockedIds,id as collectDuplicateDependencyRows,Id as collectDuplicateRelationshipEdgeGroups,XI as collectErrorCauseCodes,Qc as collectHierarchyRelations,Er as collectMcpHeaderAnnotations,cd as collectMissingDependencyTargetIds,np as collectNewOrderingCycleWarnings,xd as collectOrderingCycles,sd as collectOrderingStorageContradictions,ux as collectPackageContextIntentContracts,jt as collectPackageExtensionDirectories,cT as collectRegisteredItemFieldNames,LT as collectRuntimeCreateFieldValues,oE as collectRuntimeFilterValues,DT as collectRuntimeUpdateFieldValues,Nu as collectSubtreeIds,eo as collectUsedExtensionCapabilities,mC as commandOptionFlagLabel,Wm as comments,Om as commitImportedItem,Jv as commitItemCompletion,Xv as commitItemMutations,KA as commitWorkspaceTransaction,Xs as compactFlagAliasContracts,Lu as compareCriticalItems,G as comparePmDateVersions,VA as compareRelationshipSnapshots,Xb as compareTimestampStrings,wx as compileHistoryProvenanceMatcher,cS as composeContextIntentContracts,tP as composeExtension,aP as composeExtensionPackage,dR as computeActionabilityReport,BS as computeHistoryDiff,Sd as computeRelationshipCentrality,wd as computeRelationshipDominators,dd as computeWorkspaceGraphFingerprint,i_ as config,eT as consumeAfterCommandAffectedItems,jm as context,pS as contextIntentRowId,q_ as copy,em as countFailureCategories,bw as countReadOutputRows,D_ as create,Xx as createAssurancePreset,OR as createAssuranceWorkspaceContext,Jb as createCheckpointId,ox as createCompleteListOptions,jC as createCoreCommandHookContext,tn as createCorpusShapeMeasurement,$x as createEmptyAssuranceDocument,IC as createEmptyExtensionRegistrationRegistry,Vc as createExtensionCommandSdk,Zn as createExtensionContributionInventory,XP as createExtensionTestHarness,Ii as createHistoryEntry,tA as createLazyModule,Bk as createMcpStaticBearerVerifier,bk as createMcpTaskStore,EE as createMutationGuardSdk,ZT as createOutputOmissionReceipt,Bc as createPmCliExpectedError,vh as createPmCliProgram,Ti as createPmCommandOutputBudget,iw as createQueryFingerprint,ky as createRelationshipGraphScaleFixture,Q as createRelationshipGraphSnapshot,Ot as createRelationshipKindRegistry,fs as createReproducibleProcessRunner,qI as createSearchCursorFingerprint,GC as createSerialQueue,AT as createStdinTokenResolver,iC as createUnknownSubcommandError,tf as createWorkspaceSnapshot,uP as deactivateExtensionForTest,g0 as declineServiceOverride,uS as decodeContextIntentCursor,eA as decodeHtmlEntitiesInOptions,Sr as decodeMcpHttpHeaderValue,dw as decodeQueryCursor,aw as decodeQueryCursorEnvelope,cw as decodeQueryCursorState,xw as decodeReadOutputContinuationCursor,Kk as decoratePmMcpToolsWithApps,$l as dedupeLinkedArtifacts,GR as defaultScoreContextCandidates,S0 as defineAfterCommandHook,T0 as defineBeforeCommandHook,w0 as defineBeforeMutationHook,i0 as defineCommand,p0 as defineCommandOverride,X as defineCorpusShape,pM as defineEpisodeSpecification,C0 as defineExporter,Qv as defineExtension,eP as defineExtensionBlueprint,n0 as defineExtensionManifest,s0 as defineFlag,b0 as defineImporter,c0 as defineItemField,a0 as defineItemType,d0 as defineMigration,Xg as defineObservationContract,x0 as defineOnIndexHook,A0 as defineOnReadHook,E0 as defineOnWriteHook,f0 as defineParserOverride,wi as definePmCommandOutputBudget,Sv as definePmCommandOutputEnvelope,bv as definePmErrorCodeCatalog,m0 as definePreflightOverride,o0 as defineProjectProfile,y0 as defineRendererOverride,l0 as defineSearchProvider,_0 as defineServiceOverride,u0 as defineVectorStoreAdapter,Qg as defineVerdictContract,Se as defineWorkspaceRecipe,z_ as deleteItem,cf as deleteWorkspaceSnapshot,RC as dependencyToRelationship,t_ as deps,Jx as deriveAssuranceProposals,nP as deriveExtensionCapabilities,OI as derivePmBulkMutationEffect,SN as derivePmRecoveryReferenceObligations,cl as deriveSchemaEvolutionMigrationId,KE as deriveTelemetryCommandResolution,cE as describeAllowedTransitions,pO as describeExtensionActivation,oP as describeExtensionBlueprint,gu as describeItemOwnershipConflict,uM as describeObservationCost,Xt as describeProfileComposition,Yt as describeProjectProfile,Mv as describeUnknownError,ko as detectAgentIdentity,Do as detectHarnessIdentity,Cd as detectRelationshipCommunities,Mo as diagnoseAgentIdentity,Pd as diffRelationshipAuditSnapshots,Kf as diffTestRunMeasurements,ck as digestMcpRequestParameters,DC as discoverExtensions,Kn as discoverNearbyPmRoot,bL as discoverPmTools,xy as discoverProjectRuntimeVersionPins,e_ as docs,Km as duplicates,Nd as durableGraphCachePath,jd as durableGraphCacheStatus,uo as effectiveItemFormatVersion,lA as emitTelemetryErrorEvent,xm as emptyImportedDocument,xO as encodeItemScalarDecisionValue,wr as encodeMcpHttpHeaderValue,sw as encodeQueryCursor,Aw as encodeReadOutputContinuationCursor,qS as enforceHistoryStreamPolicyForItem,zS as enforceHistoryStreamPolicyForItems,hv as enrichCliFlagInvocationContract,tr as enrichCliFlagInvocationContracts,LA as ensureMaterializedHistoryTarget,Xc as ensurePmGitignore,Al as ensureScope,HE as ensureSentryInit,Am as ensureTrackerInitialized,yd as enumerateRelationshipPaths,Ai as estimatePmOutputTokens,jx as evaluateAssuranceAssertion,Gx as evaluateAssuranceGate,vM as evaluateBoundaryFixtures,zR as evaluateContextRanking,RA as evaluateDefectGateEvidence,Fx as evaluateMeasurement,Qi as evaluateMutationGuard,jf as evaluateProvenanceCoverage,Df as evaluateSemanticAttributionCoverage,cp as evaluateSimilarityGovernance,aE as evaluateTransition,ey as evaluateVerdictContract,ME as executeEmbeddingBatchesWithRetry,DE as executeVectorDelete,$E as executeVectorReset,LE as executeVectorUpsert,Vg as executeWorkspaceRecipe,Ml as expandAddGlobEntries,ql as explainSourceTraceability,Y_ as extension,Z_ as extensionActivate,Q_ as extensionDeactivate,J_ as extensionList,gb as extensionMigrate,VO as extractHistoryMergeReceiptDispositions,zO as extractHistoryMergeReceiptReferences,Fk as extractMcpTraceContext,PA as extractPatchFailureContext,Kl as extractReferencedPmItemIdsFromCommand,Py as federateRelationshipGraphSnapshots,Jm as files,Zm as filesDiscover,Qm as filesLookup,Qw as finalizeContextUsageDelivery,uy as findCoverageDeficits,ap as findDuplicateClusters,tl as findGitWorkspaceRoot,PT as findHistoryIdentityDiscontinuities,pl as findInstalledNpmPackageCandidate,Hk as findPmMcpAppByUri,Td as findRedundantRelationshipEdges,Ed as findRelationshipCutStructure,ip as findSimilarItems,dA as finishTelemetryCommand,rC as flattenFlagListValue,cy as flushTelemetryQueue,H_ as focus,bd as forEachMatchedRelationshipEdge,Rd as formatDuplicateEdgeGroup,td as formatHierarchyRelation,Od as formatOrderingStorageContradiction,_A as formatPmPositionalActionFlagTip,Tf as formatProfileApplyHuman,Cf as formatProfileLintHuman,yf as formatProfileListHuman,bf as formatProfileShowHuman,ul as formatSchemaEvolutionMigrationHuman,ZI as formatVectorIndexRecoveryWarnings,dv as formatWorkspacePositionHuman,v_ as gc,Bi as generateItemId,qm as get,JC as getActiveCommandResult,sS as getActiveContextIntentContracts,ro as getActiveExtensionRegistrations,Gk as getActiveMcpTraceContext,Bx as getAssuranceDeclaration,fh as getContracts,UT as getFocusedItem,Yn as getHistoryPath,jA as getItemAt,Xn as getItemPath,rs as getMutationActionContract,Wc as getPmGitignoreBlock,Wn as getSettingsPath,ph as getWorkspaceContracts,ki as getWorkspaceHistoryPath,r_ as graph,Ld as graphAuditBaselinePath,$f as groupHistoryByEpisode,h0 as handleServiceOverride,QP as hasMcpClientExtension,Vk as hasPmMcpAppsCapability,qe as hasSubcommandFlagContractsForCommand,GE as hasVectorizationEmbeddingIdentityChanged,UE as hasVectorizationVectorDimensionChanged,PS as hashDocument,kS as hashDocumentForVersion,MS as hashEmptyDocument,AS as hashHistoryPatch,ES as hashHistoryRecord,xS as hashHistoryStream,OO as hashItemScalarDecisionValue,I_ as health,md as hierarchyAncestors,_d as hierarchyDescendants,N_ as historyCompact,L_ as historyCompactBulk,Tx as historyEntryMatchesProvenance,Ae as historyItemHashVersionForRuntime,P_ as historyRedact,k_ as historyRepair,M_ as historyRepairAll,oR as indexBlockedByIds,rd as indexHierarchyRelations,BE as inferConsistentVectorDimension,Ci as inferPmOutputBudgetClass,o_ as init,ix as inspectCompleteListResult,vC as inspectExtensionManifestSchema,Kd as inspectHistoryAuthorStream,LO as inspectMergeReceiptEvidence,Ry as inspectProjectRuntimeCompatibility,ds as inspectStaleInProgressItems,JO as inspectStatusRoleAssignments,Mi as inspectWorkspaceHistoryState,rf as inspectWorkspaceSnapshot,al as installMergeFence,tk as interpretMcpResultType,Hu as isAlreadyClaimedError,Dv as isCommanderError,pu as isErrnoError,wA as isExternalDependencyReference,SA as isExternalDependencySourceKind,pe as isFileMissingError,cC as isHostOutputSuppressed,AO as isItemScalarMissingValue,UO as isLegacyMergeReceiptSummary,_ as isMcpRecord,es as isMutationAction,xC as isOrderingRelationshipKind,KS as isPlaceholderReferenceToken,qc as isPmCliExpectedError,ui as isPmExtensionCapabilityContract,fi as isPmExtensionPolicyModeContract,mi as isPmExtensionPolicySurfaceContract,pi as isPmExtensionServiceNameContract,AI as isPmKnownExitCode,Av as isPmMutationReceipt,Ve as isPmSuccessfulExitCode,li as isPmToolAction,BO as isPreDurableCloneLocalReceiptSummary,qO as isPreDurableDispositionEligibleReference,Oy as isProjectMutatingInvocation,rA as isPureSnakeCaseAlias,Hw as isReadOutputBudgetExceeded,ew as isReadRowContract,Hd as isRuntimeRecord,iA as isTerminalPlanMode,FT as isTerminalStatus,$n as isTimestampLiteral,Kv as itemDocumentToMutationOptions,LI as itemHasSchedule,ns as jaccardSimilarity,Ym as learnings,nC as levenshteinDistanceWithinLimit,du as limitAnnotationEntries,Zl as linkedTestTrustFingerprint,iP as lintExtensionBlueprint,PC as lintExtensionManifestSchema,Qt as lintProjectProfile,Gm as list,Oo as listAgentProvenanceAdapters,Eh as listAliasPluralKeys,Um as listAllComplete,wE as listAllDocumentCandidatesCached,Yi as listAllItemMetadata,SE as listAllItemMetadataLight,Ux as listAssuranceDeclarations,Kx as listAssuranceVerdicts,ny as listBuiltinCorpusShapes,Gv as listCoreClosedDomainContracts,bR as listGetProjectionFields,wO as listInvalidProvenanceHistoryStreamIds,gR as listListProjectionFields,DO as listMergeReceipts,ts as listMutationActions,ov as listMutationEvents,bn as listPmCommandFlagBudgets,Af as listPmCommandsForFamily,Ef as listPmCommandsForTier,ke as listPmFlagLexicon,QN as listPmFlagSpellingInventory,xf as listPmMcpToolsForProfile,qN as listPmRequiredArgumentRefusalContracts,zN as listPmSubcommandRefusalContracts,Wt as listProfiles,KN as listTrackerPreflightRecoveryContracts,nf as listWorkspaceSnapshots,px as loadContextIntentRuntimeLayers,lf as loadCreateTemplateOptions,$C as loadExtensions,Ud as loadGraphAuditBaseline,Qb as loadMutationCheckpoint,N as loadRelationshipGraphAdapter,Wi as locateItem,yT as looksLikeGenericKeyValueEntry,Cw as mapReadOutputRows,$O as markMergeReceiptReconciled,iE as matchesRuntimeFilters,aA as maybeRunFirstUseTelemetryPrompt,sy as measureCorpusShapePlan,zi as measureItemMetadataReadWork,_T as mergeAdditiveTags,rP as mergeExtensionBlueprints,RO as mergeHistoryStreams,kO as mergeItemDocuments,MO as mergeJsonDocuments,xh as mergeLinkedTestTwoTokenEntries,IO as mergeRelationshipEventStreams,Uu as mergeSortedWarnings,oA as migrateItemFilesToFormat,OE as mutateItem,xE as mutateItemWithHistoryContext,Di as mutateWorkspaceJsonWithHistory,zm as next,Io as normalizeAgentProvenanceAdapterValue,cu as normalizeAnnotationTransportOptions,Rx as normalizeAssuranceEvaluation,Ox as normalizeAssuranceMutation,Oh as normalizeBootstrapInvocation,IT as normalizeBulkIdsValue,od as normalizeDependencyGraphTarget,sO as normalizeDependencySeedId,iO as normalizeDependencySourceKind,Jn as normalizeExtensionContributionInventory,TO as normalizeInvalidHistoryProvenance,Iv as normalizeItemAddressInvocation,po as normalizeItemFormatVersion,Ui as normalizeItemId,ho as normalizeItemMetadata,aO as normalizeItemReference,Sh as normalizeLegacyExtensionActionSyntax,kl as normalizeLinkedPath,HS as normalizeParentReferenceValue,Ht as normalizeProfileName,Gi as normalizeRawItemId,Bw as normalizeReadOutputIncludeModeOptions,$S as normalizeReplayPatchOps,os as normalizeSimilarityText,$T as normalizeStatusForRegistry,_o as normalizeStatusInput,MT as normalizeStatusInputWithRegistry,Lv as normalizeThrownExitCode,Xm as notes,Dn as nowIso,Dd as openDurableGraphCache,ak as openMcpRequestState,fM as openPmEpisode,hd as orderingPredecessors,gd as orderingSuccessors,XR as packContextCandidates,Du as packRankedContextItems,dh as packageActivate,ch as packageCatalog,lh as packageDeactivate,sh as packageDescribe,oh as packageDoctor,rh as packageInstall,eh as packageLifecycle,th as packageList,ih as packageManage,yb as packageMigrate,ah as packageReload,nh as packageUninstall,uw as paginateQueryRows,xl as parseAddEntries,Ol as parseAddGlobEntries,uu as parseAnnotationTextInput,zv as parseAtomicMutationControls,Th as parseBootstrapCommandName,yh as parseBootstrapGlobalOptions,Ch as parseBootstrapHelpRequest,Rh as parseBootstrapTypeValue,RT as parseBulkIdsText,ku as parseContextDepth,Ru as parseContextFocusFields,dx as parseContextIntentDeclarations,Mu as parseContextSections,QR as parseContextSignalSnapshot,gT as parseCsvKv,vA as parseDefectChangeRiskRequest,RR as parseDefectRecurrenceCoverageRequest,IA as parseDefectRecurrencePolicy,Hp as parseEvalQuerySet,zd as parseGraphSubcommand,bx as parseHistoryProvenanceFilters,mx as parseIntegerLimit,jT as parseItemDocument,Vv as parseItemMutationBatch,rE as parseLimit,Tp as parseLinkedTestAssertionEqualsMap,wp as parseLinkedTestAssertionGteMap,_p as parseLinkedTestBoolean,hp as parseLinkedTestContextMode,mp as parseLinkedTestEnvClear,fp as parseLinkedTestEnvSet,Sp as parseLinkedTestJsonEntries,Cp as parseLinkedTestMinLines,bp as parseLinkedTestRegexList,yp as parseLinkedTestStringList,gp as parseLinkedTestWorkspaceContextMode,$h as parseMcpCachePolicy,Ph as parseMcpImplementation,tt as parseMcpInputRequests,ur as parseMcpInputResponses,ag as parseMcpSubscriptionFilter,Il as parseMigrateEntries,lR as parseMultiValueFilter,xv as parseMutationReceipt,OT as parseOptionalNonNegativeInteger,xT as parseOptionalNumber,_N as parsePmAgentTaskTranscriptCorpus,yL as parsePmToolDiscoveryOptions,_x as parsePriority,fR as parsePriorityFilterSet,Iw as parseReadOutputSession,dT as parseRegisteredItemFieldAssignments,ce as parseRelationshipGraphSnapshot,Rl as parseRemoveEntries,Bl as parseSourceLineRange,ZS as parseStatusFilterCsv,uR as parseStringFilterSet,io as parseTags,Vf as parseTestRunMeasurements,hx as parseType,pR as parseTypeFilterSet,Jd as parseUnknownAuthorHistoryEventCoordinates,_I as partitionDecisionEntries,US as patchPathToChangedField,Mn as pathExists,W_ as pauseTask,$d as persistDurableGraphResult,dE as persistSelectedItemFormat,GI as planAgentIdentityVocabularyMutation,iI as planCompletedAtBackfill,er as planProfileApplication,bN as planRelationshipEventBackfill,qd as planRelationshipRemediation,dl as planSchemaEvolutionMigration,Xd as planUnknownAuthorHistoryAcknowledgment,of as planWorkspaceSnapshotRestore,yA as positionalShapeKey,bA as positionalSignatureKey,dP as preflightExtension,ss as prepareSimilarityText,TT as preserveMutationStdinTokenFields,CT as preserveMutationStdinTokenLiterals,bS as printError,yS as printResult,S_ as profile,x_ as profileApply,O_ as profileLint,E_ as profileList,A_ as profileShow,QC as projectAfterCommandItemSnapshot,Iu as projectContextFocusRows,qf as projectFleetAttributionAnalytics,Cx as projectHistoryProvenance,Oi as projectPmDiagnosticOutput,Ri as projectPmDiagnosticText,Uf as projectProvenanceCoverageAnalytics,ru as projectValidateCounts,Qx as promoteAssuranceAssertion,Jw as propagateContextUsageServingReceipt,DM as pruneCompileCacheGenerations,qx as putAssuranceDeclaration,zx as putAssuranceDeclarationBundle,_E as queryItemMetadataIndex,hE as queryLinkedFileMetadataIndex,gE as querySimilarItemMetadataIndex,Hf as queryTestRunMeasurementsBelow,qo as quoteCommandArg,Bo as quoteWindowsCommandArg,jv as rankCommandPaths,lu as readAnnotationEntries,No as readAuthorEnvironment,sm as readBooleanOption,oS as readContextUsageAffinity,am as readCsvListOption,gl as readExtensionMigrationState,Nn as readFileIfExists,Ts as readFirstStringFromCommanderOptions,ws as readFirstValueFromCommanderOptions,Ff as readHistoryAnalyticsWindow,HT as readHistoryEntries,Pf as readImprovementLedger,CE as readItemMetadataDerivedIndexState,Xi as readLocatedItem,yw as readOutputBudgetCollections,Ew as readOutputCollectionFingerprint,gw as readOutputContinuationRowCollections,_w as readOutputContinuationRowPaths,Gw as readOutputIncludeModeOptions,hw as readOutputRowCollections,mw as readOutputRowPaths,kw as readOutputSessionRemainingTokens,Ft as readPmPackageManifest,mh as readRequiredString,qi as readSettings,lE as readSettingsWithMetadata,Ss as readStringArrayFromCommanderOptions,im as readStringOption,Nv as readThrownExitCode,qE as readVectorizationStatusLedger,lx as readWorkspaceContextIntentContracts,nI as readWorkspaceContextSignals,cI as readWorkspaceMemory,cv as readWorkspacePosition,GS as reanchorHistoryEntries,to as reconcileExtensionCapabilityUsage,Fi as reconcileWorkspaceJsonHistory,ZC as recordAfterCommandAffectedItem,Hx as recordAssuranceVerdict,Su as recordClaimSemanticAttribution,tS as recordContextUsageDelivery,eS as recordContextUsageServing,rS as recordContextUsageTouch,nS as recordContextUsageTouches,Au as recordFocusSemanticAttribution,vf as recordImprovementObservation,Eu as recordReleaseSemanticAttribution,TE as refreshItemMetadataDerivedIndex,il as refreshMergeAttributeFenceIfInstalled,VE as refreshSearchArtifactsForMutation,Ro as registerAgentProvenanceAdapters,nO as registerExternalDependencyResolver,xo as registerHarnessSignalDescriptors,KT as registerOutputMaterialFieldGroups,B_ as release,Vx as removeAssuranceDeclaration,Ln as removeFileIfExists,Gl as renameArtifactsResultKey,bu as renderCalendarMarkdown,Cu as renderCalendarToon,Bu as renderContextMarkdown,_l as renderExtensionDescribeMarkdown,fl as renderExtensionSurfaceMarkdown,vm as renderGuideMarkdown,kv as renderMissingOptionRetry,hI as renderNextMarkdown,Uv as renderPmClosedDomainHelp,zo as renderPmCommand,Wo as renderPmCommandAliasMigrationHint,If as renderPmCommandVisibilityMarkdown,t0 as renderPmFlagLexiconMarkdown,Wk as renderPmMcpAppHtml,kN as renderPmRefusalClosureCensusMarkdown,eE as renderRowsAsCsv,tE as renderRowsAsTable,F_ as reopen,NA as replayHistoryToTarget,LS as replayToCanonicalItemDocument,NS as replayToItemDocument,bI as requireTerminalReason,CI as requireTerminalReasonWithRecovery,IS as resealHistoryRewrite,WC as resetActiveExtensionRuntimeState,pd as resetWorkspaceGraphCache,To as resolveAgentSessionContextFromSignals,hu as resolveAnnotationIndex,fu as resolveAnnotationInput,VT as resolveAuthor,$o as resolveAuthorIdentity,VS as resolveBodyFileContent,oy as resolveBuiltinCorpusShape,yu as resolveCalendarOutputFormat,Cv as resolveCanonicalPmErrorCodeContract,AC as resolveCanonicalRelationshipKind,zT as resolveClaimPrincipal,vT as resolveCliBulkIdsInput,gC as resolveCommandOptionPolicyState,LM as resolveCompileCacheGeneration,oI as resolveCompletionTimestamp,uC as resolveConfiguredPmPackageRoot,TR as resolveContentFieldFilters,dS as resolveContextIntentContract,vu as resolveContextOutputFormat,Pu as resolveContextTokenBudget,vI as resolveCreateExplicitEmptyFlag,RE as resolveEmbeddingProviders,Tl as resolveExtensionInstallSourceIdentity,hl as resolveExtensionMigrationStatePath,LC as resolveExtensionRoots,oO as resolveExternalDependencyReference,tC as resolveFlagValueKind,Rm as resolveGuideOutputFormat,kf as resolveHistoryEpisodeGroupIdentity,yx as resolveHistoryProvenanceDimensions,DA as resolveHistorySubject,kA as resolveHistoryTarget,KI as resolveHybridSemanticWeight,Hn as resolveImplicitPmRoot,Yb as resolveIsoOrRelative,sR as resolveItemBlockers,tR as resolveItemExecutionRole,Hv as resolveItemMutationDocument,Vn as resolveItemTypeRegistry,kT as resolveItemTypesFilePath,tm as resolveLinkedTestFailureExitCode,Wl as resolveLinkedTestSourceRef,Xl as resolveLinkedTestSourceWorkspaceRoot,Ql as resolveLinkedTestTrust,eu as resolveLinkedTestTrustBatch,cg as resolveMcpAcknowledgedSubscriptionFilter,Je as resolveMcpRequestContext,el as resolveMergeInstallContext,CR as resolveMissingMetadataFilters,Pv as resolveMissingOptionPlaceholder,QT as resolveModePairedOutputOmissionReceipt,fI as resolveNextOutputFormat,rw as resolveOutputOmissionReceipt,lC as resolvePmCliVersion,Ko as resolvePmCommandAlias,We as resolvePmCommandCapabilityFamily,Bt as resolvePmCommandExitContract,Ei as resolvePmCommandOutputBudget,nr as resolvePmCommandOutputEnvelope,fA as resolvePmCommandPositionalContract,Xe as resolvePmCommandVisibilityTier,xi as resolvePmDiagnosticOutputBudget,Tv as resolvePmErrorCodeContract,fb as resolvePmFlagSemanticConcept,dC as resolvePmPackageRootFromModule,mA as resolvePmPositionalActionContract,Rc as resolvePmPositionalActionFlagContracts,De as resolvePmRoot,Pc as resolvePmToolCustomFieldCollision,YS as resolvePriority,Kt as resolveProfile,nl as resolveProjectMergeTypeFolders,lw as resolveQueryCursorStart,qw as resolveReadOutputDimensions,Kw as resolveReadOutputEncoding,ww as resolveReadOutputRecoveryBudget,Fw as resolveReadOutputSurface,tw as resolveReadRowContract,vv as resolveRecoveryCommandName,uT as resolveRegisteredSearchProvider,pT as resolveRegisteredVectorStoreAdapter,ps as resolveReproducibleProcessEnvironment,ao as resolveRuntimeFieldRegistry,so as resolveRuntimeStatusRegistry,IE as resolveSearchCorpusFields,VI as resolveSearchMaxResults,zI as resolveSearchPage,HI as resolveSearchScoreThreshold,WI as resolveSearchTuning,PE as resolveSemanticCorpusCharacterLimit,wu as resolveSemanticLineageIds,pE as resolveSettingsWithSemanticRuntimeDefaults,_O as resolveSourceContextWritePolicy,wf as resolveStartTaskInProgressStatus,te as resolveSubcommandFlagContractsForCommand,zb as resolveTelemetryErrorCategory,yI as resolveTerminalReason,hC as resolveTypeDefinition,_C as resolveTypeName,QS as resolveTypeSynonym,sE as resolveTypeWorkflows,Yd as resolveUnknownAuthorAcknowledgmentSelector,JI as resolveVectorIndexRecovery,NE as resolveVectorStores,Zc as resolveWorkspaceRelationshipKindRegistry,bC as resolveWorkspaceRoot,V_ as restore,eC as restoreCheckpointItems,ji as restoreWorkspaceJsonFromHistory,af as restoreWorkspaceSnapshot,sf as restoreWorkspaceSnapshotWithRecovery,hh as runAction,rT as runActiveBeforeMutationHooks,oT as runActiveCommandHandler,nT as runActiveOnIndexHooks,oo as runActiveOnReadHooks,no as runActiveOnWriteHooks,iT as runActiveParserOverride,sT as runActivePreflightOverride,aT as runActiveServiceOverride,Jc as runActivity,NC as runAfterCommandHooks,su as runAggregate,_u as runAnnotationCommand,au as runAppend,kR as runAssuranceAction,MR as runAssuranceDispatch,MC as runBeforeCommandHooks,Tu as runCalendar,Ku as runClaim,Wu as runClaimNext,Ju as runClose,Qu as runCloseMany,ep as runComments,Pm as runCompletion,Lp as runConfig,Ut as runContext,KR as runContextEvaluationCorpus,VR as runContextEvaluationScenario,vp as runCopy,Ep as runCreate,Pp as runDelete,fd as runDeps,Ul as runDocs,Ov as runDuplicates,Xp as runEval,Jp as runEvent,wl as runExtension,Cl as runExtensionMigrateAction,bl as runExtensionMigrations,zl as runFiles,Hl as runFilesDiscover,Vl as runFilesLookup,Bf as runFleetAttributionAnalytics,kp as runFocus,Np as runGc,Mp as runGet,Vd as runGraph,Im as runGuide,Sl as runHealth,RI as runHistory,uv as runHistoryCompact,mv as runHistoryCompactBulk,$A as runHistoryRedact,WO as runHistoryRepair,YO as runHistoryRepairAll,Bp as runInit,jp as runInitAgentGuidance,tp as runLearnings,jl as runLinkedArtifacts,rm as runLinkedTests,iu as runList,Yp as runMeet,tv as runMergeDriver,sl as runMergeInstall,jO as runMergeReceiptEvidenceReport,FO as runMergeReceiptReport,rv as runMergeReconcile,Vu as runNext,rp as runNotes,Ip as runPlan,gf as runProfileApply,hf as runProfileLint,mf as runProfileList,_f as runProfileShow,Gf as runProvenanceCoverageAnalytics,pP as runRegisteredCommandForTest,gP as runRegisteredCommandOverrideForTest,EP as runRegisteredExporterForTest,mP as runRegisteredHookForTest,SP as runRegisteredImporterForTest,wP as runRegisteredMigrationForTest,fP as runRegisteredMutationGuardForTest,_P as runRegisteredParserOverrideForTest,hP as runRegisteredPreflightOverrideForTest,yP as runRegisteredRendererOverrideForTest,CP as runRegisteredSearchProviderForTest,bP as runRegisteredServiceOverrideForTest,TP as runRegisteredVectorStoreAdapterForTest,or as runReindex,Xu as runRelease,Zp as runRemind,_v as runReopen,Zu as runRestore,ll as runSchemaEvolutionMigration,Kp as runSearch,ay as runSearchRefreshWorkerEntrypoint,km as runStartBackgroundRun,Wf as runStats,Yf as runTelemetry,pf as runTemplatesList,uf as runTemplatesSave,ff as runTemplatesShow,nm as runTest,om as runTestAll,Mm as runTestRunsList,Lm as runTestRunsLogs,$m as runTestRunsResume,Nm as runTestRunsStatus,Dm as runTestRunsStop,Fm as runTestRunsWorker,Ap as runUpdate,xp as runUpdateMany,qt as runUpgrade,ou as runValidate,_h as runWithActiveExtensions,D as runWithAgentSessionContext,aS as runWithContextIntentContracts,fx as runWithDiscoveredContextIntentContracts,vo as runWithHarnessDetectionSignals,jk as runWithMcpTraceContext,ms as runWithReproducibleProcessEnvironment,Po as runWithWorkspaceHarnessSignalDescriptors,Kr as runWithWorkspaceRecipe,FI as runWorkspaceTransactionGc,Bd as saveGraphAuditBaseline,dO as scanExtensionHostVersions,Wd as scanHistoryAuthorAttribution,mo as scanItemFormatVersions,Zi as scanMutationSecrets,SO as scanProvenanceResolverHealth,ls as scanStaleInProgressItems,eR as scanStorageIntegrity,s_ as schema,f_ as schemaAddField,u_ as schemaAddStatus,d_ as schemaAddType,g_ as schemaApplyPreset,y_ as schemaInferTypes,a_ as schemaList,__ as schemaListFields,T_ as schemaRemapStatus,m_ as schemaRemoveField,p_ as schemaRemoveStatus,l_ as schemaRemoveType,C_ as schemaRenameField,b_ as schemaRenameType,c_ as schemaShow,h_ as schemaShowField,w_ as schemaShowStatus,Fv as scoreCommandPathMatch,UR as scoreContextCandidates,BR as scoreContextCandidatesWithActiveExtensions,as as scoreItemSimilarity,VN as scorePmGrammarRefusalClosure,LN as scorePmRefusalClosure,cs as scorePreparedItemSimilarity,WN as scoreTrackerPreflightRecoveryClosure,OS as sealHistoryRecord,sk as sealMcpRequestState,Bm as search,uI as searchWorkspaceMemory,pI as searchWorkspaceMemoryReadResult,cR as selectActionableEntries,ow as selectCursorSemanticOptions,Em as selectImportAuthor,Nk as selectMcpClientRegistrationMode,lI as selectWorkspaceMemory,dI as selectWorkspaceMemoryRollups,Ou as semanticAttributionAffinity,JE as sentryCaptureCliError,YE as sentryFinishCommandSpan,QE as sentryFlush,ZE as sentryLogCliUsageError,WE as sentrySetCommandContext,XE as sentryStartCommandSpan,yo as serializeItemDocument,Bv as serializeNdjsonRows,qv as serializeNdjsonStream,Yg as serveDeclaredObservation,XC as setActiveCommandContext,YC as setActiveCommandResult,BC as setActiveExtensionCommands,UC as setActiveExtensionHooks,qC as setActiveExtensionParsers,zC as setActiveExtensionPreflight,KC as setActiveExtensionRegistrations,HC as setActiveExtensionRenderers,VC as setActiveExtensionServices,BT as setFocusedItem,sA as shouldCompletePlanOnClose,Gd as shouldPersistDurableGraphCache,ET as shouldResolveMutationStdinTokenField,ST as shouldResolveMutationStdinTokens,mE as shouldRunSearchRefreshInForeground,op as similarityAdvisoryWarnings,fw as sliceReadOutputRowCollection,Dl as sortLinkedArtifacts,fT as splitAcceptanceCriteria,nA as splitCommaList,go as splitFrontMatter,zw as stabilizeReadOutputReceiptEstimates,v as stableStringify,kC as stableValueEquals,K_ as startTask,cA as startTelemetryCommand,Hm as stats,NT as statusIsTerminal,bh as stripGlobalBootstrapTokens,iv as subscribeMutationEventBatches,sv as subscribeMutationEvents,jI as summarizeAgentIdentityVocabulary,Nf as summarizeAgentModelProvenance,Lf as summarizeAgentProvenance,HR as summarizeContextEvaluationReports,Jf as summarizeContextPreflight,Sx as summarizeHistoryProvenance,Gp as summarizeInitResult,NO as summarizeMergeReceipt,PI as supportsCreateExplicitEmpty,Rv as supportsItemIdAlias,aC as suppressHostOutput,Ie as syncRelationshipGraphAdapter,sP as synthesizeExtensionManifest,Ic as toCompletionFlagString,Gu as toContextFocusItem,$u as toContextPackingSummary,Fu as toContextRankingSummary,Hb as toErrorMessage,dm as toEstimatedMinutesValue,QA as toExtensionFlagDefinitions,mm as toImportBoolean,ym as toImportConfidence,fm as toImportInteger,wm as toImportLinkedDocs,Tm as toImportLinkedFiles,Sm as toImportLinkedTests,Cm as toImportLogEntries,bm as toImportNormalizedEnum,gm as toImportNumberMap,lm as toImportPriority,pm as toImportStatus,_m as toImportStringList,hm as toImportStringMap,um as toImportTags,GT as toItemRecord,cm as toNonEmptyImportString,Vb as toNonEmptyStringOrUndefined,DS as toReplayDocument,is as tokenizeSimilarityText,wT as transferMutationStdinTokenPolicy,TC as translateHostEnvironmentFault,$_ as update,uh as upgrade,R_ as validate,Nx as validateAssertionDefinition,Dx as validateAssuranceDocument,Lx as validateGateDefinition,Wv as validateItemMutationRows,Fl as validateLinkedPaths,Lk as validateMcpAuthorizationResponseIssuer,Mk as validateMcpAuthorizationServerMetadata,Dk as validateMcpClientMetadataDocument,Ak as validateMcpHttpRequestHeaders,lk as validateMcpJsonSchema,Mx as validateMeasurementDefinition,WS as validateMissingParentReference,jw as validateReadOutputOptions,JS as validateSprintOrReleaseValue,yC as validateTypeOptions,gv as verifyCliFlagInvocationParity,gA as verifyExplicitPositionalSlotCensus,jS as verifyHistoryChain,FS as verifyHistoryChainWithVersion,FA as verifyHistoryEntries,RS as verifyHistoryRecordHash,vS as verifyHistoryRewriteEvidence,TA as verifyPmCliGrammar,CA as verifyPmCommandPositionalContracts,e0 as verifyPmFlagLexicon,xN as verifyPmRecoveryKindRuntimeCoverage,nb as verifyPmRecoveryProducerRuntimeCoverage,AN as verifyPmRecoveryReferences,vN as verifyPmRefusalClosureIdentityRatchet,IN as verifyPmRefusalClosureRatchet,EN as verifyPmRefusalReachability,vs as verifyToolOptionCliParity,Ws as withFlagAliasMetadata,wC as withHostEnvironmentBoundary,dk as withMcpCachePolicy,ud as workspaceGraphCache,mu as wrapOwnershipConflict,$v as wrapThrownErrorForSentry,Lo as writeAuthorEnvironment,Le as writeFileAtomic,Zb as writeMutationCheckpoint,uE as writeSettings,gS as writeStderr,hS as writeStdout,zE as writeVectorizationStatusLedger,$i as writeWorkspaceJsonWithHistory};
25
+ </html>`}import{createHash as ct}from"node:crypto";import{lstat as $g,readdir as Kr,readFile as Fg}from"node:fs/promises";import M from"node:path";import{parseDocument as jg}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]="6bfbe073-3869-5451-9d65-499960a28af9")}catch{}})();var Gr="io.modelcontextprotocol/skills",dt="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Gg=Object.freeze({revision:dt,status:"draft",directoryRead:!0});function P0(e,t=!1){let r=e.clientCapabilities.extensions,o=_(r)?r[Gr]:void 0;if(!_(o)||o.revision!==dt||t&&o.directoryRead!==!0)throw new p("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Gr]:Gg}}})}var k=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Ur=100,Ug=32*1024*1024,Bg=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Br=new Set(Array.from({length:k.maxPageSize},(e,t)=>t+1));function T(e,t){throw new p(e,-32602,t)}function qr(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 qg(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||T(`Skill ${t} is missing YAML frontmatter.`);let o=jg(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&T(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(i=>i.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(i){T(`Skill ${t} has unsupported YAML aliases.`,{error:String(i)})}return(typeof n!="object"||n===null||Array.isArray(n))&&T(`Skill ${t} frontmatter must be an object.`),n}async function zg(e,t,r,o){return r>k.maxFileBytes&&T(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>k.maxFilesPerSkill&&T(`Skill exceeds ${k.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>k.maxSkillBytes&&T(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>Ug&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),Fg(e)}async function Wr(e,t,r){let o=M.join(e,t),n=await Kr(o,{withFileTypes:!0}),i=[];for(let s of n.sort((a,c)=>a.name.localeCompare(c.name))){let a=M.posix.join(t.split(M.sep).join("/"),s.name),c=M.join(e,...a.split("/")),d=await $g(c);d.isSymbolicLink()&&T(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await Wr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await zg(c,a,d.size,r)}):T(`Skill resource must be a regular file or directory: ${a}.`)}return i}async function zr(e,t,r){let o=new Map,n;try{n=await Kr(e,{withFileTypes:!0})}catch(a){if(Et(a))return o;throw a}let i=n.filter(a=>a.isDirectory()&&Bg.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>Ur&&T(`Skill origin exceeds ${Ur} directories.`);let s={value:0};for(let a of i){let c=await Wr(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((h,C)=>h+C.bytes.byteLength,0),l=c.find(h=>h.relative==="SKILL.md");if(!l)continue;let u=qg(l.bytes.toString("utf8"),a.name);u.name!==a.name&&T(`Skill directory ${a.name} must match frontmatter name.`,{actual:u.name??null,expected:a.name}),(typeof u.description!="string"||u.description.trim().length===0)&&T(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=c.map(h=>({uri:`skill://${a.name}/${h.relative}`,digest:`sha256:${ct("sha256").update(h.bytes).digest("hex")}`,size:h.bytes.byteLength})),g=ct("sha256").update(f.map(h=>`${h.uri}:${h.digest}`).join(`
26
+ `)).digest("hex");o.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:u,resources:f,_meta:{contractVersion:1,extensionRevision:dt,origin:t,packageVersion:r,protocolVersion:H,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(h=>[h.relative,h.bytes])),fingerprint:g})}return o}function Vr(e){let{files:t,fingerprint:r,...o}=e;return o}var Hr=class e{#e;#t;constructor(t){this.#e=t,this.#t=ct("sha256").update([...t.entries()].sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>`${r}:${o.fingerprint}`).join(`
27
+ `)).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)&&T("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof p)throw o;return T("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 zr(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 i=await zr(n,"workspace",t.packageVersion);for(let[s,a]of i)r.set(s,a)}}return new e(r)}list(t={}){let r=t.limit??k.defaultPageSize;Br.has(r)||T(`Skill list limit must be an integer from 1 to ${k.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),i=n.slice(o,o+r),s=o+i.length,a=s<n.length;return{skills:i.map(Vr),hasMore:a,...a?{nextCursor:this.#o(s,"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||T(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Vr(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]??"",i=o&&n?o.files.get(n):void 0,s=o?.resources.find(d=>d.uri===t);(!o||!i||!s)&&T(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:s.digest,origin:o._meta.origin,trust:"untrusted"},c=qr(n,i);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:i.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:i.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||T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let i=(o?.[2]??"").replace(/\/$/u,""),s=i.length>0?`${i}/`:"",a=`skill://${o[1]}`,c=new Map;for(let C of n.resources){let w=C.uri.slice(`${a}/`.length);if(!w.startsWith(s))continue;let z=w.slice(s.length),[I,...St]=z.split("/"),No=`${a}/${s}${I}`,Lo=n.files.get(`${s}${I}`);c.set(I,{uri:No,name:I,mimeType:St.length>0?"inode/directory":qr(I,Lo)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??k.maxPageSize;Br.has(d)||T(`Skill directory limit must be an integer from 1 to ${k.maxPageSize}.`);let l=this.#r(r.cursor,t),u=[...c.values()].sort((C,w)=>C.uri.localeCompare(w.uri)),f=u.slice(l,l+d),g=l+f.length,h=g<u.length;return{resources:f,hasMore:h,...h?{nextCursor:this.#o(g,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]="76fdc288-42b3-52b9-adc7-81e504f23ae3")}catch{}})();var Xr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function lt(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)=>lt(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,lt(o,`${t}.${r}`)])))}function Ee(e){if(e.schema!==Xr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=At(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:lt(r.input,`operations[${o}].input`)})))})}async function Yr(e,t){let r=Ee(e);return vt(r,t)}async function Vg(e,t){return Yr(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]="6e293af6-ee81-59b4-8d80-05e5c20bdcf1")}catch{}})();var Jr="pm.agent-observation/v1",Zr="pm.agent-verdict/v1",Qr="pm.agent-episode/v1";function R(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function x(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 Hg(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(x(r.command,"observation.reads.command"),R(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 Kg(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(R(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 Wg(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(x(o.id,"observation.tiers.id"),R(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 i of o.fields){if(F(i,"observation.tiers.fields"),n.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);n.add(i)}}}function Xg(e){if(e.schema!==Jr)throw new Error(`observation.schema must be ${Jr}.`);return x(e.id,"observation.id"),R(e.version,"observation.version"),Hg(e.reads),Kg(e.calibration),e.corpus_dependence.kind==="bounded"&&(x(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),R(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),Wg(e.tiers),ne(structuredClone(e))}function j0(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 Yg(e,t,r){R(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,i]of e.tiers.entries()){o.push(i.id);let s=await t(i),a=Buffer.byteLength(P(s),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,i.max_tokens))return{status:"served",payload:s,receipt:{contract_id:e.id,contract_version:e.version,served_tier:i.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens:c,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 eo(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 Jg(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function Zg(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 Qg(e){if(e.schema!==Zr)throw new Error(`verdict.schema must be ${Zr}.`);x(e.id,"verdict.id"),R(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){x(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}.`);Zg(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 ey(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(s=>[s.id,s])),o=e.composition.predicate_ids.map(s=>{let a=r.get(s),c=eo(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:P(c)===P(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${Jg(a.path)}`,evidence_digest:It(P(c))}}),n=o.filter(s=>s.outcome==="satisfied").length,i=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:i?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function G0(e){if(e.schema!==Qr)throw new Error(`episode.schema must be ${Qr}.`);if(x(e.id,"episode.id"),R(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)x(t,"episode.task_item_ids");R(e.limits.max_actions,"episode.limits.max_actions"),R(e.limits.max_observations,"episode.limits.max_observations"),R(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 Xg(e.observation),Qg(e.verdict),Ee(e.recipe),ne(structuredClone(e))}function ty(e,t,r){let o=F(t,"observation projection field"),n=e;for(let[i,s]of o.entries()){if(i===o.length-1){r!==void 0&&(n[s]=structuredClone(r));return}let a=n[s];(a===null||typeof a!="object"||Array.isArray(a))&&(n[s]={}),n=n[s]}}function ry(e,t){let r={};for(let o of t)ty(r,o,eo(e,o));return r}async function U0(e,t){let r=[],o=0,n=0,i=!1,s,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await D(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(i)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let u=await t.readRecordedState(),f=await Yg(e.observation,async g=>ry(u.state,g.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??u.snapshot_id}),f},l=async(u=!1)=>{if(i&&!u)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(),g=ey(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),g};return{observe:()=>D(a,d),step:async u=>{if(i)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(u));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>D(a,l),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=D(a,()=>l(!0)).then(f=>(r.push({sequence:r.length+1,kind:"close",state_id:f.snapshot_id}),{verdict:f,trajectory:ne(structuredClone(r))})).catch(f=>{throw i=!1,f}).finally(()=>{s=void 0}),s)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9394fb87-fb36-5886-b262-ce2787326053")}catch{}})();var j="https://schema.unbrained.dev/pm/corpus-shape/v1";function W(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 ro(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))ro(t);Object.freeze(e)}}function X(e){if(e.schema!==j)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(W(e.hierarchy_depth,"hierarchy_depth"),W(e.hierarchy_fanout,"hierarchy_fanout"),ie(e.age_span_days,"age_span_days"),W(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"),W(e.author_cardinality,"author_cardinality"),W(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 ro(t),t}var Ae=[{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:X({schema:j,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:X({schema:j,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:Ae,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":X({schema:j,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:Ae,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":X({schema:j,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:Ae,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":X({schema:j,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:Ae,author_cardinality:24,component_count:5,include_cycles:!1,custom_types:["Archive"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["archive_source"]})});function oy(){return Object.keys(Y).sort().map(e=>Y[e])}function ny(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 to=new WeakMap;function oo(e,t){if(e===0)return[];let r=to.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),to.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 iy(e,t,r,o=42){if(ie(t,"item index"),W(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),i=t%n,s=Math.floor(t/n),a=0,c=1;for(let w=0;w<e.hierarchy_depth;w+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=s%a,l=s-d,u=d===0?void 0:i+(l+Math.floor((d-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),g=e.age_span_days*864e5,h=new Date(f+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),C=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...u===void 0?{}:{parent:`pm-s${u.toString(36).padStart(7,"0")}`},component:i,timestamp:h,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:oo(t,e),has_comment:C<e.comments_per_100_items,has_note:C<e.notes_per_100_items,has_learning:C<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 ut=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,oo(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[s,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,l=c*a+Math.max(0,a+d-100),u=c*a+Math.min(a,d),f=this.annotations[s];(f<l||f>u)&&o.push(`${s}:${f}!in[${l},${u}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let s of[...n].sort()){let a=this.edgeKinds[s]??0,c=this.expectedEdgeKinds[s]??0;a!==c&&o.push(`edge_kind:${s}:${a}!=${c}`)}let i=[...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:i.length===0,mismatches:i}}};function no(e){return new ut(e)}function sy(e,t){let r=no(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]="dd1a948a-2fa2-5d2e-a41c-31f75297f17e")}catch{}})();async function ay(){let e=Fe(process.cwd(),process.env.PM_PATH);await xt(e,(t,r)=>Nt(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 cy(){await Lt()}(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]="b84b220f-cad0-5861-b3ed-07453179706e")}catch{}})();var io=["lines","branches","functions","statements"];function dy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function ly(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 uy(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)){dy(r,o);for(let n of io){let i=ly(r,n,o[n]),s=i.total-i.covered;s>0&&t.push({file:r,metric:n,uncovered:s,...i})}}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]="aa6b9997-a4c6-5bfb-8804-45b34afd9e01")}catch{}})();var py=["captured_redacted","captured_verbatim"],my=[{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 O(e){return typeof e=="string"&&e.trim().length>0}function fy(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||!py.includes(r.capture_source)||!O(r.capture_provenance)||!Array.isArray(r.redactions)||!r.redactions.every(O)||!("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 i of my)i.pattern.test(n)&&o.push({boundary_id:e.id,kind:"unsafe_fixture",detail:`${e.fixture_path} contains a possible ${i.label}.`});return o}function _y(e,t){let r=Date.parse(e.waiver_expires_at),o=O(e.waiver_reason)&&O(e.waiver_owner)&&e.waiver_expires_at.endsWith("Z")&&Ot(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 hy(e,t,r){if(!O(e.id)||!O(e.producer)||!O(e.consumer)||!O(e.format))return{captured:0,waived:0,findings:[{boundary_id:O(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=O(e.fixture_path)&&e.fixture_path in t?fy(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 _y(e,r)}function nx(e,t,r=new Date){let o=[];if(e.version!==1||!O(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,i=0,s=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 c=a,d=O(c.id)?c.id:void 0;if(d!==void 0&&n.has(d)){o.push({boundary_id:d,kind:"duplicate_boundary",detail:`Boundary ${d} is inventoried more than once.`});continue}d!==void 0&&n.add(d);let l=hy(c,t,r.getTime());i+=l.captured,s+=l.waived,o.push(...l.findings)}return o.sort((a,c)=>a.boundary_id!==c.boundary_id?a.boundary_id.localeCompare(c.boundary_id):a.kind.localeCompare(c.kind)),{ok:o.length===0,boundary_count:e.boundaries.length,captured_count:i,waived_count:s,findings:o}}import J from"node:fs";import pt 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]="9c9e4ac4-51b2-5920-bb27-a4f239f6b429")}catch{}})();var so=300*1e3,gy=3;function dx(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function lx(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.");J.mkdirSync(e,{recursive:!0});let o=pt.join(e,r);J.mkdirSync(o,{recursive:!0});let n=new Date;J.utimesSync(o,n,n);let i=J.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:J.statSync(pt.join(e,d)).mtimeMs}]}catch(l){if(l instanceof Error&&"code"in l&&me(l))return[];throw l}}).sort((d,l)=>l.mtimeMs-d.mtimeMs||d.name.localeCompare(l.name)),s=i.filter(d=>n.getTime()-d.mtimeMs<so),a=Math.max(0,gy-1-s.length),c=i.filter(d=>n.getTime()-d.mtimeMs>=so).slice(a).map(d=>d.name).sort((d,l)=>d.localeCompare(l));for(let d of c)J.rmSync(pt.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import ao from"node:fs";import Oe 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]="7ab9180f-dfcb-579d-bc0c-dbba2e4ad77e")}catch{}})();var se="@unbrained/pm-cli",yy=new Set(["append","claim","changelog","close","close-many","close-task","comments","config","copy","create","dedupe-merge","delete","deps","docs","extension","event","events","files","focus","gc","history-author-acknowledge","history-compact","history-redact","history-repair","init","install","item","learnings","meet","merge","normalize","notes","package","packages","pause-task","plan","profile","reindex","release","remind","restore","schema","start-task","test","test-all","test-runs","test-runs-worker","telemetry","templates","twin","update","update-many","upgrade","vcs","workspace"]),co=new Set(["--author","--output-budget","--output-format","--output-include","--output-limit","--output-session","--path","--pm-path"]),_t=/\b(\d{4})\.(\d{1,2})\.(\d{1,2})(?:-(\d+))?\b/u,Ie="2026.8.31";function S(e,t){return e.some(r=>t.includes(r.split("=",1)[0]))}function mt(e,t){return["activate","adopt","adopt-all","deactivate","init","install","migrate","reload","uninstall"].includes(t[0]??"")||S(e,["--activate","--adopt","--adopt-all","--deactivate","--fix-managed-state","--init","--install","--output","--reload","--scaffold","--uninstall"])}var by={changelog:(e,t)=>{if(t[0]==="generate")return!S(e,["--check"]);let r=e.indexOf("export");return t[0]==="export"&&(S(e,["--output"])||r>=0&&e[r+1]!==void 0&&!e[r+1].startsWith("-"))},comments:e=>S(e,["--add","--delete","--edit","--file","--stdin"]),config:(e,t)=>(t[0]==="project"||t[0]==="global"?t[1]:t[0])==="set",deps:()=>!1,docs:e=>S(e,["--add","--add-glob","--migrate","--remove"]),duplicates:()=>!1,events:()=>!1,extension:mt,files:(e,t)=>S(e,["--add","--add-glob","--migrate","--remove"])||t[0]==="discover"&&S(e,["--apply"]),health:e=>!S(e,["--check-only","--no-refresh","--skip-vectors"]),learnings:e=>S(e,["--add","--delete","--edit","--file","--stdin"]),merge:(e,t)=>t[0]!=="report",notes:e=>S(e,["--add","--delete","--edit","--file","--stdin"]),package:mt,packages:mt,profile:(e,t)=>t[0]==="apply",schema:(e,t)=>["add-field","add-status","add-type","remove-field","remove-status","remove-type","remap-status","rename-field","rename-type"].includes(t[0]??"")&&!(S(e,["--infer"])&&!S(e,["--apply"])),telemetry:(e,t)=>t.slice(0,2).some(r=>["clear","flush"].includes(r)),templates:(e,t)=>t[0]==="save",test:e=>S(e,["--add","--add-json","--background","--measure","--remove","--resume","--run","--stop"]),validate:e=>S(e,["--auto-fix","--prune-missing"]),vcs:(e,t)=>["abandon","create","merge","propose","ref-create"].includes(t[0]??""),workspace:(e,t)=>t[0]==="snapshot"&&["create","delete","restore"].includes(t[1]??"")};function Re(e){let t=e.match(_t);return t?[Number(t[1]),Number(t[2]),Number(t[3]),Number(t[4]??0)]:null}function G(e,t){let r=Re(e),o=Re(t);if(!r||!o)return null;for(let n=0;n<r.length;n+=1){let i=r[n]-o[n];if(i!==0)return Math.sign(i)}return 0}function ve(e){return G(e,Ie)!==-1?3:2}function Cy(e,t){if(t===3)return e.filter(r=>r.history_epoch_compatible===!1).map(r=>({...r,declaration:r.declaration??r.version})).sort((r,o)=>G(r.version,o.version))[0]}function ft(e){try{let t=JSON.parse(ao.readFileSync(e,"utf8"));return typeof t=="object"&&t!==null&&!Array.isArray(t)?t:null}catch{return null}}function Ty(e){let t=[...e.matchAll(/(<=|<)\s*v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/gu)].map(o=>({inclusive:o[1]==="<=",version:o[2]})),r=e.match(/\b\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?\s+-\s+v?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/u);return r?[...t,{inclusive:!0,version:r[1]}]:t}function wy(e){let t=e.split("||").map(r=>Ty(r));return{bounded:t.some(r=>r.length>0),compatible:t.some(r=>r.every(o=>{let n=G(Ie,o.version);return n!==null&&(o.inclusive?n!==1:n===-1)}))}}function Sy(e){return["dependencies","devDependencies","optionalDependencies","peerDependencies"].flatMap(t=>{let r=e[t];if(typeof r!="object"||r===null)return[];let o=r[se],n=typeof o=="string"?o.trim():"",i=/^[<!]/u.test(n)?void 0:n.match(_t)?.[0];if(!i)return[];let s=/^(?:=|v)?\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?$/u.test(n),a=wy(n);return[{version:i,constraint:s?"exact":a.bounded?"range":"minimum",...s?{}:{declaration:n},history_epoch_compatible:s?G(i,Ie)!==-1:a.compatible}]})}function Ey(e){let r=ft(Oe.join(e,"package-lock.json"))?.packages;if(typeof r!="object"||r===null)return;let o=r["node_modules/@unbrained/pm-cli"];if(typeof o!="object"||o===null)return;let n=o.version;return typeof n=="string"?n:void 0}function Ay(e,t){try{let r=ao.readFileSync(Oe.join(e,t),"utf8").split(/\r?\n/u),o=r.findIndex(c=>c.includes(se));if(o<0)return;let n=r[o].match(/^\s*/u)[0].length,i=[r[o]];for(let c=o+1;c<r.length;c+=1){let d=r[c],l=d.trim(),u=d.match(/^\s*/u)[0].length;if(l.length>0&&u<=n)break;i.push(d)}return i.join(`
28
+ `).match(/^\s*version(?::\s*|\s+)["']?(\d{4}\.\d{1,2}\.\d{1,2}(?:-\d+)?)/mu)?.[1]??i[0].match(_t)?.[0]}catch{return}}function vy(e){let t=[],r=ft(Oe.join(e,"package.json"));r&&t.push(...Sy(r).map(s=>({...s,source:"package.json"})));let n=ft(Oe.join(e,"node_modules","@unbrained","pm-cli","package.json"))?.version;typeof n=="string"&&Re(n)&&t.push({version:n,source:"installed-package",constraint:"exact",history_epoch_compatible:ve(n)===3});let i=Ey(e);i&&Re(i)&&t.push({version:i,source:"package-lock.json",constraint:"exact",history_epoch_compatible:ve(i)===3});for(let s of["pnpm-lock.yaml","yarn.lock"]){let a=Ay(e,s);a&&t.push({version:a,source:s,constraint:"exact",history_epoch_compatible:ve(a)===3})}return t}function lo(e){for(let t=0;t<e.length;t+=1){let r=e[t];if(co.has(r)){t+=1;continue}if(!r.startsWith("-"))return{command:r.toLowerCase(),index:t}}}function Oy(e){let t=lo(e);if(!t||S(e,["--help","-h","--dry-run"]))return!1;let{command:r,index:o}=t,n=[];for(let s=o+1;s<e.length;s+=1){let a=e[s];if(co.has(a)){s+=1;continue}a.startsWith("-")||n.push(a.toLowerCase())}let i=by[r];return i?i(e,n):yy.has(r)}function Ry(e){let t=lo(e.argv)?.command,r=Oy(e.argv),o=vy(e.projectRoot).filter(l=>G(l.version,e.executingVersion)!==null).sort((l,u)=>G(u.version,l.version)),n=o[0],i=n!==void 0&&G(e.executingVersion,n.version)===-1,s=ve(e.executingVersion),a=Cy(o,s),c=r&&a!==void 0,d=i&&!r?{code:"project_runtime_stale_read",executing_version:e.executingVersion,project_version:n.version,source:n.source,message:"This read is using an older pm runtime than the project requires.",next_steps:[`Run the command through the project's installed ${se} ${n.version}.`,"Install the project dependencies with its declared package manager if the local executable is missing."]}:void 0;return{compatible:!r||!i&&!c||e.allowStale===!0,executing_version:e.executingVersion,...n?{project_version:n.version,source:n.source}:{},...t?{command:t}:{},mutating:r,stale:i,history_epoch_incompatible:c,writer_item_hash_version:s,...a?{incompatible_project_version:a.declaration,incompatible_source:a.source}:{},...d?{warning:d}:{},override_applied:r&&(i||c)&&e.allowStale===!0}}function hx(e){let t=Ry(e);if(t.compatible)return t;throw t.history_epoch_incompatible?new b(`pm ${t.executing_version} cannot write item-hash epoch ${t.writer_item_hash_version} into a project pinned to pm ${t.incompatible_project_version}.`,L.CONFLICT,{code:"project_runtime_history_epoch_incompatible",reason:t.incompatible_source,why:`The pinned runtime cannot read item_hash_version ${t.writer_item_hash_version}; allowing the write would break its health and validation gates.`,nextSteps:[`Upgrade the project's ${se} pin to ${Ie} or newer before mutating tracker history.`,"For an intentional coordinated migration only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]}):new b(`pm ${t.executing_version} cannot mutate a project pinned to newer pm ${t.project_version}.`,L.CONFLICT,{code:"project_runtime_stale_mutation",reason:t.source,why:"An older runtime can write storage, history, and merge contracts it does not understand.",nextSteps:[`Run this command through the project's installed ${se} ${t.project_version}.`,"For an intentional recovery only, set PM_ALLOW_STALE_CLI=1 for this invocation and record why.","Read-only commands remain available without an override."]})}import{createHash as Iy}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]="eb475dcd-d16c-51fb-b248-b14cf5ade4de")}catch{}})();var ht=1;function Z(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 Q(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(),i=e.edges(),s=t.list();return Object.freeze({version:ht,fingerprint:Iy("sha256").update(P({nodes:n,edges:i,kinds:s})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:i,kinds:s})}function Py(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ce(e){if(!Py(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==ht)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 je([]);for(let n of e.kinds)t.register(n);let r=new V(e.nodes,e.edges,t),o=Q(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 N(e,t){U(e.name,"adapter name");let r=U(t.workspace,"workspace");Z(t.signal);let o=await e.read({...t,workspace:r});return Z(t.signal),o===null?null:ce(o)}async function Pe(e,t){let r=U(t.workspace,"workspace"),o=ce(t.snapshot).snapshot,n=await N(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(Z(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await N(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 ky(e,t={}){let r=e.map(ce),o=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=o.get(a.kind);if(c&&P(c)!==P(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new je([...o.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new V(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),n);return Q(i,n,t)}var ae=class{name;#e=new Map;constructor(t="memory"){this.name=U(t,"adapter name")}async read(t){Z(t.signal);let r=this.#e.get(U(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){Z(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(ce(t.snapshot).snapshot))}async clear(t){Z(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]="9a60b8c0-37d1-5c04-a079-e1351caf6e09")}catch{}})();function uo(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function My(e){let t=uo(e.nodeCount,"nodeCount"),r=uo(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(),i=(e.idPrefix??"node").trim();if(!n||!i)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${i}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${i}-${o==="star"?0:a-r}`,target:`${i}-${a}`,kind:n}}}}}function B(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function po(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=Rt(),n=Q(new V(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),i=Q(new V(["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"}),s=[];B(await N(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await Pe(e,{workspace:r,snapshot:n});B(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),B((await N(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),B((await Pe(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:i,expected_fingerprint:n.fingerprint}),B((await N(e,{workspace:r}))?.snapshot.fingerprint===i.fingerprint,"replacement must become visible"),s.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 B(d,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:i.fingerprint}),B(await N(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function xy(e){return po(new ae,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]="c59413c4-8955-5560-8bc6-f1dc9c8c5042")}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]="4d2bee02-8003-578c-9d25-32755534f8ff")}catch{}})();var gt=2,Ny=["self_reported","independent_transport"];function ke(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 mo(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 i=de(o,`${t}[${String(n)}]`);return r?o:i})}function yt(e,t){return e===void 0?void 0:de(e,t)}function Ly(e,t){if(e===void 0)return;if(!ke(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(i=>i.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 Dy(e,t,r,o,n,i){if(o==="refusal"){if(Ke(r)||n===void 0||i===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||i!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let s=kt(t);if(s===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[s].trim().toLowerCase();if(a==="history"){let l=Mt(t.slice(s+1));l!==void 0&&(a=De(`history ${l}`))}let c=Vt(a);if(!Ke(r)||r!==0&&!c?.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 d=sr(a).kind;if(o!==d)throw new TypeError(`${e} expected ${o}, but ${a} declares ${d}`)}function $y(e,t,r){if(!ke(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`),i=mo(e.args,`${o}.args`,!0),s=e.expected_exit_code;if(typeof s!="number"||!Number.isSafeInteger(s))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!ir.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!Ny.includes(d))throw new TypeError(`${o}.expected_accounting_mode is unsupported`);let l=d;if(l==="independent_transport"&&c!=="refusal")throw new TypeError(`${o} independent_transport accounting is supported only for refusal steps`);let u=mo(e.required_fields,`${o}.required_fields`);if(u.some(w=>w.split(".").some(z=>z.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=Ly(e.expected_field_values,`${o}.expected_field_values`),g=yt(e.expected_error_code,`${o}.expected_error_code`),h=yt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),C=yt(e.recovery_for,`${o}.recovery_for`);return Dy(o,i,s,c,g,h),{id:n,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:l,required_fields:u,...f?{expected_field_values:f}:{},...g?{expected_error_code:g}:{},...h?{expected_refusal_surface:h}:{},...C?{recovery_for:C}:{}}}function Fy(e,t){if(!ke(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((s,a)=>$y(s,r,a)),i=new Map;for(let s of n){if(i.has(s.id))throw new TypeError(`tasks.${r} contains duplicate step id ${s.id}`);if(s.recovery_for!==void 0&&(i.get(s.recovery_for)?.expected_output_kind!=="refusal"||s.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${s.id} recovery_for must reference an earlier refusal and declare successful output`);i.set(s.id,s)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let s of n)if(s.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===s.id))throw new TypeError(`tasks.${r}.${s.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function Vx(e){if(!ke(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==gt)throw new TypeError(`agent-task transcript corpus version must be ${String(gt)}`);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)=>Fy(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:gt,tasks:t}}import{createHash as fo}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]="41ef1735-c534-5b84-8367-1278007cb7c6")}catch{}})();function _o(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function Xx(e,t){let r=_o(t.migrationId,"migrationId"),o=_o(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let i=new Date(n).toISOString(),s=He(e,void 0,t.registry),a=s.graph.nodes(),c=s.graph.edges().map(f=>{let g=fo("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}:${g}`,relationshipId:`migration:${r}:${g}`,action:"add",edge:f,author:o,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=fo("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),l=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),u=c.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(u),edge_count:c.length,skipped_existing_count:c.length-u.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as ho 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]="81067f95-115f-5aee-b649-55d86c3915d4")}catch{}})();var le=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],bt={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"}},Jx=Object.freeze(Object.keys(bt));function go(e){if(Object.hasOwn(bt,e))return bt[e]}var jy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function ee(e,t){return e<t?-1:e>t?1:0}function Gy(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 Uy(e){return e===void 0||e.kind==="punctuator"&&jy.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function By(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
29
+ `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function qy(e,t,r){if(e[t]!=="/"||!Uy(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 zy(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=Gy(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 Vy(e){let t=[],r=0;for(;r<e.length;){let o=By(e,r);if(o!==void 0){r=o;continue}let n=qy(e,r,t.at(-1));if(n!==void 0){r=n;continue}let i=zy(e,r);i.token&&t.push(i.token),r=i.next}return t}var Hy=new Set(["object","block","pattern"]),Ky=new Set(["const","let","var"]),Wy=new Set(["}",")","]"]),Xy=new Set(["=","(","[",",",":","?","return"]);function Yy(e,t,r){if([...r].reverse().find(i=>Hy.has(i.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let n=e[t-1];return n?.kind==="identifier"&&Ky.has(n.value)?"pattern":n?.value==="=>"||n?.value===")"?"block":n&&Xy.has(n.value)?"object":"block"}function Jy(e,t,r){let o=e[t];if(o.value==="{"){let a=Yy(e,t,r);return{kind:a,...a==="object"?{member_start:!0,candidates:[]}:{}}}if(o.value==="[")return{kind:"array"};if(o.value!=="(")return;let n=e[t-1],i=e[t-2];return{kind:"paren",...n?.value==="function"||i?.value==="function"?{parameter_list:!0}:{}}}function Zy(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 Qy(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function eb(e){let t=Vy(ho.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,i]of t.entries()){let s=o.at(-1),a=Zy(s,i,t[n+1]);a&&s.candidates.push(a);let c=Jy(t,n,o);if(c)o.push(c);else if(Wy.has(i.value)){let d=o.pop();d?.kind==="object"&&!Qy(t,n)&&r.push(...d.candidates)}else i.value===","&&s?.kind==="object"?s.member_start=!0:s?.kind==="object"&&i.value!==":"&&(s.member_start=!1)}return r}function tb(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
30
+ `&&t.push(r+1);return t}function rb(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 Zx(e){let t=[],r=[];for(let n of[...e].sort((i,s)=>ee(i.path,s.path))){let i=tb(n.content),s;try{s=eb(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 s){let c=a.field,d=rb(i,a.offset),l=go(c);l?t.push({path:n.path,line:d,field:c,kind:l.kind}):/(?:retry_command|candidate_command|fallback_candidate|next_best_command|example|next_step|migration_hint|restore_with)/u.test(c)&&!/(?:_total|_truncated)$/u.test(c)&&r.push({kind:"unknown_recovery_field",subject:`${n.path}:${d}:${c}`,detail:`${c} resembles a recovery reference but has no typed field contract.`})}}let o=Object.fromEntries(le.map(n=>[n,t.filter(i=>i.kind===n).length]));for(let n of le)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,i)=>n.path!==i.path?ee(n.path,i.path):n.line!==i.line?n.line-i.line:ee(n.field,i.field)),r.sort((n,i)=>n.subject!==i.subject?ee(n.subject,i.subject):ee(n.kind,i.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function Qx(e,t){let r=[],o=(n,i)=>{if(Array.isArray(n)){n.forEach((s,a)=>o(s,[...i,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[s,a]of Object.entries(n).sort(([c],[d])=>ee(c,d))){let c=go(s),d=c?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,l=[a].flat();d!==void 0&&l.forEach((u,f)=>{let g="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,h=g&&typeof u=="object"&&u!==null&&!Array.isArray(u)?u[g]:u;if(typeof h!="string"||h.trim().length===0)return;let C=[...i,s,String(f)].map(w=>encodeURIComponent(w)).join("/");r.push({id:`${e}:${d.kind}:${C}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:h})}),o(a,[...i,s])}};return o(t,[]),r}function eN(e,t){let r=e.flatMap(s=>(s.owned_states??[]).map(a=>({contract:s,state:a}))),o=[],n=new Map;for(let s of t){if(n.has(s.probe_id)){o.push({kind:"duplicate_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} was supplied more than once.`});continue}n.set(s.probe_id,s)}let i=new Set(r.map(({state:s})=>s.probe_id));for(let{contract:s,state:a}of r){let c=n.get(a.probe_id);if(!c){o.push({kind:"missing_probe",probe_id:a.probe_id,detail:`No entrypoint observation was recorded for ${s.code}.`});continue}c.code!==s.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${s.code}; observed ${c.code}.`}),c.exit_class!==a.expected_exit_class&&o.push({kind:"wrong_exit_class",probe_id:a.probe_id,detail:`Expected ${a.expected_exit_class}; observed ${c.exit_class}.`}),a.entrypoints.includes(c.entrypoint)||o.push({kind:"wrong_entrypoint",probe_id:a.probe_id,detail:`Expected one of ${a.entrypoints.join(", ")}; observed ${c.entrypoint}.`})}for(let s of t)i.has(s.probe_id)||o.push({kind:"undeclared_probe",probe_id:s.probe_id,detail:`Observation ${s.probe_id} has no catalog declaration.`});return o.sort((s,a)=>s.probe_id!==a.probe_id?s.probe_id.localeCompare(a.probe_id):s.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function tN(e,t){let r=[],o=new Set,n=new Set;for(let c of e){if(o.has(c.id)){n.add(c.id),r.push({kind:"duplicate_obligation",reference_id:c.id,detail:`Recovery obligation ${c.id} was declared more than once.`});continue}o.add(c.id)}let i=new Map;for(let c of t){if(i.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}i.set(c.id,c),o.has(c.id)||r.push({kind:"undeclared_observation",reference_id:c.id,detail:`Recovery observation ${c.id} has no emitted obligation.`})}for(let c of e){if(n.has(c.id))continue;let d=i.get(c.id);d?d.reachable?d.semantics!==c.semantics&&r.push({kind:"wrong_semantics",reference_id:c.id,detail:`Recovery reference ${c.value} promised ${c.semantics}; proof demonstrated ${d.semantics}.`}):r.push({kind:"unreachable_reference",reference_id:c.id,detail:`Recovery reference ${c.value} did not reach its promised target.`}):r.push({kind:"missing_observation",reference_id:c.id,detail:`No reachability proof was recorded for ${c.kind} ${c.value}.`})}let s=le.map(c=>{let d=e.filter(u=>u.kind===c),l=d.filter(u=>!n.has(u.id)).map(u=>i.get(u.id)).filter(u=>u!==void 0);return{kind:c,declared:d.length,observed:l.length,passed:d.filter(u=>{let f=i.get(u.id);return!n.has(u.id)&&f?.reachable===!0&&f.semantics===u.semantics}).length}});r.sort((c,d)=>c.reference_id!==d.reference_id?c.reference_id.localeCompare(d.reference_id):c.kind.localeCompare(d.kind));let a=s.reduce((c,d)=>c+d.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:s,findings:r}}function ob(e,t){let r=new Map(le.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let o=le.map(i=>({kind:i,source_producers:e.producer_count_by_kind[i],runtime_values:r.get(i).size})),n=o.filter(({source_producers:i,runtime_values:s})=>i>0&&s===0).map(({kind:i})=>i);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((i,{runtime_values:s})=>i+s,0),coverage_by_kind:o,missing_runtime_kinds:n}}var rN=ob;(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]="ae22de89-8bac-5728-a6e2-29b342383abe")}catch{}})();var nN=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"]),yo=18,bo=Object.freeze([...nb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function iN(e,t=yo){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function sN(e,t=bo){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 Ct(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 aN(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,i=0,s=0;for(let l of e){let u=Ct(n,l.canonical_code??l.code);for(let f of l.owned_states??[])u.kinds.add("owned_state"),u.probeIds.add(f.probe_id)}for(let l of t){let u=o.get(l.error_code);if(u===void 0)continue;i+=1;let f=Ct(n,u);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let u=o.get(l.error_code);if(u===void 0)continue;s+=1;let f=Ct(n,u);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let u=l.canonical_code??l.code,f=n.get(u),g=[...f.probeIds].sort();return{code:l.code,canonical_code:u,disposition:g.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:g}}).sort((l,u)=>l.code<u.code?-1:1),c=a.filter(({disposition:l})=>l==="uncovered").map(({code:l})=>l),d=a.length-c.length;return{ok:c.length===0,catalog_error_code_count:a.length,executable_error_code_count:d,uncovered_error_code_count:c.length,coverage_fraction:a.length===0?1:d/a.length,closed_domain_probe_count:i,grammar_probe_count:s,uncovered_error_codes:c,rows:a}}function cN(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: ${yo}`,`- Required executable canonical codes: ${bo.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(`
31
+ `)}(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]="6ecdd8cf-3153-5ed9-abd4-e8a73da6662a")}catch{}})();function ib(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 sb(e){return[e.exit_code!==L.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 ${L.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."},...ib(e)]}function uN(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 i=t.length;for(let s of sb(n))s!==void 0&&t.push(s);t.length===i&&(o+=1)}return t.sort((n,i)=>n.probe_id!==i.probe_id?n.probe_id.localeCompare(i.probe_id):n.code.localeCompare(i.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]="e24f17e6-8b47-5dc0-b245-d6625b4fb60e")}catch{}})();var Co="not-a-declared-action";function ab(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 ue(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function bN(e=ze.filter(t=>Dt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>ue(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let i=r.command.split(" "),s=ue(r.command),a=i.length>1&&t.has(s)?i.map(ue).join("--"):s,c=te(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),d=qe.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${ue(o.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,n).map(l=>ab(r.command,l)),...c],recovery_args:[...i,"--help"],error_code:d&&!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 cb(e){switch(e){case"assurance":case"workspace snapshot":return qe.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Ue;case"merge":return Be;case"plan":return We;case"profile":return Xe;case"schema":return Ft;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function CN(e=ze){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-${ue(t)}`,command:t,refusal_args:[...r,Co],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:Co,allowed_values:[...cb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function db(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function lb(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&&!db(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 TN(e,t){let r=new Map(e.map(s=>[s.probe_id,s])),o=new Map(t.map(s=>[s.probe_id,s])),n=[...e.flatMap(s=>lb(s,o.get(s.probe_id))),...t.filter(s=>!r.has(s.probe_id)).map(s=>({code:"unexpected_refusal_probe",probe_id:s.probe_id,detail:`${s.probe_id} has no declared grammar refusal contract.`}))];n.sort((s,a)=>s.probe_id.localeCompare(a.probe_id)||s.code.localeCompare(a.code));let i=new Set(n.map(({probe_id:s})=>s));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:s})=>!i.has(s)).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]="5053cc84-63e5-50d3-9a4c-00c2a485ed69")}catch{}})();var Tt=[{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 SN(){return Tt.map(e=>({...e}))}function ub(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 EN(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of Tt){let i=t.get(n.probe_id);if(i===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let s=ub(n,i);r.push(...s),s.length===0&&(o+=1)}return r.sort((n,i)=>n.probe_id.localeCompare(i.probe_id)||n.code.localeCompare(i.code)),{ok:r.length===0,probe_count:Tt.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]="3764b417-dcf5-5bfd-9b32-503ca8364f8b")}catch{}})();var Me,pb=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 mb(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=pb[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(e)?"linked-file-path":["comments","notes","learnings"].includes(e)?"entry-file-input":"plan-definition-file"}function xe(){if(Me!==void 0)return Me;let t=re.filter(({command:i})=>Ve(i)).flatMap(({command:i,family:s})=>nr(i,te(i)).map(a=>({command:i,family:s,concept:mb(i,a.flag),flag:a.flag,aliases:Object.freeze([...a.aliases??[]]),value_kind:a.repeatable?"list":a.flag==="--limit"?"number":a.value_type}))),r=new Set(t.flatMap(i=>i.aliases.map(s=>`${i.command}:${s}`))),o=t.filter(i=>!r.has(`${i.command}:${i.flag}`)),n=new Map;for(let i of o){let s=n.get(i.concept)??new Set;s.add(i.value_kind),n.set(i.concept,s)}return Me=Object.freeze(o.map(i=>Object.freeze({...i,concept:n.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),Me}function IN(){return Object.freeze(xe().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var To=Object.freeze({init:30,config:36,extension:54,package:55,packages:55,install:27,upgrade:29,create:100,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:35,events:33,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:27,schema:43,profile:22,activity:35,restore:23,update:105,"update-many":146,close:31,"close-many":72,delete:24,append:25,comments:31,notes:35,learnings:31,files:39,docs:30,deps:32,plan:109,test:53,"test-all":40,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:38,release:23,"start-task":23,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":25});function wo(){let e=new Map(Object.keys(To).map(t=>[t,0]));for(let{command:t}of xe())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(To).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function fb(e,t,r){for(let o of e)for(let n of o.aliases){let i=t.get(`${o.command}:${n}`);i===void 0||i.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${i.flag}.`})}}function _b(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 i=e.get(n.command)??0;i===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(i<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${i} 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 i=`${n.command}:${n.canonical_flag}`,s=o.get(i);if(!s){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([s.flag,...s.aliases]);for(let c of n.accepted_spellings)a.has(c)||r.push({code:"removed_compatibility_spelling",command:n.command,detail:`${c} no longer resolves to ${n.canonical_flag}.`})}}function PN(e=xe(),t=wo(),r=[]){let o=[],n=new Map,i=new Map,s=new Map,a=new Map;for(let c of e){let d=`${c.command}:${c.flag}`;n.has(d)?o.push({code:"duplicate_canonical_flag",command:c.command,detail:`${c.flag} has more than one canonical row.`}):n.set(d,c),a.set(c.command,(a.get(c.command)??0)+1);let l=i.get(c.concept);l!==void 0&&l!==c.value_kind?o.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${l} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let u=s.get(c.concept);u!==void 0&&u!==c.flag?o.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${u} and ${c.flag}.`}):s.set(c.concept,c.flag)}return fb(e,n,o),_b(a,t,o),hb(e,r,o),o.sort((c,d)=>c.command.localeCompare(d.command)||c.code.localeCompare(d.code)||c.detail.localeCompare(d.detail)),{ok:o.length===0,entry_count:e.length,budget_count:t.length,concept_count:new Set(e.map(({concept:c})=>c)).size,baseline_entry_count:r.length,findings:o}}function kN(){let e=xe(),t=wo(),r=new Map(t.map(({command:n})=>[n,"unknown"]));for(let{command:n,family:i}of e)r.set(n,i);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:n,current:i,maximum:s})=>{let a=r.get(n);return`| \`${n}\` | ${a} | ${i} | ${s} |`}),""].join(`
32
+ `)}(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]="a169a68c-13d0-5a3a-b231-abdf1a34ef6a")}catch{}})();function xN(e){return e}function NN(e){return e}function LN(e){return e}function DN(e){return e}function $N(e){return e}function FN(e){return e}function jN(e){return e}function GN(e){return e}function UN(e){return e}function BN(e){return e}function qN(e){return e}function zN(e){return e}function VN(e){return e}function HN(e){return{handled:!0,result:e}}function KN(){return{handled:!1}}function WN(e){return e}function XN(e){return e}function YN(e){return e}function JN(e){return e}function ZN(e){return e}function QN(e){return e}function eL(e){return e}function tL(e){return e}function rL(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]="14bbf3be-03a5-5ff3-888f-6e8b9a68ac73")}catch{}})();function gb(e={},t={}){return new _e(t).extension(void 0,{...e,migrate:!0})}function yb(e={},t={}){return new _e(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]="af4da99c-f557-5bf7-a439-c14878e4970d")}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]="db5452b6-8d36-5425-a033-1d36757ce96e")}catch{}})();import{createHash as Eo,createHmac as bb,randomBytes as Cb,timingSafeEqual as Tb}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]="31eda153-a06e-51ef-a62f-f6dce09064d3")}catch{}})();var WL="dev.unbrained.pm/progressive-tool-discovery",XL=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),wb=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),q=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),Sb=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),Ao={core:0,standard:1,full:2,internal:3},vo=Object.freeze(["core","standard","full"]),Eb=new Set(["core","standard","full","custom"]),Oo=new Set(re.map(({family:e})=>e)),Ab=Cb(32);function Le(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 Ro(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 Io(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 Po(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function ko(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function vb(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 YL(e){if(ko(e),e.family!==void 0&&(typeof e.family!="string"||!Oo.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"||!vo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Le(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:Ro(e.limit)}:{},...e.cursor!==void 0?{cursor:Le(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:Po(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:Io(e.outputBudget)}:{}}}function Ob(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function pe(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function Rb(e,t){let r=pe(e);if(r.length===0)return 0;let o=new Set(pe(t)),n=r.filter(s=>o.has(s)).length,i=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+i)}function Ib(e,t){let r=pe(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=pe(t),i=r.filter(a=>n.some(c=>c.startsWith(a)||a.startsWith(c))).length,s=o.includes(e.toLowerCase())?.2:0;return Math.min(1,i/r.length+s)}function So(e){return Eo("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function Mo(e,t,r){return bb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function Pb(e,t,r){let o={version:1,offset:t,signature:Mo(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function kb(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8"));if(n.version!==1||!Number.isInteger(n.offset)||(n.offset??-1)<0||Number(n.offset)>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(Mo(t,n.offset,o),"base64url"),s=Buffer.from(n.signature,"base64url");if(s.length!==i.length||!Tb(s,i))throw new Error("cursor signature does not match the request");return n.offset}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function wt(e,t,r){return{value:Ob(e),weight:t,available:r!=="unavailable",source:r}}function Ne(e,t,r){return wt(e??t,r,e===void 0?"computed":"host")}function Mb(e,t,r){let o=Object.hasOwn(fe,e.name)?fe[e.name]:"help",n=Ye(o),i=`${e.name} ${e.description} ${o} ${n}`,s=Rb(t,i),a=new Set(pe(t)),c={lexical:wt(s,q.lexical,"computed"),semantic:Ne(e.signals?.semantic,Ib(t,i),q.semantic),graph:Ne(e.signals?.graph,a.has(n)||a.has(o)?1:0,q.graph),permission:wt(1,q.permission,"authorization"),freshness:Ne(e.signals?.freshness,1,q.freshness),usage:Ne(e.signals?.usage,wb.includes(e.name)?1:0,q.usage)},d=Object.values(c).reduce((l,u)=>l+u.value*u.weight,0);return{name:e.name,description:e.description,command:o,tier:Je(o),family:n,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function xb(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"||!vo.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"||!Oo.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"||!Eb.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function Nb(e){let r=Le(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Le(e.cursor===void 0?"":e.cursor,"cursor");let o=Ro(e.limit===void 0?10:e.limit),n=Io(e.outputBudget===void 0?1200:e.outputBudget);return xb(e),{query:r,includeSchema:Po(e.includeSchema),limit:o,budget:n,maximumTier:Ao[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function xo(e,t,r){let o=r??e.tools.reduce((s,a,c)=>s+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},i=0;for(let s=0;s<4;s+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:i,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+o)/4);if(c===i)break;i=c}return i}function Lb(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>Mb(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&Ao[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 Db(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[i,s]of e.entries()){let a=n+(i===0?0:1)+Buffer.byteLength(JSON.stringify(s),"utf8");if(xo(r(i+1),t,a)>t)break;o.push(s),n=a}return o}function JL(e,t={}){vb(e),ko(t);let r=Nb(t),o=t.cursorIntegrityKey??Ab,n=Lb(e,t,r),i=So({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),s=kb(t.cursor,i,n.length,o),a=n.slice(s,s+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),s+r.limit<n.length&&c.push({name:"tools",reason:"limit",restore_with:"Continue with next_cursor or increase limit."});let d={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:q},cache:{key:So({fingerprint:i,cursorIntegrityKey:Eo("sha256").update(o).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:Sb}},l=(h,C=h.length)=>{let w=s+C,z=w<n.length,I=[...c];return C<a.length&&I.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...h],returned:C,has_more:z,...z?{next_cursor:Pb(i,w,o)}:{},omission_receipt:{has_omissions:I.length>0,omitted:I}}},u=h=>{let C=l(h),w=xo(C,r.budget);return{...C,token_cost:{estimated_tokens:w,budget:r.budget,within_budget:r.budget==="unbounded"||w<=r.budget}}},f=Db(a,r.budget,h=>l([],h)),g=u(f);if(a.length>0&&f.length===0){let h=u([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 ${h}.`,64,{required:String(h)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${g.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(g.token_cost.estimated_tokens)});return g}(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]="87fb8085-4f16-58a9-9de7-c871fb90be5b")}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]="7130baa3-4e73-5123-be23-c7b4924fbf2a")}catch{}})();export{RR as ACTIONABILITY_ORDERING_KINDS,hs as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,uc as ACTIVITY_FLAG_CONTRACTS,kn as AGENT_PROVENANCE_DIMENSIONS,Xs as AGGREGATE_FLAG_CONTRACTS,La as APPEND_FLAG_CONTRACTS,rI as ASSURANCE_ACTIONS,oI as ASSURANCE_DECLARATION_KINDS,Xv as ASSURANCE_DOCUMENT_VERSION,tc as ASSURANCE_FLAG_CONTRACTS,Yv as ASSURANCE_GATE_TRIGGERS,Jv as ASSURANCE_MEASUREMENT_SOURCE_KINDS,fO as ASSURANCE_PRESET_IDS,Vv as AssuranceEvaluationRefusalError,zv as AssuranceMutationRefusalError,Hv as AssuranceSourceResolutionError,gn as BASELINE_ITEM_FORMAT_VERSION,py as BOUNDARY_FIXTURE_CAPTURE_SOURCES,UR as BRIEF_LIST_FIELDS,xn as BUILTIN_AGENT_PROVENANCE_ADAPTERS,Y as BUILTIN_CORPUS_SHAPES,Mn as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,Ho as BUILTIN_ITEM_TYPE_VALUES,Wt as BUILTIN_PROFILES,SC as BUILTIN_RELATIONSHIP_KINDS,ms as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,lc as CALENDAR_FLAG_CONTRACTS,Da as CLAIM_FLAG_CONTRACTS,Ic as CLOSE_ACTION_OPTION_KEYS,xa as CLOSE_FLAG_CONTRACTS,Na as CLOSE_MANY_FLAG_CONTRACTS,Ba as CLOSE_TASK_FLAG_CONTRACTS,Ys as COMMENTS_FLAG_CONTRACTS,pC as COMMON_MUTATION_COMMAND_OPTION_KEYS,Sc as COMPLETION_FLAG_CONTRACTS,Zo as CONFIDENCE_TEXT_VALUES,ua as CONFIG_FLAG_CONTRACTS,fs as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,_I as CONTEXT_EVALUATION_METRIC_NAMES,mc as CONTEXT_FLAG_CONTRACTS,qt as CONTEXT_OUTPUT_VALUES,CI as CONTEXT_PACKING_PROFILES,aI as CONTEXT_RECENCY_EPOCH,uI as CONTEXT_RELEVANCE_SERVICE,dI as CONTEXT_RELEVANCE_SIGNAL_NAMES,SI as CONTEXT_SIGNAL_SET_VERSION,wI as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,EI as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,iS as CONTEXT_USAGE_LIMITS,wc as CONTRACTS_FLAG_CONTRACTS,sc as COPY_FLAG_CONTRACTS,Cs as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,ws as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Ts as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,Ub as CREATE_DIRECT_CLOSE_REASON_DEFAULT,rc as CREATE_FLAG_CONTRACTS,kS as CURRENT_HISTORY_ITEM_HASH_VERSION,xS as CURRENT_HISTORY_RECORD_HASH_VERSION,yn as CURRENT_ITEM_FORMAT_VERSION,RI as ContextSignalStore,sS as ContextUsageValidationError,$v as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,iP as DEFAULT_CHILD_SAMPLE_LIMIT,GR as DEFAULT_COMPACT_LIST_FIELDS,jE as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Hp as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,qI as DEFAULT_TERMINAL_TRANSITION_POLICY,MI as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,VA as DEFECT_ESCAPE_CLASSES,HA as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Fa as DELETE_FLAG_CONTRACTS,Xo as DEPENDENCY_KIND_VALUES,hc as DEPS_FLAG_CONTRACTS,ea as DOCS_FLAG_CONTRACTS,Za as DUPLICATES_FLAG_CONTRACTS,uR as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,yc as EVAL_FLAG_CONTRACTS,Bp as EVAL_QUERY_SET_CONTRACT,qp as EVAL_QUERY_SET_EXAMPLE,Up as EVAL_QUERY_SET_SCHEMA_ID,pc as EVENTS_FLAG_CONTRACTS,za as EVENT_FLAG_CONTRACTS,Fo as EXECUTABLE_COMMAND_ALIASES,L as EXIT_CODE,wa as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ta as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Ia as EXTENSION_ADOPT_FLAG_CONTRACTS,fv as EXTENSION_CAPABILITIES,jb as EXTENSION_CAPABILITY_CONTRACT,$b as EXTENSION_CAPABILITY_CONTRACT_VERSION,Fb as EXTENSION_CAPABILITY_LEGACY_ALIASES,cn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,Ra as EXTENSION_CATALOG_FLAG_CONTRACTS,Sa as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Ca as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Oa as EXTENSION_DOCTOR_FLAG_CONTRACTS,ba as EXTENSION_EXPLORE_FLAG_CONTRACTS,pa as EXTENSION_FLAG_CONTRACTS,fa as EXTENSION_INIT_FLAG_CONTRACTS,ga as EXTENSION_INSTALL_FLAG_CONTRACTS,Aa as EXTENSION_MANAGE_FLAG_CONTRACTS,Ea as EXTENSION_MIGRATE_FLAG_CONTRACTS,_v as EXTENSION_POLICY_MODES,hv as EXTENSION_POLICY_SURFACES,va as EXTENSION_RELOAD_FLAG_CONTRACTS,yv as EXTENSION_SANDBOX_PROFILES,ma as EXTENSION_SCOPE_FLAG_CONTRACTS,gv as EXTENSION_TRUST_MODES,ya as EXTENSION_UNINSTALL_FLAG_CONTRACTS,wO as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,CO as EXTERNAL_DEPENDENCY_SOURCE_KIND,TO as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,Qs as FILES_FLAG_CONTRACTS,ac as FOCUS_FLAG_CONTRACTS,Ya as GC_FLAG_CONTRACTS,zR as GET_DEPTH_VALUES,fc as GET_FLAG_CONTRACTS,Ks as GLOBAL_FLAG_CONTRACTS,Id as GRAPH_DURABLE_CACHE_MIN_ITEMS,Rd as GRAPH_DURABLE_CACHE_VERSION,gc as GRAPH_FLAG_CONTRACTS,Ue as GRAPH_SUBCOMMAND_VALUES,_c as GUIDE_FLAG_CONTRACTS,Qa as HEALTH_FLAG_CONTRACTS,ia as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,PO as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,GP as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,sa as HISTORY_COMPACT_FLAG_CONTRACTS,Kn as HISTORY_EVENT_CLASSIFICATION_VERSION,ta as HISTORY_FLAG_CONTRACTS,Ie as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,oa as HISTORY_REDACT_FLAG_CONTRACTS,na as HISTORY_REPAIR_FLAG_CONTRACTS,Lp as INIT_AGENT_GUIDANCE_MODE_VALUES,la as INIT_FLAG_CONTRACTS,Pa as INSTALL_FLAG_CONTRACTS,Jo as ISSUE_SEVERITY_VALUES,nc as ITEM_COMPLETE_FLAG_CONTRACTS,rR as ITEM_LATEST_TIMESTAMP_FIELDS,Gb as ITEM_METADATA_KEY_ORDER,oc as ITEM_MUTATE_FLAG_CONTRACTS,ic as ITEM_REOPEN_FLAG_CONTRACTS,XO as ITEM_SCALAR_MISSING_VALUE,Ko as ITEM_TYPE_VALUES,tR as ITEM_UNION_COLLECTION_FIELDS,OI as JsonFileContextSignalStoreAdapter,Zs as LEARNINGS_FLAG_CONTRACTS,cp as LINKED_TEST_ENV_NAME_PATTERN,dp as LINKED_TEST_PM_CONTEXT_MODE_VALUES,ap as LINKED_TEST_PROTECTED_ENV_KEYS,lp as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,us as LIST_COMMANDER_STRING_OPTION_CONTRACTS,BR as LIST_COMMAND_DEFAULT_PROJECTIONS,Cv as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,Ws as LIST_FILTER_FLAG_CONTRACTS,WR as LIST_SORT_FIELDS,XR as LIST_SORT_ORDER_VALUES,Wn as MAINTENANCE_HISTORY_OPERATIONS,nP as MAX_CHILD_PROJECTION_ITEMS,Ew as MAX_WORKFLOW_POLICIES,Aw as MAX_WORKFLOW_POLICY_TERMS,qa as MEET_FLAG_CONTRACTS,OP as MERGE_DRIVER_ARTIFACT_VALUES,ra as MERGE_FLAG_CONTRACTS,Be as MERGE_SUBCOMMAND_VALUES,PP as MUTATION_EVENT_WIRE_BUDGET,ae as MemoryRelationshipGraphAdapter,_s as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Cc as NEXT_FLAG_CONTRACTS,Bu as NEXT_OUTPUT_VALUES,Js as NOTES_FLAG_CONTRACTS,_a as PACKAGE_FLAG_CONTRACTS,ha as PACKAGE_INIT_FLAG_CONTRACTS,Ua as PAUSE_TASK_FLAG_CONTRACTS,Rc as PLAN_CREATE_METADATA_PARAMETER_KEYS,da as PLAN_FLAG_CONTRACTS,Ap as PLAN_SHOW_DEPTH_VALUES,We as PLAN_SUBCOMMANDS,vp as PLAN_TEMPLATE_NAMES,Ny as PM_AGENT_TASK_ACCOUNTING_MODES,gt as PM_AGENT_TASK_TRANSCRIPT_VERSION,$c as PM_CLI_EXPECTED_ERROR_NAME,$A as PM_CLI_GRAMMAR_CONTRACT,MA as PM_CLI_GRAMMAR_NOUNS,li as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,xA as PM_CLI_SHARED_VERBS,$o as PM_COMMAND_ALIAS_CONTRACTS,re as PM_COMMAND_CAPABILITY_CONTRACTS,Dt as PM_COMMAND_DESTINATION_CONTRACTS,XI as PM_COMMAND_EXIT_CONTRACTS,WI as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Ri as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,ZP as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,ze as PM_COMMAND_POSITIONAL_CONTRACTS,Tm as PM_COMMAND_VISIBILITY_CONTRACTS,wv as PM_COMPLETE_LIST_FINDING_CODES,Rv as PM_CONTEXT_INTENTS_FILE,hS as PM_CONTEXT_INTENT_CONTRACTS,si as PM_CORE_COMMAND_NAMES,j as PM_CORPUS_SHAPE_SCHEMA,pi as PM_DEPRECATED_TOOL_ACTIONS,Si as PM_DIAGNOSTIC_DEGRADATION_STEPS,Ei as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,wi as PM_DIAGNOSTIC_OUTPUT_CLASSES,mi as PM_DISCOVERABLE_TOOL_ACTIONS,Qr as PM_EPISODE_SCHEMA,YP as PM_ERROR_CODE_CATALOG,HP as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,io as PM_EXACT_COVERAGE_METRICS,ei as PM_EXTENSION_CAPABILITY_CONTRACTS,ai as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,ri as PM_EXTENSION_POLICY_MODE_CONTRACTS,ii as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,ni as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,ti as PM_EXTENSION_SERVICE_NAME_CONTRACTS,oi as PM_EXTENSION_TRUST_MODE_CONTRACTS,$O as PM_GITATTRIBUTES_END,DO as PM_GITATTRIBUTES_START,jO as PM_GITATTRIBUTES_V2_END,FO as PM_GITATTRIBUTES_V2_START,Bc as PM_GITIGNORE_END,Uc as PM_GITIGNORE_START,Do as PM_HISTORY_COMMAND_ALIASES,di as PM_ITEM_ACTION_SUBCOMMANDS,at as PM_MCP_APPS_EXTENSION,Dr as PM_MCP_APPS_SERVER_CAPABILITY,Se as PM_MCP_APPS_SPEC_VERSION,jr as PM_MCP_APP_CONTRACTS,Fr as PM_MCP_APP_MIME_TYPE,wb as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,e0 as PM_MCP_HTTP_PROTOCOL_VERSION,Nh as PM_MCP_INPUT_REQUEST_METHODS,EM as PM_MCP_LEGACY_PROTOCOL_VERSIONS,cr as PM_MCP_LOG_LEVELS,A as PM_MCP_META_KEYS,WL as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,XL as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,vm as PM_MCP_PROMPT_CONTRACTS,H as PM_MCP_PROTOCOL_VERSION,Am as PM_MCP_RESOURCE_CONTRACTS,dt as PM_MCP_SKILLS_DRAFT_REVISION,Gr as PM_MCP_SKILLS_EXTENSION,Gg as PM_MCP_SKILLS_SERVER_CAPABILITY,k as PM_MCP_SKILL_LIMITS,Te as PM_MCP_SUBSCRIPTION_ID_META_KEY,Ze as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,HM as PM_MCP_TASKS_EXTENSION,Vh as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,YT as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,Ki as PM_MUTATION_ACTION_CONTRACTS,Jr as PM_OBSERVATION_SCHEMA,Ti as PM_OUTPUT_BUDGET_CLASSES,Ci as PM_OUTPUT_DEGRADATION_STEPS,ir as PM_OUTPUT_ENVELOPE_KINDS,Gt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,ci as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,jt as PM_PACKAGE_RESOURCE_KINDS,qe as PM_POSITIONAL_ACTION_CONTRACTS,Dc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,Nc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,Kw as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,Nw as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,zw as PM_READ_OUTPUT_DIMENSIONS,Hw as PM_READ_OUTPUT_OPTION_FLAGS,jw as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,Fw as PM_READ_OUTPUT_SESSION_MIN_TOKENS,Vw as PM_READ_OUTPUT_SURFACES,Ww as PM_READ_OUTPUT_SURFACE_CONTRACTS,XT as PM_READ_ROW_CONTRACTS,WT as PM_READ_ROW_JQ_SELECTOR,Jx as PM_RECOVERY_REFERENCE_FIELDS,le as PM_RECOVERY_REFERENCE_KINDS,nb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,bo as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,nN as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,yo as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,as as PM_REPRODUCIBLE_PROCESS_ENV,YI as PM_SUCCESS_EXIT_CODES,ui as PM_TOOL_ACTIONS,Pc as PM_TOOL_ACTION_PARAMETER_CONTRACTS,Lc as PM_TOOL_PARAMETERS_SCHEMA,xc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Mc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,vc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Zr as PM_VERDICT_SCHEMA,Xr as PM_WORKSPACE_RECIPE_SCHEMA,ca as PROFILE_FLAG_CONTRACTS,tr as PROFILE_LINT_CODES,er as PROFILE_LINT_DIMENSIONS,Kt as PROFILE_NAMES,Xe as PROFILE_SUBCOMMANDS,b as PmCliError,_e as PmClient,Sv as PmCompleteListValidationError,y as PmMcpAuthorizationError,dr as PmMcpInputRequiredError,kr as PmMcpIssuerCredentialStore,p as PmMcpProtocolError,lr as PmMcpRequestStateReplayGuard,Hr as PmMcpSkillRegistry,Tr as PmMcpSubscriptionRegistry,it as PmMcpTaskStore,pw as QUERY_CURSOR_CONTRACT,Ma as REINDEX_FLAG_CONTRACTS,xE as REINDEX_LOCK_ID,ht as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,ja as RELEASE_FLAG_CONTRACTS,Va as REMIND_FLAG_CONTRACTS,Pt as RESERVED_ITEM_FIELD_NAMES,$a as RESTORE_FLAG_CONTRACTS,Yo as RISK_VALUES,sv as RelationshipEventLog,av as RelationshipEventStore,V as RelationshipGraph,je as RelationshipKindRegistry,aa as SCHEMA_FLAG_CONTRACTS,ps as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,Tv as SEARCH_EXTENSION_FLAG_DEFINITIONS,Tc as SEARCH_FLAG_CONTRACTS,Eu as SEMANTIC_ATTRIBUTION_LIMITS,qb as SETTINGS_DEFAULTS,Jp as SNAPSHOT_SCHEMA,xO as SOURCE_CONTEXT_ACCESS_ENV,NO as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Ga as START_TASK_FLAG_CONTRACTS,Ja as STATS_FLAG_CONTRACTS,Wo as STATUS_VALUES,Hs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Xn as SUBSTANTIVE_HISTORY_OPERATIONS,MS as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,NS as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,sC as SUPPRESS_HOST_OUTPUT_MARKER,Wa as TELEMETRY_FLAG_CONTRACTS,Km as TELEMETRY_SUBCOMMANDS,Ka as TEST_ALL_FLAG_CONTRACTS,Ha as TEST_FLAG_CONTRACTS,Xa as TEST_RUNS_FLAG_CONTRACTS,Bm as TEST_RUN_MEASUREMENT_LIMIT,Gs as TOOL_ACTIVITY_OPTION_CONTRACTS,Rs as TOOL_AGGREGATE_OPTION_CONTRACTS,Ds as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,js as TOOL_CALENDAR_OPTION_CONTRACTS,Fs as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Us as TOOL_CONTEXT_OPTION_CONTRACTS,xs as TOOL_CREATE_OPTION_CONTRACTS,Ms as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Bs as TOOL_DEPS_OPTION_CONTRACTS,qs as TOOL_GRAPH_OPTION_CONTRACTS,Os as TOOL_LIST_FILTER_OPTION_CONTRACTS,Is as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,ks as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Ps as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,$s as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Ls as TOOL_UPDATE_OPTION_CONTRACTS,Ns as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,Bb as TYPE_TO_FOLDER,nC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Ss as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,As as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Es as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,cc as UPDATE_FLAG_CONTRACTS,dc as UPDATE_MANY_FLAG_CONTRACTS,ka as UPGRADE_FLAG_CONTRACTS,ec as VALIDATE_FLAG_CONTRACTS,Sw as WORKFLOW_POLICY_ACTIONS,BO as WORKFLOW_POLICY_DOCUMENT_SCHEMA,UO as WORKFLOW_POLICY_SCHEMA,bc as WORKSPACE_FLAG_CONTRACTS,rE as WORKSPACE_HISTORY_ID,Zp as WORKSPACE_SNAPSHOT_ACTIONS,id as WorkspaceGraphCache,pv as WorkspaceTransactionInterruptedError,bm as _testOnly,sI as _testOnlyAggregateCommand,Np as _testOnlyConfigCommand,dP as _testOnlyGetCommand,wl as _testOnlyHealthCommand,jp as _testOnlyInit,Dp as _testOnlyInitAgentGuidance,vk as _testOnlyItemTransaction,NP as _testOnlyMutationEvents,GI as _testOnlyNextCommand,vP as _testOnlySearchCommand,tP as _testOnlySimilarity,sm as _testOnlyTemplates,tu as _testOnlyValidateCommand,$P as _testOnlyWorkspacePosition,yO as acceptAssuranceProposals,Ql as acknowledgeLinkedTests,Xd as acknowledgeUnknownAuthorHistoryEvents,Wd as acknowledgeUnknownAuthorHistoryEventsFromTransport,GE as acquireItemMetadataDerivedIndexLock,Ge as acquireLock,Fk as activateExtensionForTest,FC as activateExtensions,Pn as agentSessionEnvironment,zf as aggregate,km as analyzeAgentProvenanceDescriptorCoverage,WA as analyzeDefectChangeRisk,tI as analyzeDefectRecurrenceCoverage,np as analyzeDuplicateItems,dv as analyzeGraphImpact,Xc as analyzeHierarchyIntegrity,lv as analyzeKnowledgeGraph,ZI as analyzePmCommandExitConformance,fi as analyzePmToolActionParity,bR as analyzeReconciliationDiscard,cv as analyzeRelationshipExecution,Cd as analyzeRelationshipSchedule,hh as analyzeSdkActionCoverage,$t as analyzeSdkCliParameterCompleteness,r_ as append,Li as appendHistoryEntry,sE as appendWorkspaceAuditEvent,iE as appendWorkspaceHistoryChange,fT as applyAcceptanceCriteriaMutations,hO as applyAssurancePreset,Th as applyBootstrapPagerPolicy,TS as applyContextIntentProjection,Uu as applyContextTagProjection,YR as applyFilterValueEcho,ev as applyHistoryPatch,Rh as applyInvocationAuthorOverride,Rl as applyPathMigrations,rS as applyReadOutputDimensions,Zw as applyReadOutputIncludeModes,Uw as applyReadOutputSessionReferences,lT as applyRegisteredItemFieldDefaultsAndValidation,Ml as applyStandaloneNote,fl as applyStoredExtensionMigrationState,hT as applyTagRemovals,KI as applyTerminalOrderingPolicy,xl as artifactKey,Wb as asRecordClone,Kb as asRecordOrNull,He as assembleWorkspaceRelationshipGraph,Ov as assertCompleteListResult,yM as assertExtensionBlueprint,gM as assertExtensionCapabilityUsage,Qk as assertExtensionDeactivated,TM as assertExtensionManifestCompatible,CM as assertExtensionManifestMatchesBlueprint,wM as assertExtensionPreflight,Zc as assertHierarchyMutationAllowed,UP as assertHistoryCompactTarget,TR as assertHistoryRepairTarget,qi as assertInitializedTracker,Il as assertLinkedArtifactMutationIsUnambiguous,vM as assertMcpClientCapabilities,AM as assertMcpProtocolHeader,xy as assertMemoryRelationshipGraphAdapterConformance,bT as assertNoUnknownCsvKeys,eM as assertPackageManifest,_E as assertParentReferenceIsNotSelf,P0 as assertPmMcpSkillsCapability,bM as assertProjectProfile,hx as assertProjectRuntimeCompatibility,JT as assertProjectionModeChoice,Bi as assertReadableTrackerRoot,tM as assertRegisteredCommandContract,uM as assertRegisteredCommandOverride,aM as assertRegisteredExporter,rM as assertRegisteredFlags,oM as assertRegisteredHook,sM as assertRegisteredImporter,cM as assertRegisteredItemField,dM as assertRegisteredItemType,hM as assertRegisteredMigration,pM as assertRegisteredParserOverride,mM as assertRegisteredPreflightOverride,lM as assertRegisteredProfile,fM as assertRegisteredRendererOverride,nM as assertRegisteredSearchProvider,_M as assertRegisteredServiceOverride,iM as assertRegisteredVectorStoreAdapter,OC as assertRelationshipEdgeAllowed,po as assertRelationshipGraphAdapterConformance,Zv as assuranceAssertionUpdateIsLoosening,ES as attachContextIntentReceipt,aS as attachContextUsageServingReceipt,Xl as attachLinkedTestMutationProvenance,Wl as attachLinkedTestProvenance,et as attachMcpServerInfo,ow as attachOutputOmissionReceipt,vS as attachOutputTokenAccounting,AS as attachReadOutputContracts,Bw as attachReadOutputSessionReceipt,el as auditMergeAttributeFence,GO as auditMergeDriverConfiguration,vd as auditWorkspaceRelationshipGraph,_0 as authorizeMcpHttpRequest,Rn as boundAgentEpisodeIdentity,Tw as boundReadOutputRows,$u as buildChildrenByParent,mP as buildCompactSearchFilterSummary,JR as buildContentFilterEcho,vI as buildContextSignalSnapshot,iy as buildCorpusShapeItemPlan,KA as buildDefectRecurrenceIndex,ll as buildExtensionDescribeResult,gl as buildExtensionInstallPlan,ZR as buildGovernanceMissingFilterEcho,SE as buildInvalidTypeError,sP as buildItemChildrenRollup,Ek as buildItemCompletionMutations,lI as buildItemContextRelevanceCandidates,HE as buildItemNotFoundError,cP as buildItemSchedule,AR as buildLinkedFileRepairReport,s0 as buildMcpAuthorizationDiscoveryUrls,Mh as buildMcpCompleteResult,RM as buildMcpDiscoverResult,u0 as buildMcpDynamicRegistrationMetadata,ZM as buildMcpHttpRequestHeaders,xM as buildMcpInputRequiredResult,i0 as buildMcpProtectedResourceMetadata,Zd as buildMergeAttributePatterns,kc as buildPmActionToolInputSchema,aN as buildPmRefusalClosureCensus,RO as buildRelationshipContext,JE as buildSearchCorpus,QE as buildSemanticCorpusInput,ER as buildStatusRoleWarnings,Ui as buildTrackerInitializationRecovery,iA as buildVectorizationEmbeddingIdentity,sA as buildVectorizationEmbeddingMetadata,fP as buildVerboseSearchFilters,qO as buildWorkflowCompletenessCheck,xI as buildWorkspaceMemorySnapshot,On as canonicalDocument,mC as canonicalizeCommandOptionKey,cI as canonicalizeContextRecencyCoordinate,EC as canonicalizeRelationshipKind,Zx as censusPmRecoveryReferenceProducers,vv as certifyCompleteListResult,Dk as checkExtensionManifestCompatibility,j_ as claim,G_ as claimNext,kO as classifyHistoryAuthorEvent,Yn as classifyHistoryEvent,gR as classifyHistoryMergeReceiptReferences,CC as classifyHostEnvironmentFault,SP as classifyImplicitSemanticFallbackReason,Tn as classifyItemFormatVersion,Ym as classifyLinkedTestCommandSafety,Jm as classifyLinkedTestFailure,tT as clearActiveExtensionHooks,Nd as clearDurableGraphCache,qT as clearFocusedItem,Vc as clearWorkspaceContractsCache,F_ as close,Wu as closeItem,W_ as closeTask,Eh as coalesceRepeatedListFlags,IR as collectBlockedByIds,kR as collectBlockedByIdsFromCorpus,dS as collectContextUsageDeliveredItemIds,rd as collectDanglingDependencyReferences,xR as collectDependencyBlockedIds,ed as collectDuplicateDependencyRows,Ad as collectDuplicateRelationshipEdgeGroups,wP as collectErrorCauseCodes,Wc as collectHierarchyRelations,Or as collectMcpHeaderAnnotations,od as collectMissingDependencyTargetIds,tp as collectNewOrderingCycleWarnings,wd as collectOrderingCycles,td as collectOrderingStorageContradictions,kv as collectPackageContextIntentContracts,Bt as collectPackageExtensionDirectories,cT as collectRegisteredItemFieldNames,LT as collectRuntimeCreateFieldValues,EE as collectRuntimeFilterValues,DT as collectRuntimeUpdateFieldValues,Mu as collectSubtreeIds,dn as collectUsedExtensionCapabilities,fC as commandOptionFlagLabel,Kf as comments,vf as commitImportedItem,Ak as commitItemCompletion,Sk as commitItemMutations,mv as commitWorkspaceTransaction,Vs as compactFlagAliasContracts,xu as compareCriticalItems,G as comparePmDateVersions,uv as compareRelationshipSnapshots,Xb as compareTimestampStrings,Bv as compileHistoryProvenanceMatcher,bS as composeContextIntentContracts,Ik as composeExtension,Lk as composeExtensionPackage,LR as computeActionabilityReport,QS as computeHistoryDiff,yd as computeRelationshipCentrality,gd as computeRelationshipDominators,nd as computeWorkspaceGraphFingerprint,n_ as config,eT as consumeAfterCommandAffectedItems,Ff as context,SS as contextIntentRowId,B_ as copy,Zm as countFailureCategories,bw as countReadOutputRows,L_ as create,_O as createAssurancePreset,QR as createAssuranceWorkspaceContext,Jb as createCheckpointId,Ev as createCompleteListOptions,jC as createCoreCommandHookContext,no as createCorpusShapeMeasurement,oO as createEmptyAssuranceDocument,IC as createEmptyExtensionRegistrationRegistry,Gc as createExtensionCommandSdk,an as createExtensionContributionInventory,SM as createExtensionTestHarness,Ni as createHistoryEntry,wA as createLazyModule,zO as createLifecycleCompletenessPolicies,h0 as createMcpStaticBearerVerifier,KM as createMcpTaskStore,VE as createMutationGuardSdk,ZT as createOutputOmissionReceipt,Fc as createPmCliExpectedError,Ih as createPmCliProgram,vi as createPmCommandOutputBudget,iw as createQueryFingerprint,My as createRelationshipGraphScaleFixture,Q as createRelationshipGraphSnapshot,Rt as createRelationshipKindRegistry,ds as createReproducibleProcessRunner,_P as createSearchCursorFingerprint,GC as createSerialQueue,AT as createStdinTokenResolver,iC as createUnknownSubcommandError,xw as createWorkflowPolicyEvaluator,Qp as createWorkspaceSnapshot,jk as deactivateExtensionForTest,KN as declineServiceOverride,wS as decodeContextIntentCursor,TA as decodeHtmlEntitiesInOptions,vr as decodeMcpHttpHeaderValue,dw as decodeQueryCursor,aw as decodeQueryCursorEnvelope,cw as decodeQueryCursorState,$w as decodeReadOutputContinuationCursor,T0 as decoratePmMcpToolsWithApps,Ll as dedupeLinkedArtifacts,pI as defaultScoreContextCandidates,QN as defineAfterCommandHook,JN as defineBeforeCommandHook,ZN as defineBeforeMutationHook,LN as defineCommand,BN as defineCommandOverride,X as defineCorpusShape,G0 as defineEpisodeSpecification,YN as defineExporter,Ok as defineExtension,Rk as defineExtensionBlueprint,xN as defineExtensionManifest,DN as defineFlag,XN as defineImporter,FN as defineItemField,$N as defineItemType,jN as defineMigration,Xg as defineObservationContract,rL as defineOnIndexHook,tL as defineOnReadHook,eL as defineOnWriteHook,qN as defineParserOverride,Oi as definePmCommandOutputBudget,JP as definePmCommandOutputEnvelope,KP as definePmErrorCodeCatalog,zN as definePreflightOverride,NN as defineProjectProfile,WN as defineRendererOverride,GN as defineSearchProvider,VN as defineServiceOverride,UN as defineVectorStoreAdapter,Qg as defineVerdictContract,Ee as defineWorkspaceRecipe,q_ as deleteItem,im as deleteWorkspaceSnapshot,RC as dependencyToRelationship,e_ as deps,gO as deriveAssuranceProposals,kk as deriveExtensionCapabilities,QI as derivePmBulkMutationEffect,Qx as derivePmRecoveryReferenceObligations,Td as deriveRelationshipDeadlines,nl as deriveSchemaEvolutionMigrationId,fA as deriveTelemetryCommandResolution,RE as describeAllowedTransitions,MO as describeExtensionActivation,Mk as describeExtensionBlueprint,_u as describeItemOwnershipConflict,j0 as describeObservationCost,Zt as describeProfileComposition,Qt as describeProjectProfile,ak as describeUnknownError,Gn as detectAgentIdentity,zn as detectHarnessIdentity,_d as detectRelationshipCommunities,Un as diagnoseAgentIdentity,Od as diffRelationshipAuditSnapshots,Vm as diffTestRunMeasurements,DM as digestMcpRequestParameters,DC as discoverExtensions,tn as discoverNearbyPmRoot,JL as discoverPmTools,vy as discoverProjectRuntimeVersionPins,Qf as docs,Hf as duplicates,Pd as durableGraphCachePath,Ld as durableGraphCacheStatus,bn as effectiveItemFormatVersion,kA as emitTelemetryErrorEvent,Af as emptyImportedDocument,JO as encodeItemScalarDecisionValue,Ar as encodeMcpHttpHeaderValue,sw as encodeQueryCursor,Dw as encodeReadOutputContinuationCursor,eE as enforceHistoryStreamPolicyForItem,tE as enforceHistoryStreamPolicyForItems,zP as enrichCliFlagInvocationContract,nr as enrichCliFlagInvocationContracts,rv as ensureMaterializedHistoryTarget,zc as ensurePmGitignore,Sl as ensureScope,mA as ensureSentryInit,Ef as ensureTrackerInitialized,md as enumerateRelationshipPaths,Pi as estimatePmOutputTokens,iO as evaluateAssuranceAssertion,sO as evaluateAssuranceGate,nx as evaluateBoundaryFixtures,hI as evaluateContextRanking,XA as evaluateDefectGateEvidence,nO as evaluateMeasurement,Xi as evaluateMutationGuard,$m as evaluateProvenanceCoverage,Nm as evaluateSemanticAttributionCoverage,sp as evaluateSimilarityGovernance,OE as evaluateTransition,ey as evaluateVerdictContract,Mw as evaluateWorkflowPolicies,eA as executeEmbeddingBatchesWithRetry,oA as executeVectorDelete,nA as executeVectorReset,rA as executeVectorUpsert,Vg as executeWorkspaceRecipe,kl as expandAddGlobEntries,Ul as explainSourceTraceability,X_ as extension,J_ as extensionActivate,Z_ as extensionDeactivate,Y_ as extensionList,gb as extensionMigrate,hR as extractHistoryMergeReceiptDispositions,_R as extractHistoryMergeReceiptReferences,p0 as extractMcpTraceContext,ZA as extractPatchFailureContext,Vl as extractReferencedPmItemIdsFromCommand,ky as federateRelationshipGraphSnapshots,Yf as files,Jf as filesDiscover,Zf as filesLookup,lS as finalizeContextUsageDelivery,uy as findCoverageDeficits,ip as findDuplicateClusters,Jd as findGitWorkspaceRoot,kT as findHistoryIdentityDiscontinuities,cl as findInstalledNpmPackageCandidate,C0 as findPmMcpAppByUri,hd as findRedundantRelationshipEdges,bd as findRelationshipCutStructure,op as findSimilarItems,PA as finishTelemetryCommand,rC as flattenFlagListValue,cy as flushTelemetryQueue,V_ as focus,fd as forEachMatchedRelationshipEdge,Ed as formatDuplicateEdgeGroup,Yc as formatHierarchyRelation,Sd as formatOrderingStorageContradiction,DA as formatPmPositionalActionFlagTip,ym as formatProfileApplyHuman,gm as formatProfileLintHuman,_m as formatProfileListHuman,hm as formatProfileShowHuman,al as formatSchemaEvolutionMigrationHuman,AP as formatVectorIndexRecoveryWarnings,DP as formatWorkspacePositionHuman,I_ as gc,Fi as generateItemId,Bf as get,JC as getActiveCommandResult,gS as getActiveContextIntentContracts,un as getActiveExtensionRegistrations,f0 as getActiveMcpTraceContext,cO as getAssuranceDeclaration,ph as getContracts,UT as getFocusedItem,nn as getHistoryPath,iv as getItemAt,on as getItemPath,Zi as getMutationActionContract,qc as getPmGitignoreBlock,rn as getSettingsPath,uh as getWorkspaceContracts,oE as getWorkspaceHistoryPath,t_ as graph,kd as graphAuditBaselinePath,Lm as groupHistoryByEpisode,HN as handleServiceOverride,OM as hasMcpClientExtension,b0 as hasPmMcpAppsCapability,Ve as hasSubcommandFlagContractsForCommand,aA as hasVectorizationEmbeddingIdentityChanged,cA as hasVectorizationVectorDimensionChanged,BS as hashDocument,qS as hashDocumentForVersion,zS as hashEmptyDocument,DS as hashHistoryPatch,LS as hashHistoryRecord,$S as hashHistoryStream,ZO as hashItemScalarDecisionValue,R_ as health,dd as hierarchyAncestors,ld as hierarchyDescendants,x_ as historyCompact,N_ as historyCompactBulk,Uv as historyEntryMatchesProvenance,ve as historyItemHashVersionForRuntime,P_ as historyRedact,k_ as historyRepair,M_ as historyRepairAll,PR as indexBlockedByIds,Jc as indexHierarchyRelations,dA as inferConsistentVectorDimension,Ai as inferPmOutputBudgetClass,o_ as init,Av as inspectCompleteListResult,PC as inspectExtensionManifestSchema,qd as inspectHistoryAuthorStream,sR as inspectMergeReceiptEvidence,Ry as inspectProjectRuntimeCompatibility,is as inspectStaleInProgressItems,SR as inspectStatusRoleAssignments,nE as inspectWorkspaceHistoryState,em as inspectWorkspaceSnapshot,ol as installMergeFence,IM as interpretMcpResultType,zu as isAlreadyClaimedError,lk as isCommanderError,lu as isErrnoError,qA as isExternalDependencyReference,zA as isExternalDependencySourceKind,me as isFileMissingError,cC as isHostOutputSuppressed,YO as isItemScalarMissingValue,pR as isLegacyMergeReceiptSummary,_ as isMcpRecord,Yi as isMutationAction,vC as isOrderingRelationshipKind,mE as isPlaceholderReferenceToken,jc as isPmCliExpectedError,hi as isPmExtensionCapabilityContract,yi as isPmExtensionPolicyModeContract,bi as isPmExtensionPolicySurfaceContract,gi as isPmExtensionServiceNameContract,JI as isPmKnownExitCode,QP as isPmMutationReceipt,Ke as isPmSuccessfulExitCode,_i as isPmToolAction,mR as isPreDurableCloneLocalReceiptSummary,fR as isPreDurableDispositionEligibleReference,Oy as isProjectMutatingInvocation,SA as isPureSnakeCaseAlias,oS as isReadOutputBudgetExceeded,ew as isReadRowContract,Bd as isRuntimeRecord,vA as isTerminalPlanMode,FT as isTerminalStatus,Vo as isTimestampLiteral,Tk as itemDocumentToMutationOptions,aP as itemHasSchedule,Qi as jaccardSimilarity,Xf as learnings,oC as levenshteinDistanceWithinLimit,au as limitAnnotationEntries,Yl as linkedTestTrustFingerprint,xk as lintExtensionBlueprint,kC as lintExtensionManifestSchema,rr as lintProjectProfile,jf as list,Ln as listAgentProvenanceAdapters,Sh as listAliasPluralKeys,Gf as listAllComplete,qE as listAllDocumentCandidatesCached,Hi as listAllItemMetadata,zE as listAllItemMetadataLight,aO as listAssuranceDeclarations,mO as listAssuranceVerdicts,oy as listBuiltinCorpusShapes,fk as listCoreClosedDomainContracts,VR as listGetProjectionFields,KO as listInvalidProvenanceHistoryStreamIds,qR as listListProjectionFields,aR as listMergeReceipts,Ji as listMutationActions,kP as listMutationEvents,wo as listPmCommandFlagBudgets,Sm as listPmCommandsForFamily,wm as listPmCommandsForTier,xe as listPmFlagLexicon,IN as listPmFlagSpellingInventory,Em as listPmMcpToolsForProfile,bN as listPmRequiredArgumentRefusalContracts,CN as listPmSubcommandRefusalContracts,Jt as listProfiles,SN as listTrackerPreflightRecoveryContracts,tm as listWorkspaceSnapshots,Mv as loadContextIntentRuntimeLayers,am as loadCreateTemplateOptions,$C as loadExtensions,$d as loadGraphAuditBaseline,Qb as loadMutationCheckpoint,N as loadRelationshipGraphAdapter,zi as locateItem,yT as looksLikeGenericKeyValueEntry,Cw as mapReadOutputRows,cR as markMergeReceiptReconciled,AE as matchesRuntimeFilters,RA as maybeRunFirstUseTelemetryPrompt,sy as measureCorpusShapePlan,Gi as measureItemMetadataReadWork,_T as mergeAdditiveTags,Pk as mergeExtensionBlueprints,QO as mergeHistoryStreams,oR as mergeItemDocuments,nR as mergeJsonDocuments,Ah as mergeLinkedTestTwoTokenEntries,eR as mergeRelationshipEventStreams,ju as mergeSortedWarnings,AA as migrateItemFilesToFormat,WE as mutateItem,KE as mutateItemWithHistoryContext,aE as mutateWorkspaceJsonWithHistory,qf as next,$n as normalizeAgentProvenanceAdapterValue,su as normalizeAnnotationTransportOptions,Wv as normalizeAssuranceEvaluation,Kv as normalizeAssuranceMutation,vh as normalizeBootstrapInvocation,IT as normalizeBulkIdsValue,Qc as normalizeDependencyGraphTarget,vO as normalizeDependencySeedId,AO as normalizeDependencySourceKind,sn as normalizeExtensionContributionInventory,HO as normalizeInvalidHistoryProvenance,ok as normalizeItemAddressInvocation,Cn as normalizeItemFormatVersion,$i as normalizeItemId,En as normalizeItemMetadata,OO as normalizeItemReference,wh as normalizeLegacyExtensionActionSyntax,Pl as normalizeLinkedPath,pE as normalizeParentReferenceValue,Xt as normalizeProfileName,Di as normalizeRawItemId,Qw as normalizeReadOutputIncludeModeOptions,WS as normalizeReplayPatchOps,es as normalizeSimilarityText,$T as normalizeStatusForRegistry,Sn as normalizeStatusInput,xT as normalizeStatusInputWithRegistry,dk as normalizeThrownExitCode,Wf as notes,zo as nowIso,Md as openDurableGraphCache,LM as openMcpRequestState,U0 as openPmEpisode,ud as orderingPredecessors,pd as orderingSuccessors,TI as packContextCandidates,Nu as packRankedContextItems,ch as packageActivate,ah as packageCatalog,dh as packageDeactivate,ih as packageDescribe,oh as packageDoctor,th as packageInstall,Q_ as packageLifecycle,eh as packageList,nh as packageManage,yb as packageMigrate,sh as packageReload,rh as packageUninstall,uw as paginateQueryRows,El as parseAddEntries,Al as parseAddGlobEntries,du as parseAnnotationTextInput,yk as parseAtomicMutationControls,Ch as parseBootstrapCommandName,gh as parseBootstrapGlobalOptions,bh as parseBootstrapHelpRequest,Oh as parseBootstrapTypeValue,RT as parseBulkIdsText,Pu as parseContextDepth,vu as parseContextFocusFields,Iv as parseContextIntentDeclarations,ku as parseContextSections,AI as parseContextSignalSnapshot,gT as parseCsvKv,JA as parseDefectChangeRiskRequest,eI as parseDefectRecurrenceCoverageRequest,YA as parseDefectRecurrencePolicy,zp as parseEvalQuerySet,Gd as parseGraphSubcommand,jv as parseHistoryProvenanceFilters,Nv as parseIntegerLimit,jT as parseItemDocument,bk as parseItemMutationBatch,wE as parseLimit,bp as parseLinkedTestAssertionEqualsMap,Cp as parseLinkedTestAssertionGteMap,mp as parseLinkedTestBoolean,fp as parseLinkedTestContextMode,pp as parseLinkedTestEnvClear,up as parseLinkedTestEnvSet,Tp as parseLinkedTestJsonEntries,yp as parseLinkedTestMinLines,gp as parseLinkedTestRegexList,hp as parseLinkedTestStringList,_p as parseLinkedTestWorkspaceContextMode,$h as parseMcpCachePolicy,Ph as parseMcpImplementation,ot as parseMcpInputRequests,fr as parseMcpInputResponses,ag as parseMcpSubscriptionFilter,Ol as parseMigrateEntries,DR as parseMultiValueFilter,ek as parseMutationReceipt,OT as parseOptionalNonNegativeInteger,vT as parseOptionalNumber,Vx as parsePmAgentTaskTranscriptCorpus,YL as parsePmToolDiscoveryOptions,Lv as parsePriority,jR as parsePriorityFilterSet,Gw as parseReadOutputSession,dT as parseRegisteredItemFieldAssignments,ce as parseRelationshipGraphSnapshot,vl as parseRemoveEntries,Gl as parseSourceLineRange,yE as parseStatusFilterCsv,$R as parseStringFilterSet,fn as parseTags,qm as parseTestRunMeasurements,Dv as parseType,FR as parseTypeFilterSet,Kd as parseUnknownAuthorHistoryEventCoordinates,vw as parseWorkflowPolicy,Ow as parseWorkflowPolicyDocument,UI as partitionDecisionEntries,ZS as patchPathToChangedField,Uo as pathExists,K_ as pauseTask,xd as persistDurableGraphResult,IE as persistSelectedItemFormat,pP as planAgentIdentityVocabularyMutation,kI as planCompletedAtBackfill,yl as planExtensionDirectoryCopy,or as planProfileApplication,Xx as planRelationshipEventBackfill,jd as planRelationshipRemediation,il as planSchemaEvolutionMigration,Vd as planUnknownAuthorHistoryAcknowledgment,rm as planWorkspaceSnapshotRestore,jA as positionalShapeKey,GA as positionalSignatureKey,$k as preflightExtension,rs as prepareSimilarityText,TT as preserveMutationStdinTokenFields,CT as preserveMutationStdinTokenLiterals,PS as printError,IS as printResult,w_ as profile,A_ as profileApply,v_ as profileLint,S_ as profileList,E_ as profileShow,QC as projectAfterCommandItemSnapshot,Ou as projectContextFocusRows,Um as projectFleetAttributionAnalytics,Gv as projectHistoryProvenance,Mi as projectPmDiagnosticOutput,xi as projectPmDiagnosticText,jm as projectProvenanceCoverageAnalytics,eu as projectValidateCounts,bO as promoteAssuranceAssertion,cS as propagateContextUsageServingReceipt,lx as pruneCompileCacheGenerations,dO as putAssuranceDeclaration,lO as putAssuranceDeclarationBundle,DE as queryItemMetadataIndex,$E as queryLinkedFileMetadataIndex,FE as querySimilarItemMetadataIndex,zm as queryTestRunMeasurementsBelow,Zn as quoteCommandArg,Jn as quoteWindowsCommandArg,mk as rankCommandPaths,cu as readAnnotationEntries,Bn as readAuthorEnvironment,nf as readBooleanOption,_S as readContextUsageAffinity,sf as readCsvListOption,ml as readExtensionMigrationState,Bo as readFileIfExists,gs as readFirstStringFromCommanderOptions,ys as readFirstValueFromCommanderOptions,Dm as readHistoryAnalyticsWindow,HT as readHistoryEntries,Hn as readHistorySnapshot,Im as readImprovementLedger,UE as readItemMetadataDerivedIndexState,Vi as readLocatedItem,yw as readOutputBudgetCollections,Lw as readOutputCollectionFingerprint,gw as readOutputContinuationRowCollections,_w as readOutputContinuationRowPaths,Jw as readOutputIncludeModeOptions,hw as readOutputRowCollections,fw as readOutputRowPaths,qw as readOutputSessionRemainingTokens,Ut as readPmPackageManifest,mh as readRequiredString,ji as readSettings,PE as readSettingsWithMetadata,bs as readStringArrayFromCommanderOptions,of as readStringOption,ck as readThrownExitCode,lA as readVectorizationStatusLedger,LE as readWorkflowPolicies,Rw as readWorkflowPolicyField,Pv as readWorkspaceContextIntentContracts,II as readWorkspaceContextSignals,NI as readWorkspaceMemory,LP as readWorkspacePosition,JS as reanchorHistoryEntries,ln as reconcileExtensionCapabilityUsage,dE as reconcileWorkspaceJsonHistory,ZC as recordAfterCommandAffectedItem,pO as recordAssuranceVerdict,Tu as recordClaimSemanticAttribution,pS as recordContextUsageDelivery,uS as recordContextUsageServing,mS as recordContextUsageTouch,fS as recordContextUsageTouches,Su as recordFocusSemanticAttribution,Rm as recordImprovementObservation,wu as recordReleaseSemanticAttribution,BE as refreshItemMetadataDerivedIndex,tl as refreshMergeAttributeFenceIfInstalled,pA as refreshSearchArtifactsForMutation,Dn as registerAgentProvenanceAdapters,SO as registerExternalDependencyResolver,Nn as registerHarnessSignalDescriptors,KT as registerOutputMaterialFieldGroups,U_ as release,uO as removeAssuranceDeclaration,qo as removeFileIfExists,Fl as renameArtifactsResultKey,gu as renderCalendarMarkdown,yu as renderCalendarToon,Gu as renderContextMarkdown,ul as renderExtensionDescribeMarkdown,dl as renderExtensionSurfaceMarkdown,If as renderGuideMarkdown,sk as renderMissingOptionRetry,BI as renderNextMarkdown,_k as renderPmClosedDomainHelp,Qn as renderPmCommand,Go as renderPmCommandAliasMigrationHint,Om as renderPmCommandVisibilityMarkdown,kN as renderPmFlagLexiconMarkdown,w0 as renderPmMcpAppHtml,cN as renderPmRefusalClosureCensusMarkdown,CE as renderRowsAsCsv,TE as renderRowsAsTable,$_ as reopen,tv as replayHistoryToTarget,HS as replayToCanonicalItemDocument,VS as replayToItemDocument,VI as requireTerminalReason,HI as requireTerminalReasonWithRecovery,GS as resealHistoryRewrite,WC as resetActiveExtensionRuntimeState,ad as resetWorkspaceGraphCache,In as resolveAgentSessionContextFromSignals,fu as resolveAnnotationIndex,uu as resolveAnnotationInput,VT as resolveAuthor,Vn as resolveAuthorIdentity,uE as resolveBodyFileContent,ny as resolveBuiltinCorpusShape,hu as resolveCalendarOutputFormat,WP as resolveCanonicalPmErrorCodeContract,AC as resolveCanonicalRelationshipKind,zT as resolveClaimPrincipal,PT as resolveCliBulkIdsInput,gC as resolveCommandOptionPolicyState,dx as resolveCompileCacheGeneration,PI as resolveCompletionTimestamp,uC as resolveConfiguredPmPackageRoot,KR as resolveContentFieldFilters,CS as resolveContextIntentContract,Ru as resolveContextOutputFormat,Iu as resolveContextTokenBudget,rP as resolveCreateExplicitEmptyFlag,yP as resolveEffectiveSearchMode,XE as resolveEmbeddingProviders,bl as resolveExtensionInstallSourceIdentity,pl as resolveExtensionMigrationStatePath,LC as resolveExtensionRoots,EO as resolveExternalDependencyReference,tC as resolveFlagValueKind,Of as resolveGuideOutputFormat,Pm as resolveHistoryEpisodeGroupIdentity,Fv as resolveHistoryProvenanceDimensions,ov as resolveHistorySubject,QA as resolveHistoryTarget,CP as resolveHybridSemanticWeight,en as resolveImplicitPmRoot,Yb as resolveIsoOrRelative,MR as resolveItemBlockers,OR as resolveItemExecutionRole,Ck as resolveItemMutationDocument,Qo as resolveItemTypeRegistry,MT as resolveItemTypesFilePath,Qm as resolveLinkedTestFailureExitCode,Hl as resolveLinkedTestSourceRef,Kl as resolveLinkedTestSourceWorkspaceRoot,Jl as resolveLinkedTestTrust,Zl as resolveLinkedTestTrustBatch,cg as resolveMcpAcknowledgedSubscriptionFilter,Qe as resolveMcpRequestContext,Yd as resolveMergeInstallContext,HR as resolveMissingMetadataFilters,ik as resolveMissingOptionPlaceholder,QT as resolveModePairedOutputOmissionReceipt,jI as resolveNextOutputFormat,rw as resolveOutputOmissionReceipt,lC as resolvePmCliVersion,jo as resolvePmCommandAlias,Ye as resolvePmCommandCapabilityFamily,Vt as resolvePmCommandExitContract,Ii as resolvePmCommandOutputBudget,sr as resolvePmCommandOutputEnvelope,NA as resolvePmCommandPositionalContract,Je as resolvePmCommandVisibilityTier,ki as resolvePmDiagnosticOutputBudget,XP as resolvePmErrorCodeContract,mb as resolvePmFlagSemanticConcept,De as resolvePmHistoryOperation,dC as resolvePmPackageRootFromModule,LA as resolvePmPositionalActionContract,Ec as resolvePmPositionalActionFlagContracts,Fe as resolvePmRoot,Oc as resolvePmToolCustomFieldCollision,hE as resolvePriority,Yt as resolveProfile,Qd as resolveProjectMergeTypeFolders,lw as resolveQueryCursorStart,eS as resolveReadOutputDimensions,nS as resolveReadOutputEncoding,ww as resolveReadOutputRecoveryBudget,Xw as resolveReadOutputSurface,tw as resolveReadRowContract,nk as resolveRecoveryCommandName,uT as resolveRegisteredSearchProvider,pT as resolveRegisteredVectorStoreAdapter,cs as resolveReproducibleProcessEnvironment,hn as resolveRuntimeFieldRegistry,_n as resolveRuntimeStatusRegistry,YE as resolveSearchCorpusFields,gP as resolveSearchMaxResults,hP as resolveSearchPage,bP as resolveSearchScoreThreshold,TP as resolveSearchTuning,ZE as resolveSemanticCorpusCharacterLimit,Cu as resolveSemanticLineageIds,ME as resolveSettingsWithSemanticRuntimeDefaults,LO as resolveSourceContextWritePolicy,Cm as resolveStartTaskInProgressStatus,te as resolveSubcommandFlagContractsForCommand,zb as resolveTelemetryErrorCategory,zI as resolveTerminalReason,hC as resolveTypeDefinition,_C as resolveTypeName,bE as resolveTypeSynonym,vE as resolveTypeWorkflows,Hd as resolveUnknownAuthorAcknowledgmentSelector,EP as resolveVectorIndexRecovery,tA as resolveVectorStores,Kc as resolveWorkspaceRelationshipKindRegistry,bC as resolveWorkspaceRoot,z_ as restore,eC as restoreCheckpointItems,lE as restoreWorkspaceJsonFromHistory,nm as restoreWorkspaceSnapshot,om as restoreWorkspaceSnapshotWithRecovery,_h as runAction,rT as runActiveBeforeMutationHooks,nT as runActiveCommandHandler,oT as runActiveOnIndexHooks,mn as runActiveOnReadHooks,pn as runActiveOnWriteHooks,iT as runActiveParserOverride,sT as runActivePreflightOverride,aT as runActiveServiceOverride,Hc as runActivity,NC as runAfterCommandHooks,nu as runAggregate,mu as runAnnotationCommand,iu as runAppend,nI as runAssuranceAction,iI as runAssuranceDispatch,xC as runBeforeCommandHooks,bu as runCalendar,Vu as runClaim,Hu as runClaimNext,Xu as runClose,Ju as runCloseMany,Zu as runComments,Pf as runCompletion,xp as runConfig,zt as runContext,bI as runContextEvaluationCorpus,gI as runContextEvaluationScenario,Rp as runCopy,wp as runCreate,Ip as runDelete,cd as runDeps,jl as runDocs,tk as runDuplicates,Kp as runEval,Xp as runEvent,Cl as runExtension,hl as runExtensionMigrateAction,_l as runExtensionMigrations,Bl as runFiles,zl as runFilesDiscover,ql as runFilesLookup,Gm as runFleetAttributionAnalytics,Pp as runFocus,Mp as runGc,kp as runGet,Ud as runGraph,Rf as runGuide,Tl as runHealth,eP as runHistory,jP as runHistoryCompact,BP as runHistoryCompactBulk,yR as runHistoryMaintenance,FP as runHistoryRedact,CR as runHistoryRepair,wR as runHistoryRepairAll,Gp as runInit,$p as runInitAgentGuidance,Qu as runLearnings,$l as runLinkedArtifacts,ef as runLinkedTests,ou as runList,Wp as runMeet,RP as runMergeDriver,rl as runMergeInstall,lR as runMergeReceiptEvidenceReport,dR as runMergeReceiptReport,IP as runMergeReconcile,qu as runNext,ep as runNotes,Op as runPlan,fm as runProfileApply,mm as runProfileLint,um as runProfileList,pm as runProfileShow,Fm as runProvenanceCoverageAnalytics,Gk as runRegisteredCommandForTest,Vk as runRegisteredCommandOverrideForTest,Zk as runRegisteredExporterForTest,Bk as runRegisteredHookForTest,Jk as runRegisteredImporterForTest,Yk as runRegisteredMigrationForTest,Uk as runRegisteredMutationGuardForTest,qk as runRegisteredParserOverrideForTest,zk as runRegisteredPreflightOverrideForTest,Hk as runRegisteredRendererOverrideForTest,Wk as runRegisteredSearchProviderForTest,Kk as runRegisteredServiceOverrideForTest,Xk as runRegisteredVectorStoreAdapterForTest,ar as runReindex,Ku as runRelease,Yp as runRemind,qP as runReopen,Yu as runRestore,sl as runSchemaEvolutionMigration,Vp as runSearch,ay as runSearchRefreshWorkerEntrypoint,kf as runStartBackgroundRun,Hm as runStats,Wm as runTelemetry,dm as runTemplatesList,cm as runTemplatesSave,lm as runTemplatesShow,tf as runTest,rf as runTestAll,Mf as runTestRunsList,Nf as runTestRunsLogs,Df as runTestRunsResume,xf as runTestRunsStatus,Lf as runTestRunsStop,$f as runTestRunsWorker,Sp as runUpdate,Ep as runUpdateMany,Ht as runUpgrade,ru as runValidate,fh as runWithActiveExtensions,D as runWithAgentSessionContext,yS as runWithContextIntentContracts,xv as runWithDiscoveredContextIntentContracts,Fn as runWithHarnessDetectionSignals,m0 as runWithMcpTraceContext,ls as runWithReproducibleProcessEnvironment,jn as runWithWorkspaceHarnessSignalDescriptors,Yr as runWithWorkspaceRecipe,VO as runWorkflowPolicyAction,lP as runWorkspaceTransactionGc,Fd as saveGraphAuditBaseline,IO as scanExtensionHostVersions,zd as scanHistoryAuthorAttribution,wn as scanItemFormatVersions,Wi as scanMutationSecrets,WO as scanProvenanceResolverHealth,ss as scanStaleInProgressItems,vR as scanStorageIntegrity,i_ as schema,p_ as schemaAddField,l_ as schemaAddStatus,c_ as schemaAddType,h_ as schemaApplyPreset,g_ as schemaInferTypes,s_ as schemaList,f_ as schemaListFields,C_ as schemaRemapStatus,m_ as schemaRemoveField,u_ as schemaRemoveStatus,d_ as schemaRemoveType,b_ as schemaRenameField,y_ as schemaRenameType,a_ as schemaShow,__ as schemaShowField,T_ as schemaShowStatus,pk as scoreCommandPathMatch,mI as scoreContextCandidates,fI as scoreContextCandidatesWithActiveExtensions,os as scoreItemSimilarity,TN as scorePmGrammarRefusalClosure,uN as scorePmRefusalClosure,ns as scorePreparedItemSimilarity,EN as scoreTrackerPreflightRecoveryClosure,FS as sealHistoryRecord,NM as sealMcpRequestState,Uf as search,$I as searchWorkspaceMemory,FI as searchWorkspaceMemoryReadResult,NR as selectActionableEntries,nw as selectCursorSemanticOptions,Sf as selectImportAuthor,c0 as selectMcpClientRegistrationMode,DI as selectWorkspaceMemory,LI as selectWorkspaceMemoryRollups,Au as semanticAttributionAffinity,yA as sentryCaptureCliError,gA as sentryFinishCommandSpan,CA as sentryFlush,bA as sentryLogCliUsageError,_A as sentrySetCommandContext,hA as sentryStartCommandSpan,vn as serializeItemDocument,hk as serializeNdjsonRows,gk as serializeNdjsonStream,Yg as serveDeclaredObservation,XC as setActiveCommandContext,YC as setActiveCommandResult,BC as setActiveExtensionCommands,UC as setActiveExtensionHooks,qC as setActiveExtensionParsers,zC as setActiveExtensionPreflight,KC as setActiveExtensionRegistrations,HC as setActiveExtensionRenderers,VC as setActiveExtensionServices,BT as setFocusedItem,OA as shouldCompletePlanOnClose,Dd as shouldPersistDurableGraphCache,ET as shouldResolveMutationStdinTokenField,ST as shouldResolveMutationStdinTokens,NE as shouldRunSearchRefreshInForeground,rp as similarityAdvisoryWarnings,mw as sliceReadOutputRowCollection,Nl as sortLinkedArtifacts,mT as splitAcceptanceCriteria,EA as splitCommaList,An as splitFrontMatter,tS as stabilizeReadOutputReceiptEstimates,P as stableStringify,MC as stableValueEquals,H_ as startTask,IA as startTelemetryCommand,Vf as stats,NT as statusIsTerminal,yh as stripGlobalBootstrapTokens,MP as subscribeMutationEventBatches,xP as subscribeMutationEvents,uP as summarizeAgentIdentityVocabulary,Mm as summarizeAgentModelProvenance,xm as summarizeAgentProvenance,yI as summarizeContextEvaluationReports,Xm as summarizeContextPreflight,qv as summarizeHistoryProvenance,Fp as summarizeInitResult,iR as summarizeMergeReceipt,oP as supportsCreateExplicitEmpty,rk as supportsItemIdAlias,aC as suppressHostOutput,Pe as syncRelationshipGraphAdapter,Nk as synthesizeExtensionManifest,Ac as toCompletionFlagString,Fu as toContextFocusItem,Lu as toContextPackingSummary,Du as toContextRankingSummary,Hb as toErrorMessage,cf as toEstimatedMinutesValue,bv as toExtensionFlagDefinitions,mf as toImportBoolean,gf as toImportConfidence,pf as toImportInteger,Tf as toImportLinkedDocs,Cf as toImportLinkedFiles,wf as toImportLinkedTests,bf as toImportLogEntries,yf as toImportNormalizedEnum,hf as toImportNumberMap,df as toImportPriority,uf as toImportStatus,ff as toImportStringList,_f as toImportStringMap,lf as toImportTags,GT as toItemRecord,af as toNonEmptyImportString,Vb as toNonEmptyStringOrUndefined,KS as toReplayDocument,ts as tokenizeSimilarityText,wT as transferMutationStdinTokenPolicy,TC as translateHostEnvironmentFault,D_ as update,lh as upgrade,O_ as validate,eO as validateAssertionDefinition,rO as validateAssuranceDocument,tO as validateGateDefinition,wk as validateItemMutationRows,Dl as validateLinkedPaths,d0 as validateMcpAuthorizationResponseIssuer,a0 as validateMcpAuthorizationServerMetadata,l0 as validateMcpClientMetadataDocument,QM as validateMcpHttpRequestHeaders,FM as validateMcpJsonSchema,Qv as validateMeasurementDefinition,fE as validateMissingParentReference,Yw as validateReadOutputOptions,gE as validateSprintOrReleaseValue,yC as validateTypeOptions,VP as verifyCliFlagInvocationParity,FA as verifyExplicitPositionalSlotCensus,YS as verifyHistoryChain,XS as verifyHistoryChainWithVersion,nv as verifyHistoryEntries,jS as verifyHistoryRecordHash,US as verifyHistoryRewriteEvidence,BA as verifyPmCliGrammar,UA as verifyPmCommandPositionalContracts,PN as verifyPmFlagLexicon,rN as verifyPmRecoveryKindRuntimeCoverage,ob as verifyPmRecoveryProducerRuntimeCoverage,tN as verifyPmRecoveryReferences,sN as verifyPmRefusalClosureIdentityRatchet,iN as verifyPmRefusalClosureRatchet,eN as verifyPmRefusalReachability,vs as verifyToolOptionCliParity,zs as withFlagAliasMetadata,wC as withHostEnvironmentBoundary,$M as withMcpCachePolicy,Pw as workflowApprovalFingerprint,kw as workflowPolicyApplies,Iw as workflowPolicyFingerprint,sd as workspaceGraphCache,pu as wrapOwnershipConflict,uk as wrapThrownErrorForSentry,qn as writeAuthorEnvironment,$e as writeFileAtomic,Zb as writeMutationCheckpoint,kE as writeSettings,RS as writeStderr,OS as writeStdout,uA as writeVectorizationStatusLedger,cE as writeWorkspaceJsonWithHistory};
33
33
  //# sourceMappingURL=sdk.js.map