@unbrained/pm-cli 2026.11.22 → 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 (892) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli/after-command-context-usage.js +1 -1
  3. package/dist/cli/argv-utils.js +1 -1
  4. package/dist/cli/bootstrap-args.js +1 -1
  5. package/dist/cli/bundle-integrity.js +2 -2
  6. package/dist/cli/command-namespaces.js +1 -1
  7. package/dist/cli/commander-usage.js +11 -11
  8. package/dist/cli/commands/annotations/comments.js +1 -1
  9. package/dist/cli/commands/annotations/docs.js +1 -1
  10. package/dist/cli/commands/annotations/files.js +1 -1
  11. package/dist/cli/commands/annotations/learnings.js +1 -1
  12. package/dist/cli/commands/annotations/notes.js +1 -1
  13. package/dist/cli/commands/extension/describe.js +1 -1
  14. package/dist/cli/commands/extension/extension.js +1 -1
  15. package/dist/cli/commands/extension/scaffold.js +1 -1
  16. package/dist/cli/commands/extension/shared.js +1 -1
  17. package/dist/cli/commands/governance/gc.js +1 -1
  18. package/dist/cli/commands/governance/health.js +1 -1
  19. package/dist/cli/commands/governance/telemetry.js +1 -1
  20. package/dist/cli/commands/governance/validate.js +1 -1
  21. package/dist/cli/commands/history/activity.js +1 -1
  22. package/dist/cli/commands/history/history-compact.js +1 -1
  23. package/dist/cli/commands/history/history-redact.js +1 -1
  24. package/dist/cli/commands/history/history-repair.js +1 -1
  25. package/dist/cli/commands/history/history.js +1 -1
  26. package/dist/cli/commands/history/restore.js +1 -1
  27. package/dist/cli/commands/lifecycle/append.js +1 -1
  28. package/dist/cli/commands/lifecycle/claim.js +1 -1
  29. package/dist/cli/commands/lifecycle/close-many.js +1 -1
  30. package/dist/cli/commands/lifecycle/close.js +1 -1
  31. package/dist/cli/commands/lifecycle/copy.js +1 -1
  32. package/dist/cli/commands/lifecycle/create.js +1 -1
  33. package/dist/cli/commands/lifecycle/delete.js +1 -1
  34. package/dist/cli/commands/lifecycle/focus.js +1 -1
  35. package/dist/cli/commands/lifecycle/plan.js +1 -1
  36. package/dist/cli/commands/lifecycle/update-many.js +1 -1
  37. package/dist/cli/commands/lifecycle/update.js +1 -1
  38. package/dist/cli/commands/query/aggregate.js +1 -1
  39. package/dist/cli/commands/query/context.js +1 -1
  40. package/dist/cli/commands/query/deps.js +1 -1
  41. package/dist/cli/commands/query/duplicates.js +1 -1
  42. package/dist/cli/commands/query/eval.js +1 -1
  43. package/dist/cli/commands/query/get.js +1 -1
  44. package/dist/cli/commands/query/graph.js +1 -1
  45. package/dist/cli/commands/query/list.js +1 -1
  46. package/dist/cli/commands/query/next.js +1 -1
  47. package/dist/cli/commands/query/search.js +1 -1
  48. package/dist/cli/commands/query/stats.js +1 -1
  49. package/dist/cli/commands/test/test-all.js +1 -1
  50. package/dist/cli/commands/test/test-runs.js +1 -1
  51. package/dist/cli/commands/test/test.js +1 -1
  52. package/dist/cli/commands/workspace/config.js +1 -1
  53. package/dist/cli/commands/workspace/contracts.js +1 -1
  54. package/dist/cli/commands/workspace/init.js +1 -1
  55. package/dist/cli/commands/workspace/merge.js +1 -1
  56. package/dist/cli/commands/workspace/profile.js +1 -1
  57. package/dist/cli/commands/workspace/schema.js +1 -1
  58. package/dist/cli/commands/workspace/upgrade.js +1 -1
  59. package/dist/cli/context-intent-invocation.js +1 -1
  60. package/dist/cli/description-stdin.js +1 -1
  61. package/dist/cli/error-guidance.js +5 -5
  62. package/dist/cli/expected-revisions.js +1 -1
  63. package/dist/cli/extension-command-help.js +6 -6
  64. package/dist/cli/extension-recovery.js +1 -1
  65. package/dist/cli/help-content.js +5 -5
  66. package/dist/cli/help-json-payload.js +7 -7
  67. package/dist/cli/invocation-profile.js +2 -2
  68. package/dist/cli/main.js +5 -5
  69. package/dist/cli/migration-gates.js +1 -1
  70. package/dist/cli/option-values.js +1 -1
  71. package/dist/cli/preflight-warnings.js +3 -3
  72. package/dist/cli/public.js +1 -1
  73. package/dist/cli/register-annotations.js +1 -1
  74. package/dist/cli/register-assurance.js +1 -1
  75. package/dist/cli/register-files-lookup.js +1 -1
  76. package/dist/cli/register-history-activity.js +1 -1
  77. package/dist/cli/register-history-author.js +1 -1
  78. package/dist/cli/register-history-maintenance.js +2 -2
  79. package/dist/cli/register-list-query.js +10 -10
  80. package/dist/cli/register-mutation-options.js +0 -1
  81. package/dist/cli/register-mutation.js +6 -6
  82. package/dist/cli/register-operations.js +1 -1
  83. package/dist/cli/register-setup.js +1 -1
  84. package/dist/cli/register-structured-mutation.js +1 -1
  85. package/dist/cli/registration-helpers.js +1 -1
  86. package/dist/cli/runtime/activation.js +1 -1
  87. package/dist/cli/runtime/annotation-option-retry.js +1 -1
  88. package/dist/cli/runtime/close-fields-retry.js +1 -1
  89. package/dist/cli/runtime/field-route-retry.js +1 -1
  90. package/dist/cli/runtime/invocation-options.js +1 -1
  91. package/dist/cli/runtime/invocation-rewrites.js +1 -1
  92. package/dist/cli/runtime/projection-retry.js +1 -1
  93. package/dist/cli/runtime/read-output-mutation-retry.js +1 -1
  94. package/dist/cli/runtime/refusal-credential-redaction.js +1 -1
  95. package/dist/cli/runtime/selection.js +1 -1
  96. package/dist/cli/runtime/telemetry-outcome.js +1 -1
  97. package/dist/cli/runtime-compatibility-boundary.js +4 -4
  98. package/dist/cli/schema/registration.js +15 -15
  99. package/dist/cli/schema-registration-helpers.js +1 -1
  100. package/dist/cli/search-refresh.js +1 -1
  101. package/dist/cli/stats-analytics-json.js +1 -1
  102. package/dist/cli/telemetry-flush.js +1 -1
  103. package/dist/cli-bundle/bundle-manifest.json +1 -1
  104. package/dist/cli-bundle/chunks/chunk-2UQU7HRR.js +9 -0
  105. package/dist/cli-bundle/chunks/chunk-5DUP4AZA.js +2 -0
  106. package/dist/cli-bundle/chunks/chunk-5WZZ5XEN.js +3 -0
  107. package/dist/cli-bundle/chunks/chunk-6H36ZHMI.js +2 -0
  108. package/dist/cli-bundle/chunks/chunk-6MYJLOSG.js +2 -0
  109. package/dist/cli-bundle/chunks/chunk-AA52P34H.js +3 -0
  110. package/dist/cli-bundle/chunks/{chunk-B76TFRO2.js → chunk-AEOHUSUI.js} +101 -101
  111. package/dist/cli-bundle/chunks/chunk-BSRIVYTM.js +8 -0
  112. package/dist/cli-bundle/chunks/chunk-CFWLQFJM.js +71 -0
  113. package/dist/cli-bundle/chunks/chunk-D6PDUKUG.js +9 -0
  114. package/dist/cli-bundle/chunks/chunk-ENKXRSFZ.js +31 -0
  115. package/dist/cli-bundle/chunks/chunk-F2Z6XLZB.js +3 -0
  116. package/dist/cli-bundle/chunks/chunk-FJOEL75F.js +2 -0
  117. package/dist/cli-bundle/chunks/chunk-GDXCAC52.js +2 -0
  118. package/dist/cli-bundle/chunks/chunk-H7JEXRIN.js +6 -0
  119. package/dist/cli-bundle/chunks/chunk-J2PDAVBC.js +2 -0
  120. package/dist/cli-bundle/chunks/chunk-KE7HMBEW.js +2 -0
  121. package/dist/cli-bundle/chunks/chunk-KZHIBEJL.js +33 -0
  122. package/dist/cli-bundle/chunks/chunk-NGJ5ERBF.js +115 -0
  123. package/dist/cli-bundle/chunks/chunk-NQ54T7T2.js +2 -0
  124. package/dist/cli-bundle/chunks/chunk-O7JHS64G.js +3 -0
  125. package/dist/cli-bundle/chunks/chunk-OKEZF7HU.js +2 -0
  126. package/dist/cli-bundle/chunks/chunk-OKIKF4FD.js +2 -0
  127. package/dist/cli-bundle/chunks/chunk-OPJF254V.js +9 -0
  128. package/dist/cli-bundle/chunks/chunk-PZA7QECY.js +1 -0
  129. package/dist/cli-bundle/chunks/chunk-RWA5YZ5X.js +2 -0
  130. package/dist/cli-bundle/chunks/chunk-S32NGRQM.js +2 -0
  131. package/dist/cli-bundle/chunks/chunk-SLFRSZK6.js +1 -0
  132. package/dist/cli-bundle/chunks/chunk-TZY5MVJF.js +125 -0
  133. package/dist/cli-bundle/chunks/chunk-YYT3MIRF.js +3 -0
  134. package/dist/cli-bundle/chunks/chunk-ZPS4B6SI.js +8 -0
  135. package/dist/cli-bundle/chunks/context-budget-recovery-M5RFUEFG.js +2 -0
  136. package/dist/cli-bundle/chunks/indexed-receipt-blobs-BPYKN5Q7.js +4 -0
  137. package/dist/cli-bundle/chunks/{item-revision-4QBMZXKX.js → item-revision-FMD4KWBB.js} +2 -2
  138. package/dist/cli-bundle/chunks/item-transaction-SEHTH7N2.js +2 -0
  139. package/dist/cli-bundle/chunks/mutation-actor-SFGYIRPW.js +2 -0
  140. package/dist/cli-bundle/chunks/mutation-admission-57LBSKQI.js +2 -0
  141. package/dist/cli-bundle/chunks/{register-list-query-RR5KACJ3.js → register-list-query-L4IBU64P.js} +11 -11
  142. package/dist/cli-bundle/chunks/register-mutation-6NUOPHZ3.js +21 -0
  143. package/dist/cli-bundle/chunks/register-operations-JGYVORNN.js +2 -0
  144. package/dist/cli-bundle/chunks/register-setup-C44SIXEH.js +2 -0
  145. package/dist/cli-bundle/chunks/settlement-hook-6MR32OOC.js +7 -0
  146. package/dist/cli-bundle/chunks/stage-PQ7AB63N.js +2 -0
  147. package/dist/cli-bundle/focused-chunks/chunk-6LKTEKHS.js +6 -0
  148. package/dist/cli-bundle/focused-chunks/chunk-6LPXMFLM.js +2 -0
  149. package/dist/cli-bundle/focused-chunks/chunk-A6VEMCRR.js +3 -0
  150. package/dist/cli-bundle/focused-chunks/chunk-AIDL2ZNT.js +3 -0
  151. package/dist/cli-bundle/focused-chunks/chunk-BKPUUW5O.js +1 -0
  152. package/dist/cli-bundle/focused-chunks/chunk-BWOVFE5B.js +2 -0
  153. package/dist/cli-bundle/focused-chunks/chunk-HMDQDRV2.js +8 -0
  154. package/dist/cli-bundle/focused-chunks/chunk-I66IKYKP.js +2 -0
  155. package/dist/cli-bundle/focused-chunks/chunk-IIP6LZ5E.js +2 -0
  156. package/dist/cli-bundle/focused-chunks/chunk-IR2J3NOT.js +2 -0
  157. package/dist/cli-bundle/focused-chunks/chunk-IROZDIDX.js +3 -0
  158. package/dist/cli-bundle/focused-chunks/chunk-ITKDHSBR.js +2 -0
  159. package/dist/cli-bundle/focused-chunks/chunk-K53OIT5J.js +2 -0
  160. package/dist/cli-bundle/focused-chunks/chunk-LQYYPXUK.js +26 -0
  161. package/dist/cli-bundle/focused-chunks/chunk-NQTEE66P.js +13 -0
  162. package/dist/cli-bundle/focused-chunks/chunk-O7Z73ALG.js +2 -0
  163. package/dist/cli-bundle/focused-chunks/chunk-OTMMOKPM.js +91 -0
  164. package/dist/cli-bundle/focused-chunks/chunk-OXOCZJC6.js +2 -0
  165. package/dist/cli-bundle/focused-chunks/chunk-QLAHEDT6.js +2 -0
  166. package/dist/cli-bundle/focused-chunks/chunk-QQIIMMFU.js +2 -0
  167. package/dist/cli-bundle/focused-chunks/chunk-RIE3SJSE.js +9 -0
  168. package/dist/cli-bundle/focused-chunks/chunk-TD544C74.js +8 -0
  169. package/dist/cli-bundle/focused-chunks/chunk-UFTUNBMY.js +27 -0
  170. package/dist/cli-bundle/focused-chunks/chunk-X6CXWWNB.js +2 -0
  171. package/dist/cli-bundle/focused-chunks/chunk-XRS3VNC6.js +44 -0
  172. package/dist/cli-bundle/focused-chunks/chunk-XYPEZGTR.js +2 -0
  173. package/dist/cli-bundle/focused-chunks/chunk-Y2ESLKCF.js +8 -0
  174. package/dist/cli-bundle/focused-chunks/chunk-YSJKQLFR.js +2 -0
  175. package/dist/cli-bundle/focused-chunks/chunk-Z2X7HH3C.js +102 -0
  176. package/dist/cli-bundle/focused-chunks/chunk-ZHWPCVQL.js +78 -0
  177. package/dist/cli-bundle/focused-chunks/context-budget-recovery-CSJV3TY3.js +2 -0
  178. package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-EGEJMG3G.js +4 -0
  179. package/dist/cli-bundle/focused-chunks/{item-revision-2O6MLPEX.js → item-revision-YDACCDVY.js} +2 -2
  180. package/dist/cli-bundle/focused-chunks/item-transaction-UKEQCTKB.js +2 -0
  181. package/dist/cli-bundle/focused-chunks/mutation-actor-AS465LRX.js +2 -0
  182. package/dist/cli-bundle/focused-chunks/mutation-admission-E5UHJZFE.js +2 -0
  183. package/dist/cli-bundle/focused-chunks/settlement-hook-FMLGKG7J.js +7 -0
  184. package/dist/cli-bundle/focused-chunks/stage-36J7YLGI.js +2 -0
  185. package/dist/cli-bundle/main.js +27 -27
  186. package/dist/cli-bundle/sdk-authoring.js +1 -1
  187. package/dist/cli-bundle/sdk-contracts.js +5 -5
  188. package/dist/cli-bundle/sdk-core.js +1 -1
  189. package/dist/cli-bundle/sdk-governance.js +1 -1
  190. package/dist/cli-bundle/sdk-graph.js +1 -1
  191. package/dist/cli-bundle/sdk-merge.js +66 -66
  192. package/dist/cli-bundle/sdk-query.js +1 -1
  193. package/dist/cli-bundle/sdk-runtime.js +1 -1
  194. package/dist/cli-bundle/sdk-testing.js +1 -1
  195. package/dist/cli-bundle/sdk.js +12 -12
  196. package/dist/cli.js +1 -1
  197. package/dist/core/checkpoint/checkpoint-gc.js +1 -1
  198. package/dist/core/checkpoint/mutation-checkpoint.js +2 -2
  199. package/dist/core/checkpoint/mutation-context.js +1 -1
  200. package/dist/core/config/nested-settings.js +1 -1
  201. package/dist/core/config/positional-value.js +1 -1
  202. package/dist/core/diagnostics/remediation.js +1 -1
  203. package/dist/core/extensions/activation-summary-markdown.js +2 -2
  204. package/dist/core/extensions/activation-summary.js +1 -1
  205. package/dist/core/extensions/activation-transaction.js +1 -1
  206. package/dist/core/extensions/capability-usage.js +1 -1
  207. package/dist/core/extensions/command-hook-context.js +1 -1
  208. package/dist/core/extensions/command-metadata-contract.js +1 -1
  209. package/dist/core/extensions/command-visibility-tier.js +1 -1
  210. package/dist/core/extensions/contribution-inventory.js +1 -1
  211. package/dist/core/extensions/exporter-output-contract.js +1 -1
  212. package/dist/core/extensions/extension-candidate.js +1 -1
  213. package/dist/core/extensions/extension-capability-aliases.js +1 -1
  214. package/dist/core/extensions/extension-hook-runtime.js +1 -1
  215. package/dist/core/extensions/extension-policy.js +1 -1
  216. package/dist/core/extensions/extension-registries.js +1 -1
  217. package/dist/core/extensions/extension-runtime-helpers.js +1 -1
  218. package/dist/core/extensions/extension-types.js +1 -1
  219. package/dist/core/extensions/flag-definition-validation.js +1 -1
  220. package/dist/core/extensions/flag-value-types.js +1 -1
  221. package/dist/core/extensions/index.js +1 -1
  222. package/dist/core/extensions/item-field-types.js +1 -1
  223. package/dist/core/extensions/item-fields.js +1 -1
  224. package/dist/core/extensions/loader.js +1 -1
  225. package/dist/core/extensions/manifest-parser.js +1 -1
  226. package/dist/core/extensions/manifest-schema.js +1 -1
  227. package/dist/core/extensions/module-graph-snapshot.js +1 -1
  228. package/dist/core/extensions/mutation-actor-snapshot.js +1 -1
  229. package/dist/core/extensions/mutation-actor.js +1 -1
  230. package/dist/core/extensions/preflight-ownership.js +1 -1
  231. package/dist/core/extensions/read-output-contract.js +1 -1
  232. package/dist/core/extensions/registration-contracts.js +1 -1
  233. package/dist/core/extensions/registration-validation.js +1 -1
  234. package/dist/core/extensions/registration-values.js +1 -1
  235. package/dist/core/extensions/reserved-host-flags.js +1 -1
  236. package/dist/core/extensions/runtime-registrations.js +1 -1
  237. package/dist/core/extensions/service-ownership.js +1 -1
  238. package/dist/core/extensions/version-compat.js +1 -1
  239. package/dist/core/extensions/version-diagnostics.js +1 -1
  240. package/dist/core/fs/atomic-create.js +1 -1
  241. package/dist/core/fs/file-glob.js +1 -1
  242. package/dist/core/fs/fs-utils.js +2 -2
  243. package/dist/core/fs/host-environment-errors.js +1 -1
  244. package/dist/core/fs/index.js +1 -1
  245. package/dist/core/fs/path-utils.js +1 -1
  246. package/dist/core/governance/content-fields.js +1 -1
  247. package/dist/core/governance/issue-codes.js +1 -1
  248. package/dist/core/governance/metadata-coverage.js +1 -1
  249. package/dist/core/history/bridge.js +1 -1
  250. package/dist/core/history/digest.js +1 -1
  251. package/dist/core/history/drift-cache.js +3 -3
  252. package/dist/core/history/drift-scan.js +1 -1
  253. package/dist/core/history/event-classification.js +1 -1
  254. package/dist/core/history/event-index.js +11 -11
  255. package/dist/core/history/history-compact-bulk.js +1 -1
  256. package/dist/core/history/history-diff.js +1 -1
  257. package/dist/core/history/history-rewrite.js +1 -1
  258. package/dist/core/history/history-storage-stats.js +1 -1
  259. package/dist/core/history/history-stream-policy.js +1 -1
  260. package/dist/core/history/history.js +2 -2
  261. package/dist/core/history/identity.js +1 -1
  262. package/dist/core/history/index.js +1 -1
  263. package/dist/core/history/operation-contract.js +1 -1
  264. package/dist/core/history/projection.js +1 -1
  265. package/dist/core/history/read.js +1 -1
  266. package/dist/core/history/replay.js +2 -2
  267. package/dist/core/history/stream-summary.js +2 -2
  268. package/dist/core/history/tombstone.js +1 -1
  269. package/dist/core/history/version-address.js +1 -1
  270. package/dist/core/history/workspace-history.js +2 -2
  271. package/dist/core/io/body-file.js +1 -1
  272. package/dist/core/io/bulk-ids-input.js +2 -2
  273. package/dist/core/item/actionability.js +1 -1
  274. package/dist/core/item/deferred-fields.js +1 -1
  275. package/dist/core/item/dependency-reference.js +1 -1
  276. package/dist/core/item/id.js +1 -1
  277. package/dist/core/item/index.js +1 -1
  278. package/dist/core/item/item-format-version.js +1 -1
  279. package/dist/core/item/item-format.js +7 -7
  280. package/dist/core/item/item-record.js +1 -1
  281. package/dist/core/item/item-type-definition.js +1 -1
  282. package/dist/core/item/literal-mutation-input.js +1 -1
  283. package/dist/core/item/parent-reference-policy.js +1 -1
  284. package/dist/core/item/parse.js +8 -8
  285. package/dist/core/item/plan-lifecycle.js +1 -1
  286. package/dist/core/item/priority.js +1 -1
  287. package/dist/core/item/sprint-release-format.js +1 -1
  288. package/dist/core/item/status-filter.js +1 -1
  289. package/dist/core/item/status.js +1 -1
  290. package/dist/core/item/toon-decode.js +1 -1
  291. package/dist/core/item/type-registry.js +1 -1
  292. package/dist/core/item/type-synonyms.js +1 -1
  293. package/dist/core/lock/index.js +1 -1
  294. package/dist/core/lock/lock-confinement.js +1 -1
  295. package/dist/core/lock/lock-gc.js +1 -1
  296. package/dist/core/lock/lock-owner.js +1 -1
  297. package/dist/core/lock/lock.js +4 -4
  298. package/dist/core/output/linked-test-projection.js +5 -5
  299. package/dist/core/output/mutation-projection.js +1 -1
  300. package/dist/core/output/output-control.js +1 -1
  301. package/dist/core/output/output.js +19 -19
  302. package/dist/core/output/query-summary.js +1 -1
  303. package/dist/core/output/tabular.js +3 -3
  304. package/dist/core/packages/manifest.js +1 -1
  305. package/dist/core/packages/root.js +1 -1
  306. package/dist/core/policy/workflow-policy-schema.js +1 -1
  307. package/dist/core/policy/workflow-policy-store.js +1 -1
  308. package/dist/core/policy/workflow-policy.js +1 -1
  309. package/dist/core/profile/profile-describe.js +1 -1
  310. package/dist/core/profile/profile-lint.d.ts +1 -1
  311. package/dist/core/profile/profile-lint.js +1 -1
  312. package/dist/core/profile/profile-plan.js +1 -1
  313. package/dist/core/profile/profile-presets.js +4 -4
  314. package/dist/core/reproducibility/context.js +1 -1
  315. package/dist/core/schema/fields-file.js +2 -2
  316. package/dist/core/schema/item-types-file.js +2 -2
  317. package/dist/core/schema/runtime-field-filters.js +1 -1
  318. package/dist/core/schema/runtime-field-values.js +1 -1
  319. package/dist/core/schema/runtime-schema.js +2 -2
  320. package/dist/core/schema/status-defs-file.js +2 -2
  321. package/dist/core/schema/status-token.js +1 -1
  322. package/dist/core/schema/type-inference.js +1 -1
  323. package/dist/core/schema/type-presets.js +1 -1
  324. package/dist/core/schema/type-workflows.js +1 -1
  325. package/dist/core/search/background-refresh.js +2 -2
  326. package/dist/core/search/bm25.js +1 -1
  327. package/dist/core/search/cache.js +2 -2
  328. package/dist/core/search/corpus.js +1 -1
  329. package/dist/core/search/embedding-batches.js +1 -1
  330. package/dist/core/search/eval-thresholds.js +1 -1
  331. package/dist/core/search/eval.js +1 -1
  332. package/dist/core/search/http-client.js +1 -1
  333. package/dist/core/search/providers.js +1 -1
  334. package/dist/core/search/relevance.js +1 -1
  335. package/dist/core/search/semantic-defaults.js +1 -1
  336. package/dist/core/search/staleness.js +1 -1
  337. package/dist/core/search/vector-stores.js +2 -2
  338. package/dist/core/search/vectorization-metadata.js +1 -1
  339. package/dist/core/sentry/helpers.js +1 -1
  340. package/dist/core/sentry/instrument.js +1 -1
  341. package/dist/core/sentry/sensitive-assignments.js +1 -1
  342. package/dist/core/session/session-state.js +1 -1
  343. package/dist/core/shared/agent-session-context.js +1 -1
  344. package/dist/core/shared/author.js +5 -5
  345. package/dist/core/shared/command-line.js +1 -1
  346. package/dist/core/shared/command-types.js +0 -1
  347. package/dist/core/shared/conflict-markers.js +1 -1
  348. package/dist/core/shared/constants.js +1 -1
  349. package/dist/core/shared/error-details.js +1 -1
  350. package/dist/core/shared/errors.js +1 -1
  351. package/dist/core/shared/html-entity-decode.js +1 -1
  352. package/dist/core/shared/index.js +1 -1
  353. package/dist/core/shared/item-metadata-contract.js +1 -1
  354. package/dist/core/shared/lazy-module.js +1 -1
  355. package/dist/core/shared/levenshtein.js +1 -1
  356. package/dist/core/shared/memo.js +1 -1
  357. package/dist/core/shared/numeric-parsers.js +1 -1
  358. package/dist/core/shared/option-alias-visibility.js +1 -1
  359. package/dist/core/shared/output-unicode.js +1 -1
  360. package/dist/core/shared/primitives.js +1 -1
  361. package/dist/core/shared/process-tree.js +2 -2
  362. package/dist/core/shared/secret-rules.js +5 -5
  363. package/dist/core/shared/serial-queue.js +1 -1
  364. package/dist/core/shared/serialization.js +1 -1
  365. package/dist/core/shared/split-comma-list.js +1 -1
  366. package/dist/core/shared/text-normalization.js +1 -1
  367. package/dist/core/shared/time.js +2 -2
  368. package/dist/core/shared/url-credentials.js +1 -1
  369. package/dist/core/store/index.js +1 -1
  370. package/dist/core/store/item-format-migration.js +1 -1
  371. package/dist/core/store/item-metadata-cache.js +1 -1
  372. package/dist/core/store/item-metadata-query-index.js +11 -11
  373. package/dist/core/store/item-metadata-read-work.js +1 -1
  374. package/dist/core/store/item-mutation-precondition.js +1 -1
  375. package/dist/core/store/item-store.js +1 -1
  376. package/dist/core/store/paths.js +1 -1
  377. package/dist/core/store/settings-concurrency.js +1 -1
  378. package/dist/core/store/settings-read-cache.js +1 -1
  379. package/dist/core/store/settings-sections.js +2 -2
  380. package/dist/core/store/settings-validator.js +1 -1
  381. package/dist/core/store/settings.d.ts +3 -1
  382. package/dist/core/store/settings.js +6 -6
  383. package/dist/core/store/sqlite-runtime.js +1 -1
  384. package/dist/core/store/tracker-preflight.js +1 -1
  385. package/dist/core/store/transaction-coordinator-scope.js +1 -1
  386. package/dist/core/telemetry/consent.js +3 -3
  387. package/dist/core/telemetry/observability.js +1 -1
  388. package/dist/core/telemetry/policy.js +1 -1
  389. package/dist/core/telemetry/read-sampling.js +2 -2
  390. package/dist/core/telemetry/runtime.js +9 -9
  391. package/dist/core/test/background-runs.js +4 -4
  392. package/dist/core/test/item-test-run-tracking.js +1 -1
  393. package/dist/core/test/run-selectors.js +1 -1
  394. package/dist/core/validate/estimate-defaults.js +1 -1
  395. package/dist/core/validate/fix-planning.js +1 -1
  396. package/dist/core/validate/linked-artifact-reference.js +1 -1
  397. package/dist/core/validate/missing-by-type.js +1 -1
  398. package/dist/core/validate/missing-link-owners.js +1 -1
  399. package/dist/core/validate/stale-file-classification.js +1 -1
  400. package/dist/mcp/http-server.js +5 -5
  401. package/dist/mcp/legacy-adapter.js +1 -1
  402. package/dist/mcp/runtime-capabilities.js +1 -1
  403. package/dist/mcp/server.js +4 -4
  404. package/dist/mcp/tool-definitions.js +1 -1
  405. package/dist/sdk/actionability.js +1 -1
  406. package/dist/sdk/agent/closed-domain-contracts.js +1 -1
  407. package/dist/sdk/agent/command-recovery.js +1 -1
  408. package/dist/sdk/agent/command-suggestions.js +1 -1
  409. package/dist/sdk/agent/create-option-policy.js +1 -1
  410. package/dist/sdk/agent/identity-config.js +1 -1
  411. package/dist/sdk/agent/item-addressing.js +1 -1
  412. package/dist/sdk/agent/linked-resource-recovery.js +1 -1
  413. package/dist/sdk/agent/refusal-closure-census.js +2 -2
  414. package/dist/sdk/agent/refusal-corpus-contracts.js +1 -1
  415. package/dist/sdk/agent/subcommand-recovery.js +1 -1
  416. package/dist/sdk/agent-capability-contracts.js +3 -3
  417. package/dist/sdk/agent-session-context.js +1 -1
  418. package/dist/sdk/annotations.js +1 -1
  419. package/dist/sdk/author-attribution.js +1 -1
  420. package/dist/sdk/cli-bootstrap.js +1 -1
  421. package/dist/sdk/cli-contracts/agent-output-contracts.js +5 -5
  422. package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +1 -1
  423. package/dist/sdk/cli-contracts/command-aliases.js +1 -1
  424. package/dist/sdk/cli-contracts/command-exit-contracts.js +1 -1
  425. package/dist/sdk/cli-contracts/commander-mutation-options.js +1 -1
  426. package/dist/sdk/cli-contracts/commander-types.js +1 -1
  427. package/dist/sdk/cli-contracts/completeness.js +1 -1
  428. package/dist/sdk/cli-contracts/enum-contracts.js +1 -1
  429. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  430. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +2 -2
  431. package/dist/sdk/cli-contracts/grammar-contracts.js +1 -1
  432. package/dist/sdk/cli-contracts/registration-helpers.js +7 -7
  433. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  434. package/dist/sdk/cli-contracts/schemas/assurance-definition.js +1 -1
  435. package/dist/sdk/cli-contracts/string-lists.js +1 -1
  436. package/dist/sdk/cli-contracts/tool-option-contracts.js +1 -1
  437. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  438. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  439. package/dist/sdk/cli-contracts/typed-action-inputs.js +0 -1
  440. package/dist/sdk/cli-contracts.js +1 -1
  441. package/dist/sdk/cli-program.js +1 -1
  442. package/dist/sdk/command-line.js +1 -1
  443. package/dist/sdk/comments.js +1 -1
  444. package/dist/sdk/compile-cache.js +1 -1
  445. package/dist/sdk/completion/bash.js +2 -2
  446. package/dist/sdk/completion/fish.js +72 -72
  447. package/dist/sdk/completion/shared.js +1 -1
  448. package/dist/sdk/completion/zsh.js +75 -75
  449. package/dist/sdk/completion.js +1 -1
  450. package/dist/sdk/config.js +1 -1
  451. package/dist/sdk/context/recency.js +1 -1
  452. package/dist/sdk/context/semantic-session-attribution.js +1 -1
  453. package/dist/sdk/context/usage-egress.js +1 -1
  454. package/dist/sdk/context/usage-ledger.js +6 -6
  455. package/dist/sdk/context-intent-contracts.js +1 -1
  456. package/dist/sdk/context-intent-runtime.js +1 -1
  457. package/dist/sdk/context-packing.js +1 -1
  458. package/dist/sdk/context-relevance.js +1 -1
  459. package/dist/sdk/context-signal-store.js +2 -2
  460. package/dist/sdk/context-usage.js +1 -1
  461. package/dist/sdk/dependencies/context-budget-recovery.js +1 -1
  462. package/dist/sdk/dependencies.js +1 -1
  463. package/dist/sdk/dependency-flag-validation.js +1 -1
  464. package/dist/sdk/dependency-provenance.js +1 -1
  465. package/dist/sdk/docs.js +1 -1
  466. package/dist/sdk/duplicates.js +1 -1
  467. package/dist/sdk/environment/host-environment-errors.js +1 -1
  468. package/dist/sdk/environment/project-runtime-compatibility.js +2 -2
  469. package/dist/sdk/environment/source-context.js +1 -1
  470. package/dist/sdk/environment/tracker-preflight.js +1 -1
  471. package/dist/sdk/error-code-catalog.js +1 -1
  472. package/dist/sdk/error-runtime.js +1 -1
  473. package/dist/sdk/errors.js +1 -1
  474. package/dist/sdk/eval.js +1 -1
  475. package/dist/sdk/extension/author-manifest.js +1 -1
  476. package/dist/sdk/extension/bundled-catalog.js +1 -1
  477. package/dist/sdk/extension/command-options.js +1 -1
  478. package/dist/sdk/extension/concurrency.js +1 -1
  479. package/dist/sdk/extension/copy-scope.js +1 -1
  480. package/dist/sdk/extension/custom-field-collisions.js +1 -1
  481. package/dist/sdk/extension/describe.js +3 -3
  482. package/dist/sdk/extension/doctor.js +1 -1
  483. package/dist/sdk/extension/install-plan.js +1 -1
  484. package/dist/sdk/extension/install-receipts.js +1 -1
  485. package/dist/sdk/extension/install-runtime.js +3 -3
  486. package/dist/sdk/extension/install-snapshot.js +1 -1
  487. package/dist/sdk/extension/install-sources.js +5 -5
  488. package/dist/sdk/extension/managed-state.js +2 -2
  489. package/dist/sdk/extension/managed-update-status.js +1 -1
  490. package/dist/sdk/extension/migrations.js +2 -2
  491. package/dist/sdk/extension/native-command-options.js +1 -1
  492. package/dist/sdk/extension/output-ownership.js +1 -1
  493. package/dist/sdk/extension/runtime-summary.js +1 -1
  494. package/dist/sdk/extension/scaffold.js +11 -11
  495. package/dist/sdk/extension/shared.js +1 -1
  496. package/dist/sdk/extension/source-resolution.js +1 -1
  497. package/dist/sdk/extension/static-inventory.js +1 -1
  498. package/dist/sdk/extension/update-check.js +1 -1
  499. package/dist/sdk/extension-command-context.js +2 -2
  500. package/dist/sdk/extension-contracts.js +1 -1
  501. package/dist/sdk/extension.js +1 -1
  502. package/dist/sdk/files.js +1 -1
  503. package/dist/sdk/flag-invocation-contracts.js +1 -1
  504. package/dist/sdk/generated/error-code-catalog-rows.js +1 -1
  505. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  506. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  507. package/dist/sdk/generated-error-code-catalog.js +1 -1
  508. package/dist/sdk/governance/assurance-action-contracts.js +0 -1
  509. package/dist/sdk/governance/assurance-action.js +1 -1
  510. package/dist/sdk/governance/assurance-limits.js +1 -1
  511. package/dist/sdk/governance/assurance-mutation-error.js +1 -1
  512. package/dist/sdk/governance/assurance-presets.js +1 -1
  513. package/dist/sdk/governance/assurance-runtime.js +1 -1
  514. package/dist/sdk/governance/assurance.js +4 -4
  515. package/dist/sdk/governance/boundary-fixtures.js +1 -1
  516. package/dist/sdk/governance/closure-timestamps.js +1 -1
  517. package/dist/sdk/governance/defect-recurrence-coverage.js +1 -1
  518. package/dist/sdk/governance/defect-recurrence-graph.js +1 -1
  519. package/dist/sdk/governance/defect-recurrence-signals.js +1 -1
  520. package/dist/sdk/governance/defect-recurrence.js +2 -2
  521. package/dist/sdk/governance/extension-host-version.js +1 -1
  522. package/dist/sdk/governance/gc.js +1 -1
  523. package/dist/sdk/governance/health/history-drift-remedies.js +1 -1
  524. package/dist/sdk/governance/health/projection.js +1 -1
  525. package/dist/sdk/governance/health-merge-evidence.js +1 -1
  526. package/dist/sdk/governance/health.js +2 -2
  527. package/dist/sdk/governance/hierarchy-validation.js +1 -1
  528. package/dist/sdk/governance/in-progress-work-health.js +1 -1
  529. package/dist/sdk/governance/lifecycle-dependency-cycles.js +1 -1
  530. package/dist/sdk/governance/linked-file-report.js +1 -1
  531. package/dist/sdk/governance/merge-receipt-history.js +1 -1
  532. package/dist/sdk/governance/provenance-health.js +4 -4
  533. package/dist/sdk/governance/reindex.js +5 -5
  534. package/dist/sdk/governance/stale-work.js +1 -1
  535. package/dist/sdk/governance/status-role-diagnostics.js +1 -1
  536. package/dist/sdk/governance/storage-integrity.js +1 -1
  537. package/dist/sdk/governance/tracked-runtime-cache.js +1 -1
  538. package/dist/sdk/governance/upgrade.js +2 -2
  539. package/dist/sdk/governance/validate-deferred-fields.js +1 -1
  540. package/dist/sdk/governance/validate-history-drift.js +1 -1
  541. package/dist/sdk/governance/validate-item-reader.js +1 -1
  542. package/dist/sdk/governance/validate-normalization.js +1 -1
  543. package/dist/sdk/governance/validate.js +1 -1
  544. package/dist/sdk/governance/workflow-completeness.js +1 -1
  545. package/dist/sdk/governance/workflow-policy.js +3 -3
  546. package/dist/sdk/governance/workspace-position.js +2 -2
  547. package/dist/sdk/graph/analytics.js +1 -1
  548. package/dist/sdk/graph/assembly.js +1 -1
  549. package/dist/sdk/graph/cache.js +1 -1
  550. package/dist/sdk/graph/cardinality-integrity.js +1 -1
  551. package/dist/sdk/graph/centrality.js +1 -1
  552. package/dist/sdk/graph/deadline-scheduling.js +1 -1
  553. package/dist/sdk/graph/durable-cache.js +1 -1
  554. package/dist/sdk/graph/governance-contracts.js +1 -1
  555. package/dist/sdk/graph/governance.js +1 -1
  556. package/dist/sdk/graph/hierarchy-integrity.js +1 -1
  557. package/dist/sdk/graph/lifecycle-coverage.js +1 -1
  558. package/dist/sdk/graph/mutation-advisory.js +1 -1
  559. package/dist/sdk/graph/query-contracts.js +1 -1
  560. package/dist/sdk/graph/remediation.js +1 -1
  561. package/dist/sdk/graph/run.js +1 -1
  562. package/dist/sdk/graph/scheduling.js +1 -1
  563. package/dist/sdk/graph/traversal.js +1 -1
  564. package/dist/sdk/graph/workspace-relationship-kind-registry.js +1 -1
  565. package/dist/sdk/guide-topics.js +1 -1
  566. package/dist/sdk/guide.js +7 -7
  567. package/dist/sdk/history/append-only-repair.js +4 -4
  568. package/dist/sdk/history/attestation-command.js +2 -2
  569. package/dist/sdk/history/attestation-contract.js +1 -1
  570. package/dist/sdk/history/attestation-scan.js +1 -1
  571. package/dist/sdk/history/attestation.js +1 -1
  572. package/dist/sdk/history/maintenance.js +1 -1
  573. package/dist/sdk/history/reanchor-refusal.js +1 -1
  574. package/dist/sdk/history/reseed.js +1 -1
  575. package/dist/sdk/history/salvage.js +5 -5
  576. package/dist/sdk/history/subject.js +1 -1
  577. package/dist/sdk/history-analytics.js +1 -1
  578. package/dist/sdk/history-compact.js +1 -1
  579. package/dist/sdk/history-mcp.js +1 -1
  580. package/dist/sdk/history-provenance.js +1 -1
  581. package/dist/sdk/history-read.js +1 -1
  582. package/dist/sdk/history-redact.js +1 -1
  583. package/dist/sdk/history-repair.js +1 -1
  584. package/dist/sdk/improvement-ledger-validation.js +1 -1
  585. package/dist/sdk/improvement-ledger.js +2 -2
  586. package/dist/sdk/init-agent-guidance.js +10 -10
  587. package/dist/sdk/init.js +14 -14
  588. package/dist/sdk/invocation-author.js +1 -1
  589. package/dist/sdk/item-children.js +1 -1
  590. package/dist/sdk/item-metadata-index.js +1 -1
  591. package/dist/sdk/item-schedule.js +1 -1
  592. package/dist/sdk/item-transaction.js +1 -1
  593. package/dist/sdk/learnings.js +1 -1
  594. package/dist/sdk/lifecycle/append.js +3 -3
  595. package/dist/sdk/lifecycle/checkpoint-rollback.js +1 -1
  596. package/dist/sdk/lifecycle/claim.js +1 -1
  597. package/dist/sdk/lifecycle/cli-input.js +1 -1
  598. package/dist/sdk/lifecycle/close-many.js +1 -1
  599. package/dist/sdk/lifecycle/close.js +1 -1
  600. package/dist/sdk/lifecycle/copy.js +1 -1
  601. package/dist/sdk/lifecycle/core-field-recovery.js +1 -1
  602. package/dist/sdk/lifecycle/core-item-fields.js +1 -1
  603. package/dist/sdk/lifecycle/create-deferrals.js +1 -1
  604. package/dist/sdk/lifecycle/create.js +1 -1
  605. package/dist/sdk/lifecycle/delete.js +1 -1
  606. package/dist/sdk/lifecycle/dependency-removal.js +1 -1
  607. package/dist/sdk/lifecycle/event-validation-messages.js +1 -1
  608. package/dist/sdk/lifecycle/focus.js +1 -1
  609. package/dist/sdk/lifecycle/hierarchy-mutation-lock.js +1 -1
  610. package/dist/sdk/lifecycle/item-revision.js +1 -1
  611. package/dist/sdk/lifecycle/legacy-none-tokens.js +1 -1
  612. package/dist/sdk/lifecycle/lifecycle-transitions.js +1 -1
  613. package/dist/sdk/lifecycle/mcp-actions.js +1 -1
  614. package/dist/sdk/lifecycle/metadata-normalizers.js +1 -1
  615. package/dist/sdk/lifecycle/mutation-command-options.js +0 -1
  616. package/dist/sdk/lifecycle/mutation-facet-contracts.js +1 -1
  617. package/dist/sdk/lifecycle/mutation-option-validation.js +1 -1
  618. package/dist/sdk/lifecycle/plan-mutation-receipt.js +1 -1
  619. package/dist/sdk/lifecycle/plan.js +1 -1
  620. package/dist/sdk/lifecycle/recurrence-parsers.js +1 -1
  621. package/dist/sdk/lifecycle/release-handoff.js +1 -1
  622. package/dist/sdk/lifecycle/reopen.js +1 -1
  623. package/dist/sdk/lifecycle/repeatable-metadata-parsers.js +2 -2
  624. package/dist/sdk/lifecycle/repeated-terminal-state.js +1 -1
  625. package/dist/sdk/lifecycle/restore.js +1 -1
  626. package/dist/sdk/lifecycle/shared-unset-fields.js +1 -1
  627. package/dist/sdk/lifecycle/start-blockers.js +1 -1
  628. package/dist/sdk/lifecycle/structured-mutation-plan.js +1 -1
  629. package/dist/sdk/lifecycle/task-composition.js +1 -1
  630. package/dist/sdk/lifecycle/update-many.js +1 -1
  631. package/dist/sdk/lifecycle/update.js +2 -2
  632. package/dist/sdk/lifecycle/workflow-transition.js +1 -1
  633. package/dist/sdk/lifecycle-completion.js +1 -1
  634. package/dist/sdk/lifecycle-policy.js +1 -1
  635. package/dist/sdk/linked-artifacts.js +2 -2
  636. package/dist/sdk/mcp/apps.js +5 -5
  637. package/dist/sdk/mcp/authorization.js +1 -1
  638. package/dist/sdk/mcp/discovery.js +1 -1
  639. package/dist/sdk/mcp/executable.js +4 -4
  640. package/dist/sdk/mcp/interactions.js +1 -1
  641. package/dist/sdk/mcp/protocol.js +1 -1
  642. package/dist/sdk/mcp/skills.js +3 -3
  643. package/dist/sdk/mcp/subscriptions.js +1 -1
  644. package/dist/sdk/mcp/tasks.js +2 -2
  645. package/dist/sdk/mcp/transport.js +1 -1
  646. package/dist/sdk/merge/abandoned-receipts.js +1 -1
  647. package/dist/sdk/merge/driver.js +7 -7
  648. package/dist/sdk/merge/history-scalar-rebase.js +1 -1
  649. package/dist/sdk/merge/ignored-artifacts.js +1 -1
  650. package/dist/sdk/merge/index.js +1 -1
  651. package/dist/sdk/merge/indexed-receipt-blobs.js +2 -2
  652. package/dist/sdk/merge/install.js +6 -6
  653. package/dist/sdk/merge/receipt-file-boundary.js +1 -1
  654. package/dist/sdk/merge/receipt-operation.js +1 -1
  655. package/dist/sdk/merge/receipt-schema.js +1 -1
  656. package/dist/sdk/merge/receipts.js +4 -4
  657. package/dist/sdk/merge/reconcile.js +1 -1
  658. package/dist/sdk/merge/settlement-hook.js +4 -4
  659. package/dist/sdk/merge/stage.js +1 -1
  660. package/dist/sdk/merge/three-way.js +9 -9
  661. package/dist/sdk/merge/worktree-config.js +2 -2
  662. package/dist/sdk/merge.js +1 -1
  663. package/dist/sdk/mutation-events.js +1 -1
  664. package/dist/sdk/mutation-guard.js +1 -1
  665. package/dist/sdk/notes.js +1 -1
  666. package/dist/sdk/output/fit-envelope.js +1 -1
  667. package/dist/sdk/output/list-envelope.js +1 -1
  668. package/dist/sdk/output/table-rows.js +1 -1
  669. package/dist/sdk/output-contracts.js +1 -1
  670. package/dist/sdk/output-projection.js +1 -1
  671. package/dist/sdk/output-token-accounting.js +1 -1
  672. package/dist/sdk/output.js +2 -2
  673. package/dist/sdk/ownership-source.js +1 -1
  674. package/dist/sdk/package-import-adapters.js +1 -1
  675. package/dist/sdk/package-migrations.js +1 -1
  676. package/dist/sdk/package-runtime-options.js +1 -1
  677. package/dist/sdk/pagination.js +1 -1
  678. package/dist/sdk/profile.js +5 -5
  679. package/dist/sdk/provenance.js +1 -1
  680. package/dist/sdk/public-surface.json +1 -1
  681. package/dist/sdk/query/activity.js +1 -1
  682. package/dist/sdk/query/aggregate.js +1 -1
  683. package/dist/sdk/query/calendar.js +4 -4
  684. package/dist/sdk/query/complete-list.js +1 -1
  685. package/dist/sdk/query/context.js +2 -2
  686. package/dist/sdk/query/declared-blockers.js +1 -1
  687. package/dist/sdk/query/duplicate-candidates.js +1 -1
  688. package/dist/sdk/query/get-facet-roots.js +1 -1
  689. package/dist/sdk/query/get.js +1 -1
  690. package/dist/sdk/query/history.js +1 -1
  691. package/dist/sdk/query/item-filter-options.js +0 -1
  692. package/dist/sdk/query/light-metadata.js +1 -1
  693. package/dist/sdk/query/list-filter-shared.js +1 -1
  694. package/dist/sdk/query/list.js +1 -1
  695. package/dist/sdk/query/multi-value-filters.js +1 -1
  696. package/dist/sdk/query/next-ranking-policy.js +1 -1
  697. package/dist/sdk/query/next-ready-budget.js +1 -1
  698. package/dist/sdk/query/next.js +2 -2
  699. package/dist/sdk/query/parsers.js +1 -1
  700. package/dist/sdk/query/projection-contracts.js +1 -1
  701. package/dist/sdk/query/search/corpus.js +2 -2
  702. package/dist/sdk/query/search/filters.js +1 -1
  703. package/dist/sdk/query/search/input.js +1 -1
  704. package/dist/sdk/query/search/lexical.js +1 -1
  705. package/dist/sdk/query/search/response.js +1 -1
  706. package/dist/sdk/query/search/semantic.js +3 -3
  707. package/dist/sdk/query/search/types.js +0 -1
  708. package/dist/sdk/query/search-contracts.js +1 -1
  709. package/dist/sdk/query/search-pagination.js +1 -1
  710. package/dist/sdk/query/search-rendering.js +1 -1
  711. package/dist/sdk/query/search.js +1 -1
  712. package/dist/sdk/query/window-pagination.js +1 -1
  713. package/dist/sdk/query/workspace-contracts.js +1 -1
  714. package/dist/sdk/read-output/continuation.js +1 -1
  715. package/dist/sdk/read-output/extension.js +1 -1
  716. package/dist/sdk/read-output/options.js +1 -1
  717. package/dist/sdk/read-output/positional-rows.js +1 -1
  718. package/dist/sdk/read-output/provenance.js +1 -1
  719. package/dist/sdk/read-output/session-result.js +0 -1
  720. package/dist/sdk/read-output/surfaces.js +1 -1
  721. package/dist/sdk/read-output/tail-retention.js +1 -1
  722. package/dist/sdk/read-output-budget.js +1 -1
  723. package/dist/sdk/read-output-contracts.js +1 -1
  724. package/dist/sdk/read-output-rows.js +1 -1
  725. package/dist/sdk/read-output-session.js +1 -1
  726. package/dist/sdk/relationship-analytics.js +1 -1
  727. package/dist/sdk/relationship-context.js +1 -1
  728. package/dist/sdk/relationship-history.js +6 -6
  729. package/dist/sdk/relationship-kinds/contract.js +1 -1
  730. package/dist/sdk/relationships.js +1 -1
  731. package/dist/sdk/reproducibility/process.js +1 -1
  732. package/dist/sdk/runtime/actions.js +1 -1
  733. package/dist/sdk/runtime/context.js +1 -1
  734. package/dist/sdk/runtime/mutation-admission.js +1 -1
  735. package/dist/sdk/runtime/mutation-value-validation.js +1 -1
  736. package/dist/sdk/runtime/schema-preview.js +1 -1
  737. package/dist/sdk/runtime/schema.js +1 -1
  738. package/dist/sdk/runtime-action-aliases.js +1 -1
  739. package/dist/sdk/runtime-extended-actions.js +1 -1
  740. package/dist/sdk/runtime-input.d.ts +2 -0
  741. package/dist/sdk/runtime-input.js +1 -1
  742. package/dist/sdk/runtime-primitives.js +1 -1
  743. package/dist/sdk/runtime-public-contracts.js +0 -1
  744. package/dist/sdk/runtime-stats-options.js +1 -1
  745. package/dist/sdk/runtime.d.ts +5 -3
  746. package/dist/sdk/runtime.js +1 -1
  747. package/dist/sdk/scheduling-shortcuts.js +1 -1
  748. package/dist/sdk/schema/field-option-collisions.js +2 -0
  749. package/dist/sdk/schema-migration.js +4 -4
  750. package/dist/sdk/schema.js +7 -7
  751. package/dist/sdk/search-refresh-worker.js +1 -1
  752. package/dist/sdk/similarity-scoring.js +1 -1
  753. package/dist/sdk/similarity.js +1 -1
  754. package/dist/sdk/start-task-status.js +1 -1
  755. package/dist/sdk/stats.js +1 -1
  756. package/dist/sdk/structured-mutations.js +1 -1
  757. package/dist/sdk/telemetry-flush.js +1 -1
  758. package/dist/sdk/telemetry.js +4 -4
  759. package/dist/sdk/templates.js +3 -3
  760. package/dist/sdk/test/batch.js +2 -2
  761. package/dist/sdk/test/command-args.js +1 -1
  762. package/dist/sdk/test/command-resolution.js +2 -2
  763. package/dist/sdk/test/entry.js +2 -2
  764. package/dist/sdk/test/execution-receipts.js +2 -2
  765. package/dist/sdk/test/execution.js +5 -5
  766. package/dist/sdk/test/json-path.js +1 -1
  767. package/dist/sdk/test/linked-command-detection.js +1 -1
  768. package/dist/sdk/test/measurements.js +1 -1
  769. package/dist/sdk/test/parsers.js +1 -1
  770. package/dist/sdk/test/prerequisites.js +1 -1
  771. package/dist/sdk/test/receipt-index-snapshot.js +1 -1
  772. package/dist/sdk/test/run-phases.js +1 -1
  773. package/dist/sdk/test/runs.js +1 -1
  774. package/dist/sdk/test/trust.js +2 -2
  775. package/dist/sdk/test/update.js +1 -1
  776. package/dist/sdk/test/workspace-snapshot.js +1 -1
  777. package/dist/sdk/traceability/runtime-files-lookup.js +1 -1
  778. package/dist/sdk/traceability/source-traceability.js +2 -2
  779. package/dist/sdk/tracker-root-discovery.js +1 -1
  780. package/dist/sdk/transactions/item-finalization.js +1 -1
  781. package/dist/sdk/workspace-contracts-cache.js +1 -1
  782. package/dist/sdk/workspace-contracts.js +1 -1
  783. package/dist/sdk/workspace-memory.js +2 -2
  784. package/dist/sdk/workspace-snapshot.js +5 -5
  785. package/dist/sdk/workspace-transaction-gc.js +1 -1
  786. package/dist/sdk/workspace-transaction.js +2 -2
  787. package/dist/sdk/workspace.js +6 -6
  788. package/dist/types/index.js +1 -1
  789. package/dist/types.js +1 -1
  790. package/docs/COMMANDS.md +1 -1
  791. package/docs/EXTENSIONS.md +1 -1
  792. package/docs/SDK.md +74 -4
  793. package/marketplace.json +1 -1
  794. package/package.json +2 -1
  795. package/packages/pm-beads/package.json +1 -1
  796. package/packages/pm-calendar/package.json +1 -1
  797. package/packages/pm-command-kit/package.json +1 -1
  798. package/packages/pm-digital-twin/package.json +1 -1
  799. package/packages/pm-governance-audit/package.json +1 -1
  800. package/packages/pm-guide-shell/package.json +1 -1
  801. package/packages/pm-kanban/package.json +1 -1
  802. package/packages/pm-lifecycle-hooks/package.json +1 -1
  803. package/packages/pm-linked-test-adapters/package.json +1 -1
  804. package/packages/pm-search-advanced/package.json +1 -1
  805. package/packages/pm-templates/package.json +1 -1
  806. package/packages/pm-todos/package.json +1 -1
  807. package/packages/pm-vcs/package.json +1 -1
  808. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  809. package/plugins/pm-claude/package.json +1 -1
  810. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  811. package/plugins/pm-codex/package.json +1 -1
  812. package/plugins/pm-codex/plugin.json +1 -1
  813. package/runtime-dependencies.json +1 -1
  814. package/scripts/finalize-build.mjs +63 -24
  815. package/scripts/prepare-build-cache.mjs +28 -1
  816. package/dist/cli-bundle/chunks/chunk-3W47ZZ5T.js +0 -9
  817. package/dist/cli-bundle/chunks/chunk-4TB5D6HL.js +0 -125
  818. package/dist/cli-bundle/chunks/chunk-5ZMVLWE3.js +0 -2
  819. package/dist/cli-bundle/chunks/chunk-6BBDEIKC.js +0 -33
  820. package/dist/cli-bundle/chunks/chunk-AR4NP5HI.js +0 -3
  821. package/dist/cli-bundle/chunks/chunk-B4PPFOPY.js +0 -3
  822. package/dist/cli-bundle/chunks/chunk-CAR2L5NW.js +0 -8
  823. package/dist/cli-bundle/chunks/chunk-DEZPZOQ7.js +0 -2
  824. package/dist/cli-bundle/chunks/chunk-EIGUKEV6.js +0 -2
  825. package/dist/cli-bundle/chunks/chunk-GTPCAJMZ.js +0 -8
  826. package/dist/cli-bundle/chunks/chunk-GYP24M7W.js +0 -2
  827. package/dist/cli-bundle/chunks/chunk-HC2OPETM.js +0 -2
  828. package/dist/cli-bundle/chunks/chunk-HKUV74K3.js +0 -2
  829. package/dist/cli-bundle/chunks/chunk-HXHYDO2R.js +0 -115
  830. package/dist/cli-bundle/chunks/chunk-IB7UB5TE.js +0 -2
  831. package/dist/cli-bundle/chunks/chunk-J2LABXBL.js +0 -2
  832. package/dist/cli-bundle/chunks/chunk-J52BEBSS.js +0 -2
  833. package/dist/cli-bundle/chunks/chunk-KQIZ34SF.js +0 -3
  834. package/dist/cli-bundle/chunks/chunk-LQBWLNZJ.js +0 -3
  835. package/dist/cli-bundle/chunks/chunk-OJTMGDON.js +0 -31
  836. package/dist/cli-bundle/chunks/chunk-SPPHDVZE.js +0 -2
  837. package/dist/cli-bundle/chunks/chunk-TC6XLIYO.js +0 -2
  838. package/dist/cli-bundle/chunks/chunk-U7EL3AYA.js +0 -3
  839. package/dist/cli-bundle/chunks/chunk-VQFWW4EF.js +0 -6
  840. package/dist/cli-bundle/chunks/chunk-X6MIWTTT.js +0 -2
  841. package/dist/cli-bundle/chunks/chunk-XC5Q2ZV7.js +0 -2
  842. package/dist/cli-bundle/chunks/chunk-XFHPKXAE.js +0 -71
  843. package/dist/cli-bundle/chunks/chunk-YHVLVSEZ.js +0 -9
  844. package/dist/cli-bundle/chunks/chunk-YMUSRWV4.js +0 -9
  845. package/dist/cli-bundle/chunks/chunk-YR2KEBHP.js +0 -2
  846. package/dist/cli-bundle/chunks/context-budget-recovery-L2WP5S26.js +0 -2
  847. package/dist/cli-bundle/chunks/indexed-receipt-blobs-ITTXIN4K.js +0 -4
  848. package/dist/cli-bundle/chunks/item-transaction-QY3PUHEI.js +0 -2
  849. package/dist/cli-bundle/chunks/mutation-actor-FWLYWJ37.js +0 -2
  850. package/dist/cli-bundle/chunks/mutation-admission-7ZDCK3G2.js +0 -2
  851. package/dist/cli-bundle/chunks/register-mutation-57AJQWFV.js +0 -21
  852. package/dist/cli-bundle/chunks/register-operations-RKWST7CU.js +0 -2
  853. package/dist/cli-bundle/chunks/register-setup-CMI23PC5.js +0 -2
  854. package/dist/cli-bundle/chunks/settlement-hook-BXN5LEQD.js +0 -7
  855. package/dist/cli-bundle/chunks/stage-4KDVXC5Z.js +0 -2
  856. package/dist/cli-bundle/focused-chunks/chunk-2ZD7275J.js +0 -2
  857. package/dist/cli-bundle/focused-chunks/chunk-324AHXJO.js +0 -2
  858. package/dist/cli-bundle/focused-chunks/chunk-3IRCYJI5.js +0 -3
  859. package/dist/cli-bundle/focused-chunks/chunk-3V53UBHN.js +0 -9
  860. package/dist/cli-bundle/focused-chunks/chunk-3XSWH6QC.js +0 -91
  861. package/dist/cli-bundle/focused-chunks/chunk-4JZITIJB.js +0 -2
  862. package/dist/cli-bundle/focused-chunks/chunk-4KTFKSS3.js +0 -2
  863. package/dist/cli-bundle/focused-chunks/chunk-5C5TK3ET.js +0 -78
  864. package/dist/cli-bundle/focused-chunks/chunk-AKJYOZZP.js +0 -2
  865. package/dist/cli-bundle/focused-chunks/chunk-BRZV7BFV.js +0 -8
  866. package/dist/cli-bundle/focused-chunks/chunk-C3O6JJPO.js +0 -2
  867. package/dist/cli-bundle/focused-chunks/chunk-CR7CGEB2.js +0 -3
  868. package/dist/cli-bundle/focused-chunks/chunk-EGN2HFRU.js +0 -2
  869. package/dist/cli-bundle/focused-chunks/chunk-GHQVM6K6.js +0 -2
  870. package/dist/cli-bundle/focused-chunks/chunk-HDEKFSOK.js +0 -2
  871. package/dist/cli-bundle/focused-chunks/chunk-I5LGPUWH.js +0 -2
  872. package/dist/cli-bundle/focused-chunks/chunk-IWOXAUDU.js +0 -2
  873. package/dist/cli-bundle/focused-chunks/chunk-ML3JHCC6.js +0 -6
  874. package/dist/cli-bundle/focused-chunks/chunk-OPGOOP25.js +0 -2
  875. package/dist/cli-bundle/focused-chunks/chunk-RE7ZWT7D.js +0 -27
  876. package/dist/cli-bundle/focused-chunks/chunk-RKQNVYGF.js +0 -3
  877. package/dist/cli-bundle/focused-chunks/chunk-RQ252B6V.js +0 -8
  878. package/dist/cli-bundle/focused-chunks/chunk-SVOOGGAK.js +0 -2
  879. package/dist/cli-bundle/focused-chunks/chunk-URGHTTT3.js +0 -8
  880. package/dist/cli-bundle/focused-chunks/chunk-USPYKWQG.js +0 -13
  881. package/dist/cli-bundle/focused-chunks/chunk-UWS3FC4D.js +0 -102
  882. package/dist/cli-bundle/focused-chunks/chunk-UXQGFGAT.js +0 -44
  883. package/dist/cli-bundle/focused-chunks/chunk-WZWXGDYY.js +0 -26
  884. package/dist/cli-bundle/focused-chunks/chunk-YKSLZPLT.js +0 -2
  885. package/dist/cli-bundle/focused-chunks/chunk-ZWJTY4ID.js +0 -2
  886. package/dist/cli-bundle/focused-chunks/context-budget-recovery-5MKOCGY5.js +0 -2
  887. package/dist/cli-bundle/focused-chunks/indexed-receipt-blobs-AF4U3F3D.js +0 -4
  888. package/dist/cli-bundle/focused-chunks/item-transaction-GLACUTPL.js +0 -2
  889. package/dist/cli-bundle/focused-chunks/mutation-actor-TCYDPUGG.js +0 -2
  890. package/dist/cli-bundle/focused-chunks/mutation-admission-LY73EJWM.js +0 -2
  891. package/dist/cli-bundle/focused-chunks/settlement-hook-ARYCZQY4.js +0 -7
  892. package/dist/cli-bundle/focused-chunks/stage-DQ7RQQ52.js +0 -2
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="78651211-fe4b-564e-a872-23bf25265243")}catch{}})();import{CONTEXT_DEPTH_VALUES,GOVERNANCE_PRESET_VALUES,RUNTIME_FIELD_COMMAND_VALUES,RUNTIME_FIELD_TYPE_VALUES,RUNTIME_STATUS_ROLE_VALUES,RUNTIME_UNKNOWN_FIELD_POLICY_VALUES}from"../../types.js";const FAIL={ok:!1,path:[]};function failAt(segment,failure){return{ok:!1,path:[segment,...failure.path]}}const vString=input=>typeof input=="string"?{ok:!0,value:input}:FAIL,vBoolean=input=>typeof input=="boolean"?{ok:!0,value:input}:FAIL;function vNumber(options={}){return input=>typeof input!="number"||!Number.isFinite(input)||options.int&&(!Number.isInteger(input)||!Number.isSafeInteger(input))||options.positive&&input<=0||typeof options.min=="number"&&input<options.min||typeof options.max=="number"&&input>options.max?FAIL:{ok:!0,value:input}}function vLiteral(...allowed){return input=>typeof input=="string"&&allowed.includes(input)?{ok:!0,value:input}:FAIL}function vArray(item,maxLength){return input=>{if(!Array.isArray(input)||maxLength!==void 0&&input.length>maxLength)return FAIL;const value=[];for(const[index,element]of input.entries()){const result=item(element);if(!result.ok)return failAt(String(index),result);value.push(result.value)}return{ok:!0,value}}}function vBoundedNormalizedString(maxLength,pattern){return input=>typeof input=="string"&&input.length>0&&input.length<=maxLength&&input===input.trim()&&(pattern===void 0||pattern.test(input))?{ok:!0,value:input}:FAIL}function vOptional(inner){return input=>input===void 0?{ok:!0,value:void 0}:inner(input)}function vRecordOf(valueCheck){return input=>{if(typeof input!="object"||input===null||Array.isArray(input))return FAIL;const value={};for(const[key,raw]of Object.entries(input)){const result=valueCheck(raw);if(!result.ok)return failAt(key,result);value[key]=result.value}return{ok:!0,value}}}function vObject(shape){return input=>{if(typeof input!="object"||input===null||Array.isArray(input))return FAIL;const record=input,value={};for(const[key,check]of Object.entries(shape)){const result=check(record[key]);if(!result.ok)return failAt(key,result);result.value!==void 0&&(value[key]=result.value)}return{ok:!0,value}}}const itemTypeOption=vObject({key:vString,values:vArray(vString),required:vOptional(vBoolean),aliases:vOptional(vArray(vString)),description:vOptional(vString)}),itemTypeCommandOptionPolicy=vObject({command:vLiteral("create","update"),option:vString,required:vOptional(vBoolean),visible:vOptional(vBoolean),enabled:vOptional(vBoolean)}),itemTypeDefinition=vObject({name:vString,description:vOptional(vString),default_status:vOptional(vString),execution_role:vOptional(vLiteral("agent","human","gate")),folder:vOptional(vString),aliases:vOptional(vArray(vString)),required_create_fields:vOptional(vArray(vString)),required_create_repeatables:vOptional(vArray(vString)),options:vOptional(vArray(itemTypeOption)),command_option_policies:vOptional(vArray(itemTypeCommandOptionPolicy))}),runtimeStatusDefinition=vObject({id:vString,aliases:vOptional(vArray(vString)),roles:vOptional(vArray(vLiteral(...RUNTIME_STATUS_ROLE_VALUES))),description:vOptional(vString),order:vOptional(vNumber())}),runtimeFieldDefinition=vObject({key:vString,metadata_key:vOptional(vString),front_matter_key:vOptional(vString),cli_flag:vOptional(vString),cli_aliases:vOptional(vArray(vString)),description:vOptional(vString),type:vOptional(vLiteral(...RUNTIME_FIELD_TYPE_VALUES)),commands:vOptional(vArray(vLiteral(...RUNTIME_FIELD_COMMAND_VALUES))),repeatable:vOptional(vBoolean),required:vOptional(vBoolean),required_on_create:vOptional(vBoolean),required_types:vOptional(vArray(vString)),allow_unset:vOptional(vBoolean)}),statusTransitionPair=input=>{if(!Array.isArray(input)||input.length!==2)return FAIL;const[from,to]=input;return typeof from!="string"||typeof to!="string"?FAIL:{ok:!0,value:[from,to]}},typeWorkflowDefinition=vObject({type:vString,allowed_transitions:vArray(statusTransitionPair)}),runtimeSchemaSettings=vOptional(vObject({version:vOptional(vNumber({int:!0})),files:vOptional(vObject({types:vOptional(vString),statuses:vOptional(vString),fields:vOptional(vString),workflows:vOptional(vString)})),statuses:vOptional(vArray(runtimeStatusDefinition)),fields:vOptional(vArray(runtimeFieldDefinition)),workflow:vOptional(vObject({draft_status:vOptional(vString),open_status:vOptional(vString),in_progress_status:vOptional(vString),blocked_status:vOptional(vString),close_status:vOptional(vString),canceled_status:vOptional(vString)})),type_workflows:vOptional(vArray(typeWorkflowDefinition)),unknown_field_policy:vOptional(vLiteral(...RUNTIME_UNKNOWN_FIELD_POLICY_VALUES))})),governanceSettings=vOptional(vObject({preset:vOptional(vLiteral(...GOVERNANCE_PRESET_VALUES)),ownership_enforcement:vOptional(vLiteral("none","warn","strict")),create_mode_default:vOptional(vLiteral("progressive","strict")),close_validation_default:vOptional(vLiteral("off","warn","strict")),require_close_reason:vOptional(vBoolean),parent_reference:vOptional(vLiteral("warn","strict_error")),metadata_profile:vOptional(vLiteral("core","strict","custom")),force_required_for_stale_lock:vOptional(vBoolean),create_default_type:vOptional(vString),workflow_enforcement:vOptional(vLiteral("off","warn","strict")),start_blocker_enforcement:vOptional(vLiteral("off","warn","strict")),duplicate_detection_mode:vOptional(vLiteral("off","advisory","strict")),duplicate_detection_threshold:vOptional(vNumber({min:0,max:1})),duplicate_detection_limit:vOptional(vNumber({int:!0,min:0,max:20}))})),extensionPolicyOverride=vObject({name:vString,disabled:vOptional(vBoolean),require_trusted:vOptional(vBoolean),require_provenance:vOptional(vBoolean),sandbox_profile:vOptional(vLiteral("none","restricted","strict")),allowed_capabilities:vOptional(vArray(vString)),blocked_capabilities:vOptional(vArray(vString)),allowed_surfaces:vOptional(vArray(vString)),blocked_surfaces:vOptional(vArray(vString)),allowed_commands:vOptional(vArray(vString)),blocked_commands:vOptional(vArray(vString)),allowed_actions:vOptional(vArray(vString)),blocked_actions:vOptional(vArray(vString)),allowed_services:vOptional(vArray(vString)),blocked_services:vOptional(vArray(vString))}),pmMaxVersionExceededModeLiteral=vLiteral("block","warn"),pmMaxVersionExceededMode=input=>typeof input=="string"?pmMaxVersionExceededModeLiteral(input):vObject({global:vOptional(pmMaxVersionExceededModeLiteral),project:vOptional(pmMaxVersionExceededModeLiteral)})(input),extensionPolicy=vOptional(vObject({mode:vOptional(vLiteral("off","warn","enforce")),trust_mode:vOptional(vLiteral("off","warn","enforce")),pm_max_version_exceeded_mode:vOptional(pmMaxVersionExceededMode),require_provenance:vOptional(vBoolean),trusted_extensions:vOptional(vArray(vString)),default_sandbox_profile:vOptional(vLiteral("none","restricted","strict")),allowed_extensions:vOptional(vArray(vString)),blocked_extensions:vOptional(vArray(vString)),allowed_capabilities:vOptional(vArray(vString)),blocked_capabilities:vOptional(vArray(vString)),allowed_surfaces:vOptional(vArray(vString)),blocked_surfaces:vOptional(vArray(vString)),allowed_commands:vOptional(vArray(vString)),blocked_commands:vOptional(vArray(vString)),allowed_actions:vOptional(vArray(vString)),blocked_actions:vOptional(vArray(vString)),allowed_services:vOptional(vArray(vString)),blocked_services:vOptional(vArray(vString)),extension_overrides:vOptional(vArray(extensionPolicyOverride))})),harnessSignalLiteral=vBoundedNormalizedString(128),harnessSignalDescriptor=vObject({harness:vBoundedNormalizedString(128,/^[a-z0-9]+(?:-[a-z0-9]+)*$/u),environment_keys:vOptional(vArray(harnessSignalLiteral,64)),model_environment_keys:vOptional(vArray(harnessSignalLiteral,64)),session_environment_keys:vOptional(vArray(harnessSignalLiteral,64)),provenance_environment_keys:vOptional(vRecordOf(vArray(harnessSignalLiteral,64))),provenance_resolvers:vOptional(vRecordOf(vLiteral("ai_agent_version","claude_session_file"))),provenance_unavailable_dimensions:vOptional(vArray(harnessSignalLiteral,64)),argv_markers:vOptional(vArray(harnessSignalLiteral,64)),client_names:vOptional(vArray(harnessSignalLiteral,64))}),SETTINGS_SHAPE={version:vNumber({int:!0}),id_prefix:vString,ids:vOptional(vObject({token_length:vOptional(vNumber({int:!0,min:4,max:12}))})),author_default:vString,agent_identity:vOptional(vObject({probes_enabled:vOptional(vBoolean),identity_vocabulary:vOptional(vObject({version:vNumber({int:!0,positive:!0}),aliases:vRecordOf(vBoundedNormalizedString(128,/^[a-z0-9]+(?:-[a-z0-9]+)*$/u))})),harness_signals:vArray(harnessSignalDescriptor)})),mutation_guard:vOptional(vObject({require_attributed_author:vOptional(vBoolean),secret_guard:vOptional(vLiteral("off","advise","block")),stale_in_progress_hours:vOptional(vNumber({int:!0,positive:!0}))})),item_format:vOptional(vLiteral("toon","json_markdown")),locks:vObject({ttl_seconds:vNumber({int:!0}),wait_ms:vOptional(vNumber({int:!0,min:0}))}),checkpoints:vOptional(vObject({retention_days:vOptional(vNumber({int:!0,positive:!0}))})),output:vObject({default_format:vLiteral("toon","json")}),ux:vOptional(vObject({deprecation_hints:vOptional(vBoolean)})),history:vOptional(vObject({missing_stream:vLiteral("auto_create","strict_error"),compact_policy:vOptional(vObject({enabled:vOptional(vBoolean),max_entries:vOptional(vNumber({int:!0,positive:!0})),trigger:vOptional(vLiteral("health_warn","auto"))}))})),validation:vOptional(vObject({sprint_release_format:vLiteral("warn","strict_error"),parent_reference:vOptional(vLiteral("warn","strict_error")),metadata_profile:vOptional(vLiteral("core","strict","custom")),metadata_required_fields:vOptional(vArray(vString)),lifecycle_stale_blocker_reason_patterns:vOptional(vArray(vString)),lifecycle_closure_like_blocked_reason_patterns:vOptional(vArray(vString)),lifecycle_closure_like_resolution_patterns:vOptional(vArray(vString)),lifecycle_closure_like_actual_result_patterns:vOptional(vArray(vString)),estimate_defaults_by_type:vOptional(vRecordOf(vNumber({int:!0,positive:!0})))})),governance:governanceSettings,workflow:vOptional(vObject({definition_of_done:vArray(vString)})),testing:vOptional(vObject({record_results_to_items:vBoolean,allow_untrusted_linked_tests:vOptional(vBoolean)})),telemetry:vOptional(vObject({enabled:vBoolean,first_run_prompt_completed:vOptional(vBoolean),capture_level:vOptional(vLiteral("minimal","redacted","max")),endpoint:vOptional(vString),installation_id:vOptional(vString),retention_days:vOptional(vNumber({int:!0,positive:!0}))})),agent_guidance:vOptional(vObject({prompt_completed:vOptional(vBoolean),declined:vOptional(vBoolean),declined_at:vOptional(vString),template_version:vOptional(vNumber({int:!0,positive:!0})),last_checked_files:vOptional(vArray(vString))})),item_types:vOptional(vObject({definitions:vArray(itemTypeDefinition)})),schema:runtimeSchemaSettings,context:vOptional(vObject({default_depth:vOptional(vLiteral(...CONTEXT_DEPTH_VALUES)),activity_limit:vOptional(vNumber({int:!0,positive:!0})),stale_threshold_days:vOptional(vNumber({int:!0,positive:!0})),next_ranking_policy:vOptional(vLiteral("priority_floor","weighted")),sections:vOptional(vObject({hierarchy:vOptional(vBoolean),activity:vOptional(vBoolean),progress:vOptional(vBoolean),recently_created:vOptional(vBoolean),unparented:vOptional(vBoolean),blockers:vOptional(vBoolean),files:vOptional(vBoolean),workload:vOptional(vBoolean),staleness:vOptional(vBoolean),tests:vOptional(vBoolean)}))})),extensions:vObject({enabled:vArray(vString),disabled:vArray(vString),policy:extensionPolicy}),search:vObject({score_threshold:vNumber(),hybrid_semantic_weight:vOptional(vNumber()),max_results:vNumber({int:!0}),embedding_model:vString,embedding_corpus_max_characters:vOptional(vNumber()),embedding_batch_size:vNumber({int:!0}),embedding_timeout_ms:vOptional(vNumber({int:!0})),scanner_max_batch_retries:vNumber({int:!0}),provider:vOptional(vString),default_mode:vOptional(vLiteral("auto","keyword","semantic","hybrid")),corpus_fields:vOptional(vArray(vString)),mutation_refresh_policy:vOptional(vLiteral("cache_only","semantic_configured","semantic_auto")),query_expansion:vOptional(vObject({enabled:vOptional(vBoolean),provider:vOptional(vString)})),rerank:vOptional(vObject({enabled:vOptional(vBoolean),model:vOptional(vString),top_k:vOptional(vNumber({int:!0,positive:!0}))})),bm25:vOptional(vObject({k1:vOptional(vNumber()),b:vOptional(vNumber())}))}),providers:vObject({openai:vObject({base_url:vString,api_key:vString,model:vString}),ollama:vObject({base_url:vString,model:vString})}),vector_store:vObject({adapter:vOptional(vString),collection_name:vOptional(vString),qdrant:vObject({url:vString,api_key:vString}),lancedb:vObject({path:vString})})},settingsCheck=vObject(SETTINGS_SHAPE),CORE_SETTINGS_SECTION_KEYS=Object.freeze(Object.keys(SETTINGS_SHAPE));function validateSettings(raw){const result=settingsCheck(raw);return result.ok?{success:!0,data:result.value}:{success:!1,path:result.path.join(".")}}export{CORE_SETTINGS_SECTION_KEYS,validateSettings};
1
+ import{CONTEXT_DEPTH_VALUES as h,GOVERNANCE_PRESET_VALUES as w,RUNTIME_FIELD_COMMAND_VALUES as x,RUNTIME_FIELD_TYPE_VALUES as E,RUNTIME_STATUS_ROLE_VALUES as S,RUNTIME_UNKNOWN_FIELD_POLICY_VALUES as A}from"../../types.js";const c={ok:!1,path:[]};function v(i,n){return{ok:!1,path:[i,...n.path]}}const t=i=>typeof i=="string"?{ok:!0,value:i}:c,s=i=>typeof i=="boolean"?{ok:!0,value:i}:c;function l(i={}){return n=>typeof n!="number"||!Number.isFinite(n)||i.int&&(!Number.isInteger(n)||!Number.isSafeInteger(n))||i.positive&&n<=0||typeof i.min=="number"&&n<i.min||typeof i.max=="number"&&n>i.max?c:{ok:!0,value:n}}function a(...i){return n=>typeof n=="string"&&i.includes(n)?{ok:!0,value:n}:c}function r(i,n){return _=>{if(!Array.isArray(_)||n!==void 0&&_.length>n)return c;const d=[];for(const[f,m]of _.entries()){const u=i(m);if(!u.ok)return v(String(f),u);d.push(u.value)}return{ok:!0,value:d}}}function k(i,n){return _=>typeof _=="string"&&_.length>0&&_.length<=i&&_===_.trim()&&(n===void 0||n.test(_))?{ok:!0,value:_}:c}function e(i){return n=>n===void 0?{ok:!0,value:void 0}:i(n)}function y(i){return n=>{if(typeof n!="object"||n===null||Array.isArray(n))return c;const _={};for(const[d,f]of Object.entries(n)){const m=i(f);if(!m.ok)return v(d,m);_[d]=m.value}return{ok:!0,value:_}}}function o(i){return n=>{if(typeof n!="object"||n===null||Array.isArray(n))return c;const _=n,d={};for(const[f,m]of Object.entries(i)){const u=m(_[f]);if(!u.ok)return v(f,u);u.value!==void 0&&(d[f]=u.value)}return{ok:!0,value:d}}}const T=o({key:t,values:r(t),required:e(s),aliases:e(r(t)),description:e(t)}),N=o({command:a("create","update"),option:t,required:e(s),visible:e(s),enabled:e(s)}),O=o({name:t,description:e(t),default_status:e(t),execution_role:e(a("agent","human","gate")),folder:e(t),aliases:e(r(t)),required_create_fields:e(r(t)),required_create_repeatables:e(r(t)),options:e(r(T)),command_option_policies:e(r(N))}),q=o({id:t,aliases:e(r(t)),roles:e(r(a(...S))),description:e(t),order:e(l())}),I=o({key:t,metadata_key:e(t),front_matter_key:e(t),cli_flag:e(t),cli_aliases:e(r(t)),description:e(t),type:e(a(...E)),commands:e(r(a(...x))),repeatable:e(s),required:e(s),required_on_create:e(s),required_types:e(r(t)),allow_unset:e(s)}),L=i=>{if(!Array.isArray(i)||i.length!==2)return c;const[n,_]=i;return typeof n!="string"||typeof _!="string"?c:{ok:!0,value:[n,_]}},U=o({type:t,allowed_transitions:r(L)}),j=e(o({version:e(l({int:!0})),files:e(o({types:e(t),statuses:e(t),fields:e(t),workflows:e(t)})),statuses:e(r(q)),fields:e(r(I)),workflow:e(o({draft_status:e(t),open_status:e(t),in_progress_status:e(t),blocked_status:e(t),close_status:e(t),canceled_status:e(t)})),type_workflows:e(r(U)),unknown_field_policy:e(a(...A))})),D=e(o({preset:e(a(...w)),ownership_enforcement:e(a("none","warn","strict")),create_mode_default:e(a("progressive","strict")),close_validation_default:e(a("off","warn","strict")),require_close_reason:e(s),parent_reference:e(a("warn","strict_error")),metadata_profile:e(a("core","strict","custom")),force_required_for_stale_lock:e(s),create_default_type:e(t),workflow_enforcement:e(a("off","warn","strict")),start_blocker_enforcement:e(a("off","warn","strict")),duplicate_detection_mode:e(a("off","advisory","strict")),duplicate_detection_threshold:e(l({min:0,max:1})),duplicate_detection_limit:e(l({int:!0,min:0,max:20}))})),M=o({name:t,disabled:e(s),require_trusted:e(s),require_provenance:e(s),sandbox_profile:e(a("none","restricted","strict")),allowed_capabilities:e(r(t)),blocked_capabilities:e(r(t)),allowed_surfaces:e(r(t)),blocked_surfaces:e(r(t)),allowed_commands:e(r(t)),blocked_commands:e(r(t)),allowed_actions:e(r(t)),blocked_actions:e(r(t)),allowed_services:e(r(t)),blocked_services:e(r(t))}),b=a("block","warn"),P=i=>typeof i=="string"?b(i):o({global:e(b),project:e(b)})(i),R=e(o({mode:e(a("off","warn","enforce")),trust_mode:e(a("off","warn","enforce")),pm_max_version_exceeded_mode:e(P),require_provenance:e(s),trusted_extensions:e(r(t)),default_sandbox_profile:e(a("none","restricted","strict")),allowed_extensions:e(r(t)),blocked_extensions:e(r(t)),allowed_capabilities:e(r(t)),blocked_capabilities:e(r(t)),allowed_surfaces:e(r(t)),blocked_surfaces:e(r(t)),allowed_commands:e(r(t)),blocked_commands:e(r(t)),allowed_actions:e(r(t)),blocked_actions:e(r(t)),allowed_services:e(r(t)),blocked_services:e(r(t)),extension_overrides:e(r(M))})),p=k(128),V=o({harness:k(128,/^[a-z0-9]+(?:-[a-z0-9]+)*$/u),environment_keys:e(r(p,64)),model_environment_keys:e(r(p,64)),session_environment_keys:e(r(p,64)),provenance_environment_keys:e(y(r(p,64))),provenance_resolvers:e(y(a("ai_agent_version","claude_session_file"))),provenance_unavailable_dimensions:e(r(p,64)),argv_markers:e(r(p,64)),client_names:e(r(p,64))}),g={version:l({int:!0}),id_prefix:t,ids:e(o({token_length:e(l({int:!0,min:4,max:12}))})),author_default:t,agent_identity:e(o({probes_enabled:e(s),identity_vocabulary:e(o({version:l({int:!0,positive:!0}),aliases:y(k(128,/^[a-z0-9]+(?:-[a-z0-9]+)*$/u))})),harness_signals:r(V)})),mutation_guard:e(o({require_attributed_author:e(s),secret_guard:e(a("off","advise","block")),stale_in_progress_hours:e(l({int:!0,positive:!0}))})),item_format:e(a("toon","json_markdown")),locks:o({ttl_seconds:l({int:!0}),wait_ms:e(l({int:!0,min:0}))}),checkpoints:e(o({retention_days:e(l({int:!0,positive:!0}))})),output:o({default_format:a("toon","json")}),ux:e(o({deprecation_hints:e(s)})),history:e(o({missing_stream:a("auto_create","strict_error"),compact_policy:e(o({enabled:e(s),max_entries:e(l({int:!0,positive:!0})),trigger:e(a("health_warn","auto"))}))})),validation:e(o({sprint_release_format:a("warn","strict_error"),parent_reference:e(a("warn","strict_error")),metadata_profile:e(a("core","strict","custom")),metadata_required_fields:e(r(t)),lifecycle_stale_blocker_reason_patterns:e(r(t)),lifecycle_closure_like_blocked_reason_patterns:e(r(t)),lifecycle_closure_like_resolution_patterns:e(r(t)),lifecycle_closure_like_actual_result_patterns:e(r(t)),estimate_defaults_by_type:e(y(l({int:!0,positive:!0})))})),governance:D,workflow:e(o({definition_of_done:r(t)})),testing:e(o({record_results_to_items:s,allow_untrusted_linked_tests:e(s)})),telemetry:e(o({enabled:s,first_run_prompt_completed:e(s),capture_level:e(a("minimal","redacted","max")),endpoint:e(t),installation_id:e(t),retention_days:e(l({int:!0,positive:!0}))})),agent_guidance:e(o({prompt_completed:e(s),declined:e(s),declined_at:e(t),template_version:e(l({int:!0,positive:!0})),last_checked_files:e(r(t))})),item_types:e(o({definitions:r(O)})),schema:j,context:e(o({default_depth:e(a(...h)),activity_limit:e(l({int:!0,positive:!0})),stale_threshold_days:e(l({int:!0,positive:!0})),next_ranking_policy:e(a("priority_floor","weighted")),sections:e(o({hierarchy:e(s),activity:e(s),progress:e(s),recently_created:e(s),unparented:e(s),blockers:e(s),files:e(s),workload:e(s),staleness:e(s),tests:e(s)}))})),extensions:o({enabled:r(t),disabled:r(t),policy:R}),search:o({score_threshold:l(),hybrid_semantic_weight:e(l()),max_results:l({int:!0}),embedding_model:t,embedding_corpus_max_characters:e(l()),embedding_batch_size:l({int:!0}),embedding_timeout_ms:e(l({int:!0})),scanner_max_batch_retries:l({int:!0}),provider:e(t),default_mode:e(a("auto","keyword","semantic","hybrid")),corpus_fields:e(r(t)),mutation_refresh_policy:e(a("cache_only","semantic_configured","semantic_auto")),query_expansion:e(o({enabled:e(s),provider:e(t)})),rerank:e(o({enabled:e(s),model:e(t),top_k:e(l({int:!0,positive:!0}))})),bm25:e(o({k1:e(l()),b:e(l())}))}),providers:o({openai:o({base_url:t,api_key:t,model:t}),ollama:o({base_url:t,model:t})}),vector_store:o({adapter:e(t),collection_name:e(t),qdrant:o({url:t,api_key:t}),lancedb:o({path:t})})},C=o(g),F=Object.freeze(Object.keys(g));function G(i){const n=C(i);return n.ok?{success:!0,data:n.value}:{success:!1,path:n.path.join(".")}}export{F as CORE_SETTINGS_SECTION_KEYS,G as validateSettings};
2
2
  //# sourceMappingURL=settings-validator.js.map
