@unbrained/pm-cli 2026.9.6 → 2026.9.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (719) 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 +5 -0
  6. package/.agents/skills/pm-user/references/ECOSYSTEM_PLANNING.md +95 -0
  7. package/.claude-plugin/marketplace.json +2 -2
  8. package/CHANGELOG.md +218 -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.js +19 -1893
  92. package/dist/cli/register-operations.js +1 -920
  93. package/dist/cli/register-setup.js +1 -716
  94. package/dist/cli/register-structured-mutation.js +1 -196
  95. package/dist/cli/registration-helpers.js +1 -5
  96. package/dist/cli/runtime-compatibility-boundary.js +4 -42
  97. package/dist/cli/schema-registration-helpers.js +1 -73
  98. package/dist/cli/search-refresh.js +1 -13
  99. package/dist/cli/stats-analytics-json.js +1 -68
  100. package/dist/cli/telemetry-flush.js +1 -10
  101. package/dist/cli-bundle/bundle-manifest.json +164 -156
  102. package/dist/cli-bundle/chunks/chunk-3BZZA6A3.js +5 -0
  103. package/dist/cli-bundle/chunks/chunk-AMRDVX36.js +235 -0
  104. package/dist/cli-bundle/chunks/chunk-DAM4CBBR.js +2202 -0
  105. package/dist/cli-bundle/chunks/{chunk-WYRZZ5ZE.js → chunk-DEZPZOQ7.js} +2 -2
  106. package/dist/cli-bundle/chunks/chunk-FLDWYEND.js +77 -0
  107. package/dist/cli-bundle/chunks/{chunk-NPN5I67J.js → chunk-G5ADGQ2D.js} +3 -3
  108. package/dist/cli-bundle/chunks/chunk-JAAEYHUA.js +2 -0
  109. package/dist/cli-bundle/chunks/{chunk-JX4DH4WC.js → chunk-KR3RP4FH.js} +3 -3
  110. package/dist/cli-bundle/chunks/chunk-LEZOUXG6.js +2 -0
  111. package/dist/cli-bundle/chunks/chunk-NSAPNEYH.js +2 -0
  112. package/dist/cli-bundle/chunks/chunk-QOEKOECV.js +29 -0
  113. package/dist/cli-bundle/chunks/chunk-RHSFOMHU.js +2 -0
  114. package/dist/cli-bundle/chunks/chunk-XOD2PCB6.js +20 -0
  115. package/dist/cli-bundle/chunks/{chunk-JT6XF6GE.js → chunk-YVEQ2AMO.js} +4 -4
  116. package/dist/cli-bundle/chunks/register-list-query-KSK3R63M.js +11 -0
  117. package/dist/cli-bundle/chunks/register-mutation-IQ5C7U6O.js +20 -0
  118. package/dist/cli-bundle/chunks/{register-operations-I5W3KMGB.js → register-operations-DWVHR2NC.js} +2 -2
  119. package/dist/cli-bundle/chunks/register-setup-BQ5SVD4B.js +2 -0
  120. package/dist/cli-bundle/focused-chunks/chunk-3WRPWLA7.js +3 -0
  121. package/dist/cli-bundle/focused-chunks/chunk-7MBUII7U.js +2 -0
  122. package/dist/cli-bundle/focused-chunks/chunk-COPBO5HW.js +8 -0
  123. package/dist/cli-bundle/focused-chunks/chunk-DUN4IXYN.js +20 -0
  124. package/dist/cli-bundle/focused-chunks/{chunk-LIJIA4TY.js → chunk-EE5QSM4Z.js} +3 -3
  125. package/dist/cli-bundle/focused-chunks/chunk-HJVARYM3.js +6 -0
  126. package/dist/cli-bundle/focused-chunks/chunk-IAUOUGVR.js +177 -0
  127. package/dist/cli-bundle/focused-chunks/chunk-KOOMJ54F.js +2 -0
  128. package/dist/cli-bundle/focused-chunks/chunk-MZDXX7JY.js +56 -0
  129. package/dist/cli-bundle/focused-chunks/{chunk-M6PBRFSH.js → chunk-OPFHFGDD.js} +2 -2
  130. package/dist/cli-bundle/focused-chunks/chunk-QHNETP77.js +9 -0
  131. package/dist/cli-bundle/focused-chunks/{chunk-3BZEOXLT.js → chunk-RMWES4M6.js} +2 -2
  132. package/dist/cli-bundle/focused-chunks/chunk-RXT4P5QH.js +10 -0
  133. package/dist/cli-bundle/focused-chunks/chunk-SDOL6FM2.js +12 -0
  134. package/dist/cli-bundle/focused-chunks/chunk-SQV4AAUC.js +2 -0
  135. package/dist/cli-bundle/focused-chunks/{chunk-PEFABF7E.js → chunk-WE3IUNIW.js} +3 -3
  136. package/dist/cli-bundle/focused-chunks/chunk-YALOUBWJ.js +2 -0
  137. package/dist/cli-bundle/main.js +20 -20
  138. package/dist/cli-bundle/sdk-authoring.js +1 -1
  139. package/dist/cli-bundle/sdk-contracts.js +2 -2
  140. package/dist/cli-bundle/sdk-core.js +29 -29
  141. package/dist/cli-bundle/sdk-governance.js +1 -1
  142. package/dist/cli-bundle/sdk-graph.js +1 -1
  143. package/dist/cli-bundle/sdk-merge.js +42 -42
  144. package/dist/cli-bundle/sdk-query.js +1 -1
  145. package/dist/cli-bundle/sdk-runtime.js +1 -1
  146. package/dist/cli-bundle/sdk-testing.js +1 -1
  147. package/dist/cli-bundle/sdk.js +11 -11
  148. package/dist/cli.js +1 -104
  149. package/dist/core/checkpoint/checkpoint-gc.js +1 -169
  150. package/dist/core/checkpoint/mutation-checkpoint.js +2 -133
  151. package/dist/core/config/nested-settings.js +1 -534
  152. package/dist/core/config/positional-value.js +1 -109
  153. package/dist/core/diagnostics/remediation.js +1 -506
  154. package/dist/core/extensions/activation-summary-markdown.js +2 -145
  155. package/dist/core/extensions/activation-summary.js +1 -92
  156. package/dist/core/extensions/activation-transaction.js +1 -46
  157. package/dist/core/extensions/capability-usage.js +1 -173
  158. package/dist/core/extensions/command-hook-context.js +1 -13
  159. package/dist/core/extensions/command-metadata-contract.js +1 -22
  160. package/dist/core/extensions/command-visibility-tier.js +1 -29
  161. package/dist/core/extensions/contribution-inventory.js +1 -173
  162. package/dist/core/extensions/exporter-output-contract.js +1 -66
  163. package/dist/core/extensions/extension-candidate.js +1 -18
  164. package/dist/core/extensions/extension-capability-aliases.js +1 -158
  165. package/dist/core/extensions/extension-hook-runtime.js +1 -699
  166. package/dist/core/extensions/extension-policy.js +1 -599
  167. package/dist/core/extensions/extension-registries.js +1 -62
  168. package/dist/core/extensions/extension-runtime-helpers.js +1 -33
  169. package/dist/core/extensions/extension-types.js +1 -102
  170. package/dist/core/extensions/flag-definition-validation.js +1 -52
  171. package/dist/core/extensions/flag-value-types.js +1 -64
  172. package/dist/core/extensions/index.js +1 -526
  173. package/dist/core/extensions/item-field-types.js +1 -39
  174. package/dist/core/extensions/item-fields.js +1 -261
  175. package/dist/core/extensions/loader.js +1 -2223
  176. package/dist/core/extensions/manifest-schema.js +1 -69
  177. package/dist/core/extensions/module-graph-snapshot.js +1 -33
  178. package/dist/core/extensions/preflight-ownership.js +1 -41
  179. package/dist/core/extensions/registration-validation.js +1 -82
  180. package/dist/core/extensions/registration-values.js +1 -209
  181. package/dist/core/extensions/reserved-host-flags.js +1 -36
  182. package/dist/core/extensions/runtime-registrations.js +1 -67
  183. package/dist/core/extensions/service-ownership.js +1 -19
  184. package/dist/core/extensions/version-compat.js +1 -216
  185. package/dist/core/fs/fs-utils.js +2 -158
  186. package/dist/core/fs/host-environment-errors.js +1 -141
  187. package/dist/core/fs/index.js +1 -9
  188. package/dist/core/fs/path-utils.js +1 -17
  189. package/dist/core/governance/content-fields.js +1 -160
  190. package/dist/core/governance/issue-codes.js +1 -151
  191. package/dist/core/governance/metadata-coverage.js +1 -358
  192. package/dist/core/history/drift-cache.js +3 -72
  193. package/dist/core/history/drift-scan.js +1 -342
  194. package/dist/core/history/event-classification.js +1 -109
  195. package/dist/core/history/event-index.js +8 -784
  196. package/dist/core/history/history-compact-bulk.js +1 -104
  197. package/dist/core/history/history-diff.js +1 -158
  198. package/dist/core/history/history-rewrite.d.ts +6 -1
  199. package/dist/core/history/history-rewrite.js +1 -107
  200. package/dist/core/history/history-storage-stats.js +1 -102
  201. package/dist/core/history/history-stream-policy.js +1 -62
  202. package/dist/core/history/history.js +2 -617
  203. package/dist/core/history/identity.js +1 -30
  204. package/dist/core/history/index.js +1 -9
  205. package/dist/core/history/projection.js +1 -196
  206. package/dist/core/history/read.d.ts +9 -0
  207. package/dist/core/history/read.js +1 -57
  208. package/dist/core/history/replay.js +2 -439
  209. package/dist/core/history/version-address.js +1 -32
  210. package/dist/core/history/workspace-history.js +2 -433
  211. package/dist/core/io/body-file.js +1 -62
  212. package/dist/core/io/bulk-ids-input.js +1 -112
  213. package/dist/core/item/actionability.js +1 -327
  214. package/dist/core/item/dependency-reference.js +1 -20
  215. package/dist/core/item/id.js +1 -112
  216. package/dist/core/item/index.js +1 -12
  217. package/dist/core/item/item-format-version.js +1 -78
  218. package/dist/core/item/item-format.js +5 -1473
  219. package/dist/core/item/item-record.js +1 -23
  220. package/dist/core/item/item-type-definition.js +1 -133
  221. package/dist/core/item/parent-reference-policy.js +1 -57
  222. package/dist/core/item/parse.js +2 -603
  223. package/dist/core/item/plan-lifecycle.js +1 -19
  224. package/dist/core/item/priority.js +1 -61
  225. package/dist/core/item/sprint-release-format.js +1 -38
  226. package/dist/core/item/status-filter.js +1 -115
  227. package/dist/core/item/status.js +1 -43
  228. package/dist/core/item/toon-decode.js +1 -29
  229. package/dist/core/item/type-registry.js +1 -715
  230. package/dist/core/item/type-synonyms.js +1 -38
  231. package/dist/core/lock/index.js +1 -9
  232. package/dist/core/lock/lock-gc.js +1 -240
  233. package/dist/core/lock/lock.js +3 -590
  234. package/dist/core/output/mutation-projection.js +1 -217
  235. package/dist/core/output/output-control.js +1 -25
  236. package/dist/core/output/output.js +11 -494
  237. package/dist/core/output/query-summary.js +1 -58
  238. package/dist/core/output/tabular.js +1 -77
  239. package/dist/core/packages/manifest.js +1 -244
  240. package/dist/core/packages/root.js +1 -84
  241. package/dist/core/profile/profile-describe.js +1 -83
  242. package/dist/core/profile/profile-lint.js +1 -415
  243. package/dist/core/profile/profile-plan.js +0 -0
  244. package/dist/core/profile/profile-presets.js +1 -370
  245. package/dist/core/reproducibility/context.js +1 -82
  246. package/dist/core/schema/fields-file.js +2 -288
  247. package/dist/core/schema/item-types-file.js +2 -296
  248. package/dist/core/schema/runtime-field-filters.js +1 -49
  249. package/dist/core/schema/runtime-field-values.js +1 -313
  250. package/dist/core/schema/runtime-schema.js +2 -826
  251. package/dist/core/schema/status-defs-file.js +2 -227
  252. package/dist/core/schema/status-token.js +1 -31
  253. package/dist/core/schema/type-inference.js +1 -95
  254. package/dist/core/schema/type-presets.js +1 -87
  255. package/dist/core/schema/type-workflows.js +1 -104
  256. package/dist/core/search/background-refresh.js +2 -286
  257. package/dist/core/search/bm25.js +1 -146
  258. package/dist/core/search/cache.js +2 -534
  259. package/dist/core/search/corpus.js +1 -311
  260. package/dist/core/search/embedding-batches.js +1 -163
  261. package/dist/core/search/eval.js +1 -225
  262. package/dist/core/search/http-client.js +1 -75
  263. package/dist/core/search/providers.js +1 -242
  264. package/dist/core/search/relevance.js +1 -244
  265. package/dist/core/search/semantic-defaults.js +1 -199
  266. package/dist/core/search/staleness.js +1 -30
  267. package/dist/core/search/vector-stores.js +2 -664
  268. package/dist/core/search/vectorization-metadata.js +1 -81
  269. package/dist/core/sentry/helpers.js +1 -272
  270. package/dist/core/sentry/instrument.js +1 -387
  271. package/dist/core/session/session-state.js +1 -260
  272. package/dist/core/shared/agent-session-context.js +1 -133
  273. package/dist/core/shared/author.js +1 -1172
  274. package/dist/core/shared/command-types.js +1 -4
  275. package/dist/core/shared/conflict-markers.js +1 -31
  276. package/dist/core/shared/constants.js +1 -405
  277. package/dist/core/shared/errors.js +1 -20
  278. package/dist/core/shared/html-entity-decode.js +1 -131
  279. package/dist/core/shared/index.js +1 -12
  280. package/dist/core/shared/item-metadata-contract.js +1 -89
  281. package/dist/core/shared/lazy-module.js +1 -16
  282. package/dist/core/shared/levenshtein.js +1 -61
  283. package/dist/core/shared/memo.js +1 -19
  284. package/dist/core/shared/numeric-parsers.js +1 -20
  285. package/dist/core/shared/option-alias-visibility.js +1 -67
  286. package/dist/core/shared/primitives.js +1 -127
  287. package/dist/core/shared/serial-queue.js +1 -79
  288. package/dist/core/shared/serialization.js +1 -210
  289. package/dist/core/shared/split-comma-list.js +1 -30
  290. package/dist/core/shared/text-normalization.js +1 -38
  291. package/dist/core/shared/time.js +1 -306
  292. package/dist/core/store/index.js +1 -12
  293. package/dist/core/store/item-format-migration.js +1 -125
  294. package/dist/core/store/item-metadata-cache.js +1 -1116
  295. package/dist/core/store/item-metadata-query-index.js +9 -394
  296. package/dist/core/store/item-metadata-read-work.js +1 -43
  297. package/dist/core/store/item-store.js +1 -693
  298. package/dist/core/store/paths.d.ts +1 -1
  299. package/dist/core/store/paths.js +1 -214
  300. package/dist/core/store/settings-read-cache.js +1 -85
  301. package/dist/core/store/settings-validator.js +1 -421
  302. package/dist/core/store/settings.js +3 -1309
  303. package/dist/core/store/tracker-preflight.js +1 -141
  304. package/dist/core/telemetry/consent.js +5 -108
  305. package/dist/core/telemetry/observability.js +1 -246
  306. package/dist/core/telemetry/runtime.js +4 -1988
  307. package/dist/core/test/background-runs.js +4 -945
  308. package/dist/core/test/item-test-run-tracking.js +1 -63
  309. package/dist/core/test/run-selectors.js +1 -120
  310. package/dist/core/validate/estimate-defaults.js +1 -89
  311. package/dist/core/validate/fix-planning.js +1 -189
  312. package/dist/core/validate/linked-artifact-reference.js +1 -36
  313. package/dist/core/validate/missing-by-type.js +1 -34
  314. package/dist/core/validate/missing-link-owners.js +1 -95
  315. package/dist/core/validate/stale-file-classification.js +1 -82
  316. package/dist/mcp/http-server.js +5 -448
  317. package/dist/mcp/legacy-adapter.js +1 -77
  318. package/dist/mcp/runtime-capabilities.js +1 -200
  319. package/dist/mcp/server.js +4 -1233
  320. package/dist/mcp/tool-definitions.js +1 -804
  321. package/dist/sdk/actionability.js +1 -13
  322. package/dist/sdk/agent/closed-domain-contracts.js +1 -161
  323. package/dist/sdk/agent/command-recovery.js +1 -59
  324. package/dist/sdk/agent/command-suggestions.js +1 -66
  325. package/dist/sdk/agent/create-option-policy.js +1 -31
  326. package/dist/sdk/agent/identity-config.js +1 -106
  327. package/dist/sdk/agent/item-addressing.js +1 -207
  328. package/dist/sdk/agent/refusal-closure-census.js +1 -151
  329. package/dist/sdk/agent/refusal-closure.js +1 -133
  330. package/dist/sdk/agent/refusal-corpus-contracts.js +1 -193
  331. package/dist/sdk/agent/refusal-reachability.js +1 -593
  332. package/dist/sdk/agent/subcommand-recovery.js +1 -83
  333. package/dist/sdk/agent/task-transcript-contracts.js +1 -197
  334. package/dist/sdk/agent/tracker-preflight-contracts.js +1 -126
  335. package/dist/sdk/agent-capability-contracts.js +1 -428
  336. package/dist/sdk/agent-session-context.js +1 -9
  337. package/dist/sdk/annotations.js +1 -448
  338. package/dist/sdk/author-attribution.js +1 -468
  339. package/dist/sdk/authoring.js +1 -20
  340. package/dist/sdk/cli-bootstrap.js +1 -838
  341. package/dist/sdk/cli-contracts/agent-output-contracts.d.ts +1 -1
  342. package/dist/sdk/cli-contracts/agent-output-contracts.js +4 -476
  343. package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -79
  344. package/dist/sdk/cli-contracts/command-aliases.d.ts +4 -0
  345. package/dist/sdk/cli-contracts/command-aliases.js +1 -107
  346. package/dist/sdk/cli-contracts/command-exit-contracts.js +1 -151
  347. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1081
  348. package/dist/sdk/cli-contracts/commander-types.js +1 -159
  349. package/dist/sdk/cli-contracts/completeness.js +1 -393
  350. package/dist/sdk/cli-contracts/enum-contracts.js +1 -222
  351. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1947
  352. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -347
  353. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -986
  354. package/dist/sdk/cli-contracts/registration-helpers.js +7 -990
  355. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +5 -0
  356. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -2090
  357. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +1 -324
  358. package/dist/sdk/cli-contracts/string-lists.js +1 -16
  359. package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -461
  360. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -2167
  361. package/dist/sdk/cli-contracts/tool-schema.d.ts +3 -1
  362. package/dist/sdk/cli-contracts/tool-schema.js +1 -1664
  363. package/dist/sdk/cli-contracts/typed-action-inputs.js +1 -4
  364. package/dist/sdk/cli-contracts.d.ts +1 -1
  365. package/dist/sdk/cli-contracts.js +1 -17
  366. package/dist/sdk/cli-program.js +1 -49
  367. package/dist/sdk/command-line.d.ts +2 -5
  368. package/dist/sdk/command-line.js +1 -78
  369. package/dist/sdk/comments.js +1 -133
  370. package/dist/sdk/compile-cache.js +1 -73
  371. package/dist/sdk/completion.js +157 -837
  372. package/dist/sdk/compose.js +1 -1090
  373. package/dist/sdk/config.js +1 -1204
  374. package/dist/sdk/context/recency.js +1 -33
  375. package/dist/sdk/context/semantic-session-attribution.js +1 -82
  376. package/dist/sdk/context/usage-egress.js +1 -29
  377. package/dist/sdk/context/usage-ledger.js +3 -185
  378. package/dist/sdk/context-intent-contracts.js +1 -709
  379. package/dist/sdk/context-intent-runtime.js +1 -115
  380. package/dist/sdk/context-packing.js +1 -218
  381. package/dist/sdk/context-relevance.js +1 -503
  382. package/dist/sdk/context-signal-store.js +2 -426
  383. package/dist/sdk/context-usage.js +1 -367
  384. package/dist/sdk/contracts.js +1 -23
  385. package/dist/sdk/core-governance.js +1 -14
  386. package/dist/sdk/core.js +1 -14
  387. package/dist/sdk/corpus-shape.js +1 -401
  388. package/dist/sdk/define.js +1 -220
  389. package/dist/sdk/dependencies.js +1 -718
  390. package/dist/sdk/dependency-flag-validation.js +1 -156
  391. package/dist/sdk/dependency-provenance.js +1 -135
  392. package/dist/sdk/docs.js +1 -14
  393. package/dist/sdk/duplicates.js +1 -40
  394. package/dist/sdk/environment/agent-environment.js +1 -466
  395. package/dist/sdk/environment/host-environment-errors.js +1 -8
  396. package/dist/sdk/environment/project-runtime-compatibility.js +1 -481
  397. package/dist/sdk/environment/source-context.js +1 -28
  398. package/dist/sdk/environment/tracker-preflight.js +1 -9
  399. package/dist/sdk/error-code-catalog.js +1 -153
  400. package/dist/sdk/error-runtime.js +1 -58
  401. package/dist/sdk/errors.js +1 -58
  402. package/dist/sdk/eval.js +1 -190
  403. package/dist/sdk/extension/author-manifest.js +1 -92
  404. package/dist/sdk/extension/bundled-catalog.js +1 -332
  405. package/dist/sdk/extension/concurrency.js +1 -25
  406. package/dist/sdk/extension/copy-scope.d.ts +2 -0
  407. package/dist/sdk/extension/copy-scope.js +2 -0
  408. package/dist/sdk/extension/custom-field-collisions.js +1 -30
  409. package/dist/sdk/extension/describe.js +3 -189
  410. package/dist/sdk/extension/doctor.js +1 -606
  411. package/dist/sdk/extension/install-plan.d.ts +69 -0
  412. package/dist/sdk/extension/install-plan.js +2 -0
  413. package/dist/sdk/extension/install-receipts.d.ts +7 -0
  414. package/dist/sdk/extension/install-receipts.js +2 -0
  415. package/dist/sdk/extension/install-runtime.js +3 -313
  416. package/dist/sdk/extension/install-snapshot.js +1 -66
  417. package/dist/sdk/extension/install-sources.js +5 -1057
  418. package/dist/sdk/extension/managed-state.js +2 -252
  419. package/dist/sdk/extension/migrations.js +2 -174
  420. package/dist/sdk/extension/output-ownership.js +1 -25
  421. package/dist/sdk/extension/runtime-summary.js +1 -18
  422. package/dist/sdk/extension/scaffold.js +4 -2308
  423. package/dist/sdk/extension/shared.js +1 -147
  424. package/dist/sdk/extension/source-resolution.js +1 -65
  425. package/dist/sdk/extension/update-check.js +1 -67
  426. package/dist/sdk/extension-command-context.js +1 -44
  427. package/dist/sdk/extension-contracts.js +1 -73
  428. package/dist/sdk/extension.d.ts +7 -2
  429. package/dist/sdk/extension.js +1 -2196
  430. package/dist/sdk/files.js +1 -535
  431. package/dist/sdk/flag-invocation-contracts.d.ts +0 -5
  432. package/dist/sdk/flag-invocation-contracts.js +1 -344
  433. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -2224
  434. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -2236
  435. package/dist/sdk/generated-error-code-catalog.js +1 -16
  436. package/dist/sdk/governance/assurance-action-contracts.js +1 -4
  437. package/dist/sdk/governance/assurance-action.js +1 -411
  438. package/dist/sdk/governance/assurance-limits.js +1 -10
  439. package/dist/sdk/governance/assurance-mutation-error.js +1 -81
  440. package/dist/sdk/governance/assurance-presets.js +1 -135
  441. package/dist/sdk/governance/assurance-runtime.js +1 -238
  442. package/dist/sdk/governance/assurance.js +4 -1182
  443. package/dist/sdk/governance/boundary-fixtures.js +1 -200
  444. package/dist/sdk/governance/coverage-assurance.js +1 -60
  445. package/dist/sdk/governance/defect-recurrence-coverage.js +1 -188
  446. package/dist/sdk/governance/defect-recurrence-graph.js +1 -120
  447. package/dist/sdk/governance/defect-recurrence-signals.js +1 -24
  448. package/dist/sdk/governance/defect-recurrence.js +1 -623
  449. package/dist/sdk/governance/extension-host-version.js +1 -115
  450. package/dist/sdk/governance/gc.js +1 -368
  451. package/dist/sdk/governance/health.js +1 -2367
  452. package/dist/sdk/governance/hierarchy-validation.js +1 -108
  453. package/dist/sdk/governance/linked-file-report.js +1 -71
  454. package/dist/sdk/governance/merge-receipt-history.js +1 -206
  455. package/dist/sdk/governance/provenance-health.js +1 -282
  456. package/dist/sdk/governance/reindex.js +4 -761
  457. package/dist/sdk/governance/stale-work.js +1 -82
  458. package/dist/sdk/governance/status-role-diagnostics.js +1 -35
  459. package/dist/sdk/governance/storage-integrity.js +1 -280
  460. package/dist/sdk/governance/tracked-runtime-cache.js +1 -106
  461. package/dist/sdk/governance/upgrade.js +2 -327
  462. package/dist/sdk/governance/validate-history-drift.js +1 -81
  463. package/dist/sdk/governance/validate-item-reader.js +1 -17
  464. package/dist/sdk/governance/validate-normalization.js +1 -36
  465. package/dist/sdk/governance/validate.js +1 -2261
  466. package/dist/sdk/governance/workspace-position.js +1 -163
  467. package/dist/sdk/governance.d.ts +1 -0
  468. package/dist/sdk/governance.js +1 -31
  469. package/dist/sdk/graph/adapter.js +1 -181
  470. package/dist/sdk/graph/analytics.js +1 -474
  471. package/dist/sdk/graph/assembly.js +1 -377
  472. package/dist/sdk/graph/cache.js +1 -160
  473. package/dist/sdk/graph/centrality.js +1 -258
  474. package/dist/sdk/graph/conformance.js +1 -130
  475. package/dist/sdk/graph/deadline-scheduling.d.ts +90 -0
  476. package/dist/sdk/graph/deadline-scheduling.js +2 -0
  477. package/dist/sdk/graph/durable-cache.d.ts +1 -1
  478. package/dist/sdk/graph/durable-cache.js +1 -361
  479. package/dist/sdk/graph/governance-contracts.js +1 -34
  480. package/dist/sdk/graph/governance.d.ts +13 -1
  481. package/dist/sdk/graph/governance.js +1 -735
  482. package/dist/sdk/graph/hierarchy-integrity.js +1 -310
  483. package/dist/sdk/graph/index.d.ts +3 -2
  484. package/dist/sdk/graph/index.js +1 -26
  485. package/dist/sdk/graph/lifecycle-coverage.d.ts +32 -0
  486. package/dist/sdk/graph/lifecycle-coverage.js +2 -0
  487. package/dist/sdk/graph/mutation-advisory.js +1 -176
  488. package/dist/sdk/graph/remediation.js +1 -197
  489. package/dist/sdk/graph/run.d.ts +15 -1
  490. package/dist/sdk/graph/run.js +1 -768
  491. package/dist/sdk/graph/scheduling.js +1 -124
  492. package/dist/sdk/graph/traversal.js +1 -284
  493. package/dist/sdk/graph/workspace-relationship-kind-registry.js +1 -27
  494. package/dist/sdk/graph.js +1 -15
  495. package/dist/sdk/guide-topics.js +1 -707
  496. package/dist/sdk/guide.js +1 -279
  497. package/dist/sdk/history/maintenance.d.ts +71 -0
  498. package/dist/sdk/history/maintenance.js +2 -0
  499. package/dist/sdk/history/salvage.js +2 -247
  500. package/dist/sdk/history/subject.d.ts +19 -0
  501. package/dist/sdk/history/subject.js +2 -0
  502. package/dist/sdk/history-analytics.js +1 -282
  503. package/dist/sdk/history-compact.js +1 -527
  504. package/dist/sdk/history-mcp.js +1 -68
  505. package/dist/sdk/history-provenance.js +1 -182
  506. package/dist/sdk/history-read.js +1 -96
  507. package/dist/sdk/history-redact.d.ts +1 -14
  508. package/dist/sdk/history-redact.js +1 -643
  509. package/dist/sdk/history-repair.d.ts +5 -0
  510. package/dist/sdk/history-repair.js +1 -657
  511. package/dist/sdk/improvement-ledger-validation.js +1 -62
  512. package/dist/sdk/improvement-ledger.js +2 -257
  513. package/dist/sdk/index.d.ts +4 -0
  514. package/dist/sdk/index.js +1 -183
  515. package/dist/sdk/init-agent-guidance.js +2 -496
  516. package/dist/sdk/init.js +2 -820
  517. package/dist/sdk/invocation-author.js +1 -39
  518. package/dist/sdk/item-children.js +1 -90
  519. package/dist/sdk/item-metadata-index.js +1 -15
  520. package/dist/sdk/item-schedule.js +1 -27
  521. package/dist/sdk/item-transaction.js +1 -396
  522. package/dist/sdk/learnings.js +1 -29
  523. package/dist/sdk/lifecycle/append.js +2 -53
  524. package/dist/sdk/lifecycle/claim.d.ts +2 -0
  525. package/dist/sdk/lifecycle/claim.js +1 -242
  526. package/dist/sdk/lifecycle/close-many.js +1 -438
  527. package/dist/sdk/lifecycle/close.js +1 -468
  528. package/dist/sdk/lifecycle/copy.js +1 -212
  529. package/dist/sdk/lifecycle/create.js +1 -1949
  530. package/dist/sdk/lifecycle/delete.js +1 -45
  531. package/dist/sdk/lifecycle/event-validation-messages.js +1 -91
  532. package/dist/sdk/lifecycle/focus.js +1 -91
  533. package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -24
  534. package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -149
  535. package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -40
  536. package/dist/sdk/lifecycle/mcp-actions.d.ts +2 -0
  537. package/dist/sdk/lifecycle/mcp-actions.js +1 -51
  538. package/dist/sdk/lifecycle/metadata-normalizers.js +1 -46
  539. package/dist/sdk/lifecycle/mutation-command-options.js +1 -9
  540. package/dist/sdk/lifecycle/plan.js +1 -1606
  541. package/dist/sdk/lifecycle/recurrence-parsers.js +1 -147
  542. package/dist/sdk/lifecycle/reopen.js +1 -68
  543. package/dist/sdk/lifecycle/repeatable-metadata-parsers.js +1 -143
  544. package/dist/sdk/lifecycle/restore.d.ts +1 -0
  545. package/dist/sdk/lifecycle/restore.js +1 -330
  546. package/dist/sdk/lifecycle/shared-unset-fields.js +1 -295
  547. package/dist/sdk/lifecycle/update-many.js +1 -861
  548. package/dist/sdk/lifecycle/update.js +1 -2136
  549. package/dist/sdk/lifecycle-completion.js +1 -92
  550. package/dist/sdk/lifecycle-policy.js +1 -120
  551. package/dist/sdk/linked-artifacts.js +1 -530
  552. package/dist/sdk/mcp/apps.js +4 -133
  553. package/dist/sdk/mcp/authorization.js +1 -404
  554. package/dist/sdk/mcp/discovery.js +1 -494
  555. package/dist/sdk/mcp/interactions.js +1 -336
  556. package/dist/sdk/mcp/protocol.d.ts +7 -0
  557. package/dist/sdk/mcp/protocol.js +1 -184
  558. package/dist/sdk/mcp/skills.js +1 -389
  559. package/dist/sdk/mcp/subscriptions.js +1 -211
  560. package/dist/sdk/mcp/tasks.js +2 -430
  561. package/dist/sdk/mcp/transport.js +1 -260
  562. package/dist/sdk/merge/abandoned-receipts.js +1 -46
  563. package/dist/sdk/merge/driver.js +1 -212
  564. package/dist/sdk/merge/index.js +1 -16
  565. package/dist/sdk/merge/install.js +3 -561
  566. package/dist/sdk/merge/receipt-file-boundary.js +1 -46
  567. package/dist/sdk/merge/receipt-operation.js +1 -96
  568. package/dist/sdk/merge/receipt-schema.js +1 -397
  569. package/dist/sdk/merge/receipts.js +4 -525
  570. package/dist/sdk/merge/reconcile.js +1 -352
  571. package/dist/sdk/merge/three-way.js +3 -775
  572. package/dist/sdk/merge.js +1 -10
  573. package/dist/sdk/mutation-events.js +1 -292
  574. package/dist/sdk/mutation-guard.js +1 -216
  575. package/dist/sdk/notes.js +1 -139
  576. package/dist/sdk/output-contracts.js +1 -172
  577. package/dist/sdk/output-projection.js +1 -430
  578. package/dist/sdk/output-token-accounting.js +1 -140
  579. package/dist/sdk/output.js +1 -64
  580. package/dist/sdk/ownership-source.js +1 -21
  581. package/dist/sdk/package-import-adapters.js +1 -442
  582. package/dist/sdk/package-migrations.js +1 -20
  583. package/dist/sdk/package-runtime-options.js +1 -80
  584. package/dist/sdk/pagination.js +1 -162
  585. package/dist/sdk/profile.js +1 -454
  586. package/dist/sdk/provenance.js +1 -258
  587. package/dist/sdk/public-surface.json +1 -1
  588. package/dist/sdk/query/activity.js +1 -401
  589. package/dist/sdk/query/aggregate.d.ts +16 -0
  590. package/dist/sdk/query/aggregate.js +1 -390
  591. package/dist/sdk/query/calendar.js +1 -964
  592. package/dist/sdk/query/complete-list.js +1 -215
  593. package/dist/sdk/query/context.js +1 -1702
  594. package/dist/sdk/query/duplicate-candidates.js +1 -70
  595. package/dist/sdk/query/get.js +1 -450
  596. package/dist/sdk/query/history.js +1 -186
  597. package/dist/sdk/query/item-filter-options.js +1 -9
  598. package/dist/sdk/query/light-metadata.js +1 -18
  599. package/dist/sdk/query/list-filter-shared.js +1 -81
  600. package/dist/sdk/query/list.js +1 -1304
  601. package/dist/sdk/query/multi-value-filters.js +1 -78
  602. package/dist/sdk/query/next.js +1 -513
  603. package/dist/sdk/query/parsers.js +1 -44
  604. package/dist/sdk/query/projection-contracts.js +1 -184
  605. package/dist/sdk/query/search-contracts.js +1 -230
  606. package/dist/sdk/query/search-pagination.js +1 -35
  607. package/dist/sdk/query/search-rendering.js +1 -105
  608. package/dist/sdk/query/search.js +2 -1987
  609. package/dist/sdk/query.js +1 -35
  610. package/dist/sdk/read-output/continuation.js +1 -194
  611. package/dist/sdk/read-output-budget.js +1 -135
  612. package/dist/sdk/read-output-contracts.js +1 -1225
  613. package/dist/sdk/read-output-rows.js +1 -186
  614. package/dist/sdk/read-output-session.js +1 -208
  615. package/dist/sdk/relationship-analytics.js +1 -410
  616. package/dist/sdk/relationship-context.js +1 -284
  617. package/dist/sdk/relationship-history.js +4 -519
  618. package/dist/sdk/relationship-kinds/contract.js +1 -22
  619. package/dist/sdk/relationship-migration.js +1 -77
  620. package/dist/sdk/relationships.js +1 -579
  621. package/dist/sdk/reproducibility/process.js +1 -87
  622. package/dist/sdk/runtime-action-aliases.js +1 -59
  623. package/dist/sdk/runtime-extended-actions.js +1 -177
  624. package/dist/sdk/runtime-input.js +1 -614
  625. package/dist/sdk/runtime-primitives.js +1 -84
  626. package/dist/sdk/runtime-public-contracts.js +1 -4
  627. package/dist/sdk/runtime-stats-options.js +1 -38
  628. package/dist/sdk/runtime.js +1 -1928
  629. package/dist/sdk/scheduling-shortcuts.js +1 -63
  630. package/dist/sdk/schema-migration.js +3 -856
  631. package/dist/sdk/schema.js +1 -1376
  632. package/dist/sdk/search-refresh-worker.js +1 -18
  633. package/dist/sdk/similarity-scoring.js +1 -53
  634. package/dist/sdk/similarity.js +1 -326
  635. package/dist/sdk/start-task-status.js +1 -14
  636. package/dist/sdk/stats.js +1 -270
  637. package/dist/sdk/structured-mutations.js +1 -580
  638. package/dist/sdk/telemetry-flush.js +1 -13
  639. package/dist/sdk/telemetry.js +1 -405
  640. package/dist/sdk/templates.js +2 -292
  641. package/dist/sdk/test/batch.js +2 -509
  642. package/dist/sdk/test/entry.js +1 -70
  643. package/dist/sdk/test/execution.js +6 -2211
  644. package/dist/sdk/test/linked-command-detection.js +1 -546
  645. package/dist/sdk/test/measurements.js +1 -91
  646. package/dist/sdk/test/parsers.js +1 -545
  647. package/dist/sdk/test/runs.js +1 -193
  648. package/dist/sdk/test/trust.js +2 -206
  649. package/dist/sdk/testing.js +4 -1391
  650. package/dist/sdk/traceability/runtime-files-lookup.js +1 -32
  651. package/dist/sdk/traceability/source-traceability.js +1 -292
  652. package/dist/sdk/tracker-root-discovery.js +1 -9
  653. package/dist/sdk/workspace-contracts-cache.js +1 -28
  654. package/dist/sdk/workspace-contracts.js +1 -33
  655. package/dist/sdk/workspace-memory.js +2 -318
  656. package/dist/sdk/workspace-recipe.js +1 -71
  657. package/dist/sdk/workspace-snapshot.js +4 -613
  658. package/dist/sdk/workspace-transaction-gc.js +1 -149
  659. package/dist/sdk/workspace-transaction.js +2 -363
  660. package/dist/sdk/workspace.js +3 -127
  661. package/dist/types/index.js +1 -9
  662. package/dist/types.js +1 -245
  663. package/docs/AGENT_GUIDE.md +1 -1
  664. package/docs/CONTEXT_ALGORITHM_PORTFOLIO.md +167 -0
  665. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +9 -3
  666. package/docs/EXTENSIONS.md +1 -0
  667. package/docs/HISTORY_MAINTENANCE.md +125 -0
  668. package/docs/MCP_2026_07_28_CONFORMANCE.md +20 -10
  669. package/docs/PACKAGE_EVIDENCE.md +92 -0
  670. package/docs/PLANNING_MEASUREMENTS.md +183 -0
  671. package/docs/README.md +3 -0
  672. package/docs/RELEASING.md +1 -0
  673. package/docs/SCRIPTING.md +21 -0
  674. package/docs/TESTING.md +23 -0
  675. package/docs/generated/FLAG_LEXICON_BUDGETS.md +5 -5
  676. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +2 -2
  677. package/marketplace.json +2 -2
  678. package/package.json +1 -1
  679. package/packages/pm-beads/package.json +1 -1
  680. package/packages/pm-calendar/package.json +1 -1
  681. package/packages/pm-command-kit/package.json +1 -1
  682. package/packages/pm-digital-twin/package.json +1 -1
  683. package/packages/pm-governance-audit/package.json +1 -1
  684. package/packages/pm-guide-shell/package.json +1 -1
  685. package/packages/pm-kanban/package.json +1 -1
  686. package/packages/pm-lifecycle-hooks/package.json +1 -1
  687. package/packages/pm-linked-test-adapters/package.json +1 -1
  688. package/packages/pm-search-advanced/package.json +1 -1
  689. package/packages/pm-templates/package.json +1 -1
  690. package/packages/pm-todos/package.json +1 -1
  691. package/packages/pm-vcs/package.json +1 -1
  692. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  693. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  694. package/scripts/finalize-build.mjs +45 -3
  695. package/dist/cli-bundle/chunks/chunk-AZDFJGH6.js +0 -9
  696. package/dist/cli-bundle/chunks/chunk-BAX2BYUW.js +0 -2111
  697. package/dist/cli-bundle/chunks/chunk-CKOL5U7J.js +0 -77
  698. package/dist/cli-bundle/chunks/chunk-OF76PSDQ.js +0 -5
  699. package/dist/cli-bundle/chunks/chunk-QUWFABDM.js +0 -232
  700. package/dist/cli-bundle/chunks/chunk-QWRRFYK3.js +0 -2
  701. package/dist/cli-bundle/chunks/chunk-RWWBOWJ5.js +0 -2
  702. package/dist/cli-bundle/chunks/chunk-WGAOYSYH.js +0 -40
  703. package/dist/cli-bundle/chunks/chunk-WI2AYPA7.js +0 -2
  704. package/dist/cli-bundle/chunks/register-list-query-5JL52D33.js +0 -11
  705. package/dist/cli-bundle/chunks/register-mutation-ZPG7KMVP.js +0 -20
  706. package/dist/cli-bundle/chunks/register-setup-H4SVAVX7.js +0 -2
  707. package/dist/cli-bundle/focused-chunks/chunk-AL5ON6K6.js +0 -2
  708. package/dist/cli-bundle/focused-chunks/chunk-CHC2IDXA.js +0 -6
  709. package/dist/cli-bundle/focused-chunks/chunk-CK6QFAPZ.js +0 -20
  710. package/dist/cli-bundle/focused-chunks/chunk-EZR3GHFE.js +0 -2
  711. package/dist/cli-bundle/focused-chunks/chunk-H2WJWK7L.js +0 -56
  712. package/dist/cli-bundle/focused-chunks/chunk-NTPY5GSO.js +0 -3
  713. package/dist/cli-bundle/focused-chunks/chunk-P5O7MP5Y.js +0 -2
  714. package/dist/cli-bundle/focused-chunks/chunk-PDMW2E36.js +0 -177
  715. package/dist/cli-bundle/focused-chunks/chunk-QTVCLMSZ.js +0 -6
  716. package/dist/cli-bundle/focused-chunks/chunk-QTZRBUYA.js +0 -8
  717. package/dist/cli-bundle/focused-chunks/chunk-SGQST3PQ.js +0 -12
  718. package/dist/cli-bundle/focused-chunks/chunk-UKHASMMP.js +0 -10
  719. 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 $h,B as Fh,C as WP,D as XP,a as hs,b as gs,c as ys,d as bs,e as FP,f as jP,g as vh,h as Oh,i as Rh,k as Ih,l as Ph,m as kh,n as Mh,o as xh,p as Nh,q as Lh,r as Dh,s as GP,t as UP,u as BP,v as qP,w as zP,x as VP,y as HP,z as KP}from"./chunks/chunk-RHSFOMHU.js";import{A as Lk,B as Dk,C as $k,D as Fk,E as jk,F as Gk,G as Uk,H as Bk,I as qk,J as zk,K as Vk,L as Hk,M as Kk,N as Wk,O as Xk,P as Yk,Q as Jk,R as Zk,S as Qk,T as eM,U as tM,V as rM,W as oM,X as nM,Y as iM,a as dk,b as lk,c as uk,d as pk,e as mk,f as fk,g as _k,h as hk,i as gk,j as yk,k as bk,l as Ck,m as Tk,n as wk,o as Sk,p as Ek,q as Ak,r as vk,s as Ok,t as Rk,u as Ik,v as Pk,w as kk,x as Mk,y as xk,z as Nk}from"./chunks/chunk-YVEQ2AMO.js";import{a as YP,b as JP,c as ZP,d as QP}from"./chunks/chunk-G5ADGQ2D.js";import{a as ek,b as tk,c as rk,d as ok,e as nk,f as ik,g as sk,h as ak,i as ck}from"./chunks/chunk-JAAEYHUA.js";import{$ as or,$a as r_,$b as rh,A as Tv,Aa as Ef,Ab as I_,B as fu,Ba as Af,Bb as P_,C as sp,Ca as vf,Cb as k_,D as ap,Da as Of,Db as M_,E as cp,Ea as Rf,Eb as x_,F as dp,Fa as If,Fb as N_,G as xp,Ga as Pf,Gb as L_,H as We,Ha as kf,Hb as D_,I as Np,Ia as Mf,Ib as $_,J as Lp,Ja as xf,Jb as F_,K as Dp,Ka as Nf,Kb as j_,L as $p,La as Lf,Lb as G_,M as Fp,Ma as Df,Mb as U_,N as jp,Na as $f,Nb as B_,O as dP,Oa as Ff,Ob as q_,P as lP,Pa as jf,Pb as z_,Q as uP,Qa as ar,Qb as V_,R as Kt,Ra as _e,Rb as H_,S as Wt,Sa as Kf,Sb as K_,T as Xt,Ta as Wf,Tb as W_,U as Yt,Ua as Xf,Ub as X_,V as Jt,Va as Yf,Vb as Y_,W as Zt,Wa as Jf,Wb as J_,X as Qt,Xa as Zf,Xb as Z_,Y as er,Ya as Qf,Yb as Q_,Z as tr,Za as e_,Zb as eh,_ as rr,_a as t_,_b as th,a as Hc,aa as _m,ab as o_,ac as oh,b as Kc,ba as hm,bb as n_,bc as nh,c as Wc,ca as gm,cb as i_,cc as ih,d as WA,da as ym,db as s_,dc as sh,e as XA,ea as bm,eb as a_,ec as ah,f as Xc,fa as Xe,fb as c_,fc as ch,g as rv,ga as Cm,gb as d_,gc as dh,h as ov,ha as Tm,hb as l_,hc as lh,i as nv,ia as wm,ib as u_,ic as uh,j as iv,ja as Sm,jb as p_,jc as ph,k as sv,ka as Em,kb as m_,kc as mh,l as av,la as Am,lb as f_,lc as fh,m as cv,ma as vm,mb as __,mc as _h,n as dv,na as Om,nb as h_,nc as hh,o as lv,oa as AP,ob as g_,oc as gh,p as uv,pa as mf,pb as y_,pc as yh,q as pv,qa as ff,qb as b_,qc as bh,r as mv,ra as _f,rb as C_,rc as Ch,s as fv,sa as hf,sb as T_,sc as Th,t as _v,ta as gf,tb as w_,tc as wh,u as ed,ua as yf,ub as S_,uc as Sh,v as hv,va as bf,vb as E_,vc as Eh,w as gv,wa as Cf,wb as A_,wc as Ah,x as yv,xa as Tf,xb as v_,y as bv,ya as wf,yb as O_,z as Cv,za as Sf,zb as R_}from"./chunks/chunk-DAM4CBBR.js";import{a as Ht,f as WI,g as XI,h as Bp,i as qp}from"./chunks/chunk-KR3RP4FH.js";import{A as sP,B as aP,C as cP,D as em,E as tm,F as rm,G as CP,H as Rm,I as TP,J as wP,K as SP,L as EP,b as mu,c as qR,d as ip,e as $I,f as UI,g as BI,h as qI,i as zI,j as VI,k as Gp,l as HI,m as Yp,n as Jp,o as Zp,p as Qp,q as YI,r as JI,s as ZI,t as QI,u as eP,v as tP,w as rP,x as oP,y as nP,z as iP}from"./chunks/chunk-3BZZA6A3.js";import{$a as du,$b as wp,$c as PP,A as nO,Aa as Dl,Ab as RI,Ac as um,Ad as ef,B as iO,Ba as $l,Bb as II,Bc as pm,Bd as tf,C as sO,Ca as Fl,Cb as PI,Cc as mm,Cd as $P,D as aO,Da as jl,Db as op,Dc as fm,Dd as rf,E as gO,Ea as Gl,Eb as np,Ec as gP,Ed as of,Fa as Ul,Fb as kI,Fc as yP,Fd as nf,Ga as Bl,Gb as MI,Gc as bP,Gd as sf,Ha as ql,Hb as xI,Hc as Im,Hd as af,Ia as zl,Ib as Ke,Ic as vP,Id as cf,J as Jd,Ja as Vl,Jb as NI,Jc as nr,Jd as df,Ka as Hl,Kb as Vt,Kc as OP,Kd as lf,La as Kl,Lb as LI,Lc as Ye,Ld as uf,Ma as Wl,Mb as DI,Mc as re,Md as pf,Na as Xl,Nc as Pm,Nd as Gf,Oa as Yl,Ob as lp,Od as Uf,Pa as Jl,Pb as up,Pd as Bf,Qa as Zl,Qb as FI,Qc as Je,Qd as qf,Ra as Ql,Rb as pp,Rc as km,Rd as zf,Sa as eu,Sb as mp,Sc as Mm,Sd as Vf,Ta as tu,Tb as fp,Td as Hf,Ua as ru,Ub as _p,Uc as fe,Va as ou,Vb as hp,Vc as xm,Wa as nu,Wb as gp,Wc as Nm,Xa as iu,Xb as yp,Xc as Lm,Ya as su,Yb as bp,Yc as Dm,Za as au,Zb as Cp,Zc as RP,_a as cu,_b as Tp,_c as IP,a as Mv,aa as yO,ab as lu,ac as Sp,ad as kP,b as xv,ba as bO,bb as uu,bc as Ep,bd as MP,c as Nv,ca as Zd,cb as DR,cc as Ap,cd as ir,d as Lv,da as Qd,db as $R,dc as vp,dd as xP,e as Dv,ea as el,eb as FR,ec as Op,ed as NP,f as $v,fa as tl,fb as jR,fc as Rp,fd as sr,g as Fv,ga as rl,gb as GR,gc as Ip,gd as LP,h as jv,ha as ol,hb as UR,hc as Pp,hd as DP,i as Gv,ia as nl,ib as BR,ic as jI,j as Uv,ja as WO,jb as _u,jc as GI,jd as $m,k as Bv,ka as XO,kb as hu,kc as kp,kd as Fm,l as qv,la as YO,lb as gu,ld as jm,m as zv,ma as JO,mb as yu,md as Gm,n as Vv,na as ZO,nb as bu,nd as Um,o as Hv,oa as QO,oc as Mp,od as Bm,p as Kv,pa as eR,pb as Cu,pd as qm,q as Wv,qa as sR,qb as Tu,qc as KI,qd as zm,r as Xv,ra as aR,rb as wu,rc as Up,rd as Vm,s as Yv,sa as Pl,sb as Su,sc as om,sd as Hm,t as Jv,ta as kl,tb as Eu,tc as nm,td as Km,u as Zv,ua as cR,ub as Qu,uc as im,ud as Wm,v as Qv,va as dR,vb as ep,vc as sm,vd as Xm,w as eO,wa as Ml,wb as tp,wc as am,wd as Ym,x as tO,xa as xl,xb as rp,xc as cm,xd as Jm,y as rO,ya as Nl,yb as vI,yc as dm,yd as Zm,z as oO,za as Ll,zb as OI,zc as lm,zd as Qm}from"./chunks/chunk-QOEKOECV.js";import{Ba as Tl,Ca as wl,Da as Sl,Ea as El,Fa as Al,Ga as vl,H as ml,Ha as Ol,I as fl,J as _l,Ja as Rl,K as hl,Ka as Il,L as Ft,La as zp,Ma as Vp,Na as Hp,Pa as Kp,Qa as Wp,Ra as Xp,a as ev,b as tv,c as Yc,d as Jc,f as Zc,g as Qc,h as CO,i as TO,j as wO,k as SO,l as EO,m as AO,n as vO,o as OO,oa as jt,p as il,pa as Gt,q as sl,qa as Ut,r as al,ra as Bt,s as cl,sa as gl,t as dl,u as RO,ua as yl,v as ll,va as bl,w as ul,wa as Cl,x as pl}from"./chunks/chunk-FLDWYEND.js";import{$ as yd,$a as zO,$b as HR,$c as Ju,A as cO,Aa as Vd,Ac as bI,B as dO,Ba as Hd,Bc as CI,C as lO,Ca as Kd,Cc as TI,D as uO,Da as Wd,Dc as Iu,E as pO,Ea as Xd,Ec as Pu,F as mO,Fa as Yd,Fb as SR,Fc as ku,G as fO,Gb as ER,Gc as Mu,H as _O,Hb as AR,Hc as xu,I as rd,Ia as IO,Ib as vR,Ic as Nu,J as od,Ja as PO,Jb as OR,Jc as qt,K as nd,Ka as kO,Kb as RR,Kc as Lu,L as id,La as MO,Lc as Du,M as sd,Ma as xO,Mc as $u,N as ad,Na as NO,Nb as IR,Nc as Fu,O as cd,Oa as LO,Ob as PR,Oc as ju,P as dd,Pa as DO,Pb as kR,Pc as Gu,Q as ld,Qa as $O,Qb as MR,Qc as Uu,R as ud,Ra as FO,Rb as xR,Rc as Bu,S as pd,Sa as jO,Sb as NR,Sc as qu,T as He,Ta as GO,Tb as LR,Tc as zu,U as md,Ua as UO,Ub as pu,Uc as Vu,V as fd,Vb as Au,Vc as Hu,W as _d,Wb as vu,Wc as Ku,X as hd,Xb as Ou,Xc as Wu,Y as hO,Ya as BO,Yb as Ru,Yc as Xu,Zb as zR,Zc as Yu,_ as gd,_a as qO,_b as VR,_c as zt,aa as bd,ac as KR,ad as wI,b as GA,ba as Cd,bb as VO,bc as WR,bd as SI,c as UA,ca as Td,cb as HO,cc as XR,cd as EI,d as BA,da as wd,db as KO,dc as YR,dd as Zu,e as qA,ea as Sd,ec as JR,ed as AI,f as zA,fa as Ed,fb as tR,fc as ZR,fd as pP,ga as Ad,gb as rR,gc as QR,gd as mP,h as VA,ha as vd,hb as oR,hc as eI,hd as fP,i as HA,ia as Od,ib as nR,ic as tI,id as _P,j as KA,ja as Rd,jb as iR,jc as rI,jd as hP,k as YA,ka as Id,kb as lR,kc as oI,l as JA,la as Pd,lb as uR,lc as nI,m as ZA,ma as kd,mb as pR,mc as iI,n as QA,na as Md,nb as mR,nc as sI,o as wv,oa as xd,ob as fR,oc as aI,p as Sv,pa as Nd,pb as _R,pc as cI,q as Ev,qa as Ld,qb as hR,qc as dI,r as Av,ra as Dd,rb as gR,rc as lI,s as vv,sa as $d,sb as yR,sc as uI,t as Ov,ta as Fd,tb as bR,tc as pI,u as Rv,ua as jd,ub as CR,uc as mI,v as Iv,va as Gd,vb as TR,vc as fI,w as Pv,wa as Ud,wb as wR,wc as _I,x as kv,xa as Bd,xc as hI,ya as qd,yc as gI,z as td,za as zd,zc as yI}from"./chunks/chunk-XOD2PCB6.js";import{$ as nC,$b as UC,$c as _T,$d as Sn,$f as _i,$g as mS,$h as Di,$i as Xi,$j as iA,$k as Gs,$l as va,$m as vc,A as Yb,Aa as Yo,Ac as dn,Ad as NT,Ae as Dn,Af as ww,Ag as Gw,Ah as $S,Ai as uE,Al as Qs,Am as Qa,An as Fc,Ba as Jo,Bc as ln,Bd as LT,Be as $n,Bf as Sw,Bg as Uw,Bh as FS,Bj as FE,Bl as ea,Bm as ec,Bn as jc,Ca as Zo,Cb as MC,Cd as DT,Ce as Fn,Cf as Ew,Cg as Bw,Ch as jS,Cl as ta,Cm as tc,Cn as Gc,D as Jb,Db as je,Dd as $T,De as jn,Df as Aw,Dg as qw,Dh as GS,Dk as Lt,Dl as ra,Dm as rc,Dn as Uc,Eb as Rt,Ec as YC,Ed as FT,Ee as Gn,Ef as vw,Eg as zw,Eh as US,Ek as gA,El as oa,Em as oc,En as Bc,Fb as xC,Fc as JC,Fd as jT,Fe as Un,Ff as Ow,Fg as Vw,Fj as jE,Fk as yA,Fl as na,Fm as nc,Fn as qc,Gb as NC,Gc as ZC,Gd as GT,Ge as Bn,Gf as Rw,Gg as Hw,Gh as BS,Gj as GE,Gk as bA,Gl as ia,Gm as ic,Gn as zc,H as Zb,Hb as LC,Hc as QC,He as qn,Hf as Iw,Hg as Kw,Hh as Ni,Hj as UE,Hk as Cs,Hl as sa,Hm as sc,Hn as Vc,I as L,Ib as DC,Ic as eT,Ie as zn,If as Pw,Ig as Ww,Ih as Li,Ij as BE,Ik as Ts,Il as aa,Im as ac,In as $t,J as Qb,Jb as V,Jc as tT,Je as Vn,Jf as kw,Jg as Xw,Jj as qE,Jk as ws,Jl as ca,Jm as cc,K as b,Kb as $C,Kc as rT,Ke as QT,Kf as ei,Kg as Yw,Kk as Ss,Kl as da,Km as dc,Lc as un,Le as ew,Lf as ti,Lg as Jw,Li as pE,Lj as zE,Lk as Es,Ll as la,Lm as lc,M as eC,Mc as oT,Md as UT,Me as Ge,Mf as ri,Mg as Zw,Mi as mE,Mj as VE,Mk as As,Ml as ua,Mm as uc,N as tC,Nc as nT,Ne as Hn,Nf as oi,Ng as Qw,Nh as qS,Ni as fE,Nj as HE,Nk as vs,Nl as pa,Nm as pc,Oc as iT,Od as _n,Oe as tw,Of as ni,Og as eS,Oh as zS,Oi as _E,Oj as KE,Ok as Os,Ol as ma,Om as mc,Pc as sT,Pd as BT,Pe as Kn,Pf as ii,Pg as tS,Ph as VS,Pi as hE,Pj as WE,Pk as Rs,Pl as fa,Pm as fc,Q as rC,Qc as aT,Qd as hn,Qe as Wn,Qf as si,Qg as rS,Qh as HS,Qi as gE,Qj as XE,Qk as Is,Ql as _a,Qm as _c,Ra as TC,Rc as cT,Re as Xn,Rf as Ue,Rg as oS,Rj as YE,Rk as Ps,Rl as ha,Rm as hc,Sa as wC,Sc as dT,Sd as qT,Se as Yn,Sf as Be,Sg as nS,Sh as KS,Sj as JE,Sk as ks,Sl as ga,Sm as gc,T as oC,Ta as SC,Tc as lT,Td as zT,Tf as ai,Tg as iS,Th as WS,Ti as yE,Tj as ZE,Tk as Ms,Tl as ya,Tm as yc,U as At,Uc as pn,Ud as VT,Uf as ci,Ug as sS,Ui as bE,Uj as QE,Uk as xs,Ul as ba,Um as bc,Vb as FC,Vc as uT,Vd as gn,Vf as di,Vg as aS,Vh as XS,Vi as Wi,Vj as Nt,Vk as Ns,Vl as Ca,Vm as Cc,W as vt,Wa as Qo,Wb as sn,Wc as mn,Wd as yn,Wf as li,Wg as cS,Wi as CE,Wj as eA,Wk as Ls,Wl as Ta,Wm as Tc,X as zo,Xa as EC,Xb as an,Xd as bn,Xf as ui,Xg as dS,Xh as YS,Xi as TE,Xj as tA,Xk as Ds,Xl as wa,Xm as wc,Y as Vo,Ya as AC,Yb as jC,Yc as pT,Yd as Cn,Yf as pi,Yg as lS,Yh as JS,Yi as wE,Yj as rA,Yk as $s,Yl as Sa,Ym as Sc,Z as Ot,Za as vC,Zb as GC,Zc as mT,Zd as Tn,Zf as mi,Zg as uS,Zh as ZS,Zi as SE,Zj as oA,Zk as Fs,Zl as Ea,Zm as Ec,_a as OC,_b as P,_c as fT,_d as wn,_f as fi,_g as pS,_h as QS,_i as xt,_j as nA,_k as js,_l as Aa,_m as Ac,ab as en,ac as It,ad as hT,ae as HT,af as kt,ag as hi,ah as fS,ai as $i,aj as EE,ak as sA,al as Us,am as Oa,an as Oc,b as Do,ba as iC,bb as tn,bc as BC,bd as Pt,be as KT,bf as Mt,bg as gi,bh as _S,bi as Fi,bj as AE,bk as aA,bl as Bs,bm as Ra,bn as Rc,c as De,ca as sC,cb as Fe,cd as gT,cf as Jn,cg as yi,ch as hS,ci as ji,cj as vE,ck as cA,cl as qs,cm as Ia,cn as Ic,d as $o,da as aC,db as RC,dc as qC,dd as yT,de as En,df as Zn,dg as bi,dh as gS,di as Gi,dj as OE,dk as rs,dl as zs,dm as Pa,dn as Pc,e as Fo,ea as cC,ed as bT,ee as An,ef as Qn,eg as Ci,eh as yS,ei as Ui,ek as os,el as Vs,em as ka,en as kc,f as jo,fa as dC,fb as rn,fe as WT,fg as Ti,fh as bS,fi as Bi,fj as RE,fk as ns,fl as Hs,fm as Ma,fn as Mc,g as Go,ga as lC,gb as on,gd as CT,ge as vn,gf as rw,gg as wi,gh as CS,gi as qi,gj as IE,gk as is,gl as Ks,gm as xa,gn as xc,ha as uC,hd as TT,he as On,hf as ow,hg as Si,hh as TS,hi as zi,hj as PE,hk as ss,hl as Ws,hm as Na,i as Uo,ia as pC,ib as nn,ie as XT,if as nw,ig as Ei,ih as wS,ii as eE,ij as kE,ik as as,il as Xs,im as La,in as Ve,j as Et,ja as mC,je as Rn,jf as iw,jg as Ai,jh as SS,jj as Yi,jl as Ys,jm as Da,jn as te,k as me,ka as fC,kd as fn,ke as In,kf as sw,kg as vi,kh as ES,ki as Vi,kj as Ji,kk as cs,kl as Js,km as $a,kn as Nc,l as Bo,ld as wT,le as D,lf as aw,lg as Oi,lh as AS,li as Hi,lj as Zi,lk as ds,ll as Zs,lm as Fa,m as $e,ma as _C,md as ST,me as Pn,mf as cw,mg as Ri,mh as vS,mi as Ki,mj as Qi,mk as ls,ml as CA,mm as ja,mn as kA,n as qo,na as hC,nd as ET,nf as dw,ng as Ii,nj as es,nk as us,nl as TA,nm as Ga,nn as MA,oa as gC,od as AT,of as lw,og as Pi,oh as OS,oi as tE,ok as ps,ol as qe,om as Ua,p as Hb,pa as yC,pd as vT,pf as uw,pg as ki,ph as RS,pi as rE,pj as ts,pk as ms,pl as wA,pm as Ba,q as Kb,qa as bC,qc as zC,qd as OT,qf as pw,qg as Mi,qi as oE,qj as ME,qk as fs,ql as SA,qm as qa,qn as xA,r as Wb,ra as CC,rc as VC,rf as mw,rg as xi,ri as nE,rk as _s,rl as EA,rm as za,rn as NA,sa as Ho,sc as HC,sd as RT,se as YT,sf as fw,sg as Mw,sh as IS,si as iE,sj as xE,sk as dA,sl as Dt,sm as Va,sn as LA,ta as Ko,td as IT,te as JT,tf as _w,tg as xw,th as PS,tj as NE,tk as lA,tl as ze,tm as Ha,tn as DA,ua as Wo,ub as IC,uc as KC,ud as PT,ue as ZT,uf as hw,ug as Nw,uh as kS,ui as sE,uj as LE,uk as uA,ul as AA,um as Ka,un as $A,vb as PC,vc as WC,vd as kT,ve as kn,vf as gw,vg as Lw,vh as MS,vk as pA,vl as vA,vm as Wa,vn as FA,wb as kC,we as Mn,wf as yw,wg as Dw,wh as xS,wi as aE,wj as DE,wk as mA,wl as OA,wm as Xa,wn as jA,xc as XC,xd as MT,xe as xn,xf as bw,xg as $w,xh as NS,xi as cE,xk as fA,xl as RA,xm as Ya,xn as Lc,y as Xb,ya as Xo,yc as cn,yd as xT,ye as Nn,yf as Cw,yg as Fw,yh as LS,yi as dE,yk as _A,yl as IA,ym as Ja,yn as Dc,ze as Ln,zf as Tw,zg as jw,zh as DS,zi as lE,zj as $E,zk as hA,zl as PA,zm as Za,zn as $c}from"./chunks/chunk-AMRDVX36.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",sM=["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 jh(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 Gh(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=jh(t[A.clientInfo]),i=Gh(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 cM(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 dM(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 Uh(e,t){return et({...e,resultType:"complete"},t)}function lM(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 Uh({supportedVersions:[...Ze],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function uM(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 Bh}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 qh=["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 zh(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"||!qh.includes(s))throw new p("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:s??null});let a=zh(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 _M(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 hM(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 Vh(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 gM(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||!Bh(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=Vh(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 yM(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 Hh(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 bM(e,t){return{...e,...Hh(t)}}function Kh(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Wh(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(Kh)){if(!_(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Xh(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 Yh(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 Jh(e,t){if(!_(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Wh(e,r)===void 0)throw new p("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function CM(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Xh(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});Jh(e,a.value),Yh(a,i)}return structuredClone(e)}import{randomUUID as Zh}from"node:crypto";import{readFile as Qh}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 RM="io.modelcontextprotocol/tasks",eg=["working","input_required","completed","failed","cancelled"],tg=/^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,rg=3600*1e3,og=1e3,Ce=1024,ng=30,ig=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(!tg.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 sg(e){if(!eg.includes(e))throw new p("Corrupt MCP task record",m.invalidParams);return e}function ag(e){if(typeof e!="string"||e.length===0)throw new p("Corrupt MCP task record",m.invalidParams);return e}function cg(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new p("Corrupt MCP task record",m.invalidParams);return e}function dg(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new p("Corrupt MCP task record",m.invalidParams);return e}function lg(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 ug(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new p("Corrupt MCP task record",m.invalidParams);return[...e]}function pg(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=sg(e.status),o=ag(e.principal),n=cg(e.workerPid),i=dg(e.ttlMs),s=lg(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:ug(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 mg(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-${Zh()}`),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 pg(JSON.parse(await Qh(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,ng,this.#t,!1,!1,ig);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?rg:t.ttlMs,i=t.pollIntervalMs??og;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&&!mg(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 IM(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,fg=5e3;function _g(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),fg);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 hg(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 gg(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=gg(hg(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 _g(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,yg=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,Sr=/^[\t\x20-\x7E]*$/u,Er=new Set(["prompts/get","resources/read","tools/call"]);function bg(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 Cg(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!yg.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=Cg(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 Tg(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 NM(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,Tg(t,e.toolSchema)),n}function wg(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 Sg(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 Eg(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),Sg(r,o,vr(i,n))||v("MCP parameter header does not match request body",n)}}function LM(e){let t=bg(e.headers),r=typeof e.request.method=="string"?e.request.method:"";wg(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Eg({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var DM=H;import{AsyncLocalStorage as Ag}from"node:async_hooks";import{createHash as Pr,timingSafeEqual as vg}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}},Og=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,Rg=/^[a-z][a-z0-9_*/-]{0,255}$/u,Ig=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,Pg=/^[\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,kg=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,Mg=/%(?![0-9A-Fa-f]{2})/u,xg=512,Ng=32,Lg=180,Dg=8192,$g=8192,Nr=new Ag;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 Fg(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 UM(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 BM(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 qM(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 zM(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 VM(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 HM(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 KM(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 jg(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?Og.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"||!Ug(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 Gg(e){return Rg.test(e)||Ig.test(e)}function Ug(e){if(Buffer.byteLength(e,"utf8")>xg)return!1;let t=e.split(",");if(t.length>Ng)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(!Gg(s)||!Pg.test(a)||r.has(s))return!1;r.add(s)}return!0}function Lr(e){return kg.test(e)&&!Mg.test(e)}function Bg(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 qg(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(Bg)))return{key:s,serialized:t}}function zg(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>Dg)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>Lg)throw new y("Invalid MCP baggage",403);let n=[];for(let i of o){let s=qg(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 WM(e,t={}){let r=_(e)&&_(e._meta)?e._meta:{},o=zg(r.baggage,t.baggageAllowlist??[]);return{...jg(r),...o?{baggage:o}:{}}}function XM(e,t){return Nr.run(structuredClone(e),t)}function YM(){let e=Nr.getStore();return e?{...e}:void 0}async function JM(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=Fg(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")>$g)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 ZM(e){let t=Pr("sha256").update(e.token).digest();return r=>{let o=Pr("sha256").update(r).digest();if(!vg(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 t0(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 Vg={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:Vg})));function r0(e){return jr.find(t=>t.uri===e)}function o0(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 n0(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 Hg,readdir as Kr,readFile as Kg}from"node:fs/promises";import M from"node:path";import{parseDocument as Wg}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",Xg=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]:Xg}}})}var k=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Ur=100,Yg=32*1024*1024,Jg=/^[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 Zg(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=Wg(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 Qg(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>Yg&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),Kg(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 Hg(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 Qg(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()&&Jg.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=Zg(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 ey(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 ty(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 ry(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 oy(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 ny(e){if(e.schema!==Jr)throw new Error(`observation.schema must be ${Jr}.`);return x(e.id,"observation.id"),R(e.version,"observation.version"),ty(e.reads),ry(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")),oy(e.tiers),ne(structuredClone(e))}function T0(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 iy(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 sy(e){return`/${F(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function ay(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 cy(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}.`);ay(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 dy(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}#${sy(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 w0(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 ny(e.observation),cy(e.verdict),Ee(e.recipe),ne(structuredClone(e))}function ly(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 uy(e,t){let r={};for(let o of t)ly(r,o,eo(e,o));return r}async function S0(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 iy(e.observation,async g=>uy(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=dy(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 py(){return Object.keys(Y).sort().map(e=>Y[e])}function my(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 fy(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 _y(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 hy(){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 gy(){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 yy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function by(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 Cy(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)){yy(r,o);for(let n of io){let i=by(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 Ty=["captured_redacted","captured_verbatim"],wy=[{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 Sy(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||!Ty.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 wy)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 Ey(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 Ay(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?Sy(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 Ey(e,r)}function G0(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=Ay(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,vy=3;function V0(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function H0(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,vy-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",Oy=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 Ry={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 Iy(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 Py(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 ky(e){let t=e.split("||").map(r=>Py(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 My(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=ky(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 xy(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 Ny(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 Ly(e){let t=[],r=ft(Oe.join(e,"package.json"));r&&t.push(...My(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=xy(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=Ny(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 Dy(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=Ry[r];return i?i(e,n):Oy.has(r)}function $y(e){let t=lo(e.argv)?.command,r=Dy(e.argv),o=Ly(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=Iy(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 Z0(e){let t=$y(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 Fy}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:Fy("sha256").update(P({nodes:n,edges:i,kinds:s})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:i,kinds:s})}function jy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ce(e){if(!jy(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 Gy(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 Uy(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 By(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,qy=["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 zy(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 Vy(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 Hy(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(!qy.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=zy(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 Vy(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 Ky(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)=>Hy(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 Ox(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)=>Ky(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 kx(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"}},xx=Object.freeze(Object.keys(bt));function go(e){if(Object.hasOwn(bt,e))return bt[e]}var Wy=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function ee(e,t){return e<t?-1:e>t?1:0}function Xy(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 Yy(e){return e===void 0||e.kind==="punctuator"&&Wy.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function Jy(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 Zy(e,t,r){if(e[t]!=="/"||!Yy(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 Qy(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=Xy(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 eb(e){let t=[],r=0;for(;r<e.length;){let o=Jy(e,r);if(o!==void 0){r=o;continue}let n=Zy(e,r,t.at(-1));if(n!==void 0){r=n;continue}let i=Qy(e,r);i.token&&t.push(i.token),r=i.next}return t}var tb=new Set(["object","block","pattern"]),rb=new Set(["const","let","var"]),ob=new Set(["}",")","]"]),nb=new Set(["=","(","[",",",":","?","return"]);function ib(e,t,r){if([...r].reverse().find(i=>tb.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"&&rb.has(n.value)?"pattern":n?.value==="=>"||n?.value===")"?"block":n&&nb.has(n.value)?"object":"block"}function sb(e,t,r){let o=e[t];if(o.value==="{"){let a=ib(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 ab(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 cb(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function db(e){let t=eb(ho.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,i]of t.entries()){let s=o.at(-1),a=ab(s,i,t[n+1]);a&&s.candidates.push(a);let c=sb(t,n,o);if(c)o.push(c);else if(ob.has(i.value)){let d=o.pop();d?.kind==="object"&&!cb(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 lb(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
30
+ `&&t.push(r+1);return t}function ub(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 Nx(e){let t=[],r=[];for(let n of[...e].sort((i,s)=>ee(i.path,s.path))){let i=lb(n.content),s;try{s=db(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=ub(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 Lx(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 Dx(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 $x(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 pb(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 Fx=pb;(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 Gx=16,mb=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([...mb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function Ux(e,t=yo){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function Bx(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 qx(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 zx(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 fb(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 _b(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."},...fb(e)]}function Kx(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 _b(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 hb(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 tN(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=>hb(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 gb(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 rN(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:[...gb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function yb(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function bb(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&&!yb(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 oN(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=>bb(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 iN(){return Tt.map(e=>({...e}))}function Cb(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 sN(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=Cb(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]="1343764b-7e64-5ce5-a5ae-7ae44acf4361")}catch{}})();var Me,Tb=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 wb(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=Tb[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:wb(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 uN(){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: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 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 Sb(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 Eb(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 Ab(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 Sb(e,n,o),Eb(a,t,o),Ab(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 mN(){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 _N(e){return e}function hN(e){return e}function gN(e){return e}function yN(e){return e}function bN(e){return e}function CN(e){return e}function TN(e){return e}function wN(e){return e}function SN(e){return e}function EN(e){return e}function AN(e){return e}function vN(e){return e}function ON(e){return e}function RN(e){return{handled:!0,result:e}}function IN(){return{handled:!1}}function PN(e){return e}function kN(e){return e}function MN(e){return e}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(){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 vb(e={},t={}){return new _e(t).extension(void 0,{...e,migrate:!0})}function Ob(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]="067c057c-811b-5708-bbad-bb5c06fe06b1")}catch{}})();import{createHash as Eo,createHmac as Rb,randomBytes as Ib,timingSafeEqual as Pb}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 IL="dev.unbrained.pm/progressive-tool-discovery",PL=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),kb=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}),Mb=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"]),xb=new Set(["core","standard","full","custom"]),Oo=new Set(re.map(({family:e})=>e)),Nb=Ib(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 Lb(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 kL(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 Db(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 $b(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 Fb(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 Rb("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function jb(e,t,r){let o={version:1,offset:t,signature:Mo(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function Gb(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||!Pb(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:Db(e),weight:t,available:r!=="unavailable",source:r}}function Ne(e,t,r){return wt(e??t,r,e===void 0?"computed":"host")}function Ub(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=$b(t,i),a=new Set(pe(t)),c={lexical:wt(s,q.lexical,"computed"),semantic:Ne(e.signals?.semantic,Fb(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,kb.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 Bb(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"||!xb.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function qb(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 Bb(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 zb(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>Ub(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 Vb(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 ML(e,t={}){Lb(e),ko(t);let r=qb(t),o=t.cursorIntegrityKey??Nb,n=zb(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=Gb(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:Mb}},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:jb(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=Vb(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]="b10b19f2-dc4f-5480-99ec-a5c3c45398b5")}catch{}})();export{uR as ACTIONABILITY_ORDERING_KINDS,As as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,Cc as ACTIVITY_FLAG_CONTRACTS,kn as AGENT_PROVENANCE_DIMENSIONS,na as AGGREGATE_FLAG_CONTRACTS,za as APPEND_FLAG_CONTRACTS,jR as ASSURANCE_ACTIONS,GR as ASSURANCE_DECLARATION_KINDS,$v as ASSURANCE_DOCUMENT_VERSION,lc as ASSURANCE_FLAG_CONTRACTS,Fv as ASSURANCE_GATE_TRIGGERS,jv as ASSURANCE_MEASUREMENT_SOURCE_KINDS,rO as ASSURANCE_PRESET_IDS,xv as AssuranceEvaluationRefusalError,Mv as AssuranceMutationRefusalError,Nv as AssuranceSourceResolutionError,gn as BASELINE_ITEM_FORMAT_VERSION,Ty as BOUNDARY_FIXTURE_CAPTURE_SOURCES,ER 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,MC as BUILTIN_RELATIONSHIP_KINDS,ws as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,bc as CALENDAR_FLAG_CONTRACTS,Va as CLAIM_FLAG_CONTRACTS,Fc as CLOSE_ACTION_OPTION_KEYS,Ba as CLOSE_FLAG_CONTRACTS,qa as CLOSE_MANY_FLAG_CONTRACTS,Ja as CLOSE_TASK_FLAG_CONTRACTS,ia as COMMENTS_FLAG_CONTRACTS,TC as COMMON_MUTATION_COMMAND_OPTION_KEYS,Mc as COMPLETION_FLAG_CONTRACTS,Zo as CONFIDENCE_TEXT_VALUES,Ca as CONFIG_FLAG_CONTRACTS,Ss as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,ZR as CONTEXT_EVALUATION_METRIC_NAMES,wc as CONTEXT_FLAG_CONTRACTS,qt as CONTEXT_OUTPUT_VALUES,oI as CONTEXT_PACKING_PROFILES,zR as CONTEXT_RECENCY_EPOCH,WR as CONTEXT_RELEVANCE_SERVICE,HR as CONTEXT_RELEVANCE_SIGNAL_NAMES,sI as CONTEXT_SIGNAL_SET_VERSION,iI as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,aI as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,oS as CONTEXT_USAGE_LIMITS,kc as CONTRACTS_FLAG_CONTRACTS,_c as COPY_FLAG_CONTRACTS,Is as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,ks as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,Ps as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,Yb as CREATE_DIRECT_CLOSE_REASON_DEFAULT,uc as CREATE_FLAG_CONTRACTS,IS as CURRENT_HISTORY_ITEM_HASH_VERSION,kS as CURRENT_HISTORY_RECORD_HASH_VERSION,yn as CURRENT_ITEM_FORMAT_VERSION,uI as ContextSignalStore,nS as ContextUsageValidationError,Av as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,BI as DEFAULT_CHILD_SAMPLE_LIMIT,SR as DEFAULT_COMPACT_LIST_FIELDS,OE as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,tm as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,vI as DEFAULT_TERMINAL_TRANSITION_POLICY,_I as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,xA as DEFECT_ESCAPE_CLASSES,NA as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ka as DELETE_FLAG_CONTRACTS,Xo as DEPENDENCY_KIND_VALUES,Ac as DEPS_FLAG_CONTRACTS,da as DOCS_FLAG_CONTRACTS,ac as DUPLICATES_FLAG_CONTRACTS,WO as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,Oc as EVAL_FLAG_CONTRACTS,Jp as EVAL_QUERY_SET_CONTRACT,Zp as EVAL_QUERY_SET_EXAMPLE,Yp as EVAL_QUERY_SET_SCHEMA_ID,Tc as EVENTS_FLAG_CONTRACTS,Qa as EVENT_FLAG_CONTRACTS,Fo as EXECUTABLE_COMMAND_ALIASES,L as EXIT_CODE,ka as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Pa as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Fa as EXTENSION_ADOPT_FLAG_CONTRACTS,rv as EXTENSION_CAPABILITIES,Wb as EXTENSION_CAPABILITY_CONTRACT,Hb as EXTENSION_CAPABILITY_CONTRACT_VERSION,Kb as EXTENSION_CAPABILITY_LEGACY_ALIASES,cn as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,$a as EXTENSION_CATALOG_FLAG_CONTRACTS,Ma as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Ia as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Da as EXTENSION_DOCTOR_FLAG_CONTRACTS,Ra as EXTENSION_EXPLORE_FLAG_CONTRACTS,Ta as EXTENSION_FLAG_CONTRACTS,Sa as EXTENSION_INIT_FLAG_CONTRACTS,va as EXTENSION_INSTALL_FLAG_CONTRACTS,Na as EXTENSION_MANAGE_FLAG_CONTRACTS,xa as EXTENSION_MIGRATE_FLAG_CONTRACTS,ov as EXTENSION_POLICY_MODES,nv as EXTENSION_POLICY_SURFACES,La as EXTENSION_RELOAD_FLAG_CONTRACTS,sv as EXTENSION_SANDBOX_PROFILES,wa as EXTENSION_SCOPE_FLAG_CONTRACTS,iv as EXTENSION_TRUST_MODES,Oa as EXTENSION_UNINSTALL_FLAG_CONTRACTS,lO as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,cO as EXTERNAL_DEPENDENCY_SOURCE_KIND,dO as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,ca as FILES_FLAG_CONTRACTS,hc as FOCUS_FLAG_CONTRACTS,ic as GC_FLAG_CONTRACTS,OR as GET_DEPTH_VALUES,Sc as GET_FLAG_CONTRACTS,ra as GLOBAL_FLAG_CONTRACTS,Fd as GRAPH_DURABLE_CACHE_MIN_ITEMS,$d as GRAPH_DURABLE_CACHE_VERSION,vc as GRAPH_FLAG_CONTRACTS,Ue as GRAPH_SUBCOMMAND_VALUES,Ec as GUIDE_FLAG_CONTRACTS,cc as HEALTH_FLAG_CONTRACTS,fa as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,yO as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,wP as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,_a as HISTORY_COMPACT_FLAG_CONTRACTS,Kn as HISTORY_EVENT_CLASSIFICATION_VERSION,la as HISTORY_FLAG_CONTRACTS,Ie as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,pa as HISTORY_REDACT_FLAG_CONTRACTS,ma as HISTORY_REPAIR_FLAG_CONTRACTS,zp as INIT_AGENT_GUIDANCE_MODE_VALUES,ba as INIT_FLAG_CONTRACTS,ja as INSTALL_FLAG_CONTRACTS,Jo as ISSUE_SEVERITY_VALUES,mc as ITEM_COMPLETE_FLAG_CONTRACTS,jO as ITEM_LATEST_TIMESTAMP_FIELDS,Xb as ITEM_METADATA_KEY_ORDER,pc as ITEM_MUTATE_FLAG_CONTRACTS,fc as ITEM_REOPEN_FLAG_CONTRACTS,MO as ITEM_SCALAR_MISSING_VALUE,Ko as ITEM_TYPE_VALUES,FO as ITEM_UNION_COLLECTION_FIELDS,lI as JsonFileContextSignalStoreAdapter,aa as LEARNINGS_FLAG_CONTRACTS,gp as LINKED_TEST_ENV_NAME_PATTERN,yp as LINKED_TEST_PM_CONTEXT_MODE_VALUES,hp as LINKED_TEST_PROTECTED_ENV_KEYS,bp as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,Cs as LIST_COMMANDER_STRING_OPTION_CONTRACTS,AR as LIST_COMMAND_DEFAULT_PROJECTIONS,cv as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,oa as LIST_FILTER_FLAG_CONTRACTS,kR as LIST_SORT_FIELDS,MR as LIST_SORT_ORDER_VALUES,Wn as MAINTENANCE_HISTORY_OPERATIONS,UI as MAX_CHILD_PROJECTION_ITEMS,Za as MEET_FLAG_CONTRACTS,dP as MERGE_DRIVER_ARTIFACT_VALUES,ua as MERGE_FLAG_CONTRACTS,Be as MERGE_SUBCOMMAND_VALUES,pP as MUTATION_EVENT_WIRE_BUDGET,ae as MemoryRelationshipGraphAdapter,Es as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Ic as NEXT_FLAG_CONTRACTS,Ju as NEXT_OUTPUT_VALUES,sa as NOTES_FLAG_CONTRACTS,Ea as PACKAGE_FLAG_CONTRACTS,Aa as PACKAGE_INIT_FLAG_CONTRACTS,Ya as PAUSE_TASK_FLAG_CONTRACTS,$c as PLAN_CREATE_METADATA_PARAMETER_KEYS,ya as PLAN_FLAG_CONTRACTS,Np as PLAN_SHOW_DEPTH_VALUES,We as PLAN_SUBCOMMANDS,Lp as PLAN_TEMPLATE_NAMES,qy as PM_AGENT_TASK_ACCOUNTING_MODES,gt as PM_AGENT_TASK_TRANSCRIPT_VERSION,Hc as PM_CLI_EXPECTED_ERROR_NAME,AA as PM_CLI_GRAMMAR_CONTRACT,CA as PM_CLI_GRAMMAR_NOUNS,li as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,TA as PM_CLI_SHARED_VERBS,$o as PM_COMMAND_ALIAS_CONTRACTS,re as PM_COMMAND_CAPABILITY_CONTRACTS,Dt as PM_COMMAND_DESTINATION_CONTRACTS,MI as PM_COMMAND_EXIT_CONTRACTS,kI as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,Ri as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,NP as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,ze as PM_COMMAND_POSITIONAL_CONTRACTS,Pm as PM_COMMAND_VISIBILITY_CONTRACTS,lv as PM_COMPLETE_LIST_FINDING_CODES,hv as PM_CONTEXT_INTENTS_FILE,fS 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,MP as PM_ERROR_CODE_CATALOG,RP 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,AO as PM_GITATTRIBUTES_END,EO as PM_GITATTRIBUTES_START,OO as PM_GITATTRIBUTES_V2_END,vO as PM_GITATTRIBUTES_V2_START,Jc as PM_GITIGNORE_END,Yc 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,kb as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,DM as PM_MCP_HTTP_PROTOCOL_VERSION,qh as PM_MCP_INPUT_REQUEST_METHODS,sM as PM_MCP_LEGACY_PROTOCOL_VERSIONS,cr as PM_MCP_LOG_LEVELS,A as PM_MCP_META_KEYS,IL as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,PL as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,Lm as PM_MCP_PROMPT_CONTRACTS,H as PM_MCP_PROTOCOL_VERSION,Nm as PM_MCP_RESOURCE_CONTRACTS,dt as PM_MCP_SKILLS_DRAFT_REVISION,Gr as PM_MCP_SKILLS_EXTENSION,Xg 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,RM as PM_MCP_TASKS_EXTENSION,eg as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,iw as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,rs 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,Vc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,qc as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,Vw as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,Mw as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,Bw as PM_READ_OUTPUT_DIMENSIONS,zw as PM_READ_OUTPUT_OPTION_FLAGS,$w as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,Dw as PM_READ_OUTPUT_SESSION_MIN_TOKENS,qw as PM_READ_OUTPUT_SURFACES,Hw as PM_READ_OUTPUT_SURFACE_CONTRACTS,nw as PM_READ_ROW_CONTRACTS,ow as PM_READ_ROW_JQ_SELECTOR,xx as PM_RECOVERY_REFERENCE_FIELDS,le as PM_RECOVERY_REFERENCE_KINDS,mb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,bo as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,Gx as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,yo as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,hs as PM_REPRODUCIBLE_PROCESS_ENV,xI as PM_SUCCESS_EXIT_CODES,ui as PM_TOOL_ACTIONS,jc as PM_TOOL_ACTION_PARAMETER_CONTRACTS,zc as PM_TOOL_PARAMETERS_SCHEMA,Bc as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,Uc as PM_TOOL_PARAMETERS_SCHEMA_VERSION,Lc as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Zr as PM_VERDICT_SCHEMA,Xr as PM_WORKSPACE_RECIPE_SCHEMA,ga 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,uv 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,Tw as QUERY_CURSOR_CONTRACT,Ua as REINDEX_FLAG_CONTRACTS,wE as REINDEX_LOCK_ID,ht as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Wa as RELEASE_FLAG_CONTRACTS,ec as REMIND_FLAG_CONTRACTS,Pt as RESERVED_ITEM_FIELD_NAMES,Ha as RESTORE_FLAG_CONTRACTS,Yo as RISK_VALUES,WA as RelationshipEventLog,XA as RelationshipEventStore,V as RelationshipGraph,je as RelationshipKindRegistry,ha as SCHEMA_FLAG_CONTRACTS,Ts as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,dv as SEARCH_EXTENSION_FLAG_DEFINITIONS,Pc as SEARCH_FLAG_CONTRACTS,xu as SEMANTIC_ATTRIBUTION_LIMITS,Zb as SETTINGS_DEFAULTS,sm as SNAPSHOT_SCHEMA,TO as SOURCE_CONTEXT_ACCESS_ENV,wO as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Xa as START_TASK_FLAG_CONTRACTS,sc as STATS_FLAG_CONTRACTS,Wo as STATUS_VALUES,ta as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,Xn as SUBSTANTIVE_HISTORY_OPERATIONS,PS as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,MS as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,_C as SUPPRESS_HOST_OUTPUT_MARKER,oc as TELEMETRY_FLAG_CONTRACTS,rf as TELEMETRY_SUBCOMMANDS,rc as TEST_ALL_FLAG_CONTRACTS,tc as TEST_FLAG_CONTRACTS,nc as TEST_RUNS_FLAG_CONTRACTS,Jm as TEST_RUN_MEASUREMENT_LIMIT,Xs as TOOL_ACTIVITY_OPTION_CONTRACTS,$s as TOOL_AGGREGATE_OPTION_CONTRACTS,Vs as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Ws as TOOL_CALENDAR_OPTION_CONTRACTS,Ks as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,Ys as TOOL_CONTEXT_OPTION_CONTRACTS,Bs as TOOL_CREATE_OPTION_CONTRACTS,Us as TOOL_CREATE_OPTION_CONTRACT_SOURCE,Js as TOOL_DEPS_OPTION_CONTRACTS,Zs as TOOL_GRAPH_OPTION_CONTRACTS,Ds as TOOL_LIST_FILTER_OPTION_CONTRACTS,Fs as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Gs as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,js as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Hs as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,zs as TOOL_UPDATE_OPTION_CONTRACTS,qs as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,Jb as TYPE_TO_FOLDER,mC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Ms as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,Ns as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,xs as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,gc as UPDATE_FLAG_CONTRACTS,yc as UPDATE_MANY_FLAG_CONTRACTS,Ga as UPGRADE_FLAG_CONTRACTS,dc as VALIDATE_FLAG_CONTRACTS,Rc as WORKSPACE_FLAG_CONTRACTS,Di as WORKSPACE_HISTORY_ID,am as WORKSPACE_SNAPSHOT_ACTIONS,fd as WorkspaceGraphCache,ev as WorkspaceTransactionInterruptedError,Rm as _testOnly,qR as _testOnlyAggregateCommand,qp as _testOnlyConfigCommand,HI as _testOnlyGetCommand,kl as _testOnlyHealthCommand,Wp as _testOnlyInit,Vp as _testOnlyInitAgentGuidance,ck as _testOnlyItemTransaction,hP as _testOnlyMutationEvents,SI as _testOnlyNextCommand,cP as _testOnlySearchCommand,FI as _testOnlySimilarity,_m as _testOnlyTemplates,lu as _testOnlyValidateCommand,bP as _testOnlyWorkspacePosition,sO as acceptAssuranceProposals,cu as acknowledgeLinkedTests,nl as acknowledgeUnknownAuthorHistoryEvents,ol as acknowledgeUnknownAuthorHistoryEventsFromTransport,RE as acquireItemMetadataDerivedIndexLock,Ge as acquireLock,Ck as activateExtensionForTest,KC as activateExtensions,Pn as agentSessionEnvironment,Qf as aggregate,Gm as analyzeAgentProvenanceDescriptorCoverage,DA as analyzeDefectChangeRisk,FR as analyzeDefectRecurrenceCoverage,mp as analyzeDuplicateItems,JA as analyzeGraphImpact,nd as analyzeHierarchyIntegrity,ZA as analyzeKnowledgeGraph,LI as analyzePmCommandExitConformance,fi as analyzePmToolActionParity,rR as analyzeReconciliationDiscard,YA as analyzeRelationshipExecution,Id as analyzeRelationshipSchedule,Ah as analyzeSdkActionCoverage,$t as analyzeSdkCliParameterCompleteness,u_ as append,Li as appendHistoryEntry,Gi as appendWorkspaceAuditEvent,ji as appendWorkspaceHistoryChange,ST as applyAcceptanceCriteriaMutations,nO as applyAssurancePreset,Ph as applyBootstrapPagerPolicy,bS as applyContextIntentProjection,Yu as applyContextTagProjection,xR as applyFilterValueEcho,BA as applyHistoryPatch,$h as applyInvocationAuthorOverride,$l as applyPathMigrations,eS as applyReadOutputDimensions,Yw as applyReadOutputIncludeModes,jw as applyReadOutputSessionReferences,bT as applyRegisteredItemFieldDefaultsAndValidation,Ul as applyStandaloneNote,Sl as applyStoredExtensionMigrationState,AT as applyTagRemovals,PI as applyTerminalOrderingPolicy,Bl as artifactKey,oC as asRecordClone,rC as asRecordOrNull,He as assembleWorkspaceRelationshipGraph,_v as assertCompleteListResult,eM as assertExtensionBlueprint,Qk as assertExtensionCapabilityUsage,Lk as assertExtensionDeactivated,oM as assertExtensionManifestCompatible,rM as assertExtensionManifestMatchesBlueprint,nM as assertExtensionPreflight,ad as assertHierarchyMutationAllowed,SP as assertHistoryCompactTarget,nR as assertHistoryRepairTarget,Zi as assertInitializedTracker,Fl as assertLinkedArtifactMutationIsUnambiguous,cM as assertMcpClientCapabilities,aM as assertMcpProtocolHeader,By as assertMemoryRelationshipGraphAdapterConformance,RT as assertNoUnknownCsvKeys,Dk as assertPackageManifest,nE as assertParentReferenceIsNotSelf,p0 as assertPmMcpSkillsCapability,tM as assertProjectProfile,Z0 as assertProjectRuntimeCompatibility,sw as assertProjectionModeChoice,Ji as assertReadableTrackerRoot,$k as assertRegisteredCommandContract,Kk as assertRegisteredCommandOverride,qk as assertRegisteredExporter,Fk as assertRegisteredFlags,jk as assertRegisteredHook,Bk as assertRegisteredImporter,zk as assertRegisteredItemField,Vk as assertRegisteredItemType,Zk as assertRegisteredMigration,Wk as assertRegisteredParserOverride,Xk as assertRegisteredPreflightOverride,Hk as assertRegisteredProfile,Yk as assertRegisteredRendererOverride,Gk as assertRegisteredSearchProvider,Jk as assertRegisteredServiceOverride,Uk as assertRegisteredVectorStoreAdapter,DC as assertRelationshipEdgeAllowed,po as assertRelationshipGraphAdapterConformance,Gv as assuranceAssertionUpdateIsLoosening,wS as attachContextIntentReceipt,iS as attachContextUsageServingReceipt,nu as attachLinkedTestMutationProvenance,ou as attachLinkedTestProvenance,et as attachMcpServerInfo,pw as attachOutputOmissionReceipt,ES as attachOutputTokenAccounting,SS as attachReadOutputContracts,Gw as attachReadOutputSessionReceipt,dl as auditMergeAttributeFence,RO as auditMergeDriverConfiguration,Ld as auditWorkspaceRelationshipGraph,JM as authorizeMcpHttpRequest,Rn as boundAgentEpisodeIdentity,Pw as boundReadOutputRows,Hu as buildChildrenByParent,YI as buildCompactSearchFilterSummary,NR as buildContentFilterEcho,dI as buildContextSignalSnapshot,fy as buildCorpusShapeItemPlan,LA as buildDefectRecurrenceIndex,bl as buildExtensionDescribeResult,vl as buildExtensionInstallPlan,LR as buildGovernanceMissingFilterEcho,pE as buildInvalidTypeError,qI as buildItemChildrenRollup,sk as buildItemCompletionMutations,KR as buildItemContextRelevanceCandidates,NE as buildItemNotFoundError,VI as buildItemSchedule,cR as buildLinkedFileRepairReport,BM as buildMcpAuthorizationDiscoveryUrls,Uh as buildMcpCompleteResult,lM as buildMcpDiscoverResult,KM as buildMcpDynamicRegistrationMetadata,NM as buildMcpHttpRequestHeaders,_M as buildMcpInputRequiredResult,UM as buildMcpProtectedResourceMetadata,al as buildMergeAttributePatterns,Gc as buildPmActionToolInputSchema,qx as buildPmRefusalClosureCensus,hO as buildRelationshipContext,jE as buildSearchCorpus,UE as buildSemanticCorpusInput,aR as buildStatusRoleWarnings,Yi as buildTrackerInitializationRecovery,KE as buildVectorizationEmbeddingIdentity,WE as buildVectorizationEmbeddingMetadata,JI as buildVerboseSearchFilters,hI as buildWorkspaceMemorySnapshot,On as canonicalDocument,wC as canonicalizeCommandOptionKey,VR as canonicalizeContextRecencyCoordinate,xC as canonicalizeRelationshipKind,Nx as censusPmRecoveryReferenceProducers,fv as certifyCompleteListResult,yk as checkExtensionManifestCompatibility,W_ as claim,X_ as claimNext,bO as classifyHistoryAuthorEvent,Yn as classifyHistoryEvent,eR as classifyHistoryMergeReceiptReferences,IC as classifyHostEnvironmentFault,iP as classifyImplicitSemanticFallbackReason,Tn as classifyItemFormatVersion,sf as classifyLinkedTestCommandSafety,af as classifyLinkedTestFailure,lT as clearActiveExtensionHooks,qd as clearDurableGraphCache,ZT as clearFocusedItem,ed as clearWorkspaceContractsCache,K_ as close,op as closeItem,oh as closeTask,xh as coalesceRepeatedListFlags,pR as collectBlockedByIds,fR as collectBlockedByIdsFromCorpus,aS as collectContextUsageDeliveredItemIds,ud as collectDanglingDependencyReferences,hR as collectDependencyBlockedIds,dd as collectDuplicateDependencyRows,Nd as collectDuplicateRelationshipEdgeGroups,nP as collectErrorCauseCodes,od as collectHierarchyRelations,Or as collectMcpHeaderAnnotations,pd as collectMissingDependencyTargetIds,lp as collectNewOrderingCycleWarnings,kd as collectOrderingCycles,ld as collectOrderingStorageContradictions,bv as collectPackageContextIntentContracts,Bt as collectPackageExtensionDirectories,gT as collectRegisteredItemFieldNames,zT as collectRuntimeCreateFieldValues,mE as collectRuntimeFilterValues,VT as collectRuntimeUpdateFieldValues,Uu as collectSubtreeIds,dn as collectUsedExtensionCapabilities,SC as commandOptionFlagLabel,r_ as comments,Lf as commitImportedItem,ak as commitItemCompletion,ik as commitItemMutations,tv as commitWorkspaceTransaction,ea as compactFlagAliasContracts,Bu as compareCriticalItems,G as comparePmDateVersions,QA as compareRelationshipSnapshots,nC as compareTimestampStrings,Pv as compileHistoryProvenanceMatcher,gS as composeContextIntentContracts,uk as composeExtension,gk as composeExtensionPackage,yR as computeActionabilityReport,JS as computeHistoryDiff,Od as computeRelationshipCentrality,vd as computeRelationshipDominators,md as computeWorkspaceGraphFingerprint,m_ as config,dT as consumeAfterCommandAffectedItems,Kf as context,TS as contextIntentRowId,J_ as copy,cf as countFailureCategories,Rw as countReadOutputRows,z_ as create,oO as createAssurancePreset,DR as createAssuranceWorkspaceContext,sC as createCheckpointId,pv as createCompleteListOptions,WC as createCoreCommandHookContext,no as createCorpusShapeMeasurement,Vv as createEmptyAssuranceDocument,FC as createEmptyExtensionRegistrationRegistry,Xc as createExtensionCommandSdk,an as createExtensionContributionInventory,iM as createExtensionTestHarness,Ni as createHistoryEntry,lA as createLazyModule,ZM as createMcpStaticBearerVerifier,IM as createMcpTaskStore,xE as createMutationGuardSdk,aw as createOutputOmissionReceipt,Kc as createPmCliExpectedError,Fh as createPmCliProgram,vi as createPmCommandOutputBudget,fw as createQueryFingerprint,Uy as createRelationshipGraphScaleFixture,Q as createRelationshipGraphSnapshot,Rt as createRelationshipKindRegistry,ys as createReproducibleProcessRunner,ZI as createSearchCursorFingerprint,XC as createSerialQueue,NT as createStdinTokenResolver,fC as createUnknownSubcommandError,cm as createWorkspaceSnapshot,Tk as deactivateExtensionForTest,IN as declineServiceOverride,CS as decodeContextIntentCursor,dA as decodeHtmlEntitiesInOptions,vr as decodeMcpHttpHeaderValue,yw as decodeQueryCursor,hw as decodeQueryCursorEnvelope,gw as decodeQueryCursorState,Lw as decodeReadOutputContinuationCursor,o0 as decoratePmMcpToolsWithApps,zl as dedupeLinkedArtifacts,XR as defaultScoreContextCandidates,LN as defineAfterCommandHook,xN as defineBeforeCommandHook,NN as defineBeforeMutationHook,gN as defineCommand,EN as defineCommandOverride,X as defineCorpusShape,w0 as defineEpisodeSpecification,MN as defineExporter,dk as defineExtension,lk as defineExtensionBlueprint,_N as defineExtensionManifest,yN as defineFlag,kN as defineImporter,CN as defineItemField,bN as defineItemType,TN as defineMigration,ny as defineObservationContract,FN as defineOnIndexHook,$N as defineOnReadHook,DN as defineOnWriteHook,AN as defineParserOverride,Oi as definePmCommandOutputBudget,xP as definePmCommandOutputEnvelope,IP as definePmErrorCodeCatalog,vN as definePreflightOverride,hN as defineProjectProfile,PN as defineRendererOverride,wN as defineSearchProvider,ON as defineServiceOverride,SN as defineVectorStoreAdapter,cy as defineVerdictContract,Ee as defineWorkspaceRecipe,Z_ as deleteItem,fm as deleteWorkspaceSnapshot,$C as dependencyToRelationship,d_ as deps,iO as deriveAssuranceProposals,mk as deriveExtensionCapabilities,DI as derivePmBulkMutationEffect,Lx as derivePmRecoveryReferenceObligations,Pd as deriveRelationshipDeadlines,ml as deriveSchemaEvolutionMigrationId,rA as deriveTelemetryCommandResolution,gE as describeAllowedTransitions,CO as describeExtensionActivation,fk as describeExtensionBlueprint,Eu as describeItemOwnershipConflict,T0 as describeObservationCost,Zt as describeProfileComposition,Qt as describeProjectProfile,qP as describeUnknownError,Gn as detectAgentIdentity,zn as detectHarnessIdentity,Ed as detectRelationshipCommunities,Un as diagnoseAgentIdentity,Dd as diffRelationshipAuditSnapshots,ef as diffTestRunMeasurements,yM as digestMcpRequestParameters,VC as discoverExtensions,tn as discoverNearbyPmRoot,ML as discoverPmTools,Ly as discoverProjectRuntimeVersionPins,c_ as docs,t_ as duplicates,jd as durableGraphCachePath,zd as durableGraphCacheStatus,bn as effectiveItemFormatVersion,bA as emitTelemetryErrorEvent,Nf as emptyImportedDocument,NO as encodeItemScalarDecisionValue,Ar as encodeMcpHttpHeaderValue,_w as encodeQueryCursor,Nw as encodeReadOutputContinuationCursor,ZS as enforceHistoryStreamPolicyForItem,QS as enforceHistoryStreamPolicyForItems,vP as enrichCliFlagInvocationContract,nr as enrichCliFlagInvocationContracts,zA as ensureMaterializedHistoryTarget,Qc as ensurePmGitignore,Ml as ensureScope,tA as ensureSentryInit,xf as ensureTrackerInitialized,wd as enumerateRelationshipPaths,Pi as estimatePmOutputTokens,Kv as evaluateAssuranceAssertion,Wv as evaluateAssuranceGate,G0 as evaluateBoundaryFixtures,QR as evaluateContextRanking,$A as evaluateDefectGateEvidence,Hv as evaluateMeasurement,ns as evaluateMutationGuard,Hm as evaluateProvenanceCoverage,qm as evaluateSemanticAttributionCoverage,_p as evaluateSimilarityGovernance,hE as evaluateTransition,dy as evaluateVerdictContract,BE as executeEmbeddingBatchesWithRetry,VE as executeVectorDelete,HE as executeVectorReset,zE as executeVectorUpsert,ey as executeWorkspaceRecipe,Gl as expandAddGlobEntries,Yl as explainSourceTraceability,nh as extension,sh as extensionActivate,ah as extensionDeactivate,ih as extensionList,vb as extensionMigrate,QO as extractHistoryMergeReceiptDispositions,ZO as extractHistoryMergeReceiptReferences,WM as extractMcpTraceContext,GA as extractPatchFailureContext,eu as extractReferencedPmItemIdsFromCommand,Gy as federateRelationshipGraphSnapshots,i_ as files,s_ as filesDiscover,a_ as filesLookup,cS as finalizeContextUsageDelivery,Cy as findCoverageDeficits,fp as findDuplicateClusters,sl as findGitWorkspaceRoot,GT as findHistoryIdentityDiscontinuities,gl as findInstalledNpmPackageCandidate,r0 as findPmMcpAppByUri,Ad as findRedundantRelationshipEdges,Rd as findRelationshipCutStructure,pp as findSimilarItems,yA as finishTelemetryCommand,uC as flattenFlagListValue,gy as flushTelemetryQueue,eh as focus,Sd as forEachMatchedRelationshipEdge,xd as formatDuplicateEdgeGroup,id as formatHierarchyRelation,Md as formatOrderingStorageContradiction,EA as formatPmPositionalActionFlagTip,Om as formatProfileApplyHuman,vm as formatProfileLintHuman,Em as formatProfileListHuman,Am as formatProfileShowHuman,hl as formatSchemaEvolutionMigrationHuman,aP as formatVectorIndexRecoveryWarnings,yP as formatWorkspacePositionHuman,F_ as gc,Ki as generateItemId,Jf as get,sT as getActiveCommandResult,_S as getActiveContextIntentContracts,un as getActiveExtensionRegistrations,YM as getActiveMcpTraceContext,Yv as getAssuranceDeclaration,Th as getContracts,YT as getFocusedItem,nn as getHistoryPath,KA as getItemAt,on as getItemPath,as as getMutationActionContract,Zc as getPmGitignoreBlock,rn as getSettingsPath,Ch as getWorkspaceContracts,$i as getWorkspaceHistoryPath,l_ as graph,Gd as graphAuditBaselinePath,zm as groupHistoryByEpisode,RN as handleServiceOverride,dM as hasMcpClientExtension,t0 as hasPmMcpAppsCapability,Ve as hasSubcommandFlagContractsForCommand,XE as hasVectorizationEmbeddingIdentityChanged,YE as hasVectorizationVectorDimensionChanged,GS as hashDocument,US as hashDocumentForVersion,BS as hashEmptyDocument,NS as hashHistoryPatch,xS as hashHistoryRecord,LS as hashHistoryStream,LO as hashItemScalarDecisionValue,$_ as health,yd as hierarchyAncestors,bd as hierarchyDescendants,B_ as historyCompact,q_ as historyCompactBulk,Iv as historyEntryMatchesProvenance,ve as historyItemHashVersionForRuntime,j_ as historyRedact,G_ as historyRepair,U_ as historyRepairAll,mR as indexBlockedByIds,sd as indexHierarchyRelations,JE as inferConsistentVectorDimension,Ai as inferPmOutputBudgetClass,p_ as init,mv as inspectCompleteListResult,jC as inspectExtensionManifestSchema,Zd as inspectHistoryAuthorStream,qO as inspectMergeReceiptEvidence,$y as inspectProjectRuntimeCompatibility,fs as inspectStaleInProgressItems,sR as inspectStatusRoleAssignments,Fi as inspectWorkspaceHistoryState,dm as inspectWorkspaceSnapshot,pl as installMergeFence,uM as interpretMcpResultType,Qu as isAlreadyClaimedError,HP as isCommanderError,bu as isErrnoError,kA as isExternalDependencyReference,MA as isExternalDependencySourceKind,me as isFileMissingError,gC as isHostOutputSuppressed,xO as isItemScalarMissingValue,XO as isLegacyMergeReceiptSummary,_ as isMcpRecord,is as isMutationAction,LC as isOrderingRelationshipKind,rE as isPlaceholderReferenceToken,Wc as isPmCliExpectedError,hi as isPmExtensionCapabilityContract,yi as isPmExtensionPolicyModeContract,bi as isPmExtensionPolicySurfaceContract,gi as isPmExtensionServiceNameContract,NI as isPmKnownExitCode,LP as isPmMutationReceipt,Ke as isPmSuccessfulExitCode,_i as isPmToolAction,YO as isPreDurableCloneLocalReceiptSummary,JO as isPreDurableDispositionEligibleReference,Dy as isProjectMutatingInvocation,uA as isPureSnakeCaseAlias,tS as isReadOutputBudgetExceeded,dw as isReadRowContract,Jd as isRuntimeRecord,fA as isTerminalPlanMode,KT as isTerminalStatus,Vo as isTimestampLiteral,ok as itemDocumentToMutationOptions,zI as itemHasSchedule,cs as jaccardSimilarity,n_ as learnings,pC as levenshteinDistanceWithinLimit,hu as limitAnnotationEntries,iu as linkedTestTrustFingerprint,_k as lintExtensionBlueprint,GC as lintExtensionManifestSchema,rr as lintProjectProfile,Wf as list,Ln as listAgentProvenanceAdapters,Mh as listAliasPluralKeys,Xf as listAllComplete,kE as listAllDocumentCandidatesCached,ts as listAllItemMetadata,ME as listAllItemMetadataLight,Xv as listAssuranceDeclarations,tO as listAssuranceVerdicts,py as listBuiltinCorpusShapes,YP as listCoreClosedDomainContracts,RR as listGetProjectionFields,PO as listInvalidProvenanceHistoryStreamIds,vR as listListProjectionFields,zO as listMergeReceipts,ss as listMutationActions,mP as listMutationEvents,wo as listPmCommandFlagBudgets,Mm as listPmCommandsForFamily,km as listPmCommandsForTier,xe as listPmFlagLexicon,uN as listPmFlagSpellingInventory,xm as listPmMcpToolsForProfile,tN as listPmRequiredArgumentRefusalContracts,rN as listPmSubcommandRefusalContracts,Jt as listProfiles,iN as listTrackerPreflightRecoveryContracts,lm as listWorkspaceSnapshots,Cv as loadContextIntentRuntimeLayers,hm as loadCreateTemplateOptions,HC as loadExtensions,Hd as loadGraphAuditBaseline,cC as loadMutationCheckpoint,N as loadRelationshipGraphAdapter,Qi as locateItem,OT as looksLikeGenericKeyValueEntry,Iw as mapReadOutputRows,VO as markMergeReceiptReconciled,fE as matchesRuntimeFilters,hA as maybeRunFirstUseTelemetryPrompt,_y as measureCorpusShapePlan,Xi as measureItemMetadataReadWork,ET as mergeAdditiveTags,pk as mergeExtensionBlueprints,DO as mergeHistoryStreams,GO as mergeItemDocuments,UO as mergeJsonDocuments,Nh as mergeLinkedTestTwoTokenEntries,$O as mergeRelationshipEventStreams,Wu as mergeSortedWarnings,mA as migrateItemFilesToFormat,DE as mutateItem,LE as mutateItemWithHistoryContext,Ui as mutateWorkspaceJsonWithHistory,Zf as next,$n as normalizeAgentProvenanceAdapterValue,_u as normalizeAnnotationTransportOptions,Dv as normalizeAssuranceEvaluation,Lv as normalizeAssuranceMutation,Lh as normalizeBootstrapInvocation,FT as normalizeBulkIdsValue,cd as normalizeDependencyGraphTarget,fO as normalizeDependencySeedId,mO as normalizeDependencySourceKind,sn as normalizeExtensionContributionInventory,IO as normalizeInvalidHistoryProvenance,jP as normalizeItemAddressInvocation,Cn as normalizeItemFormatVersion,Hi as normalizeItemId,En as normalizeItemMetadata,_O as normalizeItemReference,kh as normalizeLegacyExtensionActionSyntax,jl as normalizeLinkedPath,tE as normalizeParentReferenceValue,Xt as normalizeProfileName,Vi as normalizeRawItemId,Jw as normalizeReadOutputIncludeModeOptions,HS as normalizeReplayPatchOps,ds as normalizeSimilarityText,HT as normalizeStatusForRegistry,Sn as normalizeStatusInput,BT as normalizeStatusInputWithRegistry,VP as normalizeThrownExitCode,o_ as notes,zo as nowIso,Ud as openDurableGraphCache,gM as openMcpRequestState,S0 as openPmEpisode,Cd as orderingPredecessors,Td as orderingSuccessors,nI as packContextCandidates,qu as packRankedContextItems,gh as packageActivate,hh as packageCatalog,yh as packageDeactivate,fh as packageDescribe,ph as packageDoctor,lh as packageInstall,ch as packageLifecycle,dh as packageList,mh as packageManage,Ob as packageMigrate,_h as packageReload,uh as packageUninstall,Cw as paginateQueryRows,xl as parseAddEntries,Nl as parseAddGlobEntries,yu as parseAnnotationTextInput,ek as parseAtomicMutationControls,Ih as parseBootstrapCommandName,vh as parseBootstrapGlobalOptions,Rh as parseBootstrapHelpRequest,Dh as parseBootstrapTypeValue,$T as parseBulkIdsText,ju as parseContextDepth,Lu as parseContextFocusFields,gv as parseContextIntentDeclarations,Gu as parseContextSections,cI as parseContextSignalSnapshot,vT as parseCsvKv,jA as parseDefectChangeRiskRequest,$R as parseDefectRecurrenceCoverageRequest,FA as parseDefectRecurrencePolicy,Qp as parseEvalQuerySet,Xd as parseGraphSubcommand,Ov as parseHistoryProvenanceFilters,wv as parseIntegerLimit,WT as parseItemDocument,tk as parseItemMutationBatch,uE as parseLimit,Rp as parseLinkedTestAssertionEqualsMap,Ip as parseLinkedTestAssertionGteMap,wp as parseLinkedTestBoolean,Sp as parseLinkedTestContextMode,Tp as parseLinkedTestEnvClear,Cp as parseLinkedTestEnvSet,Pp as parseLinkedTestJsonEntries,Op as parseLinkedTestMinLines,vp as parseLinkedTestRegexList,Ap as parseLinkedTestStringList,Ep as parseLinkedTestWorkspaceContextMode,Hh as parseMcpCachePolicy,jh as parseMcpImplementation,ot as parseMcpInputRequests,fr as parseMcpInputResponses,hg as parseMcpSubscriptionFilter,Dl as parseMigrateEntries,bR as parseMultiValueFilter,DP as parseMutationReceipt,DT as parseOptionalNonNegativeInteger,LT as parseOptionalNumber,Ox as parsePmAgentTaskTranscriptCorpus,kL as parsePmToolDiscoveryOptions,Sv as parsePriority,wR as parsePriorityFilterSet,Fw as parseReadOutputSession,yT as parseRegisteredItemFieldAssignments,ce as parseRelationshipGraphSnapshot,Ll as parseRemoveEntries,Xl as parseSourceLineRange,aE as parseStatusFilterCsv,CR as parseStringFilterSet,fn as parseTags,Zm as parseTestRunMeasurements,Ev as parseType,TR as parseTypeFilterSet,rl as parseUnknownAuthorHistoryEventCoordinates,EI as partitionDecisionEntries,YS as patchPathToChangedField,Uo as pathExists,rh as pauseTask,Bd as persistDurableGraphResult,yE as persistSelectedItemFormat,XI as planAgentIdentityVocabularyMutation,fI as planCompletedAtBackfill,Ol as planExtensionDirectoryCopy,or as planProfileApplication,kx as planRelationshipEventBackfill,Wd as planRelationshipRemediation,fl as planSchemaEvolutionMigration,el as planUnknownAuthorHistoryAcknowledgment,um as planWorkspaceSnapshotRestore,OA as positionalShapeKey,RA as positionalSignatureKey,bk as preflightExtension,us as prepareSimilarityText,PT as preserveMutationStdinTokenFields,IT as preserveMutationStdinTokenLiterals,RS as printError,OS as printResult,k_ as profile,N_ as profileApply,L_ as profileLint,M_ as profileList,x_ as profileShow,cT as projectAfterCommandItemSnapshot,Du as projectContextFocusRows,Ym as projectFleetAttributionAnalytics,Rv as projectHistoryProvenance,Mi as projectPmDiagnosticOutput,xi as projectPmDiagnosticText,Wm as projectProvenanceCoverageAnalytics,du as projectValidateCounts,aO as promoteAssuranceAssertion,sS as propagateContextUsageServingReceipt,H0 as pruneCompileCacheGenerations,Jv as putAssuranceDeclaration,Zv as putAssuranceDeclarationBundle,EE as queryItemMetadataIndex,AE as queryLinkedFileMetadataIndex,vE as querySimilarItemMetadataIndex,Qm as queryTestRunMeasurementsBelow,Zn as quoteCommandArg,Jn as quoteWindowsCommandArg,XP as rankCommandPaths,gu as readAnnotationEntries,Bn as readAuthorEnvironment,ff as readBooleanOption,mS as readContextUsageAffinity,_f as readCsvListOption,wl as readExtensionMigrationState,Bo as readFileIfExists,vs as readFirstStringFromCommanderOptions,Os as readFirstValueFromCommanderOptions,Vm as readHistoryAnalyticsWindow,tw as readHistoryEntries,Hn as readHistorySnapshot,Fm as readImprovementLedger,IE as readItemMetadataDerivedIndexState,es as readLocatedItem,Ow as readOutputBudgetCollections,xw as readOutputCollectionFingerprint,vw as readOutputContinuationRowCollections,Ew as readOutputContinuationRowPaths,Xw as readOutputIncludeModeOptions,Aw as readOutputRowCollections,Sw as readOutputRowPaths,Uw as readOutputSessionRemainingTokens,Ut as readPmPackageManifest,wh as readRequiredString,Wi as readSettings,bE as readSettingsWithMetadata,Rs as readStringArrayFromCommanderOptions,mf as readStringOption,zP as readThrownExitCode,ZE as readVectorizationStatusLedger,yv as readWorkspaceContextIntentContracts,pI as readWorkspaceContextSignals,gI as readWorkspaceMemory,gP as readWorkspacePosition,XS as reanchorHistoryEntries,ln as reconcileExtensionCapabilityUsage,qi as reconcileWorkspaceJsonHistory,aT as recordAfterCommandAffectedItem,eO as recordAssuranceVerdict,Pu as recordClaimSemanticAttribution,lS as recordContextUsageDelivery,dS as recordContextUsageServing,uS as recordContextUsageTouch,pS as recordContextUsageTouches,Mu as recordFocusSemanticAttribution,$m as recordImprovementObservation,ku as recordReleaseSemanticAttribution,PE as refreshItemMetadataDerivedIndex,ll as refreshMergeAttributeFenceIfInstalled,eA as refreshSearchArtifactsForMutation,Dn as registerAgentProvenanceAdapters,uO as registerExternalDependencyResolver,Nn as registerHarnessSignalDescriptors,rw as registerOutputMaterialFieldGroups,Y_ as release,Qv as removeAssuranceDeclaration,qo as removeFileIfExists,Kl as renameArtifactsResultKey,vu as renderCalendarMarkdown,Ou as renderCalendarToon,Xu as renderContextMarkdown,Cl as renderExtensionDescribeMarkdown,yl as renderExtensionSurfaceMarkdown,Ff as renderGuideMarkdown,BP as renderMissingOptionRetry,AI as renderNextMarkdown,JP as renderPmClosedDomainHelp,Qn as renderPmCommand,Go as renderPmCommandAliasMigrationHint,Dm as renderPmCommandVisibilityMarkdown,mN as renderPmFlagLexiconMarkdown,n0 as renderPmMcpAppHtml,zx as renderPmRefusalClosureCensusMarkdown,dE as renderRowsAsCsv,lE as renderRowsAsTable,H_ as reopen,qA as replayHistoryToTarget,zS as replayToCanonicalItemDocument,qS as replayToItemDocument,RI as requireTerminalReason,II as requireTerminalReasonWithRecovery,FS as resealHistoryRewrite,oT as resetActiveExtensionRuntimeState,hd as resetWorkspaceGraphCache,In as resolveAgentSessionContextFromSignals,Su as resolveAnnotationIndex,Cu as resolveAnnotationInput,ew as resolveAuthor,Vn as resolveAuthorIdentity,eE as resolveBodyFileContent,my as resolveBuiltinCorpusShape,Au as resolveCalendarOutputFormat,PP as resolveCanonicalPmErrorCodeContract,NC as resolveCanonicalRelationshipKind,QT as resolveClaimPrincipal,jT as resolveCliBulkIdsInput,vC as resolveCommandOptionPolicyState,V0 as resolveCompileCacheGeneration,mI as resolveCompletionTimestamp,CC as resolveConfiguredPmPackageRoot,PR as resolveContentFieldFilters,yS as resolveContextIntentContract,$u as resolveContextOutputFormat,Fu as resolveContextTokenBudget,jI as resolveCreateExplicitEmptyFlag,$E as resolveEmbeddingProviders,Rl as resolveExtensionInstallSourceIdentity,Tl as resolveExtensionMigrationStatePath,zC as resolveExtensionRoots,pO as resolveExternalDependencyReference,lC as resolveFlagValueKind,Df as resolveGuideOutputFormat,jm as resolveHistoryEpisodeGroupIdentity,vv as resolveHistoryProvenanceDimensions,VA as resolveHistorySubject,UA as resolveHistoryTarget,rP as resolveHybridSemanticWeight,en as resolveImplicitPmRoot,iC as resolveIsoOrRelative,_R as resolveItemBlockers,lR as resolveItemExecutionRole,rk as resolveItemMutationDocument,Qo as resolveItemTypeRegistry,UT as resolveItemTypesFilePath,df as resolveLinkedTestFailureExitCode,tu as resolveLinkedTestSourceRef,ru as resolveLinkedTestSourceWorkspaceRoot,su as resolveLinkedTestTrust,au as resolveLinkedTestTrustBatch,gg as resolveMcpAcknowledgedSubscriptionFilter,Qe as resolveMcpRequestContext,il as resolveMergeInstallContext,IR as resolveMissingMetadataFilters,UP as resolveMissingOptionPlaceholder,cw as resolveModePairedOutputOmissionReceipt,wI as resolveNextOutputFormat,uw as resolveOutputOmissionReceipt,bC as resolvePmCliVersion,jo as resolvePmCommandAlias,Ye as resolvePmCommandCapabilityFamily,Vt as resolvePmCommandExitContract,Ii as resolvePmCommandOutputBudget,sr as resolvePmCommandOutputEnvelope,wA as resolvePmCommandPositionalContract,Je as resolvePmCommandVisibilityTier,ki as resolvePmDiagnosticOutputBudget,kP as resolvePmErrorCodeContract,wb as resolvePmFlagSemanticConcept,De as resolvePmHistoryOperation,yC as resolvePmPackageRootFromModule,SA as resolvePmPositionalActionContract,xc as resolvePmPositionalActionFlagContracts,Fe as resolvePmRoot,Dc as resolvePmToolCustomFieldCollision,iE as resolvePriority,Yt as resolveProfile,cl as resolveProjectMergeTypeFolders,bw as resolveQueryCursorStart,Zw as resolveReadOutputDimensions,rS as resolveReadOutputEncoding,kw as resolveReadOutputRecoveryBudget,Kw as resolveReadOutputSurface,lw as resolveReadRowContract,GP as resolveRecoveryCommandName,CT as resolveRegisteredSearchProvider,TT as resolveRegisteredVectorStoreAdapter,gs as resolveReproducibleProcessEnvironment,hn as resolveRuntimeFieldRegistry,_n as resolveRuntimeStatusRegistry,FE as resolveSearchCorpusFields,eP as resolveSearchMaxResults,QI as resolveSearchPage,tP as resolveSearchScoreThreshold,oP as resolveSearchTuning,GE as resolveSemanticCorpusCharacterLimit,Iu as resolveSemanticLineageIds,TE as resolveSettingsWithSemanticRuntimeDefaults,SO as resolveSourceContextWritePolicy,Im as resolveStartTaskInProgressStatus,te as resolveSubcommandFlagContractsForCommand,Qb as resolveTelemetryErrorCategory,OI as resolveTerminalReason,AC as resolveTypeDefinition,EC as resolveTypeName,cE as resolveTypeSynonym,_E as resolveTypeWorkflows,tl as resolveUnknownAuthorAcknowledgmentSelector,sP as resolveVectorIndexRecovery,qE as resolveVectorStores,rd as resolveWorkspaceRelationshipKindRegistry,RC as resolveWorkspaceRoot,Q_ as restore,dC as restoreCheckpointItems,zi as restoreWorkspaceJsonFromHistory,mm as restoreWorkspaceSnapshot,pm as restoreWorkspaceSnapshotWithRecovery,Eh as runAction,uT as runActiveBeforeMutationHooks,mT as runActiveCommandHandler,pT as runActiveOnIndexHooks,mn as runActiveOnReadHooks,pn as runActiveOnWriteHooks,fT as runActiveParserOverride,_T as runActivePreflightOverride,hT as runActiveServiceOverride,td as runActivity,qC as runAfterCommandHooks,mu as runAggregate,wu as runAnnotationCommand,fu as runAppend,UR as runAssuranceAction,BR as runAssuranceDispatch,BC as runBeforeCommandHooks,Ru as runCalendar,ep as runClaim,tp as runClaimNext,np as runClose,sp as runCloseMany,ap as runComments,jf as runCompletion,Bp as runConfig,zt as runContext,rI as runContextEvaluationCorpus,eI as runContextEvaluationScenario,$p as runCopy,kp as runCreate,Fp as runDelete,gd as runDeps,Wl as runDocs,$P as runDuplicates,rm as runEval,nm as runEvent,Il as runExtension,Al as runExtensionMigrateAction,El as runExtensionMigrations,Jl as runFiles,Ql as runFilesDiscover,Zl as runFilesLookup,Xm as runFleetAttributionAnalytics,jp as runFocus,Up as runGc,Gp as runGet,Yd as runGraph,$f as runGuide,Pl as runHealth,$I as runHistory,TP as runHistoryCompact,EP as runHistoryCompactBulk,tR as runHistoryMaintenance,CP as runHistoryRedact,oR as runHistoryRepair,iR as runHistoryRepairAll,Xp as runInit,Hp as runInitAgentGuidance,cp as runLearnings,Hl as runLinkedArtifacts,lf as runLinkedTests,pu as runList,om as runMeet,lP as runMergeDriver,ul as runMergeInstall,KO as runMergeReceiptEvidenceReport,HO as runMergeReceiptReport,uP as runMergeReconcile,Zu as runNext,dp as runNotes,Dp as runPlan,Sm as runProfileApply,wm as runProfileLint,Cm as runProfileList,Tm as runProfileShow,Km as runProvenanceCoverageAnalytics,wk as runRegisteredCommandForTest,Ok as runRegisteredCommandOverrideForTest,Nk as runRegisteredExporterForTest,Ek as runRegisteredHookForTest,xk as runRegisteredImporterForTest,Mk as runRegisteredMigrationForTest,Sk as runRegisteredMutationGuardForTest,Ak as runRegisteredParserOverrideForTest,vk as runRegisteredPreflightOverrideForTest,Rk as runRegisteredRendererOverrideForTest,Pk as runRegisteredSearchProviderForTest,Ik as runRegisteredServiceOverrideForTest,kk as runRegisteredVectorStoreAdapterForTest,ar as runReindex,rp as runRelease,im as runRemind,AP as runReopen,ip as runRestore,_l as runSchemaEvolutionMigration,em as runSearch,hy as runSearchRefreshWorkerEntrypoint,Gf as runStartBackgroundRun,tf as runStats,of as runTelemetry,ym as runTemplatesList,gm as runTemplatesSave,bm as runTemplatesShow,uf as runTest,pf as runTestAll,Uf as runTestRunsList,qf as runTestRunsLogs,Vf as runTestRunsResume,Bf as runTestRunsStatus,zf as runTestRunsStop,Hf as runTestRunsWorker,Mp as runUpdate,xp as runUpdateMany,Ht as runUpgrade,uu as runValidate,Sh as runWithActiveExtensions,D as runWithAgentSessionContext,hS as runWithContextIntentContracts,Tv as runWithDiscoveredContextIntentContracts,Fn as runWithHarnessDetectionSignals,XM as runWithMcpTraceContext,bs as runWithReproducibleProcessEnvironment,jn as runWithWorkspaceHarnessSignalDescriptors,Yr as runWithWorkspaceRecipe,KI as runWorkspaceTransactionGc,Kd as saveGraphAuditBaseline,gO as scanExtensionHostVersions,Qd as scanHistoryAuthorAttribution,wn as scanItemFormatVersions,os as scanMutationSecrets,kO as scanProvenanceResolverHealth,_s as scanStaleInProgressItems,dR as scanStorageIntegrity,f_ as schema,T_ as schemaAddField,b_ as schemaAddStatus,g_ as schemaAddType,A_ as schemaApplyPreset,v_ as schemaInferTypes,__ as schemaList,S_ as schemaListFields,I_ as schemaRemapStatus,w_ as schemaRemoveField,C_ as schemaRemoveStatus,y_ as schemaRemoveType,R_ as schemaRenameField,O_ as schemaRenameType,h_ as schemaShow,E_ as schemaShowField,P_ as schemaShowStatus,WP as scoreCommandPathMatch,YR as scoreContextCandidates,JR as scoreContextCandidatesWithActiveExtensions,ps as scoreItemSimilarity,oN as scorePmGrammarRefusalClosure,Kx as scorePmRefusalClosure,ms as scorePreparedItemSimilarity,sN as scoreTrackerPreflightRecoveryClosure,DS as sealHistoryRecord,hM as sealMcpRequestState,Yf as search,CI as searchWorkspaceMemory,TI as searchWorkspaceMemoryReadResult,gR as selectActionableEntries,mw as selectCursorSemanticOptions,Mf as selectImportAuthor,zM as selectMcpClientRegistrationMode,bI as selectWorkspaceMemory,yI as selectWorkspaceMemoryRollups,Nu as semanticAttributionAffinity,sA as sentryCaptureCliError,iA as sentryFinishCommandSpan,cA as sentryFlush,aA as sentryLogCliUsageError,oA as sentrySetCommandContext,nA as sentryStartCommandSpan,vn as serializeItemDocument,ZP as serializeNdjsonRows,QP as serializeNdjsonStream,iy as serveDeclaredObservation,nT as setActiveCommandContext,iT as setActiveCommandResult,JC as setActiveExtensionCommands,YC as setActiveExtensionHooks,ZC as setActiveExtensionParsers,QC as setActiveExtensionPreflight,rT as setActiveExtensionRegistrations,tT as setActiveExtensionRenderers,eT as setActiveExtensionServices,JT as setFocusedItem,_A as shouldCompletePlanOnClose,Vd as shouldPersistDurableGraphCache,xT as shouldResolveMutationStdinTokenField,MT as shouldResolveMutationStdinTokens,SE as shouldRunSearchRefreshInForeground,up as similarityAdvisoryWarnings,ww as sliceReadOutputRowCollection,ql as sortLinkedArtifacts,wT as splitAcceptanceCriteria,pA as splitCommaList,An as splitFrontMatter,Qw as stabilizeReadOutputReceiptEstimates,P as stableStringify,UC as stableValueEquals,th as startTask,gA as startTelemetryCommand,e_ as stats,qT as statusIsTerminal,Oh as stripGlobalBootstrapTokens,fP as subscribeMutationEventBatches,_P as subscribeMutationEvents,WI as summarizeAgentIdentityVocabulary,Um as summarizeAgentModelProvenance,Bm as summarizeAgentProvenance,tI as summarizeContextEvaluationReports,nf as summarizeContextPreflight,kv as summarizeHistoryProvenance,Kp as summarizeInitResult,BO as summarizeMergeReceipt,GI as supportsCreateExplicitEmpty,FP as supportsItemIdAlias,hC as suppressHostOutput,Pe as syncRelationshipGraphAdapter,hk as synthesizeExtensionManifest,Nc as toCompletionFlagString,Ku as toContextFocusItem,zu as toContextPackingSummary,Vu as toContextRankingSummary,tC as toErrorMessage,gf as toEstimatedMinutesValue,av as toExtensionFlagDefinitions,wf as toImportBoolean,vf as toImportConfidence,Tf as toImportInteger,Pf as toImportLinkedDocs,If as toImportLinkedFiles,kf as toImportLinkedTests,Rf as toImportLogEntries,Of as toImportNormalizedEnum,Af as toImportNumberMap,yf as toImportPriority,Cf as toImportStatus,Sf as toImportStringList,Ef as toImportStringMap,bf as toImportTags,XT as toItemRecord,hf as toNonEmptyImportString,eC as toNonEmptyStringOrUndefined,VS as toReplayDocument,ls as tokenizeSimilarityText,kT as transferMutationStdinTokenPolicy,PC as translateHostEnvironmentFault,V_ as update,bh as upgrade,D_ as validate,Bv as validateAssertionDefinition,zv as validateAssuranceDocument,qv as validateGateDefinition,nk as validateItemMutationRows,Vl as validateLinkedPaths,VM as validateMcpAuthorizationResponseIssuer,qM as validateMcpAuthorizationServerMetadata,HM as validateMcpClientMetadataDocument,LM as validateMcpHttpRequestHeaders,CM as validateMcpJsonSchema,Uv as validateMeasurementDefinition,oE as validateMissingParentReference,Ww as validateReadOutputOptions,sE as validateSprintOrReleaseValue,OC as validateTypeOptions,OP as verifyCliFlagInvocationParity,vA as verifyExplicitPositionalSlotCensus,WS as verifyHistoryChain,KS as verifyHistoryChainWithVersion,HA as verifyHistoryEntries,$S as verifyHistoryRecordHash,jS as verifyHistoryRewriteEvidence,PA as verifyPmCliGrammar,IA as verifyPmCommandPositionalContracts,pN as verifyPmFlagLexicon,Fx as verifyPmRecoveryKindRuntimeCoverage,pb as verifyPmRecoveryProducerRuntimeCoverage,$x as verifyPmRecoveryReferences,Bx as verifyPmRefusalClosureIdentityRatchet,Ux as verifyPmRefusalClosureRatchet,Dx as verifyPmRefusalReachability,Ls as verifyToolOptionCliParity,Qs as withFlagAliasMetadata,kC as withHostEnvironmentBoundary,bM as withMcpCachePolicy,_d as workspaceGraphCache,Tu as wrapOwnershipConflict,KP as wrapThrownErrorForSentry,qn as writeAuthorEnvironment,$e as writeFileAtomic,aC as writeMutationCheckpoint,CE as writeSettings,vS as writeStderr,AS as writeStdout,QE as writeVectorizationStatusLedger,Bi as writeWorkspaceJsonWithHistory};
33
33
  //# sourceMappingURL=sdk.js.map