@unbrained/pm-cli 2026.11.21 → 2026.11.23

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 (943) hide show
  1. package/.agents/skills/pm-developer/SKILL.md +1 -1
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/dist/cli/after-command-context-usage.js +1 -1
  4. package/dist/cli/argv-utils.js +1 -1
  5. package/dist/cli/bootstrap-args.js +1 -1
  6. package/dist/cli/bundle-integrity.js +2 -2
  7. package/dist/cli/command-namespaces.js +1 -1
  8. package/dist/cli/commander-usage.js +11 -11
  9. package/dist/cli/commands/annotations/comments.js +1 -1
  10. package/dist/cli/commands/annotations/docs.js +1 -1
  11. package/dist/cli/commands/annotations/files.js +1 -1
  12. package/dist/cli/commands/annotations/learnings.js +1 -1
  13. package/dist/cli/commands/annotations/notes.js +1 -1
  14. package/dist/cli/commands/extension/describe.js +1 -1
  15. package/dist/cli/commands/extension/extension.js +1 -1
  16. package/dist/cli/commands/extension/scaffold.js +1 -1
  17. package/dist/cli/commands/extension/shared.js +1 -1
  18. package/dist/cli/commands/governance/gc.js +1 -1
  19. package/dist/cli/commands/governance/health.js +1 -1
  20. package/dist/cli/commands/governance/telemetry.js +1 -1
  21. package/dist/cli/commands/governance/validate.js +1 -1
  22. package/dist/cli/commands/history/activity.js +1 -1
  23. package/dist/cli/commands/history/history-compact.js +1 -1
  24. package/dist/cli/commands/history/history-redact.js +1 -1
  25. package/dist/cli/commands/history/history-repair.js +1 -1
  26. package/dist/cli/commands/history/history.js +1 -1
  27. package/dist/cli/commands/history/restore.js +1 -1
  28. package/dist/cli/commands/lifecycle/append.js +1 -1
  29. package/dist/cli/commands/lifecycle/claim.js +1 -1
  30. package/dist/cli/commands/lifecycle/close-many.js +1 -1
  31. package/dist/cli/commands/lifecycle/close.js +1 -1
  32. package/dist/cli/commands/lifecycle/copy.js +1 -1
  33. package/dist/cli/commands/lifecycle/create.js +1 -1
  34. package/dist/cli/commands/lifecycle/delete.js +1 -1
  35. package/dist/cli/commands/lifecycle/focus.js +1 -1
  36. package/dist/cli/commands/lifecycle/plan.js +1 -1
  37. package/dist/cli/commands/lifecycle/update-many.js +1 -1
  38. package/dist/cli/commands/lifecycle/update.js +1 -1
  39. package/dist/cli/commands/query/aggregate.js +1 -1
  40. package/dist/cli/commands/query/context.js +1 -1
  41. package/dist/cli/commands/query/deps.js +1 -1
  42. package/dist/cli/commands/query/duplicates.js +1 -1
  43. package/dist/cli/commands/query/eval.js +1 -1
  44. package/dist/cli/commands/query/get.js +1 -1
  45. package/dist/cli/commands/query/graph.js +1 -1
  46. package/dist/cli/commands/query/list.js +1 -1
  47. package/dist/cli/commands/query/next.js +1 -1
  48. package/dist/cli/commands/query/search.js +1 -1
  49. package/dist/cli/commands/query/stats.js +1 -1
  50. package/dist/cli/commands/test/test-all.js +1 -1
  51. package/dist/cli/commands/test/test-runs.js +1 -1
  52. package/dist/cli/commands/test/test.js +1 -1
  53. package/dist/cli/commands/workspace/config.js +1 -1
  54. package/dist/cli/commands/workspace/contracts.js +1 -1
  55. package/dist/cli/commands/workspace/init.js +1 -1
  56. package/dist/cli/commands/workspace/merge.js +1 -1
  57. package/dist/cli/commands/workspace/profile.js +1 -1
  58. package/dist/cli/commands/workspace/schema.js +1 -1
  59. package/dist/cli/commands/workspace/upgrade.js +1 -1
  60. package/dist/cli/context-intent-invocation.js +1 -1
  61. package/dist/cli/description-stdin.js +1 -1
  62. package/dist/cli/error-guidance.js +5 -5
  63. package/dist/cli/expected-revisions.js +1 -1
  64. package/dist/cli/extension-command-help.js +6 -6
  65. package/dist/cli/extension-recovery.js +1 -1
  66. package/dist/cli/help-content.js +5 -5
  67. package/dist/cli/help-json-payload.js +7 -7
  68. package/dist/cli/invocation-profile.js +2 -2
  69. package/dist/cli/main.js +5 -5
  70. package/dist/cli/migration-gates.js +1 -1
  71. package/dist/cli/option-values.js +1 -1
  72. package/dist/cli/preflight-warnings.js +3 -3
  73. package/dist/cli/public.js +1 -1
  74. package/dist/cli/register-annotations.js +1 -1
  75. package/dist/cli/register-assurance.js +1 -1
  76. package/dist/cli/register-files-lookup.js +1 -1
  77. package/dist/cli/register-history-activity.js +1 -1
  78. package/dist/cli/register-history-author.js +1 -1
  79. package/dist/cli/register-history-maintenance.js +2 -2
  80. package/dist/cli/register-list-query.js +10 -10
  81. package/dist/cli/register-mutation-options.js +0 -1
  82. package/dist/cli/register-mutation.js +6 -6
  83. package/dist/cli/register-operations.js +1 -1
  84. package/dist/cli/register-setup.js +1 -1
  85. package/dist/cli/register-structured-mutation.js +1 -1
  86. package/dist/cli/registration-helpers.js +1 -1
  87. package/dist/cli/runtime/activation.js +1 -1
  88. package/dist/cli/runtime/annotation-option-retry.js +1 -1
  89. package/dist/cli/runtime/close-fields-retry.js +1 -1
  90. package/dist/cli/runtime/field-route-retry.js +1 -1
  91. package/dist/cli/runtime/invocation-options.js +1 -1
  92. package/dist/cli/runtime/invocation-rewrites.js +1 -1
  93. package/dist/cli/runtime/projection-retry.js +1 -1
  94. package/dist/cli/runtime/read-output-mutation-retry.js +1 -1
  95. package/dist/cli/runtime/refusal-credential-redaction.js +1 -1
  96. package/dist/cli/runtime/selection.js +1 -1
  97. package/dist/cli/runtime/telemetry-outcome.js +1 -1
  98. package/dist/cli/runtime-compatibility-boundary.js +4 -4
  99. package/dist/cli/schema/registration.js +15 -15
  100. package/dist/cli/schema-registration-helpers.js +1 -1
  101. package/dist/cli/search-refresh.js +1 -1
  102. package/dist/cli/stats-analytics-json.js +1 -1
  103. package/dist/cli/telemetry-flush.js +1 -1
  104. package/dist/cli-bundle/bundle-manifest.json +1 -1
  105. package/dist/cli-bundle/chunks/chunk-2UQU7HRR.js +9 -0
  106. package/dist/cli-bundle/chunks/chunk-5DUP4AZA.js +2 -0
  107. package/dist/cli-bundle/chunks/chunk-5WZZ5XEN.js +3 -0
  108. package/dist/cli-bundle/chunks/chunk-6H36ZHMI.js +2 -0
  109. package/dist/cli-bundle/chunks/chunk-6MYJLOSG.js +2 -0
  110. package/dist/cli-bundle/chunks/chunk-AA52P34H.js +3 -0
  111. package/dist/cli-bundle/chunks/chunk-AEOHUSUI.js +2289 -0
  112. package/dist/cli-bundle/chunks/chunk-BSRIVYTM.js +8 -0
  113. package/dist/cli-bundle/chunks/chunk-CFWLQFJM.js +71 -0
  114. package/dist/cli-bundle/chunks/chunk-D6PDUKUG.js +9 -0
  115. package/dist/cli-bundle/chunks/chunk-ENKXRSFZ.js +31 -0
  116. package/dist/cli-bundle/chunks/chunk-F2Z6XLZB.js +3 -0
  117. package/dist/cli-bundle/chunks/chunk-FJOEL75F.js +2 -0
  118. package/dist/cli-bundle/chunks/chunk-GDXCAC52.js +2 -0
  119. package/dist/cli-bundle/chunks/chunk-H7JEXRIN.js +6 -0
  120. package/dist/cli-bundle/chunks/chunk-J2PDAVBC.js +2 -0
  121. package/dist/cli-bundle/chunks/chunk-KE7HMBEW.js +2 -0
  122. package/dist/cli-bundle/chunks/chunk-KZHIBEJL.js +33 -0
  123. package/dist/cli-bundle/chunks/chunk-NGJ5ERBF.js +115 -0
  124. package/dist/cli-bundle/chunks/chunk-NQ54T7T2.js +2 -0
  125. package/dist/cli-bundle/chunks/chunk-O7JHS64G.js +3 -0
  126. package/dist/cli-bundle/chunks/chunk-OKEZF7HU.js +2 -0
  127. package/dist/cli-bundle/chunks/chunk-OKIKF4FD.js +2 -0
  128. package/dist/cli-bundle/chunks/chunk-OPJF254V.js +9 -0
  129. package/dist/cli-bundle/chunks/chunk-PZA7QECY.js +1 -0
  130. package/dist/cli-bundle/chunks/chunk-RWA5YZ5X.js +2 -0
  131. package/dist/cli-bundle/chunks/chunk-S32NGRQM.js +2 -0
  132. package/dist/cli-bundle/chunks/chunk-SLFRSZK6.js +1 -0
  133. package/dist/cli-bundle/chunks/chunk-TZY5MVJF.js +125 -0
  134. package/dist/cli-bundle/chunks/chunk-YYT3MIRF.js +3 -0
  135. package/dist/cli-bundle/chunks/chunk-ZPS4B6SI.js +8 -0
  136. package/dist/cli-bundle/chunks/context-budget-recovery-M5RFUEFG.js +2 -0
  137. package/dist/cli-bundle/chunks/indexed-receipt-blobs-BPYKN5Q7.js +4 -0
  138. package/dist/cli-bundle/chunks/{item-revision-R5SZPJZ5.js → item-revision-FMD4KWBB.js} +2 -2
  139. package/dist/cli-bundle/chunks/item-transaction-SEHTH7N2.js +2 -0
  140. package/dist/cli-bundle/chunks/mutation-actor-SFGYIRPW.js +2 -0
  141. package/dist/cli-bundle/chunks/mutation-admission-57LBSKQI.js +2 -0
  142. package/dist/cli-bundle/chunks/{register-list-query-SPGPS3OS.js → register-list-query-L4IBU64P.js} +11 -11
  143. package/dist/cli-bundle/chunks/register-mutation-6NUOPHZ3.js +21 -0
  144. package/dist/cli-bundle/chunks/register-operations-JGYVORNN.js +2 -0
  145. package/dist/cli-bundle/chunks/register-setup-C44SIXEH.js +2 -0
  146. package/dist/cli-bundle/chunks/settlement-hook-6MR32OOC.js +7 -0
  147. package/dist/cli-bundle/chunks/stage-PQ7AB63N.js +2 -0
  148. package/dist/cli-bundle/focused-chunks/chunk-6LKTEKHS.js +6 -0
  149. package/dist/cli-bundle/focused-chunks/chunk-6LPXMFLM.js +2 -0
  150. package/dist/cli-bundle/focused-chunks/chunk-A6VEMCRR.js +3 -0
  151. package/dist/cli-bundle/focused-chunks/chunk-AIDL2ZNT.js +3 -0
  152. package/dist/cli-bundle/focused-chunks/chunk-BKPUUW5O.js +1 -0
  153. package/dist/cli-bundle/focused-chunks/chunk-BWOVFE5B.js +2 -0
  154. package/dist/cli-bundle/focused-chunks/chunk-HMDQDRV2.js +8 -0
  155. package/dist/cli-bundle/focused-chunks/chunk-I66IKYKP.js +2 -0
  156. package/dist/cli-bundle/focused-chunks/chunk-IIP6LZ5E.js +2 -0
  157. package/dist/cli-bundle/focused-chunks/chunk-IR2J3NOT.js +2 -0
  158. package/dist/cli-bundle/focused-chunks/chunk-IROZDIDX.js +3 -0
  159. package/dist/cli-bundle/focused-chunks/chunk-ITKDHSBR.js +2 -0
  160. package/dist/cli-bundle/focused-chunks/chunk-K53OIT5J.js +2 -0
  161. package/dist/cli-bundle/focused-chunks/chunk-LQYYPXUK.js +26 -0
  162. package/dist/cli-bundle/focused-chunks/chunk-NQTEE66P.js +13 -0
  163. package/dist/cli-bundle/focused-chunks/chunk-O7Z73ALG.js +2 -0
  164. package/dist/cli-bundle/focused-chunks/chunk-OTMMOKPM.js +91 -0
  165. package/dist/cli-bundle/focused-chunks/chunk-OXOCZJC6.js +2 -0
  166. package/dist/cli-bundle/focused-chunks/chunk-QLAHEDT6.js +2 -0
  167. package/dist/cli-bundle/focused-chunks/chunk-QQIIMMFU.js +2 -0
  168. package/dist/cli-bundle/focused-chunks/chunk-RIE3SJSE.js +9 -0
  169. package/dist/cli-bundle/focused-chunks/chunk-TD544C74.js +8 -0
  170. package/dist/cli-bundle/focused-chunks/chunk-UFTUNBMY.js +27 -0
  171. package/dist/cli-bundle/focused-chunks/chunk-X6CXWWNB.js +2 -0
  172. package/dist/cli-bundle/focused-chunks/chunk-XRS3VNC6.js +44 -0
  173. package/dist/cli-bundle/focused-chunks/chunk-XYPEZGTR.js +2 -0
  174. package/dist/cli-bundle/focused-chunks/chunk-Y2ESLKCF.js +8 -0
  175. package/dist/cli-bundle/focused-chunks/chunk-YSJKQLFR.js +2 -0
  176. package/dist/cli-bundle/focused-chunks/chunk-Z2X7HH3C.js +102 -0
  177. package/dist/cli-bundle/focused-chunks/chunk-ZHWPCVQL.js +78 -0
  178. package/dist/cli-bundle/focused-chunks/context-budget-recovery-CSJV3TY3.js +2 -0
  179. package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-EGEJMG3G.js +4 -0
  180. package/dist/cli-bundle/focused-chunks/{item-revision-3V3UIP5X.js → item-revision-YDACCDVY.js} +2 -2
  181. package/dist/cli-bundle/focused-chunks/item-transaction-UKEQCTKB.js +2 -0
  182. package/dist/cli-bundle/focused-chunks/mutation-actor-AS465LRX.js +2 -0
  183. package/dist/cli-bundle/focused-chunks/mutation-admission-E5UHJZFE.js +2 -0
  184. package/dist/cli-bundle/focused-chunks/settlement-hook-FMLGKG7J.js +7 -0
  185. package/dist/cli-bundle/focused-chunks/stage-36J7YLGI.js +2 -0
  186. package/dist/cli-bundle/main.js +27 -27
  187. package/dist/cli-bundle/sdk-authoring.js +1 -1
  188. package/dist/cli-bundle/sdk-contracts.js +5 -5
  189. package/dist/cli-bundle/sdk-core.js +1 -1
  190. package/dist/cli-bundle/sdk-governance.js +1 -1
  191. package/dist/cli-bundle/sdk-graph.js +1 -1
  192. package/dist/cli-bundle/sdk-merge.js +72 -60
  193. package/dist/cli-bundle/sdk-query.js +1 -1
  194. package/dist/cli-bundle/sdk-runtime.js +1 -1
  195. package/dist/cli-bundle/sdk-testing.js +1 -1
  196. package/dist/cli-bundle/sdk.js +13 -13
  197. package/dist/cli.js +1 -1
  198. package/dist/core/checkpoint/checkpoint-gc.js +1 -1
  199. package/dist/core/checkpoint/mutation-checkpoint.js +2 -2
  200. package/dist/core/checkpoint/mutation-context.js +1 -1
  201. package/dist/core/config/nested-settings.js +1 -1
  202. package/dist/core/config/positional-value.js +1 -1
  203. package/dist/core/diagnostics/remediation.js +1 -1
  204. package/dist/core/extensions/activation-summary-markdown.js +2 -2
  205. package/dist/core/extensions/activation-summary.js +1 -1
  206. package/dist/core/extensions/activation-transaction.js +1 -1
  207. package/dist/core/extensions/capability-usage.js +1 -1
  208. package/dist/core/extensions/command-hook-context.js +1 -1
  209. package/dist/core/extensions/command-metadata-contract.js +1 -1
  210. package/dist/core/extensions/command-visibility-tier.js +1 -1
  211. package/dist/core/extensions/contribution-inventory.js +1 -1
  212. package/dist/core/extensions/exporter-output-contract.js +1 -1
  213. package/dist/core/extensions/extension-candidate.js +1 -1
  214. package/dist/core/extensions/extension-capability-aliases.js +1 -1
  215. package/dist/core/extensions/extension-hook-runtime.js +1 -1
  216. package/dist/core/extensions/extension-policy.js +1 -1
  217. package/dist/core/extensions/extension-registries.js +1 -1
  218. package/dist/core/extensions/extension-runtime-helpers.js +1 -1
  219. package/dist/core/extensions/extension-types.js +1 -1
  220. package/dist/core/extensions/flag-definition-validation.js +1 -1
  221. package/dist/core/extensions/flag-value-types.js +1 -1
  222. package/dist/core/extensions/index.js +1 -1
  223. package/dist/core/extensions/item-field-types.js +1 -1
  224. package/dist/core/extensions/item-fields.js +1 -1
  225. package/dist/core/extensions/loader.js +1 -1
  226. package/dist/core/extensions/manifest-parser.js +1 -1
  227. package/dist/core/extensions/manifest-schema.js +1 -1
  228. package/dist/core/extensions/module-graph-snapshot.js +1 -1
  229. package/dist/core/extensions/mutation-actor-snapshot.js +1 -1
  230. package/dist/core/extensions/mutation-actor.js +1 -1
  231. package/dist/core/extensions/preflight-ownership.js +1 -1
  232. package/dist/core/extensions/read-output-contract.js +1 -1
  233. package/dist/core/extensions/registration-contracts.js +1 -1
  234. package/dist/core/extensions/registration-validation.js +1 -1
  235. package/dist/core/extensions/registration-values.js +1 -1
  236. package/dist/core/extensions/reserved-host-flags.js +1 -1
  237. package/dist/core/extensions/runtime-registrations.js +1 -1
  238. package/dist/core/extensions/service-ownership.js +1 -1
  239. package/dist/core/extensions/version-compat.js +1 -1
  240. package/dist/core/extensions/version-diagnostics.js +1 -1
  241. package/dist/core/fs/atomic-create.js +1 -1
  242. package/dist/core/fs/file-glob.js +1 -1
  243. package/dist/core/fs/fs-utils.js +2 -2
  244. package/dist/core/fs/host-environment-errors.js +1 -1
  245. package/dist/core/fs/index.js +1 -1
  246. package/dist/core/fs/path-utils.js +1 -1
  247. package/dist/core/governance/content-fields.js +1 -1
  248. package/dist/core/governance/issue-codes.js +1 -1
  249. package/dist/core/governance/metadata-coverage.js +1 -1
  250. package/dist/core/history/bridge.js +2 -0
  251. package/dist/core/history/digest.js +1 -1
  252. package/dist/core/history/drift-cache.js +3 -3
  253. package/dist/core/history/drift-scan.js +1 -1
  254. package/dist/core/history/event-classification.js +1 -1
  255. package/dist/core/history/event-index.js +11 -11
  256. package/dist/core/history/history-compact-bulk.js +1 -1
  257. package/dist/core/history/history-diff.js +1 -1
  258. package/dist/core/history/history-rewrite.js +1 -1
  259. package/dist/core/history/history-storage-stats.js +1 -1
  260. package/dist/core/history/history-stream-policy.js +1 -1
  261. package/dist/core/history/history.d.ts +12 -0
  262. package/dist/core/history/history.js +2 -2
  263. package/dist/core/history/identity.js +1 -1
  264. package/dist/core/history/index.js +1 -1
  265. package/dist/core/history/operation-contract.js +1 -1
  266. package/dist/core/history/projection.js +1 -1
  267. package/dist/core/history/read.d.ts +9 -0
  268. package/dist/core/history/read.js +1 -1
  269. package/dist/core/history/replay.d.ts +46 -5
  270. package/dist/core/history/replay.js +2 -2
  271. package/dist/core/history/stream-summary.js +2 -2
  272. package/dist/core/history/tombstone.js +1 -1
  273. package/dist/core/history/version-address.js +1 -1
  274. package/dist/core/history/workspace-history.js +2 -2
  275. package/dist/core/io/body-file.js +1 -1
  276. package/dist/core/io/bulk-ids-input.js +2 -2
  277. package/dist/core/item/actionability.js +1 -1
  278. package/dist/core/item/deferred-fields.js +1 -1
  279. package/dist/core/item/dependency-reference.js +1 -1
  280. package/dist/core/item/id.js +1 -1
  281. package/dist/core/item/index.js +1 -1
  282. package/dist/core/item/item-format-version.js +1 -1
  283. package/dist/core/item/item-format.js +7 -7
  284. package/dist/core/item/item-record.js +1 -1
  285. package/dist/core/item/item-type-definition.js +1 -1
  286. package/dist/core/item/literal-mutation-input.js +1 -1
  287. package/dist/core/item/parent-reference-policy.js +1 -1
  288. package/dist/core/item/parse.js +8 -8
  289. package/dist/core/item/plan-lifecycle.js +1 -1
  290. package/dist/core/item/priority.js +1 -1
  291. package/dist/core/item/sprint-release-format.js +1 -1
  292. package/dist/core/item/status-filter.js +1 -1
  293. package/dist/core/item/status.js +1 -1
  294. package/dist/core/item/toon-decode.js +1 -1
  295. package/dist/core/item/type-registry.js +1 -1
  296. package/dist/core/item/type-synonyms.js +1 -1
  297. package/dist/core/lock/index.js +1 -1
  298. package/dist/core/lock/lock-confinement.js +1 -1
  299. package/dist/core/lock/lock-gc.js +1 -1
  300. package/dist/core/lock/lock-owner.js +1 -1
  301. package/dist/core/lock/lock.js +4 -4
  302. package/dist/core/output/linked-test-projection.js +5 -5
  303. package/dist/core/output/mutation-projection.js +1 -1
  304. package/dist/core/output/output-control.js +1 -1
  305. package/dist/core/output/output.js +19 -19
  306. package/dist/core/output/query-summary.js +1 -1
  307. package/dist/core/output/tabular.js +3 -3
  308. package/dist/core/packages/manifest.js +1 -1
  309. package/dist/core/packages/root.js +1 -1
  310. package/dist/core/policy/workflow-policy-schema.js +1 -1
  311. package/dist/core/policy/workflow-policy-store.js +1 -1
  312. package/dist/core/policy/workflow-policy.js +1 -1
  313. package/dist/core/profile/profile-describe.js +1 -1
  314. package/dist/core/profile/profile-lint.d.ts +1 -1
  315. package/dist/core/profile/profile-lint.js +1 -1
  316. package/dist/core/profile/profile-plan.js +1 -1
  317. package/dist/core/profile/profile-presets.js +4 -4
  318. package/dist/core/reproducibility/context.js +1 -1
  319. package/dist/core/schema/fields-file.js +2 -2
  320. package/dist/core/schema/item-types-file.js +2 -2
  321. package/dist/core/schema/runtime-field-filters.js +1 -1
  322. package/dist/core/schema/runtime-field-values.js +1 -1
  323. package/dist/core/schema/runtime-schema.js +2 -2
  324. package/dist/core/schema/status-defs-file.js +2 -2
  325. package/dist/core/schema/status-token.js +1 -1
  326. package/dist/core/schema/type-inference.js +1 -1
  327. package/dist/core/schema/type-presets.js +1 -1
  328. package/dist/core/schema/type-workflows.js +1 -1
  329. package/dist/core/search/background-refresh.js +2 -2
  330. package/dist/core/search/bm25.js +1 -1
  331. package/dist/core/search/cache.js +2 -2
  332. package/dist/core/search/corpus.js +1 -1
  333. package/dist/core/search/embedding-batches.js +1 -1
  334. package/dist/core/search/eval-thresholds.js +1 -1
  335. package/dist/core/search/eval.js +1 -1
  336. package/dist/core/search/http-client.js +1 -1
  337. package/dist/core/search/providers.js +1 -1
  338. package/dist/core/search/relevance.js +1 -1
  339. package/dist/core/search/semantic-defaults.js +1 -1
  340. package/dist/core/search/staleness.js +1 -1
  341. package/dist/core/search/vector-stores.js +2 -2
  342. package/dist/core/search/vectorization-metadata.js +1 -1
  343. package/dist/core/sentry/helpers.js +1 -1
  344. package/dist/core/sentry/instrument.js +1 -1
  345. package/dist/core/sentry/sensitive-assignments.js +1 -1
  346. package/dist/core/session/session-state.js +1 -1
  347. package/dist/core/shared/agent-session-context.js +1 -1
  348. package/dist/core/shared/author.js +5 -5
  349. package/dist/core/shared/command-line.js +1 -1
  350. package/dist/core/shared/command-types.js +0 -1
  351. package/dist/core/shared/conflict-markers.js +1 -1
  352. package/dist/core/shared/constants.js +1 -1
  353. package/dist/core/shared/error-details.js +1 -1
  354. package/dist/core/shared/errors.js +1 -1
  355. package/dist/core/shared/html-entity-decode.js +1 -1
  356. package/dist/core/shared/index.js +1 -1
  357. package/dist/core/shared/item-metadata-contract.js +1 -1
  358. package/dist/core/shared/lazy-module.js +1 -1
  359. package/dist/core/shared/levenshtein.js +1 -1
  360. package/dist/core/shared/memo.js +1 -1
  361. package/dist/core/shared/numeric-parsers.js +1 -1
  362. package/dist/core/shared/option-alias-visibility.js +1 -1
  363. package/dist/core/shared/output-unicode.js +1 -1
  364. package/dist/core/shared/primitives.js +1 -1
  365. package/dist/core/shared/process-tree.js +2 -2
  366. package/dist/core/shared/secret-rules.js +5 -5
  367. package/dist/core/shared/serial-queue.js +1 -1
  368. package/dist/core/shared/serialization.js +1 -1
  369. package/dist/core/shared/split-comma-list.js +1 -1
  370. package/dist/core/shared/text-normalization.js +1 -1
  371. package/dist/core/shared/time.js +2 -2
  372. package/dist/core/shared/url-credentials.js +1 -1
  373. package/dist/core/store/index.js +1 -1
  374. package/dist/core/store/item-format-migration.js +1 -1
  375. package/dist/core/store/item-metadata-cache.js +1 -1
  376. package/dist/core/store/item-metadata-query-index.js +11 -11
  377. package/dist/core/store/item-metadata-read-work.js +1 -1
  378. package/dist/core/store/item-mutation-precondition.js +1 -1
  379. package/dist/core/store/item-store.js +1 -1
  380. package/dist/core/store/paths.js +1 -1
  381. package/dist/core/store/settings-concurrency.js +1 -1
  382. package/dist/core/store/settings-read-cache.js +1 -1
  383. package/dist/core/store/settings-sections.js +2 -2
  384. package/dist/core/store/settings-validator.js +1 -1
  385. package/dist/core/store/settings.d.ts +3 -1
  386. package/dist/core/store/settings.js +6 -6
  387. package/dist/core/store/sqlite-runtime.js +1 -1
  388. package/dist/core/store/tracker-preflight.js +1 -1
  389. package/dist/core/store/transaction-coordinator-scope.js +1 -1
  390. package/dist/core/telemetry/consent.js +3 -3
  391. package/dist/core/telemetry/observability.js +1 -1
  392. package/dist/core/telemetry/policy.js +1 -1
  393. package/dist/core/telemetry/read-sampling.js +2 -2
  394. package/dist/core/telemetry/runtime.js +9 -9
  395. package/dist/core/test/background-runs.js +4 -4
  396. package/dist/core/test/item-test-run-tracking.js +1 -1
  397. package/dist/core/test/run-selectors.js +1 -1
  398. package/dist/core/validate/estimate-defaults.js +1 -1
  399. package/dist/core/validate/fix-planning.js +1 -1
  400. package/dist/core/validate/linked-artifact-reference.js +1 -1
  401. package/dist/core/validate/missing-by-type.js +1 -1
  402. package/dist/core/validate/missing-link-owners.js +1 -1
  403. package/dist/core/validate/stale-file-classification.js +1 -1
  404. package/dist/mcp/http-server.js +5 -5
  405. package/dist/mcp/legacy-adapter.js +1 -1
  406. package/dist/mcp/runtime-capabilities.js +1 -1
  407. package/dist/mcp/server.js +4 -4
  408. package/dist/mcp/tool-definitions.js +1 -1
  409. package/dist/sdk/actionability.js +1 -1
  410. package/dist/sdk/agent/closed-domain-contracts.js +1 -1
  411. package/dist/sdk/agent/command-recovery.js +1 -1
  412. package/dist/sdk/agent/command-suggestions.js +1 -1
  413. package/dist/sdk/agent/create-option-policy.js +1 -1
  414. package/dist/sdk/agent/identity-config.js +1 -1
  415. package/dist/sdk/agent/item-addressing.js +1 -1
  416. package/dist/sdk/agent/linked-resource-recovery.js +1 -1
  417. package/dist/sdk/agent/refusal-closure-census.js +2 -2
  418. package/dist/sdk/agent/refusal-corpus-contracts.js +1 -1
  419. package/dist/sdk/agent/subcommand-recovery.js +1 -1
  420. package/dist/sdk/agent-capability-contracts.js +3 -3
  421. package/dist/sdk/agent-session-context.js +1 -1
  422. package/dist/sdk/annotations.js +1 -1
  423. package/dist/sdk/author-attribution.js +1 -1
  424. package/dist/sdk/cli-bootstrap.js +1 -1
  425. package/dist/sdk/cli-contracts/agent-output-contracts.js +5 -5
  426. package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -1
  427. package/dist/sdk/cli-contracts/command-aliases.js +1 -1
  428. package/dist/sdk/cli-contracts/command-exit-contracts.js +1 -1
  429. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
  430. package/dist/sdk/cli-contracts/commander-types.js +1 -1
  431. package/dist/sdk/cli-contracts/completeness.js +1 -1
  432. package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
  433. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  434. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +2 -2
  435. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  436. package/dist/sdk/cli-contracts/registration-helpers.js +7 -7
  437. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  438. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +1 -1
  439. package/dist/sdk/cli-contracts/string-lists.js +1 -1
  440. package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -1
  441. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  442. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  443. package/dist/sdk/cli-contracts/typed-action-inputs.d.ts +2 -2
  444. package/dist/sdk/cli-contracts/typed-action-inputs.js +0 -1
  445. package/dist/sdk/cli-contracts.js +1 -1
  446. package/dist/sdk/cli-program.js +1 -1
  447. package/dist/sdk/command-line.js +1 -1
  448. package/dist/sdk/comments.js +1 -1
  449. package/dist/sdk/compile-cache.js +1 -1
  450. package/dist/sdk/completion/bash.js +2 -2
  451. package/dist/sdk/completion/fish.js +74 -73
  452. package/dist/sdk/completion/shared.js +1 -1
  453. package/dist/sdk/completion/zsh.js +77 -76
  454. package/dist/sdk/completion.js +1 -1
  455. package/dist/sdk/config.js +1 -1
  456. package/dist/sdk/context/recency.js +1 -1
  457. package/dist/sdk/context/semantic-session-attribution.js +1 -1
  458. package/dist/sdk/context/usage-egress.js +1 -1
  459. package/dist/sdk/context/usage-ledger.js +6 -6
  460. package/dist/sdk/context-intent-contracts.js +1 -1
  461. package/dist/sdk/context-intent-runtime.js +1 -1
  462. package/dist/sdk/context-packing.js +1 -1
  463. package/dist/sdk/context-relevance.js +1 -1
  464. package/dist/sdk/context-signal-store.js +2 -2
  465. package/dist/sdk/context-usage.js +1 -1
  466. package/dist/sdk/dependencies/context-budget-recovery.js +1 -1
  467. package/dist/sdk/dependencies.js +1 -1
  468. package/dist/sdk/dependency-flag-validation.js +1 -1
  469. package/dist/sdk/dependency-provenance.js +1 -1
  470. package/dist/sdk/docs.js +1 -1
  471. package/dist/sdk/duplicates.js +1 -1
  472. package/dist/sdk/environment/host-environment-errors.js +1 -1
  473. package/dist/sdk/environment/project-runtime-compatibility.js +2 -2
  474. package/dist/sdk/environment/source-context.js +1 -1
  475. package/dist/sdk/environment/tracker-preflight.js +1 -1
  476. package/dist/sdk/error-code-catalog.js +1 -1
  477. package/dist/sdk/error-runtime.js +1 -1
  478. package/dist/sdk/errors.js +1 -1
  479. package/dist/sdk/eval.js +1 -1
  480. package/dist/sdk/extension/author-manifest.js +1 -1
  481. package/dist/sdk/extension/bundled-catalog.js +1 -1
  482. package/dist/sdk/extension/command-options.js +1 -1
  483. package/dist/sdk/extension/concurrency.js +1 -1
  484. package/dist/sdk/extension/copy-scope.js +1 -1
  485. package/dist/sdk/extension/custom-field-collisions.js +1 -1
  486. package/dist/sdk/extension/describe.js +3 -3
  487. package/dist/sdk/extension/doctor.js +1 -1
  488. package/dist/sdk/extension/install-plan.js +1 -1
  489. package/dist/sdk/extension/install-receipts.js +1 -1
  490. package/dist/sdk/extension/install-runtime.js +3 -3
  491. package/dist/sdk/extension/install-snapshot.js +1 -1
  492. package/dist/sdk/extension/install-sources.js +5 -5
  493. package/dist/sdk/extension/managed-state.js +2 -2
  494. package/dist/sdk/extension/managed-update-status.js +1 -1
  495. package/dist/sdk/extension/migrations.js +2 -2
  496. package/dist/sdk/extension/native-command-options.js +1 -1
  497. package/dist/sdk/extension/output-ownership.js +1 -1
  498. package/dist/sdk/extension/runtime-summary.js +1 -1
  499. package/dist/sdk/extension/scaffold.js +11 -11
  500. package/dist/sdk/extension/shared.js +1 -1
  501. package/dist/sdk/extension/source-resolution.js +1 -1
  502. package/dist/sdk/extension/static-inventory.js +1 -1
  503. package/dist/sdk/extension/update-check.js +1 -1
  504. package/dist/sdk/extension-command-context.js +2 -2
  505. package/dist/sdk/extension-contracts.js +1 -1
  506. package/dist/sdk/extension.js +1 -1
  507. package/dist/sdk/files.js +1 -1
  508. package/dist/sdk/flag-invocation-contracts.js +1 -1
  509. package/dist/sdk/generated/error-code-catalog-rows.js +1 -1
  510. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  511. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  512. package/dist/sdk/generated-error-code-catalog.js +1 -1
  513. package/dist/sdk/governance/assurance-action-contracts.js +0 -1
  514. package/dist/sdk/governance/assurance-action.js +1 -1
  515. package/dist/sdk/governance/assurance-limits.js +1 -1
  516. package/dist/sdk/governance/assurance-mutation-error.js +1 -1
  517. package/dist/sdk/governance/assurance-presets.js +1 -1
  518. package/dist/sdk/governance/assurance-runtime.js +1 -1
  519. package/dist/sdk/governance/assurance.js +4 -4
  520. package/dist/sdk/governance/boundary-fixtures.js +1 -1
  521. package/dist/sdk/governance/closure-timestamps.js +1 -1
  522. package/dist/sdk/governance/defect-recurrence-coverage.js +1 -1
  523. package/dist/sdk/governance/defect-recurrence-graph.js +1 -1
  524. package/dist/sdk/governance/defect-recurrence-signals.js +1 -1
  525. package/dist/sdk/governance/defect-recurrence.js +2 -2
  526. package/dist/sdk/governance/extension-host-version.js +1 -1
  527. package/dist/sdk/governance/gc.js +1 -1
  528. package/dist/sdk/governance/health/history-drift-remedies.js +2 -0
  529. package/dist/sdk/governance/health/projection.js +1 -1
  530. package/dist/sdk/governance/health-merge-evidence.js +1 -1
  531. package/dist/sdk/governance/health.js +2 -2
  532. package/dist/sdk/governance/hierarchy-validation.js +1 -1
  533. package/dist/sdk/governance/in-progress-work-health.js +1 -1
  534. package/dist/sdk/governance/lifecycle-dependency-cycles.js +1 -1
  535. package/dist/sdk/governance/linked-file-report.js +1 -1
  536. package/dist/sdk/governance/merge-receipt-history.js +1 -1
  537. package/dist/sdk/governance/provenance-health.js +4 -4
  538. package/dist/sdk/governance/reindex.js +5 -5
  539. package/dist/sdk/governance/stale-work.js +1 -1
  540. package/dist/sdk/governance/status-role-diagnostics.js +1 -1
  541. package/dist/sdk/governance/storage-integrity.js +1 -1
  542. package/dist/sdk/governance/tracked-runtime-cache.js +1 -1
  543. package/dist/sdk/governance/upgrade.js +2 -2
  544. package/dist/sdk/governance/validate-deferred-fields.js +1 -1
  545. package/dist/sdk/governance/validate-history-drift.js +1 -1
  546. package/dist/sdk/governance/validate-item-reader.js +1 -1
  547. package/dist/sdk/governance/validate-normalization.js +1 -1
  548. package/dist/sdk/governance/validate.js +1 -1
  549. package/dist/sdk/governance/workflow-completeness.js +1 -1
  550. package/dist/sdk/governance/workflow-policy.js +3 -3
  551. package/dist/sdk/governance/workspace-position.js +2 -2
  552. package/dist/sdk/graph/analytics.js +1 -1
  553. package/dist/sdk/graph/assembly.js +1 -1
  554. package/dist/sdk/graph/cache.js +1 -1
  555. package/dist/sdk/graph/cardinality-integrity.js +1 -1
  556. package/dist/sdk/graph/centrality.js +1 -1
  557. package/dist/sdk/graph/deadline-scheduling.js +1 -1
  558. package/dist/sdk/graph/durable-cache.js +1 -1
  559. package/dist/sdk/graph/governance-contracts.js +1 -1
  560. package/dist/sdk/graph/governance.js +1 -1
  561. package/dist/sdk/graph/hierarchy-integrity.js +1 -1
  562. package/dist/sdk/graph/lifecycle-coverage.js +1 -1
  563. package/dist/sdk/graph/mutation-advisory.js +1 -1
  564. package/dist/sdk/graph/query-contracts.js +1 -1
  565. package/dist/sdk/graph/remediation.js +1 -1
  566. package/dist/sdk/graph/run.js +1 -1
  567. package/dist/sdk/graph/scheduling.js +1 -1
  568. package/dist/sdk/graph/traversal.js +1 -1
  569. package/dist/sdk/graph/workspace-relationship-kind-registry.js +1 -1
  570. package/dist/sdk/guide-topics.js +1 -1
  571. package/dist/sdk/guide.js +7 -7
  572. package/dist/sdk/history/append-only-repair.d.ts +30 -0
  573. package/dist/sdk/history/append-only-repair.js +6 -0
  574. package/dist/sdk/history/attestation-command.js +2 -2
  575. package/dist/sdk/history/attestation-contract.js +1 -1
  576. package/dist/sdk/history/attestation-scan.js +1 -1
  577. package/dist/sdk/history/attestation.js +1 -1
  578. package/dist/sdk/history/maintenance.d.ts +8 -2
  579. package/dist/sdk/history/maintenance.js +1 -1
  580. package/dist/sdk/history/reanchor-refusal.js +2 -0
  581. package/dist/sdk/history/reseed.d.ts +15 -0
  582. package/dist/sdk/history/reseed.js +2 -0
  583. package/dist/sdk/history/salvage.d.ts +19 -8
  584. package/dist/sdk/history/salvage.js +5 -3
  585. package/dist/sdk/history/subject.js +1 -1
  586. package/dist/sdk/history-analytics.js +1 -1
  587. package/dist/sdk/history-compact.js +1 -1
  588. package/dist/sdk/history-mcp.js +1 -1
  589. package/dist/sdk/history-provenance.js +1 -1
  590. package/dist/sdk/history-read.js +1 -1
  591. package/dist/sdk/history-redact.js +1 -1
  592. package/dist/sdk/history-repair.d.ts +8 -2
  593. package/dist/sdk/history-repair.js +1 -1
  594. package/dist/sdk/improvement-ledger-validation.js +1 -1
  595. package/dist/sdk/improvement-ledger.js +2 -2
  596. package/dist/sdk/index.d.ts +1 -1
  597. package/dist/sdk/init-agent-guidance.js +10 -10
  598. package/dist/sdk/init.js +14 -14
  599. package/dist/sdk/invocation-author.js +1 -1
  600. package/dist/sdk/item-children.js +1 -1
  601. package/dist/sdk/item-metadata-index.js +1 -1
  602. package/dist/sdk/item-schedule.js +1 -1
  603. package/dist/sdk/item-transaction.d.ts +33 -1
  604. package/dist/sdk/item-transaction.js +1 -1
  605. package/dist/sdk/learnings.js +1 -1
  606. package/dist/sdk/lifecycle/append.js +3 -3
  607. package/dist/sdk/lifecycle/checkpoint-rollback.js +1 -1
  608. package/dist/sdk/lifecycle/claim.js +1 -1
  609. package/dist/sdk/lifecycle/cli-input.js +1 -1
  610. package/dist/sdk/lifecycle/close-many.js +1 -1
  611. package/dist/sdk/lifecycle/close.js +1 -1
  612. package/dist/sdk/lifecycle/copy.js +1 -1
  613. package/dist/sdk/lifecycle/core-field-recovery.js +1 -1
  614. package/dist/sdk/lifecycle/core-item-fields.js +1 -1
  615. package/dist/sdk/lifecycle/create-deferrals.js +1 -1
  616. package/dist/sdk/lifecycle/create.js +1 -1
  617. package/dist/sdk/lifecycle/delete.js +1 -1
  618. package/dist/sdk/lifecycle/dependency-removal.js +1 -1
  619. package/dist/sdk/lifecycle/event-validation-messages.js +1 -1
  620. package/dist/sdk/lifecycle/focus.js +1 -1
  621. package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -1
  622. package/dist/sdk/lifecycle/item-revision.js +1 -1
  623. package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -1
  624. package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -1
  625. package/dist/sdk/lifecycle/mcp-actions.js +1 -1
  626. package/dist/sdk/lifecycle/metadata-normalizers.js +1 -1
  627. package/dist/sdk/lifecycle/mutation-command-options.js +0 -1
  628. package/dist/sdk/lifecycle/mutation-facet-contracts.js +1 -1
  629. package/dist/sdk/lifecycle/mutation-option-validation.js +1 -1
  630. package/dist/sdk/lifecycle/plan-mutation-receipt.js +1 -1
  631. package/dist/sdk/lifecycle/plan.js +1 -1
  632. package/dist/sdk/lifecycle/recurrence-parsers.js +1 -1
  633. package/dist/sdk/lifecycle/release-handoff.js +1 -1
  634. package/dist/sdk/lifecycle/reopen.js +1 -1
  635. package/dist/sdk/lifecycle/repeatable-metadata-parsers.js +2 -2
  636. package/dist/sdk/lifecycle/repeated-terminal-state.js +1 -1
  637. package/dist/sdk/lifecycle/restore.js +1 -1
  638. package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
  639. package/dist/sdk/lifecycle/start-blockers.js +1 -1
  640. package/dist/sdk/lifecycle/structured-mutation-plan.js +1 -1
  641. package/dist/sdk/lifecycle/task-composition.js +1 -1
  642. package/dist/sdk/lifecycle/update-many.js +1 -1
  643. package/dist/sdk/lifecycle/update.js +2 -2
  644. package/dist/sdk/lifecycle/workflow-transition.js +1 -1
  645. package/dist/sdk/lifecycle-completion.js +1 -1
  646. package/dist/sdk/lifecycle-policy.js +1 -1
  647. package/dist/sdk/linked-artifacts.js +2 -2
  648. package/dist/sdk/mcp/apps.js +5 -5
  649. package/dist/sdk/mcp/authorization.js +1 -1
  650. package/dist/sdk/mcp/discovery.js +1 -1
  651. package/dist/sdk/mcp/executable.js +4 -4
  652. package/dist/sdk/mcp/interactions.js +1 -1
  653. package/dist/sdk/mcp/protocol.js +1 -1
  654. package/dist/sdk/mcp/skills.js +3 -3
  655. package/dist/sdk/mcp/subscriptions.js +1 -1
  656. package/dist/sdk/mcp/tasks.js +2 -2
  657. package/dist/sdk/mcp/transport.js +1 -1
  658. package/dist/sdk/merge/abandoned-receipts.js +1 -1
  659. package/dist/sdk/merge/driver.js +7 -7
  660. package/dist/sdk/merge/history-scalar-rebase.js +1 -1
  661. package/dist/sdk/merge/ignored-artifacts.js +1 -1
  662. package/dist/sdk/merge/index.js +1 -1
  663. package/dist/sdk/merge/indexed-receipt-blobs.js +2 -2
  664. package/dist/sdk/merge/install.js +6 -6
  665. package/dist/sdk/merge/receipt-file-boundary.js +1 -1
  666. package/dist/sdk/merge/receipt-operation.js +1 -1
  667. package/dist/sdk/merge/receipt-schema.js +1 -1
  668. package/dist/sdk/merge/receipts.js +4 -4
  669. package/dist/sdk/merge/reconcile.js +1 -1
  670. package/dist/sdk/merge/settlement-hook.js +4 -4
  671. package/dist/sdk/merge/stage.js +1 -1
  672. package/dist/sdk/merge/three-way.d.ts +22 -3
  673. package/dist/sdk/merge/three-way.js +9 -3
  674. package/dist/sdk/merge/worktree-config.js +2 -2
  675. package/dist/sdk/merge.js +1 -1
  676. package/dist/sdk/mutation-events.js +1 -1
  677. package/dist/sdk/mutation-guard.js +1 -1
  678. package/dist/sdk/notes.js +1 -1
  679. package/dist/sdk/output/fit-envelope.js +1 -1
  680. package/dist/sdk/output/list-envelope.js +1 -1
  681. package/dist/sdk/output/table-rows.js +1 -1
  682. package/dist/sdk/output-contracts.js +1 -1
  683. package/dist/sdk/output-projection.js +1 -1
  684. package/dist/sdk/output-token-accounting.js +1 -1
  685. package/dist/sdk/output.js +2 -2
  686. package/dist/sdk/ownership-source.js +1 -1
  687. package/dist/sdk/package-import-adapters.js +1 -1
  688. package/dist/sdk/package-migrations.js +1 -1
  689. package/dist/sdk/package-runtime-options.js +1 -1
  690. package/dist/sdk/pagination.js +1 -1
  691. package/dist/sdk/profile.js +5 -5
  692. package/dist/sdk/provenance.js +1 -1
  693. package/dist/sdk/public-surface.json +1 -1
  694. package/dist/sdk/query/activity.js +1 -1
  695. package/dist/sdk/query/aggregate.js +1 -1
  696. package/dist/sdk/query/calendar.js +4 -4
  697. package/dist/sdk/query/complete-list.js +1 -1
  698. package/dist/sdk/query/context.js +2 -2
  699. package/dist/sdk/query/declared-blockers.js +1 -1
  700. package/dist/sdk/query/duplicate-candidates.js +1 -1
  701. package/dist/sdk/query/get-facet-roots.js +1 -1
  702. package/dist/sdk/query/get.js +1 -1
  703. package/dist/sdk/query/history.js +1 -1
  704. package/dist/sdk/query/item-filter-options.js +0 -1
  705. package/dist/sdk/query/light-metadata.js +1 -1
  706. package/dist/sdk/query/list-filter-shared.js +1 -1
  707. package/dist/sdk/query/list.js +1 -1
  708. package/dist/sdk/query/multi-value-filters.js +1 -1
  709. package/dist/sdk/query/next-ranking-policy.js +1 -1
  710. package/dist/sdk/query/next-ready-budget.js +1 -1
  711. package/dist/sdk/query/next.js +2 -2
  712. package/dist/sdk/query/parsers.js +1 -1
  713. package/dist/sdk/query/projection-contracts.js +1 -1
  714. package/dist/sdk/query/search/corpus.js +2 -2
  715. package/dist/sdk/query/search/filters.js +1 -1
  716. package/dist/sdk/query/search/input.js +1 -1
  717. package/dist/sdk/query/search/lexical.js +1 -1
  718. package/dist/sdk/query/search/response.js +1 -1
  719. package/dist/sdk/query/search/semantic.js +3 -3
  720. package/dist/sdk/query/search/types.js +0 -1
  721. package/dist/sdk/query/search-contracts.js +1 -1
  722. package/dist/sdk/query/search-pagination.js +1 -1
  723. package/dist/sdk/query/search-rendering.js +1 -1
  724. package/dist/sdk/query/search.js +1 -1
  725. package/dist/sdk/query/window-pagination.js +1 -1
  726. package/dist/sdk/query/workspace-contracts.js +1 -1
  727. package/dist/sdk/read-output/continuation.js +1 -1
  728. package/dist/sdk/read-output/extension.js +1 -1
  729. package/dist/sdk/read-output/options.js +1 -1
  730. package/dist/sdk/read-output/positional-rows.js +1 -1
  731. package/dist/sdk/read-output/provenance.js +1 -1
  732. package/dist/sdk/read-output/session-result.js +0 -1
  733. package/dist/sdk/read-output/surfaces.js +1 -1
  734. package/dist/sdk/read-output/tail-retention.js +1 -1
  735. package/dist/sdk/read-output-budget.js +1 -1
  736. package/dist/sdk/read-output-contracts.js +1 -1
  737. package/dist/sdk/read-output-rows.js +1 -1
  738. package/dist/sdk/read-output-session.js +1 -1
  739. package/dist/sdk/relationship-analytics.js +1 -1
  740. package/dist/sdk/relationship-context.js +1 -1
  741. package/dist/sdk/relationship-history.js +6 -6
  742. package/dist/sdk/relationship-kinds/contract.js +1 -1
  743. package/dist/sdk/relationships.js +1 -1
  744. package/dist/sdk/reproducibility/process.js +1 -1
  745. package/dist/sdk/runtime/actions.js +1 -1
  746. package/dist/sdk/runtime/context.js +1 -1
  747. package/dist/sdk/runtime/mutation-admission.js +1 -1
  748. package/dist/sdk/runtime/mutation-value-validation.js +1 -1
  749. package/dist/sdk/runtime/schema-preview.js +1 -1
  750. package/dist/sdk/runtime/schema.js +1 -1
  751. package/dist/sdk/runtime-action-aliases.js +1 -1
  752. package/dist/sdk/runtime-extended-actions.js +1 -1
  753. package/dist/sdk/runtime-input.d.ts +8 -2
  754. package/dist/sdk/runtime-input.js +1 -1
  755. package/dist/sdk/runtime-primitives.d.ts +1 -1
  756. package/dist/sdk/runtime-primitives.js +1 -1
  757. package/dist/sdk/runtime-public-contracts.js +0 -1
  758. package/dist/sdk/runtime-stats-options.js +1 -1
  759. package/dist/sdk/runtime.d.ts +9 -0
  760. package/dist/sdk/runtime.js +1 -1
  761. package/dist/sdk/scheduling-shortcuts.js +1 -1
  762. package/dist/sdk/schema/field-option-collisions.js +2 -0
  763. package/dist/sdk/schema-migration.js +4 -4
  764. package/dist/sdk/schema.js +7 -7
  765. package/dist/sdk/search-refresh-worker.js +1 -1
  766. package/dist/sdk/similarity-scoring.js +1 -1
  767. package/dist/sdk/similarity.js +1 -1
  768. package/dist/sdk/start-task-status.js +1 -1
  769. package/dist/sdk/stats.js +1 -1
  770. package/dist/sdk/structured-mutations.d.ts +5 -5
  771. package/dist/sdk/structured-mutations.js +1 -1
  772. package/dist/sdk/telemetry-flush.js +1 -1
  773. package/dist/sdk/telemetry.js +4 -4
  774. package/dist/sdk/templates.js +3 -3
  775. package/dist/sdk/test/batch.js +2 -2
  776. package/dist/sdk/test/command-args.js +1 -1
  777. package/dist/sdk/test/command-resolution.js +2 -2
  778. package/dist/sdk/test/entry.js +2 -2
  779. package/dist/sdk/test/execution-receipts.js +2 -2
  780. package/dist/sdk/test/execution.js +5 -5
  781. package/dist/sdk/test/json-path.js +1 -1
  782. package/dist/sdk/test/linked-command-detection.js +1 -1
  783. package/dist/sdk/test/measurements.js +1 -1
  784. package/dist/sdk/test/parsers.js +1 -1
  785. package/dist/sdk/test/prerequisites.js +1 -1
  786. package/dist/sdk/test/receipt-index-snapshot.js +1 -1
  787. package/dist/sdk/test/run-phases.js +1 -1
  788. package/dist/sdk/test/runs.js +1 -1
  789. package/dist/sdk/test/trust.js +2 -2
  790. package/dist/sdk/test/update.js +1 -1
  791. package/dist/sdk/test/workspace-snapshot.js +1 -1
  792. package/dist/sdk/traceability/runtime-files-lookup.js +1 -1
  793. package/dist/sdk/traceability/source-traceability.js +2 -2
  794. package/dist/sdk/tracker-root-discovery.js +1 -1
  795. package/dist/sdk/transactions/item-finalization.js +2 -0
  796. package/dist/sdk/workspace-contracts-cache.js +1 -1
  797. package/dist/sdk/workspace-contracts.js +1 -1
  798. package/dist/sdk/workspace-memory.js +2 -2
  799. package/dist/sdk/workspace-snapshot.js +5 -5
  800. package/dist/sdk/workspace-transaction-gc.js +1 -1
  801. package/dist/sdk/workspace-transaction.js +2 -2
  802. package/dist/sdk/workspace.js +6 -6
  803. package/dist/types/index.js +1 -1
  804. package/dist/types.d.ts +20 -0
  805. package/dist/types.js +1 -1
  806. package/docs/AGENT_GUIDE.md +1 -1
  807. package/docs/AGENT_RUNTIME_PRIMITIVES.md +1 -1
  808. package/docs/COMMANDS.md +7 -3
  809. package/docs/EXTENSIONS.md +1 -1
  810. package/docs/HISTORY_RECOVERY.md +229 -5
  811. package/docs/README.md +2 -2
  812. package/docs/SDK.md +174 -5
  813. package/docs/SDK_CONTEXT_COORDINATION.md +3 -2
  814. package/marketplace.json +1 -1
  815. package/node_modules/tar/package.json +2 -3
  816. package/package.json +31 -2
  817. package/packages/pm-beads/package.json +1 -1
  818. package/packages/pm-calendar/package.json +1 -1
  819. package/packages/pm-command-kit/package.json +1 -1
  820. package/packages/pm-digital-twin/package.json +1 -1
  821. package/packages/pm-governance-audit/package.json +1 -1
  822. package/packages/pm-guide-shell/package.json +1 -1
  823. package/packages/pm-kanban/package.json +1 -1
  824. package/packages/pm-lifecycle-hooks/package.json +1 -1
  825. package/packages/pm-linked-test-adapters/package.json +1 -1
  826. package/packages/pm-search-advanced/package.json +1 -1
  827. package/packages/pm-templates/package.json +1 -1
  828. package/packages/pm-todos/package.json +1 -1
  829. package/packages/pm-vcs/package.json +1 -1
  830. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  831. package/plugins/pm-claude/package.json +1 -1
  832. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  833. package/plugins/pm-codex/package.json +1 -1
  834. package/plugins/pm-codex/plugin.json +1 -1
  835. package/runtime-dependencies.json +1 -1
  836. package/scripts/finalize-build.mjs +63 -24
  837. package/scripts/prepare-build-cache.mjs +28 -1
  838. package/dist/cli-bundle/chunks/chunk-2DXRTIC6.js +0 -21
  839. package/dist/cli-bundle/chunks/chunk-5647LU3A.js +0 -2287
  840. package/dist/cli-bundle/chunks/chunk-6QLEXRUG.js +0 -9
  841. package/dist/cli-bundle/chunks/chunk-AHQB7W2H.js +0 -3
  842. package/dist/cli-bundle/chunks/chunk-BKSVHOWI.js +0 -2
  843. package/dist/cli-bundle/chunks/chunk-CASX6SFI.js +0 -2
  844. package/dist/cli-bundle/chunks/chunk-CIKGG34F.js +0 -2
  845. package/dist/cli-bundle/chunks/chunk-D6ILFXZY.js +0 -2
  846. package/dist/cli-bundle/chunks/chunk-DEZPZOQ7.js +0 -2
  847. package/dist/cli-bundle/chunks/chunk-IB7UB5TE.js +0 -2
  848. package/dist/cli-bundle/chunks/chunk-IUIOTAF6.js +0 -9
  849. package/dist/cli-bundle/chunks/chunk-JVGRFU5H.js +0 -3
  850. package/dist/cli-bundle/chunks/chunk-KQIZ34SF.js +0 -3
  851. package/dist/cli-bundle/chunks/chunk-KVBIMFUG.js +0 -6
  852. package/dist/cli-bundle/chunks/chunk-LQBWLNZJ.js +0 -3
  853. package/dist/cli-bundle/chunks/chunk-NCFCBKIP.js +0 -2
  854. package/dist/cli-bundle/chunks/chunk-NT5AKFE5.js +0 -31
  855. package/dist/cli-bundle/chunks/chunk-PJXKA4QU.js +0 -125
  856. package/dist/cli-bundle/chunks/chunk-RMIRNYRG.js +0 -71
  857. package/dist/cli-bundle/chunks/chunk-RULHZRFN.js +0 -2
  858. package/dist/cli-bundle/chunks/chunk-S6HB3WL2.js +0 -2
  859. package/dist/cli-bundle/chunks/chunk-SA4BNP3Q.js +0 -2
  860. package/dist/cli-bundle/chunks/chunk-SPPHDVZE.js +0 -2
  861. package/dist/cli-bundle/chunks/chunk-SRVTCYAU.js +0 -2
  862. package/dist/cli-bundle/chunks/chunk-WELSVDPU.js +0 -2
  863. package/dist/cli-bundle/chunks/chunk-XHJ3H5PL.js +0 -3
  864. package/dist/cli-bundle/chunks/chunk-XWHJIRNV.js +0 -8
  865. package/dist/cli-bundle/chunks/chunk-YJEBK7HU.js +0 -8
  866. package/dist/cli-bundle/chunks/chunk-YKJKQ7DM.js +0 -115
  867. package/dist/cli-bundle/chunks/chunk-YMUSRWV4.js +0 -9
  868. package/dist/cli-bundle/chunks/chunk-YR2KEBHP.js +0 -2
  869. package/dist/cli-bundle/chunks/context-budget-recovery-L2WP5S26.js +0 -2
  870. package/dist/cli-bundle/chunks/indexed-receipt-blobs-ITTXIN4K.js +0 -4
  871. package/dist/cli-bundle/chunks/item-transaction-7DFCG73I.js +0 -2
  872. package/dist/cli-bundle/chunks/mutation-actor-3TG636XG.js +0 -2
  873. package/dist/cli-bundle/chunks/mutation-admission-LICSDNNO.js +0 -2
  874. package/dist/cli-bundle/chunks/register-mutation-WWVECKFQ.js +0 -21
  875. package/dist/cli-bundle/chunks/register-operations-L6HFJNWD.js +0 -2
  876. package/dist/cli-bundle/chunks/register-setup-K7UFG5TD.js +0 -2
  877. package/dist/cli-bundle/chunks/settlement-hook-BXN5LEQD.js +0 -7
  878. package/dist/cli-bundle/chunks/stage-57KH3KAC.js +0 -2
  879. package/dist/cli-bundle/focused-chunks/chunk-3IRCYJI5.js +0 -3
  880. package/dist/cli-bundle/focused-chunks/chunk-3V53UBHN.js +0 -9
  881. package/dist/cli-bundle/focused-chunks/chunk-532WZV65.js +0 -2
  882. package/dist/cli-bundle/focused-chunks/chunk-7A4QWNZX.js +0 -8
  883. package/dist/cli-bundle/focused-chunks/chunk-C3O6JJPO.js +0 -2
  884. package/dist/cli-bundle/focused-chunks/chunk-CR7CGEB2.js +0 -3
  885. package/dist/cli-bundle/focused-chunks/chunk-CU2BRAOX.js +0 -2
  886. package/dist/cli-bundle/focused-chunks/chunk-CWWKRI5P.js +0 -2
  887. package/dist/cli-bundle/focused-chunks/chunk-EGN2HFRU.js +0 -2
  888. package/dist/cli-bundle/focused-chunks/chunk-GHQVM6K6.js +0 -2
  889. package/dist/cli-bundle/focused-chunks/chunk-HGFNL5XI.js +0 -2
  890. package/dist/cli-bundle/focused-chunks/chunk-I5LGPUWH.js +0 -2
  891. package/dist/cli-bundle/focused-chunks/chunk-IQK5NPMG.js +0 -13
  892. package/dist/cli-bundle/focused-chunks/chunk-J63D6QST.js +0 -6
  893. package/dist/cli-bundle/focused-chunks/chunk-JMQJBZQ5.js +0 -2
  894. package/dist/cli-bundle/focused-chunks/chunk-LNHUE4VV.js +0 -2
  895. package/dist/cli-bundle/focused-chunks/chunk-MKM5NKD7.js +0 -8
  896. package/dist/cli-bundle/focused-chunks/chunk-NP72ZDXE.js +0 -2
  897. package/dist/cli-bundle/focused-chunks/chunk-OSLQD5VH.js +0 -102
  898. package/dist/cli-bundle/focused-chunks/chunk-QGKLRXP7.js +0 -2
  899. package/dist/cli-bundle/focused-chunks/chunk-QSJW6NSQ.js +0 -66
  900. package/dist/cli-bundle/focused-chunks/chunk-RPE6IX26.js +0 -2
  901. package/dist/cli-bundle/focused-chunks/chunk-SRDQSA6M.js +0 -91
  902. package/dist/cli-bundle/focused-chunks/chunk-SVOOGGAK.js +0 -2
  903. package/dist/cli-bundle/focused-chunks/chunk-UOC6257J.js +0 -26
  904. package/dist/cli-bundle/focused-chunks/chunk-URJ2E6AS.js +0 -3
  905. package/dist/cli-bundle/focused-chunks/chunk-WXMI4AV5.js +0 -8
  906. package/dist/cli-bundle/focused-chunks/chunk-XCJSHNXK.js +0 -27
  907. package/dist/cli-bundle/focused-chunks/chunk-XQQSSKJI.js +0 -44
  908. package/dist/cli-bundle/focused-chunks/chunk-YOAYY3HE.js +0 -2
  909. package/dist/cli-bundle/focused-chunks/context-budget-recovery-5MKOCGY5.js +0 -2
  910. package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-AF4U3F3D.js +0 -4
  911. package/dist/cli-bundle/focused-chunks/item-transaction-HLBW7B3J.js +0 -2
  912. package/dist/cli-bundle/focused-chunks/mutation-actor-62HKR5IO.js +0 -2
  913. package/dist/cli-bundle/focused-chunks/mutation-admission-X4PF2SG3.js +0 -2
  914. package/dist/cli-bundle/focused-chunks/settlement-hook-ARYCZQY4.js +0 -7
  915. package/dist/cli-bundle/focused-chunks/stage-O7T7CXBB.js +0 -2
  916. package/dist/sdk/agent/refusal-closure.js +0 -2
  917. package/dist/sdk/agent/refusal-reachability.js +0 -4
  918. package/dist/sdk/agent/task-transcript-contracts.js +0 -2
  919. package/dist/sdk/agent/tracker-preflight-contracts.js +0 -2
  920. package/dist/sdk/authoring.js +0 -2
  921. package/dist/sdk/compose.js +0 -2
  922. package/dist/sdk/contracts.js +0 -2
  923. package/dist/sdk/core-governance.js +0 -2
  924. package/dist/sdk/core.js +0 -2
  925. package/dist/sdk/corpus-shape.js +0 -2
  926. package/dist/sdk/define.js +0 -2
  927. package/dist/sdk/environment/agent-environment.js +0 -2
  928. package/dist/sdk/governance/artifact-ledgers.js +0 -2
  929. package/dist/sdk/governance/coverage-assurance.js +0 -2
  930. package/dist/sdk/governance/reliability.js +0 -2
  931. package/dist/sdk/governance.js +0 -2
  932. package/dist/sdk/graph/adapter.js +0 -2
  933. package/dist/sdk/graph/conformance.js +0 -2
  934. package/dist/sdk/graph/index.js +0 -2
  935. package/dist/sdk/graph.js +0 -2
  936. package/dist/sdk/index.js +0 -2
  937. package/dist/sdk/query.js +0 -2
  938. package/dist/sdk/relationship-migration.js +0 -2
  939. package/dist/sdk/testing.js +0 -8
  940. package/dist/sdk/workspace-recipe.js +0 -2
  941. package/docs/AGENT_PROVENANCE_ADR.md +0 -206
  942. package/docs/DEFECT_RECURRENCE.md +0 -257
  943. package/docs/PERFORMANCE.md +0 -204
@@ -1,8 +1,8 @@
1
- import{a as xg}from"./chunks/chunk-CIKGG34F.js";import{a as Cx,b as Ex,c as Sx,d as wx}from"./chunks/chunk-JVGRFU5H.js";import{a as Ax,b as Ox}from"./chunks/chunk-D6ILFXZY.js";import{b as Hk,c as Vk,d as Kk,e as Wk,f as Yk,g as Xk,h as Jk,i as Qk,j as Zk,k as ex,l as tx,m as rx,n as ox,o as nx,p as ix,q as sx,r as ax}from"./chunks/chunk-SA4BNP3Q.js";import{A as fx,B as _x,C as hx,D as gx,E as yx,F as bx,G as Tx,a as qs,b as XR,c as JR,d as xc,e as Nc,f as Lc,h as Dc,i as $c,j as Fc,k as Gc,l as Uc,m as jc,n as Bc,o as qc,p as Vd,q as Kd,r as Wd,s as Yd,t as Xd,u as cx,v as dx,w as lx,x as px,y as ux,z as mx}from"./chunks/chunk-CASX6SFI.js";import{A as Zx,B as eN,C as tN,D as rN,E as oN,F as nN,G as iN,H as sN,I as aN,J as cN,K as dN,L as lN,M as pN,N as uN,O as mN,P as fN,Q as _N,R as hN,S as gN,T as yN,U as bN,V as TN,W as CN,X as EN,Y as SN,Z as wN,_ as AN,a as vx,b as Rx,c as Ix,d as Px,e as Mx,f as kx,g as xx,h as Nx,i as Lx,j as Dx,k as $x,l as Fx,m as Gx,n as Ux,o as jx,p as Bx,q as qx,r as zx,s as Hx,t as Vx,u as Kx,v as Wx,w as Yx,x as Xx,y as Jx,z as Qx}from"./chunks/chunk-XWHJIRNV.js";import{$ as _f,$a as sh,$b as sg,A as m0,Aa as R_,Ab as xh,B as Ke,Ba as I_,Bb as Nh,C as ef,Ca as P_,Cb as Lh,D as tf,Da as M_,Db as Dh,E as of,Ea as k_,Eb as $h,F as zt,Fa as x_,Fb as Fh,G as Ht,Ga as N_,Gb as Gh,H as Vt,Ha as L_,Hb as Uh,I as Kt,Ia as D_,Ib as jh,J as Wt,Ja as $_,Jb as Bh,K as Yt,Ka as F_,Kb as qh,L as Xt,La as G_,Lb as zh,M as Jt,Ma as U_,Mb as Hh,N as Qt,Na as j_,Nb as Vh,O as Zt,Oa as B_,Ob as Kh,P as er,Pa as q_,Pb as Wh,Q as nf,Qa as z_,Qb as Yh,R as sf,Ra as H_,Rb as Xh,S as af,Sa as V_,Sb as Jh,T as cf,Ta as K_,Tb as Qh,U as df,Ua as W_,Ub as Zh,V as We,Va as tr,Vb as eg,W as lf,Wa as _e,Wb as tg,X as pf,Xa as rh,Xb as rg,Y as uf,Ya as oh,Yb as og,Z as mf,Za as nh,Zb as ng,_ as ff,_a as ih,_b as ig,a as dR,aa as hf,ab as ah,ac as ag,b as lR,ba as gf,bb as ch,bc as cg,c as pR,ca as Ok,cb as dh,cc as dg,d as uR,da as vk,db as lh,dc as lg,e as mR,ea as Rk,eb as ph,ec as pg,f as fR,fa as Pf,fb as uh,fc as ug,g as gR,ga as Mf,gb as mh,gc as mg,h as yR,ha as kf,hb as fh,hc as fg,i as bR,ia as y_,ib as _h,ic as _g,j as TR,ja as b_,jb as hh,jc as hg,k as zs,ka as $k,kb as gh,kc as gg,l as cd,la as Fk,lb as yh,lc as yg,m as dd,ma as Gk,mb as bh,mc as bg,n as ld,na as Uk,nb as Th,nc as Tg,oa as jk,ob as Ch,oc as Cg,p as LP,pa as Bk,pb as Eh,pc as Eg,q as DP,qa as qk,qb as Sh,qc as Sg,r as $P,ra as zk,rb as wh,rc as wg,s as FP,sa as T_,sb as Ah,sc as Ag,t as GP,ta as C_,tb as Oh,tc as Og,u as UP,ua as E_,ub as vh,uc as vg,v as Nu,va as S_,vb as Rh,vc as Rg,w as $u,wa as w_,wb as Ih,wc as Ig,x as Fu,xa as A_,xb as Ph,xc as Pg,y as nm,ya as O_,yb as Mh,yc as Mg,z as pm,za as v_,zb as kh,zc as kg}from"./chunks/chunk-5647LU3A.js";import{e as qP,f as zP,g as ep,h as tp,i as jt}from"./chunks/chunk-AHQB7W2H.js";import{A as _k,B as hk,C as gk,D as yk,E as bk,F as Tk,G as Ck,H as Ek,I as Sk,J as wk,K as Ak,L as Tf,M as Cf,N as Ef,O as Sf,P as wf,Q as Af,R as Of,S as vf,T as Rf,U as If,a as XM,b as JM,c as QM,d as ZM,e as e0,f as xu,g as t0,h as r0,i as o0,j as n0,k as i0,m as rf,n as yf,o as nk,p as ik,q as sk,r as ak,s as ck,t as dk,u as bf,v as lk,w as pk,x as uk,y as mk,z as fk}from"./chunks/chunk-KVBIMFUG.js";import{$ as KI,$a as Tp,$b as Ru,$d as X_,A as ze,Aa as yP,Ab as iM,Ac as zu,Ad as Kf,B as ee,Ba as bP,Bb as gu,Bc as Hu,Bd as Wf,C as ll,Ca as TP,Cb as sM,Cc as Vu,Cd as Yf,Db as SM,Dc as Ku,Dd as Xf,Eb as wM,Ec as Wu,Ed as Jf,F as He,Fa as jP,Fb as AM,Fc as Yu,Fd as Qf,G as pl,Ga as BP,Gb as OM,Gc as Xu,Gd as Zf,H as ul,Ha as Kl,Hb as vM,Hc as Ju,Hd as e_,Ia as Wl,Ib as RM,Ic as Qu,Id as t_,J as fe,Ja as Yl,Jb as IM,Jc as Zu,Jd as r_,K as ml,Ka as Xl,Kb as LM,Kc as em,Kd as o_,L as fl,La as Jl,Lb as DM,Lc as tm,Ld as n_,M as _l,Ma as Ql,Mb as yu,Mc as rm,Md as i_,N as hl,Na as Zl,Nb as bu,Nd as s_,O as DI,Oa as ap,Ob as $M,Oc as p0,Od as a_,P as $I,Pa as cp,Pb as FM,Pc as u0,Q as FI,Qa as dp,Qb as GM,Qc as om,Qd as c_,R as GI,Ra as lp,Rb as UM,Rc as um,Rd as d_,S as UI,Sa as pp,Sb as jM,Sc as mm,Sd as l_,T as xt,Ta as up,Tb as Tu,Tc as fm,Td as p_,U as jI,Ua as mp,Ub as Cu,Uc as _m,Ud as u_,V as BI,Va as fp,Vb as Eu,Vc as hm,Vd as m_,W as Nt,Wa as _p,Wb as Su,Wd as f_,X as qI,Xa as hp,Xb as wu,Xd as __,Y as zI,Ya as gp,Yb as Au,Yd as h_,Z as HI,Za as yp,Zb as Ou,Zd as g_,_ as VI,_a as bp,_b as vu,_c as gm,_d as Y_,a as QR,aa as Ve,ab as Cp,ac as Iu,ad as Vm,ae as J_,b as It,ba as WI,bb as Ep,bc as Pu,bd as Km,be as Q_,c as ZR,ca as Lt,cb as Sp,cc as Mu,cd as Wm,ce as Z_,d as Zc,da as YI,db as wp,dc as BM,de as eh,e as ed,ea as XI,eb as Ap,ec as qM,ed as Ym,ee as th,f as td,fa as JI,fb as Op,fc as zM,fd as Xm,g as rd,ga as QI,gb as vp,gc as HM,gd as Jm,h as od,ha as ZI,hb as Rp,hc as VM,hd as Qm,ia as eP,ib as KP,ic as KM,id as Zm,j as nd,ja as tP,jb as Ip,jc as WM,jd as xf,k as id,ka as rP,kb as Pp,kc as YM,kd as Nf,la as oP,lb as Mp,lc as ku,ld as Lf,ma as nP,mb as kp,mc as s0,md as Df,na as iP,nb as WP,nc as a0,nd as $f,o as sd,oa as sP,ob as xp,oc as c0,od as Ff,p as ad,pa as aP,pb as Np,pc as d0,pd as Gf,qa as cP,qb as Lp,qc as l0,qd as Uf,ra as dP,rb as Dp,rd as jf,sa as lP,sb as $p,sc as Lu,sd as Nk,ta as pP,tb as YP,tc as Du,td as Lk,ua as uP,ub as XP,uc as Gu,ud as Dk,va as mP,vb as JP,vc as Uu,vd as Bf,w as Mt,wa as fP,wb as QP,wd as qf,xa as _P,xb as ZP,xc as ju,xd as zf,y as kt,ya as hP,yb as eM,yc as Bu,yd as Hf,za as gP,zb as tM,zc as qu,zd as Vf}from"./chunks/chunk-NT5AKFE5.js";import"./chunks/chunk-YR2KEBHP.js";import{x as Jd}from"./chunks/chunk-RULHZRFN.js";import{A as xP,Aa as $l,B as NP,Ba as Fl,C as Il,D as Pl,Da as Gl,E as Ml,Ea as Ul,F as kl,Fa as jl,G as Dt,Ga as Bl,Ha as ql,Ja as zl,Ka as Hl,La as Vl,b as AR,c as OR,d as vR,e as RR,f as IR,g as PR,h as Hs,i as Vs,j as Ks,k as Ws,l as Ys,ma as $t,n as CP,na as Ft,oa as Gt,pa as Ut,qa as xl,sa as Nl,ta as Ll,ua as Dl,w as PP,x as MP,z as kP}from"./chunks/chunk-RMIRNYRG.js";import{a as EP,b as SP,c as wP,d as AP,e as OP,f as vP,g as RP,h as Cl,i as El,j as Sl,k as wl,l as Al,m as IP,n as Ol,o as vl,p as Rl}from"./chunks/chunk-YJEBK7HU.js";import{a as gl,b as yl,e as bl,f as Tl}from"./chunks/chunk-YMUSRWV4.js";import{$a as gM,$b as D0,A as RI,Aa as du,Ab as Sm,Ac as Dm,B as Qd,Ba as lu,Bb as wm,Bc as $m,C as Zd,Ca as pu,Cb as Am,Cc as Fm,D as el,Da as uu,Db as _0,Dc as Gm,E as tl,Ea as mu,Eb as h0,Ec as Um,F as rl,Fa as fu,Fb as g0,Fc as jm,G as ol,Ga as _u,Gb as y0,Gc as Bm,H as nl,Ha as hu,Hb as b0,Hc as qm,I as il,Ib as T0,Ic as qt,J as sl,Jb as C0,Jc as zm,K as al,Kc as ek,L as cl,La as rM,Lb as Om,Lc as tk,M as qe,Ma as oM,Mb as vm,Mc as rk,N as II,Na as nM,Nb as E0,Nc as Hm,O as PI,Oa as aM,Ob as S0,Oc as ok,P as MI,Pa as cM,Pb as w0,Pc as Ik,Q as kI,Qa as dM,Qb as A0,Qc as Pk,R as xI,Ra as lM,Rb as O0,Rc as Mk,S as NI,Sa as pM,Sb as v0,Sc as kk,T as LI,Ta as uM,Tb as R0,Tc as xk,U as dl,Ua as mM,Ub as I0,V as rp,Va as fM,Vb as P0,W as op,Wa as _M,Wb as M0,X as np,Xa as hM,Xb as k0,Y as ip,Yb as x0,Z as HP,Zb as N0,_ as VP,_b as L0,a as CR,aa as sp,ac as $0,b as ER,ba as Fp,bb as yM,bc as F0,c as SR,ca as Gp,cb as bM,cc as G0,d as wR,da as Up,dc as U0,e as fI,ea as jp,ec as j0,f as _I,fa as Bp,fb as TM,fc as B0,g as hI,ga as qp,gb as CM,gc as q0,h as gI,ha as zp,hb as EM,hc as z0,i as yI,ia as Hp,ic as H0,j as bI,ja as Vp,jb as PM,jc as V0,k as TI,ka as Kp,kb as MM,kc as K0,la as Wp,lb as kM,lc as W0,ma as Yp,mb as xM,mc as Y0,na as Xp,nb as NM,nc as X0,oa as Jp,ob as im,oc as J0,pa as Qp,pb as sm,pc as Q0,qa as Zp,qb as am,qc as Z0,ra as eu,rb as cm,rc as Bt,sa as tu,sb as dm,sc as Rm,t as CI,ta as ru,tb as lm,tc as Im,u as EI,ua as ou,ub as ym,uc as Pm,v as SI,va as nu,vb as bm,vc as Mm,w as wI,wa as iu,wb as Tm,wc as km,x as AI,xa as su,xb as Cm,xc as xm,y as OI,ya as au,yb as f0,yc as Nm,z as vI,za as cu,zb as Em,zc as Lm}from"./chunks/chunk-2DXRTIC6.js";import{a as _R,b as hR}from"./chunks/chunk-NCFCBKIP.js";import{$ as Ea,$a as Ec,A as Js,Aa as Ya,Ab as _d,B as Qs,Ba as Xa,Bb as hd,C as Zs,Ca as Ja,Cb as gd,Da as Qa,Db as yd,E as ea,Ea as Za,Eb as bd,F as ta,Fa as ec,Fb as Td,G as ra,Ga as tc,Gb as Cd,H as oa,Ha as rc,Hb as Ed,I as na,Ia as oc,Ib as Sd,J as ia,Ja as nc,Jb as wd,K as sa,Ka as ic,Kb as Ad,L as aa,La as sc,Lb as Od,M as ca,Ma as ac,Mb as vd,N as da,Na as cc,Nb as Rd,O as la,Oa as dc,Ob as Id,P as pa,Pa as lc,Pb as Pd,Q as ua,Qa as pc,Qb as Md,R as ma,Ra as uc,Rb as kd,Sa as mc,Sb as xd,T as fa,Ta as fc,Tb as Nd,U as _a,Ua as _c,Ub as eI,V as ha,Va as hc,Vb as tI,W as ga,Wa as gc,Wb as rI,X as ya,Xa as yc,Xb as oI,Y as ba,Ya as bc,Yb as nI,Z as Ta,Za as Tc,Zb as iI,_ as Ca,_a as Cc,a as MR,aa as Sa,ab as Sc,b as kR,ba as wa,bb as wc,bc as sI,c as xR,ca as Aa,cb as Ac,cc as aI,d as NR,da as Oa,db as Oc,dc as cI,e as LR,ea as va,eb as vc,ec as dI,fa as Ra,fb as Rc,fc as lI,g as DR,ga as Ia,gb as Ic,gc as pI,h as $R,ha as Pa,hb as Pc,hc as uI,i as Xs,ia as Ma,ib as Mc,ic as mI,j as FR,ja as ka,ka as xa,kb as Be,kc as Ld,la as Na,lb as Z,lc as Dd,m as GR,ma as La,mb as kc,mc as $d,n as UR,na as Da,nb as zc,nc as Fd,o as Ue,oa as $a,ob as Hc,oc as Gd,p as jR,pa as Fa,pb as Vc,pc as Ud,q as BR,qa as Ga,qb as Kc,qc as jd,r as qR,ra as Ua,rb as Wc,rc as Bd,s as Rt,sa as ja,sb as Yc,sc as qd,t as je,ta as Ba,tb as Xc,tc as zd,u as zR,ua as qa,ub as Jc,uc as Hd,v as HR,va as za,vb as Qc,vc as Pt,w as VR,wa as Ha,wb as pd,x as KR,xa as Va,xb as ud,y as WR,ya as Ka,yb as md,z as YR,za as Wa,zb as fd}from"./chunks/chunk-IUIOTAF6.js";import{a as eR,b as tR,c as rR,d as oR,e as nR,f as iR,g as sR,h as aR,i as cR,j as Ns,k as Ls,l as Ds,m as $s,n as Fs,o as Gs,q as Us,s as js,y as Bs}from"./chunks/chunk-BKSVHOWI.js";import{b as Jv}from"./chunks/chunk-SRVTCYAU.js";import"./chunks/chunk-IB7UB5TE.js";import{$b as cv,$c as Iv,A as pC,Aa as tO,Ab as zO,Ac as bv,Ad as Wv,B as uC,Ba as rO,Bc as Tv,Bd as Yv,C as mC,Cc as Cv,Cd as Xv,Db as HO,Dc as Ev,Dd as Qv,Ec as Sv,Ed as Zv,Fb as VO,Fc as wv,Gc as Av,Hc as fs,Ic as _s,Jb as KO,Jc as hs,K as SC,Kb as WO,Kc as gs,La as oO,Lb as YO,Lc as ys,M as kC,Ma as nO,Mb as os,Mc as bs,N as xC,Na as iO,Nb as XO,Nc as Ts,O as NC,Oa as sO,Oc as Cs,P as LC,Pa as aO,Pb as JO,Pc as Es,Q as jC,Qa as cO,Qb as QO,Qc as Ss,R as BC,Ra as fO,Rb as ZO,Rc as ws,S as wt,Sa as _O,Sb as ev,Sc as As,T as CA,Ta as hO,Tb as tv,Tc as Os,U as EA,Ua as At,Ub as rv,Uc as vs,V as SA,Vb as ov,Wa as gO,Wb as nv,Wc as Rs,X as wA,Xa as yO,Xb as iv,Xc as Ov,Ya as bO,Yb as sv,Yc as vv,Z as AA,Za as TO,Zb as Ot,Zc as Is,_ as OA,_a as CO,_b as av,_c as Rv,a as QT,aa as vA,ad as Ps,ba as RA,bb as EO,bd as Ms,ca as IA,cd as Pv,da as PA,dd as Mv,ea as MA,ed as kv,fa as kA,fb as Xi,fc as ns,fd as xv,ga as xA,gc as is,gd as Nv,ha as qA,hb as kO,hc as ss,hd as Lv,i as sn,ib as xO,ic as as,id as Dv,j as ZT,ja as Vi,jb as NO,jd as ks,k as eC,ka as Ki,kb as LO,kc as cs,kd as xs,l as tC,la as Wi,lc as ds,ld as $v,m as rC,mb as DO,mc as ls,md as Fv,na as zA,nb as $O,nc as ps,nd as Gv,o as oC,oa as HA,ob as FO,oc as us,od as Uv,p as nC,pa as VA,pb as GO,pc as ms,pd as jv,qa as KA,qb as es,qc as dv,qd as Bv,r as iC,ra as WA,rb as ts,rc as lv,rd as qv,sa as YA,sc as pv,sd as zv,t as sC,ta as XA,tb as rs,tc as uv,td as Hv,u as aC,ub as UO,uc as mv,ud as Vv,v as cC,va as JA,vc as fv,vd as Kv,wb as jO,wc as _v,x as dC,xa as QA,xb as BO,xc as hv,y as lC,ya as ZA,yb as qO,yc as gv,za as eO,zc as yv,zd as vt}from"./chunks/chunk-PJXKA4QU.js";import{A as OO,B as vO,C as RO,D as IO,E as PO,F as MO,G as Ji,H as Qi,I as Zi,a as NA,b as LA,c as DA,d as $A,e as FA,f as GA,g as UA,h as jA,i as BA,n as dO,q as lO,r as pO,u as uO,v as Yi,w as mO,x as SO,y as wO,z as AO}from"./chunks/chunk-6QLEXRUG.js";import{$b as PC,$d as _E,$e as BE,$f as bS,$i as oA,A as Fo,Ad as Wn,Af as Mi,Ag as VS,B as Go,Bf as ki,Bg as KS,C as Uo,Cb as wC,Cc as kn,Ce as OE,Cf as xi,Cg as WS,D as jo,Db as AC,Dc as oE,De as vE,Df as Ni,Dg as YS,E as Bo,Ec as xn,Ee as RE,Ef as Li,Eg as XS,F as qo,Fa as fC,Ff as ZE,Fg as JS,G as zo,Ga as _C,Gc as nE,Gf as eS,Gg as QS,H as Ho,Ha as hC,Hd as uE,Hf as tS,Hg as ZS,I as Ne,Ib as OC,Id as mE,Ie as _i,If as rS,Ig as ew,J as Le,Jd as fE,Jf as oS,Jg as tw,K as Vo,Ka as gn,Kd as Yn,Kf as nS,Kg as rw,Ki as Ww,L as Ko,La as gC,Lb as vC,Ld as Xn,Lf as iS,Lg as ow,Li as Yw,M as Wo,Ma as yC,Mc as iE,Md as Jn,Me as IE,Mf as sS,Mg as nw,Mi as Xw,N as Yo,Na as bC,Nd as Qn,Ne as PE,Nf as aS,Ng as iw,O as Xo,Oa as TC,Ob as RC,Od as Zn,Oe as ME,Og as sw,Oi as Jw,P as Jo,Pc as sE,Pd as ei,Pe as kE,Ph as Mw,Pi as Qw,Q as Qo,Qa as yn,Qc as aE,Qd as ti,Qe as xE,Qf as cS,Qh as Ge,R as Zo,Ra as bn,Rb as IC,Rc as Nn,Rd as ri,Re as NE,Rf as dS,Rg as aw,Rh as St,Ri as Zw,S as en,Sa as $e,Sc as Ln,Sd as oi,Se as LE,Sf as lS,Sg as cw,Sh as kw,Si as Ui,T as tn,Ta as CC,Tb as Tt,Td as ni,Te as DE,Tf as pS,Tg as dw,Th as xw,U as rn,Ua as EC,Uc as Dn,Ud as ii,Ue as $E,Uf as uS,Ug as lw,Uh as Nw,Ui as ji,V as on,Va as Tn,Vb as Ct,Vc as $n,Vd as si,Ve as FE,Vf as mS,Vg as pw,Vh as Lw,Vi as Bi,W as nn,Wa as Cn,Wc as Fn,Wd as ai,We as GE,Wf as fS,Wg as uw,Wh as q,Xb as Pn,Xc as Gn,Xd as ci,Xe as UE,Xf as _S,Xg as mw,Xh as Dw,Ya as En,Yb as Mn,Yc as Un,Yd as di,Yf as hS,Yg as fw,Yh as $w,Yi as eA,Zb as Et,Zc as cE,Zf as gS,Zh as Fw,Zi as tA,_c as dE,_e as jE,_f as yS,_h as Gw,_i as rA,a as R,aa as gt,ae as hE,af as qE,ag as TS,ah as _w,ai as Fi,aj as nA,b as UT,ba as yt,bc as MC,be as li,bf as zE,bg as CS,bh as hw,bi as Gi,bj as iA,c as ht,ca as ln,cc as DC,cf as HE,cg as ES,cj as sA,da as pn,dc as $C,de as gE,df as VE,dg as SS,dj as qi,e as jT,ea as un,ec as FC,ee as yE,ef as KE,eg as wS,eh as gw,ej as aA,f as BT,fc as GC,ff as WE,fg as AS,fh as yw,fj as cA,g as qT,gc as UC,gf as YE,gg as OS,gh as bw,h as zT,hc as qC,hf as XE,hg as vS,hh as Tw,i as HT,ic as zC,if as JE,ig as RS,ih as Cw,ij as dA,j as VT,ja as mn,jb as Sn,jc as HC,je as bE,jf as QE,jg as IS,jh as Ew,jj as lA,k as KT,kb as wn,kc as VC,kd as jn,ke as TE,kg as PS,kh as Sw,kj as pA,l as WT,la as fn,lb as An,lc as KC,ld as Bn,le as CE,lf as hi,lg as MS,lh as ww,lj as uA,m as YT,ma as _n,mb as On,mc as WC,md as lE,me as EE,mf as gi,mg as kS,mh as Aw,mi as Uw,mj as mA,n as XT,na as hn,nb as vn,nc as YC,nd as qn,nf as yi,ng as xS,nh as Ow,nj as fA,o as JT,oc as XC,od as zn,oe as SE,of as bi,og as NS,oh as vw,oi as jw,oj as zi,p as Po,pc as JC,pd as pE,pe as wE,pf as Ti,pg as LS,ph as Rw,pi as Bw,q as Mo,qc as QC,qd as Hn,qf as Ci,qg as DS,qh as Iw,qi as qw,r as ko,rc as ZC,rd as Vn,re as AE,rf as Ei,rg as $S,ri as zw,rj as _A,s as xo,sc as eE,sd as L,sf as Si,sg as FS,sh as Pw,si as Hw,sj as Hi,t as ke,tc as tE,td as Kn,te as pi,tf as wi,tg as GS,th as Di,u as No,ue as ui,uf as Ai,ug as US,uh as $i,v as N,ve as mi,vf as Oi,vg as jS,vj as hA,w as xe,wb as Rn,we as fi,wf as vi,wg as BS,wi as Vw,wj as gA,x as Lo,xf as Ri,xg as qS,xj as yA,y as Do,yb as In,yf as Ii,yg as zS,yi as Kw,yj as bA,z as $o,zc as rE,zd as Fe,zf as Pi,zg as HS,zj as TA}from"./chunks/chunk-YKJKQ7DM.js";import"./chunks/chunk-LQBWLNZJ.js";import"./chunks/chunk-SPPHDVZE.js";import{A as ue,B as GT,C as b,E as an,F as bt,G as me,H as cn,K as De,M as dn,b as kT,c as xT,d as NT,m as LT,r as DT,u as $T,y as FT}from"./chunks/chunk-KQIZ34SF.js";import"./chunks/chunk-XAWE4EAK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8f11e0bf-4115-55a8-bd39-c360f43cdc09")}catch{}})();var z="2026-07-28",or=["2025-11-25","2025-06-18"],te=[z],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},w={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},rr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,o={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=o}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Ng(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:w.clientInfo,required:["name","version"]});let o={name:t.slice(0,128),version:r.slice(0,128)};return typeof e.description=="string"&&e.description.trim()&&(o.description=e.description.trim().slice(0,1024)),typeof e.websiteUrl=="string"&&e.websiteUrl.trim()&&(o.websiteUrl=e.websiteUrl.trim().slice(0,2048)),o}function Lg(e){if(e!==void 0){if(typeof e!="string"||!rr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:w.logLevel,allowed:[...rr]});return e}}function Ye(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[w.protocolVersion,w.clientCapabilities]});let r=t[w.protocolVersion];if(typeof r!="string"||!te.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...te],requested:typeof r=="string"?r:null});let o=t[w.clientCapabilities];if(!h(o))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:w.clientCapabilities,expected:"object"});let n=Ng(t[w.clientInfo]),s=Lg(t[w.logLevel]);return{protocolVersion:z,clientCapabilities:o,...n?{clientInfo:n}:{},...s?{logLevel:s}:{}}}function ON(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function vN(e,t){let r=t.filter(o=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,o));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(o=>[o,{}]))})}function RN(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Xe(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[w.serverInfo]:{...t}}}}function Dg(e,t){return Xe({...e,resultType:"complete"},t)}function IN(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Dg({supportedVersions:[...te],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function PN(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d4a56906-c542-567e-9265-15184a5c330b")}catch{}})();var $g=new Set(["--help","-h","--version","-V"]);function Fg(e,t){let r=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&r.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),r.push("",`MCP protocol: ${te.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${or.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),r.join(`
2
- `)}function xN(e,t,r){if(e.length===0)return{kind:"serve"};let o=e.find(n=>!$g.has(n));if(o!==void 0){let n=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(o)}. Run ${n} --help.
3
- `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?Fg(t,r):`${r}
4
- `,stderr:""}}import{createHash as sr,createHmac as ar,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]="15b81dd0-ef1a-58be-b6ee-5975b6778993")}catch{}})();var Ug=["elicitation/create","roots/list","sampling/createMessage"],nr=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},cr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,he=32,Qe=64*1024,ge=16*1024,Je={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function jg(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 u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(o,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function Ze(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>he)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:he,observed:r.length});let o={};for(let[n,s]of r){if(!cr.test(n)||!h(s))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${n}`});let i=s.method;if(typeof i!="string"||!Ug.includes(i))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${n}.method`,method:i??null});let a=jg(i);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(s.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${n}.params`,expected:"object"});o[n]={method:i,params:structuredClone(s.params)}}return ye(o,Qe,"inputRequests"),o}function dr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>he)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:he,observed:t.length});let r={};for(let[o,n]of t){if(!cr.test(o)||!h(n))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${o}`});r[o]=structuredClone(n)}return ye(r,Qe,"inputResponses"),r}function $N(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ge)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ge});let r=e.inputRequests===void 0?void 0:Ze(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[w.serverInfo]:{...e.serverInfo}}}}function lr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function FN(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ge/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ge/2});let o=r.toString("base64url"),n=ar("sha256",lr(t)).update(o).digest("base64url");return`${o}.${n}`}function Bg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof o!="string"||typeof n!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:o,principal:n,state:s}}function GN(e,t,r){let[o,n,s]=e.split(".");if(!o||!n||s!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let i=Buffer.from(n,"base64url"),a=ar("sha256",lr(t)).update(o).digest();if(i.byteLength!==a.byteLength||!Gg(i,a))throw new u("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=Bg(c),{expiresAt:l,method:p,parameterDigest:f,principal:_}=d;if(l<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:l});if(p!==r.method||f!==r.parameterDigest||_!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function UN(e){return ye(e,Qe,"request parameters"),sr("sha256").update(JSON.stringify(e)).digest("hex")}var ir=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=sr("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let o=this.#e.values().next().value;this.#e.delete(o)}this.#e.add(r)}};function qg(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function jN(e,t){return{...e,...qg(t)}}function zg(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Hg(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let o of t.slice(2).split("/").map(zg)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,o))return;r=r[o]}return r}function Vg(e){let t=e.maxBytes??Je.maxBytes,r=e.maxDepth??Je.maxDepth,o=e.maxNodes??Je.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(o)||o<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:o}}function Kg(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let o of r)t.push({value:o,depth:e.depth+1})}function Wg(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Hg(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function BN(e,t={}){let{maximumBytes:r,maximumDepth:o,maximumNodes:n}=Vg(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});ye(e,r,"JSON Schema");let s=[{value:e,depth:0}],i=0;for(;s.length>0;){let a=s.pop();if(i+=1,i>n||a.depth>o)throw new u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:o,maximumNodes:n});Wg(e,a.value),Kg(a,s)}return structuredClone(e)}import{randomUUID as Yg}from"node:crypto";import{readFile as Xg}from"node:fs/promises";import pr from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f3e94896-b2a0-561c-902b-71c28ddde2a1")}catch{}})();var XN="io.modelcontextprotocol/tasks",Jg=["working","input_required","completed","failed","cancelled"],Qg=/^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,Zg=3600*1e3,ey=1e3,Te=1024,ty=30,ry=2e3;function et(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function be(e){let t=e.trim();if(!Qg.test(t))throw et("Unknown MCP task");return t}function ur(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function mr(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Te),...h(e.data)?{data:structuredClone(e.data)}:{}}}function oy(e){if(!Jg.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function ny(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function iy(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function sy(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function ay(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function cy(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function dy(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?be(e.taskId):"",r=oy(e.status),o=ny(e.principal),n=iy(e.workerPid),s=sy(e.ttlMs),i=ay(e.pollIntervalMs),a={version:1,taskId:t,status:r,principal:o,workerPid:n,createdAt:ur(e.createdAt,"createdAt"),lastUpdatedAt:ur(e.lastUpdatedAt,"lastUpdatedAt"),ttlMs:s,consumedInputKeys:cy(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Te)}:{},...typeof i=="number"?{pollIntervalMs:i}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=mr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function H(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 re(e){return e==="completed"||e==="failed"||e==="cancelled"}function ly(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var tt=class{#e;#t;#r;#o;#i;constructor(t){this.#e=pr.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#o=t.taskIdFactory??(()=>`mcp-task-${Yg()}`),this.#i=t.workerPid??process.pid}#s(t){return pr.join(this.#e,"runtime","mcp-tasks","records",`${be(t)}.json`)}async#c(t){try{return dy(JSON.parse(await Xg(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?et("Unknown MCP task"):r}}async#a(t){await De(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
5
- `)}async#n(t,r,o){let n=be(t),s=await Fe(this.#e,n,ty,this.#t,!1,!1,ry);try{let i=await this.#c(n);if(i.principal!==r)throw et("Unknown MCP task");let a=o(i);return await this.#a(a),a}finally{await s()}}async create(t){let r=be(this.#o()),o=t.principal.trim(),n=t.ttlMs===void 0?Zg:t.ttlMs,s=t.pollIntervalMs??ey;if(o.length===0||n!==null&&(!Number.isSafeInteger(n)||n<0)||!Number.isSafeInteger(s)||s<0)throw new u("Invalid MCP task creation options",m.invalidParams);let i=this.#r().toISOString(),a={version:1,taskId:r,status:"working",createdAt:i,lastUpdatedAt:i,ttlMs:n,pollIntervalMs:s,principal:o,workerPid:this.#i,consumedInputKeys:[],...t.statusMessage?.trim()?{statusMessage:t.statusMessage.trim().slice(0,Te)}:{}};return await this.#a(a),{...H(a),resultType:"task"}}async get(t,r){return H(await this.#n(t,r,o=>{if(re(o.status))return o;let n=this.#r().getTime(),s=o.ttlMs!==null&&Date.parse(o.createdAt)+o.ttlMs<=n,i=o.workerPid!==this.#i&&!ly(o.workerPid);return!s&&!i?o:{...o,status:"failed",statusMessage:s?"Task retention expired before completion.":"Task worker ended before recording a terminal result.",lastUpdatedAt:this.#r().toISOString(),error:{code:-32603,message:s?"MCP task expired":"MCP task worker unavailable after restart",data:{recoverable:!1,createNewTask:!0}},inputRequests:void 0}}))}async requireInput(t){let r=Ze(t.inputRequests,t.requestContext);return H(await this.#n(t.taskId,t.principal,o=>{if(re(o.status))return o;let n=Object.keys(r).filter(s=>o.consumedInputKeys.includes(s));if(n.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:n});return{...o,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Te),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,o){let n=dr(o),s=[],i=[];return await this.#n(t,r,a=>{if(a.status!=="input_required"||!a.inputRequests)return a;let c={...a.inputRequests},d=a.inputResponses?{...a.inputResponses}:{};for(let[l,p]of Object.entries(n))Object.prototype.hasOwnProperty.call(c,l)&&(d[l]=p,delete c[l],s.push(l));return i=Object.keys(c).sort(),s.length===0?a:{...a,status:i.length===0?"working":"input_required",lastUpdatedAt:this.#r().toISOString(),inputRequests:i.length===0?void 0:c,inputResponses:d,consumedInputKeys:[...new Set([...a.consumedInputKeys,...s])].sort()}}),{acceptedKeys:s.sort(),remainingKeys:i}}async takeInputResponses(t,r){let o={};return await this.#n(t,r,n=>(o=structuredClone(n.inputResponses??{}),Object.keys(o).length===0?n:{...n,inputResponses:void 0})),o}async complete(t,r,o){return H(await this.#n(t,r,n=>re(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=mr(o);return H(await this.#n(t,r,s=>re(s.status)?s:{...s,status:"failed",statusMessage:n.message,lastUpdatedAt:this.#r().toISOString(),error:n,inputRequests:void 0,result:void 0}))}async cancel(t,r){return H(await this.#n(t,r,o=>re(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 JN(e){return new tt(e)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="15cbe26a-5716-5e8c-8700-eb36a1a056d6")}catch{}})();var Ce="io.modelcontextprotocol/subscriptionId",fr=256,_r=2048,py=5e3;function uy(e,t){return new Promise((r,o)=>{let n=setTimeout(()=>o(new Error("MCP subscription sink write timed out")),py);n.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(n),r()},s=>{clearTimeout(n),o(s instanceof Error?s:new Error(String(s)))})})}function rt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function my(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=rt(e.toolsListChanged,"toolsListChanged"),r=rt(e.promptsListChanged,"promptsListChanged"),o=rt(e.resourcesListChanged,"resourcesListChanged"),n;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>fr)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:fr});let s=new Set;for(let i of e.resourceSubscriptions){if(typeof i!="string"||i.trim().length===0||Buffer.byteLength(i,"utf8")>_r)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:_r});s.add(i)}s.size>0&&(n=[...s].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...o?{resourcesListChanged:o}:{},...n?{resourceSubscriptions:n}:{}}}function fy(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 hr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new u("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=fy(my(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:{[Ce]:t.id},notifications:structuredClone(r)}},!0)}catch(n){throw this.#t.delete(t.id),n}return structuredClone(r)}async emitListChanged(t){let r=`${t}ListChanged`,o=`notifications/${t}/list_changed`,n=[];for(let[s,i]of this.#t)i.filter[r]===!0&&n.push(this.#o(s,i,{jsonrpc:"2.0",method:o,params:{_meta:{[Ce]:s}}}));return(await Promise.all(n)).filter(Boolean).length}async emitResourceUpdated(t){let r=[];for(let[o,n]of this.#t)n.filter.resourceSubscriptions?.includes(t)&&r.push(this.#o(o,n,{jsonrpc:"2.0",method:"notifications/resources/updated",params:{_meta:{[Ce]:o},uri:t}}));return(await Promise.all(r)).filter(Boolean).length}async#o(t,r,o,n=!1){let s=r.writeQueue.then(async()=>{if(this.#t.get(t)!==r)return!1;try{return await uy(r.sink,o),!0}catch(i){if(this.#t.get(t)===r&&this.#t.delete(t),n)throw i;return!1}});return r.writeQueue=s.then(()=>{},()=>{}),s}close(t){if(this.#t.delete(t))return{...Xe({resultType:"complete",_meta:{[Ce]:t}},this.#r)}}closeAll(){let t=[];for(let r of this.#t.keys()){let o=this.close(r);t.push({id:r,result:o})}return t}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3681273a-e101-57a0-9446-982c450e7183")}catch{}})();var gr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,_y=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,yr=/^[\t\x20-\x7E]*$/u,br=new Set(["prompts/get","resources/read","tools/call"]);function hy(e){let t=new Map;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;let n=typeof o=="string"?o:o.join(", ");t.set(r.toLowerCase(),n)}return t}function A(e,t){throw new u(e,m.headerMismatch,{header:t})}function Tr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&yr.test(t)&&!gr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Cr(e,t){let r=gr.exec(e);if(r){let o=r[1],n=Buffer.from(o,"base64");return n.toString("base64")!==o||n.length===0?A("Malformed MCP Base64 header value",t):n.toString("utf8")}return e.length===0||e.trim()!==e||!yr.test(e)?A("Malformed MCP header value",t):e}function Ee(e){return Array.isArray(e)?e.some(Ee):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Ee):!1}function gy(e,t,r){let o=e["x-mcp-header"];if(o===void 0)return;let n=e.type;if(typeof o!="string"||!_y.test(o)||!["boolean","integer","string"].includes(String(n))||r.has(o.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:o});return r.add(o.toLowerCase()),{name:o,path:t,type:n}}function Er(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,o=(n,s)=>{let i=n.properties;if(i!==void 0){if(!h(i))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(i)){if(!h(c))continue;let d=[...s,a],l=gy(c,d,r);l&&t.push(l);for(let[p,f]of Object.entries(c))if(p!=="properties"&&p!=="x-mcp-header"&&Ee(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:p});o(c,d)}}};for(let[n,s]of Object.entries(e))if(n!=="properties"&&Ee(s))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:n});return o(e,[]),t}function Sr(e,t){let r=e;for(let o of t){if(!h(r))return;r=r[o]}return r}function wr(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function yy(e,t){let r=h(e.arguments)?e.arguments:{},o={};for(let n of Er(t)){let s=Sr(r,n.path);if(s!=null){if(!(n.type==="integer"&&typeof s=="number"&&Number.isSafeInteger(s)||n.type==="boolean"&&typeof s=="boolean"||n.type==="string"&&typeof s=="string"))throw new u("Invalid MCP custom header argument",m.invalidParams,{field:n.path.join("."),expected:n.type});o[`Mcp-Param-${n.name}`]=Tr(s)}}return o}function rL(e){let t=h(e.request.params)?e.request.params:void 0,r=Ye(t),o=e.request.method;if(typeof o!="string"||o.length===0)return A("Missing MCP request method","Mcp-Method");let n={Accept:"application/json, text/event-stream","Content-Type":"application/json","MCP-Protocol-Version":r.protocolVersion,"Mcp-Method":o},s=wr(o,t);if(br.has(o)){if(s===void 0)return A("Missing MCP request name","Mcp-Name");n["Mcp-Name"]=Tr(s)}return o==="tools/call"&&e.toolSchema!==void 0&&Object.assign(n,yy(t,e.toolSchema)),n}function by(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&A("Missing MCP request method","Mcp-Method");let o=h(t.params)?t.params:void 0,n=Ye(o).protocolVersion;if(e.get("mcp-protocol-version")!==n&&A("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&A("MCP method header does not match request body","Mcp-Method"),br.has(r)){let s=e.get("mcp-name"),i=wr(r,o);(s===void 0||i===void 0||Cr(s,"Mcp-Name")!==i)&&A("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&A("MCP SSE resumability is not supported","Last-Event-ID")}function Ty(e,t,r){return e.type==="integer"?typeof t=="number"&&Number.isSafeInteger(t)&&Number(r)===t:e.type==="boolean"?typeof t=="boolean"&&r===String(t):typeof t=="string"&&r===t}function Cy(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Er(e.toolSchema)){let o=Sr(t,r.path),n=`Mcp-Param-${r.name}`,s=e.headers.get(n.toLowerCase());if(o==null){s!==void 0&&A("Unexpected MCP parameter header",n);continue}s===void 0&&A("Missing MCP parameter header",n),Ty(r,o,Cr(s,n))||A("MCP parameter header does not match request body",n)}}function oL(e){let t=hy(e.headers),r=typeof e.request.method=="string"?e.request.method:"";by(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&Cy({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var nL=z;import{AsyncLocalStorage as Ey}from"node:async_hooks";import{createHash as Ar,timingSafeEqual as Sy}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a7c30d99-a0e4-552e-be61-0c54a455e211")}catch{}})();var y=class extends Error{httpStatus;challenge;constructor(t,r,o){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=o}},wy=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,Ay=/^[a-z][a-z0-9_*/-]{0,255}$/u,Oy=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,vy=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,vr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Rr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,Ry=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,Iy=/%(?![0-9A-Fa-f]{2})/u,Py=512,My=32,ky=180,xy=8192,Ny=8192,Ir=new Ey;function S(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new y(`Invalid ${t}`,401);let o;try{o=new URL(e)}catch{throw new y(`Invalid ${t}`,401)}let n=o.hostname==="127.0.0.1"||o.hostname==="localhost";if(o.hash.length>0||o.protocol!=="https:"&&!(r&&n&&o.protocol==="http:"))throw new y(`Invalid ${t}`,401);return o}function Ly(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 dL(e){let t=S(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new y("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(n=>S(n,"authorization server issuer").href.replace(/\/$/u,"")),o=[...new Set(e.scopes??[])];if(o.some(n=>!vr.test(n)))throw new y("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...o.length>0?{scopes_supported:o.sort()}:{}}}function lL(e){let t=S(e,"authorization server issuer"),r=t.pathname.replace(/^\/+|\/+$/gu,""),o=t.origin;return r?[`${o}/.well-known/oauth-authorization-server/${r}`,`${o}/.well-known/openid-configuration/${r}`,`${o}/${r}/.well-known/openid-configuration`]:[`${o}/.well-known/oauth-authorization-server`,`${o}/.well-known/openid-configuration`]}function pL(e,t){if(!h(e)||typeof e.issuer!="string")throw new y("Invalid authorization server metadata",401);let r=S(t,"expected issuer").href.replace(/\/$/u,"");if(S(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new y("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new y("Authorization server does not support required S256 PKCE",401);let o=c=>{let d=e[c];if(typeof d!="string")throw new y(`Authorization server metadata requires ${c}`,401);return S(d,c).href},n=c=>{let d=e[c];return typeof d=="string"?S(d,c).href:void 0},s=o("authorization_endpoint"),i=o("token_endpoint"),a=n("registration_endpoint");return{issuer:r,authorization_endpoint:s,token_endpoint:i,code_challenge_methods_supported:[...new Set(e.code_challenge_methods_supported.filter(c=>typeof c=="string"))],...e.client_id_metadata_document_supported===!0?{client_id_metadata_document_supported:!0}:{},...a?{registration_endpoint:a}:{}}}function uL(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 mL(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 fL(e,t){let r=S(t,"client metadata document URL");if(r.pathname==="/"||!h(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new y("Invalid Client ID Metadata Document",401);for(let o of e.redirect_uris){if(typeof o!="string")throw new y("Invalid client redirect URI",401);S(o,"client redirect URI",!0)}return structuredClone(e)}function _L(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new y("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>S(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Or=class{#e=new Map;set(t,r){let o=S(t,"credential issuer").href;this.#e.set(o,structuredClone(r))}get(t){let r=S(t,"credential issuer").href,o=this.#e.get(r);return o?structuredClone(o):void 0}delete(t){let r=S(t,"credential issuer").href;return this.#e.delete(r)}};function Dy(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let o=typeof t=="string"?wy.exec(t):null;if(!o)throw new y("Invalid MCP traceparent",403);let n=o[1],s=o[2];if(/^0+$/u.test(n)||/^0+$/u.test(s))throw new y("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!Fy(r)))throw new y("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function D(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function $y(e){return Ay.test(e)||Oy.test(e)}function Fy(e){if(Buffer.byteLength(e,"utf8")>Py)return!1;let t=e.split(",");if(t.length>My)return!1;let r=new Set;for(let o of t){let n=D(o);if(n.length===0)continue;let s=n.indexOf("="),i=s>0?n.slice(0,s):"",a=s>0?n.slice(s+1):"";if(!$y(i)||!vy.test(a)||r.has(i))return!1;r.add(i)}return!0}function Pr(e){return Ry.test(e)&&!Iy.test(e)}function Gy(e){let t=D(e),r=t.indexOf("="),o=D(r>=0?t.slice(0,r):t),n=r>=0?D(t.slice(r+1)):void 0;return Rr.test(o)&&(n===void 0||Pr(n))}function Uy(e){let t=D(e),r=t.split(";"),o=r[0],n=r.slice(1),s=o.indexOf("="),i=D(s>0?o.slice(0,s):""),a=s>0?D(o.slice(s+1)):"";if(!(!Rr.test(i)||!Pr(a)||!n.every(Gy)))return{key:i,serialized:t}}function jy(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>xy)throw new y("Invalid MCP baggage",403);let r=new Set(t),o=e.split(",");if(o.length>ky)throw new y("Invalid MCP baggage",403);let n=[];for(let s of o){let i=Uy(s);if(!i)throw new y("Invalid MCP baggage",403);r.has(i.key)&&n.push(i.serialized)}return n.length>0?n.join(","):void 0}function hL(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},o=jy(r.baggage,t.baggageAllowlist??[]);return{...Dy(r),...o?{baggage:o}:{}}}function gL(e,t){return Ir.run(structuredClone(e),t)}function yL(){let e=Ir.getStore();return e?{...e}:void 0}async function bL(e){let t=S(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(d=>!vr.test(d)))throw new y("Invalid authorization scope",401);let o=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new y("Access tokens must not appear in URI query parameters",401,o);let n=Ly(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!n)throw new y("Missing or malformed bearer token",401,o);let s=n[1];if(Buffer.byteLength(s,"utf8")>Ny)throw new y("Missing or malformed bearer token",401,o);let i;try{i=await e.policy.verifyAccessToken(s)}catch{throw new y("Invalid bearer token",401,o)}let a=Array.isArray(i.audience)?i.audience:[i.audience];if(i.issuer!==e.policy.issuer||!a.includes(e.policy.resource))throw new y("Bearer token issuer or audience mismatch",401,o);let c=r.filter(d=>!i.scopes.includes(d));if(c.length>0)throw new y("Bearer token has insufficient scope",403,`${o}, scope="${c.join(" ")}"`);return{...i,audience:[...a],scopes:[...i.scopes]}}function TL(e){let t=Ar("sha256").update(e.token).digest();return r=>{let o=Ar("sha256").update(r).digest();if(!Sy(t,o))throw new y("Invalid bearer token",401);return structuredClone(e.claims)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="46f5fe59-6b84-5c68-ad07-bb1329f4ea29")}catch{}})();var ot="io.modelcontextprotocol/ui",Se="2026-01-26",xr="text/html;profile=mcp-app",Mr=Object.freeze({specVersion:Se,mimeTypes:[xr]});function SL(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[ot];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[ot]:Mr}}});let o=r.mimeTypes,n=r.specVersion;if(!Array.isArray(o)||!o.includes(xr)||n!==void 0&&n!==Se)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[ot]:Mr}}});return!0}var By={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Nr=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:By})));function wL(e){return Nr.find(t=>t.uri===e)}function AL(e){let t=new Map(Nr.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 kr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function OL(e){let t=kr(e.name),r=kr(e.description),o=JSON.stringify({name:`pm-${e.id}-view`,version:Se}),n=JSON.stringify(Se);return`<!doctype html>
1
+ import{a as Ng}from"./chunks/chunk-J2PDAVBC.js";import{a as EN,b as AN,c as xN,d as bN}from"./chunks/chunk-O7JHS64G.js";import{a as wN,b as ON}from"./chunks/chunk-KE7HMBEW.js";import{b as Vk,c as Kk,d as Wk,e as Yk,f as Xk,g as Jk,h as Qk,i as Zk,j as eN,k as tN,l as rN,m as nN,n as oN,o as iN,p as sN,q as aN,r as cN}from"./chunks/chunk-OKIKF4FD.js";import{A as _N,B as hN,C as gN,D as CN,E as yN,F as SN,G as TN,a as zs,b as JR,c as QR,d as kc,e as Nc,f as Lc,h as $c,i as Dc,j as Fc,k as Gc,l as Uc,m as jc,n as Bc,o as zc,p as Vd,q as Kd,r as Wd,s as Yd,t as Xd,u as dN,v as pN,w as lN,x as uN,y as mN,z as fN}from"./chunks/chunk-RWA5YZ5X.js";import{A as e0,B as t0,C as r0,D as n0,E as o0,F as i0,G as s0,H as a0,I as c0,J as d0,K as p0,L as l0,M as u0,N as m0,O as f0,P as _0,Q as h0,R as g0,S as C0,T as y0,U as S0,V as T0,W as E0,X as A0,Y as x0,Z as b0,_ as w0,a as RN,b as PN,c as MN,d as IN,e as vN,f as kN,g as NN,h as LN,i as $N,j as DN,k as FN,l as GN,m as UN,n as jN,o as BN,p as zN,q as qN,r as HN,s as VN,t as KN,u as WN,v as YN,w as XN,x as JN,y as QN,z as ZN}from"./chunks/chunk-ZPS4B6SI.js";import{$ as _f,$a as sh,$b as sg,A as fv,Aa as R_,Ab as kh,Ac as kg,B as Ke,Ba as P_,Bb as Nh,C as ef,Ca as M_,Cb as Lh,D as tf,Da as I_,Db as $h,E as nf,Ea as v_,Eb as Dh,F as Ht,Fa as k_,Fb as Fh,G as Vt,Ga as N_,Gb as Gh,H as Kt,Ha as L_,Hb as Uh,I as Wt,Ia as $_,Ib as jh,J as Yt,Ja as D_,Jb as Bh,K as Xt,Ka as F_,Kb as zh,L as Jt,La as G_,Lb as qh,M as Qt,Ma as U_,Mb as Hh,N as Zt,Na as j_,Nb as Vh,O as er,Oa as B_,Ob as Kh,P as tr,Pa as z_,Pb as Wh,Q as of,Qa as q_,Qb as Yh,R as sf,Ra as H_,Rb as Xh,S as af,Sa as V_,Sb as Jh,T as cf,Ta as K_,Tb as Qh,U as df,Ua as W_,Ub as Zh,V as We,Va as rr,Vb as eg,W as pf,Wa as _e,Wb as tg,X as lf,Xa as rh,Xb as rg,Y as uf,Ya as nh,Yb as ng,Z as mf,Za as oh,Zb as og,_ as ff,_a as ih,_b as ig,a as pR,aa as hf,ab as ah,ac as ag,b as lR,ba as gf,bb as ch,bc as cg,c as uR,ca as Ok,cb as dh,cc as dg,d as mR,da as Rk,db as ph,dc as pg,e as fR,ea as Pk,eb as lh,ec as lg,f as _R,fa as Mf,fb as uh,fc as ug,g as CR,ga as If,gb as mh,gc as mg,h as yR,ha as vf,hb as fh,hc as fg,i as SR,ia as C_,ib as _h,ic as _g,j as TR,ja as y_,jb as hh,jc as hg,k as qs,ka as Fk,kb as gh,kc as gg,l as cd,la as Gk,lb as Ch,lc as Cg,m as dd,ma as Uk,mb as yh,mc as yg,n as pd,na as jk,nb as Sh,nc as Sg,oa as Bk,ob as Th,oc as Tg,p as $M,pa as zk,pb as Eh,pc as Eg,q as DM,qa as qk,qb as Ah,qc as Ag,r as FM,ra as Hk,rb as xh,rc as xg,s as GM,sa as S_,sb as bh,sc as bg,t as UM,ta as T_,tb as wh,tc as wg,u as jM,ua as E_,ub as Oh,uc as Og,v as Nu,va as A_,vb as Rh,vc as Rg,w as Du,wa as x_,wb as Ph,wc as Pg,x as Fu,xa as b_,xb as Mh,xc as Mg,y as om,ya as w_,yb as Ih,yc as Ig,z as lm,za as O_,zb as vh,zc as vg}from"./chunks/chunk-AEOHUSUI.js";import{e as qM,f as HM,g as el,h as tl,i as Bt}from"./chunks/chunk-5WZZ5XEN.js";import{A as hk,B as gk,C as Ck,D as yk,E as Sk,F as Tk,G as Ek,H as Ak,I as xk,J as bk,K as wk,L as Sf,M as Tf,N as Ef,O as Af,P as xf,Q as bf,R as wf,S as Of,T as Rf,U as Pf,a as JI,b as QI,c as ZI,d as ev,e as tv,f as ku,g as rv,h as nv,i as ov,j as iv,k as sv,m as rf,n as Cf,o as ik,p as sk,q as ak,r as ck,s as dk,t as pk,u as yf,v as lk,w as uk,x as mk,y as fk,z as _k}from"./chunks/chunk-H7JEXRIN.js";import{$ as WP,$a as Sl,$b as Ru,$d as X_,A as qe,Aa as yM,Ab as sI,Ac as qu,Ad as Kf,B as ee,Ba as SM,Bb as gu,Bc as Hu,Bd as Wf,C as pp,Ca as TM,Cb as aI,Cc as Vu,Cd as Yf,Db as xI,Dc as Ku,Dd as Xf,Eb as bI,Ec as Wu,Ed as Jf,F as He,Fa as BM,Fb as wI,Fc as Yu,Fd as Qf,G as lp,Ga as zM,Gb as OI,Gc as Xu,Gd as Zf,H as up,Ha as Kp,Hb as RI,Hc as Ju,Hd as e_,Ia as Wp,Ib as PI,Ic as Qu,Id as t_,J as fe,Ja as Yp,Jb as MI,Jc as Zu,Jd as r_,K as mp,Ka as Xp,Kb as $I,Kc as em,Kd as n_,L as fp,La as Jp,Lb as DI,Lc as tm,Ld as o_,M as _p,Ma as Qp,Mb as Cu,Mc as rm,Md as i_,N as hp,Na as Zp,Nb as yu,Nd as s_,O as DP,Oa as al,Ob as FI,Oc as uv,Od as a_,P as FP,Pa as cl,Pb as GI,Pc as mv,Q as GP,Qa as dl,Qb as UI,Qc as nm,Qd as c_,R as UP,Ra as pl,Rb as jI,Rc as um,Rd as d_,S as jP,Sa as ll,Sb as BI,Sc as mm,Sd as p_,T as Nt,Ta as ul,Tb as Su,Tc as fm,Td as l_,U as BP,Ua as ml,Ub as Tu,Uc as _m,Ud as u_,V as zP,Va as fl,Vb as Eu,Vc as hm,Vd as m_,W as Lt,Wa as _l,Wb as Au,Wd as f_,X as qP,Xa as hl,Xb as xu,Xd as __,Y as HP,Ya as gl,Yb as bu,Yd as h_,Z as VP,Za as Cl,Zb as wu,Zd as g_,_ as KP,_a as yl,_b as Ou,_c as gm,_d as Y_,a as ZR,aa as Ve,ab as Tl,ac as Pu,ad as Vm,ae as J_,b as Mt,ba as YP,bb as El,bc as Mu,bd as Km,be as Q_,c as eP,ca as $t,cb as Al,cc as Iu,cd as Wm,ce as Z_,d as Zc,da as XP,db as xl,dc as zI,de as eh,e as ed,ea as JP,eb as bl,ec as qI,ed as Ym,ee as th,f as td,fa as QP,fb as wl,fc as HI,fd as Xm,g as rd,ga as ZP,gb as Ol,gc as VI,gd as Jm,h as nd,ha as eM,hb as Rl,hc as KI,hd as Qm,ia as tM,ib as WM,ic as WI,id as Zm,j as od,ja as rM,jb as Pl,jc as YI,jd as kf,k as id,ka as nM,kb as Ml,kc as XI,kd as Nf,la as oM,lb as Il,lc as vu,ld as Lf,ma as iM,mb as vl,mc as av,md as $f,na as sM,nb as YM,nc as cv,nd as Df,o as sd,oa as aM,ob as kl,oc as dv,od as Ff,p as ad,pa as cM,pb as Nl,pc as pv,pd as Gf,qa as dM,qb as Ll,qc as lv,qd as Uf,ra as pM,rb as $l,rd as jf,sa as lM,sb as Dl,sc as Lu,sd as Lk,ta as uM,tb as XM,tc as $u,td as $k,ua as mM,ub as JM,uc as Gu,ud as Dk,va as fM,vb as QM,vc as Uu,vd as Bf,w as vt,wa as _M,wb as ZM,wd as zf,xa as hM,xb as eI,xc as ju,xd as qf,y as kt,ya as gM,yb as tI,yc as Bu,yd as Hf,za as CM,zb as rI,zc as zu,zd as Vf}from"./chunks/chunk-ENKXRSFZ.js";import"./chunks/chunk-5DUP4AZA.js";import{x as Jd}from"./chunks/chunk-FJOEL75F.js";import{A as IM,B as vM,D as kM,E as NM,Ea as Dp,F as LM,Fa as Fp,G as Pp,H as Mp,Ha as Gp,I as Ip,Ia as Up,J as vp,Ja as jp,K as Dt,Ka as Bp,La as zp,Na as qp,Oa as Hp,Pa as Vp,b as wR,c as OR,d as RR,e as PR,f as MR,g as IR,h as Hs,i as Vs,j as Ks,k as Ws,l as Ys,n as EM,qa as Ft,ra as Gt,sa as Ut,ta as jt,ua as kp,wa as Np,xa as Lp,ya as $p}from"./chunks/chunk-CFWLQFJM.js";import{a as AM,b as xM,c as bM,d as wM,e as OM,f as RM,g as PM,h as Tp,i as Ep,j as Ap,k as xp,l as bp,m as MM,n as wp,o as Op,p as Rp}from"./chunks/chunk-BSRIVYTM.js";import{a as gp,b as Cp,e as yp,f as Sp}from"./chunks/chunk-D6PDUKUG.js";import{$a as CI,$b as Dv,A as PP,Aa as du,Ab as Am,Ac as $m,B as Qd,Ba as pu,Bb as xm,Bc as Dm,C as Zd,Ca as lu,Cb as bm,Cc as Fm,D as ep,Da as uu,Db as hv,Dc as Gm,E as tp,Ea as mu,Eb as gv,Ec as Um,F as rp,Fa as fu,Fb as Cv,Fc as jm,G as np,Ga as _u,Gb as yv,Gc as Bm,H as op,Ha as hu,Hb as Sv,Hc as zm,I as ip,Ib as Tv,Ic as qt,J as sp,Jb as Ev,Jc as qm,K as ap,Kc as tk,L as cp,La as nI,Lb as wm,Lc as rk,M as ze,Ma as oI,Mb as Om,Mc as nk,N as MP,Na as iI,Nb as Av,Nc as Hm,O as IP,Oa as cI,Ob as xv,Oc as ok,P as vP,Pa as dI,Pb as bv,Pc as Mk,Q as kP,Qa as pI,Qb as wv,Qc as Ik,R as NP,Ra as lI,Rb as Ov,Rc as vk,S as LP,Sa as uI,Sb as Rv,Sc as kk,T as $P,Ta as mI,Tb as Pv,Tc as Nk,U as dp,Ua as fI,Ub as Mv,V as rl,Va as _I,Vb as Iv,W as nl,Wa as hI,Wb as vv,X as ol,Xa as gI,Xb as kv,Y as il,Yb as Nv,Z as VM,Zb as Lv,_ as KM,_b as $v,a as ER,aa as sl,ac as Fv,b as AR,ba as Fl,bb as yI,bc as Gv,c as xR,ca as Gl,cb as SI,cc as Uv,d as bR,da as Ul,dc as jv,e as _P,ea as jl,ec as Bv,f as hP,fa as Bl,fb as TI,fc as zv,g as gP,ga as zl,gb as EI,gc as qv,h as CP,ha as ql,hb as AI,hc as Hv,i as yP,ia as Hl,ic as Vv,j as SP,ja as Vl,jb as II,jc as Kv,k as TP,ka as Kl,kb as vI,kc as Wv,la as Wl,lb as kI,lc as Yv,ma as Yl,mb as NI,mc as Xv,na as Xl,nb as LI,nc as Jv,oa as Jl,ob as im,oc as Qv,pa as Ql,pb as sm,pc as Zv,qa as Zl,qb as am,qc as ek,ra as eu,rb as cm,rc as zt,sa as tu,sb as dm,sc as Rm,t as EP,ta as ru,tb as pm,tc as Pm,u as AP,ua as nu,ub as Cm,uc as Mm,v as xP,va as ou,vb as ym,vc as Im,w as bP,wa as iu,wb as Sm,wc as vm,x as wP,xa as su,xb as Tm,xc as km,y as OP,ya as au,yb as _v,yc as Nm,z as RP,za as cu,zb as Em,zc as Lm}from"./chunks/chunk-KZHIBEJL.js";import{a as hR,b as gR}from"./chunks/chunk-S32NGRQM.js";import{$ as Ea,$a as Ec,A as Js,Aa as Ya,Ab as _d,B as Qs,Ba as Xa,Bb as hd,C as Zs,Ca as Ja,Cb as gd,Da as Qa,Db as Cd,E as ea,Ea as Za,Eb as yd,F as ta,Fa as ec,Fb as Sd,G as ra,Ga as tc,Gb as Td,H as na,Ha as rc,Hb as Ed,I as oa,Ia as nc,Ib as Ad,J as ia,Ja as oc,Jb as xd,K as sa,Ka as ic,Kb as bd,L as aa,La as sc,Lb as wd,M as ca,Ma as ac,Mb as Od,N as da,Na as cc,Nb as Rd,O as pa,Oa as dc,Ob as Pd,P as la,Pa as pc,Pb as Md,Q as ua,Qa as lc,Qb as Id,R as ma,Ra as uc,Rb as vd,Sa as mc,Sb as kd,T as fa,Ta as fc,Tb as Nd,U as _a,Ua as _c,Ub as tP,V as ha,Va as hc,Vb as rP,W as ga,Wa as gc,Wb as nP,X as Ca,Xa as Cc,Xb as oP,Y as ya,Ya as yc,Yb as iP,Z as Sa,Za as Sc,Zb as sP,_ as Ta,_a as Tc,a as vR,aa as Aa,ab as Ac,b as kR,ba as xa,bb as xc,bc as aP,c as NR,ca as ba,cb as bc,cc as cP,d as LR,da as wa,db as wc,dc as dP,e as $R,ea as Oa,eb as Oc,ec as pP,fa as Ra,fb as Rc,fc as lP,g as DR,ga as Pa,gb as Pc,gc as uP,h as FR,ha as Ma,hb as Mc,hc as mP,i as Xs,ia as Ia,ib as Ic,ic as fP,j as GR,ja as va,ka,kb as Be,kc as Ld,la as Na,lb as Z,lc as $d,m as UR,ma as La,mb as vc,mc as Dd,n as jR,na as $a,nb as qc,nc as Fd,o as Ue,oa as Da,ob as Hc,oc as Gd,p as BR,pa as Fa,pb as Vc,pc as Ud,q as zR,qa as Ga,qb as Kc,qc as jd,r as qR,ra as Ua,rb as Wc,rc as Bd,s as Pt,sa as ja,sb as Yc,sc as zd,t as je,ta as Ba,tb as Xc,tc as qd,u as HR,ua as za,ub as Jc,uc as Hd,v as VR,va as qa,vb as Qc,vc as It,w as KR,wa as Ha,wb as ld,x as WR,xa as Va,xb as ud,y as YR,ya as Ka,yb as md,z as XR,za as Wa,zb as fd}from"./chunks/chunk-OPJF254V.js";import{a as tR,b as rR,c as nR,d as oR,e as iR,f as sR,g as aR,h as cR,i as dR,j as Ns,k as Ls,l as $s,m as Ds,n as Fs,o as Gs,q as Us,s as js,y as Bs}from"./chunks/chunk-6MYJLOSG.js";import{b as QO}from"./chunks/chunk-NQ54T7T2.js";import"./chunks/chunk-PZA7QECY.js";import{$b as dO,$c as MO,A as uT,Aa as rw,Ab as Hw,Ac as SO,Ad as YO,B as mT,Ba as nw,Bc as TO,Bd as XO,C as fT,Cc as EO,Cd as JO,Db as Vw,Dc as AO,Dd as ZO,Ec as xO,Ed as eR,Fb as Kw,Fc as bO,Gc as wO,Hc as fs,Ic as _s,Jb as Ww,Jc as hs,K as xT,Kb as Yw,Kc as gs,La as ow,Lb as Xw,Lc as Cs,M as kT,Ma as iw,Mb as ns,Mc as ys,N as NT,Na as sw,Nb as Jw,Nc as Ss,O as LT,Oa as aw,Oc as Ts,P as $T,Pa as cw,Pb as Qw,Pc as Es,Q as BT,Qa as dw,Qb as Zw,Qc as As,R as zT,Ra as _w,Rb as eO,Rc as xs,S as bt,Sa as hw,Sb as tO,Sc as bs,T as Eb,Ta as gw,Tb as rO,Tc as ws,U as Ab,Ua as wt,Ub as nO,Uc as Os,V as xb,Vb as oO,Wa as Cw,Wb as iO,Wc as Rs,X as bb,Xa as yw,Xb as sO,Xc as OO,Ya as Sw,Yb as aO,Yc as RO,Z as wb,Za as Tw,Zb as Ot,Zc as Ps,_ as Ob,_a as Ew,_b as cO,_c as PO,a as ZS,aa as Rb,ad as Ms,ba as Pb,bb as Aw,bd as Is,ca as Mb,cd as IO,da as Ib,dd as vO,ea as vb,ed as kO,fa as kb,fb as Xi,fc as os,fd as NO,ga as Nb,gc as is,gd as LO,ha as qb,hb as kw,hc as ss,hd as $O,i as io,ib as Nw,ic as as,id as DO,j as eT,ja as Vi,jb as Lw,jd as vs,k as tT,ka as Ki,kb as $w,kc as cs,kd as ks,l as rT,la as Wi,lc as ds,ld as FO,m as nT,mb as Dw,mc as ps,md as GO,na as Hb,nb as Fw,nc as ls,nd as UO,o as oT,oa as Vb,ob as Gw,oc as us,od as jO,p as iT,pa as Kb,pb as Uw,pc as ms,pd as BO,qa as Wb,qb as es,qc as pO,qd as zO,r as sT,ra as Yb,rb as ts,rc as lO,rd as qO,sa as Xb,sc as uO,sd as HO,t as aT,ta as Jb,tb as rs,tc as mO,td as VO,u as cT,ub as jw,uc as fO,ud as KO,v as dT,va as Qb,vc as _O,vd as WO,wb as Bw,wc as hO,x as pT,xa as Zb,xb as zw,xc as gO,y as lT,ya as ew,yb as qw,yc as CO,za as tw,zc as yO,zd as Rt}from"./chunks/chunk-TZY5MVJF.js";import{A as Ow,B as Rw,C as Pw,D as Mw,E as Iw,F as vw,G as Ji,H as Qi,I as Zi,a as Lb,b as $b,c as Db,d as Fb,e as Gb,f as Ub,g as jb,h as Bb,i as zb,n as pw,q as lw,r as uw,u as mw,v as Yi,w as fw,x as xw,y as bw,z as ww}from"./chunks/chunk-2UQU7HRR.js";import{$c as pE,$e as NE,$f as dA,$h as vx,$i as Zx,A as Fn,Ac as nE,Ad as Fe,Af as Si,Ag as $A,Ah as Rx,Ai as Bx,Aj as qi,B as Gn,Bd as Wo,Bf as Ti,Bg as DA,Bh as Px,Bi as zx,C as Un,Cb as bT,Ce as wE,Cf as Ei,Cg as FA,Ch as Mx,Ci as qx,D as jn,Db as wT,Dc as vo,Df as Ai,Dg as GA,Di as Hx,Dj as hb,E as Bn,Ec as oE,Ee as li,Ef as xi,Eg as UA,Eh as Ix,Ei as Vx,Ej as Hi,F as zn,Fa as _T,Fc as ko,Fe as ui,Ff as bi,Fg as jA,Fh as $i,G as qn,Ga as hT,Ge as mi,Gf as wi,Gg as BA,Gh as Di,H as Hn,Ha as gT,Hc as iE,He as fi,Hf as Oi,Hg as zA,Hj as gb,I as Ne,Id as mE,If as Ri,Ig as qA,Ii as Kx,Ij as Cb,J as Le,Jb as OT,Jd as fE,Jf as Pi,Jg as HA,Jj as yb,K as Vn,Ka as go,Kd as _E,Kf as Mi,Kg as VA,Ki as Wx,Kj as Sb,L as Kn,La as CT,Ld as Yo,Lf as Ii,Lg as KA,Lj as Tb,M as Wn,Ma as yT,Mb as RT,Md as Xo,Mf as vi,Mg as WA,N as Yn,Na as ST,Nc as sE,Nd as Jo,Ne as OE,Nf as ki,Ng as YA,O as Xn,Oa as TT,Od as Qo,Oe as RE,Of as Ni,Og as XA,P as Jn,Pb as PT,Pd as Zo,Pe as PE,Pf as Li,Pg as JA,Q as Qn,Qa as Co,Qc as aE,Qd as ei,Qf as eA,Qg as QA,R as Zn,Ra as yo,Rc as cE,Rd as ti,Rf as tA,Rg as ZA,S as eo,Sa as De,Sb as MT,Sc as No,Sd as ri,Sf as rA,Sg as ex,T as to,Ta as ET,Tc as Lo,Td as ni,Te as _i,Tf as nA,Tg as tx,U as ro,Ua as AT,Ub as Tt,Ud as oi,Uf as oA,Ug as rx,V as no,Va as So,Vc as $o,Vd as ii,Vf as iA,Vg as nx,W as oo,Wa as To,Wb as Et,Wc as Do,Wd as si,Wf as sA,Wg as ox,Wi as Yx,Xc as Fo,Xd as ai,Xe as ME,Xf as aA,Xg as ix,Xi as Xx,Ya as Eo,Yb as Mo,Yc as Go,Yd as ci,Ye as IE,Yf as cA,Yg as sx,Yi as Jx,Zb as Io,Zc as Uo,Zd as di,Ze as vE,Zg as ax,_b as At,_c as dE,_e as kE,_i as Qx,a as R,aa as Ct,ac as IT,ae as hE,af as LE,ag as pA,ah as cx,ai as Ge,b as jS,ba as yt,be as gE,bf as $E,bg as lA,bh as dx,bi as xt,bj as eb,c as gt,ca as po,cc as vT,ce as pi,cf as DE,cg as uA,ch as px,ci as kx,cj as Ui,da as lo,dc as DT,df as FE,dg as mA,dh as lx,di as Nx,e as BS,ea as uo,ec as FT,ef as GE,eg as fA,eh as ux,ei as Lx,ej as ji,f as zS,fc as GT,ff as UE,fg as _A,fh as mx,fi as $x,fj as Bi,g as qS,gc as UT,ge as CE,gf as jE,gg as hA,gh as fx,gi as z,h as HS,hc as jT,he as yE,hg as gA,hh as _x,hi as Dx,i as VS,ic as qT,ig as CA,ii as Fx,ij as tb,j as KS,ja as mo,jb as Ao,jc as HT,jf as BE,jg as yA,ji as Gx,jj as rb,k as WS,kb as xo,kc as VT,kf as zE,kg as SA,ki as Ux,kj as nb,l as YS,la as fo,lb as bo,lc as KT,ld as jo,lf as qE,lg as TA,lh as hx,lj as ob,m as XS,ma as _o,mb as wo,mc as WT,md as Bo,mf as HE,mg as EA,mh as gx,mi as Fi,mj as ib,n as JS,na as ho,nb as Oo,nc as YT,nd as lE,nf as VE,ng as AA,ni as Gi,nj as sb,o as QS,oc as XT,od as zo,of as KE,og as xA,oj as ab,p as Mn,pc as JT,pd as qo,pf as WE,pg as bA,ph as Cx,pj as zi,q as In,qc as QT,qd as uE,qe as SE,qf as YE,qg as wA,qh as yx,qj as cb,r as vn,rc as ZT,rd as Ho,re as TE,rf as XE,rg as OA,rh as Sx,rj as db,s as kn,sc as eE,sd as Vo,se as EE,sf as JE,sg as RA,sh as Tx,t as ve,tc as tE,td as L,te as AE,tf as QE,tg as PA,th as Ex,u as Nn,uc as rE,ud as Ko,uf as ZE,ug as MA,uh as Ax,uj as pb,v as N,ve as xE,vg as IA,vh as xx,vj as lb,w as ke,wb as Ro,we as bE,wf as hi,wg as vA,wh as bx,wj as ub,x as Ln,xf as gi,xg as kA,xj as mb,y as $n,yb as Po,yf as Ci,yg as NA,yh as wx,yi as jx,yj as fb,z as Dn,zf as yi,zg as LA,zh as Ox,zj as _b}from"./chunks/chunk-NGJ5ERBF.js";import"./chunks/chunk-AA52P34H.js";import"./chunks/chunk-6H36ZHMI.js";import{A as ue,B as US,C as S,E as so,F as St,G as me,H as ao,K as $e,M as co,b as kS,c as NS,d as LS,m as $S,r as DS,u as FS,y as GS}from"./chunks/chunk-YYT3MIRF.js";import"./chunks/chunk-XAWE4EAK.js";var q="2026-07-28",or=["2025-11-25","2025-06-18"],te=[q],m={headerMismatch:-32020,missingRequiredClientCapability:-32021,unsupportedProtocolVersion:-32022,invalidParams:-32602},x={clientCapabilities:"io.modelcontextprotocol/clientCapabilities",clientInfo:"io.modelcontextprotocol/clientInfo",logLevel:"io.modelcontextprotocol/logLevel",protocolVersion:"io.modelcontextprotocol/protocolVersion",serverInfo:"io.modelcontextprotocol/serverInfo"},nr=["debug","info","notice","warning","error","critical","alert","emergency"],u=class extends Error{code;data;constructor(t,r,n={}){super(t),this.name="PmMcpProtocolError",this.code=r,this.data=n}};function h(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Lg(e){if(e===void 0)return;if(!h(e))throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.clientInfo,expected:"object"});let t=typeof e.name=="string"?e.name.trim():"",r=typeof e.version=="string"?e.version.trim():"";if(t.length===0||r.length===0)throw new u("Invalid MCP clientInfo metadata",m.invalidParams,{field:x.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 $g(e){if(e!==void 0){if(typeof e!="string"||!nr.includes(e))throw new u("Invalid MCP logLevel metadata",m.invalidParams,{field:x.logLevel,allowed:[...nr]});return e}}function Ye(e){let t=h(e)?e._meta:void 0;if(!h(t))throw new u("Missing required MCP request metadata",m.invalidParams,{required:[x.protocolVersion,x.clientCapabilities]});let r=t[x.protocolVersion];if(typeof r!="string"||!te.includes(r))throw new u("Unsupported protocol version",m.unsupportedProtocolVersion,{supported:[...te],requested:typeof r=="string"?r:null});let n=t[x.clientCapabilities];if(!h(n))throw new u("Invalid MCP client capabilities metadata",m.invalidParams,{field:x.clientCapabilities,expected:"object"});let o=Lg(t[x.clientInfo]),i=$g(t[x.logLevel]);return{protocolVersion:q,clientCapabilities:n,...o?{clientInfo:o}:{},...i?{logLevel:i}:{}}}function O0(e,t){if(t!==e.protocolVersion)throw new u("MCP protocol header does not match request metadata",m.headerMismatch,{header:t??null,metadata:e.protocolVersion})}function R0(e,t){let r=t.filter(n=>!Object.prototype.hasOwnProperty.call(e.clientCapabilities,n));if(r.length>0)throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:Object.fromEntries(r.map(n=>[n,{}]))})}function P0(e,t){let r=e.clientCapabilities.extensions;return h(r)&&h(r[t])}function Xe(e,t){let r=h(e._meta)?e._meta:{};return{...e,_meta:{...r,[x.serverInfo]:{...t}}}}function Dg(e,t){return Xe({...e,resultType:"complete"},t)}function M0(e){let t=e.ttlMs??6e4;if(!Number.isFinite(t)||t<0)throw new u("Invalid MCP discovery cache TTL",m.invalidParams,{ttlMs:t});return Dg({supportedVersions:[...te],capabilities:structuredClone(e.capabilities),ttlMs:t,cacheScope:"public",...e.instructions?{instructions:e.instructions}:{}},e.serverInfo)}function I0(e,t){if(h(e)&&typeof e.resultType=="string")return e.resultType;if(t==="legacy")return"complete";throw new u("Modern MCP result is missing resultType",m.invalidParams,{required:"resultType"})}var Fg=new Set(["--help","-h","--version","-V"]);function Gg(e,t){let n=[`Usage: ${e==="stdio"?"pm-mcp":"pm-mcp-http"} [--help | --version]`,"",e==="stdio"?"JSON-RPC over stdin/stdout. With no arguments, starts the stdio server.":"Streamable HTTP POST /mcp. With no arguments, starts the HTTP server.","","Options:"," -h, --help Print help and exit before transport startup."," -V, --version Print the package version and exit.","","Environment:"," PM_PATH Tracker root (otherwise discovered from cwd)."," PM_GLOBAL_PATH Global settings root."," PM_MCP_PROFILE core (default), standard, full, or custom."," PM_MCP_TOOLS Comma-separated tool allowlist for custom profile."," PM_MCP_DISCOVERY_CURSOR_KEY Shared discovery cursor secret, at least 32 UTF-8 bytes."," PM_MCP_BAGGAGE_ALLOWLIST Comma-separated permitted trace baggage keys."];return e==="http"&&n.push(" PM_MCP_HTTP_HOST Bind host (default 127.0.0.1)."," PM_MCP_HTTP_PORT Bind port, 0..65535 (default 3000)."," PM_MCP_HTTP_ALLOWED_ORIGINS Comma-separated exact browser origins (default none)."," PM_MCP_HTTP_BEARER_TOKEN Deployment token for the bundled verifier."," PM_MCP_HTTP_AUTH_ISSUER Exact HTTPS authorization-server issuer."," PM_MCP_HTTP_RESOURCE Canonical resource/audience URI."," PM_MCP_HTTP_SCOPES Space-separated scopes (default pm:read pm:write).","","Non-loopback HTTP requires bearer token, issuer, and resource together."),n.push("",`MCP protocol: ${te.join(", ")}.`,e==="stdio"?`Legacy initialize compatibility: ${or.join(", ")}.`:"HTTP requires modern per-request metadata; legacy initialize is stdio-only.","",e==="stdio"?"Client configuration:":"Example loopback server:",e==="stdio"?JSON.stringify({mcpServers:{pm:{command:"npx",args:["--yes","--package",`@unbrained/pm-cli@${t}`,"pm-mcp"]}}}):`PM_MCP_HTTP_PORT=3000 npx --yes --package @unbrained/pm-cli@${t} pm-mcp-http`,...e==="http"?["HTTP client configuration:",JSON.stringify({mcpServers:{pm:{url:"http://127.0.0.1:3000/mcp"}}})]:[],"","Configuration: https://github.com/unbraind/pm-cli/blob/main/docs/MCP_REMOTE_TRANSPORT_SECURITY.md",""),n.join(`
2
+ `)}function N0(e,t,r){if(e.length===0)return{kind:"serve"};let n=e.find(i=>!Fg.has(i));if(n!==void 0){let i=t==="stdio"?"pm-mcp":"pm-mcp-http";return{kind:"exit",exitCode:64,stdout:"",stderr:`Unsupported argument ${JSON.stringify(n)}. Run ${i} --help.
3
+ `}}return{kind:"exit",exitCode:0,stdout:e.includes("--help")||e.includes("-h")?Gg(t,r):`${r}
4
+ `,stderr:""}}import{createHash as ar,createHmac as cr,timingSafeEqual as Ug}from"node:crypto";var jg=["elicitation/create","roots/list","sampling/createMessage"],ir=class extends Error{inputRequests;requestState;constructor(t){super("MCP operation requires additional input"),this.name="PmMcpInputRequiredError",this.inputRequests=t.inputRequests,this.requestState=t.requestState}},dr=/^[a-zA-Z][a-zA-Z0-9_.-]{0,63}$/u,he=32,Qe=64*1024,ge=16*1024,Je={maxBytes:256*1024,maxDepth:32,maxNodes:4096};function Bg(e){return e==="elicitation/create"?"elicitation":e==="sampling/createMessage"?"sampling":"roots"}function Ce(e,t,r){let n;try{n=JSON.stringify(e)}catch{throw new u(`Invalid ${r}: value is not JSON serializable`,m.invalidParams,{field:r})}if(Buffer.byteLength(n,"utf8")>t)throw new u(`Invalid ${r}: payload exceeds the protocol bound`,m.invalidParams,{field:r,maximumBytes:t})}function Ze(e,t){if(!h(e))throw new u("Invalid MCP inputRequests",m.invalidParams,{field:"inputRequests",expected:"object"});let r=Object.entries(e);if(r.length===0||r.length>he)throw new u("Invalid MCP inputRequests count",m.invalidParams,{minimum:1,maximum:he,observed:r.length});let n={};for(let[o,i]of r){if(!dr.test(o)||!h(i))throw new u("Invalid MCP input request entry",m.invalidParams,{field:`inputRequests.${o}`});let s=i.method;if(typeof s!="string"||!jg.includes(s))throw new u("Unsupported MCP input request method",m.invalidParams,{field:`inputRequests.${o}.method`,method:s??null});let a=Bg(s);if(!Object.prototype.hasOwnProperty.call(t.clientCapabilities,a))throw new u("Missing required client capability",m.missingRequiredClientCapability,{requiredCapabilities:{[a]:{}}});if(!h(i.params))throw new u("Invalid MCP input request parameters",m.invalidParams,{field:`inputRequests.${o}.params`,expected:"object"});n[o]={method:s,params:structuredClone(i.params)}}return Ce(n,Qe,"inputRequests"),n}function pr(e){if(!h(e))throw new u("Invalid MCP inputResponses",m.invalidParams,{field:"inputResponses",expected:"object"});let t=Object.entries(e);if(t.length>he)throw new u("Invalid MCP inputResponses count",m.invalidParams,{maximum:he,observed:t.length});let r={};for(let[n,o]of t){if(!dr.test(n)||!h(o))throw new u("Invalid MCP input response entry",m.invalidParams,{field:`inputResponses.${n}`});r[n]=structuredClone(o)}return Ce(r,Qe,"inputResponses"),r}function F0(e){let t=e.requestState?.trim();if(t&&Buffer.byteLength(t,"utf8")>ge)throw new u("Invalid MCP requestState: payload exceeds the protocol bound",m.invalidParams,{field:"requestState",maximumBytes:ge});let r=e.inputRequests===void 0?void 0:Ze(e.inputRequests,e.requestContext);if(r===void 0&&!t)throw new u("InputRequiredResult requires inputRequests or requestState",m.invalidParams,{requiredAnyOf:["inputRequests","requestState"]});return{resultType:"input_required",...r?{inputRequests:r}:{},...t?{requestState:t}:{},_meta:{[x.serverInfo]:{...e.serverInfo}}}}function lr(e){let t=Buffer.from(e);if(t.byteLength<32)throw new u("MCP requestState signing key must contain at least 32 bytes",m.invalidParams,{minimumBytes:32});return t}function G0(e,t){if(!Number.isSafeInteger(e.expiresAt)||e.expiresAt<=0||e.method.trim().length===0||e.parameterDigest.trim().length===0||e.principal.trim().length===0)throw new u("Invalid MCP requestState payload",m.invalidParams);let r=Buffer.from(JSON.stringify({version:1,...e}),"utf8");if(r.byteLength>ge/2)throw new u("MCP requestState payload exceeds the protocol bound",m.invalidParams,{maximumBytes:ge/2});let n=r.toString("base64url"),o=cr("sha256",lr(t)).update(n).digest("base64url");return`${n}.${o}`}function zg(e){if(!h(e)||e.version!==1)throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});let{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}=e;if(typeof t!="number"||!Number.isSafeInteger(t))throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});if(typeof r!="string"||typeof n!="string"||typeof o!="string")throw new u("Invalid MCP requestState payload",m.invalidParams,{field:"requestState"});return{expiresAt:t,method:r,parameterDigest:n,principal:o,state:i}}function U0(e,t,r){let[n,o,i]=e.split(".");if(!n||!o||i!==void 0)throw new u("Invalid MCP requestState encoding",m.invalidParams,{field:"requestState"});let s=Buffer.from(o,"base64url"),a=cr("sha256",lr(t)).update(n).digest();if(s.byteLength!==a.byteLength||!Ug(s,a))throw new u("Invalid MCP requestState signature",m.invalidParams,{field:"requestState"});let c;try{c=JSON.parse(Buffer.from(n,"base64url").toString("utf8"))}catch{c=null}let d=zg(c),{expiresAt:p,method:l,parameterDigest:f,principal:g}=d;if(p<(r.nowMs??Date.now()))throw new u("Expired MCP requestState",m.invalidParams,{field:"requestState",expiredAt:p});if(l!==r.method||f!==r.parameterDigest||g!==r.principal)throw new u("MCP requestState binding mismatch",m.invalidParams,{field:"requestState"});return d}function j0(e){return Ce(e,Qe,"request parameters"),ar("sha256").update(JSON.stringify(e)).digest("hex")}var sr=class{#e=new Set;#t;constructor(t=4096){if(!Number.isSafeInteger(t)||t<1)throw new u("Invalid MCP replay guard capacity",m.invalidParams,{maximumEntries:t});this.#t=t}consume(t){let r=ar("sha256").update(t).digest("hex");if(this.#e.has(r))throw new u("MCP requestState replay detected",m.invalidParams,{field:"requestState"});if(this.#e.size>=this.#t){let n=this.#e.values().next().value;this.#e.delete(n)}this.#e.add(r)}};function qg(e){if(!Number.isSafeInteger(e.ttlMs)||e.ttlMs<0||e.cacheScope!=="public"&&e.cacheScope!=="private")throw new u("Invalid MCP cache policy",m.invalidParams,{ttlMs:e.ttlMs,cacheScope:e.cacheScope});return{ttlMs:e.ttlMs,cacheScope:e.cacheScope}}function B0(e,t){return{...e,...qg(t)}}function Hg(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Vg(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(let n of t.slice(2).split("/").map(Hg)){if(!h(r)&&!Array.isArray(r)||!Object.prototype.hasOwnProperty.call(r,n))return;r=r[n]}return r}function Kg(e){let t=e.maxBytes??Je.maxBytes,r=e.maxDepth??Je.maxDepth,n=e.maxNodes??Je.maxNodes;if(!Number.isSafeInteger(t)||t<2)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(r)||r<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);if(!Number.isSafeInteger(n)||n<1)throw new u("Invalid MCP JSON Schema work bounds",m.invalidParams);return{maximumBytes:t,maximumDepth:r,maximumNodes:n}}function Wg(e,t){let r=Array.isArray(e.value)?e.value:h(e.value)?Object.values(e.value):[];for(let n of r)t.push({value:n,depth:e.depth+1})}function Yg(e,t){if(!h(t)||typeof t.$ref!="string")return;let r=t.$ref;if(r.startsWith("#")&&Vg(e,r)===void 0)throw new u("MCP JSON Schema contains an unresolved local reference",m.invalidParams,{reference:r})}function z0(e,t={}){let{maximumBytes:r,maximumDepth:n,maximumNodes:o}=Kg(t);if(typeof e!="boolean"&&!h(e))throw new u("Invalid MCP JSON Schema root",m.invalidParams,{expected:"object or boolean"});Ce(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 u("MCP JSON Schema exceeds validation work bounds",m.invalidParams,{maximumDepth:n,maximumNodes:o});Yg(e,a.value),Wg(a,i)}return structuredClone(e)}import{randomUUID as Xg}from"node:crypto";import{readFile as Jg}from"node:fs/promises";import ur from"node:path";var J0="io.modelcontextprotocol/tasks",Qg=["working","input_required","completed","failed","cancelled"],Zg=/^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,eC=3600*1e3,tC=1e3,Se=1024,rC=30,nC=2e3;function et(e){return new u(e,m.invalidParams,{code:"mcp_task_not_found_or_not_authorized"})}function ye(e){let t=e.trim();if(!Zg.test(t))throw et("Unknown MCP task");return t}function mr(e,t){if(typeof e!="string"||!Number.isFinite(Date.parse(e)))throw new u("Corrupt MCP task record",m.invalidParams,{field:t});return e}function fr(e){if(!h(e)||typeof e.code!="number"||!Number.isFinite(e.code)||typeof e.message!="string")throw new u("Corrupt MCP task error",m.invalidParams);return{code:e.code,message:e.message.slice(0,Se),...h(e.data)?{data:structuredClone(e.data)}:{}}}function oC(e){if(!Qg.includes(e))throw new u("Corrupt MCP task record",m.invalidParams);return e}function iC(e){if(typeof e!="string"||e.length===0)throw new u("Corrupt MCP task record",m.invalidParams);return e}function sC(e){if(typeof e!="number"||!Number.isSafeInteger(e)||e<1)throw new u("Corrupt MCP task record",m.invalidParams);return e}function aC(e){if(e!==null&&(typeof e!="number"||!Number.isSafeInteger(e)||e<0))throw new u("Corrupt MCP task record",m.invalidParams);return e}function cC(e){if(e!==void 0){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new u("Corrupt MCP task record",m.invalidParams);return e}}function dC(e){if(!Array.isArray(e)||e.some(t=>typeof t!="string"))throw new u("Corrupt MCP task record",m.invalidParams);return[...e]}function pC(e){if(!h(e)||e.version!==1)throw new u("Corrupt MCP task record",m.invalidParams);let t=typeof e.taskId=="string"?ye(e.taskId):"",r=oC(e.status),n=iC(e.principal),o=sC(e.workerPid),i=aC(e.ttlMs),s=cC(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:dC(e.consumedInputKeys),...typeof e.statusMessage=="string"?{statusMessage:e.statusMessage.slice(0,Se)}:{},...typeof s=="number"?{pollIntervalMs:s}:{}};if(h(e.inputRequests)&&(a.inputRequests=structuredClone(e.inputRequests)),h(e.inputResponses)&&(a.inputResponses=structuredClone(e.inputResponses)),h(e.result)&&(a.result=structuredClone(e.result)),e.error!==void 0&&(a.error=fr(e.error)),a.status==="input_required"&&!a.inputRequests||a.status==="completed"&&!a.result||a.status==="failed"&&!a.error)throw new u("Corrupt MCP task status payload",m.invalidParams,{status:a.status});return a}function H(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 re(e){return e==="completed"||e==="failed"||e==="cancelled"}function lC(e){try{return process.kill(e,0),!0}catch(t){return!(typeof t=="object"&&t!==null&&"code"in t&&t.code==="ESRCH")}}var tt=class{#e;#t;#r;#n;#i;constructor(t){this.#e=ur.resolve(t.pmRoot),this.#t=t.owner?.trim()||"pm-mcp",this.#r=t.now??(()=>new Date),this.#n=t.taskIdFactory??(()=>`mcp-task-${Xg()}`),this.#i=t.workerPid??process.pid}#s(t){return ur.join(this.#e,"runtime","mcp-tasks","records",`${ye(t)}.json`)}async#c(t){try{return pC(JSON.parse(await Jg(this.#s(t),"utf8")))}catch(r){throw me(r)||r instanceof SyntaxError?et("Unknown MCP task"):r}}async#a(t){await $e(this.#s(t.taskId),`${JSON.stringify(t,null,2)}
5
+ `)}async#o(t,r,n){let o=ye(t),i=await Fe(this.#e,o,rC,this.#t,!1,!1,nC);try{let s=await this.#c(o);if(s.principal!==r)throw et("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?eC:t.ttlMs,i=t.pollIntervalMs??tC;if(n.length===0||o!==null&&(!Number.isSafeInteger(o)||o<0)||!Number.isSafeInteger(i)||i<0)throw new u("Invalid MCP task creation options",m.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,Se)}:{}};return await this.#a(a),{...H(a),resultType:"task"}}async get(t,r){return H(await this.#o(t,r,n=>{if(re(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&&!lC(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=Ze(t.inputRequests,t.requestContext);return H(await this.#o(t.taskId,t.principal,n=>{if(re(n.status))return n;let o=Object.keys(r).filter(i=>n.consumedInputKeys.includes(i));if(o.length>0)throw new u("MCP task input request keys must be unique for the task lifetime",m.invalidParams,{reused:o});return{...n,status:"input_required",statusMessage:t.statusMessage?.trim().slice(0,Se),lastUpdatedAt:this.#r().toISOString(),inputRequests:r}}))}async update(t,r,n){let o=pr(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[p,l]of Object.entries(o))Object.prototype.hasOwnProperty.call(c,p)&&(d[p]=l,delete c[p],i.push(p));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 H(await this.#o(t,r,o=>re(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=fr(n);return H(await this.#o(t,r,i=>re(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 H(await this.#o(t,r,n=>re(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 Q0(e){return new tt(e)}var Te="io.modelcontextprotocol/subscriptionId",_r=256,hr=2048,uC=5e3;function mC(e,t){return new Promise((r,n)=>{let o=setTimeout(()=>n(new Error("MCP subscription sink write timed out")),uC);o.unref(),Promise.resolve().then(()=>e(t)).then(()=>{clearTimeout(o),r()},i=>{clearTimeout(o),n(i instanceof Error?i:new Error(String(i)))})})}function rt(e,t){if(e!==void 0){if(typeof e!="boolean")throw new u("Invalid MCP subscription filter",m.invalidParams,{field:`notifications.${t}`,expected:"boolean"});return e||void 0}}function fC(e){if(!h(e))throw new u("Invalid MCP subscription filter",m.invalidParams,{field:"notifications",expected:"object"});let t=rt(e.toolsListChanged,"toolsListChanged"),r=rt(e.promptsListChanged,"promptsListChanged"),n=rt(e.resourcesListChanged,"resourcesListChanged"),o;if(e.resourceSubscriptions!==void 0){if(!Array.isArray(e.resourceSubscriptions)||e.resourceSubscriptions.length>_r)throw new u("Invalid MCP resource subscriptions",m.invalidParams,{field:"notifications.resourceSubscriptions",maximum:_r});let i=new Set;for(let s of e.resourceSubscriptions){if(typeof s!="string"||s.trim().length===0||Buffer.byteLength(s,"utf8")>hr)throw new u("Invalid MCP resource subscription URI",m.invalidParams,{field:"notifications.resourceSubscriptions",maximumBytes:hr});i.add(s)}i.size>0&&(o=[...i].sort())}return{...t?{toolsListChanged:t}:{},...r?{promptsListChanged:r}:{},...n?{resourcesListChanged:n}:{},...o?{resourceSubscriptions:o}:{}}}function _C(e,t){return{...e.toolsListChanged&&t.tools?.listChanged?{toolsListChanged:!0}:{},...e.promptsListChanged&&t.prompts?.listChanged?{promptsListChanged:!0}:{},...e.resourcesListChanged&&t.resources?.listChanged?{resourcesListChanged:!0}:{},...e.resourceSubscriptions&&t.resources?.subscribe?{resourceSubscriptions:[...e.resourceSubscriptions]}:{}}}var gr=class{#e;#t=new Map;#r;constructor(t){this.#e=structuredClone(t.capabilities),this.#r={...t.serverInfo}}get size(){return this.#t.size}async open(t){if(this.#t.has(t.id))throw new u("MCP subscription id is already active",m.invalidParams,{subscriptionId:t.id});let r=_C(fC(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:{[Te]: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:{[Te]: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:{[Te]: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 mC(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{...Xe({resultType:"complete",_meta:{[Te]: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}};var Cr=/^=\?base64\?([A-Za-z0-9+/]*={0,2})\?=$/u,hC=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u,yr=/^[\t\x20-\x7E]*$/u,Sr=new Set(["prompts/get","resources/read","tools/call"]);function gC(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 b(e,t){throw new u(e,m.headerMismatch,{header:t})}function Tr(e){let t=typeof e=="boolean"?String(e).toLowerCase():String(e);return t.length>0&&t.trim()===t&&yr.test(t)&&!Cr.test(t)?t:`=?base64?${Buffer.from(t,"utf8").toString("base64")}?=`}function Er(e,t){let r=Cr.exec(e);if(r){let n=r[1],o=Buffer.from(n,"base64");return o.toString("base64")!==n||o.length===0?b("Malformed MCP Base64 header value",t):o.toString("utf8")}return e.length===0||e.trim()!==e||!yr.test(e)?b("Malformed MCP header value",t):e}function Ee(e){return Array.isArray(e)?e.some(Ee):h(e)?Object.prototype.hasOwnProperty.call(e,"x-mcp-header")||Object.values(e).some(Ee):!1}function CC(e,t,r){let n=e["x-mcp-header"];if(n===void 0)return;let o=e.type;if(typeof n!="string"||!hC.test(n)||!["boolean","integer","string"].includes(String(o))||r.has(n.toLowerCase()))throw new u("Invalid MCP x-mcp-header annotation",m.invalidParams,{field:t.join("."),annotation:n});return r.add(n.toLowerCase()),{name:n,path:t,type:o}}function Ar(e){if(!h(e))throw new u("Invalid MCP tool schema",m.invalidParams,{field:"inputSchema",expected:"object"});let t=[],r=new Set,n=(o,i)=>{let s=o.properties;if(s!==void 0){if(!h(s))throw new u("Invalid MCP tool schema properties",m.invalidParams,{field:"inputSchema.properties"});for(let[a,c]of Object.entries(s)){if(!h(c))continue;let d=[...i,a],p=CC(c,d,r);p&&t.push(p);for(let[l,f]of Object.entries(c))if(l!=="properties"&&l!=="x-mcp-header"&&Ee(f))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:d.join("."),keyword:l});n(c,d)}}};for(let[o,i]of Object.entries(e))if(o!=="properties"&&Ee(i))throw new u("MCP x-mcp-header is not statically reachable",m.invalidParams,{field:"inputSchema",keyword:o});return n(e,[]),t}function xr(e,t){let r=e;for(let n of t){if(!h(r))return;r=r[n]}return r}function br(e,t){let r=e==="resources/read"?t.uri:t.name;return typeof r=="string"?r:void 0}function yC(e,t){let r=h(e.arguments)?e.arguments:{},n={};for(let o of Ar(t)){let i=xr(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 u("Invalid MCP custom header argument",m.invalidParams,{field:o.path.join("."),expected:o.type});n[`Mcp-Param-${o.name}`]=Tr(i)}return n}function nL(e){let t=h(e.request.params)?e.request.params:void 0,r=Ye(t),n=e.request.method;if(typeof n!="string"||n.length===0)return b("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=br(n,t);if(Sr.has(n)){if(i===void 0)return b("Missing MCP request name","Mcp-Name");o["Mcp-Name"]=Tr(i)}return n==="tools/call"&&e.toolSchema!==void 0&&Object.assign(o,yC(t,e.toolSchema)),o}function SC(e,t){let r=t.method;(typeof r!="string"||r.length===0)&&b("Missing MCP request method","Mcp-Method");let n=h(t.params)?t.params:void 0,o=Ye(n).protocolVersion;if(e.get("mcp-protocol-version")!==o&&b("MCP protocol header does not match request metadata","MCP-Protocol-Version"),e.get("mcp-method")!==r&&b("MCP method header does not match request body","Mcp-Method"),Sr.has(r)){let i=e.get("mcp-name"),s=br(r,n);(i===void 0||s===void 0||Er(i,"Mcp-Name")!==s)&&b("MCP name header does not match request body","Mcp-Name")}e.has("last-event-id")&&b("MCP SSE resumability is not supported","Last-Event-ID")}function TC(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 EC(e){let t=h(e.params.arguments)?e.params.arguments:{};for(let r of Ar(e.toolSchema)){let n=xr(t,r.path),o=`Mcp-Param-${r.name}`,i=e.headers.get(o.toLowerCase());if(n==null){i!==void 0&&b("Unexpected MCP parameter header",o);continue}i===void 0&&b("Missing MCP parameter header",o),TC(r,n,Er(i,o))||b("MCP parameter header does not match request body",o)}}function oL(e){let t=gC(e.headers),r=typeof e.request.method=="string"?e.request.method:"";SC(t,e.request),!(r!=="tools/call"||e.toolSchema===void 0)&&EC({headers:t,params:e.request.params,toolSchema:e.toolSchema})}var iL=q;import{AsyncLocalStorage as AC}from"node:async_hooks";import{createHash as wr,timingSafeEqual as xC}from"node:crypto";var C=class extends Error{httpStatus;challenge;constructor(t,r,n){super(t),this.name="PmMcpAuthorizationError",this.httpStatus=r,this.challenge=n}},bC=/^00-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})$/u,wC=/^[a-z][a-z0-9_*/-]{0,255}$/u,OC=/^(?:[a-z0-9][a-z0-9_*/-]{0,240})@[a-z][a-z0-9_*/-]{0,13}$/u,RC=/^[\x20-\x2B\x2D-\x3C\x3E-\x7E]{0,255}[\x21-\x2B\x2D-\x3C\x3E-\x7E]$/u,Rr=/^[\x21\x23-\x5B\x5D-\x7E]+$/u,Pr=/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/u,PC=/^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*$/u,MC=/%(?![0-9A-Fa-f]{2})/u,IC=512,vC=32,kC=180,NC=8192,LC=8192,Mr=new AC;function A(e,t,r=!1){if(new RegExp("\\p{Cc}","u").test(e))throw new C(`Invalid ${t}`,401);let n;try{n=new URL(e)}catch{throw new C(`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 C(`Invalid ${t}`,401);return n}function $C(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 pL(e){let t=A(e.resource,"protected resource URI",!0).href.replace(/\/$/u,"");if(e.authorizationServers.length===0)throw new C("Protected resource metadata requires an authorization server",401);let r=e.authorizationServers.map(o=>A(o,"authorization server issuer").href.replace(/\/$/u,"")),n=[...new Set(e.scopes??[])];if(n.some(o=>!Rr.test(o)))throw new C("Invalid authorization scope",401);return{resource:t,authorization_servers:r,...n.length>0?{scopes_supported:n.sort()}:{}}}function lL(e){let t=A(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 uL(e,t){if(!h(e)||typeof e.issuer!="string")throw new C("Invalid authorization server metadata",401);let r=A(t,"expected issuer").href.replace(/\/$/u,"");if(A(e.issuer,"metadata issuer").href.replace(/\/$/u,"")!==r)throw new C("Authorization server issuer mismatch",401);if(!Array.isArray(e.code_challenge_methods_supported)||!e.code_challenge_methods_supported.includes("S256"))throw new C("Authorization server does not support required S256 PKCE",401);let o=d=>{let p=e[d];if(typeof p!="string")throw new C(`Authorization server metadata requires ${d}`,401);return A(p,d).href},i=d=>{let p=e[d];return typeof p=="string"?A(p,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 mL(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 fL(e){if(e.responseIssuer===void 0){if(e.issuerParameterSupported)throw new C("Authorization response omitted the advertised issuer",401);return}if(e.responseIssuer!==e.expectedIssuer)throw new C("Authorization response issuer mismatch",401)}function _L(e,t){let r=A(t,"client metadata document URL");if(r.pathname==="/"||!h(e)||e.client_id!==r.href||typeof e.client_name!="string"||e.client_name.trim().length===0||!Array.isArray(e.redirect_uris)||e.redirect_uris.length===0)throw new C("Invalid Client ID Metadata Document",401);for(let n of e.redirect_uris){if(typeof n!="string")throw new C("Invalid client redirect URI",401);A(n,"client redirect URI",!0)}return structuredClone(e)}function hL(e){if(e.redirectUris.length===0||e.clientName.trim().length===0)throw new C("Invalid dynamic client registration metadata",401);let t=e.redirectUris.map(r=>A(r,"redirect URI",!0).href);return{application_type:e.applicationType,client_name:e.clientName.trim().slice(0,128),redirect_uris:t,grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none"}}var Or=class{#e=new Map;set(t,r){let n=A(t,"credential issuer").href;this.#e.set(n,structuredClone(r))}get(t){let r=A(t,"credential issuer").href,n=this.#e.get(r);return n?structuredClone(n):void 0}delete(t){let r=A(t,"credential issuer").href;return this.#e.delete(r)}};function DC(e){let t=e.traceparent,r=e.tracestate;if(t!==void 0){let n=typeof t=="string"?bC.exec(t):null;if(!n)throw new C("Invalid MCP traceparent",403);let o=n[1],i=n[2];if(/^0+$/u.test(o)||/^0+$/u.test(i))throw new C("Invalid MCP traceparent",403)}if(r!==void 0&&(typeof r!="string"||!GC(r)))throw new C("Invalid MCP tracestate",403);return{...typeof t=="string"?{traceparent:t}:{},...typeof r=="string"?{tracestate:r}:{}}}function $(e){return e.replace(/^[ \t]*|[ \t]*$/gu,"")}function FC(e){return wC.test(e)||OC.test(e)}function GC(e){if(Buffer.byteLength(e,"utf8")>IC)return!1;let t=e.split(",");if(t.length>vC)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(!FC(s)||!RC.test(a)||r.has(s))return!1;r.add(s)}return!0}function Ir(e){return PC.test(e)&&!MC.test(e)}function UC(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 Pr.test(n)&&(o===void 0||Ir(o))}function jC(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(!(!Pr.test(s)||!Ir(a)||!o.every(UC)))return{key:s,serialized:t}}function BC(e,t){if(e===void 0)return;if(typeof e!="string"||Buffer.byteLength(e,"utf8")>NC)throw new C("Invalid MCP baggage",403);let r=new Set(t),n=e.split(",");if(n.length>kC)throw new C("Invalid MCP baggage",403);let o=[];for(let i of n){let s=jC(i);if(!s)throw new C("Invalid MCP baggage",403);r.has(s.key)&&o.push(s.serialized)}return o.length>0?o.join(","):void 0}function gL(e,t={}){let r=h(e)&&h(e._meta)?e._meta:{},n=BC(r.baggage,t.baggageAllowlist??[]);return{...DC(r),...n?{baggage:n}:{}}}function CL(e,t){return Mr.run(structuredClone(e),t)}function yL(){let e=Mr.getStore();return e?{...e}:void 0}async function SL(e){let t=A(e.policy.resourceMetadataUrl,"protected resource metadata URL",!0).href,r=[...new Set(e.policy.requiredScopes??[])];if(r.some(l=>!Rr.test(l)))throw new C("Invalid authorization scope",401);let n=`Bearer resource_metadata="${t}"`;if(new URL(e.requestUrl,e.policy.resource).searchParams.has("access_token"))throw new C("Access tokens must not appear in URI query parameters",401,n);let s=$C(e.headers,"authorization")?.match(/^Bearer ([^\s]+)$/iu);if(!s)throw new C("Missing or malformed bearer token",401,n);let a=s[1];if(Buffer.byteLength(a,"utf8")>LC)throw new C("Missing or malformed bearer token",401,n);let c;try{c=await e.policy.verifyAccessToken(a)}catch{throw new C("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 C("Bearer token issuer or audience mismatch",401,n);let p=r.filter(l=>!c.scopes.includes(l));if(p.length>0)throw new C("Bearer token has insufficient scope",403,`${n}, scope="${p.join(" ")}"`);return{...c,audience:[...d],scopes:[...c.scopes]}}function TL(e){let t=wr("sha256").update(e.token).digest();return r=>{let n=wr("sha256").update(r).digest();if(!xC(t,n))throw new C("Invalid bearer token",401);return structuredClone(e.claims)}}var nt="io.modelcontextprotocol/ui",Ae="2026-01-26",Nr="text/html;profile=mcp-app",vr=Object.freeze({specVersion:Ae,mimeTypes:[Nr]});function xL(e){let t=e.clientCapabilities.extensions;if(!h(t))return!1;let r=t[nt];if(r===void 0)return!1;if(!h(r))throw new u("Invalid MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[nt]:vr}}});let n=r.mimeTypes,o=r.specVersion;if(!Array.isArray(n)||!n.includes(Nr)||o!==void 0&&o!==Ae)throw new u("Unsupported MCP Apps client capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[nt]:vr}}});return!0}var zC={csp:{connectDomains:[],resourceDomains:[],frameDomains:[]},permissions:{},prefersBorder:!0},Lr=Object.freeze([{id:"context",name:"Context explorer",description:"Inspect bounded project context, provenance, omissions, and token accounting.",toolName:"pm_context",uri:"ui://pm/context.html"},{id:"graph",name:"Relationship graph",description:"Explore typed relationships, explaining paths, and graph-governance evidence.",toolName:"pm_graph",uri:"ui://pm/graph.html"},{id:"plan",name:"Plan and milestone view",description:"Review durable plan steps, dependencies, decisions, discoveries, and validation state.",toolName:"pm_plan",uri:"ui://pm/plan.html"},{id:"assurance",name:"Assurance dashboard",description:"Inspect validation verdicts, evidence, omissions, and actionable recovery paths.",toolName:"pm_validate",uri:"ui://pm/assurance.html"},{id:"operations",name:"Long-operation view",description:"Inspect durable test and operation results without creating a second task store.",toolName:"pm_test",uri:"ui://pm/operations.html"}].map(e=>({...e,toolMeta:{resourceUri:e.uri,visibility:["model","app"]},resourceMeta:zC})));function bL(e){return Lr.find(t=>t.uri===e)}function wL(e){let t=new Map(Lr.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 kr(e){return e.replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll('"',"&quot;").replaceAll("'","&#39;")}function OL(e){let t=kr(e.name),r=kr(e.description),n=JSON.stringify({name:`pm-${e.id}-view`,version:Ae}),o=JSON.stringify(Ae);return`<!doctype html>
6
6
  <html lang="en">
7
7
  <head>
8
8
  <meta charset="utf-8">
@@ -22,14 +22,14 @@ import{a as xg}from"./chunks/chunk-CIKGG34F.js";import{a as Cx,b as Ex,c as Sx,d
22
22
  <button type="button" id="copy">Copy visible evidence</button>
23
23
  </main>
24
24
  <script>
25
- (()=>{"use strict";const MAX=24000,status=document.querySelector("#status"),result=document.querySelector("#result"),input=document.querySelector("#input"),pending=new Map();let nextId=1;const render=(node,value)=>{let text;try{text=typeof value==="string"?value:JSON.stringify(value,null,2)}catch{text="Result could not be serialized."}if(text.length>MAX)text=text.slice(0,MAX)+"\\n\\n[View truncated at "+MAX+" characters; use the authoritative pm tool with a cursor or narrower projection.]";node.textContent=text};const send=(message)=>window.parent.postMessage(message,"*");window.addEventListener("message",event=>{if(event.source!==window.parent||!event.data||event.data.jsonrpc!=="2.0")return;const message=event.data;if(message.id!==undefined&&pending.has(message.id)){pending.get(message.id)(message);pending.delete(message.id);return}if(message.method==="ui/notifications/tool-input"||message.method==="ui/notifications/tool-input-partial"){render(input,message.params?.arguments??message.params);status.textContent="Input received"}else if(message.method==="ui/notifications/tool-result"){render(result,message.params);status.textContent="Current tool result"}else if(message.method==="ui/notifications/tool-cancelled"){status.textContent="Tool call cancelled";status.classList.add("notice")}else if(message.method==="ui/notifications/host-context-changed"&&message.params?.theme){document.documentElement.style.colorScheme=message.params.theme}});const request=(method,params)=>new Promise(resolve=>{const id=nextId++;pending.set(id,resolve);send({jsonrpc:"2.0",id,method,params})});document.querySelector("#copy").addEventListener("click",async()=>{const text=result.textContent+"\\n\\n"+input.textContent;try{await navigator.clipboard.writeText(text);status.textContent="Visible evidence copied"}catch{status.textContent="Clipboard permission unavailable";status.classList.add("notice")}});request("ui/initialize",{appInfo:${o},appCapabilities:{},protocolVersion:${n}}).then(message=>{if(message.error){status.textContent="Host rejected MCP App initialization";status.classList.add("notice");return}send({jsonrpc:"2.0",method:"ui/notifications/initialized"});status.textContent="Connected \u2014 awaiting authoritative result"})})();
25
+ (()=>{"use strict";const MAX=24000,status=document.querySelector("#status"),result=document.querySelector("#result"),input=document.querySelector("#input"),pending=new Map();let nextId=1;const render=(node,value)=>{let text;try{text=typeof value==="string"?value:JSON.stringify(value,null,2)}catch{text="Result could not be serialized."}if(text.length>MAX)text=text.slice(0,MAX)+"\\n\\n[View truncated at "+MAX+" characters; use the authoritative pm tool with a cursor or narrower projection.]";node.textContent=text};const send=(message)=>window.parent.postMessage(message,"*");window.addEventListener("message",event=>{if(event.source!==window.parent||!event.data||event.data.jsonrpc!=="2.0")return;const message=event.data;if(message.id!==undefined&&pending.has(message.id)){pending.get(message.id)(message);pending.delete(message.id);return}if(message.method==="ui/notifications/tool-input"||message.method==="ui/notifications/tool-input-partial"){render(input,message.params?.arguments??message.params);status.textContent="Input received"}else if(message.method==="ui/notifications/tool-result"){render(result,message.params);status.textContent="Current tool result"}else if(message.method==="ui/notifications/tool-cancelled"){status.textContent="Tool call cancelled";status.classList.add("notice")}else if(message.method==="ui/notifications/host-context-changed"&&message.params?.theme){document.documentElement.style.colorScheme=message.params.theme}});const request=(method,params)=>new Promise(resolve=>{const id=nextId++;pending.set(id,resolve);send({jsonrpc:"2.0",id,method,params})});document.querySelector("#copy").addEventListener("click",async()=>{const text=result.textContent+"\\n\\n"+input.textContent;try{await navigator.clipboard.writeText(text);status.textContent="Visible evidence copied"}catch{status.textContent="Clipboard permission unavailable";status.classList.add("notice")}});request("ui/initialize",{appInfo:${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"})})();
26
26
  </script>
27
27
  </body>
28
- </html>`}import{createHash as nt}from"node:crypto";import{lstat as qy,readdir as Br,readFile as zy}from"node:fs/promises";import P from"node:path";import{parseDocument as Hy}from"yaml";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="eafd8bc3-0da1-5220-8fb1-6967eecdb6bf")}catch{}})();var Lr="io.modelcontextprotocol/skills",it="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",Vy=Object.freeze({revision:it,status:"draft",directoryRead:!0});function NL(e,t=!1){let r=e.clientCapabilities.extensions,o=h(r)?r[Lr]:void 0;if(!h(o)||o.revision!==it||t&&o.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[Lr]:Vy}}})}var I=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Dr=100,Ky=32*1024*1024,Wy=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,$r=new Set(Array.from({length:I.maxPageSize},(e,t)=>t+1));function C(e,t){throw new u(e,-32602,t)}function Fr(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 Yy(e,t){let r=/^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/u.exec(e);r||C(`Skill ${t} is missing YAML frontmatter.`);let o=Hy(r[1],{prettyErrors:!1,strict:!0,uniqueKeys:!0});o.errors.length>0&&C(`Skill ${t} has invalid YAML frontmatter.`,{errors:o.errors.map(s=>s.message)});let n;try{n=o.toJS({maxAliasCount:0})}catch(s){C(`Skill ${t} has unsupported YAML aliases.`,{error:String(s)})}return(typeof n!="object"||n===null||Array.isArray(n))&&C(`Skill ${t} frontmatter must be an object.`),n}async function Xy(e,t,r,o){return r>I.maxFileBytes&&C(`Skill resource exceeds the per-file limit: ${t}.`),o.files+=1,o.files>I.maxFilesPerSkill&&C(`Skill exceeds ${I.maxFilesPerSkill} files.`),o.skillBytes+=r,o.skillBytes>I.maxSkillBytes&&C(`Skill exceeds the aggregate byte limit: ${t}.`),o.originBytes.value+=r,o.originBytes.value>Ky&&C(`Skill origin exceeds the aggregate byte limit: ${t}.`),zy(e)}async function qr(e,t,r){let o=P.join(e,t),n=await Br(o,{withFileTypes:!0}),s=[];for(let i of n.sort((a,c)=>a.name.localeCompare(c.name))){let a=P.posix.join(t.split(P.sep).join("/"),i.name),c=P.join(e,...a.split("/")),d=await qy(c);d.isSymbolicLink()&&C(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?s.push(...await qr(e,a,r)):d.isFile()?s.push({relative:a,bytes:await Xy(c,a,d.size,r)}):C(`Skill resource must be a regular file or directory: ${a}.`)}return s}async function Gr(e,t,r){let o=new Map,n;try{n=await Br(e,{withFileTypes:!0})}catch(a){if(bt(a))return o;throw a}let s=n.filter(a=>a.isDirectory()&&Wy.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));s.length>Dr&&C(`Skill origin exceeds ${Dr} directories.`);let i={value:0};for(let a of s){let c=await qr(P.join(e,a.name),"",{files:0,skillBytes:0,originBytes:i}),d=c.reduce((g,T)=>g+T.bytes.byteLength,0),l=c.find(g=>g.relative==="SKILL.md");if(!l)continue;let p=Yy(l.bytes.toString("utf8"),a.name);p.name!==a.name&&C(`Skill directory ${a.name} must match frontmatter name.`,{actual:p.name??null,expected:a.name}),(typeof p.description!="string"||p.description.trim().length===0)&&C(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=c.map(g=>({uri:`skill://${a.name}/${g.relative}`,digest:`sha256:${nt("sha256").update(g.bytes).digest("hex")}`,size:g.bytes.byteLength})),_=nt("sha256").update(f.map(g=>`${g.uri}:${g.digest}`).join(`
29
- `)).digest("hex");o.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:p,resources:f,_meta:{contractVersion:1,extensionRevision:it,origin:t,packageVersion:r,protocolVersion:z,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(g=>[g.relative,g.bytes])),fingerprint:_})}return o}function Ur(e){let{files:t,fingerprint:r,...o}=e;return o}var jr=class e{#e;#t;constructor(t){this.#e=t,this.#t=nt("sha256").update([...t.entries()].sort(([r],[o])=>r.localeCompare(o)).map(([r,o])=>`${r}:${o.fingerprint}`).join(`
30
- `)).digest("hex").slice(0,16)}#r(t,r){if(!t)return 0;try{let o=JSON.parse(Buffer.from(t,"base64url").toString("utf8"));return(typeof o!="object"||o===null||!("fingerprint"in o)||o.fingerprint!==this.#t||!("scope"in o)||o.scope!==r||!("offset"in o)||!Number.isInteger(o.offset)||Number(o.offset)<0)&&C("Skill cursor is invalid or stale."),Number(o.offset)}catch(o){if(o instanceof u)throw o;return C("Skill cursor is invalid or stale.")}}#o(t,r){return Buffer.from(JSON.stringify({fingerprint:this.#t,offset:t,scope:r})).toString("base64url")}static async load(t){let r=await Gr(P.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let o=P.resolve(t.packageRoot,".agents","skills"),n=P.resolve(t.workspaceRoot,".agents","skills");if(n!==o){let s=await Gr(n,"workspace",t.packageVersion);for(let[i,a]of s)r.set(i,a)}}return new e(r)}list(t={}){let r=t.limit??I.defaultPageSize;$r.has(r)||C(`Skill list limit must be an integer from 1 to ${I.maxPageSize}.`);let o=this.#r(t.cursor,"skills/list"),n=[...this.#e.values()].sort((c,d)=>c.uri.localeCompare(d.uri)),s=n.slice(o,o+r),i=o+s.length,a=i<n.length;return{skills:s.map(Ur),hasMore:a,...a?{nextCursor:this.#o(i,"skills/list")}:{}}}get(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/SKILL\.md$/u.exec(t),o=r?this.#e.get(r[1]):void 0;return o||C(`Unknown pm MCP skill: ${t}.`,{field:"uri"}),Ur(o)}read(t){let r=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)\/(.+)$/u.exec(t),o=r?this.#e.get(r[1]):void 0,n=r?.[2]??"",s=o&&n?o.files.get(n):void 0,i=o?.resources.find(d=>d.uri===t);(!o||!s||!i)&&C(`Unknown pm MCP skill resource: ${t}.`,{field:"uri"});let a={digest:i.digest,origin:o._meta.origin,trust:"untrusted"},c=Fr(n,s);return c!=="application/octet-stream"?{contents:[{uri:t,mimeType:c,text:s.toString("utf8"),_meta:a}]}:{contents:[{uri:t,mimeType:c,blob:s.toString("base64"),_meta:a}]}}readDirectory(t,r={}){let o=/^skill:\/\/([a-z0-9]+(?:-[a-z0-9]+)*)(?:\/(.+))?$/u.exec(t),n=o?this.#e.get(o[1]):void 0;n||C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let s=(o?.[2]??"").replace(/\/$/u,""),i=s.length>0?`${s}/`:"",a=`skill://${o[1]}`,c=new Map;for(let T of n.resources){let E=T.uri.slice(`${a}/`.length);if(!E.startsWith(i))continue;let B=E.slice(i.length),[v,...vo]=B.split("/"),Ro=`${a}/${i}${v}`,Io=n.files.get(`${i}${v}`);c.set(v,{uri:Ro,name:v,mimeType:vo.length>0?"inode/directory":Fr(v,Io)})}s.length>0&&c.size===0&&C(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??I.maxPageSize;$r.has(d)||C(`Skill directory limit must be an integer from 1 to ${I.maxPageSize}.`);let l=this.#r(r.cursor,t),p=[...c.values()].sort((T,E)=>T.uri.localeCompare(E.uri)),f=p.slice(l,l+d),_=l+f.length,g=_<p.length;return{resources:f,hasMore:g,...g?{nextCursor:this.#o(_,t)}:{}}}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="38023567-8a5b-5e25-8d71-5112f74d1894")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="619dbd55-b854-5e69-b5a5-c0bcada81629")}catch{}})();var zr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function st(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)=>st(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,st(o,`${t}.${r}`)])))}function we(e){if(e.schema!==zr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Tt(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:st(r.input,`operations[${o}].input`)})))})}async function Hr(e,t){let r=we(e);return Ct(r,t)}async function Jy(e,t){return Hr(e,async()=>{let r=[];for(let[o,n]of e.operations.entries())r.push(await t(n,o));return r})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c234be1c-35b7-5388-8a70-a012e9a34389")}catch{}})();var Vr="pm.agent-observation/v1",Kr="pm.agent-verdict/v1",Wr="pm.agent-episode/v1";function O(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function 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 Qy(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"),O(r.budget_tokens,"observation.reads.budget_tokens"),t+=r.budget_tokens,!Number.isSafeInteger(t))throw new Error("observation read ceilings exceed safe integer range.")}function Zy(e){if(e.basis!=="emitted_bytes")throw new Error("observation calibration must use emitted_bytes.");for(let r of e.samples)if(!Number.isSafeInteger(r)||r<0)throw new Error("observation calibration samples must be non-negative safe integers.");if(e.samples.length===0)throw new Error("observation calibration must include at least one sample.");if(O(e.expected_emitted_bytes,"observation.calibration.expected_emitted_bytes"),!Number.isSafeInteger(e.tolerance_bytes)||e.tolerance_bytes<0)throw new Error("observation.calibration.tolerance_bytes must be a non-negative safe integer.");let t=e.samples.reduce((r,o)=>r+o,0)/e.samples.length;if(Math.abs(t-e.expected_emitted_bytes)>e.tolerance_bytes)throw new Error("observation expected_emitted_bytes is outside the calibrated sample tolerance.")}function eb(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(M(o.id,"observation.tiers.id"),O(o.max_tokens,"observation.tiers.max_tokens"),t.has(o.id))throw new Error(`Duplicate observation tier: ${o.id}.`);if(t.add(o.id),o.max_tokens>r)throw new Error("observation tiers must be ordered from largest to smallest max_tokens.");r=o.max_tokens;let n=new Set;for(let s of o.fields){if($(s,"observation.tiers.fields"),n.has(s))throw new Error(`Duplicate observation tier field: ${s}.`);n.add(s)}}}function tb(e){if(e.schema!==Vr)throw new Error(`observation.schema must be ${Vr}.`);return M(e.id,"observation.id"),O(e.version,"observation.version"),Qy(e.reads),Zy(e.calibration),e.corpus_dependence.kind==="bounded"&&(M(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),O(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),eb(e.tiers),oe(structuredClone(e))}function qL(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 rb(e,t,r){O(r.budget_tokens,"observation request budget_tokens");let o=[];for(let[n,s]of e.tiers.entries()){o.push(s.id);let i=await t(s),a=Buffer.byteLength(R(i),"utf8"),c=Math.ceil(a/4);if(c<=Math.min(r.budget_tokens,s.max_tokens))return{status:"served",payload:i,receipt:{contract_id:e.id,contract_version:e.version,served_tier:s.id,degraded:n>0,attempted_tiers:o,emitted_bytes:a,estimated_tokens: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 $(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 Yr(e,t){let r=e;for(let o of $(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,o))return;r=r[o]}return r}function ob(e){return`/${$(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function nb(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 ib(e){if(e.schema!==Kr)throw new Error(`verdict.schema must be ${Kr}.`);M(e.id,"verdict.id"),O(e.version,"verdict.version");let t=new Set;for(let o of e.predicates){M(o.id,"verdict.predicates.id"),$(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}.`);nb(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 oe(structuredClone(e))}function sb(e,t){if(e.predicates.length===0)return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:"not_applicable",score:null,policy:"verdict_only_no_reward",reason:"no_predicates_declared",predicates:[]};let r=new Map(e.predicates.map(i=>[i.id,i])),o=e.composition.predicate_ids.map(i=>{let a=r.get(i),c=Yr(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:R(c)===R(a.expected);return{id:i,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${ob(a.path)}`,evidence_digest:ht(R(c))}}),n=o.filter(i=>i.outcome==="satisfied").length,s=e.composition.operator==="all"?n===o.length:n>0;return{contract_id:e.id,contract_version:e.version,snapshot_id:t.snapshot_id,outcome:s?"satisfied":"violated",score:n/o.length,policy:"verdict_only_no_reward",predicates:o}}function zL(e){if(e.schema!==Wr)throw new Error(`episode.schema must be ${Wr}.`);if(M(e.id,"episode.id"),O(e.version,"episode.version"),!["benchmark","evaluation","training","scale_transfer"].includes(e.mode))throw new Error("episode.mode is not supported.");if(e.task_item_ids.length===0)throw new Error("episode.task_item_ids must declare at least one pm item.");for(let t of e.task_item_ids)M(t,"episode.task_item_ids");O(e.limits.max_actions,"episode.limits.max_actions"),O(e.limits.max_observations,"episode.limits.max_observations"),O(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)$(t,"episode.observable_fields");for(let t of e.withheld_fields)$(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 tb(e.observation),ib(e.verdict),we(e.recipe),oe(structuredClone(e))}function ab(e,t,r){let o=$(t,"observation projection field"),n=e;for(let[s,i]of o.entries()){if(s===o.length-1){r!==void 0&&(n[i]=structuredClone(r));return}let a=n[i];(a===null||typeof a!="object"||Array.isArray(a))&&(n[i]={}),n=n[i]}}function cb(e,t){let r={};for(let o of t)ab(r,o,Yr(e,o));return r}async function HL(e,t){let r=[],o=0,n=0,s=!1,i,a={episode:{id:e.id,label:`pm agent environment v${e.version}`},provenance:{role:e.mode,topic:"agent-environment"}},c=await L(a,()=>t.reset(e.recipe));r.push({sequence:1,kind:"reset",state_id:c.state_id});let d=async()=>{if(s)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let p=await t.readRecordedState(),f=await rb(e.observation,async _=>cb(p.state,_.fields),{budget_tokens:e.limits.max_tokens_per_observation});return r.push({sequence:r.length+1,kind:"observation",state_id:f.receipt.served_tier??p.snapshot_id}),f},l=async(p=!1)=>{if(s&&!p)throw new Error("episode is already closed.");if(n>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");n+=1;let f=await t.readRecordedState(),_=sb(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),_};return{observe:()=>L(a,d),step:async p=>{if(s)throw new Error("episode is already closed.");if(o>=e.limits.max_actions)throw new Error("episode exceeded limits.max_actions.");o+=1;let f=await L(a,()=>t.execute(p));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>L(a,l),close:()=>i!==void 0?i:s?Promise.reject(new Error("episode is already closed.")):(s=!0,i=L(a,()=>l(!0)).then(p=>(r.push({sequence:r.length+1,kind:"close",state_id:p.snapshot_id}),{verdict:p,trajectory:oe(structuredClone(r))})).catch(p=>{throw s=!1,p}).finally(()=>{i=void 0}),i)}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1202ba19-0bcb-5478-b245-4472e361d4de")}catch{}})();var F="https://schema.unbrained.dev/pm/corpus-shape/v1";function V(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function ne(e,t){if(!Number.isSafeInteger(e)||e<0)throw new TypeError(`Corpus shape ${t} must be a non-negative safe integer`);return e}function Jr(e){if(!(typeof e!="object"||e===null||Object.isFrozen(e))){for(let t of Object.values(e))Jr(t);Object.freeze(e)}}function K(e){if(e.schema!==F)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(V(e.hierarchy_depth,"hierarchy_depth"),V(e.hierarchy_fanout,"hierarchy_fanout"),ne(e.age_span_days,"age_span_days"),V(e.history_entries_per_item,"history_entries_per_item"),ne(e.comments_per_100_items,"comments_per_100_items"),ne(e.notes_per_100_items,"notes_per_100_items"),ne(e.learnings_per_100_items,"learnings_per_100_items"),V(e.author_cardinality,"author_cardinality"),V(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 Jr(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}],W=Object.freeze({scratch:K({schema:F,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:K({schema:F,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":K({schema:F,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":K({schema:F,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":K({schema:F,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 db(){return Object.keys(W).sort().map(e=>W[e])}function lb(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(W,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(W).join(", ")}`);return W[t]}var Xr=new WeakMap;function Qr(e,t){if(e===0)return[];let r=Xr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(n=>Array.from({length:n.weight},()=>n.kind)),Xr.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 pb(e,t,r,o=42){if(ne(t,"item index"),V(r,"item count"),t>=r)throw new RangeError(`Corpus item index ${t} exceeds ${r}`);let n=Math.min(e.component_count,r),s=t%n,i=Math.floor(t/n),a=0,c=1;for(let E=0;E<e.hierarchy_depth;E+=1)a=Math.min(Number.MAX_SAFE_INTEGER,a+c),c=Math.min(Number.MAX_SAFE_INTEGER,c*e.hierarchy_fanout);let d=i%a,l=i-d,p=d===0?void 0:s+(l+Math.floor((d-1)/e.hierarchy_fanout))*n,f=Date.UTC(2026,0,1),_=e.age_span_days*864e5,g=new Date(f+(r===1?0:Math.round(t/(r-1)*_))).toISOString(),T=(t*37+o)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...p===void 0?{}:{parent:`pm-s${p.toString(36).padStart(7,"0")}`},component:s,timestamp:g,author:`pm-corpus-agent-${(t+o)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Qr(t,e),has_comment:T<e.comments_per_100_items,has_note:T<e.notes_per_100_items,has_learning:T<e.learnings_per_100_items,...e.custom_types.length>0&&t%11===0?{custom_type:e.custom_types[t%e.custom_types.length]}:{},...e.custom_statuses.length>0&&t%13===0?{custom_status:e.custom_statuses[t%e.custom_statuses.length]}:{}}}var at=class{shape;authors=new Set;components=new Set;depths=new Map;childCounts=new Map;edgeKinds={};expectedEdgeKinds={};annotations={comments:0,notes:0,learnings:0};annotationFields;planMismatches=[];itemCount=0;observedDepth=0;observedFanout=0;historyEntryCount=0;firstTimestamp=null;lastTimestamp=null;constructor(t){this.shape=t,this.annotationFields=[["comments","has_comment",t.comments_per_100_items],["notes","has_note",t.notes_per_100_items],["learnings","has_learning",t.learnings_per_100_items]]}recordMismatch(t,r){t&&this.planMismatches.push(r)}recordEdgeKinds(t,r){for(let o of r)t[o]=(t[o]??0)+1}add(t){this.itemCount+=1,this.authors.add(t.author),this.components.add(t.component),this.recordMismatch(this.depths.has(t.id),`duplicate_id:${t.id}`);let r=1;if(t.parent!==void 0){let o=this.depths.get(t.parent);this.recordMismatch(o===void 0,`parent_missing:${t.parent}`),r=(o??0)+1;let n=(this.childCounts.get(t.parent)??0)+1;this.childCounts.set(t.parent,n),this.observedFanout=Math.max(this.observedFanout,n)}this.depths.set(t.id,r),this.observedDepth=Math.max(this.observedDepth,r),this.historyEntryCount+=t.history_entry_count,this.recordMismatch(t.history_entry_count!==this.shape.history_entries_per_item,"history_entries_per_item:drift"),this.firstTimestamp=this.firstTimestamp===null||t.timestamp<this.firstTimestamp?t.timestamp:this.firstTimestamp,this.lastTimestamp=this.lastTimestamp===null||t.timestamp>this.lastTimestamp?t.timestamp:this.lastTimestamp;for(let[o,n]of this.annotationFields)this.annotations[o]+=Number(t[n]);this.recordEdgeKinds(this.edgeKinds,t.dependency_kinds),this.recordEdgeKinds(this.expectedEdgeKinds,Qr(t.index,this.shape))}finish(){let t=Math.min(this.shape.author_cardinality,this.itemCount),r=Math.min(this.shape.component_count,this.itemCount),o=[...this.planMismatches,...this.itemCount===0?["item_count:empty"]:[],...this.authors.size===t?[]:[`author_count:${this.authors.size}!=${t}`],...this.components.size===r?[]:[`component_count:${this.components.size}!=${r}`],...this.observedDepth<=this.shape.hierarchy_depth?[]:[`hierarchy_depth:${this.observedDepth}>${this.shape.hierarchy_depth}`],...this.observedFanout<=this.shape.hierarchy_fanout?[]:[`hierarchy_fanout:${this.observedFanout}>${this.shape.hierarchy_fanout}`]];for(let[i,,a]of this.annotationFields){let c=Math.floor(this.itemCount/100),d=this.itemCount%100,l=c*a+Math.max(0,a+d-100),p=c*a+Math.min(a,d),f=this.annotations[i];(f<l||f>p)&&o.push(`${i}:${f}!in[${l},${p}]`)}let n=new Set([...Object.keys(this.edgeKinds),...Object.keys(this.expectedEdgeKinds)]);for(let i of[...n].sort()){let a=this.edgeKinds[i]??0,c=this.expectedEdgeKinds[i]??0;a!==c&&o.push(`edge_kind:${i}:${a}!=${c}`)}let s=[...new Set(o)];return{shape:this.shape.name,item_count:this.itemCount,author_count:this.authors.size,component_count:this.components.size,hierarchy_depth:this.observedDepth,hierarchy_fanout:this.observedFanout,timestamp_range:{first:this.firstTimestamp,last:this.lastTimestamp},history_entry_count:this.historyEntryCount,annotations:{...this.annotations},edge_kinds:{...this.edgeKinds},matches_declaration:s.length===0,mismatches:s}}};function Zr(e){return new at(e)}function ub(e,t){let r=Zr(e);for(let o of t)r.add(o);return r.finish()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="48d03e9b-14a4-545c-8e5d-5f5f2092a113")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="6a6b2905-b6b7-5b46-b87d-8b8287e37745")}catch{}})();async function mb(){let e=$e(process.cwd(),process.env.PM_PATH);await At(e,(t,r)=>Ot(t,r,{apply_runtime_defaults:!0}))}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4534b1c9-de27-5745-88f2-641b00b94714")}catch{}})();async function fb(){await vt()}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c1cb8d82-20a6-5460-a0ff-f55312911218")}catch{}})();var eo=["lines","branches","functions","statements"];function _b(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function hb(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 gb(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)){_b(r,o);for(let n of eo){let s=hb(r,n,o[n]),i=s.total-s.covered;i>0&&t.push({file:r,metric:n,uncovered:i,...s})}}return t}import Y from"node:fs";import ct from"node:path";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="aacf5738-098d-50f9-b619-19e472b577ea")}catch{}})();var to=300*1e3,yb=3;function lD(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function pD(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.");Y.mkdirSync(e,{recursive:!0});let o=ct.join(e,r);Y.mkdirSync(o,{recursive:!0});let n=new Date;Y.utimesSync(o,n,n);let s=Y.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:Y.statSync(ct.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)),i=s.filter(d=>n.getTime()-d.mtimeMs<to),a=Math.max(0,yb-1-i.length),c=s.filter(d=>n.getTime()-d.mtimeMs>=to).slice(a).map(d=>d.name).sort((d,l)=>d.localeCompare(l));for(let d of c)Y.rmSync(ct.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import{createHash as bb}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ff60bc5b-bd85-5b3c-9a55-21e7e72477ac")}catch{}})();var dt=1;function X(e){e?.throwIfAborted()}function G(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function J(e,t,r={}){let o=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(o))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let n=e.nodes(),s=e.edges(),i=t.list();return Object.freeze({version:dt,fingerprint:bb("sha256").update(R({nodes:n,edges:s,kinds:i})).digest("hex"),created_at:new Date(o).toISOString(),nodes:n,edges:s,kinds:i})}function Tb(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function se(e){if(!Tb(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==dt)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 Ge([]);for(let n of e.kinds)t.register(n);let r=new q(e.nodes,e.edges,t),o=J(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 k(e,t){G(e.name,"adapter name");let r=G(t.workspace,"workspace");X(t.signal);let o=await e.read({...t,workspace:r});return X(t.signal),o===null?null:se(o)}async function Oe(e,t){let r=G(t.workspace,"workspace"),o=se(t.snapshot).snapshot,n=await k(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(X(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:o,expected_fingerprint:n?.snapshot.fingerprint??null}),(await k(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 Cb(e,t={}){let r=e.map(se),o=new Map;for(let i of r)for(let a of i.snapshot.kinds){let c=o.get(a.kind);if(c&&R(c)!==R(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);o.set(a.kind,a)}let n=new Ge([...o.values()].sort((i,a)=>i.kind.localeCompare(a.kind))),s=new q(new Set(r.flatMap(i=>[...i.snapshot.nodes])),r.flatMap(i=>[...i.snapshot.edges]),n);return J(s,n,t)}var ie=class{name;#e=new Map;constructor(t="memory"){this.name=G(t,"adapter name")}async read(t){X(t.signal);let r=this.#e.get(G(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){X(t.signal);let r=G(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(se(t.snapshot).snapshot))}async clear(t){X(t.signal);let r=G(t.workspace,"workspace"),o=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(o?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e47f9bb8-f98e-5159-9116-29c3e6fedfc3")}catch{}})();function ro(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Eb(e){let t=ro(e.nodeCount,"nodeCount"),r=ro(e.edgeStride??1,"edgeStride"),o=e.topology??"chain";if(!["chain","star","disconnected"].includes(o))throw new TypeError(`Unsupported relationship graph topology: ${o}`);let n=(e.kind??"related").trim(),s=(e.idPrefix??"node").trim();if(!n||!s)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let i=o==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:i,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let a=0;a<t;a+=1)yield`${s}-${a}`}},edges:{*[Symbol.iterator](){if(o!=="disconnected")for(let a=r;a<t;a+=r)yield{source:`${s}-${o==="star"?0:a-r}`,target:`${s}-${a}`,kind:n}}}}}function U(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function oo(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",o=St(),n=J(new q(["a","b"],[{source:"a",target:"b",kind:"related"}],o),o,{createdAt:"2026-01-01T00:00:00.000Z"}),s=J(new q(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],o),o,{createdAt:"2026-01-02T00:00:00.000Z"}),i=[];U(await k(e,{workspace:r})===null,"workspace must start empty"),i.push({name:"empty-read",passed:!0});let a=await Oe(e,{workspace:r,snapshot:n});U(a.disposition==="written","first sync must write"),i.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),U((await k(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),i.push({name:"read-isolation",passed:!0}),U((await Oe(e,{workspace:r,snapshot:n})).disposition==="current","identical sync must be idempotent"),i.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:s,expected_fingerprint:n.fingerprint}),U((await k(e,{workspace:r}))?.snapshot.fingerprint===s.fingerprint,"replacement must become visible"),i.push({name:"replacement-visibility",passed:!0});let c=!1;try{await e.replace({workspace:r,snapshot:n,expected_fingerprint:n.fingerprint})}catch{c=!0}return U(c,"stale compare-and-swap must fail"),i.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:s.fingerprint}),U(await k(e,{workspace:r})===null,"clear must remove the workspace"),i.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(i),clear_supported:e.clear!==void 0}}function Sb(e){return oo(new ie,e?{workspace:e}:{})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="58736688-35d0-545d-892e-e0ede7fedc1a")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d45a8203-4501-5797-a6cc-a2e7844adec9")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="f5567aa1-0268-574d-907b-38d6249538ce")}catch{}})();var lt=2,wb=["self_reported","independent_transport"];function ve(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function no(e,t,r=!1){if(!Array.isArray(e)||e.length===0)throw new TypeError(`${t} must be a non-empty string array`);return e.map((o,n)=>{let s=ae(o,`${t}[${String(n)}]`);return r?o:s})}function pt(e,t){return e===void 0?void 0:ae(e,t)}function Ab(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(([o,n])=>{if(o.length===0||o.split(".").some(s=>s.length===0))throw new TypeError(`${t} must use dot-separated own-property paths`);if(n!==null&&typeof n!="string"&&typeof n!="boolean"&&(typeof n!="number"||!Number.isFinite(n)))throw new TypeError(`${t} values must be JSON primitives`);return[o,n]});return Object.fromEntries(r)}function Ob(e,t,r,o,n,s){if(o==="refusal"){if(Ve(r)||n===void 0||s===void 0)throw new TypeError(`${e} refusal steps require a non-success exit, error code, and refusal surface`);return}if(n!==void 0||s!==void 0)throw new TypeError(`${e} only refusal steps may declare expected_error_code or expected_refusal_surface`);let i=gt(t);if(i===void 0)throw new TypeError(`${e}.args must identify a command after global flags`);let a=t[i].trim().toLowerCase();if(a==="history"){let l=yt(t.slice(i+1));l!==void 0&&(a=xe(`history ${l}`))}let c=Lt(a);if(!Ve(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=Nt(a).kind;if(o!==d)throw new TypeError(`${e} expected ${o}, but ${a} declares ${d}`)}function vb(e,t,r){if(!ve(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let o=`tasks.${t}.steps[${String(r)}]`,n=ae(e.id,`${o}.id`),s=no(e.args,`${o}.args`,!0),i=e.expected_exit_code;if(typeof i!="number"||!Number.isSafeInteger(i))throw new TypeError(`${o}.expected_exit_code must be a safe integer`);let a=e.expected_output_kind;if(a!=="refusal"&&!xt.includes(a))throw new TypeError(`${o}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!wb.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 p=no(e.required_fields,`${o}.required_fields`);if(p.some(E=>E.split(".").some(B=>B.length===0)))throw new TypeError(`${o}.required_fields must contain dot-separated own-property paths`);let f=Ab(e.expected_field_values,`${o}.expected_field_values`),_=pt(e.expected_error_code,`${o}.expected_error_code`),g=pt(e.expected_refusal_surface,`${o}.expected_refusal_surface`),T=pt(e.recovery_for,`${o}.recovery_for`);return Ob(o,s,i,c,_,g),{id:n,args:s,expected_exit_code:i,expected_output_kind:c,expected_accounting_mode:l,required_fields:p,...f?{expected_field_values:f}:{},..._?{expected_error_code:_}:{},...g?{expected_refusal_surface:g}:{},...T?{recovery_for:T}:{}}}function Rb(e,t){if(!ve(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=ae(e.id,`tasks[${String(t)}].id`),o=ae(e.description,`tasks.${r}.description`);if(!Array.isArray(e.steps)||e.steps.length===0)throw new TypeError(`tasks.${r}.steps must be a non-empty array`);let n=e.steps.map((i,a)=>vb(i,r,a)),s=new Map;for(let i of n){if(s.has(i.id))throw new TypeError(`tasks.${r} contains duplicate step id ${i.id}`);if(i.recovery_for!==void 0&&(s.get(i.recovery_for)?.expected_output_kind!=="refusal"||i.expected_output_kind==="refusal"))throw new TypeError(`tasks.${r}.${i.id} recovery_for must reference an earlier refusal and declare successful output`);s.set(i.id,i)}if(n.at(-1)?.expected_output_kind==="refusal")throw new TypeError(`tasks.${r} completed task must terminate with successful output`);for(let i of n)if(i.expected_output_kind==="refusal"&&!n.some(a=>a.recovery_for===i.id))throw new TypeError(`tasks.${r}.${i.id} refusal must have a later successful recovery_for step`);return{id:r,description:o,steps:n}}function BD(e){if(!ve(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==lt)throw new TypeError(`agent-task transcript corpus version must be ${String(lt)}`);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)=>Rb(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:lt,tasks:t}}import{createHash as io}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7163a078-d8be-5bca-813f-c941fcb8e406")}catch{}})();function so(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function VD(e,t){let r=so(t.migrationId,"migrationId"),o=so(t.author,"author"),n=Date.parse(t.timestamp);if(!Number.isFinite(n))throw new TypeError("Relationship backfill timestamp must be valid");let s=new Date(n).toISOString(),i=qe(e,void 0,t.registry),a=i.graph.nodes(),c=i.graph.edges().map(f=>{let _=io("sha256").update(JSON.stringify([r,f.kind,f.source,f.target,f.createdAt??null,f.author??null,f.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${_}`,relationshipId:`migration:${r}:${_}`,action:"add",edge:f,author:o,timestamp:s,reason:`Backfill ${r} from legacy item metadata`})}),d=io("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)),p=c.filter(f=>!l.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(p),edge_count:c.length,skipped_existing_count:c.length-p.length,duplicate_dependency_rows:i.duplicateRows.length,dangling_reference_count:i.dangling.active.length+i.dangling.legacy_terminal.length})}import*as ao from"node:module";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7a1d7194-6ff1-5365-ab64-80b47b0176d7")}catch{}})();var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ut={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"}},WD=Object.freeze(Object.keys(ut));function co(e){if(Object.hasOwn(ut,e))return ut[e]}var Ib=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function Pb(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 Mb(e){return e===void 0||e.kind==="punctuator"&&Ib.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function kb(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
31
- `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function xb(e,t,r){if(e[t]!=="/"||!Mb(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 Nb(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let n=Pb(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 Lb(e){let t=[],r=0;for(;r<e.length;){let o=kb(e,r);if(o!==void 0){r=o;continue}let n=xb(e,r,t.at(-1));if(n!==void 0){r=n;continue}let s=Nb(e,r);s.token&&t.push(s.token),r=s.next}return t}var Db=new Set(["object","block","pattern"]),$b=new Set(["const","let","var"]),Fb=new Set(["}",")","]"]),Gb=new Set(["=","(","[",",",":","?","return"]);function Ub(e,t,r){if([...r].reverse().find(n=>Db.has(n.kind))?.kind==="pattern"||r.at(-1)?.kind==="paren"&&r.at(-1)?.parameter_list)return"pattern";let o=e[t-1];return o?.kind==="identifier"&&$b.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Gb.has(o.value)?"object":"block"}function jb(e,t,r){let o=e[t];if(o.value==="{"){let i=Ub(e,t,r);return{kind:i,...i==="object"?{member_start:!0,candidates:[]}:{}}}if(o.value==="[")return{kind:"array"};if(o.value!=="(")return;let n=e[t-1],s=e[t-2];return{kind:"paren",...n?.value==="function"||s?.value==="function"?{parameter_list:!0}:{}}}function Bb(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 qb(e,t){return e[t+1]?.value===")"&&e[t+2]?.value==="=>"||e[t+1]?.value==="="}function zb(e){let t=Lb(ao.stripTypeScriptTypes(e,{mode:"strip"})),r=[],o=[];for(let[n,s]of t.entries()){let i=o.at(-1),a=Bb(i,s,t[n+1]);a&&i.candidates.push(a);let c=jb(t,n,o);if(c)o.push(c);else if(Fb.has(s.value)){let d=o.pop();d?.kind==="object"&&!qb(t,n)&&r.push(...d.candidates)}else s.value===","&&i?.kind==="object"?i.member_start=!0:i?.kind==="object"&&s.value!==":"&&(i.member_start=!1)}return r}function Hb(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
32
- `&&t.push(r+1);return t}function Vb(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 YD(e){let t=[],r=[];for(let n of[...e].sort((s,i)=>Q(s.path,i.path))){let s=Hb(n.content),i;try{i=zb(n.content)}catch(a){r.push({kind:"invalid_source",subject:n.path,detail:`${n.path} could not be parsed for recovery producers: ${String(a)}.`});continue}for(let a of i){let c=a.field,d=Vb(s,a.offset),l=co(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(ce.map(n=>[n,t.filter(s=>s.kind===n).length]));for(let n of ce)o[n]===0&&r.push({kind:"missing_kind_producer",subject:n,detail:`No source producer emits the ${n} recovery-reference kind.`});return t.sort((n,s)=>n.path!==s.path?Q(n.path,s.path):n.line!==s.line?n.line-s.line:Q(n.field,s.field)),r.sort((n,s)=>n.subject!==s.subject?Q(n.subject,s.subject):Q(n.kind,s.kind)),{ok:r.length===0,scanned_file_count:e.length,producer_count:t.length,producer_count_by_kind:o,producers:t,findings:r}}function XD(e,t){let r=[],o=(n,s)=>{if(Array.isArray(n)){n.forEach((i,a)=>o(i,[...s,String(a)]));return}if(!(typeof n!="object"||n===null))for(let[i,a]of Object.entries(n).sort(([c],[d])=>Q(c,d))){let c=co(i),d=c?.kind==="migration_hint"&&n.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,l=[a].flat();d!==void 0&&l.forEach((p,f)=>{let _="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,g=_&&typeof p=="object"&&p!==null&&!Array.isArray(p)?p[_]:p;if(typeof g!="string"||g.trim().length===0)return;let T=[...s,i,String(f)].map(E=>encodeURIComponent(E)).join("/");r.push({id:`${e}:${d.kind}:${T}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:g})}),o(a,[...s,i])}};return o(t,[]),r}function JD(e,t){let r=e.flatMap(i=>(i.owned_states??[]).map(a=>({contract:i,state:a}))),o=[],n=new Map;for(let i of t){if(n.has(i.probe_id)){o.push({kind:"duplicate_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} was supplied more than once.`});continue}n.set(i.probe_id,i)}let s=new Set(r.map(({state:i})=>i.probe_id));for(let{contract:i,state:a}of r){let 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 ${i.code}.`});continue}c.code!==i.code&&o.push({kind:"wrong_error_code",probe_id:a.probe_id,detail:`Expected ${i.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 i of t)s.has(i.probe_id)||o.push({kind:"undeclared_probe",probe_id:i.probe_id,detail:`Observation ${i.probe_id} has no catalog declaration.`});return o.sort((i,a)=>i.probe_id!==a.probe_id?i.probe_id.localeCompare(a.probe_id):i.kind.localeCompare(a.kind)),{ok:o.length===0,declared_probe_count:r.length,observed_probe_count:t.length,findings:o}}function QD(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 s=new Map;for(let c of t){if(s.has(c.id)){r.push({kind:"duplicate_observation",reference_id:c.id,detail:`Recovery reference ${c.id} was observed more than once.`});continue}s.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=s.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 i=ce.map(c=>{let d=e.filter(p=>p.kind===c),l=d.filter(p=>!n.has(p.id)).map(p=>s.get(p.id)).filter(p=>p!==void 0);return{kind:c,declared:d.length,observed:l.length,passed:d.filter(p=>{let f=s.get(p.id);return!n.has(p.id)&&f?.reachable===!0&&f.semantics===p.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=i.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:i,findings:r}}function Kb(e,t){let r=new Map(ce.map(s=>[s,new Set]));for(let s of t)r.get(s.kind).add(s.value);let o=ce.map(s=>({kind:s,source_producers:e.producer_count_by_kind[s],runtime_values:r.get(s).size})),n=o.filter(({source_producers:s,runtime_values:i})=>s>0&&i===0).map(({kind:s})=>s);return{ok:e.ok&&n.length===0,source_producer_count:e.producer_count,runtime_value_count:o.reduce((s,{runtime_values:i})=>s+i,0),coverage_by_kind:o,missing_runtime_kinds:n}}var ZD=Kb;(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2b2197f3-7203-52c8-9cc7-f714b33a9306")}catch{}})();var t1=16,Wb=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"]),lo=18,po=Object.freeze([...Wb,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function r1(e,t=lo){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function o1(e,t=po){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 mt(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 n1(e,t,r){let o=new Map(e.map(l=>[l.code,l.canonical_code??l.code])),n=new Map,s=0,i=0;for(let l of e){let p=mt(n,l.canonical_code??l.code);for(let f of l.owned_states??[])p.kinds.add("owned_state"),p.probeIds.add(f.probe_id)}for(let l of t){let p=o.get(l.error_code);if(p===void 0)continue;s+=1;let f=mt(n,p);f.kinds.add("closed_domain"),f.probeIds.add(l.probe_id)}for(let l of r){let p=o.get(l.error_code);if(p===void 0)continue;i+=1;let f=mt(n,p);f.kinds.add("grammar"),f.probeIds.add(l.probe_id)}let a=e.map(l=>{let p=l.canonical_code??l.code,f=n.get(p),_=[...f.probeIds].sort();return{code:l.code,canonical_code:p,disposition:_.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:_}}).sort((l,p)=>l.code<p.code?-1:1),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:s,grammar_probe_count:i,uncovered_error_codes:c,rows:a}}function i1(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: ${lo}`,`- Required executable canonical codes: ${po.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
33
- `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d252409d-e33e-5c9e-9671-789f0ee87312")}catch{}})();function Yb(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 Xb(e){return[e.exit_code!==ue.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 ${ue.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."},...Yb(e)]}function c1(e){let t=[],r=new Set,o=0;e.length===0&&t.push({code:"empty_corpus",probe_id:"corpus",detail:"At least one real refusal observation is required."});for(let n of e){if(r.has(n.probe_id)){t.push({code:"duplicate_probe",probe_id:n.probe_id,detail:`${n.probe_id} was supplied more than once.`});continue}r.add(n.probe_id);let s=t.length;for(let i of Xb(n))i!==void 0&&t.push(i);t.length===s&&(o+=1)}return t.sort((n,s)=>n.probe_id!==s.probe_id?n.probe_id.localeCompare(s.probe_id):n.code.localeCompare(s.code)),{ok:t.length===0,probe_count:r.size,closed_probe_count:o,closure_fraction:r.size===0?0:o/r.size,findings:t}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="39b4e1fe-a34a-5ffc-9447-eaf8c46863c7")}catch{}})();var uo="not-a-declared-action";function Jb(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 de(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function g1(e=je.filter(t=>Rt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>de(r)));return e.flatMap(r=>r.slots.flatMap((o,n)=>{if(!o.required)return[];let s=r.command.split(" "),i=de(r.command),a=s.length>1&&t.has(i)?s.map(de).join("--"):i,c=Z(r.command).flatMap(l=>l.required?[l.flag,...l.value_name?["example"]:[]]:[]),d=Ue.some(l=>l.command===r.command);return[{probe_id:`required-argument-${a}-${de(o.name)}`,command:r.command,refusal_args:[...s,...r.slots.slice(0,n).map(l=>Jb(r.command,l)),...c],recovery_args:[...s,"--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 Qb(e){switch(N(e)){case"assurance":case"workspace snapshot":return Ue.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Ne;case"merge":return Le;case"plan":return Ke;case"profile":return We;case"schema":return Dt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function y1(e=je){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-${de(t)}`,command:t,refusal_args:[...r,uo],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:uo,allowed_values:[...Qb(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function Zb(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((o,n)=>o===r[n])}function eT(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&&!Zb(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 b1(e,t){let r=new Map(e.map(i=>[i.probe_id,i])),o=new Map(t.map(i=>[i.probe_id,i])),n=[...e.flatMap(i=>eT(i,o.get(i.probe_id))),...t.filter(i=>!r.has(i.probe_id)).map(i=>({code:"unexpected_refusal_probe",probe_id:i.probe_id,detail:`${i.probe_id} has no declared grammar refusal contract.`}))];n.sort((i,a)=>i.probe_id.localeCompare(a.probe_id)||i.code.localeCompare(a.code));let s=new Set(n.map(({probe_id:i})=>i));return{ok:n.length===0,probe_count:e.length,closed_probe_count:e.filter(({probe_id:i})=>!s.has(i)).length,findings:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d3795bc4-fbe5-5ca4-bc90-b72a2d469dc7")}catch{}})();var ft=[{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 C1(){return ft.map(e=>({...e}))}function tT(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 E1(e){let t=new Map(e.map(n=>[n.probe_id,n])),r=[],o=0;for(let n of ft){let s=t.get(n.probe_id);if(s===void 0){r.push({code:"missing_probe",probe_id:n.probe_id,detail:"No runtime observation was supplied for this contract."});continue}let i=tT(n,s);r.push(...i),i.length===0&&(o+=1)}return r.sort((n,s)=>n.probe_id.localeCompare(s.probe_id)||n.code.localeCompare(s.code)),{ok:r.length===0,probe_count:ft.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]="9df3f350-83bd-524a-92df-b4011cdcea62")}catch{}})();var Re,rT=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 oT(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=rT[N(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(N(e))?"linked-file-path":["comments","notes","learnings"].includes(N(e))?"entry-file-input":"plan-definition-file"}function Ie(){if(Re!==void 0)return Re;let e=ee.filter(({command:n})=>Be(n)).flatMap(({command:n,family:s})=>It(n,Z(n)).map(i=>({command:n,family:s,concept:oT(n,i.flag),flag:i.flag,aliases:Object.freeze([...i.aliases??[]]),value_kind:i.repeatable?"list":i.flag==="--limit"?"number":i.value_type}))),t=new Set(e.flatMap(n=>n.aliases.map(s=>`${n.command}:${s}`))),r=e.filter(n=>!t.has(`${n.command}:${n.flag}`)),o=new Map;for(let n of r){let s=o.get(n.concept)??new Set;s.add(n.value_kind),o.set(n.concept,s)}return Re=Object.freeze(r.map(n=>Object.freeze({...n,concept:o.get(n.concept)?.size===1?n.concept:`${n.concept}@${n.command}`}))),Re}function R1(){return Object.freeze(Ie().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var mo=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:104,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:36,events:34,"history-attest":23,"history-redact":27,"history-repair":27,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:32,notes:36,learnings:32,files:41,docs:32,deps:32,plan:111,test:58,"test-all":41,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:40,release:25,"start-task":24,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),nT=1,fo=Object.freeze(Object.fromEntries(Object.entries({...mo,...Object.fromEntries(ke.flatMap(({alias:e,canonical:t})=>{let r=mo[e];return r===void 0?[]:[[t,r]]}))}).map(([e,t])=>[e,t+nT])));function _o(){let e=new Map(Object.keys(fo).map(t=>[t,0]));for(let{command:t}of Ie())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(fo).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function iT(e,t,r){for(let o of e)for(let n of o.aliases){let s=t.get(`${o.command}:${n}`);s===void 0||s.flag===o.flag||r.push({code:"alias_collision",command:o.command,detail:`${n} aliases ${o.flag} but is canonical for ${s.flag}.`})}}function sT(e,t,r){let o=new Set(t.map(({command:n})=>n));for(let n of e.keys())o.has(n)||r.push({code:"missing_budget",command:n,detail:`${n} has canonical flags but no persisted budget.`});for(let n of t){let s=e.get(n.command)??0;s===0&&r.push({code:"stale_budget",command:n.command,detail:`${n.command} has a persisted budget but no canonical flags.`}),!(s<=n.maximum)&&r.push({code:"budget_exceeded",command:n.command,detail:`${s} canonical flags exceed the ratcheted maximum ${n.maximum}.`})}}function aT(e,t,r){let o=new Map(e.map(n=>[`${n.command}:${n.flag}`,n]));for(let n of t){let s=`${n.command}:${n.canonical_flag}`,i=o.get(s);if(!i){r.push({code:"removed_canonical_spelling",command:n.command,detail:`${n.canonical_flag} disappeared from the executable spelling inventory.`});continue}let a=new Set([i.flag,...i.aliases]);for(let 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 I1(e=Ie(),t=_o(),r=[]){let o=[],n=new Map,s=new Map,i=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=s.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}.`}):s.set(c.concept,c.value_kind);let p=i.get(c.concept);p!==void 0&&p!==c.flag?o.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${p} and ${c.flag}.`}):i.set(c.concept,c.flag)}return iT(e,n,o),sT(a,t,o),aT(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 P1(){let e=Ie(),t=_o(),r=new Map(t.map(({command:o})=>[o,"unknown"]));for(let{command:o,family:n}of e)r.set(o,n);return["# Generated flag lexicon budgets","","This file is generated by `listPmFlagLexicon()`. Compatibility aliases do not consume canonical budget.","","| Command | Capability family | Canonical flags | Maximum |","| --- | --- | ---: | ---: |",...t.map(({command:o,current:n,maximum:s})=>{let i=r.get(o);return`| \`${o}\` | ${i} | ${n} | ${s} |`}),""].join(`
34
- `)}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3f3a5dca-8370-52d7-b279-dc6f9f0aeadf")}catch{}})();function k1(e){return e}function x1(e){return e}function N1(e){return e}function L1(e){return e}function D1(e){return e}function $1(e){return e}function F1(e){return e}function G1(e){return e}function U1(e){return e}function j1(e){return e}function B1(e){return e}function q1(e){return e}function z1(e){return e}function H1(e){return{handled:!0,result:e}}function V1(){return{handled:!1}}function K1(e){return e}function W1(e){return e}function Y1(e){return e}function X1(e){return e}function J1(e){return e}function Q1(e){return e}function Z1(e){return e}function e$(e){return e}function t$(e){return e}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="68ca9ab1-91e0-5020-859e-fc1f1f6dcc56")}catch{}})();function cT(e={},t={}){return new _e(t).extension(void 0,{...e,migrate:!0})}function dT(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]="ce91f520-088c-5a77-9194-78a36c965ff6")}catch{}})();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="604d7dcb-9fea-5631-8a72-b2a7ff3278f8")}catch{}})();function x(e){if(typeof e!="string"||!Et(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function lT(e){let t=x(e.window_start),r=x(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(o=>typeof o!="string"||o.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function pT(e,t,r,o){let n=new Map(t.map(i=>[i,[]])),s=new Set;for(let i of e){if(typeof i.id!="string"||i.id.trim().length===0||s.has(i.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");s.add(i.id);let a=n.get(i.family);if(!a||!["success","failure","pending"].includes(i.outcome)||i.cause!==void 0&&(!["product","infrastructure","unknown"].includes(i.cause)||i.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let c=x(i.started_at);if(i.repaired_at!==void 0&&(x(i.repaired_at)<c||i.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");c>=r&&c<o&&a.push(i)}return n}function T$(e,t){let{start:r,end:o}=lT(t),n=[...pT(e,t.families,r,o)].map(([s,i])=>{let a=i.filter(_=>_.outcome==="failure"),c=i.filter(_=>_.outcome!=="pending").length,d=c===0?null:a.length/c,l=a.filter(_=>_.repaired_at!==void 0&&x(_.repaired_at)<o),p={product:0,infrastructure:0,unknown:0};for(let _ of a)p[_.cause??"unknown"]+=1;let f=[];return c<t.min_completed_attempts&&f.push("insufficient_completed_attempts"),d!==null&&d>t.max_failure_rate&&f.push("failure_rate"),{family:s,attempts:i.length,completed:c,failed:a.length,pending:i.length-c,failure_rate:d,affected_days:[...new Set(a.map(_=>new Date(x(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(x(_.repaired_at)-x(_.started_at))/6e4).sort((_,g)=>_-g),unresolved:a.length-l.length,causes:p,violations:f,ok:f.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(o).toISOString(),ok:n.every(s=>s.ok),families:n}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="773ad2b6-326e-5483-bdce-a377f935cb31")}catch{}})();function le(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function uT(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!le(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let o=new Set(r.identities);if(o.size!==r.identities.length||[...o].some(n=>!le(n)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,o)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function mT(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let o of e){if(o===null||typeof o!="object"||!le(o.identity)||r.has(o.identity)||!le(o.reason)||!le(o.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let n=o.missing_from;if(!Array.isArray(n)||n.length===0||n.length>=t.length||new Set(n).size!==n.length||[...n].some(s=>!t.includes(s)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(o.identity,o)}return r}function E$(e,t=[]){let r=uT(e),o=[...r.keys()].sort(),n=mT(t,o),s=[...new Set([...r.values()].flatMap(d=>[...d]))].sort(),i=[],a=new Set;for(let d of s){let l=o.filter(_=>!r.get(_).has(d));if(l.length===0)continue;let p=n.get(d),f=p!==void 0&&JSON.stringify([...p.missing_from].sort())===JSON.stringify(l);f&&a.add(d),i.push({identity:d,present_in:o.filter(_=>r.get(_).has(d)),missing_from:l,disposition:f?{reason:p.reason,evidence:p.evidence}:null})}let c=[...n.keys()].filter(d=>!a.has(d)).sort();return{schema:"pm-artifact-ledgers/1",ok:i.every(d=>d.disposition!==null)&&c.length===0,counts:Object.fromEntries(o.map(d=>[d,r.get(d).size])),findings:i,stale_exceptions:c}}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="14b66b71-90c1-5a6b-96cc-af2694079048")}catch{}})();import{createHash as go,createHmac as fT,randomBytes as _T,timingSafeEqual as hT}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="98283845-5c48-5901-b54c-c8cc8138427b")}catch{}})();var sF="dev.unbrained.pm/progressive-tool-discovery",aF=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),gT=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),j=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),yT=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),yo={core:0,standard:1,full:2,internal:3},bo=Object.freeze(["core","standard","full"]),bT=new Set(["core","standard","full","custom"]),To=new Set(ee.map(({family:e})=>e)),TT=_T(32);function Me(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 Co(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 Eo(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 So(e){if(e!==void 0&&typeof e!="boolean")throw new b("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function wo(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new b("pm tool discovery options must be an object.",64)}function CT(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 cF(e){if(wo(e),e.family!==void 0&&(typeof e.family!="string"||!To.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"||!bo.includes(e.tier)))throw new b("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Me(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:Co(e.limit)}:{},...e.cursor!==void 0?{cursor:Me(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:So(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:Eo(e.outputBudget)}:{}}}function ET(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 ST(e,t){let r=pe(e);if(r.length===0)return 0;let o=new Set(pe(t)),n=r.filter(i=>o.has(i)).length,s=t.toLowerCase().includes(e.toLowerCase())?.25:0;return Math.min(1,n/r.length+s)}function wT(e,t){let r=pe(e);if(r.length===0)return 0;let o=t.toLowerCase(),n=pe(t),s=r.filter(a=>n.some(c=>c.startsWith(a)||a.startsWith(c))).length,i=o.includes(e.toLowerCase())?.2:0;return Math.min(1,s/r.length+i)}function ho(e){return go("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function Ao(e,t,r){return fT("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function AT(e,t,r){let o={version:1,offset:t,signature:Ao(e,t,r)};return Buffer.from(JSON.stringify(o),"utf8").toString("base64url")}function OT(e,t,r,o){if(e===void 0)return 0;try{let n=JSON.parse(Buffer.from(e,"base64url").toString("utf8")),s=n.offset;if(n.version!==1||typeof s!="number"||!Number.isInteger(s)||s<0||s>r||typeof n.signature!="string")throw new Error("cursor fields do not match the request");let i=Buffer.from(Ao(t,s,o),"base64url"),a=Buffer.from(n.signature,"base64url");if(a.length!==i.length||!hT(a,i))throw new Error("cursor signature does not match the request");return s}catch(n){throw new b("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(n)})}}function _t(e,t,r){return{value:ET(e),weight:t,available:r!=="unavailable",source:r}}function Pe(e,t,r){return _t(e??t,r,e===void 0?"computed":"host")}function vT(e,t,r){let o=Object.hasOwn(fe,e.name)?fe[e.name]:"help",n=ze(o),s=`${e.name} ${e.description} ${o} ${n}`,i=ST(t,s),a=new Set(pe(t)),c={lexical:_t(i,j.lexical,"computed"),semantic:Pe(e.signals?.semantic,wT(t,s),j.semantic),graph:Pe(e.signals?.graph,a.has(n)||a.has(o)?1:0,j.graph),permission:_t(1,j.permission,"authorization"),freshness:Pe(e.signals?.freshness,1,j.freshness),usage:Pe(e.signals?.usage,gT.includes(e.name)?1:0,j.usage)},d=Object.values(c).reduce((l,p)=>l+p.value*p.weight,0);return{name:e.name,description:e.description,command:o,tier:He(o),family:n,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function RT(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"||!bo.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"||!To.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"||!bT.has(e.profile)))throw new b("pm tool discovery profile must be core, standard, full, or custom.",64)}function IT(e){let t=Me(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Me(e.cursor===void 0?"":e.cursor,"cursor");let r=Co(e.limit===void 0?10:e.limit),o=Eo(e.outputBudget===void 0?1200:e.outputBudget);return RT(e),{query:t,includeSchema:So(e.includeSchema),limit:r,budget:o,maximumTier:yo[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function Oo(e,t,r){let o=r??e.tools.reduce((i,a,c)=>i+(c===0?0:1)+Buffer.byteLength(JSON.stringify(a),"utf8"),0),n={...e,tools:[]},s=0;for(let i=0;i<4;i+=1){let a=Buffer.byteLength(JSON.stringify({...n,token_cost:{estimated_tokens:s,budget:t,within_budget:!0}}),"utf8"),c=Math.ceil((a+o)/4);if(c===s)break;s=c}return s}function PT(e,t,r){return e.filter(o=>o.authorized!==!1).map(o=>vT(o,r.query,r.includeSchema)).filter(o=>o.tier!=="internal"&&yo[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 MT(e,t,r){if(t==="unbounded")return[...e];let o=[],n=0;for(let[s,i]of e.entries()){let a=n+(s===0?0:1)+Buffer.byteLength(JSON.stringify(i),"utf8");if(Oo(r(s+1),t,a)>t)break;o.push(i),n=a}return o}function dF(e,t={}){CT(e),wo(t);let r=IT(t),o=t.cursorIntegrityKey??TT,n=PT(e,t,r),s=ho({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:n}),i=OT(t.cursor,s,n.length,o),a=n.slice(i,i+r.limit),c=[];r.includeSchema||c.push({name:"input_schema",reason:"compact_projection",restore_with:"Set includeSchema=true."}),i+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:j},cache:{key:ho({fingerprint:s,cursorIntegrityKey:go("sha256").update(o).digest("hex"),limit:r.limit,offset:i,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:yT}},l=(g,T=g.length)=>{let E=i+T,B=E<n.length,v=[...c];return T<a.length&&v.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[...g],returned:T,has_more:B,...B?{next_cursor:AT(s,E,o)}:{},omission_receipt:{has_omissions:v.length>0,omitted:v}}},p=g=>{let T=l(g),E=Oo(T,r.budget);return{...T,token_cost:{estimated_tokens:E,budget:r.budget,within_budget:r.budget==="unbounded"||E<=r.budget}}},f=MT(a,r.budget,g=>l([],g)),_=p(f);if(a.length>0&&f.length===0){let g=p([a[0]]).token_cost.estimated_tokens;throw new b(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${g}.`,64,{required:String(g)})}if(r.budget!=="unbounded"&&_.token_cost.estimated_tokens>r.budget)throw new b(`pm tool discovery outputBudget is too small; at least ${_.token_cost.estimated_tokens} estimated tokens are required for this page.`,64,{required:String(_.token_cost.estimated_tokens)});return _}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="92de6b54-8d32-5394-964c-854d01cea810")}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]="d914ebc9-d578-50a5-8508-9818543bf1f3")}catch{}})();export{tR as ACTIONABILITY_ORDERING_KINDS,Yc as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,yc as ACTIVITY_FLAG_CONTRACTS,Yn as AGENT_PROVENANCE_DIMENSIONS,ra as AGGREGATE_FLAG_CONTRACTS,Ba as APPEND_FLAG_CONTRACTS,HM as ASSURANCE_ACTIONS,VM as ASSURANCE_DECLARATION_KINDS,rP as ASSURANCE_DOCUMENT_VERSION,cc as ASSURANCE_FLAG_CONTRACTS,oP as ASSURANCE_GATE_TRIGGERS,nP as ASSURANCE_MEASUREMENT_SOURCE_KINDS,YP as ASSURANCE_PRESET_IDS,QI as AssuranceEvaluationRefusalError,JI as AssuranceMutationRefusalError,ZI as AssuranceSourceResolutionError,Nn as BASELINE_ITEM_FORMAT_VERSION,eI as BOUNDARY_FIXTURE_CAPTURE_SOURCES,xR as BRIEF_LIST_FIELDS,Jn as BUILTIN_AGENT_PROVENANCE_ADAPTERS,W as BUILTIN_CORPUS_SHAPES,Xn as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,ln as BUILTIN_ITEM_TYPE_VALUES,Ht as BUILTIN_PROFILES,Mw as BUILTIN_RELATIONSHIP_KINDS,Vc as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,gc as CALENDAR_FLAG_CONTRACTS,qa as CLAIM_FLAG_CONTRACTS,Fd as CLOSE_ACTION_OPTION_KEYS,Ua as CLOSE_FLAG_CONTRACTS,ja as CLOSE_MANY_FLAG_CONTRACTS,Ya as CLOSE_TASK_FLAG_CONTRACTS,oa as COMMENTS_FLAG_CONTRACTS,fC as COMMON_MUTATION_COMMAND_OPTION_KEYS,Pc as COMPLETION_FLAG_CONTRACTS,hn as CONFIDENCE_TEXT_VALUES,ya as CONFIG_FLAG_CONTRACTS,Kc as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,P0 as CONTEXT_EVALUATION_METRIC_NAMES,Tc as CONTEXT_FLAG_CONTRACTS,YS as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,Bt as CONTEXT_OUTPUT_VALUES,L0 as CONTEXT_PACKING_PROFILES,E0 as CONTEXT_RECENCY_EPOCH,O0 as CONTEXT_RELEVANCE_SERVICE,w0 as CONTEXT_RELEVANCE_SIGNAL_NAMES,F0 as CONTEXT_SIGNAL_SET_VERSION,$0 as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,G0 as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,FS as CONTEXT_USAGE_LIMITS,Ic as CONTRACTS_FLAG_CONTRACTS,mc as COPY_FLAG_CONTRACTS,pd as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,md as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,ud as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,DT as CREATE_DIRECT_CLOSE_REASON_DEFAULT,dc as CREATE_FLAG_CONTRACTS,ZC as CURRENT_HISTORY_HASH_ALGORITHM,gw as CURRENT_HISTORY_ITEM_HASH_VERSION,bw as CURRENT_HISTORY_RECORD_HASH_VERSION,Ln as CURRENT_ITEM_FORMAT_VERSION,q0 as ContextSignalStore,GS as ContextUsageValidationError,_0 as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,sk as DEFAULT_CHILD_SAMPLE_LIMIT,kR as DEFAULT_COMPACT_LIST_FIELDS,LO as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Rf as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,HP as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,s0 as DEFAULT_TERMINAL_TRANSITION_POLICY,K0 as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,sI as DEFECT_ESCAPE_CLASSES,aI as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ha as DELETE_FLAG_CONTRACTS,mn as DEPENDENCY_KIND_VALUES,Sc as DEPS_FLAG_CONTRACTS,aa as DOCS_FLAG_CONTRACTS,ic as DUPLICATES_FLAG_CONTRACTS,SM as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,pI as DefectRecurrencePolicyParseError,Ac as EVAL_FLAG_CONTRACTS,Cf as EVAL_METRIC_NAMES,Af as EVAL_QUERY_SET_CONTRACT,Of as EVAL_QUERY_SET_EXAMPLE,wf as EVAL_QUERY_SET_SCHEMA_ID,bc as EVENTS_FLAG_CONTRACTS,Ja as EVENT_FLAG_CONTRACTS,Do as EXECUTABLE_COMMAND_ALIASES,ue as EXIT_CODE,Ia as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ra as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,Da as EXTENSION_ADOPT_FLAG_CONTRACTS,$k as EXTENSION_CAPABILITIES,NT as EXTENSION_CAPABILITY_CONTRACT,kT as EXTENSION_CAPABILITY_CONTRACT_VERSION,xT as EXTENSION_CAPABILITY_LEGACY_ALIASES,Ui as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,La as EXTENSION_CATALOG_FLAG_CONTRACTS,Pa as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,va as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Na as EXTENSION_DOCTOR_FLAG_CONTRACTS,Oa as EXTENSION_EXPLORE_FLAG_CONTRACTS,ba as EXTENSION_FLAG_CONTRACTS,Ca as EXTENSION_INIT_FLAG_CONTRACTS,wa as EXTENSION_INSTALL_FLAG_CONTRACTS,ka as EXTENSION_MANAGE_FLAG_CONTRACTS,Ma as EXTENSION_MIGRATE_FLAG_CONTRACTS,Fk as EXTENSION_POLICY_MODES,Gk as EXTENSION_POLICY_SURFACES,xa as EXTENSION_RELOAD_FLAG_CONTRACTS,jk as EXTENSION_SANDBOX_PROFILES,Ta as EXTENSION_SCOPE_FLAG_CONTRACTS,Uk as EXTENSION_TRUST_MODES,Aa as EXTENSION_UNINSTALL_FLAG_CONTRACTS,SI as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,CI as EXTERNAL_DEPENDENCY_SOURCE_KIND,EI as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,pv as ExtensionCommandError,sa as FILES_FLAG_CONTRACTS,fc as FOCUS_FLAG_CONTRACTS,oc as GC_FLAG_CONTRACTS,$R as GET_DEPTH_INPUT_VALUES,DR as GET_DEPTH_VALUES,Cc as GET_FLAG_CONTRACTS,ea as GLOBAL_FLAG_CONTRACTS,nu as GRAPH_DURABLE_CACHE_MIN_ITEMS,ou as GRAPH_DURABLE_CACHE_VERSION,wc as GRAPH_FLAG_CONTRACTS,MR as GRAPH_QUERY_DEFAULTS,Ne as GRAPH_SUBCOMMAND_VALUES,Ec as GUIDE_FLAG_CONTRACTS,sc as HEALTH_FLAG_CONTRACTS,ua as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,jP as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,JM as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,ma as HISTORY_COMPACT_FLAG_CONTRACTS,pi as HISTORY_EVENT_CLASSIFICATION_VERSION,ca as HISTORY_FLAG_CONTRACTS,JC as HISTORY_HASH_ALGORITHMS,SO as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,la as HISTORY_REDACT_FLAG_CONTRACTS,pa as HISTORY_REPAIR_FLAG_CONTRACTS,jl as INIT_AGENT_GUIDANCE_MODE_VALUES,ga as INIT_FLAG_CONTRACTS,$a as INSTALL_FLAG_CONTRACTS,iM as IN_PROGRESS_WORK_DETAIL_LIMIT,_n as ISSUE_SEVERITY_VALUES,pc as ITEM_COMPLETE_FLAG_CONTRACTS,fM as ITEM_LATEST_TIMESTAMP_FIELDS,LT as ITEM_METADATA_KEY_ORDER,lc as ITEM_MUTATE_FLAG_CONTRACTS,uc as ITEM_REOPEN_FLAG_CONTRACTS,Ds as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,Ls as ITEM_REVISION_CONFLICT_CODE,aM as ITEM_SCALAR_MISSING_VALUE,pn as ITEM_TYPE_VALUES,mM as ITEM_UNION_COLLECTION_FIELDS,B0 as JsonFileContextSignalStoreAdapter,ia as LEARNINGS_FLAG_CONTRACTS,QC as LEGACY_HISTORY_HASH_ALGORITHM,ap as LINKED_ARTIFACT_NOTE_CONFLICT_MODES,qu as LINKED_TEST_ENV_NAME_PATTERN,zu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Bu as LINKED_TEST_PROTECTED_ENV_KEYS,Hu as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,zc as LIST_COMMANDER_STRING_OPTION_CONTRACTS,NR as LIST_COMMAND_DEFAULT_PROJECTIONS,qk as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,ta as LIST_FILTER_FLAG_CONTRACTS,MI as LIST_SORT_FIELDS,kI as LIST_SORT_ORDER_VALUES,ui as MAINTENANCE_HISTORY_OPERATIONS,ik as MAX_CHILD_PROJECTION_ITEMS,tI as MAX_WAIVER_NOTICE_DAYS,BT as MAX_WORKFLOW_POLICIES,qT as MAX_WORKFLOW_POLICY_TERMS,Xa as MEET_FLAG_CONTRACTS,Ok as MERGE_DRIVER_ARTIFACT_VALUES,da as MERGE_FLAG_CONTRACTS,Le as MERGE_SUBCOMMAND_VALUES,Ik as MUTATION_EVENT_WIRE_BUDGET,ie as MemoryRelationshipGraphAdapter,Wc as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,vc as NEXT_FLAG_CONTRACTS,zm as NEXT_OUTPUT_VALUES,f0 as NEXT_RANKING_POLICIES,na as NOTES_FLAG_CONTRACTS,gR as OutputEnvelopeFitError,Ea as PACKAGE_FLAG_CONTRACTS,Sa as PACKAGE_INIT_FLAG_CONTRACTS,Wa as PAUSE_TASK_FLAG_CONTRACTS,$d as PLAN_CREATE_METADATA_PARAMETER_KEYS,ha as PLAN_FLAG_CONTRACTS,Xs as PLAN_SHOW_DEPTH_VALUES,Ke as PLAN_SUBCOMMANDS,ef as PLAN_TEMPLATE_NAMES,wb as PM_AGENT_TASK_ACCOUNTING_MODES,lt as PM_AGENT_TASK_TRANSCRIPT_VERSION,ko as PM_BULK_LIFECYCLE_COMMAND_ALIASES,ns as PM_CLI_ERROR_DETAILS_LIMITS,ls as PM_CLI_EXPECTED_ERROR_NAME,zR as PM_CLI_GRAMMAR_CONTRACT,GR as PM_CLI_GRAMMAR_NOUNS,Yo as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,UR as PM_CLI_SHARED_VERBS,Lo as PM_COMMAND_ALIAS_CONTRACTS,ee as PM_COMMAND_CAPABILITY_CONTRACTS,Rt as PM_COMMAND_DESTINATION_CONTRACTS,VI as PM_COMMAND_EXIT_CONTRACTS,HI as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,wi as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,BI as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,je as PM_COMMAND_POSITIONAL_CONTRACTS,ll as PM_COMMAND_VISIBILITY_CONTRACTS,LP as PM_COMPLETE_LIST_FINDING_CODES,dR as PM_CONTEXT_INTENTS_FILE,XS as PM_CONTEXT_INTENT_CONTRACTS,Mo as PM_CONTEXT_OPS_COMMAND_ALIASES,Ho as PM_CORE_COMMAND_NAMES,F as PM_CORPUS_SHAPE_SCHEMA,Jo as PM_DEPRECATED_TOOL_ACTIONS,bi as PM_DIAGNOSTIC_DEGRADATION_STEPS,Ti as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,yi as PM_DIAGNOSTIC_OUTPUT_CLASSES,Qo as PM_DISCOVERABLE_TOOL_ACTIONS,Wr as PM_EPISODE_SCHEMA,UI as PM_ERROR_CODE_CATALOG,DI as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,eo as PM_EXACT_COVERAGE_METRICS,Go as PM_EXTENSION_CAPABILITY_CONTRACTS,Vo as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,jo as PM_EXTENSION_POLICY_MODE_CONTRACTS,zo as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,qo as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Uo as PM_EXTENSION_SERVICE_NAME_CONTRACTS,Bo as PM_EXTENSION_TRUST_MODE_CONTRACTS,Pi as PM_GENERIC_REFUSAL_GUIDANCE,OP as PM_GITATTRIBUTES_END,AP as PM_GITATTRIBUTES_START,RP as PM_GITATTRIBUTES_V2_END,vP as PM_GITATTRIBUTES_V2_START,yl as PM_GITIGNORE_END,gl as PM_GITIGNORE_START,t0 as PM_HISTORY_ATTESTATION_CONTRACT,Po as PM_HISTORY_COMMAND_ALIASES,HC as PM_HISTORY_OPERATION_ALIASES,KC as PM_HISTORY_OPERATION_CONTRACT,VC as PM_HISTORY_OPERATION_PATTERNS,Wo as PM_ITEM_ACTION_SUBCOMMANDS,qC as PM_ITEM_HISTORY_OPERATIONS,ot as PM_MCP_APPS_EXTENSION,Mr as PM_MCP_APPS_SERVER_CAPABILITY,Se as PM_MCP_APPS_SPEC_VERSION,Nr as PM_MCP_APP_CONTRACTS,xr as PM_MCP_APP_MIME_TYPE,gT as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,nL as PM_MCP_HTTP_PROTOCOL_VERSION,Ug as PM_MCP_INPUT_REQUEST_METHODS,or as PM_MCP_LEGACY_PROTOCOL_VERSIONS,rr as PM_MCP_LOG_LEVELS,w as PM_MCP_META_KEYS,sF as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,aF as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,_l as PM_MCP_PROMPT_CONTRACTS,z as PM_MCP_PROTOCOL_VERSION,fl as PM_MCP_RESOURCE_CONTRACTS,it as PM_MCP_SKILLS_DRAFT_REVISION,Lr as PM_MCP_SKILLS_EXTENSION,Vy as PM_MCP_SKILLS_SERVER_CAPABILITY,I as PM_MCP_SKILL_LIMITS,Ce as PM_MCP_SUBSCRIPTION_ID_META_KEY,te as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,XN as PM_MCP_TASKS_EXTENSION,Jg as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,xE as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,fs as PM_MUTATION_ACTION_CONTRACTS,ke as PM_NAMESPACED_COMMAND_ALIASES,Vr as PM_OBSERVATION_SCHEMA,gi as PM_OUTPUT_BUDGET_CLASSES,hi as PM_OUTPUT_DEGRADATION_STEPS,xt as PM_OUTPUT_ENVELOPE_KINDS,Ft as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Ko as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,$t as PM_PACKAGE_RESOURCE_KINDS,Ue as PM_POSITIONAL_ACTION_CONTRACTS,Hd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,qd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,lS as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,AS as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,cS as PM_READ_OUTPUT_DIMENSIONS,dS as PM_READ_OUTPUT_OPTION_FLAGS,oS as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,rS as PM_READ_OUTPUT_SESSION_MIN_TOKENS,IE as PM_READ_OUTPUT_SURFACES,pS as PM_READ_OUTPUT_SURFACE_CONTRACTS,ZE as PM_READ_OUTPUT_TAIL_RETENTION_POLICIES,kE as PM_READ_ROW_CONTRACTS,ME as PM_READ_ROW_JQ_SELECTOR,Ni as PM_RECOVERY_ECHO_FIELDS,WD as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,Wb as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,po as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,t1 as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,lo as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,xo as PM_RELOCATED_COMMAND_ALIASES,Kd as PM_REPRODUCIBLE_PROCESS_ENV,KI as PM_SUCCESS_EXIT_CODES,Xo as PM_TOOL_ACTIONS,Gd as PM_TOOL_ACTION_PARAMETER_CONTRACTS,zd as PM_TOOL_PARAMETERS_SCHEMA,Bd as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,jd as PM_TOOL_PARAMETERS_SCHEMA_VERSION,Ld as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Kr as PM_VERDICT_SCHEMA,zC as PM_WORKSPACE_HISTORY_OPERATIONS,zr as PM_WORKSPACE_RECIPE_SCHEMA,_a as PROFILE_FLAG_CONTRACTS,Qt as PROFILE_LINT_CODES,Jt as PROFILE_LINT_DIMENSIONS,zt as PROFILE_NAMES,We as PROFILE_SUBCOMMANDS,b as PmCliError,_e as PmClient,DP as PmCompleteListValidationError,y as PmMcpAuthorizationError,nr as PmMcpInputRequiredError,Or as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,ir as PmMcpRequestStateReplayGuard,jr as PmMcpSkillRegistry,hr as PmMcpSubscriptionRegistry,tt as PmMcpTaskStore,$S as QUERY_CURSOR_CONTRACT,mS as READ_OUTPUT_MUTATION_CONFLICT_CODE,fS as READ_OUTPUT_SHAPING_CONTROL_FLAGS,Ga as REINDEX_FLAG_CONTRACTS,_O as REINDEX_LOCK_ID,dt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Va as RELEASE_FLAG_CONTRACTS,Qa as REMIND_FLAG_CONTRACTS,wt as RESERVED_ITEM_FIELD_NAMES,za as RESTORE_FLAG_CONTRACTS,fn as RISK_VALUES,bR as RelationshipEventLog,TR as RelationshipEventStore,q as RelationshipGraph,Ge as RelationshipKindRegistry,fa as SCHEMA_FLAG_CONTRACTS,Hc as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,zk as SEARCH_EXTENSION_FLAG_DEFINITIONS,Rc as SEARCH_FLAG_CONTRACTS,gs as SECRET_GUARD_RULE_CATEGORIES,dm as SEMANTIC_ATTRIBUTION_LIMITS,FT as SETTINGS_DEFAULTS,xf as SNAPSHOT_SCHEMA,EP as SOURCE_CONTEXT_ACCESS_ENV,SP as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Vm as STALE_CLAIM_TAKEOVER_REFUSED_CODE,Rs as STALE_WORK_THRESHOLD_SETTING,fm as START_BLOCKED_REFUSAL_CODE,mm as START_BLOCKER_ENFORCEMENT_DEFAULT,Ka as START_TASK_FLAG_CONTRACTS,nc as STATS_FLAG_CONTRACTS,un as STATUS_VALUES,Zs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,mi as SUBSTANTIVE_HISTORY_OPERATIONS,yw as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Tw as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,OE as SUPPRESS_HOST_OUTPUT_MARKER,tc as TELEMETRY_FLAG_CONTRACTS,a_ as TELEMETRY_SUBCOMMANDS,ec as TEST_ALL_FLAG_CONTRACTS,Za as TEST_FLAG_CONTRACTS,rc as TEST_RUNS_FLAG_CONTRACTS,r_ as TEST_RUN_MEASUREMENT_LIMIT,Md as TOOL_ACTIVITY_OPTION_CONTRACTS,bd as TOOL_AGGREGATE_OPTION_CONTRACTS,vd as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Pd as TOOL_CALENDAR_OPTION_CONTRACTS,Id as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,kd as TOOL_CONTEXT_OPTION_CONTRACTS,wd as TOOL_CREATE_OPTION_CONTRACTS,Sd as TOOL_CREATE_OPTION_CONTRACT_SOURCE,xd as TOOL_DEPS_OPTION_CONTRACTS,Nd as TOOL_GRAPH_OPTION_CONTRACTS,yd as TOOL_LIST_FILTER_OPTION_CONTRACTS,Td as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Ed as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Cd as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Rd as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,Od as TOOL_UPDATE_OPTION_CONTRACTS,Ad as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,$T as TYPE_TO_FOLDER,jC as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,Ov as UNPROVEN_ACTIVITY_REASONS,fd as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,hd as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,_d as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,_c as UPDATE_FLAG_CONTRACTS,hc as UPDATE_MANY_FLAG_CONTRACTS,Fa as UPGRADE_FLAG_CONTRACTS,On as URL_CREDENTIAL_PLACEHOLDER,ac as VALIDATE_FLAG_CONTRACTS,jT as WORKFLOW_POLICY_ACTIONS,MP as WORKFLOW_POLICY_DOCUMENT_SCHEMA,PP as WORKFLOW_POLICY_SCHEMA,Oc as WORKSPACE_FLAG_CONTRACTS,NA as WORKSPACE_HISTORY_ID,Nf as WORKSPACE_SNAPSHOT_ACTIONS,op as WorkspaceGraphCache,AR as WorkspaceTransactionInterruptedError,xu as _testOnly,nk as _testOnlyAggregateCommand,tp as _testOnlyConfigCommand,lk as _testOnlyGetCommand,bu as _testOnlyHealthCommand,Hl as _testOnlyInit,Bl as _testOnlyInitAgentGuidance,ix as _testOnlyItemTransaction,xk as _testOnlyMutationEvents,tk as _testOnlyNextCommand,Ak as _testOnlySearchCommand,KP as _testOnlySimilarity,nf as _testOnlyTemplates,Pu as _testOnlyValidateCommand,Dk as _testOnlyWorkspacePosition,ax as abandonItemTransaction,PR as abandonWorkspaceTransaction,ZP as acceptAssuranceProposals,Ru as acknowledgeLinkedTests,Zl as acknowledgeUnknownAuthorHistoryEvents,Ql as acknowledgeUnknownAuthorHistoryEventsFromTransport,DO as acquireItemMetadataDerivedIndexLock,Fe as acquireLock,Wn as acquireLockLease,Ux as activateExtensionForTest,Jw as activateExtensions,hm as admitStartWithOpenBlockers,Kn as agentSessionEnvironment,ch as aggregate,Hf as analyzeAgentProvenanceDescriptorCoverage,dI as analyzeDefectChangeRisk,zM as analyzeDefectRecurrenceCoverage,Pp as analyzeDuplicateItems,ER as analyzeGraphImpact,el as analyzeHierarchyIntegrity,SR as analyzeKnowledgeGraph,YI as analyzePmCommandExitConformance,Zo as analyzePmToolActionParity,MM as analyzeReconciliationDiscard,CR as analyzeRelationshipExecution,Yp as analyzeRelationshipSchedule,kg as analyzeSdkActionCoverage,Pt as analyzeSdkCliParameterCompleteness,Th as append,$i as appendHistoryEntry,FA as appendWorkspaceAuditEvent,$A as appendWorkspaceHistoryChange,eC as applyAcceptanceCriteriaMutations,JP as applyAssurancePreset,$c as applyBootstrapPagerPolicy,GM as applyClosureTimestampFix,tw as applyContextIntentProjection,qm as applyContextTagProjection,xI as applyFilterValueEcho,bO as applyHistoryPatch,Vd as applyInvocationAuthorOverride,hp as applyPathMigrations,CS as applyReadOutputDimensions,gS as applyReadOutputIncludeModes,iS as applyReadOutputSessionReferences,SA as applyRegisteredItemFieldDefaultsAndValidation,Tp as applyStandaloneNote,Ks as applyStoredExtensionMigrationState,rC as applyTagRemovals,l0 as applyTerminalOrderingPolicy,Cp as artifactKey,IC as asRecordClone,RC as asRecordOrNull,qe as assembleWorkspaceRelationshipGraph,UP as assertCompleteListResult,TN as assertExtensionBlueprint,bN as assertExtensionCapabilityUsage,tN as assertExtensionDeactivated,SN as assertExtensionManifestCompatible,EN as assertExtensionManifestMatchesBlueprint,wN as assertExtensionPreflight,ol as assertHierarchyMutationAllowed,QM as assertHistoryCompactTarget,xM as assertHistoryRepairTarget,Zi as assertInitializedTracker,gp as assertLinkedArtifactMutationIsUnambiguous,vN as assertMcpClientCapabilities,ON as assertMcpProtocolHeader,Sb as assertMemoryRelationshipGraphAdapterConformance,iC as assertNoUnknownCsvKeys,Uu as assertNonHierarchyCardinalityMutationAllowed,rN as assertPackageManifest,KA as assertParentReferenceIsNotSelf,NL as assertPmMcpSkillsCapability,CN as assertProjectProfile,MO as assertProjectRuntimeCompatibility,vO as assertProjectRuntimeFormatGuard,NE as assertProjectionModeChoice,Qi as assertReadableTrackerRoot,oN as assertRegisteredCommandContract,mN as assertRegisteredCommandOverride,dN as assertRegisteredExporter,nN as assertRegisteredFlags,iN as assertRegisteredHook,cN as assertRegisteredImporter,lN as assertRegisteredItemField,pN as assertRegisteredItemType,yN as assertRegisteredMigration,fN as assertRegisteredParserOverride,_N as assertRegisteredPreflightOverride,uN as assertRegisteredProfile,hN as assertRegisteredRendererOverride,sN as assertRegisteredSearchProvider,gN as assertRegisteredServiceOverride,aN as assertRegisteredVectorStoreAdapter,Lw as assertRelationshipEdgeAllowed,oo as assertRelationshipGraphAdapterConformance,QT as assertSchemaPreviewSupported,l_ as assertTestMeasurementRun,uw as assertWellFormedOutputText,iP as assuranceAssertionUpdateIsLoosening,nw as attachContextIntentReceipt,US as attachContextUsageServingReceipt,wu as attachLinkedTestMutationProvenance,Su as attachLinkedTestProvenance,Xe as attachMcpServerInfo,UE as attachOutputOmissionReceipt,sw as attachOutputTokenAccounting,iw as attachReadOutputContracts,sS as attachReadOutputSessionReceipt,Al as auditMergeAttributeFence,IP as auditMergeDriverConfiguration,tu as auditWorkspaceRelationshipGraph,bL as authorizeMcpHttpRequest,Hn as boundAgentEpisodeIdentity,YE as boundReadOutputRows,Gm as buildChildrenByParent,bk as buildCompactSearchFilterSummary,NI as buildContentFilterEcho,j0 as buildContextSignalSnapshot,pb as buildCorpusShapeItemPlan,cI as buildDefectRecurrenceIndex,Ll as buildExtensionDescribeResult,$l as buildExtensionInstallPlan,LI as buildGovernanceMissingFilterEcho,gu as buildInProgressSweepCommands,sM as buildInProgressWorkHealthSummary,oO as buildInvalidTypeError,ak as buildItemChildrenRollup,ox as buildItemCompletionMutations,A0 as buildItemContextRelevanceCandidates,BO as buildItemNotFoundError,dk as buildItemSchedule,UM as buildLinkedFileRepairReport,lL as buildMcpAuthorizationDiscoveryUrls,Dg as buildMcpCompleteResult,IN as buildMcpDiscoverResult,_L as buildMcpDynamicRegistrationMetadata,rL as buildMcpHttpRequestHeaders,$N as buildMcpInputRequiredResult,dL as buildMcpProtectedResourceMetadata,Sl as buildMergeAttributePatterns,Ud as buildPmActionToolInputSchema,n1 as buildPmRefusalClosureCensus,VP as buildRelationshipContext,KO as buildSearchCorpus,YO as buildSemanticCorpusInput,DM as buildStatusRoleWarnings,Ji as buildTrackerInitializationRecovery,ev as buildVectorizationEmbeddingIdentity,tv as buildVectorizationEmbeddingMetadata,Tk as buildVerboseSearchFilters,kP as buildWorkflowCompletenessCheck,W0 as buildWorkspaceMemorySnapshot,zn as canonicalDocument,_C as canonicalizeCommandOptionKey,Tx as canonicalizeCommandSuggestions,S0 as canonicalizeContextRecencyCoordinate,kw as canonicalizeRelationshipKind,YD as censusPmRecoveryReferenceProducers,GP as certifyCompleteListResult,Dx as checkExtensionManifestCompatibility,og as claim,ng as claimNext,BP as classifyHistoryAuthorEvent,fi as classifyHistoryEvent,IM as classifyHistoryMergeReceiptReferences,qw as classifyHostEnvironmentFault,Ek as classifyImplicitSemanticFallbackReason,Fn as classifyItemFormatVersion,u_ as classifyLinkedTestCommandSafety,m_ as classifyLinkedTestFailure,fA as clearActiveExtensionHooks,du as clearDurableGraphCache,fE as clearFocusedItem,b_ as clearWorkspaceContractsCache,rg as close,Lu as closeItem,ug as closeTask,Uc as coalesceRepeatedListFlags,rR as collectBlockedByIds,nR as collectBlockedByIdsFromCorpus,BS as collectContextUsageDeliveredItemIds,al as collectDanglingDependencyReferences,sR as collectDependencyBlockedIds,il as collectDuplicateDependencyRows,eu as collectDuplicateRelationshipEdgeGroups,Ck as collectErrorCauseCodes,Zd as collectHierarchyRelations,Er as collectMcpHeaderAnnotations,cl as collectMissingDependencyTargetIds,Gu as collectNewOrderingCycleWarnings,Jp as collectOrderingCycles,sl as collectOrderingStorageContradictions,uR as collectPackageContextIntentContracts,Ut as collectPackageExtensionDirectories,CA as collectRegisteredItemFieldNames,sE as collectRuntimeCreateFieldValues,nO as collectRuntimeFilterValues,aE as collectRuntimeUpdateFieldValues,Nm as collectSubtreeIds,ji as collectUsedExtensionCapabilities,hC as commandOptionFlagLabel,ph as comments,z_ as commitImportedItem,nx as commitItemCompletion,rx as commitItemMutations,vR as commitWorkspaceTransaction,Qs as compactFlagAliasContracts,Lm as compareCriticalItems,wO as comparePmDateVersions,wR as compareRelationshipSnapshots,PC as compareTimestampStrings,T0 as compileHistoryProvenanceMatcher,ZS as composeContextIntentContracts,Ix as composeExtension,Lx as composeExtensionPackage,cR as computeActionabilityReport,MA as computeHistoryDiff,Kp as computeRelationshipCentrality,Vp as computeRelationshipDominators,rp as computeWorkspaceGraphFingerprint,Eh as config,mA as consumeAfterCommandAffectedItems,rh as context,ow as contextIntentRowId,sg as copy,ju as countFailureCategories,KE as countReadOutputRows,Zh as create,XP as createAssurancePreset,BM as createAssuranceWorkspaceContext,kC as createCheckpointId,$P as createCompleteListOptions,Qw as createCoreCommandHookContext,Zr as createCorpusShapeMeasurement,lP as createEmptyAssuranceDocument,Uw as createEmptyExtensionRegistrationRegistry,uv as createExtensionCommandError,zs as createExtensionCommandSdk,Gi as createExtensionContributionInventory,AN as createExtensionTestHarness,Di as createHistoryEntry,Fv as createLazyModule,xP as createLifecycleCompletenessPolicies,TL as createMcpStaticBearerVerifier,JN as createMcpTaskStore,jO as createMutationGuardSdk,LE as createOutputOmissionReceipt,us as createPmCliExpectedError,qs as createPmCliProgram,Ei as createPmCommandOutputBudget,PS as createQueryFingerprint,Eb as createRelationshipGraphScaleFixture,J as createRelationshipGraphSnapshot,St as createRelationshipKindRegistry,Yd as createReproducibleProcessRunner,gk as createSearchCursorFingerprint,Zw as createSerialQueue,pC as createStdinTokenResolver,BC as createUnknownSubcommandError,JT as createWorkflowPolicyEvaluator,Lf as createWorkspaceSnapshot,jx as deactivateExtensionForTest,bs as decideSecretGuardFinding,V1 as declineServiceOverride,rw as decodeContextIntentCursor,$v as decodeHtmlEntitiesInOptions,Cr as decodeMcpHttpHeaderValue,cw as decodePmTableRows,NS as decodeQueryCursor,kS as decodeQueryCursorEnvelope,xS as decodeQueryCursorState,RS as decodeReadOutputContinuationCursor,Fx as decodeToon,AL as decoratePmMcpToolsWithApps,Sp as dedupeLinkedArtifacts,wA as defaultConfigScope,v0 as defaultScoreContextCandidates,Q1 as defineAfterCommandHook,X1 as defineBeforeCommandHook,J1 as defineBeforeMutationHook,N1 as defineCommand,j1 as defineCommandOverride,K as defineCorpusShape,zL as defineEpisodeSpecification,Y1 as defineExporter,vx as defineExtension,Rx as defineExtensionBlueprint,k1 as defineExtensionManifest,L1 as defineFlag,W1 as defineImporter,$1 as defineItemField,D1 as defineItemType,F1 as defineMigration,tb as defineObservationContract,t$ as defineOnIndexHook,e$ as defineOnReadHook,Z1 as defineOnWriteHook,B1 as defineParserOverride,Si as definePmCommandOutputBudget,jI as definePmCommandOutputEnvelope,$I as definePmErrorCodeCatalog,q1 as definePreflightOverride,x1 as defineProjectProfile,K1 as defineRendererOverride,G1 as defineSearchProvider,z1 as defineServiceOverride,U1 as defineVectorStoreAdapter,ib as defineVerdictContract,we as defineWorkspaceRecipe,ag as deleteItem,jf as deleteWorkspaceSnapshot,Dw as dependencyToRelationship,yh as deps,QP as deriveAssuranceProposals,$M as deriveClosureTimestamp,Mx as deriveExtensionCapabilities,Hk as deriveMutationTransactionId,XI as derivePmBulkMutationEffect,XD as derivePmRecoveryReferenceObligations,Xp as deriveRelationshipDeadlines,Il as deriveSchemaEvolutionMigrationId,yv as deriveTelemetryCommandResolution,cO as describeAllowedTransitions,CP as describeExtensionActivation,kx as describeExtensionBlueprint,GC as describeFlagScalarValueFailure,Cm as describeItemOwnershipConflict,Us as describeItemRevisionChanges,qL as describeObservationCost,Yt as describeProfileComposition,Xt as describeProjectProfile,lx as describeReadCompletenessControls,mv as describeUnknownError,ni as detectAgentIdentity,ci as detectHarnessIdentity,zp as detectRelationshipCommunities,ii as diagnoseAgentIdentity,ru as diffRelationshipAuditSnapshots,i_ as diffTestRunMeasurements,UN as digestMcpRequestParameters,Yw as discoverExtensions,bn as discoverNearbyPmRoot,dF as discoverPmTools,OO as discoverProjectRuntimeVersionPins,gh as docs,lh as duplicates,iu as durableGraphCachePath,lu as durableGraphCacheStatus,Dn as effectiveItemFormatVersion,Xv as emitTelemetryErrorEvent,q_ as emptyImportedDocument,dM as encodeItemScalarDecisionValue,Tr as encodeMcpHttpHeaderValue,aw as encodePmTableRows,MS as encodeQueryCursor,vS as encodeReadOutputContinuationCursor,Gx as encodeToon,kA as enforceHistoryStreamPolicyForItem,xA as enforceHistoryStreamPolicyForItems,QR as enrichCliFlagInvocationContract,It as enrichCliFlagInvocationContracts,CO as ensureMaterializedHistoryTarget,Tl as ensurePmGitignore,pp as ensureScope,lv as ensureSentryCommandTracing,dv as ensureSentryInit,B_ as ensureTrackerInitialized,Bp as enumerateRelationshipPaths,Oi as estimatePmOutputTokens,uP as evaluateAssuranceAssertion,mP as evaluateAssuranceGate,iI as evaluateBoundaryFixtures,ym as evaluateClaimActivity,M0 as evaluateContextRanking,lI as evaluateDefectGateEvidence,pP as evaluateMeasurement,Sf as evaluateMetricFloors,hs as evaluateMutationGuard,Jf as evaluateProvenanceCoverage,T$ as evaluateReliabilityWindow,Wf as evaluateSemanticAttributionCoverage,kp as evaluateSimilarityGovernance,aO as evaluateTransition,sb as evaluateVerdictContract,XT as evaluateWorkflowPolicies,os as executeEmbeddingBatchesWithRetry,QO as executeVectorDelete,ZO as executeVectorReset,JO as executeVectorUpsert,Jy as executeWorkspaceRecipe,bp as expandAddGlobEntries,Np as explainSourceTraceability,o0 as exportAttestation,mg as extension,_g as extensionActivate,hg as extensionDeactivate,fg as extensionList,cT as extensionMigrate,RM as extractHistoryMergeReceiptDispositions,vM as extractHistoryMergeReceiptReferences,hL as extractMcpTraceContext,gO as extractPatchFailureContext,Tu as extractReferencedPmItemIdsFromCommand,Cb as federateRelationshipGraphSnapshots,fh as files,_h as filesDiscover,hh as filesLookup,qS as finalizeContextUsageDelivery,gb as findCoverageDeficits,Mp as findDuplicateClusters,El as findGitWorkspaceRoot,yE as findHistoryIdentityDiscontinuities,xl as findInstalledNpmPackageCandidate,wL as findPmMcpAppByUri,No as findPmNamespacedCommand,Hp as findRedundantRelationshipEdges,Wp as findRelationshipCutStructure,Ip as findSimilarItems,Yv as finishTelemetryCommand,yR as fitOutputEnvelope,FC as flattenFlagListValue,fb as flushTelemetryQueue,dg as focus,qp as forEachMatchedRelationshipEdge,Zp as formatDuplicateEdgeGroup,tl as formatHierarchyRelation,Qp as formatOrderingStorageContradiction,qR as formatPmPositionalActionFlagTip,gf as formatProfileApplyHuman,hf as formatProfileLintHuman,ff as formatProfileListHuman,_f as formatProfileShowHuman,kl as formatSchemaEvolutionMigrationHuman,wk as formatVectorIndexRecoveryWarnings,Lk as formatWorkspacePositionHuman,Kh as gc,Wi as generateItemId,sh as get,lA as getActiveCommandResult,JS as getActiveContextIntentContracts,qi as getActiveExtensionRegistrations,yL as getActiveMcpTraceContext,_P as getAssuranceDeclaration,Ig as getContracts,uE as getFocusedItem,En as getHistoryPath,hR as getItemAt,Cn as getItemPath,Es as getMutationActionContract,bl as getPmGitignoreBlock,Tn as getSettingsPath,T_ as getWorkspaceContracts,LA as getWorkspaceHistoryPath,bh as graph,su as graphAuditBaselinePath,Yf as groupHistoryByEpisode,H1 as handleServiceOverride,RN as hasMcpClientExtension,SL as hasPmMcpAppsCapability,Be as hasSubcommandFlagContractsForCommand,rv as hasVectorizationEmbeddingIdentityChanged,ov as hasVectorizationVectorDimensionChanged,Rw as hashDocument,Iw as hashDocumentForVersion,Pw as hashEmptyDocument,Ew as hashHistoryPatch,Cw as hashHistoryRecord,Sw as hashHistoryStream,lM as hashItemScalarDecisionValue,Vh as health,Fp as hierarchyAncestors,Gp as hierarchyDescendants,Jh as historyCompact,Qh as historyCompactBulk,tE as historyDigest,b0 as historyEntryMatchesProvenance,AO as historyItemHashVersionForRuntime,Wh as historyRedact,Yh as historyRepair,Xh as historyRepairAll,oR as indexBlockedByIds,rl as indexHierarchyRelations,nv as inferConsistentVectorDimension,Ci as inferPmOutputBudgetClass,Ch as init,FP as inspectCompleteListResult,jw as inspectExtensionManifestSchema,Kl as inspectHistoryAuthorStream,Ps as inspectInProgressWork,yM as inspectMergeReceiptEvidence,PO as inspectProjectRuntimeCompatibility,Ms as inspectStaleInProgressItems,xg as inspectStaticExtensionInventory,LM as inspectStatusRoleAssignments,DA as inspectWorkspaceHistoryState,Df as inspectWorkspaceSnapshot,Rl as installMergeFence,PN as interpretMcpResultType,Km as isAlreadyClaimedError,hv as isCommanderError,mx as isCompatibleRecoveryFlag,od as isErrnoError,Qv as isExternalDependencyReference,Zv as isExternalDependencySourceKind,me as isFileMissingError,Mi as isGenericRefusalRequired,ki as isGenericRefusalWhy,RE as isHostOutputSuppressed,ps as isItemAlreadyExistsError,js as isItemRevisionConflict,cM as isItemScalarMissingValue,Mv as isJudgeableHistoryRecord,wM as isLegacyMergeReceiptSummary,h as isMcpRecord,Ts as isMutationAction,Nw as isOrderingRelationshipKind,HA as isPlaceholderReferenceToken,is as isPmCliErrorDetails,ms as isPmCliExpectedError,tn as isPmExtensionCapabilityContract,on as isPmExtensionPolicyModeContract,nn as isPmExtensionPolicySurfaceContract,rn as isPmExtensionServiceNameContract,WI as isPmKnownExitCode,qI as isPmMutationReceipt,Ve as isPmSuccessfulExitCode,ds as isPmTokenBudgetRecovery,en as isPmToolAction,AM as isPreDurableCloneLocalReceiptSummary,OM as isPreDurableDispositionEligibleReference,IO as isProjectMutatingInvocation,Gv as isPureSnakeCaseAlias,SS as isReadOutputBudgetExceeded,tS as isReadOutputSessionReference,ux as isReadProjectionRecoveryFlag,ES as isReadResultOmittedForBudget,$E as isReadRowContract,Jd as isRuntimeRecord,pO as isSettingsReadFallback,_m as isStartTransition,Bv as isTerminalPlanMode,dE as isTerminalStatus,Mn as isTimestampLiteral,rI as isWaiverNoticeDays,Pv as isWellFormedHistoryRecord,Xk as itemDocumentToMutationOptions,ck as itemHasSchedule,_i as jaccardSimilarity,Nv as latestHistoryTimestamp,mh as learnings,UC as levenshteinDistanceWithinLimit,ed as limitAnnotationEntries,Au as linkedTestTrustFingerprint,xx as lintExtensionBlueprint,Bw as lintExtensionManifestSchema,Zt as lintProjectProfile,oh as list,Zn as listAgentProvenanceAdapters,Gc as listAliasPluralKeys,nh as listAllComplete,GO as listAllDocumentCandidatesCached,rs as listAllItemMetadata,UO as listAllItemMetadataLight,fP as listAssuranceDeclarations,TP as listAssuranceVerdicts,db as listBuiltinCorpusShapes,Cx as listCoreClosedDomainContracts,FR as listGetProjectionFields,oM as listInvalidProvenanceHistoryStreamIds,LR as listListProjectionFields,bM as listMergeReceipts,Cs as listMutationActions,Pk as listMutationEvents,_o as listPmCommandFlagBudgets,ul as listPmCommandsForFamily,pl as listPmCommandsForTier,Ie as listPmFlagLexicon,R1 as listPmFlagSpellingInventory,ml as listPmMcpToolsForProfile,g1 as listPmRequiredArgumentRefusalContracts,y1 as listPmSubcommandRefusalContracts,Wt as listProfiles,C1 as listTrackerPreflightRecoveryContracts,Zk as listUpsertKeyCandidates,$f as listWorkspaceSnapshots,mR as loadContextIntentRuntimeLayers,sf as loadCreateTemplateOptions,Xw as loadExtensions,uu as loadGraphAuditBaseline,ex as loadGuardedRuntimeSchema,NC as loadMutationCheckpoint,k as loadRelationshipGraphAdapter,es as locateItem,nC as looksLikeGenericKeyValueEntry,WE as mapReadOutputRows,TM as markMergeReceiptReconciled,iO as matchesRuntimeFilters,Kv as maybeRunFirstUseTelemetryPrompt,ub as measureCorpusShapePlan,Xi as measureItemMetadataReadWork,tC as mergeAdditiveTags,Px as mergeExtensionBlueprints,pM as mergeHistoryStreams,_M as mergeItemDocuments,hM as mergeJsonDocuments,jc as mergeLinkedTestTwoTokenEntries,uM as mergeRelationshipEventStreams,jm as mergeSortedWarnings,jv as migrateItemFilesToFormat,zO as mutateItem,qO as mutateItemWithHistoryContext,GA as mutateWorkspaceJsonWithHistory,ah as next,ti as normalizeAgentProvenanceAdapterValue,Zc as normalizeAnnotationTransportOptions,tP as normalizeAssuranceEvaluation,eP as normalizeAssuranceMutation,Bc as normalizeBootstrapInvocation,RA as normalizeBulkIdsValue,nl as normalizeDependencyGraphTarget,vI as normalizeDependencySeedId,OI as normalizeDependencySourceKind,kt as normalizeDirectExtensionCommandOptions,$s as normalizeExpectedItemHash,Fi as normalizeExtensionContributionInventory,XC as normalizeHistoryOperationForWrite,rM as normalizeInvalidHistoryProvenance,JR as normalizeItemAddressInvocation,$n as normalizeItemFormatVersion,Ki as normalizeItemId,jn as normalizeItemMetadata,RI as normalizeItemReference,Fc as normalizeLegacyExtensionActionSyntax,yp as normalizeLinkedPath,zA as normalizeParentReferenceValue,Vt as normalizeProfileName,Vi as normalizeRawItemId,yS as normalizeReadOutputIncludeModeOptions,EE as normalizeReplayPatchOps,Ss as normalizeSimilarityText,vv as normalizeStaleWorkThresholdHours,cE as normalizeStatusForRegistry,Un as normalizeStatusInput,oE as normalizeStatusInputWithRegistry,_v as normalizeThrownExitCode,uh as notes,Pn as nowIso,au as openDurableGraphCache,GN as openMcpRequestState,HL as openPmEpisode,Up as orderingPredecessors,jp as orderingSuccessors,D0 as packContextCandidates,Dm as packRankedContextItems,Og as packageActivate,Ag as packageCatalog,vg as packageDeactivate,Sg as packageDescribe,Cg as packageDoctor,bg as packageInstall,gg as packageLifecycle,yg as packageList,Eg as packageManage,dT as packageMigrate,wg as packageReload,Tg as packageUninstall,DS as paginateQueryRows,up as parseAddEntries,mp as parseAddGlobEntries,rd as parseAnnotationTextInput,Vk as parseAtomicMutationControls,Dc as parseBootstrapCommandName,xc as parseBootstrapGlobalOptions,Lc as parseBootstrapHelpRequest,qc as parseBootstrapTypeValue,vA as parseBulkIdsText,km as parseContextDepth,Rm as parseContextFocusFields,lR as parseContextIntentDeclarations,xm as parseContextSections,U0 as parseContextSignalSnapshot,oC as parseCsvKv,mI as parseDefectChangeRiskRequest,qM as parseDefectRecurrenceCoverageRequest,uI as parseDefectRecurrencePolicy,Ef as parseEvalMetricFloors,vf as parseEvalQuerySet,Fs as parseExpectHashSpecs,wC as parseExtensionLongFlagToken,_u as parseGraphSubcommand,r0 as parseHistoryAttestation,g0 as parseHistoryProvenanceFilters,fI as parseIntegerLimit,lE as parseItemDocument,Kk as parseItemMutationBatch,rO as parseLimit,em as parseLinkedTestAssertionEqualsMap,tm as parseLinkedTestAssertionGteMap,Wu as parseLinkedTestBoolean,Yu as parseLinkedTestContextMode,Ku as parseLinkedTestEnvClear,Vu as parseLinkedTestEnvSet,rm as parseLinkedTestJsonEntries,Zu as parseLinkedTestMinLines,Qu as parseLinkedTestRegexList,Ju as parseLinkedTestStringList,Xu as parseLinkedTestWorkspaceContextMode,qg as parseMcpCachePolicy,Ng as parseMcpImplementation,Ze as parseMcpInputRequests,dr as parseMcpInputResponses,my as parseMcpSubscriptionFilter,_p as parseMigrateEntries,gI as parseMultiValueFilter,zI as parseMutationReceipt,mC as parseOptionalNonNegativeInteger,uC as parseOptionalNumber,BD as parsePmAgentTaskTranscriptCorpus,cF as parsePmToolDiscoveryOptions,_I as parsePriority,TI as parsePriorityFilterSet,nS as parseReadOutputSession,EA as parseRegisteredItemFieldAssignments,se as parseRelationshipGraphSnapshot,fp as parseRemoveEntries,xp as parseSourceLineRange,QA as parseStatusFilterCsv,yI as parseStringFilterSet,sn as parseTags,o_ as parseTestRunMeasurements,hI as parseType,bI as parseTypeFilterSet,Jl as parseUnknownAuthorHistoryEventCoordinates,zT as parseWorkflowPolicy,HT as parseWorkflowPolicyDocument,rk as partitionDecisionEntries,PA as patchPathToChangedField,an as pathExists,pg as pauseTask,cu as persistDurableGraphResult,lO as persistSelectedItemFormat,zP as planAgentIdentityVocabularyMutation,V0 as planCompletedAtBackfill,Fl as planExtensionDirectoryCopy,Ox as planItemMutationDocument,er as planProfileApplication,VD as planRelationshipEventBackfill,fu as planRelationshipRemediation,Pl as planSchemaEvolutionMigration,Yl as planUnknownAuthorHistoryAcknowledgment,Ff as planWorkspaceSnapshotRestore,VR as positionalShapeKey,KR as positionalSignatureKey,$x as preflightExtension,As as prepareSimilarityText,aC as preserveMutationStdinTokenFields,sC as preserveMutationStdinTokenLiterals,Ax as previewItemMutationDocument,tx as previewItemMutations,hw as printError,_w as printResult,Uh as profile,qh as profileApply,zh as profileLint,jh as profileList,Bh as profileShow,uA as projectAfterCommandItemSnapshot,Im as projectContextFocusRows,t_ as projectFleetAttributionAnalytics,y0 as projectHistoryProvenance,Li as projectLeanRecoveryPayload,lp as projectLinkedCollectionMutation,dw as projectPmBriefListEnvelope,lw as projectPmBriefSearchEnvelope,cs as projectPmCliErrorContextDetails,ss as projectPmCliErrorDetails,Ri as projectPmDiagnosticOutput,Ii as projectPmDiagnosticText,Zf as projectProvenanceCoverageAnalytics,Iu as projectValidateCounts,eM as promoteAssuranceAssertion,jS as propagateContextUsageServingReceipt,pD as pruneCompileCacheGenerations,hP as putAssuranceDeclaration,gP as putAssuranceDeclarationBundle,kO as queryItemMetadataIndex,xO as queryLinkedFileMetadataIndex,NO as querySimilarItemMetadataIndex,n_ as queryTestRunMeasurementsBelow,wn as quoteCommandArg,Sn as quoteWindowsCommandArg,bx as rankCommandPaths,td as readAnnotationEntries,si as readAuthorEnvironment,E_ as readBooleanOption,WS as readContextUsageAffinity,S_ as readCsvListOption,Vs as readExtensionMigrationState,cn as readFileIfExists,Xc as readFirstStringFromCommanderOptions,Jc as readFirstValueFromCommanderOptions,Xf as readHistoryAnalyticsWindow,gE as readHistoryEntries,li as readHistorySnapshot,qf as readImprovementLedger,$O as readItemMetadataDerivedIndexState,Gs as readItemRevision,sx as readItemTransaction,Dv as readLatestHistoryActivity,ts as readLocatedItem,VE as readOutputBudgetCollections,OS as readOutputCollectionFingerprint,HE as readOutputContinuationRowCollections,qE as readOutputContinuationRowPaths,hS as readOutputIncludeModeOptions,eS as readOutputRetainsTail,zE as readOutputRowCollections,BE as readOutputRowPaths,aS as readOutputSessionRemainingTokens,Gt as readPmPackageManifest,vm as readRecentActivity,y_ as readRequiredString,iE as readRuntimeFieldOptionValue,Yi as readSettings,Hv as readSettingsSection,uO as readSettingsWithMetadata,Qc as readStringArrayFromCommanderOptions,C_ as readStringOption,fv as readThrownExitCode,iv as readVectorizationStatusLedger,EO as readWorkflowPolicies,VT as readWorkflowPolicyField,pR as readWorkspaceContextIntentContracts,z0 as readWorkspaceContextSignals,Y0 as readWorkspaceMemory,Nk as readWorkspacePosition,RR as readWorkspaceTransaction,AE as reanchorHistoryEntries,E$ as reconcileArtifactLedgers,Bi as reconcileExtensionCapabilityUsage,jA as reconcileWorkspaceJsonHistory,pA as recordAfterCommandAffectedItem,bP as recordAssuranceVerdict,sm as recordClaimSemanticAttribution,HS as recordContextUsageDelivery,zS as recordContextUsageServing,VS as recordContextUsageTouch,KS as recordContextUsageTouches,cm as recordFocusSemanticAttribution,Bf as recordImprovementObservation,am as recordReleaseSemanticAttribution,xv as recordedBaselineActivity,Lv as recordedPrefixActivity,Rn as redactUrlCredentialsInText,vn as redactUrlCredentialsInToken,FO as refreshItemMetadataDerivedIndex,Ol as refreshMergeAttributeFenceIfInstalled,JE as refreshReadOutputDeliveredCounts,av as refreshSearchArtifactsForMutation,ei as registerAgentProvenanceAdapters,wI as registerExternalDependencyResolver,Qn as registerHarnessSignalDescriptors,PE as registerOutputMaterialFieldGroups,ig as release,XE as rememberReadOutputFocusRows,yP as removeAssuranceDeclaration,dn as removeFileIfExists,Op as renameArtifactsResultKey,Sm as renderCalendarMarkdown,wm as renderCalendarToon,Bm as renderContextMarkdown,Dl as renderExtensionDescribeMarkdown,Nl as renderExtensionSurfaceMarkdown,K_ as renderGuideMarkdown,hx as renderMissingOptionRetry,ok as renderNextMarkdown,Ex as renderPmClosedDomainHelp,An as renderPmCommand,Fo as renderPmCommandAliasMigrationHint,hl as renderPmCommandVisibilityMarkdown,P1 as renderPmFlagLexiconMarkdown,OL as renderPmMcpAppHtml,i1 as renderPmRefusalClosureCensusMarkdown,eO as renderRowsAsCsv,tO as renderRowsAsTable,tg as reopen,TO as replayHistoryToTarget,TE as replayToCanonicalItemDocument,bE as replayToItemDocument,YC as requireHistoryOperation,c0 as requireTerminalReason,d0 as requireTerminalReasonWithRecovery,Ow as resealHistoryRewrite,aA as resetActiveExtensionRuntimeState,ip as resetWorkspaceGraphCache,Vn as resolveAgentSessionContextFromSignals,ad as resolveAnnotationIndex,nd as resolveAnnotationInput,hE as resolveAuthor,di as resolveAuthorIdentity,qA as resolveBodyFileContent,lb as resolveBuiltinCorpusShape,Em as resolveCalendarOutputFormat,FI as resolveCanonicalPmErrorCodeContract,xw as resolveCanonicalRelationshipKind,_E as resolveClaimPrincipal,IA as resolveCliBulkIdsInput,bC as resolveCommandOptionPolicyState,lD as resolveCompileCacheGeneration,H0 as resolveCompletionTimestamp,Gw as resolveConfiguredPmPackageRoot,PI as resolveContentFieldFilters,ew as resolveContextIntentContract,Pm as resolveContextOutputFormat,Mm as resolveContextTokenBudget,p0 as resolveCreateExplicitEmptyFlag,Ns as resolveDeclaredBlockers,mk as resolveEffectiveSearchMode,HO as resolveEmbeddingProviders,Mt as resolveExtensionFlagOptionKey,$C as resolveExtensionFlagValueContract,Gl as resolveExtensionInstallSourceIdentity,AC as resolveExtensionLongFlagName,Hs as resolveExtensionMigrationStatePath,Ww as resolveExtensionRoots,AI as resolveExternalDependencyReference,DC as resolveFlagValueKind,EC as resolveGlobalPmRoot,H_ as resolveGuideOutputFormat,zf as resolveHistoryEpisodeGroupIdentity,eE as resolveHistoryHashAlgorithm,WC as resolveHistoryOperation,h0 as resolveHistoryProvenanceDimensions,Jv as resolveHistorySubject,yO as resolveHistoryTarget,_k as resolveHybridSemanticWeight,yn as resolveImplicitPmRoot,MC as resolveIsoOrRelative,iR as resolveItemBlockers,eR as resolveItemExecutionRole,Yk as resolveItemMutationDocument,Tm as resolveItemOwnershipActivity,bm as resolveItemOwnershipConflict,gn as resolveItemTypeRegistry,rE as resolveItemTypesFilePath,Is as resolveLastActivityAt,cx as resolveLifecycleVerbRecovery,SC as resolveLinkedResourcePositionalRecovery,f_ as resolveLinkedTestFailureExitCode,Cu as resolveLinkedTestSourceRef,Eu as resolveLinkedTestSourceWorkspaceRoot,Ou as resolveLinkedTestTrust,vu as resolveLinkedTestTrustBatch,fy as resolveMcpAcknowledgedSubscriptionFilter,Ye as resolveMcpRequestContext,Cl as resolveMergeInstallContext,gx as resolveMisnestedCommandPath,II as resolveMissingMetadataFilters,_x as resolveMissingOptionPlaceholder,DE as resolveModePairedOutputOmissionReceipt,ek as resolveNextOutputFormat,GE as resolveOutputOmissionReceipt,Fw as resolvePmCliVersion,$o as resolvePmCommandAlias,ze as resolvePmCommandCapabilityFamily,Lt as resolvePmCommandExitContract,N as resolvePmCommandOperation,Ai as resolvePmCommandOutputBudget,Nt as resolvePmCommandOutputEnvelope,jR as resolvePmCommandPositionalContract,In as resolvePmCommandScopeArgs,He as resolvePmCommandVisibilityTier,vi as resolvePmDiagnosticOutputBudget,GI as resolvePmErrorCodeContract,oT as resolvePmFlagSemanticConcept,xe as resolvePmHistoryOperation,xN as resolvePmMcpExecutableInvocation,$w as resolvePmPackageRootFromModule,BR as resolvePmPositionalActionContract,Mc as resolvePmPositionalActionFlagContracts,$e as resolvePmRoot,Dd as resolvePmToolCustomFieldCollision,WA as resolvePriority,Kt as resolveProfile,wl as resolveProjectMergeTypeFolders,LS as resolveQueryCursorStart,dx as resolveReadCompletenessControls,px as resolveReadOptionRetryArgs,bS as resolveReadOutputDimensions,wS as resolveReadOutputEncoding,QE as resolveReadOutputRecoveryBudget,uS as resolveReadOutputSurface,FE as resolveReadRowContract,fx as resolveRecoveryCommandName,AA as resolveRegisteredSearchProvider,OA as resolveRegisteredVectorStoreAdapter,Wd as resolveReproducibleProcessEnvironment,xn as resolveRuntimeFieldRegistry,kn as resolveRuntimeStatusRegistry,VO as resolveSearchCorpusFields,uk as resolveSearchMaxResults,yk as resolveSearchPage,fk as resolveSearchScoreThreshold,hk as resolveSearchTuning,WO as resolveSemanticCorpusCharacterLimit,im as resolveSemanticLineageIds,fO as resolveSettingsWithSemanticRuntimeDefaults,wP as resolveSourceContextWritePolicy,um as resolveStartTaskInProgressStatus,Z as resolveSubcommandFlagContractsForCommand,GT as resolveTelemetryErrorCategory,cv as resolveTelemetrySourceAttribution,a0 as resolveTerminalReason,Qk as resolveTransactionSchema,yC as resolveTypeDefinition,gC as resolveTypeName,ZA as resolveTypeSynonym,sO as resolveTypeWorkflows,Xl as resolveUnknownAuthorAcknowledgmentSelector,Sk as resolveVectorIndexRecovery,XO as resolveVectorStores,Qd as resolveWorkspaceRelationshipKindRegistry,CC as resolveWorkspaceRoot,cg as restore,LC as restoreCheckpointItems,BA as restoreWorkspaceJsonFromHistory,Uf as restoreWorkspaceSnapshot,Gf as restoreWorkspaceSnapshotWithRecovery,cp as reviseLinkedNote,Mg as runAction,_A as runActiveBeforeMutationHooks,gA as runActiveCommandHandler,hA as runActiveOnIndexHooks,Hi as runActiveOnReadHooks,zi as runActiveOnWriteHooks,yA as runActiveParserOverride,bA as runActivePreflightOverride,TA as runActiveServiceOverride,Om as runActivity,Kw as runAfterCommandHooks,yf as runAggregate,sd as runAnnotationCommand,Nu as runAppend,KM as runAssuranceAction,WM as runAssuranceDispatch,Vw as runBeforeCommandHooks,Am as runCalendar,Wm as runClaim,Ym as runClaimNext,Du as runClose,$u as runCloseMany,Zm as runCloseTask,cd as runComments,W_ as runCompletion,ep as runConfig,qt as runContext,N0 as runContextEvaluationCorpus,k0 as runContextEvaluationScenario,Fu as runCopy,om as runCreate,nm as runDelete,sp as runDeps,vp as runDocs,WP as runDuplicates,If as runEval,Mf as runEvent,Ul as runExtension,Ys as runExtensionMigrateAction,Ws as runExtensionMigrations,Lp as runFiles,$p as runFilesDiscover,Dp as runFilesLookup,e_ as runFleetAttributionAnalytics,pm as runFocus,ku as runGc,bf as runGet,hu as runGraph,V_ as runGuide,yu as runHealth,pk as runHistory,i0 as runHistoryAttest,XM as runHistoryCompact,ZM as runHistoryCompactBulk,PM as runHistoryMaintenance,e0 as runHistoryRedact,kM as runHistoryRepair,NM as runHistoryRepairAll,Vl as runInit,ql as runInitAgentGuidance,dd as runLearnings,Ap as runLinkedArtifacts,__ as runLinkedTests,dl as runList,Pf as runMeet,vk as runMergeDriver,vl as runMergeInstall,EM as runMergeReceiptEvidenceReport,CM as runMergeReceiptReport,Rk as runMergeReconcile,Hm as runNext,ld as runNotes,Qm as runPauseTask,tf as runPlan,mf as runProfileApply,uf as runProfileLint,lf as runProfileList,pf as runProfileShow,Qf as runProvenanceCoverageAnalytics,Bx as runRegisteredCommandForTest,Kx as runRegisteredCommandOverrideForTest,eN as runRegisteredExporterForTest,zx as runRegisteredHookForTest,Zx as runRegisteredImporterForTest,Qx as runRegisteredMigrationForTest,qx as runRegisteredMutationGuardForTest,Hx as runRegisteredParserOverrideForTest,Vx as runRegisteredPreflightOverrideForTest,Wx as runRegisteredRendererOverrideForTest,Xx as runRegisteredSearchProviderForTest,Yx as runRegisteredServiceOverrideForTest,Jx as runRegisteredVectorStoreAdapterForTest,tr as runReindex,Xm as runRelease,kf as runRemind,m0 as runReopen,rf as runRestore,Ml as runSchemaEvolutionMigration,Tf as runSearch,mb as runSearchRefreshWorkerEntrypoint,Y_ as runStartBackgroundRun,Jm as runStartTask,s_ as runStats,c_ as runTelemetry,cf as runTemplatesList,af as runTemplatesSave,df as runTemplatesShow,h_ as runTest,g_ as runTestAll,X_ as runTestRunsList,Q_ as runTestRunsLogs,eh as runTestRunsResume,J_ as runTestRunsStatus,Z_ as runTestRunsStop,th as runTestRunsWorker,gm as runUpdate,of as runUpdateMany,jt as runUpgrade,Mu as runValidate,Pg as runWithActiveExtensions,L as runWithAgentSessionContext,dO as runWithConfigurationOnlySettings,QS as runWithContextIntentContracts,fR as runWithDiscoveredContextIntentContracts,ri as runWithHarnessDetectionSignals,gL as runWithMcpTraceContext,Xd as runWithReproducibleProcessEnvironment,oi as runWithWorkspaceHarnessSignalDescriptors,Hr as runWithWorkspaceRecipe,NP as runWorkflowPolicyAction,YM as runWorkspaceTransactionGc,mu as saveGraphAuditBaseline,FM as scanClosureTimestamps,tM as scanExtensionHostVersions,Wl as scanHistoryAuthorAttribution,ks as scanInProgressWork,Gn as scanItemFormatVersions,_s as scanMutationSecrets,nM as scanProvenanceResolverHealth,xs as scanStaleInProgressItems,jM as scanStorageIntegrity,Sh as schema,Ph as schemaAddField,Rh as schemaAddStatus,Oh as schemaAddType,Nh as schemaApplyPreset,Lh as schemaInferTypes,wh as schemaList,kh as schemaListFields,Fh as schemaRemapStatus,Mh as schemaRemoveField,Ih as schemaRemoveStatus,vh as schemaRemoveType,$h as schemaRenameField,Dh as schemaRenameType,Ah as schemaShow,xh as schemaShowField,Gh as schemaShowStatus,yx as scoreCommandPathMatch,R0 as scoreContextCandidates,I0 as scoreContextCandidatesWithActiveExtensions,Os as scoreItemSimilarity,b1 as scorePmGrammarRefusalClosure,c1 as scorePmRefusalClosure,vs as scorePreparedItemSimilarity,E1 as scoreTrackerPreflightRecoveryClosure,ww as sealHistoryRecord,FN as sealMcpRequestState,ih as search,Q0 as searchWorkspaceMemory,Z0 as searchWorkspaceMemoryReadResult,ys as secretGuardRuleCategory,aR as selectActionableEntries,IS as selectCursorSemanticOptions,j_ as selectImportAuthor,uL as selectMcpClientRegistrationMode,J0 as selectWorkspaceMemory,X0 as selectWorkspaceMemoryRollups,lm as semanticAttributionAffinity,Sv as sentryCaptureCliError,Cv as sentryDiscardCommandSpan,Ev as sentryFinishCommandSpan,Av as sentryFlush,wv as sentryLogCliUsageError,bv as sentrySetCommandContext,Tv as sentryStartCommandSpan,qn as serializeItemDocument,Sx as serializeNdjsonRows,wx as serializeNdjsonStream,rb as serveDeclaredObservation,cA as setActiveCommandContext,dA as setActiveCommandResult,tA as setActiveExtensionCommands,eA as setActiveExtensionHooks,rA as setActiveExtensionParsers,oA as setActiveExtensionPreflight,sA as setActiveExtensionRegistrations,iA as setActiveExtensionRenderers,nA as setActiveExtensionServices,mE as setFocusedItem,zv as settingsSectionRevision,qv as shouldCompletePlanOnClose,pu as shouldPersistDurableGraphCache,lC as shouldResolveMutationStdinTokenField,dC as shouldResolveMutationStdinTokens,hO as shouldRunSearchRefreshInForeground,Rp as similarityAdvisoryWarnings,jE as sliceReadOutputRowCollection,as as snapshotPmCliErrorContext,Ep as sortLinkedArtifacts,nI as sortWaiverNotices,ZT as splitAcceptanceCriteria,Uv as splitCommaList,Bn as splitFrontMatter,TS as stabilizeReadOutputReceiptEstimates,R as stableStringify,Wk as stableUpsertValue,UT as stableValueEquals,Iv as staleEligibleAt,RO as stampRequiredItemFormat,lg as startTask,Wv as startTelemetryCommand,dh as stats,nE as statusIsTerminal,Nc as stripGlobalBootstrapTokens,Mk as subscribeMutationEventBatches,kk as subscribeMutationEvents,qP as summarizeAgentIdentityVocabulary,Vf as summarizeAgentModelProvenance,Kf as summarizeAgentProvenance,x0 as summarizeContextEvaluationReports,p_ as summarizeContextPreflight,C0 as summarizeHistoryProvenance,zl as summarizeInitResult,gM as summarizeMergeReceipt,u0 as supportsCreateExplicitEmpty,XR as supportsItemIdAlias,vE as suppressHostOutput,Oe as syncRelationshipGraphAdapter,Nx as synthesizeExtensionManifest,kc as toCompletionFlagString,Um as toContextFocusItem,$m as toContextPackingSummary,Fm as toContextRankingSummary,vC as toErrorMessage,A_ as toEstimatedMinutesValue,Bk as toExtensionFlagDefinitions,P_ as toImportBoolean,N_ as toImportConfidence,G_ as toImportDeferredFields,I_ as toImportInteger,F_ as toImportLinkedDocs,$_ as toImportLinkedFiles,U_ as toImportLinkedTests,D_ as toImportLogEntries,L_ as toImportNormalizedEnum,x_ as toImportNumberMap,O_ as toImportPriority,R_ as toImportStatus,M_ as toImportStringList,k_ as toImportStringMap,v_ as toImportTags,pE as toItemRecord,w_ as toNonEmptyImportString,OC as toNonEmptyStringOrUndefined,CE as toReplayDocument,pw as toWellFormedText,ws as tokenizeSimilarityText,cC as transferMutationStdinTokenPolicy,zw as translateHostEnvironmentFault,kv as unprovenClaimActivity,eg as update,d_ as updateLinkedTest,Rg as upgrade,Hh as validate,aP as validateAssertionDefinition,dP as validateAssuranceDocument,cP as validateGateDefinition,Jk as validateItemMutationRows,wp as validateLinkedPaths,mL as validateMcpAuthorizationResponseIssuer,pL as validateMcpAuthorizationServerMetadata,fL as validateMcpClientMetadataDocument,oL as validateMcpHttpRequestHeaders,BN as validateMcpJsonSchema,sP as validateMeasurementDefinition,VA as validateMissingParentReference,_S as validateReadOutputOptions,JA as validateSprintOrReleaseValue,TC as validateTypeOptions,OR as validateWorkspaceTransactionIdentity,n0 as verifyAttestation,ZR as verifyCliFlagInvocationParity,HR as verifyExplicitPositionalSlotCensus,wE as verifyHistoryChain,SE as verifyHistoryChainWithVersion,_R as verifyHistoryEntries,Aw as verifyHistoryRecordHash,vw as verifyHistoryRewriteEvidence,YR as verifyPmCliGrammar,WR as verifyPmCommandPositionalContracts,I1 as verifyPmFlagLexicon,ZD as verifyPmRecoveryKindRuntimeCoverage,Kb as verifyPmRecoveryProducerRuntimeCoverage,QD as verifyPmRecoveryReferences,o1 as verifyPmRefusalClosureIdentityRatchet,r1 as verifyPmRefusalClosureRatchet,JD as verifyPmRefusalReachability,gd as verifyToolOptionCliParity,oI as waiverNoticeFor,Rv as wholeHoursSince,YA as withCliMutationInput,Bs as withExpectedItemRevisions,Js as withFlagAliasMetadata,Hw as withHostEnvironmentBoundary,XA as withLiteralMutationInput,jN as withMcpCachePolicy,xi as withoutGenericRefusalExamples,WT as workflowApprovalFingerprint,YT as workflowPolicyApplies,KT as workflowPolicyFingerprint,np as workspaceGraphCache,IR as workspaceTransactionPlanDigest,id as wrapOwnershipConflict,gv as wrapThrownErrorForSentry,ai as writeAuthorEnvironment,De as writeFileAtomic,xC as writeMutationCheckpoint,mO as writeSettings,Vv as writeSettingsSection,fw as writeStderr,mw as writeStdout,sv as writeVectorizationStatusLedger,UA as writeWorkspaceJsonWithHistory,dp as writtenLinkedEntries};
28
+ </html>`}import{createHash as ot}from"node:crypto";import{lstat as qC,readdir as zr,readFile as HC}from"node:fs/promises";import M from"node:path";import{parseDocument as VC}from"yaml";var $r="io.modelcontextprotocol/skills",it="SEP-2640@a3e147ca2710f68214247aecc729731ee1ae8d03",KC=Object.freeze({revision:it,status:"draft",directoryRead:!0});function LL(e,t=!1){let r=e.clientCapabilities.extensions,n=h(r)?r[$r]:void 0;if(!h(n)||n.revision!==it||t&&n.directoryRead!==!0)throw new u("Missing or incompatible Skills over MCP draft capability",m.missingRequiredClientCapability,{requiredCapabilities:{extensions:{[$r]:KC}}})}var P=Object.freeze({maxFilesPerSkill:512,maxFileBytes:16*1024*1024,maxSkillBytes:16*1024*1024,defaultPageSize:20,maxPageSize:100}),Dr=100,WC=32*1024*1024,YC=/^[a-z0-9]+(?:-[a-z0-9]+)*$/u,Fr=new Set(Array.from({length:P.maxPageSize},(e,t)=>t+1));function T(e,t){throw new u(e,-32602,t)}function Gr(e,t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(t),e.endsWith(".md")?"text/markdown":"text/plain"}catch{return"application/octet-stream"}}function XC(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=VC(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 JC(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>WC&&T(`Skill origin exceeds the aggregate byte limit: ${t}.`),HC(e)}async function qr(e,t,r){let n=M.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=M.posix.join(t.split(M.sep).join("/"),s.name),c=M.join(e,...a.split("/")),d=await qC(c);d.isSymbolicLink()&&T(`Skill resource must not be a symbolic link: ${a}.`),d.isDirectory()?i.push(...await qr(e,a,r)):d.isFile()?i.push({relative:a,bytes:await JC(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()&&YC.test(a.name)).sort((a,c)=>a.name.localeCompare(c.name));i.length>Dr&&T(`Skill origin exceeds ${Dr} directories.`);let s={value:0};for(let a of i){let c=await qr(M.join(e,a.name),"",{files:0,skillBytes:0,originBytes:s}),d=c.reduce((_,y)=>_+y.bytes.byteLength,0),p=c.find(_=>_.relative==="SKILL.md");if(!p)continue;let l=XC(p.bytes.toString("utf8"),a.name);l.name!==a.name&&T(`Skill directory ${a.name} must match frontmatter name.`,{actual:l.name??null,expected:a.name}),(typeof l.description!="string"||l.description.trim().length===0)&&T(`Skill ${a.name} requires a non-empty frontmatter description.`,{required:["description"]});let f=c.map(_=>({uri:`skill://${a.name}/${_.relative}`,digest:`sha256:${ot("sha256").update(_.bytes).digest("hex")}`,size:_.bytes.byteLength})),g=ot("sha256").update(f.map(_=>`${_.uri}:${_.digest}`).join(`
29
+ `)).digest("hex");n.set(a.name,{uri:`skill://${a.name}/SKILL.md`,frontmatter:l,resources:f,_meta:{contractVersion:1,extensionRevision:it,origin:t,packageVersion:r,protocolVersion:q,trust:"untrusted",estimatedTokens:Math.ceil(d/4)},files:new Map(c.map(_=>[_.relative,_.bytes])),fingerprint:g})}return n}function jr(e){let{files:t,fingerprint:r,...n}=e;return n}var Br=class e{#e;#t;constructor(t){this.#e=t,this.#t=ot("sha256").update([...t.entries()].sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>`${r}:${n.fingerprint}`).join(`
30
+ `)).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 u)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(M.join(t.packageRoot,".agents","skills"),"package",t.packageVersion);if(t.workspaceRoot){let n=M.resolve(t.packageRoot,".agents","skills"),o=M.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;Fr.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(jr),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"}),jr(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 y of o.resources){let E=y.uri.slice(`${a}/`.length);if(!E.startsWith(s))continue;let B=E.slice(s.length),[O,...ht]=B.split("/"),Rn=`${a}/${s}${O}`,Pn=o.files.get(`${s}${O}`);c.set(O,{uri:Rn,name:O,mimeType:ht.length>0?"inode/directory":Gr(O,Pn)})}i.length>0&&c.size===0&&T(`Unknown pm MCP skill directory: ${t}.`,{field:"uri"});let d=r.limit??P.maxPageSize;Fr.has(d)||T(`Skill directory limit must be an integer from 1 to ${P.maxPageSize}.`);let p=this.#r(r.cursor,t),l=[...c.values()].sort((y,E)=>y.uri.localeCompare(E.uri)),f=l.slice(p,p+d),g=p+f.length,_=g<l.length;return{resources:f,hasMore:_,..._?{nextCursor:this.#n(g,t)}:{}}}};var Hr="https://schema.unbrained.dev/pm/workspace-recipe/v1";function st(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)=>st(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,st(n,`${t}.${r}`)])))}function xe(e){if(e.schema!==Hr)throw new Error(`Unsupported workspace recipe schema: ${e.schema}`);let t=Tt(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:st(r.input,`operations[${n}].input`)})))})}async function Vr(e,t){let r=xe(e);return Et(r,t)}async function QC(e,t){return Vr(e,async()=>{let r=[];for(let[n,o]of e.operations.entries())r.push(await t(o,n));return r})}var Kr="pm.agent-observation/v1",Wr="pm.agent-verdict/v1",Yr="pm.agent-episode/v1";function w(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new Error(`${t} must be a positive safe integer.`)}function I(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 ZC(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(I(r.command,"observation.reads.command"),w(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 ey(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(w(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 ty(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(I(n.id,"observation.tiers.id"),w(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(D(i,"observation.tiers.fields"),o.has(i))throw new Error(`Duplicate observation tier field: ${i}.`);o.add(i)}}}function ry(e){if(e.schema!==Kr)throw new Error(`observation.schema must be ${Kr}.`);return I(e.id,"observation.id"),w(e.version,"observation.version"),ZC(e.reads),ey(e.calibration),e.corpus_dependence.kind==="bounded"&&(I(e.corpus_dependence.dimension,"observation.corpus_dependence.dimension"),w(e.corpus_dependence.maximum,"observation.corpus_dependence.maximum")),ty(e.tiers),ne(structuredClone(e))}function qL(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 ny(e,t,r){w(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(R(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 D(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 Xr(e,t){let r=e;for(let n of D(t,"recorded field path")){if(r===null||typeof r!="object"||!Object.hasOwn(r,n))return;r=r[n]}return r}function oy(e){return`/${D(e,"verdict predicate path").map(t=>t.replaceAll("~","~0").replaceAll("/","~1")).join("/")}`}function iy(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 sy(e){if(e.schema!==Wr)throw new Error(`verdict.schema must be ${Wr}.`);I(e.id,"verdict.id"),w(e.version,"verdict.version");let t=new Set;for(let n of e.predicates){I(n.id,"verdict.predicates.id"),D(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}.`);iy(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 ne(structuredClone(e))}function ay(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=Xr(t.state,a.path),d=a.kind==="field_present"?c!==void 0:a.kind==="field_absent"?c===void 0:R(c)===R(a.expected);return{id:s,outcome:d?"satisfied":"violated",evidence_pointer:`${t.snapshot_id}#${oy(a.path)}`,evidence_digest:gt(R(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 HL(e){if(e.schema!==Yr)throw new Error(`episode.schema must be ${Yr}.`);if(I(e.id,"episode.id"),w(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)I(t,"episode.task_item_ids");w(e.limits.max_actions,"episode.limits.max_actions"),w(e.limits.max_observations,"episode.limits.max_observations"),w(e.limits.max_tokens_per_observation,"episode.limits.max_tokens_per_observation");for(let t of e.observable_fields)D(t,"episode.observable_fields");for(let t of e.withheld_fields)D(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 ry(e.observation),sy(e.verdict),xe(e.recipe),ne(structuredClone(e))}function cy(e,t,r){let n=D(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 dy(e,t){let r={};for(let n of t)cy(r,n,Xr(e,n));return r}async function VL(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 L(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 l=await t.readRecordedState(),f=await ny(e.observation,async g=>dy(l.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??l.snapshot_id}),f},p=async(l=!1)=>{if(i&&!l)throw new Error("episode is already closed.");if(o>=e.limits.max_observations)throw new Error("episode exceeded limits.max_observations.");o+=1;let f=await t.readRecordedState(),g=ay(e.verdict,f);return r.push({sequence:r.length+1,kind:"verdict",state_id:f.snapshot_id}),g};return{observe:()=>L(a,d),step:async l=>{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 f=await L(a,()=>t.execute(l));return r.push({sequence:r.length+1,kind:"action",state_id:f.state_id}),f},score:()=>L(a,p),close:()=>s!==void 0?s:i?Promise.reject(new Error("episode is already closed.")):(i=!0,s=L(a,()=>p(!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)}}var F="https://schema.unbrained.dev/pm/corpus-shape/v1";function V(e,t){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(`Corpus shape ${t} must be a positive safe integer`);return e}function oe(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 K(e){if(e.schema!==F)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(V(e.hierarchy_depth,"hierarchy_depth"),V(e.hierarchy_fanout,"hierarchy_fanout"),oe(e.age_span_days,"age_span_days"),V(e.history_entries_per_item,"history_entries_per_item"),oe(e.comments_per_100_items,"comments_per_100_items"),oe(e.notes_per_100_items,"notes_per_100_items"),oe(e.learnings_per_100_items,"learnings_per_100_items"),V(e.author_cardinality,"author_cardinality"),V(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 be=[{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}],W=Object.freeze({scratch:K({schema:F,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:K({schema:F,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:be,author_cardinality:32,component_count:1,include_cycles:!1,custom_types:["Experiment"],custom_statuses:["review"],terminal_statuses:[],custom_fields:["domain"]}),"deep-graph":K({schema:F,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:be,author_cardinality:16,component_count:1,include_cycles:!0,custom_types:[],custom_statuses:[],terminal_statuses:[],custom_fields:[]}),"multi-decade":K({schema:F,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:be,author_cardinality:64,component_count:1,include_cycles:!1,custom_types:["Program"],custom_statuses:["archived"],terminal_statuses:["archived"],custom_fields:["portfolio"]}),"disconnected-archive":K({schema:F,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:be,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(W).sort().map(e=>W[e])}function ly(e){let t=e.trim().toLowerCase();if(!Object.hasOwn(W,t))throw new TypeError(`Unknown corpus shape "${e}". Available: ${Object.keys(W).join(", ")}`);return W[t]}var Jr=new WeakMap;function Zr(e,t){if(e===0)return[];let r=Jr.get(t);r===void 0&&(r=t.edge_kind_mix.flatMap(o=>Array.from({length:o.weight},()=>o.kind)),Jr.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 uy(e,t,r,n=42){if(oe(t,"item index"),V(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 E=0;E<e.hierarchy_depth;E+=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,p=s-d,l=d===0?void 0:i+(p+Math.floor((d-1)/e.hierarchy_fanout))*o,f=Date.UTC(2026,0,1),g=e.age_span_days*864e5,_=new Date(f+(r===1?0:Math.round(t/(r-1)*g))).toISOString(),y=(t*37+n)%100;return{index:t,id:`pm-s${t.toString(36).padStart(7,"0")}`,...l===void 0?{}:{parent:`pm-s${l.toString(36).padStart(7,"0")}`},component:i,timestamp:_,author:`pm-corpus-agent-${(t+n)%Math.min(e.author_cardinality,r)}`,history_entry_count:e.history_entries_per_item,dependency_kinds:Zr(t,e),has_comment:y<e.comments_per_100_items,has_note:y<e.notes_per_100_items,has_learning:y<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 at=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,Zr(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,p=c*a+Math.max(0,a+d-100),l=c*a+Math.min(a,d),f=this.annotations[s];(f<p||f>l)&&n.push(`${s}:${f}!in[${p},${l}]`)}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 en(e){return new at(e)}function my(e,t){let r=en(e);for(let n of t)r.add(n);return r.finish()}async function fy(){let e=De(process.cwd(),process.env.PM_PATH);await wt(e,(t,r)=>Ot(t,r,{apply_runtime_defaults:!0}))}async function _y(){await Rt()}var tn=["lines","branches","functions","statements"];function hy(e,t){if(typeof t!="object"||t===null||Array.isArray(t))throw new TypeError(`Coverage entry for ${e} must be an object.`)}function gy(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 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,n]of Object.entries(e)){hy(r,n);for(let o of tn){let i=gy(r,o,n[o]),s=i.total-i.covered;s>0&&t.push({file:r,metric:o,uncovered:s,...i})}}return t}import Y from"node:fs";import ct from"node:path";var rn=300*1e3,yy=3;function l$(e){return(e?.trim()||"development").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/^\./,"_")}function u$(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.");Y.mkdirSync(e,{recursive:!0});let n=ct.join(e,r);Y.mkdirSync(n,{recursive:!0});let o=new Date;Y.utimesSync(n,o,o);let i=Y.readdirSync(e).filter(d=>d!==r).flatMap(d=>{try{return[{name:d,mtimeMs:Y.statSync(ct.join(e,d)).mtimeMs}]}catch(p){if(p instanceof Error&&"code"in p&&me(p))return[];throw p}}).sort((d,p)=>p.mtimeMs-d.mtimeMs||d.name.localeCompare(p.name)),s=i.filter(d=>o.getTime()-d.mtimeMs<rn),a=Math.max(0,yy-1-s.length),c=i.filter(d=>o.getTime()-d.mtimeMs>=rn).slice(a).map(d=>d.name).sort((d,p)=>d.localeCompare(p));for(let d of c)Y.rmSync(ct.join(e,d),{recursive:!0,force:!0,maxRetries:3,retryDelay:50});return{retained:r,removed:c}}import{createHash as Sy}from"node:crypto";var dt=1;function X(e){e?.throwIfAborted()}function G(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function J(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:dt,fingerprint:Sy("sha256").update(R({nodes:o,edges:i,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:o,edges:i,kinds:s})}function Ty(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function se(e){if(!Ty(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==dt)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 Ge([]);for(let o of e.kinds)t.register(o);let r=new z(e.nodes,e.edges,t),n=J(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 v(e,t){G(e.name,"adapter name");let r=G(t.workspace,"workspace");X(t.signal);let n=await e.read({...t,workspace:r});return X(t.signal),n===null?null:se(n)}async function we(e,t){let r=G(t.workspace,"workspace"),n=se(t.snapshot).snapshot,o=await v(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(X(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:o?.snapshot.fingerprint??null}),(await v(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 Ey(e,t={}){let r=e.map(se),n=new Map;for(let s of r)for(let a of s.snapshot.kinds){let c=n.get(a.kind);if(c&&R(c)!==R(a))throw new TypeError(`Conflicting federated relationship kind: ${a.kind}`);n.set(a.kind,a)}let o=new Ge([...n.values()].sort((s,a)=>s.kind.localeCompare(a.kind))),i=new z(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),o);return J(i,o,t)}var ie=class{name;#e=new Map;constructor(t="memory"){this.name=G(t,"adapter name")}async read(t){X(t.signal);let r=this.#e.get(G(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){X(t.signal);let r=G(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(se(t.snapshot).snapshot))}async clear(t){X(t.signal);let r=G(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 nn(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Ay(e){let t=nn(e.nodeCount,"nodeCount"),r=nn(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 U(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function on(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=xt(),o=J(new z(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),i=J(new z(["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=[];U(await v(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let a=await we(e,{workspace:r,snapshot:o});U(a.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),U((await v(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),U((await we(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}),U((await v(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 U(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}),U(await v(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function xy(e){return on(new ie,e?{workspace:e}:{})}var pt=2,by=["self_reported","independent_transport"];function Oe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function ae(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`${t} must be a non-empty string`);return e.trim()}function sn(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=ae(n,`${t}[${String(o)}]`);return r?n:i})}function lt(e,t){return e===void 0?void 0:ae(e,t)}function wy(e,t){if(e===void 0)return;if(!Oe(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 Oy(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=Ct(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 p=yt(t.slice(s+1));p!==void 0&&(a=ke(`history ${p}`))}let c=$t(a);if(!Ve(r)||r!==0&&!c?.exit_codes.some(p=>p===r))throw new TypeError(`${e} successful output must use exit code 0 or a command-declared successful effect exit`);let d=Lt(a).kind;if(n!==d)throw new TypeError(`${e} expected ${n}, but ${a} declares ${d}`)}function Ry(e,t,r){if(!Oe(e))throw new TypeError(`tasks.${t}.steps[${String(r)}] must be an object`);let n=`tasks.${t}.steps[${String(r)}]`,o=ae(e.id,`${n}.id`),i=sn(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"&&!Nt.includes(a))throw new TypeError(`${n}.expected_output_kind is unsupported`);let c=a,d=e.expected_accounting_mode;if(!by.includes(d))throw new TypeError(`${n}.expected_accounting_mode is unsupported`);let p=d;if(p==="independent_transport"&&c!=="refusal")throw new TypeError(`${n} independent_transport accounting is supported only for refusal steps`);let l=sn(e.required_fields,`${n}.required_fields`);if(l.some(E=>E.split(".").some(B=>B.length===0)))throw new TypeError(`${n}.required_fields must contain dot-separated own-property paths`);let f=wy(e.expected_field_values,`${n}.expected_field_values`),g=lt(e.expected_error_code,`${n}.expected_error_code`),_=lt(e.expected_refusal_surface,`${n}.expected_refusal_surface`),y=lt(e.recovery_for,`${n}.recovery_for`);return Oy(n,i,s,c,g,_),{id:o,args:i,expected_exit_code:s,expected_output_kind:c,expected_accounting_mode:p,required_fields:l,...f?{expected_field_values:f}:{},...g?{expected_error_code:g}:{},..._?{expected_refusal_surface:_}:{},...y?{recovery_for:y}:{}}}function Py(e,t){if(!Oe(e))throw new TypeError(`tasks[${String(t)}] must be an object`);let r=ae(e.id,`tasks[${String(t)}].id`),n=ae(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)=>Ry(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 z$(e){if(!Oe(e))throw new TypeError("agent-task transcript corpus must be an object");if(e.version!==pt)throw new TypeError(`agent-task transcript corpus version must be ${String(pt)}`);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)=>Py(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:pt,tasks:t}}import{createHash as an}from"node:crypto";function cn(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function K$(e,t){let r=cn(t.migrationId,"migrationId"),n=cn(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(f=>{let g=an("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:n,timestamp:i,reason:`Backfill ${r} from legacy item metadata`})}),d=an("sha256").update(JSON.stringify({migrationId:r,nodes:a,events:c})).digest("hex"),p=new Set([...t.existingEventIds??[]].filter(f=>typeof f=="string").map(f=>f.trim()).filter(Boolean)),l=c.filter(f=>!p.has(f.eventId));return Object.freeze({migration_id:r,fingerprint:d,nodes:a,events:Object.freeze(l),edge_count:c.length,skipped_existing_count:c.length-l.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}import*as dn from"node:module";var ce=["suggested_retry","candidate_command","example","next_step","migration_hint","restore_with"],ut={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"}},Y$=Object.freeze(Object.keys(ut));function pn(e){if(Object.hasOwn(ut,e))return ut[e]}var My=new Set([..."=([{,:;!?&|+-*%^~<>","=>"]);function Q(e,t){return e<t?-1:e>t?1:0}function Iy(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 vy(e){return e===void 0||e.kind==="punctuator"&&My.has(e.value)||e.kind==="identifier"&&["return","case","throw","else","yield"].includes(e.value)}function ky(e,t){if(/\s/u.test(e[t]))return t+1;if(e.startsWith("//",t)){let r=e.indexOf(`
31
+ `,t+2);return r===-1?e.length:r+1}if(e.startsWith("/*",t))return e.indexOf("*/",t+2)+2}function Ny(e,t,r){if(e[t]!=="/"||!vy(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 Ly(e,t){let r=e[t];if(r==="'"||r==='"'||r==="`"){let o=Iy(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 $y(e){let t=[],r=0;for(;r<e.length;){let n=ky(e,r);if(n!==void 0){r=n;continue}let o=Ny(e,r,t.at(-1));if(o!==void 0){r=o;continue}let i=Ly(e,r);i.token&&t.push(i.token),r=i.next}return t}var Dy=new Set(["object","block","pattern"]),Fy=new Set(["const","let","var"]),Gy=new Set(["}",")","]"]),Uy=new Set(["=","(","[",",",":","?","return"]);function jy(e,t,r){if([...r].reverse().find(i=>Dy.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"&&Fy.has(o.value)?"pattern":o?.value==="=>"||o?.value===")"?"block":o&&Uy.has(o.value)?"object":"block"}function By(e,t,r){let n=e[t];if(n.value==="{"){let a=jy(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 Hy(e){let t=$y(dn.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=By(t,o,n);if(c)n.push(c);else if(Gy.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 Vy(e){let t=[0];for(let r=0;r<e.length;r+=1)e[r]===`
32
+ `&&t.push(r+1);return t}function Ky(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 X$(e){let t=[],r=[];for(let o of[...e].sort((i,s)=>Q(i.path,s.path))){let i=Vy(o.content),s;try{s=Hy(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=Ky(i,a.offset),p=pn(c);p?t.push({path:o.path,line:d,field:c,kind:p.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(ce.map(o=>[o,t.filter(i=>i.kind===o).length]));for(let o of ce)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?Q(o.path,i.path):o.line!==i.line?o.line-i.line:Q(o.field,i.field)),r.sort((o,i)=>o.subject!==i.subject?Q(o.subject,i.subject):Q(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 J$(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])=>Q(c,d))){let c=pn(s),d=c?.kind==="migration_hint"&&o.semantics==="behavior_preserving"?{...c,semantics:"behavior_preserving"}:c,p=[a].flat();d!==void 0&&p.forEach((l,f)=>{let g="nested_value_field"in d&&typeof d.nested_value_field=="string"?d.nested_value_field:void 0,_=g&&typeof l=="object"&&l!==null&&!Array.isArray(l)?l[g]:l;if(typeof _!="string"||_.trim().length===0)return;let y=[...i,s,String(f)].map(E=>encodeURIComponent(E)).join("/");r.push({id:`${e}:${d.kind}:${y}`,probe_id:e,kind:d.kind,semantics:d.semantics,value:_})}),n(a,[...i,s])}};return n(t,[]),r}function Q$(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 Z$(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=ce.map(c=>{let d=e.filter(l=>l.kind===c),p=d.filter(l=>!o.has(l.id)).map(l=>i.get(l.id)).filter(l=>l!==void 0);return{kind:c,declared:d.length,observed:p.length,passed:d.filter(l=>{let f=i.get(l.id);return!o.has(l.id)&&f?.reachable===!0&&f.semantics===l.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 Wy(e,t){let r=new Map(ce.map(i=>[i,new Set]));for(let i of t)r.get(i.kind).add(i.value);let n=ce.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 eD=Wy;var rD=16,Yy=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"]),ln=18,un=Object.freeze([...Yy,"manifest_unknown_key","no_version_bounds_declared"].sort((e,t)=>e.localeCompare(t)));function nD(e,t=ln){return{ok:e.executable_error_code_count>=t,baseline:t,actual:e.executable_error_code_count}}function oD(e,t=un){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 mt(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 iD(e,t,r){let n=new Map(e.map(p=>[p.code,p.canonical_code??p.code])),o=new Map,i=0,s=0;for(let p of e){let l=mt(o,p.canonical_code??p.code);for(let f of p.owned_states??[])l.kinds.add("owned_state"),l.probeIds.add(f.probe_id)}for(let p of t){let l=n.get(p.error_code);if(l===void 0)continue;i+=1;let f=mt(o,l);f.kinds.add("closed_domain"),f.probeIds.add(p.probe_id)}for(let p of r){let l=n.get(p.error_code);if(l===void 0)continue;s+=1;let f=mt(o,l);f.kinds.add("grammar"),f.probeIds.add(p.probe_id)}let a=e.map(p=>{let l=p.canonical_code??p.code,f=o.get(l),g=[...f.probeIds].sort();return{code:p.code,canonical_code:l,disposition:g.length>0?"executable":"uncovered",evidence_kinds:[...f.kinds].sort(),probe_ids:g}}).sort((p,l)=>p.code<l.code?-1:1),c=a.filter(({disposition:p})=>p==="uncovered").map(({code:p})=>p),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 sD(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: ${ln}`,`- Required executable canonical codes: ${un.map(r=>`\`${r}\``).join(", ")}`,`- Uncovered error codes: ${e.uncovered_error_code_count}`,`- Coverage fraction: ${e.coverage_fraction.toFixed(6)}`,`- Closed-domain probes: ${e.closed_domain_probe_count}`,`- Grammar probes: ${e.grammar_probe_count}`,"","| Error code | Canonical code | Disposition | Evidence kinds | Probe count |","| --- | --- | --- | --- | --- |",...t,""].join(`
33
+ `)}function Xy(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 Jy(e){return[e.exit_code!==ue.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 ${ue.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."},...Xy(e)]}function dD(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 Jy(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}}var mn="not-a-declared-action";function Qy(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 de(e){return e.replaceAll(/[^a-z0-9]+/gu,"-").replaceAll(/^-|-$/gu,"")}function CD(e=je.filter(t=>Pt.some(r=>r.command===t.command&&r.disposition!=="package_owned"))){let t=new Set(e.filter(({command:r})=>!r.includes(" ")).map(({command:r})=>de(r)));return e.flatMap(r=>r.slots.flatMap((n,o)=>{if(!n.required)return[];let i=r.command.split(" "),s=de(r.command),a=i.length>1&&t.has(s)?i.map(de).join("--"):s,c=Z(r.command).flatMap(p=>p.required?[p.flag,...p.value_name?["example"]:[]]:[]),d=Ue.some(p=>p.command===r.command);return[{probe_id:`required-argument-${a}-${de(n.name)}`,command:r.command,refusal_args:[...i,...r.slots.slice(0,o).map(p=>Qy(r.command,p)),...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:n.name,missing_argument_index:o}]})).sort((r,n)=>r.probe_id.localeCompare(n.probe_id))}function Zy(e){switch(N(e)){case"assurance":case"workspace snapshot":return Ue.filter(({parent:t})=>t===e).map(({action:t})=>t);case"graph":return Ne;case"merge":return Le;case"plan":return Ke;case"profile":return We;case"schema":return Dt;default:throw new Error(`Required positional action family ${e} has no authoritative value domain.`)}}function yD(e=je){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-${de(t)}`,command:t,refusal_args:[...r,mn],recovery_args:[...r,"--help"],error_code:"unknown_subcommand",rejected_value:mn,allowed_values:[...Zy(t)].sort()}}).sort((t,r)=>t.probe_id.localeCompare(r.probe_id))}function eS(e,t){let r=[...t].sort();return e.length===t.length&&[...e].sort().every((n,o)=>n===r[o])}function tS(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&&!eS(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 SD(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=>tS(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}}var ft=[{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 ED(){return ft.map(e=>({...e}))}function rS(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 AD(e){let t=new Map(e.map(o=>[o.probe_id,o])),r=[],n=0;for(let o of ft){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=rS(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:ft.length,closed_probe_count:n,findings:r}}var Re,nS=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 oS(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=nS[N(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(N(e))?"linked-file-path":["comments","notes","learnings"].includes(N(e))?"entry-file-input":"plan-definition-file"}function Pe(){if(Re!==void 0)return Re;let t=ee.filter(({command:i})=>Be(i)).flatMap(({command:i,family:s})=>Mt(i,Z(i)).map(a=>({command:i,family:s,concept:oS(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 Re=Object.freeze(n.map(i=>Object.freeze({...i,concept:o.get(i.concept)?.size===1?i.concept:`${i.concept}@${i.command}`}))),Re}function PD(){return Object.freeze(Pe().map(e=>Object.freeze({command:e.command,canonical_flag:e.flag,accepted_spellings:Object.freeze([...new Set([e.flag,...e.aliases])].sort())})))}var fn=Object.freeze({init:30,item:20,config:36,extension:55,package:56,packages:56,install:27,upgrade:29,create:104,copy:24,focus:22,list:86,"list-all":86,"list-draft":84,"list-open":84,"list-in-progress":84,"list-blocked":84,"list-closed":84,"list-canceled":84,aggregate:40,context:45,ctx:45,get:30,graph:34,search:78,duplicates:25,eval:25,next:38,history:36,events:34,"history-attest":23,"history-redact":27,"history-repair":28,"history-compact":30,"history-author-acknowledge":28,merge:29,schema:43,profile:22,activity:36,restore:23,update:105,"update-many":146,close:32,"close-many":72,delete:24,append:25,comments:32,notes:36,learnings:32,files:41,docs:32,deps:32,plan:111,test:58,"test-all":41,telemetry:21,stats:29,health:36,validate:46,assurance:30,gc:22,workspace:23,contracts:29,claim:40,release:25,"start-task":24,"pause-task":23,"close-task":24,meet:33,event:33,remind:29,"test-runs-worker":20}),iS=1,_n=Object.freeze(Object.fromEntries(Object.entries({...fn,...Object.fromEntries(ve.flatMap(({alias:e,canonical:t})=>{let r=fn[e];return r===void 0?[]:[[t,r]]}))}).map(([e,t])=>[e,t+iS])));function hn(){let e=new Map(Object.keys(_n).map(t=>[t,0]));for(let{command:t}of Pe())e.set(t,Number(e.get(t))+1);return Object.freeze(Object.entries(_n).map(([t,r])=>Object.freeze({command:t,current:Number(e.get(t)),maximum:r})))}function sS(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 aS(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 cS(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 MD(e=Pe(),t=hn(),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 p=i.get(c.concept);p!==void 0&&p!==c.value_kind?n.push({code:"inconsistent_concept_kind",command:c.command,detail:`${c.concept} uses both ${p} and ${c.value_kind}.`}):i.set(c.concept,c.value_kind);let l=s.get(c.concept);l!==void 0&&l!==c.flag?n.push({code:"semantic_spelling_collision",command:c.command,detail:`${c.concept} is canonicalized by both ${l} and ${c.flag}.`}):s.set(c.concept,c.flag)}return sS(e,o,n),aS(a,t,n),cS(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 ID(){let e=Pe(),t=hn(),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(`
34
+ `)}function kD(e){return e}function ND(e){return e}function LD(e){return e}function $D(e){return e}function DD(e){return e}function FD(e){return e}function GD(e){return e}function UD(e){return e}function jD(e){return e}function BD(e){return e}function zD(e){return e}function qD(e){return e}function HD(e){return e}function VD(e){return{handled:!0,result:e}}function KD(){return{handled:!1}}function WD(e){return e}function YD(e){return e}function XD(e){return e}function JD(e){return e}function QD(e){return e}function ZD(e){return e}function eF(e){return e}function tF(e){return e}function rF(e){return e}function dS(e={},t={}){return new _e(t).extension(void 0,{...e,migrate:!0})}function pS(e={},t={}){return new _e(t).packageMigrate(e)}function k(e){if(typeof e!="string"||!At(e))throw new TypeError("Invalid reliability timestamp.");return Date.parse(e)}function lS(e){let t=k(e.window_start),r=k(e.window_end);if(t>=r||!Number.isFinite(e.max_failure_rate)||e.max_failure_rate<0||e.max_failure_rate>=1||!Number.isSafeInteger(e.min_completed_attempts)||e.min_completed_attempts<1)throw new TypeError("Invalid reliability window policy.");if(e.families.length===0||e.families.some(n=>typeof n!="string"||n.trim().length===0)||new Set(e.families).size!==e.families.length)throw new TypeError("Expected unique, nonempty reliability families.");return{start:t,end:r}}function uS(e,t,r,n){let o=new Map(t.map(s=>[s,[]])),i=new Set;for(let s of e){if(typeof s.id!="string"||s.id.trim().length===0||i.has(s.id))throw new TypeError("Invalid or duplicate reliability attempt identity.");i.add(s.id);let a=o.get(s.family);if(!a||!["success","failure","pending"].includes(s.outcome)||s.cause!==void 0&&(!["product","infrastructure","unknown"].includes(s.cause)||s.outcome!=="failure"))throw new TypeError("Invalid reliability attempt family, outcome or cause.");let c=k(s.started_at);if(s.repaired_at!==void 0&&(k(s.repaired_at)<c||s.outcome!=="failure"))throw new TypeError("Invalid reliability repair chronology.");c>=r&&c<n&&a.push(s)}return o}function TF(e,t){let{start:r,end:n}=lS(t),i=[...uS(e,t.families,r,n)].map(([s,a])=>{let c=a.filter(_=>_.outcome==="failure"),d=a.filter(_=>_.outcome!=="pending").length,p=d===0?null:c.length/d,l=c.filter(_=>_.repaired_at!==void 0&&k(_.repaired_at)<n),f={product:0,infrastructure:0,unknown:0};for(let _ of c)f[_.cause??"unknown"]+=1;let g=[];return d<t.min_completed_attempts&&g.push("insufficient_completed_attempts"),p!==null&&p>t.max_failure_rate&&g.push("failure_rate"),{family:s,attempts:a.length,completed:d,failed:c.length,pending:a.length-d,failure_rate:p,affected_days:[...new Set(c.map(_=>new Date(k(_.started_at)).toISOString().slice(0,10)))].sort(),repair_minutes:l.map(_=>(k(_.repaired_at)-k(_.started_at))/6e4).sort((_,y)=>_-y),unresolved:c.length-l.length,causes:f,violations:g,ok:g.length===0}});return{schema:"pm-reliability-window/1",window_start:new Date(r).toISOString(),window_end:new Date(n).toISOString(),ok:i.every(s=>s.ok),families:i}}function pe(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function mS(e){if(!Array.isArray(e)||e.length<2)throw new TypeError("Expected at least two artifact ledgers.");let t=new Map;for(let r of e){if(r===null||typeof r!="object"||!pe(r.name)||t.has(r.name)||r.complete!==!0)throw new TypeError("Expected unique complete artifact ledgers.");if(!Array.isArray(r.identities))throw new TypeError("Invalid or duplicate artifact identity.");let n=new Set(r.identities);if(n.size!==r.identities.length||[...n].some(o=>!pe(o)))throw new TypeError("Invalid or duplicate artifact identity.");t.set(r.name,n)}if([...t.values()].every(r=>r.size===0))throw new TypeError("Empty inventories cannot establish artifact reconciliation.");return t}function fS(e,t){if(!Array.isArray(e))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let r=new Map;for(let n of e){if(n===null||typeof n!="object"||!pe(n.identity)||r.has(n.identity)||!pe(n.reason)||!pe(n.evidence))throw new TypeError("Expected unique evidence-backed artifact exceptions.");let o=n.missing_from;if(!Array.isArray(o)||o.length===0||o.length>=t.length||new Set(o).size!==o.length||[...o].some(i=>!t.includes(i)))throw new TypeError("Invalid artifact exception ledger signature.");r.set(n.identity,n)}return r}function AF(e,t=[]){let r=mS(e),n=[...r.keys()].sort(),o=fS(t,n),i=[...new Set([...r.values()].flatMap(d=>[...d]))].sort(),s=[],a=new Set;for(let d of i){let p=n.filter(g=>!r.get(g).has(d));if(p.length===0)continue;let l=o.get(d),f=l!==void 0&&JSON.stringify([...l.missing_from].sort())===JSON.stringify(p);f&&a.add(d),s.push({identity:d,present_in:n.filter(g=>r.get(g).has(d)),missing_from:p,disposition:f?{reason:l.reason,evidence:l.evidence}:null})}let c=[...o.keys()].filter(d=>!a.has(d)).sort();return{schema:"pm-artifact-ledgers/1",ok:s.every(d=>d.disposition!==null)&&c.length===0,counts:Object.fromEntries(n.map(d=>[d,r.get(d).size])),findings:s,stale_exceptions:c}}import{createHash as Cn,createHmac as _S,randomBytes as hS,timingSafeEqual as gS}from"node:crypto";var a1="dev.unbrained.pm/progressive-tool-discovery",c1=Object.freeze({version:1,discoveryTool:"pm_discover",canonicalResult:"structuredContent.result",compatibilityText:"pointer"}),CS=Object.freeze(["pm_discover","pm_next","pm_context","pm_search","pm_get"]),j=Object.freeze({lexical:.4,semantic:.2,graph:.1,permission:.15,freshness:.05,usage:.1}),yS=Object.freeze(["profile_changed","tool_contract_changed","workspace_extension_changed","authorization_changed","ranking_signal_changed","cursor_integrity_key_rotated"]),yn={core:0,standard:1,full:2,internal:3},Sn=Object.freeze(["core","standard","full"]),SS=new Set(["core","standard","full","custom"]),Tn=new Set(ee.map(({family:e})=>e)),TS=hS(32);function Ie(e,t){if(typeof e!="string")throw new S(`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 S(`pm tool discovery ${t} must be a string of at most 4096 Unicode characters.`,64);return e}function En(e){if(!Number.isInteger(e)||Number(e)<1||Number(e)>100)throw new S("pm tool discovery limit must be from 1 through 100.",64);return Number(e)}function An(e){if(e!=="unbounded"&&(!Number.isInteger(e)||Number(e)<128))throw new S("pm tool discovery outputBudget must be unbounded or an integer of at least 128.",64);return e==="unbounded"?e:Number(e)}function xn(e){if(e!==void 0&&typeof e!="boolean")throw new S("pm tool discovery includeSchema must be a boolean.",64);return e===!0}function bn(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new S("pm tool discovery options must be an object.",64)}function ES(e){if(!Array.isArray(e))throw new S("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 S(`pm tool discovery candidate ${t} must be an object.`,64);if(typeof r.name!="string"||r.name.trim().length===0)throw new S(`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 S(`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 S(`pm tool discovery candidate ${t} inputSchema must be an object.`,64);if(r.authorized!==void 0&&typeof r.authorized!="boolean")throw new S(`pm tool discovery candidate ${t} authorized must be a boolean.`,64)}}function d1(e){if(bn(e),e.family!==void 0&&(typeof e.family!="string"||!Tn.has(e.family)))throw new S("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 S("pm tool discovery tier must be core, standard, or full.",64);return{...e.query!==void 0?{query:Ie(e.query,"query")}:{},...e.family!==void 0?{family:e.family}:{},...e.tier!==void 0?{tier:e.tier}:{},...e.limit!==void 0?{limit:En(e.limit)}:{},...e.cursor!==void 0?{cursor:Ie(e.cursor,"cursor")}:{},...e.includeSchema!==void 0?{includeSchema:xn(e.includeSchema)}:{},...e.outputBudget!==void 0?{outputBudget:An(e.outputBudget)}:{}}}function AS(e){return e===void 0||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e))}function le(e){return[...new Set(e.toLowerCase().match(/[a-z0-9]+/gu)??[])].sort()}function xS(e,t){let r=le(e);if(r.length===0)return 0;let n=new Set(le(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 bS(e,t){let r=le(e);if(r.length===0)return 0;let n=t.toLowerCase(),o=le(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 gn(e){return Cn("sha256").update(JSON.stringify(e)).digest("hex").slice(0,24)}function wn(e,t,r){return _S("sha256",r).update(JSON.stringify({version:1,fingerprint:e,offset:t})).digest("base64url")}function wS(e,t,r){let n={version:1,offset:t,signature:wn(e,t,r)};return Buffer.from(JSON.stringify(n),"utf8").toString("base64url")}function OS(e,t,r,n){if(e===void 0)return 0;try{let o=JSON.parse(Buffer.from(e,"base64url").toString("utf8")),i=o.offset;if(o.version!==1||typeof i!="number"||!Number.isInteger(i)||i<0||i>r||typeof o.signature!="string")throw new Error("cursor fields do not match the request");let s=Buffer.from(wn(t,i,n),"base64url"),a=Buffer.from(o.signature,"base64url");if(a.length!==s.length||!gS(a,s))throw new Error("cursor signature does not match the request");return i}catch(o){throw new S("Invalid or stale pm tool discovery cursor; restart discovery without cursor.",64,{reason:String(o)})}}function _t(e,t,r){return{value:AS(e),weight:t,available:r!=="unavailable",source:r}}function Me(e,t,r){return _t(e??t,r,e===void 0?"computed":"host")}function RS(e,t,r){let n=Object.hasOwn(fe,e.name)?fe[e.name]:"help",o=qe(n),i=`${e.name} ${e.description} ${n} ${o}`,s=xS(t,i),a=new Set(le(t)),c={lexical:_t(s,j.lexical,"computed"),semantic:Me(e.signals?.semantic,bS(t,i),j.semantic),graph:Me(e.signals?.graph,a.has(o)||a.has(n)?1:0,j.graph),permission:_t(1,j.permission,"authorization"),freshness:Me(e.signals?.freshness,1,j.freshness),usage:Me(e.signals?.usage,CS.includes(e.name)?1:0,j.usage)},d=Object.values(c).reduce((p,l)=>p+l.value*l.weight,0);return{name:e.name,description:e.description,command:n,tier:He(n),family:o,score:Number(d.toFixed(6)),signals:c,...r?{input_schema:structuredClone(e.inputSchema)}:{}}}function PS(e){if(e.cursorIntegrityKey!==void 0&&(!(e.cursorIntegrityKey instanceof Uint8Array)||e.cursorIntegrityKey.byteLength<32))throw new S("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 S("pm tool discovery tier must be core, standard, or full.",64);if(e.family!==void 0&&(typeof e.family!="string"||!Tn.has(e.family)))throw new S("pm tool discovery family must be a declared capability family.",64);if(e.profile!==void 0&&(typeof e.profile!="string"||!SS.has(e.profile)))throw new S("pm tool discovery profile must be core, standard, full, or custom.",64)}function MS(e){let r=Ie(e.query===void 0?"":e.query,"query").trim().replace(/\s+/gu," ");Ie(e.cursor===void 0?"":e.cursor,"cursor");let n=En(e.limit===void 0?10:e.limit),o=An(e.outputBudget===void 0?1200:e.outputBudget);return PS(e),{query:r,includeSchema:xn(e.includeSchema),limit:n,budget:o,maximumTier:yn[e.tier??"full"],profile:e.profile===void 0?"core":e.profile}}function On(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 IS(e,t,r){return e.filter(n=>n.authorized!==!1).map(n=>RS(n,r.query,r.includeSchema)).filter(n=>n.tier!=="internal"&&yn[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 vS(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(On(r(i+1),t,a)>t)break;n.push(s),o=a}return n}function p1(e,t={}){ES(e),bn(t);let r=MS(t),n=t.cursorIntegrityKey??TS,o=IS(e,t,r),i=gn({query:r.query,family:t.family??null,tier:t.tier??"full",includeSchema:r.includeSchema,profile:r.profile,ranked:o}),s=OS(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:j},cache:{key:gn({fingerprint:i,cursorIntegrityKey:Cn("sha256").update(n).digest("hex"),limit:r.limit,offset:s,budget:r.budget}),ttl_ms:3e4,scope:"private",invalidates_on:yS}},p=(_,y=_.length)=>{let E=s+y,B=E<o.length,O=[...c];return y<a.length&&O.push({name:"tools",reason:"token_budget",restore_with:"Continue with next_cursor or increase outputBudget."}),{...d,tools:[..._],returned:y,has_more:B,...B?{next_cursor:wS(i,E,n)}:{},omission_receipt:{has_omissions:O.length>0,omitted:O}}},l=_=>{let y=p(_),E=On(y,r.budget);return{...y,token_cost:{estimated_tokens:E,budget:r.budget,within_budget:r.budget==="unbounded"||E<=r.budget}}},f=vS(a,r.budget,_=>p([],_)),g=l(f);if(a.length>0&&f.length===0){let _=l([a[0]]).token_cost.estimated_tokens;throw new S(`pm tool discovery outputBudget is too small to return a tool; increase it to at least ${_}.`,64,{required:String(_)})}if(r.budget!=="unbounded"&&g.token_cost.estimated_tokens>r.budget)throw new S(`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}export{rR as ACTIONABILITY_ORDERING_KINDS,Yc as ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS,Cc as ACTIVITY_FLAG_CONTRACTS,Yo as AGENT_PROVENANCE_DIMENSIONS,ra as AGGREGATE_FLAG_CONTRACTS,Ba as APPEND_FLAG_CONTRACTS,VI as ASSURANCE_ACTIONS,KI as ASSURANCE_DECLARATION_KINDS,nM as ASSURANCE_DOCUMENT_VERSION,cc as ASSURANCE_FLAG_CONTRACTS,oM as ASSURANCE_GATE_TRIGGERS,iM as ASSURANCE_MEASUREMENT_SOURCE_KINDS,XM as ASSURANCE_PRESET_IDS,ZP as AssuranceEvaluationRefusalError,QP as AssuranceMutationRefusalError,eM as AssuranceSourceResolutionError,No as BASELINE_ITEM_FORMAT_VERSION,tP as BOUNDARY_FIXTURE_CAPTURE_SOURCES,NR as BRIEF_LIST_FIELDS,Jo as BUILTIN_AGENT_PROVENANCE_ADAPTERS,W as BUILTIN_CORPUS_SHAPES,Xo as BUILTIN_HARNESS_SIGNAL_DESCRIPTORS,po as BUILTIN_ITEM_TYPE_VALUES,Vt as BUILTIN_PROFILES,vx as BUILTIN_RELATIONSHIP_KINDS,Vc as CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS,gc as CALENDAR_FLAG_CONTRACTS,za as CLAIM_FLAG_CONTRACTS,Fd as CLOSE_ACTION_OPTION_KEYS,Ua as CLOSE_FLAG_CONTRACTS,ja as CLOSE_MANY_FLAG_CONTRACTS,Ya as CLOSE_TASK_FLAG_CONTRACTS,na as COMMENTS_FLAG_CONTRACTS,_T as COMMON_MUTATION_COMMAND_OPTION_KEYS,Mc as COMPLETION_FLAG_CONTRACTS,ho as CONFIDENCE_TEXT_VALUES,Ca as CONFIG_FLAG_CONTRACTS,Kc as CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS,Iv as CONTEXT_EVALUATION_METRIC_NAMES,Sc as CONTEXT_FLAG_CONTRACTS,XA as CONTEXT_INTENT_LIMIT_OVERRIDE_WARNING,zt as CONTEXT_OUTPUT_VALUES,$v as CONTEXT_PACKING_PROFILES,Av as CONTEXT_RECENCY_EPOCH,Ov as CONTEXT_RELEVANCE_SERVICE,bv as CONTEXT_RELEVANCE_SIGNAL_NAMES,Gv as CONTEXT_SIGNAL_SET_VERSION,Fv as CONTEXT_SIGNAL_STORE_FORMAT_VERSION,Uv as CONTEXT_SIGNAL_STORE_WARNING_DETAILS,GA as CONTEXT_USAGE_LIMITS,Pc as CONTRACTS_FLAG_CONTRACTS,mc as COPY_FLAG_CONTRACTS,ld as CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,md as CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,ud as CREATE_COMMANDER_STRING_OPTION_CONTRACTS,DS as CREATE_DIRECT_CLOSE_REASON_DEFAULT,dc as CREATE_FLAG_CONTRACTS,eE as CURRENT_HISTORY_HASH_ALGORITHM,Cx as CURRENT_HISTORY_ITEM_HASH_VERSION,Sx as CURRENT_HISTORY_RECORD_HASH_VERSION,Lo as CURRENT_ITEM_FORMAT_VERSION,qv as ContextSignalStore,UA as ContextUsageValidationError,hv as DEFAULT_AUTHOR_IDENTITY_VOCABULARY,ak as DEFAULT_CHILD_SAMPLE_LIMIT,kR as DEFAULT_COMPACT_LIST_FIELDS,$w as DEFAULT_DERIVED_INDEX_MINIMUM_ITEMS,Rf as DEFAULT_EVAL_QUERIES_RELATIVE_PATH,VM as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,av as DEFAULT_TERMINAL_TRANSITION_POLICY,Wv as DEFAULT_WORKSPACE_MEMORY_MINIMUM_ITEMS,aP as DEFECT_ESCAPE_CLASSES,cP as DEFECT_GATE_EVIDENCE_DISPOSITIONS,Ha as DELETE_FLAG_CONTRACTS,mo as DEPENDENCY_KIND_VALUES,Ac as DEPS_FLAG_CONTRACTS,aa as DOCS_FLAG_CONTRACTS,ic as DUPLICATES_FLAG_CONTRACTS,xI as DURABLE_MERGE_RECEIPT_INTRODUCED_AT,uP as DefectRecurrencePolicyParseError,bc as EVAL_FLAG_CONTRACTS,Tf as EVAL_METRIC_NAMES,bf as EVAL_QUERY_SET_CONTRACT,wf as EVAL_QUERY_SET_EXAMPLE,xf as EVAL_QUERY_SET_SCHEMA_ID,yc as EVENTS_FLAG_CONTRACTS,Ja as EVENT_FLAG_CONTRACTS,$n as EXECUTABLE_COMMAND_ALIASES,ue as EXIT_CODE,Pa as EXTENSION_ACTIVATE_FLAG_CONTRACTS,Ra as EXTENSION_ADOPT_ALL_FLAG_CONTRACTS,$a as EXTENSION_ADOPT_FLAG_CONTRACTS,Fk as EXTENSION_CAPABILITIES,LS as EXTENSION_CAPABILITY_CONTRACT,kS as EXTENSION_CAPABILITY_CONTRACT_VERSION,NS as EXTENSION_CAPABILITY_LEGACY_ALIASES,Ui as EXTENSION_CAPABILITY_REGISTRATION_SURFACES,La as EXTENSION_CATALOG_FLAG_CONTRACTS,Ma as EXTENSION_DEACTIVATE_FLAG_CONTRACTS,Oa as EXTENSION_DESCRIBE_FLAG_CONTRACTS,Na as EXTENSION_DOCTOR_FLAG_CONTRACTS,wa as EXTENSION_EXPLORE_FLAG_CONTRACTS,ya as EXTENSION_FLAG_CONTRACTS,Ta as EXTENSION_INIT_FLAG_CONTRACTS,xa as EXTENSION_INSTALL_FLAG_CONTRACTS,va as EXTENSION_MANAGE_FLAG_CONTRACTS,Ia as EXTENSION_MIGRATE_FLAG_CONTRACTS,Gk as EXTENSION_POLICY_MODES,Uk as EXTENSION_POLICY_SURFACES,ka as EXTENSION_RELOAD_FLAG_CONTRACTS,Bk as EXTENSION_SANDBOX_PROFILES,Sa as EXTENSION_SCOPE_FLAG_CONTRACTS,jk as EXTENSION_TRUST_MODES,ba as EXTENSION_UNINSTALL_FLAG_CONTRACTS,xP as EXTERNAL_DEPENDENCY_RESOLUTION_STATUSES,EP as EXTERNAL_DEPENDENCY_SOURCE_KIND,AP as EXTERNAL_DEPENDENCY_SOURCE_KIND_ALIAS,uO as ExtensionCommandError,sa as FILES_FLAG_CONTRACTS,fc as FOCUS_FLAG_CONTRACTS,nc as GC_FLAG_CONTRACTS,FR as GET_DEPTH_INPUT_VALUES,DR as GET_DEPTH_VALUES,Tc as GET_FLAG_CONTRACTS,ea as GLOBAL_FLAG_CONTRACTS,ou as GRAPH_DURABLE_CACHE_MIN_ITEMS,nu as GRAPH_DURABLE_CACHE_VERSION,xc as GRAPH_FLAG_CONTRACTS,vR as GRAPH_QUERY_DEFAULTS,Ne as GRAPH_SUBCOMMAND_VALUES,Ec as GUIDE_FLAG_CONTRACTS,sc as HEALTH_FLAG_CONTRACTS,ua as HISTORY_AUTHOR_ACKNOWLEDGE_FLAG_CONTRACTS,BM as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,QI as HISTORY_COMPACT_BULK_DEFAULT_MIN_ENTRIES,ma as HISTORY_COMPACT_FLAG_CONTRACTS,li as HISTORY_EVENT_CLASSIFICATION_VERSION,ca as HISTORY_FLAG_CONTRACTS,QT as HISTORY_HASH_ALGORITHMS,xw as HISTORY_ITEM_HASH_VERSION_3_INTRODUCED_IN,pa as HISTORY_REDACT_FLAG_CONTRACTS,la as HISTORY_REPAIR_FLAG_CONTRACTS,jp as INIT_AGENT_GUIDANCE_MODE_VALUES,ga as INIT_FLAG_CONTRACTS,Da as INSTALL_FLAG_CONTRACTS,sI as IN_PROGRESS_WORK_DETAIL_LIMIT,_o as ISSUE_SEVERITY_VALUES,lc as ITEM_COMPLETE_FLAG_CONTRACTS,_I as ITEM_LATEST_TIMESTAMP_FIELDS,$S as ITEM_METADATA_KEY_ORDER,pc as ITEM_MUTATE_FLAG_CONTRACTS,uc as ITEM_REOPEN_FLAG_CONTRACTS,$s as ITEM_REVISION_CONFLICT_CHANGE_LIMIT,Ls as ITEM_REVISION_CONFLICT_CODE,cI as ITEM_SCALAR_MISSING_VALUE,lo as ITEM_TYPE_VALUES,fI as ITEM_UNION_COLLECTION_FIELDS,zv as JsonFileContextSignalStoreAdapter,ia as LEARNINGS_FLAG_CONTRACTS,ZT as LEGACY_HISTORY_HASH_ALGORITHM,al as LINKED_ARTIFACT_NOTE_CONFLICT_MODES,zu as LINKED_TEST_ENV_NAME_PATTERN,qu as LINKED_TEST_PM_CONTEXT_MODE_VALUES,Bu as LINKED_TEST_PROTECTED_ENV_KEYS,Hu as LINKED_TEST_WORKSPACE_CONTEXT_MODE_VALUES,qc as LIST_COMMANDER_STRING_OPTION_CONTRACTS,LR as LIST_COMMAND_DEFAULT_PROJECTIONS,qk as LIST_FILTER_EXTENSION_FLAG_DEFINITIONS,ta as LIST_FILTER_FLAG_CONTRACTS,vP as LIST_SORT_FIELDS,kP as LIST_SORT_ORDER_VALUES,ui as MAINTENANCE_HISTORY_OPERATIONS,sk as MAX_CHILD_PROJECTION_ITEMS,rP as MAX_WAIVER_NOTICE_DAYS,zS as MAX_WORKFLOW_POLICIES,qS as MAX_WORKFLOW_POLICY_TERMS,Xa as MEET_FLAG_CONTRACTS,Ok as MERGE_DRIVER_ARTIFACT_VALUES,da as MERGE_FLAG_CONTRACTS,Le as MERGE_SUBCOMMAND_VALUES,Mk as MUTATION_EVENT_WIRE_BUDGET,ie as MemoryRelationshipGraphAdapter,Wc as NEXT_COMMANDER_STRING_OPTION_CONTRACTS,Oc as NEXT_FLAG_CONTRACTS,qm as NEXT_OUTPUT_VALUES,_v as NEXT_RANKING_POLICIES,oa as NOTES_FLAG_CONTRACTS,CR as OutputEnvelopeFitError,Ea as PACKAGE_FLAG_CONTRACTS,Aa as PACKAGE_INIT_FLAG_CONTRACTS,Wa as PAUSE_TASK_FLAG_CONTRACTS,Dd as PLAN_CREATE_METADATA_PARAMETER_KEYS,ha as PLAN_FLAG_CONTRACTS,Xs as PLAN_SHOW_DEPTH_VALUES,Ke as PLAN_SUBCOMMANDS,ef as PLAN_TEMPLATE_NAMES,by as PM_AGENT_TASK_ACCOUNTING_MODES,pt as PM_AGENT_TASK_TRANSCRIPT_VERSION,vn as PM_BULK_LIFECYCLE_COMMAND_ALIASES,os as PM_CLI_ERROR_DETAILS_LIMITS,ps as PM_CLI_EXPECTED_ERROR_NAME,HR as PM_CLI_GRAMMAR_CONTRACT,UR as PM_CLI_GRAMMAR_NOUNS,Yn as PM_CLI_ONLY_TOOL_ACTION_WAIVERS,jR as PM_CLI_SHARED_VERBS,Ln as PM_COMMAND_ALIAS_CONTRACTS,ee as PM_COMMAND_CAPABILITY_CONTRACTS,Pt as PM_COMMAND_DESTINATION_CONTRACTS,KP as PM_COMMAND_EXIT_CONTRACTS,VP as PM_COMMAND_EXIT_OUTCOME_CONTRACTS,xi as PM_COMMAND_OUTPUT_BUDGET_CONTRACTS,zP as PM_COMMAND_OUTPUT_ENVELOPE_CONTRACTS,je as PM_COMMAND_POSITIONAL_CONTRACTS,pp as PM_COMMAND_VISIBILITY_CONTRACTS,$M as PM_COMPLETE_LIST_FINDING_CODES,pR as PM_CONTEXT_INTENTS_FILE,JA as PM_CONTEXT_INTENT_CONTRACTS,In as PM_CONTEXT_OPS_COMMAND_ALIASES,Hn as PM_CORE_COMMAND_NAMES,F as PM_CORPUS_SHAPE_SCHEMA,Jn as PM_DEPRECATED_TOOL_ACTIONS,yi as PM_DIAGNOSTIC_DEGRADATION_STEPS,Si as PM_DIAGNOSTIC_OUTPUT_BUDGET_CONTRACTS,Ci as PM_DIAGNOSTIC_OUTPUT_CLASSES,Qn as PM_DISCOVERABLE_TOOL_ACTIONS,Yr as PM_EPISODE_SCHEMA,jP as PM_ERROR_CODE_CATALOG,DP as PM_ERROR_CODE_EXIT_CLASS_CONTRACTS,tn as PM_EXACT_COVERAGE_METRICS,Gn as PM_EXTENSION_CAPABILITY_CONTRACTS,Vn as PM_EXTENSION_PACKAGE_ACTION_SUBCOMMANDS,jn as PM_EXTENSION_POLICY_MODE_CONTRACTS,qn as PM_EXTENSION_POLICY_SURFACE_CONTRACTS,zn as PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS,Un as PM_EXTENSION_SERVICE_NAME_CONTRACTS,Bn as PM_EXTENSION_TRUST_MODE_CONTRACTS,Mi as PM_GENERIC_REFUSAL_GUIDANCE,OM as PM_GITATTRIBUTES_END,wM as PM_GITATTRIBUTES_START,PM as PM_GITATTRIBUTES_V2_END,RM as PM_GITATTRIBUTES_V2_START,Cp as PM_GITIGNORE_END,gp as PM_GITIGNORE_START,rv as PM_HISTORY_ATTESTATION_CONTRACT,Mn as PM_HISTORY_COMMAND_ALIASES,VT as PM_HISTORY_OPERATION_ALIASES,WT as PM_HISTORY_OPERATION_CONTRACT,KT as PM_HISTORY_OPERATION_PATTERNS,Wn as PM_ITEM_ACTION_SUBCOMMANDS,qT as PM_ITEM_HISTORY_OPERATIONS,nt as PM_MCP_APPS_EXTENSION,vr as PM_MCP_APPS_SERVER_CAPABILITY,Ae as PM_MCP_APPS_SPEC_VERSION,Lr as PM_MCP_APP_CONTRACTS,Nr as PM_MCP_APP_MIME_TYPE,CS as PM_MCP_ENTRY_TOOL_NAMES,m as PM_MCP_ERROR_CODES,iL as PM_MCP_HTTP_PROTOCOL_VERSION,jg as PM_MCP_INPUT_REQUEST_METHODS,or as PM_MCP_LEGACY_PROTOCOL_VERSIONS,nr as PM_MCP_LOG_LEVELS,x as PM_MCP_META_KEYS,a1 as PM_MCP_PROGRESSIVE_DISCOVERY_EXTENSION,c1 as PM_MCP_PROGRESSIVE_DISCOVERY_SERVER_CAPABILITY,_p as PM_MCP_PROMPT_CONTRACTS,q as PM_MCP_PROTOCOL_VERSION,fp as PM_MCP_RESOURCE_CONTRACTS,it as PM_MCP_SKILLS_DRAFT_REVISION,$r as PM_MCP_SKILLS_EXTENSION,KC as PM_MCP_SKILLS_SERVER_CAPABILITY,P as PM_MCP_SKILL_LIMITS,Te as PM_MCP_SUBSCRIPTION_ID_META_KEY,te as PM_MCP_SUPPORTED_PROTOCOL_VERSIONS,J0 as PM_MCP_TASKS_EXTENSION,Qg as PM_MCP_TASK_STATUSES,fe as PM_MCP_TOOL_COMMAND_CONTRACTS,NE as PM_MODE_PAIRED_OUTPUT_PROJECTION_CONTRACTS,fs as PM_MUTATION_ACTION_CONTRACTS,ve as PM_NAMESPACED_COMMAND_ALIASES,Kr as PM_OBSERVATION_SCHEMA,gi as PM_OUTPUT_BUDGET_CLASSES,hi as PM_OUTPUT_DEGRADATION_STEPS,Nt as PM_OUTPUT_ENVELOPE_KINDS,Gt as PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,Kn as PM_PACKAGE_ONLY_ACTION_SUBCOMMANDS,Ft as PM_PACKAGE_RESOURCE_KINDS,Ue as PM_POSITIONAL_ACTION_CONTRACTS,Hd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA,zd as PM_PROVIDER_TOOL_PARAMETERS_SCHEMA_VERSION,lA as PM_READ_OUTPUT_COMPOSITION_OPTION_FLAGS,wA as PM_READ_OUTPUT_CONTINUATION_FINGERPRINT_POLICIES,dA as PM_READ_OUTPUT_DIMENSIONS,pA as PM_READ_OUTPUT_OPTION_FLAGS,oA as PM_READ_OUTPUT_SESSION_MAX_SEEN_ITEM_IDS,nA as PM_READ_OUTPUT_SESSION_MIN_TOKENS,ME as PM_READ_OUTPUT_SURFACES,uA as PM_READ_OUTPUT_SURFACE_CONTRACTS,eA as PM_READ_OUTPUT_TAIL_RETENTION_POLICIES,kE as PM_READ_ROW_CONTRACTS,vE as PM_READ_ROW_JQ_SELECTOR,Ni as PM_RECOVERY_ECHO_FIELDS,Y$ as PM_RECOVERY_REFERENCE_FIELDS,ce as PM_RECOVERY_REFERENCE_KINDS,Yy as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE,un as PM_REFUSAL_CLOSURE_EXECUTABLE_CANONICAL_CODE_BASELINE_V2,rD as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE,ln as PM_REFUSAL_CLOSURE_EXECUTABLE_CODE_BASELINE_V2,kn as PM_RELOCATED_COMMAND_ALIASES,Kd as PM_REPRODUCIBLE_PROCESS_ENV,WP as PM_SUCCESS_EXIT_CODES,Xn as PM_TOOL_ACTIONS,Gd as PM_TOOL_ACTION_PARAMETER_CONTRACTS,qd as PM_TOOL_PARAMETERS_SCHEMA,Bd as PM_TOOL_PARAMETERS_SCHEMA_MAJOR,jd as PM_TOOL_PARAMETERS_SCHEMA_VERSION,Ld as PM_TOOL_RESERVED_CUSTOM_FIELD_PROPERTIES,Wr as PM_VERDICT_SCHEMA,HT as PM_WORKSPACE_HISTORY_OPERATIONS,Hr as PM_WORKSPACE_RECIPE_SCHEMA,_a as PROFILE_FLAG_CONTRACTS,Zt as PROFILE_LINT_CODES,Qt as PROFILE_LINT_DIMENSIONS,Ht as PROFILE_NAMES,We as PROFILE_SUBCOMMANDS,S as PmCliError,_e as PmClient,DM as PmCompleteListValidationError,C as PmMcpAuthorizationError,ir as PmMcpInputRequiredError,Or as PmMcpIssuerCredentialStore,u as PmMcpProtocolError,sr as PmMcpRequestStateReplayGuard,Br as PmMcpSkillRegistry,gr as PmMcpSubscriptionRegistry,tt as PmMcpTaskStore,FA as QUERY_CURSOR_CONTRACT,fA as READ_OUTPUT_MUTATION_CONFLICT_CODE,_A as READ_OUTPUT_SHAPING_CONTROL_FLAGS,Ga as REINDEX_FLAG_CONTRACTS,hw as REINDEX_LOCK_ID,dt as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Va as RELEASE_FLAG_CONTRACTS,Qa as REMIND_FLAG_CONTRACTS,bt as RESERVED_ITEM_FIELD_NAMES,qa as RESTORE_FLAG_CONTRACTS,fo as RISK_VALUES,SR as RelationshipEventLog,TR as RelationshipEventStore,z as RelationshipGraph,Ge as RelationshipKindRegistry,fa as SCHEMA_FLAG_CONTRACTS,Hc as SEARCH_COMMANDER_STRING_OPTION_CONTRACTS,Hk as SEARCH_EXTENSION_FLAG_DEFINITIONS,Rc as SEARCH_FLAG_CONTRACTS,gs as SECRET_GUARD_RULE_CATEGORIES,dm as SEMANTIC_ATTRIBUTION_LIMITS,GS as SETTINGS_DEFAULTS,kf as SNAPSHOT_SCHEMA,AM as SOURCE_CONTEXT_ACCESS_ENV,xM as SOURCE_CONTEXT_WRITE_OVERRIDE_ENV,Vm as STALE_CLAIM_TAKEOVER_REFUSED_CODE,Rs as STALE_WORK_THRESHOLD_SETTING,fm as START_BLOCKED_REFUSAL_CODE,mm as START_BLOCKER_ENFORCEMENT_DEFAULT,Ka as START_TASK_FLAG_CONTRACTS,oc as STATS_FLAG_CONTRACTS,uo as STATUS_VALUES,Zs as SUBCOMMAND_GLOBAL_FLAG_CONTRACTS,mi as SUBSTANTIVE_HISTORY_OPERATIONS,yx as SUPPORTED_HISTORY_ITEM_HASH_VERSIONS,Tx as SUPPORTED_HISTORY_RECORD_HASH_VERSIONS,OE as SUPPRESS_HOST_OUTPUT_MARKER,tc as TELEMETRY_FLAG_CONTRACTS,a_ as TELEMETRY_SUBCOMMANDS,ec as TEST_ALL_FLAG_CONTRACTS,Za as TEST_FLAG_CONTRACTS,rc as TEST_RUNS_FLAG_CONTRACTS,r_ as TEST_RUN_MEASUREMENT_LIMIT,Id as TOOL_ACTIVITY_OPTION_CONTRACTS,yd as TOOL_AGGREGATE_OPTION_CONTRACTS,Od as TOOL_BULK_MUTATION_FILTER_OPTION_CONTRACT_SOURCE,Md as TOOL_CALENDAR_OPTION_CONTRACTS,Pd as TOOL_CLOSE_MANY_FILTER_OPTION_CONTRACTS,vd as TOOL_CONTEXT_OPTION_CONTRACTS,xd as TOOL_CREATE_OPTION_CONTRACTS,Ad as TOOL_CREATE_OPTION_CONTRACT_SOURCE,kd as TOOL_DEPS_OPTION_CONTRACTS,Nd as TOOL_GRAPH_OPTION_CONTRACTS,Cd as TOOL_LIST_FILTER_OPTION_CONTRACTS,Sd as TOOL_SEARCH_FILTER_OPTION_CONTRACTS,Ed as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACTS,Td as TOOL_SHARED_CREATE_UPDATE_OPTION_CONTRACT_SOURCE,Rd as TOOL_UPDATE_MANY_FILTER_OPTION_CONTRACTS,wd as TOOL_UPDATE_OPTION_CONTRACTS,bd as TOOL_UPDATE_OPTION_CONTRACT_SOURCE,FS as TYPE_TO_FOLDER,BT as UNKNOWN_SUBCOMMAND_COMPATIBILITY_CODES,OO as UNPROVEN_ACTIVITY_REASONS,fd as UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS,hd as UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS,_d as UPDATE_COMMANDER_STRING_OPTION_CONTRACTS,_c as UPDATE_FLAG_CONTRACTS,hc as UPDATE_MANY_FLAG_CONTRACTS,Fa as UPGRADE_FLAG_CONTRACTS,wo as URL_CREDENTIAL_PLACEHOLDER,ac as VALIDATE_FLAG_CONTRACTS,BS as WORKFLOW_POLICY_ACTIONS,vM as WORKFLOW_POLICY_DOCUMENT_SCHEMA,IM as WORKFLOW_POLICY_SCHEMA,wc as WORKSPACE_FLAG_CONTRACTS,Lb as WORKSPACE_HISTORY_ID,Nf as WORKSPACE_SNAPSHOT_ACTIONS,nl as WorkspaceGraphCache,wR as WorkspaceTransactionInterruptedError,ku as _testOnly,ik as _testOnlyAggregateCommand,tl as _testOnlyConfigCommand,lk as _testOnlyGetCommand,yu as _testOnlyHealthCommand,Hp as _testOnlyInit,Bp as _testOnlyInitAgentGuidance,sN as _testOnlyItemTransaction,Nk as _testOnlyMutationEvents,rk as _testOnlyNextCommand,wk as _testOnlySearchCommand,WM as _testOnlySimilarity,of as _testOnlyTemplates,Mu as _testOnlyValidateCommand,Dk as _testOnlyWorkspacePosition,cN as abandonItemTransaction,IR as abandonWorkspaceTransaction,eI as acceptAssuranceProposals,Ru as acknowledgeLinkedTests,Zp as acknowledgeUnknownAuthorHistoryEvents,Qp as acknowledgeUnknownAuthorHistoryEventsFromTransport,Dw as acquireItemMetadataDerivedIndexLock,Fe as acquireLock,Wo as acquireLockLease,GN as activateExtensionForTest,Qx as activateExtensions,hm as admitStartWithOpenBlockers,Ko as agentSessionEnvironment,ch as aggregate,Hf as analyzeAgentProvenanceDescriptorCoverage,pP as analyzeDefectChangeRisk,HI as analyzeDefectRecurrenceCoverage,Ml as analyzeDuplicateItems,AR as analyzeGraphImpact,ep as analyzeHierarchyIntegrity,xR as analyzeKnowledgeGraph,XP as analyzePmCommandExitConformance,Zn as analyzePmToolActionParity,vI as analyzeReconciliationDiscard,ER as analyzeRelationshipExecution,Yl as analyzeRelationshipSchedule,kg as analyzeSdkActionCoverage,It as analyzeSdkCliParameterCompleteness,Sh as append,Di as appendHistoryEntry,Gb as appendWorkspaceAuditEvent,Fb as appendWorkspaceHistoryChange,tT as applyAcceptanceCriteriaMutations,QM as applyAssurancePreset,Dc as applyBootstrapPagerPolicy,UI as applyClosureTimestampFix,rx as applyContextIntentProjection,zm as applyContextTagProjection,NP as applyFilterValueEcho,Sw as applyHistoryPatch,Vd as applyInvocationAuthorOverride,hl as applyPathMigrations,EA as applyReadOutputDimensions,CA as applyReadOutputIncludeModes,sA as applyReadOutputSessionReferences,xb as applyRegisteredItemFieldDefaultsAndValidation,Sl as applyStandaloneNote,Ks as applyStoredExtensionMigrationState,nT as applyTagRemovals,lv as applyTerminalOrderingPolicy,Tl as artifactKey,MT as asRecordClone,PT as asRecordOrNull,ze as assembleWorkspaceRelationshipGraph,jM as assertCompleteListResult,y0 as assertExtensionBlueprint,C0 as assertExtensionCapabilityUsage,e0 as assertExtensionDeactivated,E0 as assertExtensionManifestCompatible,T0 as assertExtensionManifestMatchesBlueprint,A0 as assertExtensionPreflight,np as assertHierarchyMutationAllowed,ZI as assertHistoryCompactTarget,NI as assertHistoryRepairTarget,Zi as assertInitializedTracker,gl as assertLinkedArtifactMutationIsUnambiguous,R0 as assertMcpClientCapabilities,O0 as assertMcpProtocolHeader,xy as assertMemoryRelationshipGraphAdapterConformance,sT as assertNoUnknownCsvKeys,Uu as assertNonHierarchyCardinalityMutationAllowed,t0 as assertPackageManifest,Wb as assertParentReferenceIsNotSelf,LL as assertPmMcpSkillsCapability,S0 as assertProjectProfile,vw as assertProjectRuntimeCompatibility,Rw as assertProjectRuntimeFormatGuard,LE as assertProjectionModeChoice,Qi as assertReadableTrackerRoot,r0 as assertRegisteredCommandContract,u0 as assertRegisteredCommandOverride,c0 as assertRegisteredExporter,n0 as assertRegisteredFlags,o0 as assertRegisteredHook,a0 as assertRegisteredImporter,d0 as assertRegisteredItemField,p0 as assertRegisteredItemType,g0 as assertRegisteredMigration,m0 as assertRegisteredParserOverride,f0 as assertRegisteredPreflightOverride,l0 as assertRegisteredProfile,_0 as assertRegisteredRendererOverride,i0 as assertRegisteredSearchProvider,h0 as assertRegisteredServiceOverride,s0 as assertRegisteredVectorStoreAdapter,$x as assertRelationshipEdgeAllowed,on as assertRelationshipGraphAdapterConformance,ZS as assertSchemaPreviewSupported,p_ as assertTestMeasurementRun,mx as assertWellFormedOutputText,sM as assuranceAssertionUpdateIsLoosening,ix as attachContextIntentReceipt,jA as attachContextUsageServingReceipt,xu as attachLinkedTestMutationProvenance,Au as attachLinkedTestProvenance,Xe as attachMcpServerInfo,jE as attachOutputOmissionReceipt,ax as attachOutputTokenAccounting,sx as attachReadOutputContracts,aA as attachReadOutputSessionReceipt,bp as auditMergeAttributeFence,MM as auditMergeDriverConfiguration,tu as auditWorkspaceRelationshipGraph,SL as authorizeMcpHttpRequest,Ho as boundAgentEpisodeIdentity,XE as boundReadOutputRows,Gm as buildChildrenByParent,Sk as buildCompactSearchFilterSummary,LP as buildContentFilterEcho,Bv as buildContextSignalSnapshot,uy as buildCorpusShapeItemPlan,dP as buildDefectRecurrenceIndex,Lp as buildExtensionDescribeResult,Dp as buildExtensionInstallPlan,$P as buildGovernanceMissingFilterEcho,gu as buildInProgressSweepCommands,aI as buildInProgressWorkHealthSummary,ow as buildInvalidTypeError,ck as buildItemChildrenRollup,oN as buildItemCompletionMutations,wv as buildItemContextRelevanceCandidates,zw as buildItemNotFoundError,pk as buildItemSchedule,jI as buildLinkedFileRepairReport,lL as buildMcpAuthorizationDiscoveryUrls,Dg as buildMcpCompleteResult,M0 as buildMcpDiscoverResult,hL as buildMcpDynamicRegistrationMetadata,nL as buildMcpHttpRequestHeaders,F0 as buildMcpInputRequiredResult,pL as buildMcpProtectedResourceMetadata,Ap as buildMergeAttributePatterns,Ud as buildPmActionToolInputSchema,iD as buildPmRefusalClosureCensus,KM as buildRelationshipContext,Ww as buildSearchCorpus,Xw as buildSemanticCorpusInput,DI as buildStatusRoleWarnings,Ji as buildTrackerInitializationRecovery,tO as buildVectorizationEmbeddingIdentity,rO as buildVectorizationEmbeddingMetadata,Tk as buildVerboseSearchFilters,kM as buildWorkflowCompletenessCheck,Yv as buildWorkspaceMemorySnapshot,qo as canonicalDocument,hT as canonicalizeCommandOptionKey,TN as canonicalizeCommandSuggestions,xv as canonicalizeContextRecencyCoordinate,kx as canonicalizeRelationshipKind,X$ as censusPmRecoveryReferenceProducers,UM as certifyCompleteListResult,DN as checkExtensionManifestCompatibility,ng as claim,og as claimNext,zM as classifyHistoryAuthorEvent,fi as classifyHistoryEvent,MI as classifyHistoryMergeReceiptReferences,qx as classifyHostEnvironmentFault,Ak as classifyImplicitSemanticFallbackReason,Fo as classifyItemFormatVersion,u_ as classifyLinkedTestCommandSafety,m_ as classifyLinkedTestFailure,_b as clearActiveExtensionHooks,du as clearDurableGraphCache,_E as clearFocusedItem,y_ as clearWorkspaceContractsCache,rg as close,Lu as closeItem,ug as closeTask,Uc as coalesceRepeatedListFlags,nR as collectBlockedByIds,iR as collectBlockedByIdsFromCorpus,zA as collectContextUsageDeliveredItemIds,ap as collectDanglingDependencyReferences,aR as collectDependencyBlockedIds,ip as collectDuplicateDependencyRows,eu as collectDuplicateRelationshipEdgeGroups,Ek as collectErrorCauseCodes,Zd as collectHierarchyRelations,Ar as collectMcpHeaderAnnotations,cp as collectMissingDependencyTargetIds,Gu as collectNewOrderingCycleWarnings,Jl as collectOrderingCycles,sp as collectOrderingStorageContradictions,mR as collectPackageContextIntentContracts,jt as collectPackageExtensionDirectories,Eb as collectRegisteredItemFieldNames,aE as collectRuntimeCreateFieldValues,iw as collectRuntimeFilterValues,cE as collectRuntimeUpdateFieldValues,Nm as collectSubtreeIds,ji as collectUsedExtensionCapabilities,gT as commandOptionFlagLabel,lh as comments,q_ as commitImportedItem,iN as commitItemCompletion,nN as commitItemMutations,RR as commitWorkspaceTransaction,Qs as compactFlagAliasContracts,Lm as compareCriticalItems,bw as comparePmDateVersions,bR as compareRelationshipSnapshots,IT as compareTimestampStrings,Tv as compileHistoryProvenanceMatcher,ex as composeContextIntentContracts,MN as composeExtension,$N as composeExtensionPackage,dR as computeActionabilityReport,vb as computeHistoryDiff,Kl as computeRelationshipCentrality,Vl as computeRelationshipDominators,rl as computeWorkspaceGraphFingerprint,Eh as config,fb as consumeAfterCommandAffectedItems,rh as context,ox as contextIntentRowId,sg as copy,ju as countFailureCategories,WE as countReadOutputRows,Zh as create,JM as createAssurancePreset,zI as createAssuranceWorkspaceContext,kT as createCheckpointId,FM as createCompleteListOptions,Zx as createCoreCommandHookContext,en as createCorpusShapeMeasurement,lM as createEmptyAssuranceDocument,jx as createEmptyExtensionRegistrationRegistry,mO as createExtensionCommandError,qs as createExtensionCommandSdk,Gi as createExtensionContributionInventory,x0 as createExtensionTestHarness,$i as createHistoryEntry,GO as createLazyModule,NM as createLifecycleCompletenessPolicies,TL as createMcpStaticBearerVerifier,Q0 as createMcpTaskStore,Bw as createMutationGuardSdk,$E as createOutputOmissionReceipt,us as createPmCliExpectedError,zs as createPmCliProgram,Ei as createPmCommandOutputBudget,IA as createQueryFingerprint,Ay as createRelationshipGraphScaleFixture,J as createRelationshipGraphSnapshot,xt as createRelationshipKindRegistry,Yd as createReproducibleProcessRunner,Ck as createSearchCursorFingerprint,eb as createSerialQueue,uT as createStdinTokenResolver,zT as createUnknownSubcommandError,QS as createWorkflowPolicyEvaluator,Lf as createWorkspaceSnapshot,UN as deactivateExtensionForTest,ys as decideSecretGuardFinding,KD as declineServiceOverride,nx as decodeContextIntentCursor,FO as decodeHtmlEntitiesInOptions,Er as decodeMcpHttpHeaderValue,dx as decodePmTableRows,LA as decodeQueryCursor,kA as decodeQueryCursorEnvelope,NA as decodeQueryCursorState,PA as decodeReadOutputContinuationCursor,b0 as decodeToon,wL as decoratePmMcpToolsWithApps,Al as dedupeLinkedArtifacts,bb as defaultConfigScope,Rv as defaultScoreContextCandidates,ZD as defineAfterCommandHook,JD as defineBeforeCommandHook,QD as defineBeforeMutationHook,LD as defineCommand,BD as defineCommandOverride,K as defineCorpusShape,HL as defineEpisodeSpecification,XD as defineExporter,RN as defineExtension,PN as defineExtensionBlueprint,kD as defineExtensionManifest,$D as defineFlag,YD as defineImporter,FD as defineItemField,DD as defineItemType,GD as defineMigration,ry as defineObservationContract,rF as defineOnIndexHook,tF as defineOnReadHook,eF as defineOnWriteHook,zD as defineParserOverride,Ai as definePmCommandOutputBudget,BP as definePmCommandOutputEnvelope,FP as definePmErrorCodeCatalog,qD as definePreflightOverride,ND as defineProjectProfile,WD as defineRendererOverride,UD as defineSearchProvider,HD as defineServiceOverride,jD as defineVectorStoreAdapter,sy as defineVerdictContract,xe as defineWorkspaceRecipe,ag as deleteItem,jf as deleteWorkspaceSnapshot,Dx as dependencyToRelationship,Ch as deps,ZM as deriveAssuranceProposals,FI as deriveClosureTimestamp,vN as deriveExtensionCapabilities,Vk as deriveMutationTransactionId,JP as derivePmBulkMutationEffect,J$ as derivePmRecoveryReferenceObligations,Xl as deriveRelationshipDeadlines,Pp as deriveSchemaEvolutionMigrationId,yO as deriveTelemetryCommandResolution,dw as describeAllowedTransitions,EM as describeExtensionActivation,kN as describeExtensionBlueprint,UT as describeFlagScalarValueFailure,Tm as describeItemOwnershipConflict,Us as describeItemRevisionChanges,qL as describeObservationCost,Xt as describeProfileComposition,Jt as describeProjectProfile,lN as describeReadCompletenessControls,fO as describeUnknownError,oi as detectAgentIdentity,ci as detectHarnessIdentity,ql as detectRelationshipCommunities,ii as diagnoseAgentIdentity,ru as diffRelationshipAuditSnapshots,i_ as diffTestRunMeasurements,j0 as digestMcpRequestParameters,Xx as discoverExtensions,yo as discoverNearbyPmRoot,p1 as discoverPmTools,Ow as discoverProjectRuntimeVersionPins,gh as docs,ph as duplicates,iu as durableGraphCachePath,pu as durableGraphCacheStatus,$o as effectiveItemFormatVersion,JO as emitTelemetryErrorEvent,z_ as emptyImportedDocument,pI as encodeItemScalarDecisionValue,Tr as encodeMcpHttpHeaderValue,cx as encodePmTableRows,vA as encodeQueryCursor,RA as encodeReadOutputContinuationCursor,w0 as encodeToon,kb as enforceHistoryStreamPolicyForItem,Nb as enforceHistoryStreamPolicyForItems,ZR as enrichCliFlagInvocationContract,Mt as enrichCliFlagInvocationContracts,Ew as ensureMaterializedHistoryTarget,Sp as ensurePmGitignore,ll as ensureScope,lO as ensureSentryCommandTracing,pO as ensureSentryInit,B_ as ensureTrackerInitialized,Bl as enumerateRelationshipPaths,wi as estimatePmOutputTokens,mM as evaluateAssuranceAssertion,fM as evaluateAssuranceGate,sP as evaluateBoundaryFixtures,Cm as evaluateClaimActivity,vv as evaluateContextRanking,lP as evaluateDefectGateEvidence,uM as evaluateMeasurement,Af as evaluateMetricFloors,hs as evaluateMutationGuard,Jf as evaluateProvenanceCoverage,TF as evaluateReliabilityWindow,Wf as evaluateSemanticAttributionCoverage,vl as evaluateSimilarityGovernance,cw as evaluateTransition,ay as evaluateVerdictContract,JS as evaluateWorkflowPolicies,ns as executeEmbeddingBatchesWithRetry,Zw as executeVectorDelete,eO as executeVectorReset,Qw as executeVectorUpsert,QC as executeWorkspaceRecipe,yl as expandAddGlobEntries,Nl as explainSourceTraceability,ov as exportAttestation,mg as extension,_g as extensionActivate,hg as extensionDeactivate,fg as extensionList,dS as extensionMigrate,PI as extractHistoryMergeReceiptDispositions,RI as extractHistoryMergeReceiptReferences,gL as extractMcpTraceContext,Cw as extractPatchFailureContext,Su as extractReferencedPmItemIdsFromCommand,Ey as federateRelationshipGraphSnapshots,fh as files,_h as filesDiscover,hh as filesLookup,qA as finalizeContextUsageDelivery,Cy as findCoverageDeficits,Il as findDuplicateClusters,Ep as findGitWorkspaceRoot,yE as findHistoryIdentityDiscontinuities,kp as findInstalledNpmPackageCandidate,bL as findPmMcpAppByUri,Nn as findPmNamespacedCommand,Hl as findRedundantRelationshipEdges,Wl as findRelationshipCutStructure,Pl as findSimilarItems,XO as finishTelemetryCommand,yR as fitOutputEnvelope,GT as flattenFlagListValue,_y as flushTelemetryQueue,dg as focus,zl as forEachMatchedRelationshipEdge,Zl as formatDuplicateEdgeGroup,tp as formatHierarchyRelation,Ql as formatOrderingStorageContradiction,qR as formatPmPositionalActionFlagTip,gf as formatProfileApplyHuman,hf as formatProfileLintHuman,ff as formatProfileListHuman,_f as formatProfileShowHuman,vp as formatSchemaEvolutionMigrationHuman,bk as formatVectorIndexRecoveryWarnings,$k as formatWorkspacePositionHuman,Kh as gc,Wi as generateItemId,sh as get,lb as getActiveCommandResult,QA as getActiveContextIntentContracts,zi as getActiveExtensionRegistrations,yL as getActiveMcpTraceContext,hM as getAssuranceDeclaration,Pg as getContracts,mE as getFocusedItem,Eo as getHistoryPath,gR as getItemAt,To as getItemPath,Es as getMutationActionContract,yp as getPmGitignoreBlock,So as getSettingsPath,S_ as getWorkspaceContracts,$b as getWorkspaceHistoryPath,yh as graph,su as graphAuditBaselinePath,Yf as groupHistoryByEpisode,VD as handleServiceOverride,P0 as hasMcpClientExtension,xL as hasPmMcpAppsCapability,Be as hasSubcommandFlagContractsForCommand,nO as hasVectorizationEmbeddingIdentityChanged,oO as hasVectorizationVectorDimensionChanged,Px as hashDocument,Mx as hashDocumentForVersion,Ix as hashEmptyDocument,Ax as hashHistoryPatch,Ex as hashHistoryRecord,xx as hashHistoryStream,lI as hashItemScalarDecisionValue,Vh as health,Fl as hierarchyAncestors,Gl as hierarchyDescendants,Jh as historyCompact,Qh as historyCompactBulk,rE as historyDigest,Sv as historyEntryMatchesProvenance,ww as historyItemHashVersionForRuntime,Wh as historyRedact,Yh as historyRepair,Xh as historyRepairAll,oR as indexBlockedByIds,rp as indexHierarchyRelations,iO as inferConsistentVectorDimension,Ti as inferPmOutputBudgetClass,Th as init,GM as inspectCompleteListResult,Bx as inspectExtensionManifestSchema,Kp as inspectHistoryAuthorStream,Ms as inspectInProgressWork,yI as inspectMergeReceiptEvidence,Iw as inspectProjectRuntimeCompatibility,Is as inspectStaleInProgressItems,Ng as inspectStaticExtensionInventory,$I as inspectStatusRoleAssignments,Db as inspectWorkspaceHistoryState,$f as inspectWorkspaceSnapshot,Rp as installMergeFence,I0 as interpretMcpResultType,Km as isAlreadyClaimedError,gO as isCommanderError,fN as isCompatibleRecoveryFlag,nd as isErrnoError,ZO as isExternalDependencyReference,eR as isExternalDependencySourceKind,me as isFileMissingError,Ii as isGenericRefusalRequired,vi as isGenericRefusalWhy,PE as isHostOutputSuppressed,ls as isItemAlreadyExistsError,js as isItemRevisionConflict,dI as isItemScalarMissingValue,vO as isJudgeableHistoryRecord,bI as isLegacyMergeReceiptSummary,h as isMcpRecord,Ss as isMutationAction,Lx as isOrderingRelationshipKind,Vb as isPlaceholderReferenceToken,is as isPmCliErrorDetails,ms as isPmCliExpectedError,to as isPmExtensionCapabilityContract,no as isPmExtensionPolicyModeContract,oo as isPmExtensionPolicySurfaceContract,ro as isPmExtensionServiceNameContract,YP as isPmKnownExitCode,qP as isPmMutationReceipt,Ve as isPmSuccessfulExitCode,ds as isPmTokenBudgetRecovery,eo as isPmToolAction,wI as isPreDurableCloneLocalReceiptSummary,OI as isPreDurableDispositionEligibleReference,Mw as isProjectMutatingInvocation,UO as isPureSnakeCaseAlias,xA as isReadOutputBudgetExceeded,rA as isReadOutputSessionReference,mN as isReadProjectionRecoveryFlag,AA as isReadResultOmittedForBudget,FE as isReadRowContract,Jd as isRuntimeRecord,uw as isSettingsReadFallback,_m as isStartTransition,zO as isTerminalPlanMode,pE as isTerminalStatus,Io as isTimestampLiteral,nP as isWaiverNoticeDays,IO as isWellFormedHistoryRecord,Jk as itemDocumentToMutationOptions,dk as itemHasSchedule,_i as jaccardSimilarity,LO as latestHistoryTimestamp,mh as learnings,jT as levenshteinDistanceWithinLimit,ed as limitAnnotationEntries,bu as linkedTestTrustFingerprint,NN as lintExtensionBlueprint,zx as lintExtensionManifestSchema,er as lintProjectProfile,nh as list,Zo as listAgentProvenanceAdapters,Gc as listAliasPluralKeys,oh as listAllComplete,Uw as listAllDocumentCandidatesCached,rs as listAllItemMetadata,jw as listAllItemMetadataLight,_M as listAssuranceDeclarations,TM as listAssuranceVerdicts,py as listBuiltinCorpusShapes,EN as listCoreClosedDomainContracts,GR as listGetProjectionFields,oI as listInvalidProvenanceHistoryStreamIds,$R as listListProjectionFields,SI as listMergeReceipts,Ts as listMutationActions,Ik as listMutationEvents,hn as listPmCommandFlagBudgets,up as listPmCommandsForFamily,lp as listPmCommandsForTier,Pe as listPmFlagLexicon,PD as listPmFlagSpellingInventory,mp as listPmMcpToolsForProfile,CD as listPmRequiredArgumentRefusalContracts,yD as listPmSubcommandRefusalContracts,Yt as listProfiles,ED as listTrackerPreflightRecoveryContracts,eN as listUpsertKeyCandidates,Df as listWorkspaceSnapshots,fR as loadContextIntentRuntimeLayers,sf as loadCreateTemplateOptions,Jx as loadExtensions,uu as loadGraphAuditBaseline,tN as loadGuardedRuntimeSchema,LT as loadMutationCheckpoint,v as loadRelationshipGraphAdapter,es as locateItem,iT as looksLikeGenericKeyValueEntry,YE as mapReadOutputRows,TI as markMergeReceiptReconciled,sw as matchesRuntimeFilters,WO as maybeRunFirstUseTelemetryPrompt,my as measureCorpusShapePlan,Xi as measureItemMetadataReadWork,rT as mergeAdditiveTags,IN as mergeExtensionBlueprints,uI as mergeHistoryStreams,hI as mergeItemDocuments,gI as mergeJsonDocuments,jc as mergeLinkedTestTwoTokenEntries,mI as mergeRelationshipEventStreams,jm as mergeSortedWarnings,BO as migrateItemFilesToFormat,Hw as mutateItem,qw as mutateItemWithHistoryContext,Ub as mutateWorkspaceJsonWithHistory,ah as next,ti as normalizeAgentProvenanceAdapterValue,Zc as normalizeAnnotationTransportOptions,rM as normalizeAssuranceEvaluation,tM as normalizeAssuranceMutation,Bc as normalizeBootstrapInvocation,Pb as normalizeBulkIdsValue,op as normalizeDependencyGraphTarget,RP as normalizeDependencySeedId,OP as normalizeDependencySourceKind,kt as normalizeDirectExtensionCommandOptions,Ds as normalizeExpectedItemHash,Fi as normalizeExtensionContributionInventory,JT as normalizeHistoryOperationForWrite,nI as normalizeInvalidHistoryProvenance,QR as normalizeItemAddressInvocation,Do as normalizeItemFormatVersion,Ki as normalizeItemId,jo as normalizeItemMetadata,PP as normalizeItemReference,Fc as normalizeLegacyExtensionActionSyntax,Cl as normalizeLinkedPath,Hb as normalizeParentReferenceValue,Kt as normalizeProfileName,Vi as normalizeRawItemId,yA as normalizeReadOutputIncludeModeOptions,AE as normalizeReplayPatchOps,As as normalizeSimilarityText,RO as normalizeStaleWorkThresholdHours,dE as normalizeStatusForRegistry,Uo as normalizeStatusInput,oE as normalizeStatusInputWithRegistry,hO as normalizeThrownExitCode,uh as notes,Mo as nowIso,au as openDurableGraphCache,U0 as openMcpRequestState,VL as openPmEpisode,Ul as orderingPredecessors,jl as orderingSuccessors,Dv as packContextCandidates,$m as packRankedContextItems,wg as packageActivate,bg as packageCatalog,Og as packageDeactivate,Ag as packageDescribe,Tg as packageDoctor,yg as packageInstall,gg as packageLifecycle,Cg as packageList,Eg as packageManage,pS as packageMigrate,xg as packageReload,Sg as packageUninstall,DA as paginateQueryRows,ul as parseAddEntries,ml as parseAddGlobEntries,rd as parseAnnotationTextInput,Kk as parseAtomicMutationControls,$c as parseBootstrapCommandName,kc as parseBootstrapGlobalOptions,Lc as parseBootstrapHelpRequest,zc as parseBootstrapTypeValue,Rb as parseBulkIdsText,vm as parseContextDepth,Rm as parseContextFocusFields,lR as parseContextIntentDeclarations,km as parseContextSections,jv as parseContextSignalSnapshot,oT as parseCsvKv,fP as parseDefectChangeRiskRequest,qI as parseDefectRecurrenceCoverageRequest,mP as parseDefectRecurrencePolicy,Ef as parseEvalMetricFloors,Of as parseEvalQuerySet,Fs as parseExpectHashSpecs,bT as parseExtensionLongFlagToken,_u as parseGraphSubcommand,nv as parseHistoryAttestation,Cv as parseHistoryProvenanceFilters,_P as parseIntegerLimit,lE as parseItemDocument,Wk as parseItemMutationBatch,nw as parseLimit,em as parseLinkedTestAssertionEqualsMap,tm as parseLinkedTestAssertionGteMap,Wu as parseLinkedTestBoolean,Yu as parseLinkedTestContextMode,Ku as parseLinkedTestEnvClear,Vu as parseLinkedTestEnvSet,rm as parseLinkedTestJsonEntries,Zu as parseLinkedTestMinLines,Qu as parseLinkedTestRegexList,Ju as parseLinkedTestStringList,Xu as parseLinkedTestWorkspaceContextMode,qg as parseMcpCachePolicy,Lg as parseMcpImplementation,Ze as parseMcpInputRequests,pr as parseMcpInputResponses,fC as parseMcpSubscriptionFilter,_l as parseMigrateEntries,CP as parseMultiValueFilter,HP as parseMutationReceipt,fT as parseOptionalNonNegativeInteger,mT as parseOptionalNumber,z$ as parsePmAgentTaskTranscriptCorpus,d1 as parsePmToolDiscoveryOptions,hP as parsePriority,TP as parsePriorityFilterSet,iA as parseReadOutputSession,Ab as parseRegisteredItemFieldAssignments,se as parseRelationshipGraphSnapshot,fl as parseRemoveEntries,kl as parseSourceLineRange,Zb as parseStatusFilterCsv,yP as parseStringFilterSet,io as parseTags,n_ as parseTestRunMeasurements,gP as parseType,SP as parseTypeFilterSet,Jp as parseUnknownAuthorHistoryEventCoordinates,HS as parseWorkflowPolicy,VS as parseWorkflowPolicyDocument,nk as partitionDecisionEntries,Ib as patchPathToChangedField,so as pathExists,lg as pauseTask,cu as persistDurableGraphResult,lw as persistSelectedItemFormat,HM as planAgentIdentityVocabularyMutation,Kv as planCompletedAtBackfill,Fp as planExtensionDirectoryCopy,ON as planItemMutationDocument,tr as planProfileApplication,K$ as planRelationshipEventBackfill,fu as planRelationshipRemediation,Mp as planSchemaEvolutionMigration,Yp as planUnknownAuthorHistoryAcknowledgment,Ff as planWorkspaceSnapshotRestore,KR as positionalShapeKey,WR as positionalSignatureKey,FN as preflightExtension,bs as prepareSimilarityText,cT as preserveMutationStdinTokenFields,aT as preserveMutationStdinTokenLiterals,wN as previewItemMutationDocument,rN as previewItemMutations,gx as printError,hx as printResult,Uh as profile,zh as profileApply,qh as profileLint,jh as profileList,Bh as profileShow,mb as projectAfterCommandItemSnapshot,Pm as projectContextFocusRows,t_ as projectFleetAttributionAnalytics,yv as projectHistoryProvenance,Li as projectLeanRecoveryPayload,pl as projectLinkedCollectionMutation,px as projectPmBriefListEnvelope,lx as projectPmBriefSearchEnvelope,cs as projectPmCliErrorContextDetails,ss as projectPmCliErrorDetails,Ri as projectPmDiagnosticOutput,Pi as projectPmDiagnosticText,Zf as projectProvenanceCoverageAnalytics,Pu as projectValidateCounts,tI as promoteAssuranceAssertion,BA as propagateContextUsageServingReceipt,u$ as pruneCompileCacheGenerations,gM as putAssuranceDeclaration,CM as putAssuranceDeclarationBundle,kw as queryItemMetadataIndex,Nw as queryLinkedFileMetadataIndex,Lw as querySimilarItemMetadataIndex,o_ as queryTestRunMeasurementsBelow,xo as quoteCommandArg,Ao as quoteWindowsCommandArg,SN as rankCommandPaths,td as readAnnotationEntries,si as readAuthorEnvironment,E_ as readBooleanOption,YA as readContextUsageAffinity,A_ as readCsvListOption,Vs as readExtensionMigrationState,ao as readFileIfExists,Xc as readFirstStringFromCommanderOptions,Jc as readFirstValueFromCommanderOptions,Xf as readHistoryAnalyticsWindow,CE as readHistoryEntries,pi as readHistorySnapshot,zf as readImprovementLedger,Fw as readItemMetadataDerivedIndexState,Gs as readItemRevision,aN as readItemTransaction,DO as readLatestHistoryActivity,ts as readLocatedItem,KE as readOutputBudgetCollections,OA as readOutputCollectionFingerprint,VE as readOutputContinuationRowCollections,qE as readOutputContinuationRowPaths,gA as readOutputIncludeModeOptions,tA as readOutputRetainsTail,HE as readOutputRowCollections,zE as readOutputRowPaths,cA as readOutputSessionRemainingTokens,Ut as readPmPackageManifest,Om as readRecentActivity,C_ as readRequiredString,sE as readRuntimeFieldOptionValue,Yi as readSettings,VO as readSettingsSection,mw as readSettingsWithMetadata,Qc as readStringArrayFromCommanderOptions,T_ as readStringOption,_O as readThrownExitCode,sO as readVectorizationStatusLedger,Aw as readWorkflowPolicies,KS as readWorkflowPolicyField,uR as readWorkspaceContextIntentContracts,Hv as readWorkspaceContextSignals,Xv as readWorkspaceMemory,Lk as readWorkspacePosition,PR as readWorkspaceTransaction,wE as reanchorHistoryEntries,AF as reconcileArtifactLedgers,Bi as reconcileExtensionCapabilityUsage,Bb as reconcileWorkspaceJsonHistory,ub as recordAfterCommandAffectedItem,SM as recordAssuranceVerdict,sm as recordClaimSemanticAttribution,VA as recordContextUsageDelivery,HA as recordContextUsageServing,KA as recordContextUsageTouch,WA as recordContextUsageTouches,cm as recordFocusSemanticAttribution,Bf as recordImprovementObservation,am as recordReleaseSemanticAttribution,NO as recordedBaselineActivity,$O as recordedPrefixActivity,Ro as redactUrlCredentialsInText,Oo as redactUrlCredentialsInToken,Gw as refreshItemMetadataDerivedIndex,wp as refreshMergeAttributeFenceIfInstalled,QE as refreshReadOutputDeliveredCounts,cO as refreshSearchArtifactsForMutation,ei as registerAgentProvenanceAdapters,bP as registerExternalDependencyResolver,Qo as registerHarnessSignalDescriptors,IE as registerOutputMaterialFieldGroups,ig as release,JE as rememberReadOutputFocusRows,yM as removeAssuranceDeclaration,co as removeFileIfExists,wl as renameArtifactsResultKey,Am as renderCalendarMarkdown,xm as renderCalendarToon,Bm as renderContextMarkdown,$p as renderExtensionDescribeMarkdown,Np as renderExtensionSurfaceMarkdown,K_ as renderGuideMarkdown,gN as renderMissingOptionRetry,ok as renderNextMarkdown,AN as renderPmClosedDomainHelp,bo as renderPmCommand,Fn as renderPmCommandAliasMigrationHint,hp as renderPmCommandVisibilityMarkdown,ID as renderPmFlagLexiconMarkdown,OL as renderPmMcpAppHtml,sD as renderPmRefusalClosureCensusMarkdown,tw as renderRowsAsCsv,rw as renderRowsAsTable,tg as reopen,Tw as replayHistoryToTarget,TE as replayToCanonicalItemDocument,SE as replayToItemDocument,XT as requireHistoryOperation,dv as requireTerminalReason,pv as requireTerminalReasonWithRecovery,Ox as resealHistoryRewrite,cb as resetActiveExtensionRuntimeState,il as resetWorkspaceGraphCache,Vo as resolveAgentSessionContextFromSignals,ad as resolveAnnotationIndex,od as resolveAnnotationInput,gE as resolveAuthor,di as resolveAuthorIdentity,qb as resolveBodyFileContent,ly as resolveBuiltinCorpusShape,Em as resolveCalendarOutputFormat,GP as resolveCanonicalPmErrorCodeContract,Nx as resolveCanonicalRelationshipKind,hE as resolveClaimPrincipal,Mb as resolveCliBulkIdsInput,ST as resolveCommandOptionPolicyState,l$ as resolveCompileCacheGeneration,Vv as resolveCompletionTimestamp,Ux as resolveConfiguredPmPackageRoot,IP as resolveContentFieldFilters,tx as resolveContextIntentContract,Mm as resolveContextOutputFormat,Im as resolveContextTokenBudget,uv as resolveCreateExplicitEmptyFlag,Ns as resolveDeclaredBlockers,fk as resolveEffectiveSearchMode,Vw as resolveEmbeddingProviders,vt as resolveExtensionFlagOptionKey,FT as resolveExtensionFlagValueContract,Gp as resolveExtensionInstallSourceIdentity,wT as resolveExtensionLongFlagName,Hs as resolveExtensionMigrationStatePath,Yx as resolveExtensionRoots,wP as resolveExternalDependencyReference,DT as resolveFlagValueKind,AT as resolveGlobalPmRoot,H_ as resolveGuideOutputFormat,qf as resolveHistoryEpisodeGroupIdentity,tE as resolveHistoryHashAlgorithm,YT as resolveHistoryOperation,gv as resolveHistoryProvenanceDimensions,QO as resolveHistorySubject,yw as resolveHistoryTarget,hk as resolveHybridSemanticWeight,Co as resolveImplicitPmRoot,vT as resolveIsoOrRelative,sR as resolveItemBlockers,tR as resolveItemExecutionRole,Xk as resolveItemMutationDocument,Sm as resolveItemOwnershipActivity,ym as resolveItemOwnershipConflict,go as resolveItemTypeRegistry,nE as resolveItemTypesFilePath,Ps as resolveLastActivityAt,dN as resolveLifecycleVerbRecovery,xT as resolveLinkedResourcePositionalRecovery,f_ as resolveLinkedTestFailureExitCode,Tu as resolveLinkedTestSourceRef,Eu as resolveLinkedTestSourceWorkspaceRoot,wu as resolveLinkedTestTrust,Ou as resolveLinkedTestTrustBatch,_C as resolveMcpAcknowledgedSubscriptionFilter,Ye as resolveMcpRequestContext,Tp as resolveMergeInstallContext,CN as resolveMisnestedCommandPath,MP as resolveMissingMetadataFilters,hN as resolveMissingOptionPlaceholder,DE as resolveModePairedOutputOmissionReceipt,tk as resolveNextOutputFormat,UE as resolveOutputOmissionReceipt,Gx as resolvePmCliVersion,Dn as resolvePmCommandAlias,qe as resolvePmCommandCapabilityFamily,$t as resolvePmCommandExitContract,N as resolvePmCommandOperation,bi as resolvePmCommandOutputBudget,Lt as resolvePmCommandOutputEnvelope,BR as resolvePmCommandPositionalContract,Po as resolvePmCommandScopeArgs,He as resolvePmCommandVisibilityTier,Oi as resolvePmDiagnosticOutputBudget,UP as resolvePmErrorCodeContract,oS as resolvePmFlagSemanticConcept,ke as resolvePmHistoryOperation,N0 as resolvePmMcpExecutableInvocation,Fx as resolvePmPackageRootFromModule,zR as resolvePmPositionalActionContract,Ic as resolvePmPositionalActionFlagContracts,De as resolvePmRoot,$d as resolvePmToolCustomFieldCollision,Yb as resolvePriority,Wt as resolveProfile,xp as resolveProjectMergeTypeFolders,$A as resolveQueryCursorStart,pN as resolveReadCompletenessControls,uN as resolveReadOptionRetryArgs,SA as resolveReadOutputDimensions,bA as resolveReadOutputEncoding,ZE as resolveReadOutputRecoveryBudget,mA as resolveReadOutputSurface,GE as resolveReadRowContract,_N as resolveRecoveryCommandName,wb as resolveRegisteredSearchProvider,Ob as resolveRegisteredVectorStoreAdapter,Wd as resolveReproducibleProcessEnvironment,ko as resolveRuntimeFieldRegistry,vo as resolveRuntimeStatusRegistry,Kw as resolveSearchCorpusFields,mk as resolveSearchMaxResults,yk as resolveSearchPage,_k as resolveSearchScoreThreshold,gk as resolveSearchTuning,Yw as resolveSemanticCorpusCharacterLimit,im as resolveSemanticLineageIds,_w as resolveSettingsWithSemanticRuntimeDefaults,bM as resolveSourceContextWritePolicy,um as resolveStartTaskInProgressStatus,Z as resolveSubcommandFlagContractsForCommand,US as resolveTelemetryErrorCategory,dO as resolveTelemetrySourceAttribution,cv as resolveTerminalReason,Zk as resolveTransactionSchema,yT as resolveTypeDefinition,CT as resolveTypeName,ew as resolveTypeSynonym,aw as resolveTypeWorkflows,Xp as resolveUnknownAuthorAcknowledgmentSelector,xk as resolveVectorIndexRecovery,Jw as resolveVectorStores,Qd as resolveWorkspaceRelationshipKindRegistry,ET as resolveWorkspaceRoot,cg as restore,$T as restoreCheckpointItems,zb as restoreWorkspaceJsonFromHistory,Uf as restoreWorkspaceSnapshot,Gf as restoreWorkspaceSnapshotWithRecovery,cl as reviseLinkedNote,vg as runAction,hb as runActiveBeforeMutationHooks,Cb as runActiveCommandHandler,gb as runActiveOnIndexHooks,Hi as runActiveOnReadHooks,qi as runActiveOnWriteHooks,yb as runActiveParserOverride,Sb as runActivePreflightOverride,Tb as runActiveServiceOverride,wm as runActivity,Wx as runAfterCommandHooks,Cf as runAggregate,sd as runAnnotationCommand,Nu as runAppend,WI as runAssuranceAction,YI as runAssuranceDispatch,Kx as runBeforeCommandHooks,bm as runCalendar,Wm as runClaim,Ym as runClaimNext,$u as runClose,Du as runCloseMany,Zm as runCloseTask,cd as runComments,W_ as runCompletion,el as runConfig,qt as runContext,Lv as runContextEvaluationCorpus,kv as runContextEvaluationScenario,Fu as runCopy,nm as runCreate,om as runDelete,sl as runDeps,Ol as runDocs,YM as runDuplicates,Pf as runEval,If as runEvent,Up as runExtension,Ys as runExtensionMigrateAction,Ws as runExtensionMigrations,Ll as runFiles,Dl as runFilesDiscover,$l as runFilesLookup,e_ as runFleetAttributionAnalytics,lm as runFocus,vu as runGc,yf as runGet,hu as runGraph,V_ as runGuide,Cu as runHealth,uk as runHistory,sv as runHistoryAttest,JI as runHistoryCompact,ev as runHistoryCompactBulk,II as runHistoryMaintenance,tv as runHistoryRedact,kI as runHistoryRepair,LI as runHistoryRepairAll,Ig as runInActiveExtensionScope,Vp as runInit,zp as runInitAgentGuidance,dd as runLearnings,bl as runLinkedArtifacts,__ as runLinkedTests,dp as runList,Mf as runMeet,Rk as runMergeDriver,Op as runMergeInstall,AI as runMergeReceiptEvidenceReport,EI as runMergeReceiptReport,Pk as runMergeReconcile,Hm as runNext,pd as runNotes,Qm as runPauseTask,tf as runPlan,mf as runProfileApply,uf as runProfileLint,pf as runProfileList,lf as runProfileShow,Qf as runProvenanceCoverageAnalytics,jN as runRegisteredCommandForTest,VN as runRegisteredCommandOverrideForTest,ZN as runRegisteredExporterForTest,zN as runRegisteredHookForTest,QN as runRegisteredImporterForTest,JN as runRegisteredMigrationForTest,BN as runRegisteredMutationGuardForTest,qN as runRegisteredParserOverrideForTest,HN as runRegisteredPreflightOverrideForTest,KN as runRegisteredRendererOverrideForTest,YN as runRegisteredSearchProviderForTest,WN as runRegisteredServiceOverrideForTest,XN as runRegisteredVectorStoreAdapterForTest,rr as runReindex,Xm as runRelease,vf as runRemind,fv as runReopen,rf as runRestore,Ip as runSchemaEvolutionMigration,Sf as runSearch,fy as runSearchRefreshWorkerEntrypoint,Y_ as runStartBackgroundRun,Jm as runStartTask,s_ as runStats,c_ as runTelemetry,cf as runTemplatesList,af as runTemplatesSave,df as runTemplatesShow,h_ as runTest,g_ as runTestAll,X_ as runTestRunsList,Q_ as runTestRunsLogs,eh as runTestRunsResume,J_ as runTestRunsStatus,Z_ as runTestRunsStop,th as runTestRunsWorker,gm as runUpdate,nf as runUpdateMany,Bt as runUpgrade,Iu as runValidate,Mg as runWithActiveExtensions,L as runWithAgentSessionContext,pw as runWithConfigurationOnlySettings,ZA as runWithContextIntentContracts,_R as runWithDiscoveredContextIntentContracts,ri as runWithHarnessDetectionSignals,CL as runWithMcpTraceContext,Xd as runWithReproducibleProcessEnvironment,ni as runWithWorkspaceHarnessSignalDescriptors,Vr as runWithWorkspaceRecipe,LM as runWorkflowPolicyAction,XI as runWorkspaceTransactionGc,mu as saveGraphAuditBaseline,GI as scanClosureTimestamps,rI as scanExtensionHostVersions,Wp as scanHistoryAuthorAttribution,vs as scanInProgressWork,Go as scanItemFormatVersions,_s as scanMutationSecrets,iI as scanProvenanceResolverHealth,ks as scanStaleInProgressItems,BI as scanStorageIntegrity,Ah as schema,Mh as schemaAddField,Rh as schemaAddStatus,wh as schemaAddType,Nh as schemaApplyPreset,Lh as schemaInferTypes,xh as schemaList,vh as schemaListFields,Fh as schemaRemapStatus,Ih as schemaRemoveField,Ph as schemaRemoveStatus,Oh as schemaRemoveType,Dh as schemaRenameField,$h as schemaRenameType,bh as schemaShow,kh as schemaShowField,Gh as schemaShowStatus,yN as scoreCommandPathMatch,Pv as scoreContextCandidates,Mv as scoreContextCandidatesWithActiveExtensions,ws as scoreItemSimilarity,SD as scorePmGrammarRefusalClosure,dD as scorePmRefusalClosure,Os as scorePreparedItemSimilarity,AD as scoreTrackerPreflightRecoveryClosure,bx as sealHistoryRecord,G0 as sealMcpRequestState,ih as search,Zv as searchWorkspaceMemory,ek as searchWorkspaceMemoryReadResult,Cs as secretGuardRuleCategory,cR as selectActionableEntries,MA as selectCursorSemanticOptions,j_ as selectImportAuthor,mL as selectMcpClientRegistrationMode,Qv as selectWorkspaceMemory,Jv as selectWorkspaceMemoryRollups,pm as semanticAttributionAffinity,xO as sentryCaptureCliError,EO as sentryDiscardCommandSpan,AO as sentryFinishCommandSpan,wO as sentryFlush,bO as sentryLogCliUsageError,SO as sentrySetCommandContext,TO as sentryStartCommandSpan,zo as serializeItemDocument,xN as serializeNdjsonRows,bN as serializeNdjsonStream,ny as serveDeclaredObservation,db as setActiveCommandContext,pb as setActiveCommandResult,rb as setActiveExtensionCommands,tb as setActiveExtensionHooks,nb as setActiveExtensionParsers,ob as setActiveExtensionPreflight,ab as setActiveExtensionRegistrations,sb as setActiveExtensionRenderers,ib as setActiveExtensionServices,fE as setFocusedItem,HO as settingsSectionRevision,qO as shouldCompletePlanOnClose,lu as shouldPersistDurableGraphCache,lT as shouldResolveMutationStdinTokenField,pT as shouldResolveMutationStdinTokens,gw as shouldRunSearchRefreshInForeground,Rl as similarityAdvisoryWarnings,BE as sliceReadOutputRowCollection,as as snapshotPmCliErrorContext,El as sortLinkedArtifacts,iP as sortWaiverNotices,eT as splitAcceptanceCriteria,jO as splitCommaList,Bo as splitFrontMatter,TA as stabilizeReadOutputReceiptEstimates,R as stableStringify,Yk as stableUpsertValue,jS as stableValueEquals,MO as staleEligibleAt,Pw as stampRequiredItemFormat,pg as startTask,YO as startTelemetryCommand,dh as stats,iE as statusIsTerminal,Nc as stripGlobalBootstrapTokens,vk as subscribeMutationEventBatches,kk as subscribeMutationEvents,qM as summarizeAgentIdentityVocabulary,Vf as summarizeAgentModelProvenance,Kf as summarizeAgentProvenance,Nv as summarizeContextEvaluationReports,l_ as summarizeContextPreflight,Ev as summarizeHistoryProvenance,qp as summarizeInitResult,CI as summarizeMergeReceipt,mv as supportsCreateExplicitEmpty,JR as supportsItemIdAlias,RE as suppressHostOutput,we as syncRelationshipGraphAdapter,LN as synthesizeExtensionManifest,vc as toCompletionFlagString,Um as toContextFocusItem,Dm as toContextPackingSummary,Fm as toContextRankingSummary,RT as toErrorMessage,b_ as toEstimatedMinutesValue,zk as toExtensionFlagDefinitions,M_ as toImportBoolean,N_ as toImportConfidence,G_ as toImportDeferredFields,P_ as toImportInteger,F_ as toImportLinkedDocs,D_ as toImportLinkedFiles,U_ as toImportLinkedTests,$_ as toImportLogEntries,L_ as toImportNormalizedEnum,k_ as toImportNumberMap,w_ as toImportPriority,R_ as toImportStatus,I_ as toImportStringList,v_ as toImportStringMap,O_ as toImportTags,uE as toItemRecord,x_ as toNonEmptyImportString,OT as toNonEmptyStringOrUndefined,EE as toReplayDocument,ux as toWellFormedText,xs as tokenizeSimilarityText,dT as transferMutationStdinTokenPolicy,Hx as translateHostEnvironmentFault,kO as unprovenClaimActivity,eg as update,d_ as updateLinkedTest,Rg as upgrade,Hh as validate,cM as validateAssertionDefinition,pM as validateAssuranceDocument,dM as validateGateDefinition,Qk as validateItemMutationRows,xl as validateLinkedPaths,fL as validateMcpAuthorizationResponseIssuer,uL as validateMcpAuthorizationServerMetadata,_L as validateMcpClientMetadataDocument,oL as validateMcpHttpRequestHeaders,z0 as validateMcpJsonSchema,aM as validateMeasurementDefinition,Kb as validateMissingParentReference,hA as validateReadOutputOptions,Qb as validateSprintOrReleaseValue,TT as validateTypeOptions,OR as validateWorkspaceTransactionIdentity,iv as verifyAttestation,eP as verifyCliFlagInvocationParity,VR as verifyExplicitPositionalSlotCensus,bE as verifyHistoryChain,xE as verifyHistoryChainWithVersion,hR as verifyHistoryEntries,wx as verifyHistoryRecordHash,Rx as verifyHistoryRewriteEvidence,XR as verifyPmCliGrammar,YR as verifyPmCommandPositionalContracts,MD as verifyPmFlagLexicon,eD as verifyPmRecoveryKindRuntimeCoverage,Wy as verifyPmRecoveryProducerRuntimeCoverage,Z$ as verifyPmRecoveryReferences,oD as verifyPmRefusalClosureIdentityRatchet,nD as verifyPmRefusalClosureRatchet,Q$ as verifyPmRefusalReachability,gd as verifyToolOptionCliParity,oP as waiverNoticeFor,PO as wholeHoursSince,Xb as withCliMutationInput,Bs as withExpectedItemRevisions,Js as withFlagAliasMetadata,Vx as withHostEnvironmentBoundary,Jb as withLiteralMutationInput,B0 as withMcpCachePolicy,ki as withoutGenericRefusalExamples,YS as workflowApprovalFingerprint,XS as workflowPolicyApplies,WS as workflowPolicyFingerprint,ol as workspaceGraphCache,MR as workspaceTransactionPlanDigest,id as wrapOwnershipConflict,CO as wrapThrownErrorForSentry,ai as writeAuthorEnvironment,$e as writeFileAtomic,NT as writeMutationCheckpoint,fw as writeSettings,KO as writeSettingsSection,_x as writeStderr,fx as writeStdout,aO as writeVectorizationStatusLedger,jb as writeWorkspaceJsonWithHistory,dl as writtenLinkedEntries};
35
35
  //# sourceMappingURL=sdk.js.map