@@ -5,7 +5,9 @@ import{type ParsedSettings}from "./settings-validator.js";import{collectSettings
5
5
  * optional-schema hydration, schema scaffolding or hydrated-cache access.
6
6
  * Nested source scopes compose; staged and unrelated trackers keep normal
7
7
  * settings behavior. Async context is restored when the callback returns or
8
- * throws, including concurrent invocations outside this scope.
8
+ * throws, including concurrent invocations outside this scope. The layer
9
+ * also expires when the callback settles, so a continuation that captured
10
+ * this async context and runs later is no longer bound by it.
9
11
  * The optional predicate is evaluated for each matching read. Disabling this
10
12
  * layer restores normal reads unless an enabled ancestor layer protects the
11
13
  * same root; hosts can settle conservative parser decisions without changing
@@ -1,7 +1,7 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="6e01cb2d-2ff0-54f2-abdb-2d16f36487c1")}catch{}})();import{AsyncLocalStorage}from"node:async_hooks";import{lstat,realpath}from"node:fs/promises";import path from"node:path";import{CORE_SETTINGS_SECTION_KEYS,validateSettings}from"./settings-validator.js";import{runActiveOnReadHooks,runActiveOnWriteHooks}from"../extensions/index.js";import{EXIT_CODE,GOVERNANCE_PRESET_DEFAULTS,SETTINGS_DEFAULTS}from"../shared/constants.js";import{PmCliError}from"../shared/errors.js";import{resolveAuthor}from"../shared/author.js";import{isFileAbsentError,readFileIfExists,readRegularFile,transactionPreviewNonRegularFileError}from"../fs/fs-utils.js";import{mutateWorkspaceJsonWithHistory}from"../history/workspace-history.js";import{reconcileSettingsSnapshot}from"./settings-concurrency.js";import{DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,filePathForSchemaSection,loadRuntimeSchemaFromOptionalFiles,normalizeRuntimeSchemaSettings}from"../schema/runtime-schema.js";import{getSettingsPath}from"./paths.js";import{orderObject,stableValueEquals}from"../shared/serialization.js";import{normalizeItemTypeDefinition}from"../item/item-type-definition.js";import{normalizeEstimateDefaultOverrides}from"../validate/estimate-defaults.js";import{clearSettingsReadCache,collectSettingsReadCacheSignatures,getSettingsReadCacheEntry,setSettingsReadCacheEntry,settingsReadCacheSignaturesEqual}from"./settings-read-cache.js";import{GOVERNANCE_START_BLOCKER_ENFORCEMENT_VALUES}from"../../types/index.js";const configurationOnlySettingsRoots=new AsyncLocalStorage;async function runWithConfigurationOnlySettings(pmRoot,run,isEnabled=()=>!0){const roots=new Set([path.resolve(pmRoot)]);try{roots.add(await realpath(pmRoot))}catch{}return configurationOnlySettingsRoots.run([...configurationOnlySettingsRoots.getStore()??[],[roots,isEnabled]],run)}function isConfigurationOnlySettingsRead(pmRoot){const root=path.resolve(pmRoot);return configurationOnlySettingsRoots.getStore()?.some(([roots,isEnabled])=>roots.has(root)&&isEnabled())??!1}const SETTINGS_WRITE_OP="settings:write",SETTINGS_PERSIST_SOURCE_SYMBOL=Symbol("pm.settings.persist_source"),SETTINGS_FALLBACK_ORIGIN_SYMBOL=Symbol("pm.settings.fallback_origin"),SETTINGS_FALLBACK_BASELINE_SYMBOL=Symbol("pm.settings.fallback_baseline"),MAX_VECTOR_STORE_COLLECTION_NAME_LENGTH=128,DUPLICATE_DETECTION_MODES=new Set(["off","advisory","strict"]);function resolveGovernanceKnobsFromPreset(preset){return structuredClone(GOVERNANCE_PRESET_DEFAULTS[preset])}function normalizeGovernancePreset(value){return value==="minimal"||value==="default"||value==="strict"||value==="custom"?value:SETTINGS_DEFAULTS.governance.preset}const START_BLOCKER_ENFORCEMENT_VALUES=new Set(GOVERNANCE_START_BLOCKER_ENFORCEMENT_VALUES);function isStartBlockerEnforcement(value){return START_BLOCKER_ENFORCEMENT_VALUES.has(value)}function withGovernanceExtras(base,governance){const createDefaultType=typeof governance.create_default_type=="string"?governance.create_default_type.trim():void 0;return createDefaultType&&createDefaultType.length>0&&(base.create_default_type=createDefaultType),(governance.workflow_enforcement==="off"||governance.workflow_enforcement==="warn"||governance.workflow_enforcement==="strict")&&(base.workflow_enforcement=governance.workflow_enforcement),isStartBlockerEnforcement(governance.start_blocker_enforcement)&&(base.start_blocker_enforcement=governance.start_blocker_enforcement),governance.require_close_reason===!1&&(base.require_close_reason=!1),base.duplicate_detection_mode=governance.duplicate_detection_mode,base.duplicate_detection_threshold=governance.duplicate_detection_threshold,base.duplicate_detection_limit=governance.duplicate_detection_limit,base}function normalizeGovernanceForPersist(governance){return governance.preset==="custom"?withGovernanceExtras({preset:"custom",ownership_enforcement:governance.ownership_enforcement,create_mode_default:governance.create_mode_default,close_validation_default:governance.close_validation_default,parent_reference:governance.parent_reference,metadata_profile:governance.metadata_profile,force_required_for_stale_lock:governance.force_required_for_stale_lock},governance):withGovernanceExtras({preset:governance.preset},governance)}function resolveGovernanceExtras(rawGovernance){const createDefaultType=typeof rawGovernance.create_default_type=="string"?rawGovernance.create_default_type.trim():void 0,extras={};createDefaultType&&createDefaultType.length>0&&(extras.create_default_type=createDefaultType),(rawGovernance.workflow_enforcement==="off"||rawGovernance.workflow_enforcement==="warn"||rawGovernance.workflow_enforcement==="strict")&&(extras.workflow_enforcement=rawGovernance.workflow_enforcement),isStartBlockerEnforcement(rawGovernance.start_blocker_enforcement)&&(extras.start_blocker_enforcement=rawGovernance.start_blocker_enforcement),typeof rawGovernance.require_close_reason=="boolean"&&(extras.require_close_reason=rawGovernance.require_close_reason),DUPLICATE_DETECTION_MODES.has(String(rawGovernance.duplicate_detection_mode))&&(extras.duplicate_detection_mode=rawGovernance.duplicate_detection_mode);const threshold=rawGovernance.duplicate_detection_threshold;[typeof threshold=="number",Number.isFinite(threshold),Number(threshold)>=0,Number(threshold)<=1].every(Boolean)&&(extras.duplicate_detection_threshold=threshold);const limit=rawGovernance.duplicate_detection_limit;return[typeof limit=="number",Number.isSafeInteger(limit),Number(limit)>=0,Number(limit)<=20].every(Boolean)&&(extras.duplicate_detection_limit=limit),extras}function resolveGovernanceKnobs(settings){const rawGovernance=settings.governance??{},preset=normalizeGovernancePreset(rawGovernance.preset),extras=resolveGovernanceExtras(rawGovernance);if(preset==="custom"){const baseline2=resolveGovernanceKnobsFromPreset("default"),requireCloseReason2=extras.require_close_reason??baseline2.require_close_reason;return{preset,ownership_enforcement:rawGovernance.ownership_enforcement??baseline2.ownership_enforcement,create_mode_default:rawGovernance.create_mode_default??baseline2.create_mode_default,close_validation_default:rawGovernance.close_validation_default??baseline2.close_validation_default,parent_reference:rawGovernance.parent_reference??baseline2.parent_reference,metadata_profile:rawGovernance.metadata_profile??baseline2.metadata_profile,force_required_for_stale_lock:rawGovernance.force_required_for_stale_lock??baseline2.force_required_for_stale_lock,...extras,require_close_reason:requireCloseReason2,duplicate_detection_mode:extras.duplicate_detection_mode??baseline2.duplicate_detection_mode,duplicate_detection_threshold:extras.duplicate_detection_threshold??baseline2.duplicate_detection_threshold,duplicate_detection_limit:extras.duplicate_detection_limit??baseline2.duplicate_detection_limit}}const baseline=resolveGovernanceKnobsFromPreset(preset),requireCloseReason=extras.require_close_reason??baseline.require_close_reason;return{preset,...baseline,...extras,require_close_reason:requireCloseReason}}function cloneDefaults(){return structuredClone(SETTINGS_DEFAULTS)}function normalizeSearchMutationRefreshPolicy(value){return value==="cache_only"||value==="semantic_configured"||value==="semantic_auto"?value:SETTINGS_DEFAULTS.search.mutation_refresh_policy}function normalizeSearchDefaultMode(value){return value==="auto"||value==="keyword"||value==="semantic"||value==="hybrid"?value:"auto"}function normalizeSearchQueryExpansionEnabled(value){return typeof value=="boolean"?value:SETTINGS_DEFAULTS.search.query_expansion.enabled}function normalizeSearchQueryExpansionProvider(value){return typeof value!="string"?SETTINGS_DEFAULTS.search.query_expansion.provider:value.trim()}function normalizeSearchRerankEnabled(value){return typeof value=="boolean"?value:SETTINGS_DEFAULTS.search.rerank.enabled}function normalizeSearchRerankModel(value){return typeof value!="string"?SETTINGS_DEFAULTS.search.rerank.model:value.trim()}function normalizeSearchRerankTopK(value){return typeof value=="number"&&Number.isFinite(value)&&Number.isInteger(value)&&value>0?value:SETTINGS_DEFAULTS.search.rerank.top_k}function normalizeVectorStoreCollectionName(value){if(typeof value!="string")return SETTINGS_DEFAULTS.vector_store.collection_name;const truncated=value.trim().replaceAll(/[^a-zA-Z0-9_-]/g,"_").slice(0,MAX_VECTOR_STORE_COLLECTION_NAME_LENGTH);return truncated.length>0?truncated:SETTINGS_DEFAULTS.vector_store.collection_name}function cloneOptionalArray(value){return{present:Array.isArray(value),values:Array.isArray(value)?structuredClone(value):[]}}function buildSettingsPersistSourceSnapshot(parsedSettings,runtimeSettings){const sourceSchema=parsedSettings.schema,sourceStatuses=cloneOptionalArray(sourceSchema?.statuses),sourceFields=cloneOptionalArray(sourceSchema?.fields),sourceTypeWorkflows=cloneOptionalArray(sourceSchema?.type_workflows);return{persisted_settings:structuredClone(parsedSettings),source_settings:structuredClone(parsedSettings),has_source_item_type_definitions:Array.isArray(parsedSettings.item_types?.definitions),source_item_type_definitions:normalizeItemTypeDefinitions(parsedSettings.item_types?.definitions),has_source_schema_statuses:sourceStatuses.present,source_schema_statuses:sourceStatuses.values,has_source_schema_fields:sourceFields.present,source_schema_fields:sourceFields.values,has_source_schema_type_workflows:sourceTypeWorkflows.present,source_schema_type_workflows:sourceTypeWorkflows.values,runtime_item_type_definitions:normalizeItemTypeDefinitions(runtimeSettings.item_types?.definitions),runtime_schema_statuses:structuredClone(runtimeSettings.schema.statuses),runtime_schema_fields:structuredClone(runtimeSettings.schema.fields),runtime_schema_type_workflows:structuredClone(runtimeSettings.schema.type_workflows??[])}}function attachSettingsPersistSourceSnapshot(settings,source){Object.defineProperty(settings,SETTINGS_PERSIST_SOURCE_SYMBOL,{value:source,writable:!0,configurable:!0,enumerable:!1})}function getSettingsPersistSourceSnapshot(settings){const candidate=settings[SETTINGS_PERSIST_SOURCE_SYMBOL];if(!(!candidate||typeof candidate!="object"))return candidate}function persistSelectedItemFormat(settings){const source=getSettingsPersistSourceSnapshot(settings);if(source){const detachedSource=structuredClone(source);detachedSource.source_settings.item_format=settings.item_format,attachSettingsPersistSourceSnapshot(settings,detachedSource)}}function cloneSettingsReadResult(result){const clonedSettings=structuredClone(result.settings),persistSource=getSettingsPersistSourceSnapshot(result.settings);persistSource&&attachSettingsPersistSourceSnapshot(clonedSettings,persistSource);const fallbackOrigin=getSettingsFallbackOrigin(result.settings);return fallbackOrigin!==void 0&&markSettingsFallbackOrigin(clonedSettings,fallbackOrigin),{settings:clonedSettings,metadata:{has_explicit_item_format:result.metadata.has_explicit_item_format},warnings:[...result.warnings]}}function resolveSettingsReadTrackedPaths(pmRoot,schema,settingsPath){const normalizedSchema=normalizeRuntimeSchemaSettings(schema);return[settingsPath,filePathForSchemaSection(pmRoot,normalizedSchema.files.types,DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types),filePathForSchemaSection(pmRoot,normalizedSchema.files.statuses,DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses),filePathForSchemaSection(pmRoot,normalizedSchema.files.fields,DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields),filePathForSchemaSection(pmRoot,normalizedSchema.files.workflows,DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.workflows)]}async function cacheSettingsReadResult(pmRoot,trackedPaths,result){const signatures=await collectSettingsReadCacheSignatures(trackedPaths);setSettingsReadCacheEntry(pmRoot,{tracked_paths:trackedPaths,signatures,value:cloneSettingsReadResult(result)})}async function cacheSettingsReadResultSafe(pmRoot,trackedPaths,result){try{await cacheSettingsReadResult(pmRoot,trackedPaths,result)}catch{clearSettingsReadCache(pmRoot)}}function findSettingsReadCacheSignature(signatures,targetPath){return signatures.find(signature=>signature.path===targetPath)}function selectedSettingsReadCacheSignaturesEqual(before,after,targetPaths){for(const targetPath of targetPaths){const beforeSignature=findSettingsReadCacheSignature(before,targetPath),afterSignature=findSettingsReadCacheSignature(after,targetPath);if(!beforeSignature||!afterSignature||!settingsReadCacheSignaturesEqual([beforeSignature],[afterSignature]))return!1}return!0}async function cacheSettingsReadResultIfStable(pmRoot,trackedPaths,result,stableSignatures,stablePaths){try{const currentSignatures=await collectSettingsReadCacheSignatures(trackedPaths);if(!selectedSettingsReadCacheSignaturesEqual(stableSignatures,currentSignatures,stablePaths)){clearSettingsReadCache(pmRoot);return}setSettingsReadCacheEntry(pmRoot,{tracked_paths:trackedPaths,signatures:currentSignatures,value:cloneSettingsReadResult(result)})}catch{clearSettingsReadCache(pmRoot)}}function resolvePersistedFileBackedSchemaSections(settings,source){const normalizedSchema=normalizeRuntimeSchemaSettings(settings.schema),currentItemTypeDefinitions=normalizeItemTypeDefinitions(settings.item_types?.definitions);if(!source)return{item_type_definitions:currentItemTypeDefinitions,schema_statuses:normalizedSchema.statuses,schema_fields:normalizedSchema.fields,schema_type_workflows:normalizedSchema.type_workflows};const currentTypeWorkflows=normalizedSchema.type_workflows??[],itemTypeDefinitionsUnchanged=stableValueEquals(currentItemTypeDefinitions,source.runtime_item_type_definitions),schemaStatusesUnchanged=stableValueEquals(normalizedSchema.statuses,source.runtime_schema_statuses),schemaFieldsUnchanged=stableValueEquals(normalizedSchema.fields,source.runtime_schema_fields),schemaTypeWorkflowsUnchanged=stableValueEquals(currentTypeWorkflows,source.runtime_schema_type_workflows);return{item_type_definitions:itemTypeDefinitionsUnchanged?source.has_source_item_type_definitions?normalizeItemTypeDefinitions(source.source_item_type_definitions):[]:currentItemTypeDefinitions,schema_statuses:schemaStatusesUnchanged?source.has_source_schema_statuses?structuredClone(source.source_schema_statuses):[]:normalizedSchema.statuses,schema_fields:schemaFieldsUnchanged?source.has_source_schema_fields?structuredClone(source.source_schema_fields):[]:normalizedSchema.fields,schema_type_workflows:schemaTypeWorkflowsUnchanged?source.has_source_schema_type_workflows?structuredClone(source.source_schema_type_workflows):void 0:normalizedSchema.type_workflows}}function markSettingsFallbackOrigin(settings,warning){Object.defineProperty(settings,SETTINGS_FALLBACK_ORIGIN_SYMBOL,{value:warning,writable:!0,configurable:!0,enumerable:!1})}function isSettingsReadFallback(settings){return getSettingsFallbackOrigin(settings)!==void 0}function getSettingsFallbackOrigin(settings){const candidate=settings[SETTINGS_FALLBACK_ORIGIN_SYMBOL];return typeof candidate=="string"?candidate:void 0}function getSettingsFallbackBaseline(settings){return settings[SETTINGS_FALLBACK_BASELINE_SYMBOL]}function setSettingsFallbackBaseline(settings,baseline){Object.defineProperty(settings,SETTINGS_FALLBACK_BASELINE_SYMBOL,{value:baseline,writable:!0,configurable:!0,enumerable:!1})}function buildFallbackSettingsReadResult(warning){const settings=cloneDefaults();return warning!==void 0&&markSettingsFallbackOrigin(settings,warning),{settings,metadata:{has_explicit_item_format:!1},warnings:warning?[warning]:[]}}function hasExplicitItemFormat(raw){if(typeof raw!="object"||raw===null||Array.isArray(raw))return!1;const itemFormat=raw.item_format;return itemFormat==="toon"||itemFormat==="json_markdown"}function normalizeStringList(values){return[...new Set((values??[]).map(value=>value.trim()).filter(value=>value.length>0))].sort((left,right)=>left.localeCompare(right))}function normalizeAgentGuidanceSettings(value){const defaults=SETTINGS_DEFAULTS.agent_guidance,templateVersion=value?.template_version;return{prompt_completed:value?.prompt_completed===!0,declined:value?.declined===!0,declined_at:typeof value?.declined_at=="string"?value.declined_at:defaults.declined_at,template_version:typeof templateVersion=="number"&&Number.isInteger(templateVersion)&&templateVersion>0?templateVersion:defaults.template_version,last_checked_files:normalizeStringList(value?.last_checked_files??defaults.last_checked_files)}}function normalizeLowerStringList(values){return[...new Set((values??[]).map(value=>value.trim().toLowerCase()).filter(value=>value.length>0))].sort((left,right)=>left.localeCompare(right))}function normalizeExtensionPolicyMode(value){return value==="off"||value==="warn"||value==="enforce"?value:SETTINGS_DEFAULTS.extensions.policy.mode}function normalizeExtensionTrustMode(value){return value==="off"||value==="warn"||value==="enforce"?value:SETTINGS_DEFAULTS.extensions.policy.trust_mode}function normalizeExtensionSandboxProfile(value){return value==="none"||value==="restricted"||value==="strict"?value:SETTINGS_DEFAULTS.extensions.policy.default_sandbox_profile}function normalizeExtensionPolicyOverride(override){const name=override.name.trim().toLowerCase();if(name.length===0)return null;const normalized={name};override.disabled===!0&&(normalized.disabled=!0),override.require_trusted===!0&&(normalized.require_trusted=!0),override.require_provenance===!0&&(normalized.require_provenance=!0),override.sandbox_profile!==void 0&&(normalized.sandbox_profile=normalizeExtensionSandboxProfile(override.sandbox_profile));const allowedCapabilities=normalizeLowerStringList(override.allowed_capabilities),blockedCapabilities=normalizeLowerStringList(override.blocked_capabilities),allowedSurfaces=normalizeLowerStringList(override.allowed_surfaces),blockedSurfaces=normalizeLowerStringList(override.blocked_surfaces),allowedCommands=normalizeLowerStringList(override.allowed_commands),blockedCommands=normalizeLowerStringList(override.blocked_commands),allowedActions=normalizeLowerStringList(override.allowed_actions),blockedActions=normalizeLowerStringList(override.blocked_actions),allowedServices=normalizeLowerStringList(override.allowed_services),blockedServices=normalizeLowerStringList(override.blocked_services);return allowedCapabilities.length>0&&(normalized.allowed_capabilities=allowedCapabilities),blockedCapabilities.length>0&&(normalized.blocked_capabilities=blockedCapabilities),allowedSurfaces.length>0&&(normalized.allowed_surfaces=allowedSurfaces),blockedSurfaces.length>0&&(normalized.blocked_surfaces=blockedSurfaces),allowedCommands.length>0&&(normalized.allowed_commands=allowedCommands),blockedCommands.length>0&&(normalized.blocked_commands=blockedCommands),allowedActions.length>0&&(normalized.allowed_actions=allowedActions),blockedActions.length>0&&(normalized.blocked_actions=blockedActions),allowedServices.length>0&&(normalized.allowed_services=allowedServices),blockedServices.length>0&&(normalized.blocked_services=blockedServices),normalized}function normalizeExtensionPolicyOverrides(overrides){const dedupedByName=new Map;for(const override of overrides??[]){const normalized=normalizeExtensionPolicyOverride(override);normalized&&dedupedByName.set(normalized.name,normalized)}return[...dedupedByName.values()].sort((left,right)=>left.name.localeCompare(right.name))}function normalizePmMaxVersionExceededModeValue(value){return value==="block"||value==="warn"?value:void 0}function normalizePmMaxVersionExceededModeSetting(value){if(typeof value=="string")return normalizePmMaxVersionExceededModeValue(value);if(typeof value=="object"&&value!==null&&!Array.isArray(value)){const global2=normalizePmMaxVersionExceededModeValue(value.global),project=normalizePmMaxVersionExceededModeValue(value.project);return global2===void 0&&project===void 0?void 0:{...global2!==void 0?{global:global2}:{},...project!==void 0?{project}:{}}}}function normalizeExtensionPolicyList(policy,key){return normalizeLowerStringList(policy?.[key]??SETTINGS_DEFAULTS.extensions.policy[key])}function normalizeExtensionPolicySettings(policy){const pmMaxVersionExceededMode=normalizePmMaxVersionExceededModeSetting(policy?.pm_max_version_exceeded_mode);return{mode:normalizeExtensionPolicyMode(policy?.mode),trust_mode:normalizeExtensionTrustMode(policy?.trust_mode),...pmMaxVersionExceededMode!==void 0?{pm_max_version_exceeded_mode:pmMaxVersionExceededMode}:{},require_provenance:policy?.require_provenance===!0,trusted_extensions:normalizeExtensionPolicyList(policy,"trusted_extensions"),default_sandbox_profile:normalizeExtensionSandboxProfile(policy?.default_sandbox_profile),allowed_extensions:normalizeExtensionPolicyList(policy,"allowed_extensions"),blocked_extensions:normalizeExtensionPolicyList(policy,"blocked_extensions"),allowed_capabilities:normalizeExtensionPolicyList(policy,"allowed_capabilities"),blocked_capabilities:normalizeExtensionPolicyList(policy,"blocked_capabilities"),allowed_surfaces:normalizeExtensionPolicyList(policy,"allowed_surfaces"),blocked_surfaces:normalizeExtensionPolicyList(policy,"blocked_surfaces"),allowed_commands:normalizeExtensionPolicyList(policy,"allowed_commands"),blocked_commands:normalizeExtensionPolicyList(policy,"blocked_commands"),allowed_actions:normalizeExtensionPolicyList(policy,"allowed_actions"),blocked_actions:normalizeExtensionPolicyList(policy,"blocked_actions"),allowed_services:normalizeExtensionPolicyList(policy,"allowed_services"),blocked_services:normalizeExtensionPolicyList(policy,"blocked_services"),extension_overrides:normalizeExtensionPolicyOverrides(policy?.extension_overrides??SETTINGS_DEFAULTS.extensions.policy.extension_overrides)}}function normalizeValidationMetadataRequiredFields(values){return[...new Set((values??[]).map(value=>value.trim().toLowerCase().replaceAll("-","_")))].filter(value=>value.length>0).sort((left,right)=>left.localeCompare(right)).filter(value=>["author","acceptance_criteria","estimated_minutes","close_reason","reviewer","risk","confidence","sprint","release"].includes(value))}function normalizeValidationPatternList(values){return[...new Set((values??[]).map(value=>value.trim().toLowerCase()).filter(value=>value.length>0))].sort((left,right)=>left.localeCompare(right))}function valueOrDefault(value,fallback){return value===void 0?fallback:value}function recordOrEmpty(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)?value:{}}function arrayOrEmpty(value){return Array.isArray(value)?value:[]}function buildValidationSettings(settings,defaults,governance){return{...defaults.validation,...settings.validation,parent_reference:governance.parent_reference,metadata_profile:governance.metadata_profile,metadata_required_fields:normalizeValidationMetadataRequiredFields(settings.validation?.metadata_required_fields),lifecycle_stale_blocker_reason_patterns:normalizeValidationPatternList(settings.validation?.lifecycle_stale_blocker_reason_patterns??defaults.validation.lifecycle_stale_blocker_reason_patterns),lifecycle_closure_like_blocked_reason_patterns:normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_blocked_reason_patterns??defaults.validation.lifecycle_closure_like_blocked_reason_patterns),lifecycle_closure_like_resolution_patterns:normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_resolution_patterns??defaults.validation.lifecycle_closure_like_resolution_patterns),lifecycle_closure_like_actual_result_patterns:normalizeValidationPatternList(settings.validation?.lifecycle_closure_like_actual_result_patterns??defaults.validation.lifecycle_closure_like_actual_result_patterns),estimate_defaults_by_type:normalizeEstimateDefaultOverrides(settings.validation?.estimate_defaults_by_type)}}function buildTelemetrySettings(settings,defaults){return{enabled:settings.telemetry?.enabled??defaults.telemetry.enabled,first_run_prompt_completed:settings.telemetry?.first_run_prompt_completed??defaults.telemetry.first_run_prompt_completed,capture_level:settings.telemetry?.capture_level??defaults.telemetry.capture_level,endpoint:settings.telemetry?.endpoint??defaults.telemetry.endpoint,installation_id:settings.telemetry?.installation_id??defaults.telemetry.installation_id,retention_days:settings.telemetry?.retention_days??defaults.telemetry.retention_days}}function buildSearchSettings(settings,defaults){return{...defaults.search,...settings.search,default_mode:normalizeSearchDefaultMode(settings.search?.default_mode),mutation_refresh_policy:normalizeSearchMutationRefreshPolicy(settings.search?.mutation_refresh_policy),query_expansion:{...defaults.search.query_expansion,...settings.search?.query_expansion,enabled:normalizeSearchQueryExpansionEnabled(settings.search?.query_expansion?.enabled),provider:normalizeSearchQueryExpansionProvider(settings.search?.query_expansion?.provider)},rerank:{...defaults.search.rerank,...settings.search?.rerank,enabled:normalizeSearchRerankEnabled(settings.search?.rerank?.enabled),model:normalizeSearchRerankModel(settings.search?.rerank?.model),top_k:normalizeSearchRerankTopK(settings.search?.rerank?.top_k)}}}function buildVectorStoreSettings(settings,defaults){return{adapter:settings.vector_store.adapter??defaults.vector_store.adapter,collection_name:normalizeVectorStoreCollectionName(settings.vector_store.collection_name),qdrant:{...defaults.vector_store.qdrant,...settings.vector_store.qdrant},lancedb:{...defaults.vector_store.lancedb,...settings.vector_store.lancedb}}}function normalizeSettingsItemFormat(settings,defaults){return settings.item_format==="json_markdown"?"toon":settings.item_format??defaults.item_format}function buildContextSettings(settings,defaults){return{default_depth:settings.context?.default_depth??defaults.context.default_depth,activity_limit:settings.context?.activity_limit??defaults.context.activity_limit,stale_threshold_days:settings.context?.stale_threshold_days??defaults.context.stale_threshold_days,next_ranking_policy:settings.context?.next_ranking_policy??defaults.context.next_ranking_policy,sections:{...defaults.context.sections,...settings.context?.sections}}}function buildProviderSettings(settings,defaults){return{openai:{...defaults.providers.openai,...settings.providers.openai},ollama:{...defaults.providers.ollama,...settings.providers.ollama}}}function normalizeItemTypeDefinitions(definitions){const normalized=(definitions??[]).map(definition=>normalizeItemTypeDefinition(definition)).filter(definition=>definition!==null),dedupedByName=new Map;for(const definition of normalized)dedupedByName.set(definition.name.toLowerCase(),definition);return[...dedupedByName.values()].sort((left,right)=>left.name.localeCompare(right.name))}function mergeSettings(settings){const defaults=cloneDefaults(),governance=resolveGovernanceKnobs({governance:settings.governance??{preset:"default"}});return{...defaults,...settings,item_format:normalizeSettingsItemFormat(settings,defaults),locks:{...defaults.locks,...settings.locks},ids:{...defaults.ids,...settings.ids},agent_identity:structuredClone(settings.agent_identity??defaults.agent_identity),mutation_guard:{...defaults.mutation_guard,...settings.mutation_guard},checkpoints:{...defaults.checkpoints,...settings.checkpoints},output:{...defaults.output,...settings.output},ux:{...defaults.ux,...settings.ux},history:{...defaults.history,...settings.history,compact_policy:{...defaults.history.compact_policy,...settings.history?.compact_policy}},validation:buildValidationSettings(settings,defaults,governance),governance,workflow:{definition_of_done:[...settings.workflow?.definition_of_done??defaults.workflow.definition_of_done]},testing:{record_results_to_items:settings.testing?.record_results_to_items??defaults.testing.record_results_to_items,allow_untrusted_linked_tests:settings.testing?.allow_untrusted_linked_tests??defaults.testing.allow_untrusted_linked_tests},telemetry:buildTelemetrySettings(settings,defaults),agent_guidance:normalizeAgentGuidanceSettings(settings.agent_guidance??defaults.agent_guidance),item_types:{definitions:normalizeItemTypeDefinitions(settings.item_types?.definitions)},schema:normalizeRuntimeSchemaSettings(settings.schema??defaults.schema),context:buildContextSettings(settings,defaults),extensions:{enabled:[...settings.extensions.enabled],disabled:[...settings.extensions.disabled],policy:normalizeExtensionPolicySettings(settings.extensions.policy??defaults.extensions.policy)},search:buildSearchSettings(settings,defaults),providers:buildProviderSettings(settings,defaults),vector_store:buildVectorStoreSettings(settings,defaults)}}function orderSerializedSettingsSections(ordered){ordered.agent_identity=orderObject(ordered.agent_identity,["probes_enabled","identity_vocabulary","harness_signals"]);const orderedAgentIdentity=ordered.agent_identity;Object.hasOwn(orderedAgentIdentity,"identity_vocabulary")&&(orderedAgentIdentity.identity_vocabulary=orderObject(recordOrEmpty(orderedAgentIdentity.identity_vocabulary),["version","aliases"])),ordered.agent_identity.harness_signals=arrayOrEmpty(ordered.agent_identity.harness_signals).map(entry=>orderObject(recordOrEmpty(entry),["harness","environment_keys","model_environment_keys","session_environment_keys","provenance_environment_keys","provenance_resolvers","provenance_unavailable_dimensions","argv_markers","client_names"])),ordered.locks=orderObject(ordered.locks,["ttl_seconds","wait_ms"]),ordered.ids=orderObject(ordered.ids,["token_length"]),ordered.mutation_guard=orderObject(ordered.mutation_guard,["require_attributed_author","secret_guard","stale_in_progress_hours"]),ordered.checkpoints=orderObject(ordered.checkpoints,["retention_days"]),ordered.output=orderObject(ordered.output,["default_format"]),ordered.ux=orderObject(ordered.ux,["deprecation_hints"]),ordered.history=orderObject(ordered.history,["missing_stream","compact_policy"]),ordered.validation=orderObject(ordered.validation,["sprint_release_format","parent_reference","metadata_profile","metadata_required_fields","lifecycle_stale_blocker_reason_patterns","lifecycle_closure_like_blocked_reason_patterns","lifecycle_closure_like_resolution_patterns","lifecycle_closure_like_actual_result_patterns","estimate_defaults_by_type"]),ordered.governance=orderObject(ordered.governance,["preset","ownership_enforcement","create_mode_default","close_validation_default","require_close_reason","parent_reference","metadata_profile","force_required_for_stale_lock","create_default_type","workflow_enforcement","duplicate_detection_mode","duplicate_detection_threshold","duplicate_detection_limit"]),ordered.workflow=orderObject(ordered.workflow,["definition_of_done"]),ordered.testing=orderObject(ordered.testing,["record_results_to_items","allow_untrusted_linked_tests"]),ordered.telemetry=orderObject(ordered.telemetry,["enabled","first_run_prompt_completed","capture_level","endpoint","installation_id","retention_days"]),ordered.agent_guidance=orderObject(ordered.agent_guidance,["prompt_completed","declined","declined_at","template_version","last_checked_files"]),ordered.item_types=orderObject(ordered.item_types,["definitions"]),ordered.schema=orderObject(ordered.schema,["version","files","statuses","fields","workflow","type_workflows","unknown_field_policy"]),ordered.schema.files=orderObject(recordOrEmpty(ordered.schema.files),["types","statuses","fields","workflows"]),ordered.schema.workflow=orderObject(recordOrEmpty(ordered.schema.workflow),["draft_status","open_status","in_progress_status","blocked_status","close_status","canceled_status"]),ordered.context=orderObject(ordered.context,["default_depth","activity_limit","stale_threshold_days","next_ranking_policy","sections"]),ordered.context.sections=orderObject(recordOrEmpty(ordered.context.sections),["hierarchy","activity","progress","blockers","files","workload","staleness","tests"]),ordered.extensions=orderObject(ordered.extensions,["enabled","disabled","policy"]),ordered.extensions.policy=orderObject(recordOrEmpty(ordered.extensions.policy),["mode","trust_mode","pm_max_version_exceeded_mode","require_provenance","trusted_extensions","default_sandbox_profile","allowed_extensions","blocked_extensions","allowed_capabilities","blocked_capabilities","allowed_surfaces","blocked_surfaces","allowed_commands","blocked_commands","allowed_actions","blocked_actions","allowed_services","blocked_services","extension_overrides"]),ordered.extensions.policy.extension_overrides=arrayOrEmpty(ordered.extensions.policy.extension_overrides).map(entry=>orderObject(recordOrEmpty(entry),["name","disabled","require_trusted","require_provenance","sandbox_profile","allowed_capabilities","blocked_capabilities","allowed_surfaces","blocked_surfaces","allowed_commands","blocked_commands","allowed_actions","blocked_actions","allowed_services","blocked_services"])),ordered.search=orderObject(ordered.search,["score_threshold","hybrid_semantic_weight","max_results","embedding_model","embedding_corpus_max_characters","embedding_batch_size","embedding_timeout_ms","scanner_max_batch_retries","provider","default_mode","mutation_refresh_policy","query_expansion","rerank"]),ordered.search.query_expansion=orderObject(recordOrEmpty(ordered.search.query_expansion),["enabled","provider"]),ordered.search.rerank=orderObject(recordOrEmpty(ordered.search.rerank),["enabled","model","top_k"]),ordered.providers=orderObject(ordered.providers,["openai","ollama"]),ordered.providers.openai=orderObject(recordOrEmpty(ordered.providers.openai),["base_url","api_key","model"]),ordered.providers.ollama=orderObject(recordOrEmpty(ordered.providers.ollama),["base_url","model"]),ordered.vector_store=orderObject(ordered.vector_store,["adapter","collection_name","qdrant","lancedb"]),ordered.vector_store.qdrant=orderObject(recordOrEmpty(ordered.vector_store.qdrant),["url","api_key"]),ordered.vector_store.lancedb=orderObject(recordOrEmpty(ordered.vector_store.lancedb),["path"])}function buildSerializeBaseSettings(settings){return{...settings,locks:valueOrDefault(settings.locks,SETTINGS_DEFAULTS.locks),ids:valueOrDefault(settings.ids,SETTINGS_DEFAULTS.ids),agent_identity:valueOrDefault(settings.agent_identity,SETTINGS_DEFAULTS.agent_identity),mutation_guard:valueOrDefault(settings.mutation_guard,SETTINGS_DEFAULTS.mutation_guard),checkpoints:valueOrDefault(settings.checkpoints,SETTINGS_DEFAULTS.checkpoints),output:valueOrDefault(settings.output,SETTINGS_DEFAULTS.output),ux:valueOrDefault(settings.ux,SETTINGS_DEFAULTS.ux),history:valueOrDefault(settings.history,SETTINGS_DEFAULTS.history),validation:valueOrDefault(settings.validation,SETTINGS_DEFAULTS.validation),workflow:valueOrDefault(settings.workflow,SETTINGS_DEFAULTS.workflow),testing:valueOrDefault(settings.testing,SETTINGS_DEFAULTS.testing),telemetry:valueOrDefault(settings.telemetry,SETTINGS_DEFAULTS.telemetry),agent_guidance:valueOrDefault(settings.agent_guidance,SETTINGS_DEFAULTS.agent_guidance),item_types:valueOrDefault(settings.item_types,SETTINGS_DEFAULTS.item_types),schema:valueOrDefault(settings.schema,SETTINGS_DEFAULTS.schema),context:valueOrDefault(settings.context,SETTINGS_DEFAULTS.context),extensions:valueOrDefault(settings.extensions,SETTINGS_DEFAULTS.extensions),search:valueOrDefault(settings.search,SETTINGS_DEFAULTS.search),providers:valueOrDefault(settings.providers,SETTINGS_DEFAULTS.providers),vector_store:valueOrDefault(settings.vector_store,SETTINGS_DEFAULTS.vector_store)}}function buildSerializedValidationSettings(baseSettings,governance){return{...baseSettings.validation,parent_reference:governance.parent_reference,metadata_profile:governance.metadata_profile,metadata_required_fields:normalizeValidationMetadataRequiredFields(baseSettings.validation?.metadata_required_fields),lifecycle_stale_blocker_reason_patterns:normalizeValidationPatternList(baseSettings.validation?.lifecycle_stale_blocker_reason_patterns??SETTINGS_DEFAULTS.validation.lifecycle_stale_blocker_reason_patterns),lifecycle_closure_like_blocked_reason_patterns:normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_blocked_reason_patterns??SETTINGS_DEFAULTS.validation.lifecycle_closure_like_blocked_reason_patterns),lifecycle_closure_like_resolution_patterns:normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_resolution_patterns??SETTINGS_DEFAULTS.validation.lifecycle_closure_like_resolution_patterns),lifecycle_closure_like_actual_result_patterns:normalizeValidationPatternList(baseSettings.validation?.lifecycle_closure_like_actual_result_patterns??SETTINGS_DEFAULTS.validation.lifecycle_closure_like_actual_result_patterns),estimate_defaults_by_type:normalizeEstimateDefaultOverrides(baseSettings.validation?.estimate_defaults_by_type)}}function buildSerializedSearchSettings(baseSettings){return{...SETTINGS_DEFAULTS.search,...baseSettings.search,default_mode:normalizeSearchDefaultMode(baseSettings.search?.default_mode),mutation_refresh_policy:normalizeSearchMutationRefreshPolicy(baseSettings.search?.mutation_refresh_policy),query_expansion:{...SETTINGS_DEFAULTS.search.query_expansion,...baseSettings.search?.query_expansion,enabled:normalizeSearchQueryExpansionEnabled(baseSettings.search?.query_expansion?.enabled),provider:normalizeSearchQueryExpansionProvider(baseSettings.search?.query_expansion?.provider)},rerank:{...SETTINGS_DEFAULTS.search.rerank,...baseSettings.search?.rerank,enabled:normalizeSearchRerankEnabled(baseSettings.search?.rerank?.enabled),model:normalizeSearchRerankModel(baseSettings.search?.rerank?.model),top_k:normalizeSearchRerankTopK(baseSettings.search?.rerank?.top_k)}}}function buildSerializedContextSettings(baseSettings){return{default_depth:baseSettings.context?.default_depth??SETTINGS_DEFAULTS.context.default_depth,activity_limit:baseSettings.context?.activity_limit??SETTINGS_DEFAULTS.context.activity_limit,stale_threshold_days:baseSettings.context?.stale_threshold_days??SETTINGS_DEFAULTS.context.stale_threshold_days,next_ranking_policy:baseSettings.context?.next_ranking_policy??SETTINGS_DEFAULTS.context.next_ranking_policy,sections:{...SETTINGS_DEFAULTS.context.sections,...baseSettings.context?.sections}}}function buildSerializedVectorStoreSettings(baseSettings){return{...baseSettings.vector_store,adapter:baseSettings.vector_store?.adapter??SETTINGS_DEFAULTS.vector_store.adapter,collection_name:normalizeVectorStoreCollectionName(baseSettings.vector_store?.collection_name),qdrant:{...baseSettings.vector_store?.qdrant},lancedb:{...baseSettings.vector_store?.lancedb}}}function buildNormalizedSettingsForSerialization(baseSettings,governance,normalizedSchema,persistedFileBackedSections){return{...baseSettings,item_format:"toon",validation:buildSerializedValidationSettings(baseSettings,governance),governance,agent_guidance:normalizeAgentGuidanceSettings(baseSettings.agent_guidance),item_types:{definitions:persistedFileBackedSections.item_type_definitions},schema:{...normalizedSchema,statuses:persistedFileBackedSections.schema_statuses,fields:persistedFileBackedSections.schema_fields,type_workflows:persistedFileBackedSections.schema_type_workflows},search:buildSerializedSearchSettings(baseSettings),context:buildSerializedContextSettings(baseSettings),extensions:{enabled:normalizeStringList(baseSettings.extensions?.enabled),disabled:normalizeStringList(baseSettings.extensions?.disabled),policy:normalizeExtensionPolicySettings(baseSettings.extensions?.policy)},vector_store:buildSerializedVectorStoreSettings(baseSettings)}}function overlayPresentSettingsSource(target,source){for(const key of Object.keys(source)){const value=Reflect.get(source,key),existing=target[key];typeof value=="object"&&value!==null&&!Array.isArray(value)&&typeof existing=="object"&&existing!==null&&!Array.isArray(existing)?overlayPresentSettingsSource(existing,value):target[key]=structuredClone(value)}}function applySettingsDelta(target,baseline,current){const keys=new Set([...Object.keys(baseline),...Object.keys(current)]);for(const key of keys){const before=baseline[key],after=current[key];if(!stableValueEquals(before,after)){if(after===void 0){delete target[key];continue}if(typeof before=="object"&&before!==null&&!Array.isArray(before)&&typeof after=="object"&&after!==null&&!Array.isArray(after)){const existing=target[key],nestedTarget=typeof existing=="object"&&existing!==null&&!Array.isArray(existing)?existing:{};applySettingsDelta(nestedTarget,before,after),Object.keys(nestedTarget).length>0?target[key]=nestedTarget:delete target[key];continue}target[key]=structuredClone(after)}}}const SETTINGS_TOP_LEVEL_KEY_ORDER=["version","id_prefix","ids","author_default","agent_identity","mutation_guard","item_format","locks","checkpoints","output","ux","history","validation","governance","workflow","testing","telemetry","agent_guidance","item_types","schema","context","extensions","search","providers","vector_store"];function buildOrderedSettingsForSerialization(settings,persistSource){const baseSettings=buildSerializeBaseSettings(settings),governance=resolveGovernanceKnobs(baseSettings),normalizedSchema=normalizeRuntimeSchemaSettings(baseSettings.schema),persistedFileBackedSections=resolvePersistedFileBackedSchemaSections(baseSettings,persistSource),normalizedSettings=buildNormalizedSettingsForSerialization(baseSettings,governance,normalizedSchema,persistedFileBackedSections),ordered=orderObject({...normalizedSettings,governance:normalizeGovernanceForPersist(governance)},SETTINGS_TOP_LEVEL_KEY_ORDER);return orderSerializedSettingsSections(ordered),ordered}function serializeSettings(settings,options={}){const persistSource=options.source===void 0?options.persist_source:buildSettingsPersistSourceSnapshot(options.source.validated,mergeSettings(options.source.validated)),ordered=buildOrderedSettingsForSerialization(settings,persistSource);if(persistSource){const baselineSettings=mergeSettings(persistSource.source_settings);baselineSettings.item_types={definitions:structuredClone(persistSource.runtime_item_type_definitions)},baselineSettings.schema={...baselineSettings.schema,statuses:structuredClone(persistSource.runtime_schema_statuses),fields:structuredClone(persistSource.runtime_schema_fields),type_workflows:structuredClone(persistSource.runtime_schema_type_workflows)};const baseline=buildOrderedSettingsForSerialization(baselineSettings,persistSource);options.source!==void 0&&overlayPresentSettingsSource(baseline,options.source.validated);const sparse=structuredClone(options.source===void 0?persistSource.source_settings:options.source.raw);return applySettingsDelta(sparse,baseline,ordered),`${JSON.stringify(orderObject(sparse,SETTINGS_TOP_LEVEL_KEY_ORDER),null,2)}
2
- `}return`${JSON.stringify(ordered,null,2)}
3
- `}async function readConfigurationOnlySettings(pmRoot){let root;try{root=await realpath(pmRoot)}catch(error){if(isFileAbsentError(error))return buildFallbackSettingsReadResult();throw error}const file=getSettingsPath(root);let entry;try{entry=await lstat(file)}catch(error){if(isFileAbsentError(error))return buildFallbackSettingsReadResult();throw error}if(!entry.isFile())throw transactionPreviewNonRegularFileError("settings.json");let raw;try{raw=await readRegularFile(file,transactionPreviewNonRegularFileError("settings.json"))}catch(error){if(isFileAbsentError(error))return buildFallbackSettingsReadResult();throw error}let parsed;try{parsed=JSON.parse(raw)}catch{return buildFallbackSettingsReadResult("settings_read_invalid_json")}const validated=validateSettings(parsed);return validated.success?{settings:mergeSettings(validated.data),metadata:{has_explicit_item_format:hasExplicitItemFormat(parsed)},warnings:validated.data.item_format==="json_markdown"?["settings_item_format_legacy_json_markdown_coerced_to_toon"]:[]}:buildFallbackSettingsReadResult("settings_read_invalid_schema")}async function readSettingsWithMetadata(pmRoot){if(isConfigurationOnlySettingsRead(pmRoot))return readConfigurationOnlySettings(pmRoot);const settingsPath=getSettingsPath(pmRoot);let trackedPathsForFailure=[settingsPath];await runActiveOnReadHooks({path:settingsPath,scope:"project"});const cachedResult=getSettingsReadCacheEntry(pmRoot);if(cachedResult){const currentSignatures=await collectSettingsReadCacheSignatures(cachedResult.tracked_paths);if(settingsReadCacheSignaturesEqual(currentSignatures,cachedResult.signatures))return cloneSettingsReadResult(cachedResult.value)}const settingsOnlySignatures=await collectSettingsReadCacheSignatures([settingsPath]);let raw;try{raw=await readFileIfExists(settingsPath)}catch{return buildFallbackSettingsReadResult("settings_read_fs_error")}if(raw===null){const fallback=buildFallbackSettingsReadResult();return await cacheSettingsReadResultIfStable(pmRoot,[settingsPath],fallback,settingsOnlySignatures,[settingsPath]),fallback}const settingsSignaturesAfterRead=await collectSettingsReadCacheSignatures([settingsPath]);if(!settingsReadCacheSignaturesEqual(settingsOnlySignatures,settingsSignaturesAfterRead))return clearSettingsReadCache(pmRoot),readSettingsWithMetadata(pmRoot);let parsed;try{parsed=JSON.parse(raw)}catch{const fallback=buildFallbackSettingsReadResult("settings_read_invalid_json");return await cacheSettingsReadResultIfStable(pmRoot,[settingsPath],fallback,settingsSignaturesAfterRead,[settingsPath]),fallback}const validated=validateSettings(parsed);if(!validated.success){const fallback=buildFallbackSettingsReadResult("settings_read_invalid_schema");return await cacheSettingsReadResultIfStable(pmRoot,[settingsPath],fallback,settingsSignaturesAfterRead,[settingsPath]),fallback}try{const mergedSettings=mergeSettings(validated.data),trackedPaths=resolveSettingsReadTrackedPaths(pmRoot,mergedSettings.schema,settingsPath);trackedPathsForFailure=trackedPaths;const signaturesBeforeSchemaLoad=await collectSettingsReadCacheSignatures(trackedPaths),loadedSchemaSections=await loadRuntimeSchemaFromOptionalFiles(pmRoot,mergedSettings.schema),signaturesAfterSchemaLoad=await collectSettingsReadCacheSignatures(trackedPaths),settings={...mergedSettings,item_types:{definitions:normalizeItemTypeDefinitions([...mergedSettings.item_types.definitions,...arrayOrEmpty(loadedSchemaSections.type_definitions_from_file)])},schema:loadedSchemaSections.schema};attachSettingsPersistSourceSnapshot(settings,buildSettingsPersistSourceSnapshot(validated.data,settings));const result={settings,metadata:{has_explicit_item_format:hasExplicitItemFormat(parsed)},warnings:[...validated.data.item_format==="json_markdown"?["settings_item_format_legacy_json_markdown_coerced_to_toon"]:[],...loadedSchemaSections.warnings]};return settingsReadCacheSignaturesEqual(signaturesBeforeSchemaLoad,signaturesAfterSchemaLoad)?setSettingsReadCacheEntry(pmRoot,{tracked_paths:trackedPaths,signatures:signaturesAfterSchemaLoad,value:cloneSettingsReadResult(result)}):clearSettingsReadCache(pmRoot),result}catch{const fallback=buildFallbackSettingsReadResult("settings_read_merge_failed");return await cacheSettingsReadResultSafe(pmRoot,trackedPathsForFailure,fallback),fallback}}function omitSettingsSections(raw,sections=[],current=null){const stored=asPlainRecord(current)??{},omitted=sections.filter(section=>!Object.hasOwn(stored,section));if(omitted.length===0)return raw;const parsed=JSON.parse(raw);for(const section of omitted)Reflect.deleteProperty(parsed,section);return`${JSON.stringify(parsed,null,2)}
4
- `}const ASSIGNED_SETTINGS_PATH_SEGMENT=/^[A-Za-z0-9_-]+$/u,RESERVED_SETTINGS_PATH_SEGMENTS=new Set(["__proto__","constructor","prototype"]);function asPlainRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)?value:void 0}function assertAssignedSettingsPaths(assignedPaths){for(const assignedPath of assignedPaths)if(assignedPath.split(".").find(segment=>!ASSIGNED_SETTINGS_PATH_SEGMENT.test(segment)||RESERVED_SETTINGS_PATH_SEGMENTS.has(segment))!==void 0)throw new PmCliError(`Settings write assignedPaths entry "${assignedPath}" is not a dotted settings path.`,EXIT_CODE.USAGE,{code:"settings_write_assigned_path_invalid",reason:"assigned_path_segment_invalid",field:assignedPath,why:"Assigned paths name settings keys; an empty, reserved or non-identifier segment cannot address one safely.",nextSteps:["Pass dotted settings keys such as context.next_ranking_policy in assignedPaths."]})}function ownRecordAt(record,segment){return asPlainRecord(Object.hasOwn(record,segment)?record[segment]:void 0)}function findAssignedSource(proposed,parents){let source=proposed;for(const segment of parents)if(source=ownRecordAt(source,segment),source===void 0)return;return source}function ensureAssignedParent(target,parents){let cursor=target;for(const segment of parents){let next=ownRecordAt(cursor,segment);next===void 0&&(next={},cursor[segment]=next),cursor=next}return cursor}function applyAssignedSettingsPaths(target,proposed,assignedPaths){for(const assignedPath of assignedPaths){const parents=assignedPath.split("."),leaf=parents.pop(),source=findAssignedSource(proposed,parents);if(source===void 0)continue;if(Object.hasOwn(source,leaf)){ensureAssignedParent(target,parents)[leaf]=structuredClone(source[leaf]);continue}if(!CORE_SETTINGS_SECTION_KEYS.includes(parents[0]??leaf))continue;const storedParent=findAssignedSource(target,parents);storedParent!==void 0&&delete storedParent[leaf]}}function applyFallbackChangeToStoredSettings(current,proposedCanonical,fallbackOrigin,assignedPaths,baseline){const baselineCanonical=baseline??JSON.parse(serializeSettings(cloneDefaults())),candidate=structuredClone(asPlainRecord(current)??{});applySettingsDelta(candidate,baselineCanonical,proposedCanonical),applyAssignedSettingsPaths(candidate,proposedCanonical,assignedPaths);const validated=validateSettings(candidate);if(!validated.success){const field=validated.path;throw new PmCliError(`Existing settings.json fails validation at ${field}; the settings write was refused and nothing was changed.`,EXIT_CODE.USAGE,{code:"settings_write_invalid_existing_schema",reason:"existing_settings_schema_invalid",field,original_code:fallbackOrigin,why:"The stored settings could not be read, so writing would either keep an invalid document or replace intended project configuration with defaults.",nextSteps:[`Fix or remove ${field} in settings.json, then retry the original command.`,"A configurable setting can also be repaired explicitly, even to its default value, with pm config <scope> set <dotted.key> <value>.","Run pm health to confirm the settings warning has cleared."]})}return`${JSON.stringify(orderObject(candidate,SETTINGS_TOP_LEVEL_KEY_ORDER),null,2)}
5
- `}function parseExistingSettingsForWrite(raw){try{return JSON.parse(raw)}catch{throw new PmCliError("Existing settings.json is malformed; the settings write was refused.",EXIT_CODE.USAGE,{code:"settings_write_invalid_existing_json",reason:"existing_settings_json_malformed",why:"Writing defaults over malformed settings could destroy intended project configuration.",nextSteps:["Repair the syntax in .agents/pm/settings.json, then retry the original command.","Run pm health to confirm the settings warning has cleared."]})}}async function readSettings(pmRoot){return(await readSettingsWithMetadata(pmRoot)).settings}async function writeSettings(pmRoot,settings,op=SETTINGS_WRITE_OP,options={}){const assignedPaths=options.assignedPaths??[];assertAssignedSettingsPaths(assignedPaths);const settingsPath=getSettingsPath(pmRoot),source=getSettingsPersistSourceSnapshot(settings),fallbackOrigin=source?void 0:getSettingsFallbackOrigin(settings),afterRaw=serializeSettings(settings,{persist_source:source}),proposed=JSON.parse(afterRaw);let skipped=!1;try{if(await mutateWorkspaceJsonWithHistory({pmRoot,filePath:settingsPath,mutate:beforeRaw=>{const current=beforeRaw===null?null:parseExistingSettingsForWrite(beforeRaw);return beforeRaw!==null&&options.skipIfStored?.(current)===!0?(skipped=!0,{raw:beforeRaw,result:void 0}):fallbackOrigin!==void 0&&beforeRaw!==null?{raw:applyFallbackChangeToStoredSettings(current,proposed,fallbackOrigin,assignedPaths,getSettingsFallbackBaseline(settings)),result:void 0}:{raw:source?`${JSON.stringify(orderObject(reconcileSettingsSnapshot(source.persisted_settings,proposed,current),SETTINGS_TOP_LEVEL_KEY_ORDER),null,2)}
6
- `:omitSettingsSections(afterRaw,options.omitSections,current),result:void 0}},op,author:resolveAuthor(void 0,settings.author_default),lockTtlSeconds:settings.locks.ttl_seconds,lockWaitMs:settings.locks.wait_ms,recordCreation:!1}),skipped)return;source?attachSettingsPersistSourceSnapshot(settings,{...source,persisted_settings:structuredClone(proposed)}):fallbackOrigin!==void 0&&setSettingsFallbackBaseline(settings,structuredClone(proposed)),await runActiveOnWriteHooks({path:settingsPath,scope:"project",op})}finally{clearSettingsReadCache(pmRoot)}}const settingsStoreTestOnly={applySettingsDelta,hasExplicitItemFormat,buildSettingsPersistSourceSnapshot,cacheSettingsReadResultIfStable,cacheSettingsReadResultSafe,mergeSettings,normalizeExtensionPolicySettings,normalizeExtensionPolicyOverride,normalizeExtensionPolicyOverrides,normalizeExtensionPolicyMode,normalizePmMaxVersionExceededModeSetting,normalizeExtensionSandboxProfile,normalizeExtensionTrustMode,normalizeLowerStringList,normalizeStringList,valueOrDefault,arrayOrEmpty,normalizeValidationPatternList,normalizeValidationMetadataRequiredFields,resolveSettingsReadTrackedPaths,resolvePersistedFileBackedSchemaSections,selectedSettingsReadCacheSignaturesEqual};export{isConfigurationOnlySettingsRead,isSettingsReadFallback,mergeSettings,normalizeItemTypeDefinitions,persistSelectedItemFormat,readSettings,readSettingsWithMetadata,resolveGovernanceKnobs,runWithConfigurationOnlySettings,serializeSettings,settingsStoreTestOnly,writeSettings};
1
+ import{AsyncLocalStorage as Ve}from"node:async_hooks";import{lstat as Be,realpath as ie}from"node:fs/promises";import oe from"node:path";import{CORE_SETTINGS_SECTION_KEYS as Ue,validateSettings as L}from"./settings-validator.js";import{runActiveOnReadHooks as Ge,runActiveOnWriteHooks as Je}from"../extensions/index.js";import{EXIT_CODE as M,GOVERNANCE_PRESET_DEFAULTS as We,SETTINGS_DEFAULTS as a}from"../shared/constants.js";import{PmCliError as D}from"../shared/errors.js";import{resolveAuthor as Ke}from"../shared/author.js";import{isFileAbsentError as V,readFileIfExists as $e,readRegularFile as He,transactionPreviewNonRegularFileError as se}from"../fs/fs-utils.js";import{mutateWorkspaceJsonWithHistory as Ye}from"../history/workspace-history.js";import{reconcileSettingsSnapshot as Qe}from"./settings-concurrency.js";import{DEFAULT_RUNTIME_SCHEMA_FILE_PATHS as C,filePathForSchemaSection as A,loadRuntimeSchemaFromOptionalFiles as Xe,normalizeRuntimeSchemaSettings as O}from"../schema/runtime-schema.js";import{getSettingsPath as B}from"./paths.js";import{orderObject as c,stableValueEquals as v}from"../shared/serialization.js";import{normalizeItemTypeDefinition as Ze}from"../item/item-type-definition.js";import{normalizeEstimateDefaultOverrides as ae}from"../validate/estimate-defaults.js";import{clearSettingsReadCache as S,collectSettingsReadCacheSignatures as g,getSettingsReadCacheEntry as et,setSettingsReadCacheEntry as U,settingsReadCacheSignaturesEqual as T}from"./settings-read-cache.js";import{GOVERNANCE_START_BLOCKER_ENFORCEMENT_VALUES as tt}from"../../types/index.js";const G=new Ve;async function en(e,t,n=()=>!0){const r=new Set([oe.resolve(e)]);try{r.add(await ie(e))}catch{}let i=!1;const s=[r,()=>!i&&n()];try{return await G.run([...G.getStore()??[],s],t)}finally{i=!0}}function nt(e){const t=oe.resolve(e);return G.getStore()?.some(([n,r])=>n.has(t)&&r())??!1}const rt="settings:write",ce=Symbol("pm.settings.persist_source"),le=Symbol("pm.settings.fallback_origin"),_e=Symbol("pm.settings.fallback_baseline"),it=128,ot=new Set(["off","advisory","strict"]);function de(e){return structuredClone(We[e])}function st(e){return e==="minimal"||e==="default"||e==="strict"||e==="custom"?e:a.governance.preset}const at=new Set(tt);function ue(e){return at.has(e)}function fe(e,t){const n=typeof t.create_default_type=="string"?t.create_default_type.trim():void 0;return n&&n.length>0&&(e.create_default_type=n),(t.workflow_enforcement==="off"||t.workflow_enforcement==="warn"||t.workflow_enforcement==="strict")&&(e.workflow_enforcement=t.workflow_enforcement),ue(t.start_blocker_enforcement)&&(e.start_blocker_enforcement=t.start_blocker_enforcement),t.require_close_reason===!1&&(e.require_close_reason=!1),e.duplicate_detection_mode=t.duplicate_detection_mode,e.duplicate_detection_threshold=t.duplicate_detection_threshold,e.duplicate_detection_limit=t.duplicate_detection_limit,e}function ct(e){return e.preset==="custom"?fe({preset:"custom",ownership_enforcement:e.ownership_enforcement,create_mode_default:e.create_mode_default,close_validation_default:e.close_validation_default,parent_reference:e.parent_reference,metadata_profile:e.metadata_profile,force_required_for_stale_lock:e.force_required_for_stale_lock},e):fe({preset:e.preset},e)}function lt(e){const t=typeof e.create_default_type=="string"?e.create_default_type.trim():void 0,n={};t&&t.length>0&&(n.create_default_type=t),(e.workflow_enforcement==="off"||e.workflow_enforcement==="warn"||e.workflow_enforcement==="strict")&&(n.workflow_enforcement=e.workflow_enforcement),ue(e.start_blocker_enforcement)&&(n.start_blocker_enforcement=e.start_blocker_enforcement),typeof e.require_close_reason=="boolean"&&(n.require_close_reason=e.require_close_reason),ot.has(String(e.duplicate_detection_mode))&&(n.duplicate_detection_mode=e.duplicate_detection_mode);const r=e.duplicate_detection_threshold;[typeof r=="number",Number.isFinite(r),Number(r)>=0,Number(r)<=1].every(Boolean)&&(n.duplicate_detection_threshold=r);const i=e.duplicate_detection_limit;return[typeof i=="number",Number.isSafeInteger(i),Number(i)>=0,Number(i)<=20].every(Boolean)&&(n.duplicate_detection_limit=i),n}function me(e){const t=e.governance??{},n=st(t.preset),r=lt(t);if(n==="custom"){const o=de("default"),l=r.require_close_reason??o.require_close_reason;return{preset:n,ownership_enforcement:t.ownership_enforcement??o.ownership_enforcement,create_mode_default:t.create_mode_default??o.create_mode_default,close_validation_default:t.close_validation_default??o.close_validation_default,parent_reference:t.parent_reference??o.parent_reference,metadata_profile:t.metadata_profile??o.metadata_profile,force_required_for_stale_lock:t.force_required_for_stale_lock??o.force_required_for_stale_lock,...r,require_close_reason:l,duplicate_detection_mode:r.duplicate_detection_mode??o.duplicate_detection_mode,duplicate_detection_threshold:r.duplicate_detection_threshold??o.duplicate_detection_threshold,duplicate_detection_limit:r.duplicate_detection_limit??o.duplicate_detection_limit}}const i=de(n),s=r.require_close_reason??i.require_close_reason;return{preset:n,...i,...r,require_close_reason:s}}function J(){return structuredClone(a)}function pe(e){return e==="cache_only"||e==="semantic_configured"||e==="semantic_auto"?e:a.search.mutation_refresh_policy}function he(e){return e==="auto"||e==="keyword"||e==="semantic"||e==="hybrid"?e:"auto"}function ye(e){return typeof e=="boolean"?e:a.search.query_expansion.enabled}function ke(e){return typeof e!="string"?a.search.query_expansion.provider:e.trim()}function we(e){return typeof e=="boolean"?e:a.search.rerank.enabled}function be(e){return typeof e!="string"?a.search.rerank.model:e.trim()}function ge(e){return typeof e=="number"&&Number.isFinite(e)&&Number.isInteger(e)&&e>0?e:a.search.rerank.top_k}function Se(e){if(typeof e!="string")return a.vector_store.collection_name;const n=e.trim().replaceAll(/[^a-zA-Z0-9_-]/g,"_").slice(0,it);return n.length>0?n:a.vector_store.collection_name}function W(e){return{present:Array.isArray(e),values:Array.isArray(e)?structuredClone(e):[]}}function K(e,t){const n=e.schema,r=W(n?.statuses),i=W(n?.fields),s=W(n?.type_workflows);return{persisted_settings:structuredClone(e),source_settings:structuredClone(e),has_source_item_type_definitions:Array.isArray(e.item_types?.definitions),source_item_type_definitions:x(e.item_types?.definitions),has_source_schema_statuses:r.present,source_schema_statuses:r.values,has_source_schema_fields:i.present,source_schema_fields:i.values,has_source_schema_type_workflows:s.present,source_schema_type_workflows:s.values,runtime_item_type_definitions:x(t.item_types?.definitions),runtime_schema_statuses:structuredClone(t.schema.statuses),runtime_schema_fields:structuredClone(t.schema.fields),runtime_schema_type_workflows:structuredClone(t.schema.type_workflows??[])}}function q(e,t){Object.defineProperty(e,ce,{value:t,writable:!0,configurable:!0,enumerable:!1})}function $(e){const t=e[ce];if(!(!t||typeof t!="object"))return t}function tn(e){const t=$(e);if(t){const n=structuredClone(t);n.source_settings.item_format=e.item_format,q(e,n)}}function z(e){const t=structuredClone(e.settings),n=$(e.settings);n&&q(t,n);const r=H(e.settings);return r!==void 0&&Oe(t,r),{settings:t,metadata:{has_explicit_item_format:e.metadata.has_explicit_item_format},warnings:[...e.warnings]}}function xe(e,t,n){const r=O(t);return[n,A(e,r.files.types,C.types),A(e,r.files.statuses,C.statuses),A(e,r.files.fields,C.fields),A(e,r.files.workflows,C.workflows)]}async function _t(e,t,n){const r=await g(t);U(e,{tracked_paths:t,signatures:r,value:z(n)})}async function ve(e,t,n){try{await _t(e,t,n)}catch{S(e)}}function Ee(e,t){return e.find(n=>n.path===t)}function Ce(e,t,n){for(const r of n){const i=Ee(e,r),s=Ee(t,r);if(!i||!s||!T([i],[s]))return!1}return!0}async function N(e,t,n,r,i){try{const s=await g(t);if(!Ce(r,s,i)){S(e);return}U(e,{tracked_paths:t,signatures:s,value:z(n)})}catch{S(e)}}function Ae(e,t){const n=O(e.schema),r=x(e.item_types?.definitions);if(!t)return{item_type_definitions:r,schema_statuses:n.statuses,schema_fields:n.fields,schema_type_workflows:n.type_workflows};const i=n.type_workflows??[],s=v(r,t.runtime_item_type_definitions),o=v(n.statuses,t.runtime_schema_statuses),l=v(n.fields,t.runtime_schema_fields),u=v(i,t.runtime_schema_type_workflows);return{item_type_definitions:s?t.has_source_item_type_definitions?x(t.source_item_type_definitions):[]:r,schema_statuses:o?t.has_source_schema_statuses?structuredClone(t.source_schema_statuses):[]:n.statuses,schema_fields:l?t.has_source_schema_fields?structuredClone(t.source_schema_fields):[]:n.fields,schema_type_workflows:u?t.has_source_schema_type_workflows?structuredClone(t.source_schema_type_workflows):void 0:n.type_workflows}}function Oe(e,t){Object.defineProperty(e,le,{value:t,writable:!0,configurable:!0,enumerable:!1})}function nn(e){return H(e)!==void 0}function H(e){const t=e[le];return typeof t=="string"?t:void 0}function dt(e){return e[_e]}function ut(e,t){Object.defineProperty(e,_e,{value:t,writable:!0,configurable:!0,enumerable:!1})}function w(e){const t=J();return e!==void 0&&Oe(t,e),{settings:t,metadata:{has_explicit_item_format:!1},warnings:e?[e]:[]}}function Y(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;const t=e.item_format;return t==="toon"||t==="json_markdown"}function P(e){return[...new Set((e??[]).map(t=>t.trim()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}function Te(e){const t=a.agent_guidance,n=e?.template_version;return{prompt_completed:e?.prompt_completed===!0,declined:e?.declined===!0,declined_at:typeof e?.declined_at=="string"?e.declined_at:t.declined_at,template_version:typeof n=="number"&&Number.isInteger(n)&&n>0?n:t.template_version,last_checked_files:P(e?.last_checked_files??t.last_checked_files)}}function p(e){return[...new Set((e??[]).map(t=>t.trim().toLowerCase()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}function qe(e){return e==="off"||e==="warn"||e==="enforce"?e:a.extensions.policy.mode}function ze(e){return e==="off"||e==="warn"||e==="enforce"?e:a.extensions.policy.trust_mode}function Q(e){return e==="none"||e==="restricted"||e==="strict"?e:a.extensions.policy.default_sandbox_profile}function Ne(e){const t=e.name.trim().toLowerCase();if(t.length===0)return null;const n={name:t};e.disabled===!0&&(n.disabled=!0),e.require_trusted===!0&&(n.require_trusted=!0),e.require_provenance===!0&&(n.require_provenance=!0),e.sandbox_profile!==void 0&&(n.sandbox_profile=Q(e.sandbox_profile));const r=p(e.allowed_capabilities),i=p(e.blocked_capabilities),s=p(e.allowed_surfaces),o=p(e.blocked_surfaces),l=p(e.allowed_commands),u=p(e.blocked_commands),_=p(e.allowed_actions),y=p(e.blocked_actions),k=p(e.allowed_services),h=p(e.blocked_services);return r.length>0&&(n.allowed_capabilities=r),i.length>0&&(n.blocked_capabilities=i),s.length>0&&(n.allowed_surfaces=s),o.length>0&&(n.blocked_surfaces=o),l.length>0&&(n.allowed_commands=l),u.length>0&&(n.blocked_commands=u),_.length>0&&(n.allowed_actions=_),y.length>0&&(n.blocked_actions=y),k.length>0&&(n.allowed_services=k),h.length>0&&(n.blocked_services=h),n}function Pe(e){const t=new Map;for(const n of e??[]){const r=Ne(n);r&&t.set(r.name,r)}return[...t.values()].sort((n,r)=>n.name.localeCompare(r.name))}function X(e){return e==="block"||e==="warn"?e:void 0}function je(e){if(typeof e=="string")return X(e);if(typeof e=="object"&&e!==null&&!Array.isArray(e)){const t=X(e.global),n=X(e.project);return t===void 0&&n===void 0?void 0:{...t!==void 0?{global:t}:{},...n!==void 0?{project:n}:{}}}}function f(e,t){return p(e?.[t]??a.extensions.policy[t])}function Z(e){const t=je(e?.pm_max_version_exceeded_mode);return{mode:qe(e?.mode),trust_mode:ze(e?.trust_mode),...t!==void 0?{pm_max_version_exceeded_mode:t}:{},require_provenance:e?.require_provenance===!0,trusted_extensions:f(e,"trusted_extensions"),default_sandbox_profile:Q(e?.default_sandbox_profile),allowed_extensions:f(e,"allowed_extensions"),blocked_extensions:f(e,"blocked_extensions"),allowed_capabilities:f(e,"allowed_capabilities"),blocked_capabilities:f(e,"blocked_capabilities"),allowed_surfaces:f(e,"allowed_surfaces"),blocked_surfaces:f(e,"blocked_surfaces"),allowed_commands:f(e,"allowed_commands"),blocked_commands:f(e,"blocked_commands"),allowed_actions:f(e,"allowed_actions"),blocked_actions:f(e,"blocked_actions"),allowed_services:f(e,"allowed_services"),blocked_services:f(e,"blocked_services"),extension_overrides:Pe(e?.extension_overrides??a.extensions.policy.extension_overrides)}}function ee(e){return[...new Set((e??[]).map(n=>n.trim().toLowerCase().replaceAll("-","_")))].filter(n=>n.length>0).sort((n,r)=>n.localeCompare(r)).filter(n=>["author","acceptance_criteria","estimated_minutes","close_reason","reviewer","risk","confidence","sprint","release"].includes(n))}function b(e){return[...new Set((e??[]).map(t=>t.trim().toLowerCase()).filter(t=>t.length>0))].sort((t,n)=>t.localeCompare(n))}function d(e,t){return e===void 0?t:e}function m(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{}}function j(e){return Array.isArray(e)?e:[]}function ft(e,t,n){return{...t.validation,...e.validation,parent_reference:n.parent_reference,metadata_profile:n.metadata_profile,metadata_required_fields:ee(e.validation?.metadata_required_fields),lifecycle_stale_blocker_reason_patterns:b(e.validation?.lifecycle_stale_blocker_reason_patterns??t.validation.lifecycle_stale_blocker_reason_patterns),lifecycle_closure_like_blocked_reason_patterns:b(e.validation?.lifecycle_closure_like_blocked_reason_patterns??t.validation.lifecycle_closure_like_blocked_reason_patterns),lifecycle_closure_like_resolution_patterns:b(e.validation?.lifecycle_closure_like_resolution_patterns??t.validation.lifecycle_closure_like_resolution_patterns),lifecycle_closure_like_actual_result_patterns:b(e.validation?.lifecycle_closure_like_actual_result_patterns??t.validation.lifecycle_closure_like_actual_result_patterns),estimate_defaults_by_type:ae(e.validation?.estimate_defaults_by_type)}}function mt(e,t){return{enabled:e.telemetry?.enabled??t.telemetry.enabled,first_run_prompt_completed:e.telemetry?.first_run_prompt_completed??t.telemetry.first_run_prompt_completed,capture_level:e.telemetry?.capture_level??t.telemetry.capture_level,endpoint:e.telemetry?.endpoint??t.telemetry.endpoint,installation_id:e.telemetry?.installation_id??t.telemetry.installation_id,retention_days:e.telemetry?.retention_days??t.telemetry.retention_days}}function pt(e,t){return{...t.search,...e.search,default_mode:he(e.search?.default_mode),mutation_refresh_policy:pe(e.search?.mutation_refresh_policy),query_expansion:{...t.search.query_expansion,...e.search?.query_expansion,enabled:ye(e.search?.query_expansion?.enabled),provider:ke(e.search?.query_expansion?.provider)},rerank:{...t.search.rerank,...e.search?.rerank,enabled:we(e.search?.rerank?.enabled),model:be(e.search?.rerank?.model),top_k:ge(e.search?.rerank?.top_k)}}}function ht(e,t){return{adapter:e.vector_store.adapter??t.vector_store.adapter,collection_name:Se(e.vector_store.collection_name),qdrant:{...t.vector_store.qdrant,...e.vector_store.qdrant},lancedb:{...t.vector_store.lancedb,...e.vector_store.lancedb}}}function yt(e,t){return e.item_format==="json_markdown"?"toon":e.item_format??t.item_format}function kt(e,t){return{default_depth:e.context?.default_depth??t.context.default_depth,activity_limit:e.context?.activity_limit??t.context.activity_limit,stale_threshold_days:e.context?.stale_threshold_days??t.context.stale_threshold_days,next_ranking_policy:e.context?.next_ranking_policy??t.context.next_ranking_policy,sections:{...t.context.sections,...e.context?.sections}}}function wt(e,t){return{openai:{...t.providers.openai,...e.providers.openai},ollama:{...t.providers.ollama,...e.providers.ollama}}}function x(e){const t=(e??[]).map(r=>Ze(r)).filter(r=>r!==null),n=new Map;for(const r of t)n.set(r.name.toLowerCase(),r);return[...n.values()].sort((r,i)=>r.name.localeCompare(i.name))}function E(e){const t=J(),n=me({governance:e.governance??{preset:"default"}});return{...t,...e,item_format:yt(e,t),locks:{...t.locks,...e.locks},ids:{...t.ids,...e.ids},agent_identity:structuredClone(e.agent_identity??t.agent_identity),mutation_guard:{...t.mutation_guard,...e.mutation_guard},checkpoints:{...t.checkpoints,...e.checkpoints},output:{...t.output,...e.output},ux:{...t.ux,...e.ux},history:{...t.history,...e.history,compact_policy:{...t.history.compact_policy,...e.history?.compact_policy}},validation:ft(e,t,n),governance:n,workflow:{definition_of_done:[...e.workflow?.definition_of_done??t.workflow.definition_of_done]},testing:{record_results_to_items:e.testing?.record_results_to_items??t.testing.record_results_to_items,allow_untrusted_linked_tests:e.testing?.allow_untrusted_linked_tests??t.testing.allow_untrusted_linked_tests},telemetry:mt(e,t),agent_guidance:Te(e.agent_guidance??t.agent_guidance),item_types:{definitions:x(e.item_types?.definitions)},schema:O(e.schema??t.schema),context:kt(e,t),extensions:{enabled:[...e.extensions.enabled],disabled:[...e.extensions.disabled],policy:Z(e.extensions.policy??t.extensions.policy)},search:pt(e,t),providers:wt(e,t),vector_store:ht(e,t)}}function bt(e){e.agent_identity=c(e.agent_identity,["probes_enabled","identity_vocabulary","harness_signals"]);const t=e.agent_identity;Object.hasOwn(t,"identity_vocabulary")&&(t.identity_vocabulary=c(m(t.identity_vocabulary),["version","aliases"])),e.agent_identity.harness_signals=j(e.agent_identity.harness_signals).map(n=>c(m(n),["harness","environment_keys","model_environment_keys","session_environment_keys","provenance_environment_keys","provenance_resolvers","provenance_unavailable_dimensions","argv_markers","client_names"])),e.locks=c(e.locks,["ttl_seconds","wait_ms"]),e.ids=c(e.ids,["token_length"]),e.mutation_guard=c(e.mutation_guard,["require_attributed_author","secret_guard","stale_in_progress_hours"]),e.checkpoints=c(e.checkpoints,["retention_days"]),e.output=c(e.output,["default_format"]),e.ux=c(e.ux,["deprecation_hints"]),e.history=c(e.history,["missing_stream","compact_policy"]),e.validation=c(e.validation,["sprint_release_format","parent_reference","metadata_profile","metadata_required_fields","lifecycle_stale_blocker_reason_patterns","lifecycle_closure_like_blocked_reason_patterns","lifecycle_closure_like_resolution_patterns","lifecycle_closure_like_actual_result_patterns","estimate_defaults_by_type"]),e.governance=c(e.governance,["preset","ownership_enforcement","create_mode_default","close_validation_default","require_close_reason","parent_reference","metadata_profile","force_required_for_stale_lock","create_default_type","workflow_enforcement","duplicate_detection_mode","duplicate_detection_threshold","duplicate_detection_limit"]),e.workflow=c(e.workflow,["definition_of_done"]),e.testing=c(e.testing,["record_results_to_items","allow_untrusted_linked_tests"]),e.telemetry=c(e.telemetry,["enabled","first_run_prompt_completed","capture_level","endpoint","installation_id","retention_days"]),e.agent_guidance=c(e.agent_guidance,["prompt_completed","declined","declined_at","template_version","last_checked_files"]),e.item_types=c(e.item_types,["definitions"]),e.schema=c(e.schema,["version","files","statuses","fields","workflow","type_workflows","unknown_field_policy"]),e.schema.files=c(m(e.schema.files),["types","statuses","fields","workflows"]),e.schema.workflow=c(m(e.schema.workflow),["draft_status","open_status","in_progress_status","blocked_status","close_status","canceled_status"]),e.context=c(e.context,["default_depth","activity_limit","stale_threshold_days","next_ranking_policy","sections"]),e.context.sections=c(m(e.context.sections),["hierarchy","activity","progress","blockers","files","workload","staleness","tests"]),e.extensions=c(e.extensions,["enabled","disabled","policy"]),e.extensions.policy=c(m(e.extensions.policy),["mode","trust_mode","pm_max_version_exceeded_mode","require_provenance","trusted_extensions","default_sandbox_profile","allowed_extensions","blocked_extensions","allowed_capabilities","blocked_capabilities","allowed_surfaces","blocked_surfaces","allowed_commands","blocked_commands","allowed_actions","blocked_actions","allowed_services","blocked_services","extension_overrides"]),e.extensions.policy.extension_overrides=j(e.extensions.policy.extension_overrides).map(n=>c(m(n),["name","disabled","require_trusted","require_provenance","sandbox_profile","allowed_capabilities","blocked_capabilities","allowed_surfaces","blocked_surfaces","allowed_commands","blocked_commands","allowed_actions","blocked_actions","allowed_services","blocked_services"])),e.search=c(e.search,["score_threshold","hybrid_semantic_weight","max_results","embedding_model","embedding_corpus_max_characters","embedding_batch_size","embedding_timeout_ms","scanner_max_batch_retries","provider","default_mode","mutation_refresh_policy","query_expansion","rerank"]),e.search.query_expansion=c(m(e.search.query_expansion),["enabled","provider"]),e.search.rerank=c(m(e.search.rerank),["enabled","model","top_k"]),e.providers=c(e.providers,["openai","ollama"]),e.providers.openai=c(m(e.providers.openai),["base_url","api_key","model"]),e.providers.ollama=c(m(e.providers.ollama),["base_url","model"]),e.vector_store=c(e.vector_store,["adapter","collection_name","qdrant","lancedb"]),e.vector_store.qdrant=c(m(e.vector_store.qdrant),["url","api_key"]),e.vector_store.lancedb=c(m(e.vector_store.lancedb),["path"])}function gt(e){return{...e,locks:d(e.locks,a.locks),ids:d(e.ids,a.ids),agent_identity:d(e.agent_identity,a.agent_identity),mutation_guard:d(e.mutation_guard,a.mutation_guard),checkpoints:d(e.checkpoints,a.checkpoints),output:d(e.output,a.output),ux:d(e.ux,a.ux),history:d(e.history,a.history),validation:d(e.validation,a.validation),workflow:d(e.workflow,a.workflow),testing:d(e.testing,a.testing),telemetry:d(e.telemetry,a.telemetry),agent_guidance:d(e.agent_guidance,a.agent_guidance),item_types:d(e.item_types,a.item_types),schema:d(e.schema,a.schema),context:d(e.context,a.context),extensions:d(e.extensions,a.extensions),search:d(e.search,a.search),providers:d(e.providers,a.providers),vector_store:d(e.vector_store,a.vector_store)}}function St(e,t){return{...e.validation,parent_reference:t.parent_reference,metadata_profile:t.metadata_profile,metadata_required_fields:ee(e.validation?.metadata_required_fields),lifecycle_stale_blocker_reason_patterns:b(e.validation?.lifecycle_stale_blocker_reason_patterns??a.validation.lifecycle_stale_blocker_reason_patterns),lifecycle_closure_like_blocked_reason_patterns:b(e.validation?.lifecycle_closure_like_blocked_reason_patterns??a.validation.lifecycle_closure_like_blocked_reason_patterns),lifecycle_closure_like_resolution_patterns:b(e.validation?.lifecycle_closure_like_resolution_patterns??a.validation.lifecycle_closure_like_resolution_patterns),lifecycle_closure_like_actual_result_patterns:b(e.validation?.lifecycle_closure_like_actual_result_patterns??a.validation.lifecycle_closure_like_actual_result_patterns),estimate_defaults_by_type:ae(e.validation?.estimate_defaults_by_type)}}function xt(e){return{...a.search,...e.search,default_mode:he(e.search?.default_mode),mutation_refresh_policy:pe(e.search?.mutation_refresh_policy),query_expansion:{...a.search.query_expansion,...e.search?.query_expansion,enabled:ye(e.search?.query_expansion?.enabled),provider:ke(e.search?.query_expansion?.provider)},rerank:{...a.search.rerank,...e.search?.rerank,enabled:we(e.search?.rerank?.enabled),model:be(e.search?.rerank?.model),top_k:ge(e.search?.rerank?.top_k)}}}function vt(e){return{default_depth:e.context?.default_depth??a.context.default_depth,activity_limit:e.context?.activity_limit??a.context.activity_limit,stale_threshold_days:e.context?.stale_threshold_days??a.context.stale_threshold_days,next_ranking_policy:e.context?.next_ranking_policy??a.context.next_ranking_policy,sections:{...a.context.sections,...e.context?.sections}}}function Et(e){return{...e.vector_store,adapter:e.vector_store?.adapter??a.vector_store.adapter,collection_name:Se(e.vector_store?.collection_name),qdrant:{...e.vector_store?.qdrant},lancedb:{...e.vector_store?.lancedb}}}function Ct(e,t,n,r){return{...e,item_format:"toon",validation:St(e,t),governance:t,agent_guidance:Te(e.agent_guidance),item_types:{definitions:r.item_type_definitions},schema:{...n,statuses:r.schema_statuses,fields:r.schema_fields,type_workflows:r.schema_type_workflows},search:xt(e),context:vt(e),extensions:{enabled:P(e.extensions?.enabled),disabled:P(e.extensions?.disabled),policy:Z(e.extensions?.policy)},vector_store:Et(e)}}function Fe(e,t){for(const n of Object.keys(t)){const r=Reflect.get(t,n),i=e[n];typeof r=="object"&&r!==null&&!Array.isArray(r)&&typeof i=="object"&&i!==null&&!Array.isArray(i)?Fe(i,r):e[n]=structuredClone(r)}}function F(e,t,n){const r=new Set([...Object.keys(t),...Object.keys(n)]);for(const i of r){const s=t[i],o=n[i];if(!v(s,o)){if(o===void 0){delete e[i];continue}if(typeof s=="object"&&s!==null&&!Array.isArray(s)&&typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=e[i],u=typeof l=="object"&&l!==null&&!Array.isArray(l)?l:{};F(u,s,o),Object.keys(u).length>0?e[i]=u:delete e[i];continue}e[i]=structuredClone(o)}}}const R=["version","id_prefix","ids","author_default","agent_identity","mutation_guard","item_format","locks","checkpoints","output","ux","history","validation","governance","workflow","testing","telemetry","agent_guidance","item_types","schema","context","extensions","search","providers","vector_store"];function Re(e,t){const n=gt(e),r=me(n),i=O(n.schema),s=Ae(n,t),o=Ct(n,r,i,s),l=c({...o,governance:ct(r)},R);return bt(l),l}function Ie(e,t={}){const n=t.source===void 0?t.persist_source:K(t.source.validated,E(t.source.validated)),r=Re(e,n);if(n){const i=E(n.source_settings);i.item_types={definitions:structuredClone(n.runtime_item_type_definitions)},i.schema={...i.schema,statuses:structuredClone(n.runtime_schema_statuses),fields:structuredClone(n.runtime_schema_fields),type_workflows:structuredClone(n.runtime_schema_type_workflows)};const s=Re(i,n);t.source!==void 0&&Fe(s,t.source.validated);const o=structuredClone(t.source===void 0?n.source_settings:t.source.raw);return F(o,s,r),`${JSON.stringify(c(o,R),null,2)}
2
+ `}return`${JSON.stringify(r,null,2)}
3
+ `}async function At(e){let t;try{t=await ie(e)}catch(l){if(V(l))return w();throw l}const n=B(t);let r;try{r=await Be(n)}catch(l){if(V(l))return w();throw l}if(!r.isFile())throw se("settings.json");let i;try{i=await He(n,se("settings.json"))}catch(l){if(V(l))return w();throw l}let s;try{s=JSON.parse(i)}catch{return w("settings_read_invalid_json")}const o=L(s);return o.success?{settings:E(o.data),metadata:{has_explicit_item_format:Y(s)},warnings:o.data.item_format==="json_markdown"?["settings_item_format_legacy_json_markdown_coerced_to_toon"]:[]}:w("settings_read_invalid_schema")}async function Le(e){if(nt(e))return At(e);const t=B(e);let n=[t];await Ge({path:t,scope:"project"});const r=et(e);if(r){const _=await g(r.tracked_paths);if(T(_,r.signatures))return z(r.value)}const i=await g([t]);let s;try{s=await $e(t)}catch{return w("settings_read_fs_error")}if(s===null){const _=w();return await N(e,[t],_,i,[t]),_}const o=await g([t]);if(!T(i,o))return S(e),Le(e);let l;try{l=JSON.parse(s)}catch{const _=w("settings_read_invalid_json");return await N(e,[t],_,o,[t]),_}const u=L(l);if(!u.success){const _=w("settings_read_invalid_schema");return await N(e,[t],_,o,[t]),_}try{const _=E(u.data),y=xe(e,_.schema,t);n=y;const k=await g(y),h=await Xe(e,_.schema),ne=await g(y),I={..._,item_types:{definitions:x([..._.item_types.definitions,...j(h.type_definitions_from_file)])},schema:h.schema};q(I,K(u.data,I));const re={settings:I,metadata:{has_explicit_item_format:Y(l)},warnings:[...u.data.item_format==="json_markdown"?["settings_item_format_legacy_json_markdown_coerced_to_toon"]:[],...h.warnings]};return T(k,ne)?U(e,{tracked_paths:y,signatures:ne,value:z(re)}):S(e),re}catch{const _=w("settings_read_merge_failed");return await ve(e,n,_),_}}function Ot(e,t=[],n=null){const r=te(n)??{},i=t.filter(o=>!Object.hasOwn(r,o));if(i.length===0)return e;const s=JSON.parse(e);for(const o of i)Reflect.deleteProperty(s,o);return`${JSON.stringify(s,null,2)}
4
+ `}const Tt=/^[A-Za-z0-9_-]+$/u,qt=new Set(["__proto__","constructor","prototype"]);function te(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)?e:void 0}function zt(e){for(const t of e)if(t.split(".").find(i=>!Tt.test(i)||qt.has(i))!==void 0)throw new D(`Settings write assignedPaths entry "${t}" is not a dotted settings path.`,M.USAGE,{code:"settings_write_assigned_path_invalid",reason:"assigned_path_segment_invalid",field:t,why:"Assigned paths name settings keys; an empty, reserved or non-identifier segment cannot address one safely.",nextSteps:["Pass dotted settings keys such as context.next_ranking_policy in assignedPaths."]})}function Me(e,t){return te(Object.hasOwn(e,t)?e[t]:void 0)}function De(e,t){let n=e;for(const r of t)if(n=Me(n,r),n===void 0)return;return n}function Nt(e,t){let n=e;for(const r of t){let i=Me(n,r);i===void 0&&(i={},n[r]=i),n=i}return n}function Pt(e,t,n){for(const r of n){const i=r.split("."),s=i.pop(),o=De(t,i);if(o===void 0)continue;if(Object.hasOwn(o,s)){Nt(e,i)[s]=structuredClone(o[s]);continue}if(!Ue.includes(i[0]??s))continue;const l=De(e,i);l!==void 0&&delete l[s]}}function jt(e,t,n,r,i){const s=i??JSON.parse(Ie(J())),o=structuredClone(te(e)??{});F(o,s,t),Pt(o,t,r);const l=L(o);if(!l.success){const u=l.path;throw new D(`Existing settings.json fails validation at ${u}; the settings write was refused and nothing was changed.`,M.USAGE,{code:"settings_write_invalid_existing_schema",reason:"existing_settings_schema_invalid",field:u,original_code:n,why:"The stored settings could not be read, so writing would either keep an invalid document or replace intended project configuration with defaults.",nextSteps:[`Fix or remove ${u} in settings.json, then retry the original command.`,"A configurable setting can also be repaired explicitly, even to its default value, with pm config <scope> set <dotted.key> <value>.","Run pm health to confirm the settings warning has cleared."]})}return`${JSON.stringify(c(o,R),null,2)}
5
+ `}function Ft(e){try{return JSON.parse(e)}catch{throw new D("Existing settings.json is malformed; the settings write was refused.",M.USAGE,{code:"settings_write_invalid_existing_json",reason:"existing_settings_json_malformed",why:"Writing defaults over malformed settings could destroy intended project configuration.",nextSteps:["Repair the syntax in .agents/pm/settings.json, then retry the original command.","Run pm health to confirm the settings warning has cleared."]})}}async function rn(e){return(await Le(e)).settings}async function on(e,t,n=rt,r={}){const i=r.assignedPaths??[];zt(i);const s=B(e),o=$(t),l=o?void 0:H(t),u=Ie(t,{persist_source:o}),_=JSON.parse(u);let y=!1;try{if(await Ye({pmRoot:e,filePath:s,mutate:k=>{const h=k===null?null:Ft(k);return k!==null&&r.skipIfStored?.(h)===!0?(y=!0,{raw:k,result:void 0}):l!==void 0&&k!==null?{raw:jt(h,_,l,i,dt(t)),result:void 0}:{raw:o?`${JSON.stringify(c(Qe(o.persisted_settings,_,h),R),null,2)}
6
+ `:Ot(u,r.omitSections,h),result:void 0}},op:n,author:Ke(void 0,t.author_default),lockTtlSeconds:t.locks.ttl_seconds,lockWaitMs:t.locks.wait_ms,recordCreation:!1}),y)return;o?q(t,{...o,persisted_settings:structuredClone(_)}):l!==void 0&&ut(t,structuredClone(_)),await Je({path:s,scope:"project",op:n})}finally{S(e)}}const sn={applySettingsDelta:F,hasExplicitItemFormat:Y,buildSettingsPersistSourceSnapshot:K,cacheSettingsReadResultIfStable:N,cacheSettingsReadResultSafe:ve,mergeSettings:E,normalizeExtensionPolicySettings:Z,normalizeExtensionPolicyOverride:Ne,normalizeExtensionPolicyOverrides:Pe,normalizeExtensionPolicyMode:qe,normalizePmMaxVersionExceededModeSetting:je,normalizeExtensionSandboxProfile:Q,normalizeExtensionTrustMode:ze,normalizeLowerStringList:p,normalizeStringList:P,valueOrDefault:d,arrayOrEmpty:j,normalizeValidationPatternList:b,normalizeValidationMetadataRequiredFields:ee,resolveSettingsReadTrackedPaths:xe,resolvePersistedFileBackedSchemaSections:Ae,selectedSettingsReadCacheSignaturesEqual:Ce};export{nt as isConfigurationOnlySettingsRead,nn as isSettingsReadFallback,E as mergeSettings,x as normalizeItemTypeDefinitions,tn as persistSelectedItemFormat,rn as readSettings,Le as readSettingsWithMetadata,me as resolveGovernanceKnobs,en as runWithConfigurationOnlySettings,Ie as serializeSettings,sn as settingsStoreTestOnly,on as writeSettings};
7
7
  //# sourceMappingURL=settings.js.map
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="812b558d-59f3-58d6-b04e-6a4f8689e866")}catch{}})();function loadDatabaseSync(loadModule){const emitWarning=process.emitWarning;process.emitWarning=(warning,...args)=>{warning==="SQLite is an experimental feature and might change at any time"&&args[0]==="ExperimentalWarning"||Reflect.apply(emitWarning,process,[warning,...args])};try{return loadModule(["node","sqlite"].join(":")).DatabaseSync??null}catch{return null}finally{process.emitWarning=emitWarning}}function loadStableDatabaseSync(nodeVersion,loadModule){const nodeMajor=Number.parseInt(nodeVersion,10);return Number.isFinite(nodeMajor)&&nodeMajor>=22?loadDatabaseSync(loadModule):null}export{loadDatabaseSync,loadStableDatabaseSync};
1
+ function r(t){const n=process.emitWarning;process.emitWarning=(e,...a)=>{e==="SQLite is an experimental feature and might change at any time"&&a[0]==="ExperimentalWarning"||Reflect.apply(n,process,[e,...a])};try{return t(["node","sqlite"].join(":")).DatabaseSync??null}catch{return null}finally{process.emitWarning=n}}function i(t,n){const e=Number.parseInt(t,10);return Number.isFinite(e)&&e>=22?r(n):null}export{r as loadDatabaseSync,i as loadStableDatabaseSync};
2
2
  //# sourceMappingURL=sqlite-runtime.js.map
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="658ab1c3-da92-5af6-a170-85ed7befaad6")}catch{}})();import fs from"node:fs/promises";import path from"node:path";import{renderPmCommand}from"../shared/command-line.js";import{EXIT_CODE}from"../shared/constants.js";import{PmCliError}from"../shared/errors.js";import{pathExists}from"../fs/fs-utils.js";import{getSettingsPath}from"./paths.js";function isErrno(error,code){return typeof error=="object"&&error!==null&&"code"in error&&error.code===code}function buildTrackerInitializationRecovery(pmRoot){const suggestedRetryArguments=["--pm-path",pmRoot,"init","--defaults","--agent-guidance","skip"];return{suggested_retry:renderPmCommand(suggestedRetryArguments),suggested_retry_args:suggestedRetryArguments}}function trackerRootNotDirectoryError(pmRoot){return new PmCliError(`Tracker root is not a directory at ${pmRoot}.`,EXIT_CODE.USAGE,{code:"tracker_root_not_directory",reason:"not_a_directory",resolved_path:pmRoot,nextSteps:["Pass a tracker directory, usually <workspace>/.agents/pm, rather than a file path."]})}function trackerRootUnreadableError(pmRoot){return new PmCliError(`Tracker root is not readable at ${pmRoot}.`,EXIT_CODE.GENERIC_FAILURE,{code:"tracker_root_unreadable",reason:"unreadable",resolved_path:pmRoot,nextSteps:["Grant read and directory-search permission to the tracker root, then retry."]})}async function assertMissingRootAncestors(pmRoot){const resolvedRoot=path.resolve(pmRoot),filesystemRoot=path.parse(resolvedRoot).root;let ancestor=path.dirname(resolvedRoot);for(;ancestor!==filesystemRoot;){let ancestorStats;try{ancestorStats=await fs.stat(ancestor)}catch(error){if(isErrno(error,"ENOTDIR"))throw trackerRootNotDirectoryError(pmRoot);if(!isErrno(error,"ENOENT"))throw error;ancestor=path.dirname(ancestor);continue}if(!ancestorStats.isDirectory())throw trackerRootNotDirectoryError(pmRoot);return}}async function assertReadableTrackerRoot(pmRoot){let stats;try{stats=await fs.stat(pmRoot)}catch(error){throw isErrno(error,"ENOENT")?(await assertMissingRootAncestors(pmRoot),new PmCliError(`Tracker is not initialized at ${pmRoot}. Tracker root does not exist. Run pm init first.`,EXIT_CODE.NOT_FOUND,{code:"tracker_root_missing",reason:"missing",resolved_path:pmRoot,nextSteps:["Confirm the tracker root path or initialize it with the emitted retry."],recovery:buildTrackerInitializationRecovery(pmRoot)})):isErrno(error,"ENOTDIR")?trackerRootNotDirectoryError(pmRoot):isErrno(error,"EACCES")||isErrno(error,"EPERM")?trackerRootUnreadableError(pmRoot):error}if(!stats.isDirectory())throw trackerRootNotDirectoryError(pmRoot);if(process.platform!=="win32"&&((stats.mode&292)===0||(stats.mode&73)===0))throw trackerRootUnreadableError(pmRoot);try{await(await fs.opendir(pmRoot)).close()}catch(error){throw isErrno(error,"EACCES")||isErrno(error,"EPERM")?trackerRootUnreadableError(pmRoot):error}}async function assertInitializedTracker(pmRoot){if(await assertReadableTrackerRoot(pmRoot),!await pathExists(getSettingsPath(pmRoot)))throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`,EXIT_CODE.NOT_FOUND,{code:"tracker_not_initialized",reason:"settings_missing",resolved_path:pmRoot,nextSteps:["Initialize the selected tracker root with the emitted retry."],recovery:buildTrackerInitializationRecovery(pmRoot)})}export{assertInitializedTracker,assertReadableTrackerRoot,buildTrackerInitializationRecovery};
1
+ import h from"node:fs/promises";import o from"node:path";import{renderPmCommand as w}from"../shared/command-line.js";import{EXIT_CODE as n}from"../shared/constants.js";import{PmCliError as s}from"../shared/errors.js";import{pathExists as y}from"../fs/fs-utils.js";import{getSettingsPath as E}from"./paths.js";function i(r,t){return typeof r=="object"&&r!==null&&"code"in r&&r.code===t}function u(r){const t=["--pm-path",r,"init","--defaults","--agent-guidance","skip"];return{suggested_retry:w(t),suggested_retry_args:t}}function c(r){return new s(`Tracker root is not a directory at ${r}.`,n.USAGE,{code:"tracker_root_not_directory",reason:"not_a_directory",resolved_path:r,nextSteps:["Pass a tracker directory, usually <workspace>/.agents/pm, rather than a file path."]})}function l(r){return new s(`Tracker root is not readable at ${r}.`,n.GENERIC_FAILURE,{code:"tracker_root_unreadable",reason:"unreadable",resolved_path:r,nextSteps:["Grant read and directory-search permission to the tracker root, then retry."]})}async function _(r){const t=o.resolve(r),e=o.parse(t).root;let a=o.dirname(t);for(;a!==e;){let f;try{f=await h.stat(a)}catch(d){if(i(d,"ENOTDIR"))throw c(r);if(!i(d,"ENOENT"))throw d;a=o.dirname(a);continue}if(!f.isDirectory())throw c(r);return}}async function k(r){let t;try{t=await h.stat(r)}catch(e){throw i(e,"ENOENT")?(await _(r),new s(`Tracker is not initialized at ${r}. Tracker root does not exist. Run pm init first.`,n.NOT_FOUND,{code:"tracker_root_missing",reason:"missing",resolved_path:r,nextSteps:["Confirm the tracker root path or initialize it with the emitted retry."],recovery:u(r)})):i(e,"ENOTDIR")?c(r):i(e,"EACCES")||i(e,"EPERM")?l(r):e}if(!t.isDirectory())throw c(r);if(process.platform!=="win32"&&((t.mode&292)===0||(t.mode&73)===0))throw l(r);try{await(await h.opendir(r)).close()}catch(e){throw i(e,"EACCES")||i(e,"EPERM")?l(r):e}}async function C(r){if(await k(r),!await y(E(r)))throw new s(`Tracker is not initialized at ${r}. Run pm init first.`,n.NOT_FOUND,{code:"tracker_not_initialized",reason:"settings_missing",resolved_path:r,nextSteps:["Initialize the selected tracker root with the emitted retry."],recovery:u(r)})}export{C as assertInitializedTracker,k as assertReadableTrackerRoot,u as buildTrackerInitializationRecovery};
2
2
  //# sourceMappingURL=tracker-preflight.js.map
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c8fb265a-c747-5387-8504-adfa325b14d5")}catch{}})();import{AsyncLocalStorage}from"node:async_hooks";import path from"node:path";const coordinatorCompensation=new AsyncLocalStorage;function runAsCoordinatorCompensation(compensation,run){return coordinatorCompensation.run({...compensation,pmRoot:path.resolve(compensation.pmRoot)},run)}function activeCoordinatorStep(pmRoot,transactionId){const active=coordinatorCompensation.getStore();return active!==void 0&&active.pmRoot===path.resolve(pmRoot)&&active.transactionId===transactionId?active.step:void 0}export{activeCoordinatorStep,runAsCoordinatorCompensation};
1
+ import{AsyncLocalStorage as i}from"node:async_hooks";import r from"node:path";const e=new i;function c(o,n){return e.run({...o,pmRoot:r.resolve(o.pmRoot)},n)}function s(o,n){const t=e.getStore();return t!==void 0&&t.pmRoot===r.resolve(o)&&t.transactionId===n?t.step:void 0}export{s as activeCoordinatorStep,c as runAsCoordinatorCompensation};
2
2
  //# sourceMappingURL=transaction-coordinator-scope.js.map
@@ -1,6 +1,6 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="88db9929-8e1d-56ad-9a5f-6cc0febadfb3")}catch{}})();import readline from"node:readline/promises";import{stdin as input,stdout as output}from"node:process";import{resolveGlobalPmRoot}from"../store/paths.js";import{isSettingsReadFallback,readSettings,writeSettings}from"../store/settings.js";import{resolveTelemetryEnvironmentPolicy}from"./policy.js";const TELEMETRY_PROMPT_DISABLE_ENV="PM_TELEMETRY_PROMPT",TELEMETRY_PROMPT_DISABLE_VALUES=new Set(["0","false","no","off"]),TELEMETRY_PROMPT_SKIPPED_COMMANDS=new Set(["init","completion","completion-statuses","completion-tags","completion-types"]);function parseBooleanLike(value){return typeof value!="string"?!1:TELEMETRY_PROMPT_DISABLE_VALUES.has(value.trim().toLowerCase())}function isTruthyEnvValue(value){if(typeof value!="string")return!1;const normalized=value.trim().toLowerCase();return normalized.length===0?!1:!TELEMETRY_PROMPT_DISABLE_VALUES.has(normalized)}function shouldSkipTelemetryPrompt(commandPath,globalOptions){if(globalOptions.json===!0||globalOptions.quiet===!0||process.stdin.isTTY!==!0||process.stdout.isTTY!==!0||parseBooleanLike(process.env[TELEMETRY_PROMPT_DISABLE_ENV])||isTruthyEnvValue(process.env.CI))return!0;const normalizedCommandPath=commandPath.trim().toLowerCase();return normalizedCommandPath.length===0?!0:TELEMETRY_PROMPT_SKIPPED_COMMANDS.has(normalizedCommandPath)}function parseTelemetryPromptAnswer(answer){const normalized=answer.trim().toLowerCase();return!(normalized==="n"||normalized==="no")}async function promptTelemetryConsent(currentDefault){const prompt=`pm telemetry helps improve reliability and usage diagnostics.
1
+ import a from"node:readline/promises";import{stdin as l,stdout as i}from"node:process";import{resolveGlobalPmRoot as m}from"../store/paths.js";import{isSettingsReadFallback as u,readSettings as c,writeSettings as p}from"../store/settings.js";import{resolveTelemetryEnvironmentPolicy as f}from"./policy.js";const d="PM_TELEMETRY_PROMPT",s=new Set(["0","false","no","off"]),y=new Set(["init","completion","completion-statuses","completion-tags","completion-types"]);function T(e){return typeof e!="string"?!1:s.has(e.trim().toLowerCase())}function b(e){if(typeof e!="string")return!1;const t=e.trim().toLowerCase();return t.length===0?!1:!s.has(t)}function E(e,t){if(t.json===!0||t.quiet===!0||process.stdin.isTTY!==!0||process.stdout.isTTY!==!0||T(process.env[d])||b(process.env.CI))return!0;const n=e.trim().toLowerCase();return n.length===0?!0:y.has(n)}function _(e){const t=e.trim().toLowerCase();return!(t==="n"||t==="no")}async function g(e){const n=`pm telemetry helps improve reliability and usage diagnostics.
2
2
  It is enabled by default and can be changed anytime via:
3
3
  pm config global set telemetry-tracking --policy disabled
4
- Enable telemetry now? [${currentDefault?"Y/n":"y/N"}] `,rl=readline.createInterface({input,output});try{const answer=await rl.question(prompt);return answer.trim().length===0?currentDefault:parseTelemetryPromptAnswer(answer)}finally{rl.close()}}async function maybeRunFirstUseTelemetryPrompt(commandPath,globalOptions){if(!(resolveTelemetryEnvironmentPolicy().telemetry_disabled||shouldSkipTelemetryPrompt(commandPath,globalOptions)))try{const globalPmRoot=resolveGlobalPmRoot(process.cwd()),settings=await readSettings(globalPmRoot);if(settings.telemetry.first_run_prompt_completed||isSettingsReadFallback(settings))return;const enabled=await promptTelemetryConsent(settings.telemetry.enabled);settings.telemetry.enabled=enabled,settings.telemetry.first_run_prompt_completed=!0,await writeSettings(globalPmRoot,settings,"telemetry:first_run_prompt"),output.write(`Telemetry ${enabled?"enabled":"disabled"} for this CLI install. Update any time with pm config global set telemetry-tracking --policy ${enabled?"disabled":"enabled"}.
5
- `)}catch{}}export{maybeRunFirstUseTelemetryPrompt};
4
+ Enable telemetry now? [${e?"Y/n":"y/N"}] `,r=a.createInterface({input:l,output:i});try{const o=await r.question(n);return o.trim().length===0?e:_(o)}finally{r.close()}}async function M(e,t){if(!(f().telemetry_disabled||E(e,t)))try{const n=m(process.cwd()),r=await c(n);if(r.telemetry.first_run_prompt_completed||u(r))return;const o=await g(r.telemetry.enabled);r.telemetry.enabled=o,r.telemetry.first_run_prompt_completed=!0,await p(n,r,"telemetry:first_run_prompt"),i.write(`Telemetry ${o?"enabled":"disabled"} for this CLI install. Update any time with pm config global set telemetry-tracking --policy ${o?"disabled":"enabled"}.
5
+ `)}catch{}}export{M as maybeRunFirstUseTelemetryPrompt};
6
6
  //# sourceMappingURL=consent.js.map
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bd65294f-dfa5-53d2-9691-c630884f2a5f")}catch{}})();import{EXIT_CODE}from"../shared/constants.js";const SETUP_ROOT_COMMANDS=new Set(["init","config","completion","completion-statuses","completion-tags","completion-types"]),QUERY_ROOT_COMMANDS=new Set(["list","list-all","list-open","list-in-progress","list-blocked","list-closed","list-canceled","list-draft","search","get","context","calendar","history","activity","aggregate","deps","contracts","stats"]),MUTATION_ROOT_COMMANDS=new Set(["create","update","update-many","close-many","append","close","delete","restore","claim","release","comments","notes","learnings","files","docs","start-task","pause-task","close-task"]),TESTING_ROOT_COMMANDS=new Set(["test","test-all","test-runs","test-verify","trace-test","test-ping"]),DIAGNOSTICS_ROOT_COMMANDS=new Set(["health","validate","normalize","reindex","gc","telemetry","extension-doctor"]);function normalizeCommandPath(commandPath){return commandPath.trim().replaceAll(/\s+/g," ").toLowerCase()}function normalizeErrorCode(errorCode){const normalized=errorCode?.trim().toLowerCase();return normalized&&normalized.length>0?normalized:void 0}const TELEMETRY_ERROR_MESSAGE_CLASSIFIERS=[{code:"unknown_command",matches:message=>message.includes("unknown command")},{code:"unknown_option",matches:message=>message.includes("unknown option")},{code:"missing_required_option",matches:message=>message.includes("missing required options")||message.includes("missing required option")},{code:"missing_required_argument",matches:message=>message.includes("missing required argument")},{code:"no_update_fields",matches:message=>message.includes("no update flags provided")},{code:"ownership_conflict",matches:message=>message.includes("is assigned to")&&message.includes("use --force")},{code:"lock_conflict",matches:message=>message.includes("is locked")},{code:"terminal_state_conflict",matches:message=>message.includes("already terminal")&&message.includes("use --force")},{code:"tracker_not_initialized",matches:message=>message.includes("tracker is not initialized")},{code:"item_not_found",matches:message=>message.includes(" not found")},{code:"close_through_update",matches:message=>message.includes('use "pm close <id> <text>" to close an item')||message.includes("invalid --status value")&&message.includes('"closed"')},{code:"invalid_argument_value",matches:message=>message.startsWith("invalid ")||message.includes(" must be ")||message.includes(" requires ")},{code:"invalid_command_usage",matches:message=>message.includes("either as positional")&&message.includes("not both")}],TELEMETRY_EXIT_CODE_FALLBACKS=new Map([[EXIT_CODE.USAGE,"invalid_command_usage"],[EXIT_CODE.NOT_FOUND,"item_not_found"],[EXIT_CODE.CONFLICT,"lock_conflict"],[EXIT_CODE.DEPENDENCY_FAILED,"dependency_failed"]]);function deriveTelemetryCommandTaxonomy(commandPath){const normalizedPath=normalizeCommandPath(commandPath),tokens=normalizedPath.length>0?normalizedPath.split(" "):["<unknown>"],root=tokens[0],leaf=tokens[tokens.length-1];let family="other";return SETUP_ROOT_COMMANDS.has(root)?family="setup":QUERY_ROOT_COMMANDS.has(root)?family="query":MUTATION_ROOT_COMMANDS.has(root)?family="mutation":TESTING_ROOT_COMMANDS.has(root)?family="testing":root==="extension"?family="extension":DIAGNOSTICS_ROOT_COMMANDS.has(root)&&(family="diagnostics"),{command_path:normalizedPath.length>0?normalizedPath:"<unknown>",command_root:root,command_leaf:leaf,command_depth:tokens.length,command_family:family}}function inferTelemetryErrorCode(params){if(params.ok)return;const explicit=normalizeErrorCode(params.errorCode);if(explicit)return explicit;const message=(params.errorMessage??"").trim().toLowerCase();for(const classifier of TELEMETRY_ERROR_MESSAGE_CLASSIFIERS)if(classifier.matches(message))return classifier.code;const exitCode=Number.isFinite(params.exitCode)?Math.max(0,Math.trunc(params.exitCode)):void 0;return exitCode!==void 0?TELEMETRY_EXIT_CODE_FALLBACKS.get(exitCode)??"command_failed":"command_failed"}function deriveTelemetryCommandResolution(params){if(params.ok)return"success";const normalizedCode=normalizeErrorCode(params.errorCode);return normalizedCode==="unknown_command"?"nonexistent_command":normalizedCode==="unknown_option"?"invalid_option":normalizedCode==="missing_required_option"?"missing_required_option":normalizedCode==="missing_required_argument"?"missing_required_argument":normalizedCode==="health_findings"?"health_findings":normalizedCode==="validation_findings"?"validation_findings":params.errorCategory==="usage"?"invalid_usage":params.errorCategory==="validation"?"validation_failed":params.errorCategory==="conflict"?"conflict":params.errorCategory==="runtime"?"runtime_failed":"unknown_failed"}export{deriveTelemetryCommandResolution,deriveTelemetryCommandTaxonomy,inferTelemetryErrorCode};
1
+ import{EXIT_CODE as r}from"../shared/constants.js";const d=new Set(["init","config","completion","completion-statuses","completion-tags","completion-types"]),a=new Set(["list","list-all","list-open","list-in-progress","list-blocked","list-closed","list-canceled","list-draft","search","get","context","calendar","history","activity","aggregate","deps","contracts","stats"]),l=new Set(["create","update","update-many","close-many","append","close","delete","restore","claim","release","comments","notes","learnings","files","docs","start-task","pause-task","close-task"]),u=new Set(["test","test-all","test-runs","test-verify","trace-test","test-ping"]),m=new Set(["health","validate","normalize","reindex","gc","telemetry","extension-doctor"]);function _(e){return e.trim().replaceAll(/\s+/g," ").toLowerCase()}function c(e){const n=e?.trim().toLowerCase();return n&&n.length>0?n:void 0}const f=[{code:"unknown_command",matches:e=>e.includes("unknown command")},{code:"unknown_option",matches:e=>e.includes("unknown option")},{code:"missing_required_option",matches:e=>e.includes("missing required options")||e.includes("missing required option")},{code:"missing_required_argument",matches:e=>e.includes("missing required argument")},{code:"no_update_fields",matches:e=>e.includes("no update flags provided")},{code:"ownership_conflict",matches:e=>e.includes("is assigned to")&&e.includes("use --force")},{code:"lock_conflict",matches:e=>e.includes("is locked")},{code:"terminal_state_conflict",matches:e=>e.includes("already terminal")&&e.includes("use --force")},{code:"tracker_not_initialized",matches:e=>e.includes("tracker is not initialized")},{code:"item_not_found",matches:e=>e.includes(" not found")},{code:"close_through_update",matches:e=>e.includes('use "pm close <id> <text>" to close an item')||e.includes("invalid --status value")&&e.includes('"closed"')},{code:"invalid_argument_value",matches:e=>e.startsWith("invalid ")||e.includes(" must be ")||e.includes(" requires ")},{code:"invalid_command_usage",matches:e=>e.includes("either as positional")&&e.includes("not both")}],h=new Map([[r.USAGE,"invalid_command_usage"],[r.NOT_FOUND,"item_not_found"],[r.CONFLICT,"lock_conflict"],[r.DEPENDENCY_FAILED,"dependency_failed"]]);function p(e){const n=_(e),o=n.length>0?n.split(" "):["<unknown>"],t=o[0],s=o[o.length-1];let i="other";return d.has(t)?i="setup":a.has(t)?i="query":l.has(t)?i="mutation":u.has(t)?i="testing":t==="extension"?i="extension":m.has(t)&&(i="diagnostics"),{command_path:n.length>0?n:"<unknown>",command_root:t,command_leaf:s,command_depth:o.length,command_family:i}}function C(e){if(e.ok)return;const n=c(e.errorCode);if(n)return n;const o=(e.errorMessage??"").trim().toLowerCase();for(const s of f)if(s.matches(o))return s.code;const t=Number.isFinite(e.exitCode)?Math.max(0,Math.trunc(e.exitCode)):void 0;return t!==void 0?h.get(t)??"command_failed":"command_failed"}function E(e){if(e.ok)return"success";const n=c(e.errorCode);return n==="unknown_command"?"nonexistent_command":n==="unknown_option"?"invalid_option":n==="missing_required_option"?"missing_required_option":n==="missing_required_argument"?"missing_required_argument":n==="health_findings"?"health_findings":n==="validation_findings"?"validation_findings":e.errorCategory==="usage"?"invalid_usage":e.errorCategory==="validation"?"validation_failed":e.errorCategory==="conflict"?"conflict":e.errorCategory==="runtime"?"runtime_failed":"unknown_failed"}export{E as deriveTelemetryCommandResolution,p as deriveTelemetryCommandTaxonomy,C as inferTelemetryErrorCode};
2
2
  //# sourceMappingURL=observability.js.map
@@ -1,2 +1,2 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1bd63c38-5dff-5f7d-b733-3be3fcc6605e")}catch{}})();import{createHash}from"node:crypto";const TRUE_VALUES=new Set(["1","true","yes","on"]),PM_TELEMETRY_SOURCE_CONTEXT_VALUES=["user","automation","test","dogfood"],SOURCE_CONTEXTS=new Set(PM_TELEMETRY_SOURCE_CONTEXT_VALUES);function resolveTelemetrySourceAttribution(options={},env=process.env,interactive=process.stdin.isTTY===!0&&process.stdout.isTTY===!0){const override=(env.PM_TELEMETRY_SOURCE_CONTEXT??"").trim().toLowerCase(),inferredTest=isTelemetryTestEnvironment(env);if(SOURCE_CONTEXTS.has(override)&&(!inferredTest||override==="test"))return{source_context:override,source_context_source:"env_override"};const source=override&&!SOURCE_CONTEXTS.has(override)?"env_override_rejected":"inferred";return inferredTest?{source_context:"test",source_context_source:source}:{source_context:!interactive||telemetryEnvironmentFlag("CI",env)||options.json===!0||options.quiet===!0?"automation":"user",source_context_source:source}}function telemetryTestEnvironmentSignal(env=process.env){return typeof env.VITEST=="string"?"VITEST":typeof env.VITEST_WORKER_ID=="string"?"VITEST_WORKER_ID":typeof env.NODE_TEST_CONTEXT=="string"?"NODE_TEST_CONTEXT":(env.NODE_ENV??"").trim().toLowerCase()==="test"?"NODE_ENV":void 0}function isTelemetryTestEnvironment(env=process.env){return telemetryTestEnvironmentSignal(env)!==void 0}const TELEMETRY_SAMPLEABLE_READS=new Set(["stats","ops stats","list","get","next","context","activity","aggregate"]);function resolveTelemetryReadSampleRate(command,noExtensions,env=process.env){const raw=env.PM_TELEMETRY_READ_SAMPLE_RATE?.trim();if(!raw||!noExtensions||!TELEMETRY_SAMPLEABLE_READS.has(command))return 1;const rate=Number(raw);return Number.isFinite(rate)&&rate>0&&rate<=1?rate:1}function telemetryEnvironmentFlag(key,env){return TRUE_VALUES.has((env[key]??"").trim().toLowerCase())}function resolveTelemetryEndpointOverride(env=process.env){const raw=(env.PM_TELEMETRY_ENDPOINT??"").trim(),protocol=URL.canParse(raw)?new URL(raw).protocol:"";return protocol==="http:"||protocol==="https:"?{endpoint:raw,invalid:!1}:{endpoint:null,invalid:raw.length>0}}function telemetryRuntimeFileName(base,override=resolveTelemetryEndpointOverride().endpoint){if(override===null)return base;const key=createHash("sha256").update(override).digest("hex").slice(0,16);return base.replace(/\.(jsonl|json)$/u,`.${key}.$1`)}function stripUrlCredentials(text){return text.replaceAll(/(\/\/)[^/?#\s]*@/gu,"$1")}function redactTelemetryEndpoint(rawEndpoint){const trimmed=rawEndpoint.trim();if(!URL.canParse(trimmed))return stripUrlCredentials(trimmed).replace(/[?#].*$/su,"");const parsed=new URL(trimmed);return parsed.username="",parsed.password="",parsed.search="",parsed.hash="",parsed.toString()}function redactUrlsInText(text){return text.replaceAll(/\b[a-z][a-z\d+.-]*:\/\/[^\s"'<>]+/giu,url=>redactTelemetryEndpoint(url))}function effectiveTelemetryEndpoint(configured,env=process.env){return resolveTelemetryEndpointOverride(env).endpoint??configured}function hardTelemetryOptOut(env,endpointInvalid){return telemetryEnvironmentFlag("DO_NOT_TRACK",env)?"env:DO_NOT_TRACK":telemetryEnvironmentFlag("PM_TELEMETRY_DISABLED",env)?"env:PM_TELEMETRY_DISABLED":telemetryEnvironmentFlag("PM_NO_TELEMETRY",env)?"env:PM_NO_TELEMETRY":endpointInvalid?"env:PM_TELEMETRY_ENDPOINT":void 0}function resolveTelemetryEnvironmentPolicy(env=process.env){const endpoint=resolveTelemetryEndpointOverride(env),override=(env.PM_TELEMETRY_SOURCE_CONTEXT??"").trim().toLowerCase(),testSignal=telemetryTestEnvironmentSignal(env),testOptIn=override==="test"?"env:PM_TELEMETRY_SOURCE_CONTEXT":telemetryEnvironmentFlag("PM_TELEMETRY_SEND_TEST_EVENTS",env)?"env:PM_TELEMETRY_SEND_TEST_EVENTS":void 0,testSuppressed=testSignal!==void 0&&testOptIn===void 0,optOut=hardTelemetryOptOut(env,endpoint.invalid),testDecision=testSignal===void 0?void 0:testOptIn??`env:${testSignal}`;return{telemetry_disabled:optOut!==void 0||testSuppressed,do_not_track:optOut==="env:DO_NOT_TRACK",test_suppressed:testSuppressed,endpoint_override:endpoint.endpoint===null?null:redactTelemetryEndpoint(endpoint.endpoint),endpoint_override_invalid:endpoint.invalid,decided_by:optOut??testDecision??null}}export{PM_TELEMETRY_SOURCE_CONTEXT_VALUES,TELEMETRY_SAMPLEABLE_READS,effectiveTelemetryEndpoint,isTelemetryTestEnvironment,redactTelemetryEndpoint,redactUrlsInText,resolveTelemetryEndpointOverride,resolveTelemetryEnvironmentPolicy,resolveTelemetryReadSampleRate,resolveTelemetrySourceAttribution,stripUrlCredentials,telemetryRuntimeFileName,telemetryTestEnvironmentSignal};
1
+ import{createHash as a}from"node:crypto";const p=new Set(["1","true","yes","on"]),l=["user","automation","test","dogfood"],T=new Set(l);function L(e={},t=process.env,n=process.stdin.isTTY===!0&&process.stdout.isTTY===!0){const r=(t.PM_TELEMETRY_SOURCE_CONTEXT??"").trim().toLowerCase(),o=f(t);if(T.has(r)&&(!o||r==="test"))return{source_context:r,source_context_source:"env_override"};const s=r&&!T.has(r)?"env_override_rejected":"inferred";return o?{source_context:"test",source_context_source:s}:{source_context:!n||i("CI",t)||e.json===!0||e.quiet===!0?"automation":"user",source_context_source:s}}function c(e=process.env){return typeof e.VITEST=="string"?"VITEST":typeof e.VITEST_WORKER_ID=="string"?"VITEST_WORKER_ID":typeof e.NODE_TEST_CONTEXT=="string"?"NODE_TEST_CONTEXT":(e.NODE_ENV??"").trim().toLowerCase()==="test"?"NODE_ENV":void 0}function f(e=process.env){return c(e)!==void 0}const m=new Set(["stats","ops stats","list","get","next","context","activity","aggregate"]);function M(e,t,n=process.env){const r=n.PM_TELEMETRY_READ_SAMPLE_RATE?.trim();if(!r||!t||!m.has(e))return 1;const o=Number(r);return Number.isFinite(o)&&o>0&&o<=1?o:1}function i(e,t){return p.has((t[e]??"").trim().toLowerCase())}function u(e=process.env){const t=(e.PM_TELEMETRY_ENDPOINT??"").trim(),n=URL.canParse(t)?new URL(t).protocol:"";return n==="http:"||n==="https:"?{endpoint:t,invalid:!1}:{endpoint:null,invalid:t.length>0}}function N(e,t=u().endpoint){if(t===null)return e;const n=a("sha256").update(t).digest("hex").slice(0,16);return e.replace(/\.(jsonl|json)$/u,`.${n}.$1`)}function R(e){return e.replaceAll(/(\/\/)[^/?#\s]*@/gu,"$1")}function _(e){const t=e.trim();if(!URL.canParse(t))return R(t).replace(/[?#].*$/su,"");const n=new URL(t);return n.username="",n.password="",n.search="",n.hash="",n.toString()}function v(e){return e.replaceAll(/\b[a-z][a-z\d+.-]*:\/\/[^\s"'<>]+/giu,t=>_(t))}function x(e,t=process.env){return u(t).endpoint??e}function S(e,t){return i("DO_NOT_TRACK",e)?"env:DO_NOT_TRACK":i("PM_TELEMETRY_DISABLED",e)?"env:PM_TELEMETRY_DISABLED":i("PM_NO_TELEMETRY",e)?"env:PM_NO_TELEMETRY":t?"env:PM_TELEMETRY_ENDPOINT":void 0}function C(e=process.env){const t=u(e),n=(e.PM_TELEMETRY_SOURCE_CONTEXT??"").trim().toLowerCase(),r=c(e),o=n==="test"?"env:PM_TELEMETRY_SOURCE_CONTEXT":i("PM_TELEMETRY_SEND_TEST_EVENTS",e)?"env:PM_TELEMETRY_SEND_TEST_EVENTS":void 0,s=r!==void 0&&o===void 0,E=S(e,t.invalid),d=r===void 0?void 0:o??`env:${r}`;return{telemetry_disabled:E!==void 0||s,do_not_track:E==="env:DO_NOT_TRACK",test_suppressed:s,endpoint_override:t.endpoint===null?null:_(t.endpoint),endpoint_override_invalid:t.invalid,decided_by:E??d??null}}export{l as PM_TELEMETRY_SOURCE_CONTEXT_VALUES,m as TELEMETRY_SAMPLEABLE_READS,x as effectiveTelemetryEndpoint,f as isTelemetryTestEnvironment,_ as redactTelemetryEndpoint,v as redactUrlsInText,u as resolveTelemetryEndpointOverride,C as resolveTelemetryEnvironmentPolicy,M as resolveTelemetryReadSampleRate,L as resolveTelemetrySourceAttribution,R as stripUrlCredentials,N as telemetryRuntimeFileName,c as telemetryTestEnvironmentSignal};
2
2
  //# sourceMappingURL=policy.js.map
@@ -1,3 +1,3 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4f455b67-536a-59be-8f25-1dc9c9c0b917")}catch{}})();import path from"node:path";import{readFileIfExists,writeFileAtomic}from"../fs/fs-utils.js";import{resolveTelemetryReadSampleRate,TELEMETRY_SAMPLEABLE_READS}from"./policy.js";async function resolveAutomaticReadSampleRate(globalPmRoot,command,coreReadOwned,env=process.env,now=Date.now()){if(!coreReadOwned||!TELEMETRY_SAMPLEABLE_READS.has(command))return 1;if(env.PM_TELEMETRY_READ_SAMPLE_RATE!==void 0)return resolveTelemetryReadSampleRate(command,!0,env);try{const statePath=path.join(globalPmRoot,"runtime","telemetry","read-sampling.json"),minute=Math.floor(now/6e4),counts=parseReadCounts(await readFileIfExists(statePath),minute),ordinal=Math.min(Number.MAX_SAFE_INTEGER,(counts[command]??0)+1);return counts[command]=ordinal,await writeFileAtomic(statePath,`${JSON.stringify({minute,counts})}
2
- `),Math.min(1,(10/ordinal)**2)}catch{return 1}}function parseReadCounts(raw,minute){const counts={};let previous;try{previous=JSON.parse(raw??"null")}catch{return counts}if(typeof previous!="object"||previous===null||!("minute"in previous)||previous.minute!==minute||!("counts"in previous)||typeof previous.counts!="object"||previous.counts===null)return counts;for(const[key,value]of Object.entries(previous.counts))TELEMETRY_SAMPLEABLE_READS.has(key)&&typeof value=="number"&&Number.isSafeInteger(value)&&value>=0&&(counts[key]=value);return counts}export{resolveAutomaticReadSampleRate};
1
+ import f from"node:path";import{readFileIfExists as l,writeFileAtomic as m}from"../fs/fs-utils.js";import{resolveTelemetryReadSampleRate as E,TELEMETRY_SAMPLEABLE_READS as c}from"./policy.js";async function h(i,n,r,t=process.env,o=Date.now()){if(!r||!c.has(n))return 1;if(t.PM_TELEMETRY_READ_SAMPLE_RATE!==void 0)return E(n,!0,t);try{const e=f.join(i,"runtime","telemetry","read-sampling.json"),u=Math.floor(o/6e4),s=p(await l(e),u),a=Math.min(Number.MAX_SAFE_INTEGER,(s[n]??0)+1);return s[n]=a,await m(e,`${JSON.stringify({minute:u,counts:s})}
2
+ `),Math.min(1,(10/a)**2)}catch{return 1}}function p(i,n){const r={};let t;try{t=JSON.parse(i??"null")}catch{return r}if(typeof t!="object"||t===null||!("minute"in t)||t.minute!==n||!("counts"in t)||typeof t.counts!="object"||t.counts===null)return r;for(const[o,e]of Object.entries(t.counts))c.has(o)&&typeof e=="number"&&Number.isSafeInteger(e)&&e>=0&&(r[o]=e);return r}export{h as resolveAutomaticReadSampleRate};
3
3
  //# sourceMappingURL=read-sampling.js.map