@rpamis/comet 0.4.2 → 0.4.4

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 (391) hide show
  1. package/LICENSE +21 -21
  2. package/assets/manifest.json +1 -1
  3. package/assets/skills/comet/scripts/comet-archive.mjs +109 -96
  4. package/assets/skills/comet/scripts/comet-check.mjs +117 -104
  5. package/assets/skills/comet/scripts/comet-entry-runtime.mjs +59 -59
  6. package/assets/skills/comet/scripts/comet-guard.mjs +173 -160
  7. package/assets/skills/comet/scripts/comet-handoff.mjs +110 -97
  8. package/assets/skills/comet/scripts/comet-hook-guard.mjs +110 -97
  9. package/assets/skills/comet/scripts/comet-hook-router.mjs +269 -159
  10. package/assets/skills/comet/scripts/comet-intent.mjs +31 -31
  11. package/assets/skills/comet/scripts/comet-resume-probe.mjs +104 -91
  12. package/assets/skills/comet/scripts/comet-runtime.mjs +272 -259
  13. package/assets/skills/comet/scripts/comet-state.mjs +204 -191
  14. package/assets/skills/comet/scripts/comet-yaml-validate.mjs +25 -25
  15. package/assets/skills/comet-archive/SKILL.md +4 -4
  16. package/assets/skills/comet-build/SKILL.md +4 -6
  17. package/assets/skills/comet-classic/SKILL.md +3 -1
  18. package/assets/skills/comet-classic/reference/scripts.md +17 -1
  19. package/assets/skills/comet-design/SKILL.md +0 -2
  20. package/assets/skills/comet-hotfix/SKILL.md +2 -3
  21. package/assets/skills/comet-native/SKILL.md +11 -8
  22. package/assets/skills/comet-native/reference/artifacts.md +7 -7
  23. package/assets/skills/comet-native/reference/clarification.md +4 -4
  24. package/assets/skills/comet-native/reference/commands.md +25 -13
  25. package/assets/skills/comet-native/reference/recovery.md +3 -3
  26. package/assets/skills/comet-native/reference/workspace.md +10 -4
  27. package/assets/skills/comet-native/scripts/comet-native-archive.mjs +230 -149
  28. package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +239 -161
  29. package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +232 -122
  30. package/assets/skills/comet-native/scripts/comet-native-init.mjs +184 -107
  31. package/assets/skills/comet-native/scripts/comet-native-new.mjs +219 -142
  32. package/assets/skills/comet-native/scripts/comet-native-next.mjs +239 -161
  33. package/assets/skills/comet-native/scripts/comet-native-root.mjs +205 -128
  34. package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +276 -195
  35. package/assets/skills/comet-native/scripts/comet-native-select.mjs +204 -127
  36. package/assets/skills/comet-native/scripts/comet-native-show.mjs +202 -125
  37. package/assets/skills/comet-native/scripts/comet-native-spec.mjs +203 -125
  38. package/assets/skills/comet-native/scripts/comet-native-status.mjs +200 -123
  39. package/assets/skills/comet-open/SKILL.md +0 -2
  40. package/assets/skills/comet-tweak/SKILL.md +2 -1
  41. package/assets/skills/comet-verify/SKILL.md +0 -2
  42. package/assets/skills-zh/comet-archive/SKILL.md +4 -4
  43. package/assets/skills-zh/comet-build/SKILL.md +4 -6
  44. package/assets/skills-zh/comet-classic/SKILL.md +3 -1
  45. package/assets/skills-zh/comet-classic/reference/scripts.md +11 -1
  46. package/assets/skills-zh/comet-design/SKILL.md +0 -2
  47. package/assets/skills-zh/comet-hotfix/SKILL.md +2 -3
  48. package/assets/skills-zh/comet-native/SKILL.md +11 -8
  49. package/assets/skills-zh/comet-native/reference/artifacts.md +7 -7
  50. package/assets/skills-zh/comet-native/reference/clarification.md +4 -4
  51. package/assets/skills-zh/comet-native/reference/commands.md +26 -10
  52. package/assets/skills-zh/comet-native/reference/recovery.md +3 -3
  53. package/assets/skills-zh/comet-native/reference/workspace.md +10 -4
  54. package/assets/skills-zh/comet-open/SKILL.md +0 -2
  55. package/assets/skills-zh/comet-tweak/SKILL.md +2 -1
  56. package/assets/skills-zh/comet-verify/SKILL.md +0 -2
  57. package/bin/comet-daemon-router.js +57 -13
  58. package/bin/fast-runtime-router.js +1 -1
  59. package/dist/app/commands/daemon-server.d.ts.map +1 -1
  60. package/dist/app/commands/daemon-server.js +14 -2
  61. package/dist/app/commands/daemon-server.js.map +1 -1
  62. package/dist/app/commands/project-knowledge.d.ts.map +1 -1
  63. package/dist/app/commands/project-knowledge.js +0 -1
  64. package/dist/app/commands/project-knowledge.js.map +1 -1
  65. package/dist/domains/comet-classic/classic-archive-entry.d.ts +1 -1
  66. package/dist/domains/comet-classic/classic-archive-entry.d.ts.map +1 -1
  67. package/dist/domains/comet-classic/classic-archive-entry.js +5 -2
  68. package/dist/domains/comet-classic/classic-archive-entry.js.map +1 -1
  69. package/dist/domains/comet-classic/classic-branch-binding.d.ts.map +1 -1
  70. package/dist/domains/comet-classic/classic-branch-binding.js +5 -4
  71. package/dist/domains/comet-classic/classic-branch-binding.js.map +1 -1
  72. package/dist/domains/comet-classic/classic-check-entry.d.ts +1 -1
  73. package/dist/domains/comet-classic/classic-check-entry.d.ts.map +1 -1
  74. package/dist/domains/comet-classic/classic-check-entry.js +5 -2
  75. package/dist/domains/comet-classic/classic-check-entry.js.map +1 -1
  76. package/dist/domains/comet-classic/classic-check-snapshot.d.ts +2 -0
  77. package/dist/domains/comet-classic/classic-check-snapshot.d.ts.map +1 -1
  78. package/dist/domains/comet-classic/classic-check-snapshot.js +90 -27
  79. package/dist/domains/comet-classic/classic-check-snapshot.js.map +1 -1
  80. package/dist/domains/comet-classic/classic-guard-entry.d.ts +1 -1
  81. package/dist/domains/comet-classic/classic-guard-entry.d.ts.map +1 -1
  82. package/dist/domains/comet-classic/classic-guard-entry.js +5 -2
  83. package/dist/domains/comet-classic/classic-guard-entry.js.map +1 -1
  84. package/dist/domains/comet-classic/classic-handoff-entry.d.ts +1 -1
  85. package/dist/domains/comet-classic/classic-handoff-entry.d.ts.map +1 -1
  86. package/dist/domains/comet-classic/classic-handoff-entry.js +5 -2
  87. package/dist/domains/comet-classic/classic-handoff-entry.js.map +1 -1
  88. package/dist/domains/comet-classic/classic-resume-probe.d.ts.map +1 -1
  89. package/dist/domains/comet-classic/classic-resume-probe.js +3 -2
  90. package/dist/domains/comet-classic/classic-resume-probe.js.map +1 -1
  91. package/dist/domains/comet-classic/classic-script-entry.d.ts +3 -1
  92. package/dist/domains/comet-classic/classic-script-entry.d.ts.map +1 -1
  93. package/dist/domains/comet-classic/classic-script-entry.js +34 -3
  94. package/dist/domains/comet-classic/classic-script-entry.js.map +1 -1
  95. package/dist/domains/comet-classic/classic-state-command.d.ts.map +1 -1
  96. package/dist/domains/comet-classic/classic-state-command.js +3 -2
  97. package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
  98. package/dist/domains/comet-classic/classic-state-entry.d.ts +1 -1
  99. package/dist/domains/comet-classic/classic-state-entry.d.ts.map +1 -1
  100. package/dist/domains/comet-classic/classic-state-entry.js +5 -2
  101. package/dist/domains/comet-classic/classic-state-entry.js.map +1 -1
  102. package/dist/domains/comet-classic/classic-store.d.ts.map +1 -1
  103. package/dist/domains/comet-classic/classic-store.js +67 -1
  104. package/dist/domains/comet-classic/classic-store.js.map +1 -1
  105. package/dist/domains/comet-entry/resume-probe.d.ts.map +1 -1
  106. package/dist/domains/comet-entry/resume-probe.js +3 -2
  107. package/dist/domains/comet-entry/resume-probe.js.map +1 -1
  108. package/dist/domains/comet-native/native-acceptance.d.ts +5 -1
  109. package/dist/domains/comet-native/native-acceptance.d.ts.map +1 -1
  110. package/dist/domains/comet-native/native-acceptance.js +13 -2
  111. package/dist/domains/comet-native/native-acceptance.js.map +1 -1
  112. package/dist/domains/comet-native/native-archive-command.d.ts.map +1 -1
  113. package/dist/domains/comet-native/native-archive-command.js +167 -37
  114. package/dist/domains/comet-native/native-archive-command.js.map +1 -1
  115. package/dist/domains/comet-native/native-artifact-language.d.ts +3 -1
  116. package/dist/domains/comet-native/native-artifact-language.d.ts.map +1 -1
  117. package/dist/domains/comet-native/native-artifact-language.js +4 -11
  118. package/dist/domains/comet-native/native-artifact-language.js.map +1 -1
  119. package/dist/domains/comet-native/native-artifacts.d.ts +8 -1
  120. package/dist/domains/comet-native/native-artifacts.d.ts.map +1 -1
  121. package/dist/domains/comet-native/native-artifacts.js +14 -2
  122. package/dist/domains/comet-native/native-artifacts.js.map +1 -1
  123. package/dist/domains/comet-native/native-builder-acceptance-review.d.ts +16 -0
  124. package/dist/domains/comet-native/native-builder-acceptance-review.d.ts.map +1 -0
  125. package/dist/domains/comet-native/native-builder-acceptance-review.js +65 -0
  126. package/dist/domains/comet-native/native-builder-acceptance-review.js.map +1 -0
  127. package/dist/domains/comet-native/native-cli-help.d.ts.map +1 -1
  128. package/dist/domains/comet-native/native-cli-help.js +8 -4
  129. package/dist/domains/comet-native/native-cli-help.js.map +1 -1
  130. package/dist/domains/comet-native/native-cli-shared.d.ts +4 -2
  131. package/dist/domains/comet-native/native-cli-shared.d.ts.map +1 -1
  132. package/dist/domains/comet-native/native-cli-shared.js +37 -9
  133. package/dist/domains/comet-native/native-cli-shared.js.map +1 -1
  134. package/dist/domains/comet-native/native-cli.d.ts +4 -1
  135. package/dist/domains/comet-native/native-cli.d.ts.map +1 -1
  136. package/dist/domains/comet-native/native-cli.js +9 -5
  137. package/dist/domains/comet-native/native-cli.js.map +1 -1
  138. package/dist/domains/comet-native/native-doctor-command.d.ts.map +1 -1
  139. package/dist/domains/comet-native/native-doctor-command.js +144 -3
  140. package/dist/domains/comet-native/native-doctor-command.js.map +1 -1
  141. package/dist/domains/comet-native/native-git-provenance.d.ts.map +1 -1
  142. package/dist/domains/comet-native/native-git-provenance.js +3 -2
  143. package/dist/domains/comet-native/native-git-provenance.js.map +1 -1
  144. package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -1
  145. package/dist/domains/comet-native/native-hook-guard.js +56 -26
  146. package/dist/domains/comet-native/native-hook-guard.js.map +1 -1
  147. package/dist/domains/comet-native/native-local-execution.d.ts +1 -0
  148. package/dist/domains/comet-native/native-local-execution.d.ts.map +1 -1
  149. package/dist/domains/comet-native/native-local-execution.js +7 -0
  150. package/dist/domains/comet-native/native-local-execution.js.map +1 -1
  151. package/dist/domains/comet-native/native-lock.d.ts.map +1 -1
  152. package/dist/domains/comet-native/native-lock.js +12 -0
  153. package/dist/domains/comet-native/native-lock.js.map +1 -1
  154. package/dist/domains/comet-native/native-loop-runtime.d.ts +2 -0
  155. package/dist/domains/comet-native/native-loop-runtime.d.ts.map +1 -1
  156. package/dist/domains/comet-native/native-loop-runtime.js +6 -0
  157. package/dist/domains/comet-native/native-loop-runtime.js.map +1 -1
  158. package/dist/domains/comet-native/native-next-command.d.ts.map +1 -1
  159. package/dist/domains/comet-native/native-next-command.js +57 -28
  160. package/dist/domains/comet-native/native-next-command.js.map +1 -1
  161. package/dist/domains/comet-native/native-output-language.d.ts.map +1 -1
  162. package/dist/domains/comet-native/native-output-language.js +7 -0
  163. package/dist/domains/comet-native/native-output-language.js.map +1 -1
  164. package/dist/domains/comet-native/native-portable-acceptance.d.ts +2 -0
  165. package/dist/domains/comet-native/native-portable-acceptance.d.ts.map +1 -1
  166. package/dist/domains/comet-native/native-portable-acceptance.js +11 -1
  167. package/dist/domains/comet-native/native-portable-acceptance.js.map +1 -1
  168. package/dist/domains/comet-native/native-portable-archive.d.ts +1 -0
  169. package/dist/domains/comet-native/native-portable-archive.d.ts.map +1 -1
  170. package/dist/domains/comet-native/native-portable-archive.js +3 -0
  171. package/dist/domains/comet-native/native-portable-archive.js.map +1 -1
  172. package/dist/domains/comet-native/native-portable-checks.d.ts +15 -4
  173. package/dist/domains/comet-native/native-portable-checks.d.ts.map +1 -1
  174. package/dist/domains/comet-native/native-portable-checks.js +167 -66
  175. package/dist/domains/comet-native/native-portable-checks.js.map +1 -1
  176. package/dist/domains/comet-native/native-portable-continuation.d.ts +2 -1
  177. package/dist/domains/comet-native/native-portable-continuation.d.ts.map +1 -1
  178. package/dist/domains/comet-native/native-portable-continuation.js +121 -39
  179. package/dist/domains/comet-native/native-portable-continuation.js.map +1 -1
  180. package/dist/domains/comet-native/native-portable-requirements.d.ts +1 -0
  181. package/dist/domains/comet-native/native-portable-requirements.d.ts.map +1 -1
  182. package/dist/domains/comet-native/native-portable-requirements.js +61 -18
  183. package/dist/domains/comet-native/native-portable-requirements.js.map +1 -1
  184. package/dist/domains/comet-native/native-portable-shape-coordination.d.ts.map +1 -1
  185. package/dist/domains/comet-native/native-portable-shape-coordination.js +18 -5
  186. package/dist/domains/comet-native/native-portable-shape-coordination.js.map +1 -1
  187. package/dist/domains/comet-native/native-portable-state.d.ts.map +1 -1
  188. package/dist/domains/comet-native/native-portable-state.js +10 -3
  189. package/dist/domains/comet-native/native-portable-state.js.map +1 -1
  190. package/dist/domains/comet-native/native-portable-status.d.ts.map +1 -1
  191. package/dist/domains/comet-native/native-portable-status.js +10 -4
  192. package/dist/domains/comet-native/native-portable-status.js.map +1 -1
  193. package/dist/domains/comet-native/native-portable-types.d.ts +2 -1
  194. package/dist/domains/comet-native/native-portable-types.d.ts.map +1 -1
  195. package/dist/domains/comet-native/native-portable-types.js.map +1 -1
  196. package/dist/domains/comet-native/native-portable-verification.d.ts +3 -0
  197. package/dist/domains/comet-native/native-portable-verification.d.ts.map +1 -1
  198. package/dist/domains/comet-native/native-portable-verification.js +28 -35
  199. package/dist/domains/comet-native/native-portable-verification.js.map +1 -1
  200. package/dist/domains/comet-native/native-portable-verifier-coordination.d.ts +2 -0
  201. package/dist/domains/comet-native/native-portable-verifier-coordination.d.ts.map +1 -1
  202. package/dist/domains/comet-native/native-portable-verifier-coordination.js +9 -0
  203. package/dist/domains/comet-native/native-portable-verifier-coordination.js.map +1 -1
  204. package/dist/domains/comet-native/native-runner-input-artifacts.d.ts +9 -0
  205. package/dist/domains/comet-native/native-runner-input-artifacts.d.ts.map +1 -0
  206. package/dist/domains/comet-native/native-runner-input-artifacts.js +102 -0
  207. package/dist/domains/comet-native/native-runner-input-artifacts.js.map +1 -0
  208. package/dist/domains/comet-native/native-runner-input.d.ts +90 -64
  209. package/dist/domains/comet-native/native-runner-input.d.ts.map +1 -1
  210. package/dist/domains/comet-native/native-runner-input.js +107 -22
  211. package/dist/domains/comet-native/native-runner-input.js.map +1 -1
  212. package/dist/domains/comet-native/native-script-entry.d.ts.map +1 -1
  213. package/dist/domains/comet-native/native-script-entry.js +9 -3
  214. package/dist/domains/comet-native/native-script-entry.js.map +1 -1
  215. package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -1
  216. package/dist/domains/comet-native/native-snapshot.js +7 -2
  217. package/dist/domains/comet-native/native-snapshot.js.map +1 -1
  218. package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts.map +1 -1
  219. package/dist/domains/comet-native/native-verification-receipt-runtime.js +5 -4
  220. package/dist/domains/comet-native/native-verification-receipt-runtime.js.map +1 -1
  221. package/dist/domains/comet-native/native-workspace-finish.d.ts +26 -0
  222. package/dist/domains/comet-native/native-workspace-finish.d.ts.map +1 -1
  223. package/dist/domains/comet-native/native-workspace-finish.js +520 -15
  224. package/dist/domains/comet-native/native-workspace-finish.js.map +1 -1
  225. package/dist/domains/dashboard/web/assets/{abnfDiagram-VCTEODGH-qlcciI25.js → abnfDiagram-VCTEODGH-CFEU4PQU.js} +1 -1
  226. package/dist/domains/dashboard/web/assets/{arc-KVm4k9kp.js → arc-BeYYJor9.js} +1 -1
  227. package/dist/domains/dashboard/web/assets/architecture-7GRP2DOG-YphM8Wtg.js +1 -0
  228. package/dist/domains/dashboard/web/assets/{architectureDiagram-5GKGNRK7-C366RdBK.js → architectureDiagram-5GKGNRK7-CqTy4fyH.js} +1 -1
  229. package/dist/domains/dashboard/web/assets/{blockDiagram-I7D4REHJ-DAuTc2OO.js → blockDiagram-I7D4REHJ-SR_5S4SA.js} +1 -1
  230. package/dist/domains/dashboard/web/assets/{c4Diagram-7LVT6UL2-CFB0RZmL.js → c4Diagram-7LVT6UL2-DzphG2XS.js} +1 -1
  231. package/dist/domains/dashboard/web/assets/channel-BkwcGbYR.js +1 -0
  232. package/dist/domains/dashboard/web/assets/{chunk-4HAMMTFA-DTV6lyGQ.js → chunk-4HAMMTFA-BpthUtIs.js} +1 -1
  233. package/dist/domains/dashboard/web/assets/{chunk-75Z2AOVW-DgJm4cEX.js → chunk-75Z2AOVW-CxAdhPhG.js} +1 -1
  234. package/dist/domains/dashboard/web/assets/{chunk-DU6HZSFF-NAtcgGZr.js → chunk-DU6HZSFF-5peVNfxp.js} +1 -1
  235. package/dist/domains/dashboard/web/assets/{chunk-F27PBJKO-BcFXHZMJ.js → chunk-F27PBJKO-CwG4xi2V.js} +1 -1
  236. package/dist/domains/dashboard/web/assets/{chunk-GMAD6QVW-wNemar9b.js → chunk-GMAD6QVW-BuFFY783.js} +1 -1
  237. package/dist/domains/dashboard/web/assets/{chunk-GVQU2GXP-BiVCDO9d.js → chunk-GVQU2GXP-OyUFmjE-.js} +1 -1
  238. package/dist/domains/dashboard/web/assets/{chunk-IMKFNOWR-D9GDj4b6.js → chunk-IMKFNOWR-DmTme45C.js} +1 -1
  239. package/dist/domains/dashboard/web/assets/{chunk-L3NEJ4N5-DkPl5vac.js → chunk-L3NEJ4N5-D6BHbKty.js} +1 -1
  240. package/dist/domains/dashboard/web/assets/{chunk-OSK3NFVY-RbbxGqtJ.js → chunk-OSK3NFVY-CCz1v1Nv.js} +1 -1
  241. package/dist/domains/dashboard/web/assets/{chunk-P2QGCYS3-B9_X57eT.js → chunk-P2QGCYS3-C1_7kDYS.js} +1 -1
  242. package/dist/domains/dashboard/web/assets/{chunk-POPQ4Y6H-DE4bOH0D.js → chunk-POPQ4Y6H-buFKlAdG.js} +1 -1
  243. package/dist/domains/dashboard/web/assets/{chunk-PWAF6VOD-Bo-W1iA1.js → chunk-PWAF6VOD-B_K6Jrsv.js} +1 -1
  244. package/dist/domains/dashboard/web/assets/{chunk-SHT3W25Y-BhLxs4rZ.js → chunk-SHT3W25Y-CRRLsXmS.js} +1 -1
  245. package/dist/domains/dashboard/web/assets/{chunk-SVP7TREG-BCXfn8uF.js → chunk-SVP7TREG-Q5zCQTul.js} +1 -1
  246. package/dist/domains/dashboard/web/assets/{chunk-TICWLB2K-DqSBgE5L.js → chunk-TICWLB2K-Zc5XaO5Z.js} +1 -1
  247. package/dist/domains/dashboard/web/assets/{chunk-XXDRQBXY-Dbkt1xEZ.js → chunk-XXDRQBXY-BAIB2h_r.js} +1 -1
  248. package/dist/domains/dashboard/web/assets/classDiagram-ZZMXUADV-DzpQhyL3.js +1 -0
  249. package/dist/domains/dashboard/web/assets/classDiagram-v2-VYDZK3BY-DzpQhyL3.js +1 -0
  250. package/dist/domains/dashboard/web/assets/{cose-bilkent-JH36ORCC-DrwNpMyX.js → cose-bilkent-JH36ORCC-C7jkFYhm.js} +1 -1
  251. package/dist/domains/dashboard/web/assets/{cynefin-OW5HDTMX-BbDlivxs.js → cynefin-OW5HDTMX-4yS-l7kx.js} +1 -1
  252. package/dist/domains/dashboard/web/assets/{cynefinDiagram-5FMLGOSQ-DmLmRN42.js → cynefinDiagram-5FMLGOSQ-DAkfQ8jW.js} +1 -1
  253. package/dist/domains/dashboard/web/assets/{dagre-GXQ25YYZ-Cgm5DNgI.js → dagre-GXQ25YYZ-D3b16ruz.js} +1 -1
  254. package/dist/domains/dashboard/web/assets/{diagram-S7CK7UJ4-Bnht1X2m.js → diagram-S7CK7UJ4-BXZHtdNz.js} +1 -1
  255. package/dist/domains/dashboard/web/assets/{diagram-UQ7AKVKN-LELTI4PR.js → diagram-UQ7AKVKN-B4nIzofw.js} +1 -1
  256. package/dist/domains/dashboard/web/assets/{diagram-VSXAHHWV-Do0fZuNG.js → diagram-VSXAHHWV-B6d7KNj1.js} +1 -1
  257. package/dist/domains/dashboard/web/assets/{diagram-VX7I27RA-B0rZTUwt.js → diagram-VX7I27RA-CHr0Rg8a.js} +1 -1
  258. package/dist/domains/dashboard/web/assets/{diagram-Z3DM3KII-wn8xCc_j.js → diagram-Z3DM3KII-BO2IxR9N.js} +1 -1
  259. package/dist/domains/dashboard/web/assets/{dist-CYwDKy2m.js → dist-0wyW4qbm.js} +1 -1
  260. package/dist/domains/dashboard/web/assets/{ebnfDiagram-PWID7BFC-CMDOpP2T.js → ebnfDiagram-PWID7BFC-CHRK8Hyg.js} +1 -1
  261. package/dist/domains/dashboard/web/assets/{erDiagram-RLTQ6QDP-C2d43bdq.js → erDiagram-RLTQ6QDP-_HFHzZlc.js} +1 -1
  262. package/dist/domains/dashboard/web/assets/{es-BzaOcXwu.js → es-kjndkyYX.js} +1 -1
  263. package/dist/domains/dashboard/web/assets/eventmodeling-NTZA5JFV-CG-cVTEg.js +1 -0
  264. package/dist/domains/dashboard/web/assets/flowDiagram-HODETNUW-C3RaJz-z.js +1 -0
  265. package/dist/domains/dashboard/web/assets/{ganttDiagram-EL5Y4UJY-hTH7TzhY.js → ganttDiagram-EL5Y4UJY-CxhSw1PI.js} +1 -1
  266. package/dist/domains/dashboard/web/assets/{gitGraph-4MIJSDKK-C3CCywb-.js → gitGraph-4MIJSDKK-Cbw-3Dnk.js} +1 -1
  267. package/dist/domains/dashboard/web/assets/{gitGraphDiagram-WWUBYQGX-DW6jDckj.js → gitGraphDiagram-WWUBYQGX-Cx93hwtL.js} +1 -1
  268. package/dist/domains/dashboard/web/assets/{index-CTZPz_mx.js → index-CQb8j5OE.js} +3 -3
  269. package/dist/domains/dashboard/web/assets/{index-CWNqBYyI.css → index-Gaxnq6Jd.css} +1 -1
  270. package/dist/domains/dashboard/web/assets/{info-A6RAGUB7-Bg3eKis8.js → info-A6RAGUB7--d4EMiIK.js} +1 -1
  271. package/dist/domains/dashboard/web/assets/{infoDiagram-27XIBGKW-7zk6ytVJ.js → infoDiagram-27XIBGKW-DMkRRNGB.js} +1 -1
  272. package/dist/domains/dashboard/web/assets/{ishikawaDiagram-5VMMS53U-CGDCTmCQ.js → ishikawaDiagram-5VMMS53U-CjKh_jHT.js} +1 -1
  273. package/dist/domains/dashboard/web/assets/{journeyDiagram-3NMN7TZE-C8_L_e8a.js → journeyDiagram-3NMN7TZE-CG735M_M.js} +1 -1
  274. package/dist/domains/dashboard/web/assets/{kanban-definition-UXKFOSKX-D5x6qTgM.js → kanban-definition-UXKFOSKX-CgXFmhFM.js} +1 -1
  275. package/dist/domains/dashboard/web/assets/{line-DC93oja4.js → line-Bhf8l3gG.js} +1 -1
  276. package/dist/domains/dashboard/web/assets/{linear-81TNubkB.js → linear-YWT9mnmu.js} +1 -1
  277. package/dist/domains/dashboard/web/assets/{mermaid-parser.core-D60d8uy9.js → mermaid-parser.core-COzQ1kq0.js} +3 -3
  278. package/dist/domains/dashboard/web/assets/{mermaid.core-l4Wgjz2Q.js → mermaid.core-Cc1lMpx-.js} +4 -4
  279. package/dist/domains/dashboard/web/assets/{mindmap-definition-YA3MSWOX-Dfqu1201.js → mindmap-definition-YA3MSWOX-B_VOgUSO.js} +1 -1
  280. package/dist/domains/dashboard/web/assets/{packet-AYTQ26CC-CsFZBhTs.js → packet-AYTQ26CC-CXbJLNC9.js} +1 -1
  281. package/dist/domains/dashboard/web/assets/{pegDiagram-XKGWAZYB-myFMaA7n.js → pegDiagram-XKGWAZYB-BuS0hioo.js} +1 -1
  282. package/dist/domains/dashboard/web/assets/{pie-WAS4IAKB-FMuCTNSk.js → pie-WAS4IAKB-BEaGwdWZ.js} +1 -1
  283. package/dist/domains/dashboard/web/assets/{pieDiagram-E7YTZNPT-CSR4B4Z1.js → pieDiagram-E7YTZNPT-DDzYv-_9.js} +1 -1
  284. package/dist/domains/dashboard/web/assets/purify.es-Bvo9QlJ8.js +3 -0
  285. package/dist/domains/dashboard/web/assets/{quadrantDiagram-AXDQQJYC-BiE4kEeP.js → quadrantDiagram-AXDQQJYC-DExT--Ut.js} +1 -1
  286. package/dist/domains/dashboard/web/assets/{radar-RG4KPBEZ-BZ-n7JtG.js → radar-RG4KPBEZ-C1JtzGr8.js} +1 -1
  287. package/dist/domains/dashboard/web/assets/{railroad-74A4TZTK-CWVtRfHu.js → railroad-74A4TZTK-CMpkXATR.js} +1 -1
  288. package/dist/domains/dashboard/web/assets/railroad-abnf-HS5TGJTU-BM35gYWg.js +1 -0
  289. package/dist/domains/dashboard/web/assets/railroad-ebnf-LZEXJU2U-CN60GGp0.js +1 -0
  290. package/dist/domains/dashboard/web/assets/railroad-peg-WCYAUIDC-DRUSW4g7.js +1 -0
  291. package/dist/domains/dashboard/web/assets/{railroadDiagram-O6MQD6OU-CBj7v1de.js → railroadDiagram-O6MQD6OU-BCE65sLR.js} +1 -1
  292. package/dist/domains/dashboard/web/assets/{requirementDiagram-BXWQKSXE-DSDgb54n.js → requirementDiagram-BXWQKSXE-CmyX3vGG.js} +1 -1
  293. package/dist/domains/dashboard/web/assets/{sankeyDiagram-P5KCCOFB-1-oXLUAP.js → sankeyDiagram-P5KCCOFB-BFKrX2dv.js} +1 -1
  294. package/dist/domains/dashboard/web/assets/{sequenceDiagram-WJ2MYXX4-DAF4nGs_.js → sequenceDiagram-WJ2MYXX4-DqodS9W-.js} +1 -1
  295. package/dist/domains/dashboard/web/assets/{src-CTWLVUqE.js → src-BVUP3QzK.js} +1 -1
  296. package/dist/domains/dashboard/web/assets/{stateDiagram-D77RDMKH-DzENBaJT.js → stateDiagram-D77RDMKH-nHai_EZh.js} +1 -1
  297. package/dist/domains/dashboard/web/assets/stateDiagram-v2-MP3YSRHH-BL6vE1m9.js +1 -0
  298. package/dist/domains/dashboard/web/assets/{swimlanes-42K2YHIH-CnxFUZJc.js → swimlanes-42K2YHIH-BODBARYN.js} +1 -1
  299. package/dist/domains/dashboard/web/assets/swimlanesDiagram-VR7AAH4N-XHK_nuTj.js +8 -0
  300. package/dist/domains/dashboard/web/assets/{timeline-definition-24CTP7MA-KtvPzpZM.js → timeline-definition-24CTP7MA-RVnG8rgK.js} +1 -1
  301. package/dist/domains/dashboard/web/assets/{treeView-Q6P3EWNA-Bdu3P9iY.js → treeView-Q6P3EWNA-B6lrg3KQ.js} +1 -1
  302. package/dist/domains/dashboard/web/assets/{treemap-WGGIJYW6-DFnn23JR.js → treemap-WGGIJYW6-CJfMKVf4.js} +1 -1
  303. package/dist/domains/dashboard/web/assets/{vennDiagram-4TSXK5OY-BjpviP26.js → vennDiagram-4TSXK5OY-CZMWJiN7.js} +1 -1
  304. package/dist/domains/dashboard/web/assets/{wardley-WFR3VGLG-CEo4a-j4.js → wardley-WFR3VGLG-BoUsbNlx.js} +1 -1
  305. package/dist/domains/dashboard/web/assets/{wardleyDiagram-VM6X3IG4-Bf54n6im.js → wardleyDiagram-VM6X3IG4-BwBCykVb.js} +1 -1
  306. package/dist/domains/dashboard/web/assets/{xychartDiagram-S5SC5T6Z-CU-hI0Cm.js → xychartDiagram-S5SC5T6Z-vutnbx57.js} +1 -1
  307. package/dist/domains/dashboard/web/index.html +2 -2
  308. package/dist/domains/project-knowledge/corpus.d.ts +5 -0
  309. package/dist/domains/project-knowledge/corpus.d.ts.map +1 -1
  310. package/dist/domains/project-knowledge/corpus.js +34 -9
  311. package/dist/domains/project-knowledge/corpus.js.map +1 -1
  312. package/dist/domains/project-knowledge/index-store.d.ts +5 -2
  313. package/dist/domains/project-knowledge/index-store.d.ts.map +1 -1
  314. package/dist/domains/project-knowledge/index-store.js +95 -52
  315. package/dist/domains/project-knowledge/index-store.js.map +1 -1
  316. package/dist/domains/project-knowledge/local-provider.d.ts.map +1 -1
  317. package/dist/domains/project-knowledge/local-provider.js +14 -3
  318. package/dist/domains/project-knowledge/local-provider.js.map +1 -1
  319. package/dist/domains/project-knowledge/local-store.d.ts +2 -2
  320. package/dist/domains/project-knowledge/local-store.d.ts.map +1 -1
  321. package/dist/domains/project-knowledge/local-store.js +2 -2
  322. package/dist/domains/project-knowledge/local-store.js.map +1 -1
  323. package/dist/domains/project-knowledge/plugin.d.ts.map +1 -1
  324. package/dist/domains/project-knowledge/plugin.js +5 -4
  325. package/dist/domains/project-knowledge/plugin.js.map +1 -1
  326. package/dist/domains/project-knowledge/provider-factory.d.ts.map +1 -1
  327. package/dist/domains/project-knowledge/provider-factory.js +7 -5
  328. package/dist/domains/project-knowledge/provider-factory.js.map +1 -1
  329. package/dist/domains/project-knowledge/types.d.ts +1 -0
  330. package/dist/domains/project-knowledge/types.d.ts.map +1 -1
  331. package/dist/domains/skill/platform-install.d.ts.map +1 -1
  332. package/dist/domains/skill/platform-install.js +31 -3
  333. package/dist/domains/skill/platform-install.js.map +1 -1
  334. package/dist/domains/workflow-contract/hook-target-scope.d.ts.map +1 -1
  335. package/dist/domains/workflow-contract/hook-target-scope.js +2 -1
  336. package/dist/domains/workflow-contract/hook-target-scope.js.map +1 -1
  337. package/dist/platform/paths/git-worktree-cache.d.ts +3 -0
  338. package/dist/platform/paths/git-worktree-cache.d.ts.map +1 -0
  339. package/dist/platform/paths/git-worktree-cache.js +109 -0
  340. package/dist/platform/paths/git-worktree-cache.js.map +1 -0
  341. package/dist/platform/paths/git-worktree.d.ts +6 -0
  342. package/dist/platform/paths/git-worktree.d.ts.map +1 -1
  343. package/dist/platform/paths/git-worktree.js +191 -30
  344. package/dist/platform/paths/git-worktree.js.map +1 -1
  345. package/dist/platform/process/comet-daemon.d.ts +3 -0
  346. package/dist/platform/process/comet-daemon.d.ts.map +1 -1
  347. package/dist/platform/process/comet-daemon.js +9 -6
  348. package/dist/platform/process/comet-daemon.js.map +1 -1
  349. package/dist/platform/process/external-command.d.ts +3 -0
  350. package/dist/platform/process/external-command.d.ts.map +1 -1
  351. package/dist/platform/process/external-command.js +69 -2
  352. package/dist/platform/process/external-command.js.map +1 -1
  353. package/dist/platform/process/git.d.ts.map +1 -1
  354. package/dist/platform/process/git.js +3 -4
  355. package/dist/platform/process/git.js.map +1 -1
  356. package/dist/platform/process/hook-adapter.d.ts +2 -0
  357. package/dist/platform/process/hook-adapter.d.ts.map +1 -1
  358. package/dist/platform/process/hook-adapter.js +32 -3
  359. package/dist/platform/process/hook-adapter.js.map +1 -1
  360. package/dist/platform/process/hook-read-cache.d.ts +2 -0
  361. package/dist/platform/process/hook-read-cache.d.ts.map +1 -1
  362. package/dist/platform/process/hook-read-cache.js +25 -13
  363. package/dist/platform/process/hook-read-cache.js.map +1 -1
  364. package/dist/platform/process/process-identity.d.ts.map +1 -1
  365. package/dist/platform/process/process-identity.js +18 -51
  366. package/dist/platform/process/process-identity.js.map +1 -1
  367. package/dist/platform/process/runtime-metrics.d.ts +10 -1
  368. package/dist/platform/process/runtime-metrics.d.ts.map +1 -1
  369. package/dist/platform/process/runtime-metrics.js +37 -2
  370. package/dist/platform/process/runtime-metrics.js.map +1 -1
  371. package/dist/platform/process/windows-process-broker.d.ts +13 -0
  372. package/dist/platform/process/windows-process-broker.d.ts.map +1 -0
  373. package/dist/platform/process/windows-process-broker.js +150 -0
  374. package/dist/platform/process/windows-process-broker.js.map +1 -0
  375. package/dist/platform/process/windows-process-identity.d.ts +6 -0
  376. package/dist/platform/process/windows-process-identity.d.ts.map +1 -0
  377. package/dist/platform/process/windows-process-identity.js +190 -0
  378. package/dist/platform/process/windows-process-identity.js.map +1 -0
  379. package/package.json +1 -1
  380. package/dist/domains/dashboard/web/assets/architecture-7GRP2DOG-QeljAKq2.js +0 -1
  381. package/dist/domains/dashboard/web/assets/channel-_AqwP0KA.js +0 -1
  382. package/dist/domains/dashboard/web/assets/classDiagram-ZZMXUADV-CRo4aB_7.js +0 -1
  383. package/dist/domains/dashboard/web/assets/classDiagram-v2-VYDZK3BY-CRo4aB_7.js +0 -1
  384. package/dist/domains/dashboard/web/assets/eventmodeling-NTZA5JFV-KYANo3DQ.js +0 -1
  385. package/dist/domains/dashboard/web/assets/flowDiagram-HODETNUW-CSROlLuj.js +0 -1
  386. package/dist/domains/dashboard/web/assets/purify.es-ChwZkWde.js +0 -3
  387. package/dist/domains/dashboard/web/assets/railroad-abnf-HS5TGJTU-CkHwwI2i.js +0 -1
  388. package/dist/domains/dashboard/web/assets/railroad-ebnf-LZEXJU2U-8xzEHL6v.js +0 -1
  389. package/dist/domains/dashboard/web/assets/railroad-peg-WCYAUIDC-nSHBw0tH.js +0 -1
  390. package/dist/domains/dashboard/web/assets/stateDiagram-v2-MP3YSRHH-CNw52Fkn.js +0 -1
  391. package/dist/domains/dashboard/web/assets/swimlanesDiagram-VR7AAH4N-6TRvbqqI.js +0 -8
@@ -1,148 +1,148 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __cometCreateRequire } from 'module';
3
3
  const require = __cometCreateRequire(import.meta.url);
4
- var Bd=Object.create;var fs=Object.defineProperty;var Fd=Object.getOwnPropertyDescriptor;var Md=Object.getOwnPropertyNames;var Vd=Object.getPrototypeOf,qd=Object.prototype.hasOwnProperty;var Jr=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var b=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(i){throw r=[i],i}};var v=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var Wd=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Md(e))!qd.call(t,n)&&n!==r&&fs(t,n,{get:()=>e[n],enumerable:!(i=Fd(e,n))||i.enumerable});return t};var Pe=(t,e,r)=>(r=t!=null?Bd(Vd(t)):{},Wd(e||!t||!t.__esModule?fs(r,"default",{value:t,enumerable:!0}):r,t));var P=v(M=>{"use strict";var Hn=Symbol.for("yaml.alias"),ps=Symbol.for("yaml.document"),Ur=Symbol.for("yaml.map"),hs=Symbol.for("yaml.pair"),Dn=Symbol.for("yaml.scalar"),Kr=Symbol.for("yaml.seq"),he=Symbol.for("yaml.node.type"),zd=t=>!!t&&typeof t=="object"&&t[he]===Hn,Gd=t=>!!t&&typeof t=="object"&&t[he]===ps,Jd=t=>!!t&&typeof t=="object"&&t[he]===Ur,Ud=t=>!!t&&typeof t=="object"&&t[he]===hs,ms=t=>!!t&&typeof t=="object"&&t[he]===Dn,Kd=t=>!!t&&typeof t=="object"&&t[he]===Kr;function vs(t){if(t&&typeof t=="object")switch(t[he]){case Ur:case Kr:return!0}return!1}function Yd(t){if(t&&typeof t=="object")switch(t[he]){case Hn:case Ur:case Dn:case Kr:return!0}return!1}var Xd=t=>(ms(t)||vs(t))&&!!t.anchor;M.ALIAS=Hn;M.DOC=ps;M.MAP=Ur;M.NODE_TYPE=he;M.PAIR=hs;M.SCALAR=Dn;M.SEQ=Kr;M.hasAnchor=Xd;M.isAlias=zd;M.isCollection=vs;M.isDocument=Gd;M.isMap=Jd;M.isNode=Yd;M.isPair=Ud;M.isScalar=ms;M.isSeq=Kd});var Lt=v(Ln=>{"use strict";var H=P(),G=Symbol("break visit"),gs=Symbol("skip children"),ce=Symbol("remove node");function Yr(t,e){let r=ws(e);H.isDocument(t)?ut(null,t.contents,r,Object.freeze([t]))===ce&&(t.contents=null):ut(null,t,r,Object.freeze([]))}Yr.BREAK=G;Yr.SKIP=gs;Yr.REMOVE=ce;function ut(t,e,r,i){let n=ys(t,e,r,i);if(H.isNode(n)||H.isPair(n))return Ns(t,i,n),ut(t,n,r,i);if(typeof n!="symbol"){if(H.isCollection(e)){i=Object.freeze(i.concat(e));for(let a=0;a<e.items.length;++a){let o=ut(a,e.items[a],r,i);if(typeof o=="number")a=o-1;else{if(o===G)return G;o===ce&&(e.items.splice(a,1),a-=1)}}}else if(H.isPair(e)){i=Object.freeze(i.concat(e));let a=ut("key",e.key,r,i);if(a===G)return G;a===ce&&(e.key=null);let o=ut("value",e.value,r,i);if(o===G)return G;o===ce&&(e.value=null)}}return n}async function Xr(t,e){let r=ws(e);H.isDocument(t)?await dt(null,t.contents,r,Object.freeze([t]))===ce&&(t.contents=null):await dt(null,t,r,Object.freeze([]))}Xr.BREAK=G;Xr.SKIP=gs;Xr.REMOVE=ce;async function dt(t,e,r,i){let n=await ys(t,e,r,i);if(H.isNode(n)||H.isPair(n))return Ns(t,i,n),dt(t,n,r,i);if(typeof n!="symbol"){if(H.isCollection(e)){i=Object.freeze(i.concat(e));for(let a=0;a<e.items.length;++a){let o=await dt(a,e.items[a],r,i);if(typeof o=="number")a=o-1;else{if(o===G)return G;o===ce&&(e.items.splice(a,1),a-=1)}}}else if(H.isPair(e)){i=Object.freeze(i.concat(e));let a=await dt("key",e.key,r,i);if(a===G)return G;a===ce&&(e.key=null);let o=await dt("value",e.value,r,i);if(o===G)return G;o===ce&&(e.value=null)}}return n}function ws(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function ys(t,e,r,i){if(typeof r=="function")return r(t,e,i);if(H.isMap(e))return r.Map?.(t,e,i);if(H.isSeq(e))return r.Seq?.(t,e,i);if(H.isPair(e))return r.Pair?.(t,e,i);if(H.isScalar(e))return r.Scalar?.(t,e,i);if(H.isAlias(e))return r.Alias?.(t,e,i)}function Ns(t,e,r){let i=e[e.length-1];if(H.isCollection(i))i.items[t]=r;else if(H.isPair(i))t==="key"?i.key=r:i.value=r;else if(H.isDocument(i))i.contents=r;else{let n=H.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}Ln.visit=Yr;Ln.visitAsync=Xr});var Bn=v(ks=>{"use strict";var bs=P(),Qd=Lt(),Zd={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ef=t=>t.replace(/[!,[\]{}]/g,e=>Zd[e]),Bt=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[a,o]=i;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[a]=i;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{let o=/^\d+\.\d+$/.test(a);return r(6,`Unsupported YAML version ${a}`,o),!1}}default:return r(0,`Unknown directive ${n}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||r(`The ${e} tag has no suffix`);let a=this.tags[i];if(a)try{return a+decodeURIComponent(n)}catch(o){return r(String(o)),null}return i==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,i]of Object.entries(this.tags))if(e.startsWith(i))return r+ef(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&bs.isNode(e.contents)){let a={};Qd.visit(e.contents,(o,s)=>{bs.isNode(s)&&s.tag&&(a[s.tag]=!0)}),n=Object.keys(a)}else n=[];for(let[a,o]of i)a==="!!"&&o==="tag:yaml.org,2002:"||(!e||n.some(s=>s.startsWith(o)))&&r.push(`%TAG ${a} ${o}`);return r.join(`
5
- `)}};Bt.defaultYaml={explicit:!1,version:"1.2"};Bt.defaultTags={"!!":"tag:yaml.org,2002:"};ks.Directives=Bt});var Qr=v(Ft=>{"use strict";var Ss=P(),tf=Lt();function rf(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function Es(t){let e=new Set;return tf.visit(t,{Value(r,i){i.anchor&&e.add(i.anchor)}}),e}function xs(t,e){for(let r=1;;++r){let i=`${t}${r}`;if(!e.has(i))return i}}function nf(t,e){let r=[],i=new Map,n=null;return{onAnchor:a=>{r.push(a),n??(n=Es(t));let o=xs(e,n);return n.add(o),o},setAnchors:()=>{for(let a of r){let o=i.get(a);if(typeof o=="object"&&o.anchor&&(Ss.isScalar(o.node)||Ss.isCollection(o.node)))o.node.anchor=o.anchor;else{let s=new Error("Failed to resolve repeated object (this should not happen)");throw s.source=a,s}}},sourceObjects:i}}Ft.anchorIsValid=rf;Ft.anchorNames=Es;Ft.createNodeAnchors=nf;Ft.findNewAnchor=xs});var Fn=v(Cs=>{"use strict";function Mt(t,e,r,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,a=i.length;n<a;++n){let o=i[n],s=Mt(t,i,String(n),o);s===void 0?delete i[n]:s!==o&&(i[n]=s)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let a=i.get(n),o=Mt(t,i,n,a);o===void 0?i.delete(n):o!==a&&i.set(n,o)}else if(i instanceof Set)for(let n of Array.from(i)){let a=Mt(t,i,n,n);a===void 0?i.delete(n):a!==n&&(i.delete(n),i.add(a))}else for(let[n,a]of Object.entries(i)){let o=Mt(t,i,n,a);o===void 0?delete i[n]:o!==a&&(i[n]=o)}return t.call(e,r,i)}Cs.applyReviver=Mt});var Re=v(Rs=>{"use strict";var af=P();function Ps(t,e,r){if(Array.isArray(t))return t.map((i,n)=>Ps(i,String(n),r));if(t&&typeof t.toJSON=="function"){if(!r||!af.hasAnchor(t))return t.toJSON(e,r);let i={aliasCount:0,count:1,res:void 0};r.anchors.set(t,i),r.onCreate=a=>{i.res=a,delete r.onCreate};let n=t.toJSON(e,r);return r.onCreate&&r.onCreate(n),n}return typeof t=="bigint"&&!r?.keep?Number(t):t}Rs.toJS=Ps});var Zr=v(As=>{"use strict";var of=Fn(),_s=P(),sf=Re(),Mn=class{constructor(e){Object.defineProperty(this,_s.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:i,onAnchor:n,reviver:a}={}){if(!_s.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},s=sf.toJS(this,"",o);if(typeof n=="function")for(let{count:c,res:l}of o.anchors.values())n(l,c);return typeof a=="function"?of.applyReviver(a,{"":s},"",s):s}};As.NodeBase=Mn});var Vt=v(Is=>{"use strict";var cf=Qr(),lf=Lt(),ft=P(),uf=Zr(),df=Re(),Vn=class extends uf.NodeBase{constructor(e){super(ft.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;r?.aliasResolveCache?i=r.aliasResolveCache:(i=[],lf.visit(e,{Node:(a,o)=>{(ft.isAlias(o)||ft.hasAnchor(o))&&i.push(o)}}),r&&(r.aliasResolveCache=i));let n;for(let a of i){if(a===this)break;a.anchor===this.source&&(n=a)}return n}toJSON(e,r){if(!r)return{source:this.source};let{anchors:i,doc:n,maxAliasCount:a}=r,o=this.resolve(n,r);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let s=i.get(o);if(s||(df.toJS(o,null,r),s=i.get(o)),s?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=ei(n,o,i)),s.count*s.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return s.res}toString(e,r,i){let n=`*${this.source}`;if(e){if(cf.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(e.implicitKey)return`${n} `}return n}};function ei(t,e,r){if(ft.isAlias(e)){let i=e.resolve(t),n=r&&i&&r.get(i);return n?n.count*n.aliasCount:0}else if(ft.isCollection(e)){let i=0;for(let n of e.items){let a=ei(t,n,r);a>i&&(i=a)}return i}else if(ft.isPair(e)){let i=ei(t,e.key,r),n=ei(t,e.value,r);return Math.max(i,n)}return 1}Is.Alias=Vn});var $=v(qn=>{"use strict";var ff=P(),pf=Zr(),hf=Re(),mf=t=>!t||typeof t!="function"&&typeof t!="object",_e=class extends pf.NodeBase{constructor(e){super(ff.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:hf.toJS(this.value,e,r)}toString(){return String(this.value)}};_e.BLOCK_FOLDED="BLOCK_FOLDED";_e.BLOCK_LITERAL="BLOCK_LITERAL";_e.PLAIN="PLAIN";_e.QUOTE_DOUBLE="QUOTE_DOUBLE";_e.QUOTE_SINGLE="QUOTE_SINGLE";qn.Scalar=_e;qn.isScalarValue=mf});var qt=v($s=>{"use strict";var vf=Vt(),Ke=P(),Ts=$(),gf="tag:yaml.org,2002:";function wf(t,e,r){if(e){let i=r.filter(a=>a.tag===e),n=i.find(a=>!a.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return r.find(i=>i.identify?.(t)&&!i.format)}function yf(t,e,r){if(Ke.isDocument(t)&&(t=t.contents),Ke.isNode(t))return t;if(Ke.isPair(t)){let u=r.schema[Ke.MAP].createNode?.(r.schema,null,r);return u.items.push(t),u}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:n,onTagObj:a,schema:o,sourceObjects:s}=r,c;if(i&&t&&typeof t=="object"){if(c=s.get(t),c)return c.anchor??(c.anchor=n(t)),new vf.Alias(c.anchor);c={anchor:null,node:null},s.set(t,c)}e?.startsWith("!!")&&(e=gf+e.slice(2));let l=wf(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new Ts.Scalar(t);return c&&(c.node=u),u}l=t instanceof Map?o[Ke.MAP]:Symbol.iterator in Object(t)?o[Ke.SEQ]:o[Ke.MAP]}a&&(a(l),delete r.onTagObj);let d=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new Ts.Scalar(t);return e?d.tag=e:l.default||(d.tag=l.tag),c&&(c.node=d),d}$s.createNode=yf});var ri=v(ti=>{"use strict";var Nf=qt(),le=P(),bf=Zr();function Wn(t,e,r){let i=r;for(let n=e.length-1;n>=0;--n){let a=e[n];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){let o=[];o[a]=i,i=o}else i=new Map([[a,i]])}return Nf.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var js=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,zn=class extends bf.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(i=>le.isNode(i)||le.isPair(i)?i.clone(e):i),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(js(e))this.add(r);else{let[i,...n]=e,a=this.get(i,!0);if(le.isCollection(a))a.addIn(n,r);else if(a===void 0&&this.schema)this.set(i,Wn(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[r,...i]=e;if(i.length===0)return this.delete(r);let n=this.get(r,!0);if(le.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}getIn(e,r){let[i,...n]=e,a=this.get(i,!0);return n.length===0?!r&&le.isScalar(a)?a.value:a:le.isCollection(a)?a.getIn(n,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!le.isPair(r))return!1;let i=r.value;return i==null||e&&le.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[r,...i]=e;if(i.length===0)return this.has(r);let n=this.get(r,!0);return le.isCollection(n)?n.hasIn(i):!1}setIn(e,r){let[i,...n]=e;if(n.length===0)this.set(i,r);else{let a=this.get(i,!0);if(le.isCollection(a))a.setIn(n,r);else if(a===void 0&&this.schema)this.set(i,Wn(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};ti.Collection=zn;ti.collectionFromPath=Wn;ti.isEmptyPath=js});var Wt=v(ii=>{"use strict";var kf=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Gn(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var Sf=(t,e,r)=>t.endsWith(`
6
- `)?Gn(r,e):r.includes(`
4
+ var Yf=Object.create;var Zs=Object.defineProperty;var Xf=Object.getOwnPropertyDescriptor;var Qf=Object.getOwnPropertyNames;var Zf=Object.getPrototypeOf,ep=Object.prototype.hasOwnProperty;var gi=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var b=(t,e,r)=>()=>{if(r)throw r[0];try{return t&&(e=t(t=0)),e}catch(i){throw r=[i],i}};var g=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var tp=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Qf(e))!ep.call(t,n)&&n!==r&&Zs(t,n,{get:()=>e[n],enumerable:!(i=Xf(e,n))||i.enumerable});return t};var Oe=(t,e,r)=>(r=t!=null?Yf(Zf(t)):{},tp(e||!t||!t.__esModule?Zs(r,"default",{value:t,enumerable:!0}):r,t));var R=g(q=>{"use strict";var ma=Symbol.for("yaml.alias"),ec=Symbol.for("yaml.document"),wi=Symbol.for("yaml.map"),tc=Symbol.for("yaml.pair"),va=Symbol.for("yaml.scalar"),yi=Symbol.for("yaml.seq"),be=Symbol.for("yaml.node.type"),rp=t=>!!t&&typeof t=="object"&&t[be]===ma,ip=t=>!!t&&typeof t=="object"&&t[be]===ec,np=t=>!!t&&typeof t=="object"&&t[be]===wi,ap=t=>!!t&&typeof t=="object"&&t[be]===tc,rc=t=>!!t&&typeof t=="object"&&t[be]===va,op=t=>!!t&&typeof t=="object"&&t[be]===yi;function ic(t){if(t&&typeof t=="object")switch(t[be]){case wi:case yi:return!0}return!1}function sp(t){if(t&&typeof t=="object")switch(t[be]){case ma:case wi:case va:case yi:return!0}return!1}var cp=t=>(rc(t)||ic(t))&&!!t.anchor;q.ALIAS=ma;q.DOC=ec;q.MAP=wi;q.NODE_TYPE=be;q.PAIR=tc;q.SCALAR=va;q.SEQ=yi;q.hasAnchor=cp;q.isAlias=rp;q.isCollection=ic;q.isDocument=ip;q.isMap=np;q.isNode=sp;q.isPair=ap;q.isScalar=rc;q.isSeq=op});var tr=g(ga=>{"use strict";var L=R(),K=Symbol("break visit"),nc=Symbol("skip children"),pe=Symbol("remove node");function Ni(t,e){let r=ac(e);L.isDocument(t)?St(null,t.contents,r,Object.freeze([t]))===pe&&(t.contents=null):St(null,t,r,Object.freeze([]))}Ni.BREAK=K;Ni.SKIP=nc;Ni.REMOVE=pe;function St(t,e,r,i){let n=oc(t,e,r,i);if(L.isNode(n)||L.isPair(n))return sc(t,i,n),St(t,n,r,i);if(typeof n!="symbol"){if(L.isCollection(e)){i=Object.freeze(i.concat(e));for(let a=0;a<e.items.length;++a){let o=St(a,e.items[a],r,i);if(typeof o=="number")a=o-1;else{if(o===K)return K;o===pe&&(e.items.splice(a,1),a-=1)}}}else if(L.isPair(e)){i=Object.freeze(i.concat(e));let a=St("key",e.key,r,i);if(a===K)return K;a===pe&&(e.key=null);let o=St("value",e.value,r,i);if(o===K)return K;o===pe&&(e.value=null)}}return n}async function bi(t,e){let r=ac(e);L.isDocument(t)?await Et(null,t.contents,r,Object.freeze([t]))===pe&&(t.contents=null):await Et(null,t,r,Object.freeze([]))}bi.BREAK=K;bi.SKIP=nc;bi.REMOVE=pe;async function Et(t,e,r,i){let n=await oc(t,e,r,i);if(L.isNode(n)||L.isPair(n))return sc(t,i,n),Et(t,n,r,i);if(typeof n!="symbol"){if(L.isCollection(e)){i=Object.freeze(i.concat(e));for(let a=0;a<e.items.length;++a){let o=await Et(a,e.items[a],r,i);if(typeof o=="number")a=o-1;else{if(o===K)return K;o===pe&&(e.items.splice(a,1),a-=1)}}}else if(L.isPair(e)){i=Object.freeze(i.concat(e));let a=await Et("key",e.key,r,i);if(a===K)return K;a===pe&&(e.key=null);let o=await Et("value",e.value,r,i);if(o===K)return K;o===pe&&(e.value=null)}}return n}function ac(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function oc(t,e,r,i){if(typeof r=="function")return r(t,e,i);if(L.isMap(e))return r.Map?.(t,e,i);if(L.isSeq(e))return r.Seq?.(t,e,i);if(L.isPair(e))return r.Pair?.(t,e,i);if(L.isScalar(e))return r.Scalar?.(t,e,i);if(L.isAlias(e))return r.Alias?.(t,e,i)}function sc(t,e,r){let i=e[e.length-1];if(L.isCollection(i))i.items[t]=r;else if(L.isPair(i))t==="key"?i.key=r:i.value=r;else if(L.isDocument(i))i.contents=r;else{let n=L.isAlias(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${n} parent`)}}ga.visit=Ni;ga.visitAsync=bi});var wa=g(lc=>{"use strict";var cc=R(),lp=tr(),up={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},dp=t=>t.replace(/[!,[\]{}]/g,e=>up[e]),rr=class t{constructor(e,r){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,r)}clone(){let e=new t(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},t.defaultTags);break}return e}add(e,r){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let i=e.trim().split(/[ \t]+/),n=i.shift();switch(n){case"%TAG":{if(i.length!==2&&(r(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;let[a,o]=i;return this.tags[a]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return r(0,"%YAML directive should contain exactly one part"),!1;let[a]=i;if(a==="1.1"||a==="1.2")return this.yaml.version=a,!0;{let o=/^\d+\.\d+$/.test(a);return r(6,`Unsupported YAML version ${a}`,o),!1}}default:return r(0,`Unknown directive ${n}`,!0),!1}}tagName(e,r){if(e==="!")return"!";if(e[0]!=="!")return r(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let o=e.slice(2,-1);return o==="!"||o==="!!"?(r(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&r("Verbatim tags must end with a >"),o)}let[,i,n]=e.match(/^(.*!)([^!]*)$/s);n||r(`The ${e} tag has no suffix`);let a=this.tags[i];if(a)try{return a+decodeURIComponent(n)}catch(o){return r(String(o)),null}return i==="!"?e:(r(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[r,i]of Object.entries(this.tags))if(e.startsWith(i))return r+dp(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags),n;if(e&&i.length>0&&cc.isNode(e.contents)){let a={};lp.visit(e.contents,(o,s)=>{cc.isNode(s)&&s.tag&&(a[s.tag]=!0)}),n=Object.keys(a)}else n=[];for(let[a,o]of i)a==="!!"&&o==="tag:yaml.org,2002:"||(!e||n.some(s=>s.startsWith(o)))&&r.push(`%TAG ${a} ${o}`);return r.join(`
5
+ `)}};rr.defaultYaml={explicit:!1,version:"1.2"};rr.defaultTags={"!!":"tag:yaml.org,2002:"};lc.Directives=rr});var ki=g(ir=>{"use strict";var uc=R(),fp=tr();function pp(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(r)}return!0}function dc(t){let e=new Set;return fp.visit(t,{Value(r,i){i.anchor&&e.add(i.anchor)}}),e}function fc(t,e){for(let r=1;;++r){let i=`${t}${r}`;if(!e.has(i))return i}}function hp(t,e){let r=[],i=new Map,n=null;return{onAnchor:a=>{r.push(a),n??(n=dc(t));let o=fc(e,n);return n.add(o),o},setAnchors:()=>{for(let a of r){let o=i.get(a);if(typeof o=="object"&&o.anchor&&(uc.isScalar(o.node)||uc.isCollection(o.node)))o.node.anchor=o.anchor;else{let s=new Error("Failed to resolve repeated object (this should not happen)");throw s.source=a,s}}},sourceObjects:i}}ir.anchorIsValid=pp;ir.anchorNames=dc;ir.createNodeAnchors=hp;ir.findNewAnchor=fc});var ya=g(pc=>{"use strict";function nr(t,e,r,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let n=0,a=i.length;n<a;++n){let o=i[n],s=nr(t,i,String(n),o);s===void 0?delete i[n]:s!==o&&(i[n]=s)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let a=i.get(n),o=nr(t,i,n,a);o===void 0?i.delete(n):o!==a&&i.set(n,o)}else if(i instanceof Set)for(let n of Array.from(i)){let a=nr(t,i,n,n);a===void 0?i.delete(n):a!==n&&(i.delete(n),i.add(a))}else for(let[n,a]of Object.entries(i)){let o=nr(t,i,n,a);o===void 0?delete i[n]:o!==a&&(i[n]=o)}return t.call(e,r,i)}pc.applyReviver=nr});var He=g(mc=>{"use strict";var mp=R();function hc(t,e,r){if(Array.isArray(t))return t.map((i,n)=>hc(i,String(n),r));if(t&&typeof t.toJSON=="function"){if(!r||!mp.hasAnchor(t))return t.toJSON(e,r);let i={aliasCount:0,count:1,res:void 0};r.anchors.set(t,i),r.onCreate=a=>{i.res=a,delete r.onCreate};let n=t.toJSON(e,r);return r.onCreate&&r.onCreate(n),n}return typeof t=="bigint"&&!r?.keep?Number(t):t}mc.toJS=hc});var Si=g(gc=>{"use strict";var vp=ya(),vc=R(),gp=He(),Na=class{constructor(e){Object.defineProperty(this,vc.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:r,maxAliasCount:i,onAnchor:n,reviver:a}={}){if(!vc.isDocument(e))throw new TypeError("A document argument is required");let o={anchors:new Map,doc:e,keep:!0,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},s=gp.toJS(this,"",o);if(typeof n=="function")for(let{count:c,res:l}of o.anchors.values())n(l,c);return typeof a=="function"?vp.applyReviver(a,{"":s},"",s):s}};gc.NodeBase=Na});var ar=g(wc=>{"use strict";var wp=ki(),yp=tr(),xt=R(),Np=Si(),bp=He(),ba=class extends Np.NodeBase{constructor(e){super(xt.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,r){if(r?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let i;r?.aliasResolveCache?i=r.aliasResolveCache:(i=[],yp.visit(e,{Node:(a,o)=>{(xt.isAlias(o)||xt.hasAnchor(o))&&i.push(o)}}),r&&(r.aliasResolveCache=i));let n;for(let a of i){if(a===this)break;a.anchor===this.source&&(n=a)}return n}toJSON(e,r){if(!r)return{source:this.source};let{anchors:i,doc:n,maxAliasCount:a}=r,o=this.resolve(n,r);if(!o){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let s=i.get(o);if(s||(bp.toJS(o,null,r),s=i.get(o)),s?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(a>=0&&(s.count+=1,s.aliasCount===0&&(s.aliasCount=Ei(n,o,i)),s.count*s.aliasCount>a)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return s.res}toString(e,r,i){let n=`*${this.source}`;if(e){if(wp.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(a)}if(e.implicitKey)return`${n} `}return n}};function Ei(t,e,r){if(xt.isAlias(e)){let i=e.resolve(t),n=r&&i&&r.get(i);return n?n.count*n.aliasCount:0}else if(xt.isCollection(e)){let i=0;for(let n of e.items){let a=Ei(t,n,r);a>i&&(i=a)}return i}else if(xt.isPair(e)){let i=Ei(t,e.key,r),n=Ei(t,e.value,r);return Math.max(i,n)}return 1}wc.Alias=ba});var O=g(ka=>{"use strict";var kp=R(),Sp=Si(),Ep=He(),xp=t=>!t||typeof t!="function"&&typeof t!="object",De=class extends Sp.NodeBase{constructor(e){super(kp.SCALAR),this.value=e}toJSON(e,r){return r?.keep?this.value:Ep.toJS(this.value,e,r)}toString(){return String(this.value)}};De.BLOCK_FOLDED="BLOCK_FOLDED";De.BLOCK_LITERAL="BLOCK_LITERAL";De.PLAIN="PLAIN";De.QUOTE_DOUBLE="QUOTE_DOUBLE";De.QUOTE_SINGLE="QUOTE_SINGLE";ka.Scalar=De;ka.isScalarValue=xp});var or=g(Nc=>{"use strict";var Cp=ar(),it=R(),yc=O(),Pp="tag:yaml.org,2002:";function Rp(t,e,r){if(e){let i=r.filter(a=>a.tag===e),n=i.find(a=>!a.format)??i[0];if(!n)throw new Error(`Tag ${e} not found`);return n}return r.find(i=>i.identify?.(t)&&!i.format)}function _p(t,e,r){if(it.isDocument(t)&&(t=t.contents),it.isNode(t))return t;if(it.isPair(t)){let u=r.schema[it.MAP].createNode?.(r.schema,null,r);return u.items.push(t),u}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:i,onAnchor:n,onTagObj:a,schema:o,sourceObjects:s}=r,c;if(i&&t&&typeof t=="object"){if(c=s.get(t),c)return c.anchor??(c.anchor=n(t)),new Cp.Alias(c.anchor);c={anchor:null,node:null},s.set(t,c)}e?.startsWith("!!")&&(e=Pp+e.slice(2));let l=Rp(t,e,o.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let u=new yc.Scalar(t);return c&&(c.node=u),u}l=t instanceof Map?o[it.MAP]:Symbol.iterator in Object(t)?o[it.SEQ]:o[it.MAP]}a&&(a(l),delete r.onTagObj);let d=l?.createNode?l.createNode(r.schema,t,r):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(r.schema,t,r):new yc.Scalar(t);return e?d.tag=e:l.default||(d.tag=l.tag),c&&(c.node=d),d}Nc.createNode=_p});var Ci=g(xi=>{"use strict";var Ap=or(),he=R(),Ip=Si();function Sa(t,e,r){let i=r;for(let n=e.length-1;n>=0;--n){let a=e[n];if(typeof a=="number"&&Number.isInteger(a)&&a>=0){let o=[];o[a]=i,i=o}else i=new Map([[a,i]])}return Ap.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var bc=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Ea=class extends Ip.NodeBase{constructor(e,r){super(e),Object.defineProperty(this,"schema",{value:r,configurable:!0,enumerable:!1,writable:!0})}clone(e){let r=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(r.schema=e),r.items=r.items.map(i=>he.isNode(i)||he.isPair(i)?i.clone(e):i),this.range&&(r.range=this.range.slice()),r}addIn(e,r){if(bc(e))this.add(r);else{let[i,...n]=e,a=this.get(i,!0);if(he.isCollection(a))a.addIn(n,r);else if(a===void 0&&this.schema)this.set(i,Sa(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}deleteIn(e){let[r,...i]=e;if(i.length===0)return this.delete(r);let n=this.get(r,!0);if(he.isCollection(n))return n.deleteIn(i);throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}getIn(e,r){let[i,...n]=e,a=this.get(i,!0);return n.length===0?!r&&he.isScalar(a)?a.value:a:he.isCollection(a)?a.getIn(n,r):void 0}hasAllNullValues(e){return this.items.every(r=>{if(!he.isPair(r))return!1;let i=r.value;return i==null||e&&he.isScalar(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){let[r,...i]=e;if(i.length===0)return this.has(r);let n=this.get(r,!0);return he.isCollection(n)?n.hasIn(i):!1}setIn(e,r){let[i,...n]=e;if(n.length===0)this.set(i,r);else{let a=this.get(i,!0);if(he.isCollection(a))a.setIn(n,r);else if(a===void 0&&this.schema)this.set(i,Sa(this.schema,n,r));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${n}`)}}};xi.Collection=Ea;xi.collectionFromPath=Sa;xi.isEmptyPath=bc});var sr=g(Pi=>{"use strict";var Tp=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function xa(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var $p=(t,e,r)=>t.endsWith(`
6
+ `)?xa(r,e):r.includes(`
7
7
  `)?`
8
- `+Gn(r,e):(t.endsWith(" ")?"":" ")+r;ii.indentComment=Gn;ii.lineComment=Sf;ii.stringifyComment=kf});var Hs=v(zt=>{"use strict";var Ef="flow",Jn="block",ni="quoted";function xf(t,e,r="flow",{indentAtStart:i,lineWidth:n=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!n||n<0)return t;n<a&&(a=0);let c=Math.max(1+a,1+n-e.length);if(t.length<=c)return t;let l=[],d={},u=n-e.length;typeof i=="number"&&(i>n-Math.max(2,a)?l.push(0):u=n-i);let f,m,g=!1,p=-1,h=-1,w=-1;r===Jn&&(p=Os(t,p,e.length),p!==-1&&(u=p+c));for(let k;k=t[p+=1];){if(r===ni&&k==="\\"){switch(h=p,t[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}w=p}if(k===`
9
- `)r===Jn&&(p=Os(t,p,e.length)),u=p+e.length+c,f=void 0;else{if(k===" "&&m&&m!==" "&&m!==`
10
- `&&m!==" "){let S=t[p+1];S&&S!==" "&&S!==`
11
- `&&S!==" "&&(f=p)}if(p>=u)if(f)l.push(f),u=f+c,f=void 0;else if(r===ni){for(;m===" "||m===" ";)m=k,k=t[p+=1],g=!0;let S=p>w+1?p-2:h-1;if(d[S])return t;l.push(S),d[S]=!0,u=S+c,f=void 0}else g=!0}m=k}if(g&&s&&s(),l.length===0)return t;o&&o();let N=t.slice(0,l[0]);for(let k=0;k<l.length;++k){let S=l[k],E=l[k+1]||t.length;S===0?N=`
12
- ${e}${t.slice(0,E)}`:(r===ni&&d[S]&&(N+=`${t[S]}\\`),N+=`
13
- ${e}${t.slice(S+1,E)}`)}return N}function Os(t,e,r){let i=e,n=e+1,a=t[n];for(;a===" "||a===" ";)if(e<n+r)a=t[++e];else{do a=t[++e];while(a&&a!==`
14
- `);i=e,n=e+1,a=t[n]}return i}zt.FOLD_BLOCK=Jn;zt.FOLD_FLOW=Ef;zt.FOLD_QUOTED=ni;zt.foldFlowLines=xf});var Jt=v(Ds=>{"use strict";var ee=$(),Ae=Hs(),oi=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),si=t=>/^(%|---|\.\.\.)/m.test(t);function Cf(t,e,r){if(!e||e<0)return!1;let i=e-r,n=t.length;if(n<=i)return!1;for(let a=0,o=0;a<n;++a)if(t[a]===`
15
- `){if(a-o>i)return!0;if(o=a+1,n-o<=i)return!1}return!0}function Gt(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:i}=e,n=e.options.doubleQuotedMinMultiLineLength,a=e.indent||(si(t)?" ":""),o="",s=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(o+=r.slice(s,c)+"\\ ",c+=1,s=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{o+=r.slice(s,c);let d=r.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=r.substr(c,6)}c+=5,s=c+1}break;case"n":if(i||r[c+2]==='"'||r.length<n)c+=1;else{for(o+=r.slice(s,c)+`
8
+ `+xa(r,e):(t.endsWith(" ")?"":" ")+r;Pi.indentComment=xa;Pi.lineComment=$p;Pi.stringifyComment=Tp});var Sc=g(cr=>{"use strict";var jp="flow",Ca="block",Ri="quoted";function Op(t,e,r="flow",{indentAtStart:i,lineWidth:n=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!n||n<0)return t;n<a&&(a=0);let c=Math.max(1+a,1+n-e.length);if(t.length<=c)return t;let l=[],d={},u=n-e.length;typeof i=="number"&&(i>n-Math.max(2,a)?l.push(0):u=n-i);let f,h,v=!1,p=-1,m=-1,w=-1;r===Ca&&(p=kc(t,p,e.length),p!==-1&&(u=p+c));for(let k;k=t[p+=1];){if(r===Ri&&k==="\\"){switch(m=p,t[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}w=p}if(k===`
9
+ `)r===Ca&&(p=kc(t,p,e.length)),u=p+e.length+c,f=void 0;else{if(k===" "&&h&&h!==" "&&h!==`
10
+ `&&h!==" "){let x=t[p+1];x&&x!==" "&&x!==`
11
+ `&&x!==" "&&(f=p)}if(p>=u)if(f)l.push(f),u=f+c,f=void 0;else if(r===Ri){for(;h===" "||h===" ";)h=k,k=t[p+=1],v=!0;let x=p>w+1?p-2:m-1;if(d[x])return t;l.push(x),d[x]=!0,u=x+c,f=void 0}else v=!0}h=k}if(v&&s&&s(),l.length===0)return t;o&&o();let y=t.slice(0,l[0]);for(let k=0;k<l.length;++k){let x=l[k],E=l[k+1]||t.length;x===0?y=`
12
+ ${e}${t.slice(0,E)}`:(r===Ri&&d[x]&&(y+=`${t[x]}\\`),y+=`
13
+ ${e}${t.slice(x+1,E)}`)}return y}function kc(t,e,r){let i=e,n=e+1,a=t[n];for(;a===" "||a===" ";)if(e<n+r)a=t[++e];else{do a=t[++e];while(a&&a!==`
14
+ `);i=e,n=e+1,a=t[n]}return i}cr.FOLD_BLOCK=Ca;cr.FOLD_FLOW=jp;cr.FOLD_QUOTED=Ri;cr.foldFlowLines=Op});var ur=g(Ec=>{"use strict";var ae=O(),Le=Sc(),Ai=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Ii=t=>/^(%|---|\.\.\.)/m.test(t);function Hp(t,e,r){if(!e||e<0)return!1;let i=e-r,n=t.length;if(n<=i)return!1;for(let a=0,o=0;a<n;++a)if(t[a]===`
15
+ `){if(a-o>i)return!0;if(o=a+1,n-o<=i)return!1}return!0}function lr(t,e){let r=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return r;let{implicitKey:i}=e,n=e.options.doubleQuotedMinMultiLineLength,a=e.indent||(Ii(t)?" ":""),o="",s=0;for(let c=0,l=r[c];l;l=r[++c])if(l===" "&&r[c+1]==="\\"&&r[c+2]==="n"&&(o+=r.slice(s,c)+"\\ ",c+=1,s=c,l="\\"),l==="\\")switch(r[c+1]){case"u":{o+=r.slice(s,c);let d=r.substr(c+2,4);switch(d){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:d.substr(0,2)==="00"?o+="\\x"+d.substr(2):o+=r.substr(c,6)}c+=5,s=c+1}break;case"n":if(i||r[c+2]==='"'||r.length<n)c+=1;else{for(o+=r.slice(s,c)+`
16
16
 
17
17
  `;r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"';)o+=`
18
- `,c+=2;o+=a,r[c+2]===" "&&(o+="\\"),c+=1,s=c+1}break;default:c+=1}return o=s?o+r.slice(s):r,i?o:Ae.foldFlowLines(o,a,Ae.FOLD_QUOTED,oi(e,!1))}function Un(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
19
- `)||/[ \t]\n|\n[ \t]/.test(t))return Gt(t,e);let r=e.indent||(si(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20
- ${r}`)+"'";return e.implicitKey?i:Ae.foldFlowLines(i,r,Ae.FOLD_FLOW,oi(e,!1))}function pt(t,e){let{singleQuote:r}=e.options,i;if(r===!1)i=Gt;else{let n=t.includes('"'),a=t.includes("'");n&&!a?i=Un:a&&!n?i=Gt:i=r?Un:Gt}return i(t,e)}var Kn;try{Kn=new RegExp(`(^|(?<!
18
+ `,c+=2;o+=a,r[c+2]===" "&&(o+="\\"),c+=1,s=c+1}break;default:c+=1}return o=s?o+r.slice(s):r,i?o:Le.foldFlowLines(o,a,Le.FOLD_QUOTED,Ai(e,!1))}function Pa(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
19
+ `)||/[ \t]\n|\n[ \t]/.test(t))return lr(t,e);let r=e.indent||(Ii(t)?" ":""),i="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20
+ ${r}`)+"'";return e.implicitKey?i:Le.foldFlowLines(i,r,Le.FOLD_FLOW,Ai(e,!1))}function Ct(t,e){let{singleQuote:r}=e.options,i;if(r===!1)i=lr;else{let n=t.includes('"'),a=t.includes("'");n&&!a?i=Pa:a&&!n?i=lr:i=r?Pa:lr}return i(t,e)}var Ra;try{Ra=new RegExp(`(^|(?<!
21
21
  ))
22
22
  +(?!
23
- |$)`,"g")}catch{Kn=/\n+(?!\n|$)/g}function ai({comment:t,type:e,value:r},i,n,a){let{blockQuote:o,commentString:s,lineWidth:c}=i.options;if(!o||/\n[\t ]+$/.test(r))return pt(r,i);let l=i.indent||(i.forceBlockIndent||si(r)?" ":""),d=o==="literal"?!0:o==="folded"||e===ee.Scalar.BLOCK_FOLDED?!1:e===ee.Scalar.BLOCK_LITERAL?!0:!Cf(r,c,l.length);if(!r)return d?`|
23
+ |$)`,"g")}catch{Ra=/\n+(?!\n|$)/g}function _i({comment:t,type:e,value:r},i,n,a){let{blockQuote:o,commentString:s,lineWidth:c}=i.options;if(!o||/\n[\t ]+$/.test(r))return Ct(r,i);let l=i.indent||(i.forceBlockIndent||Ii(r)?" ":""),d=o==="literal"?!0:o==="folded"||e===ae.Scalar.BLOCK_FOLDED?!1:e===ae.Scalar.BLOCK_LITERAL?!0:!Hp(r,c,l.length);if(!r)return d?`|
24
24
  `:`>
25
25
  `;let u,f;for(f=r.length;f>0;--f){let E=r[f-1];if(E!==`
26
- `&&E!==" "&&E!==" ")break}let m=r.substring(f),g=m.indexOf(`
27
- `);g===-1?u="-":r===m||g!==m.length-1?(u="+",a&&a()):u="",m&&(r=r.slice(0,-m.length),m[m.length-1]===`
28
- `&&(m=m.slice(0,-1)),m=m.replace(Kn,`$&${l}`));let p=!1,h,w=-1;for(h=0;h<r.length;++h){let E=r[h];if(E===" ")p=!0;else if(E===`
29
- `)w=h;else break}let N=r.substring(0,w<h?w+1:h);N&&(r=r.substring(N.length),N=N.replace(/\n+/g,`$&${l}`));let S=(p?l?"2":"1":"")+u;if(t&&(S+=" "+s(t.replace(/ ?[\r\n]+/g," ")),n&&n()),!d){let E=r.replace(/\n+/g,`
30
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),x=!1,_=oi(i,!0);o!=="folded"&&e!==ee.Scalar.BLOCK_FOLDED&&(_.onOverflow=()=>{x=!0});let y=Ae.foldFlowLines(`${N}${E}${m}`,l,Ae.FOLD_BLOCK,_);if(!x)return`>${S}
31
- ${l}${y}`}return r=r.replace(/\n+/g,`$&${l}`),`|${S}
32
- ${l}${N}${r}${m}`}function Pf(t,e,r,i){let{type:n,value:a}=t,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:d}=e;if(s&&a.includes(`
33
- `)||d&&/[[\]{},]/.test(a))return pt(a,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||d||!a.includes(`
34
- `)?pt(a,e):ai(t,e,r,i);if(!s&&!d&&n!==ee.Scalar.PLAIN&&a.includes(`
35
- `))return ai(t,e,r,i);if(si(a)){if(c==="")return e.forceBlockIndent=!0,ai(t,e,r,i);if(s&&c===l)return pt(a,e)}let u=a.replace(/\n+/g,`$&
36
- ${c}`);if(o){let f=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(u),{compat:m,tags:g}=e.doc.schema;if(g.some(f)||m?.some(f))return pt(a,e)}return s?u:Ae.foldFlowLines(u,c,Ae.FOLD_FLOW,oi(e,!1))}function Rf(t,e,r,i){let{implicitKey:n,inFlow:a}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:s}=t;s!==ee.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=ee.Scalar.QUOTE_DOUBLE);let c=d=>{switch(d){case ee.Scalar.BLOCK_FOLDED:case ee.Scalar.BLOCK_LITERAL:return n||a?pt(o.value,e):ai(o,e,r,i);case ee.Scalar.QUOTE_DOUBLE:return Gt(o.value,e);case ee.Scalar.QUOTE_SINGLE:return Un(o.value,e);case ee.Scalar.PLAIN:return Pf(o,e,r,i);default:return null}},l=c(s);if(l===null){let{defaultKeyType:d,defaultStringType:u}=e.options,f=n&&d||u;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}Ds.stringifyString=Rf});var Ut=v(Yn=>{"use strict";var _f=Qr(),Ie=P(),Af=Wt(),If=Jt();function Tf(t,e){let r=Object.assign({blockQuote:!0,commentString:Af.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(r.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:i,options:r}}function $f(t,e){if(e.tag){let n=t.filter(a=>a.tag===e.tag);if(n.length>0)return n.find(a=>a.format===e.format)??n[0]}let r,i;if(Ie.isScalar(e)){i=e.value;let n=t.filter(a=>a.identify?.(i));if(n.length>1){let a=n.filter(o=>o.test);a.length>0&&(n=a)}r=n.find(a=>a.format===e.format)??n.find(a=>!a.format)}else i=e,r=t.find(n=>n.nodeClass&&i instanceof n.nodeClass);if(!r){let n=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${n} value`)}return r}function jf(t,e,{anchors:r,doc:i}){if(!i.directives)return"";let n=[],a=(Ie.isScalar(t)||Ie.isCollection(t))&&t.anchor;a&&_f.anchorIsValid(a)&&(r.add(a),n.push(`&${a}`));let o=t.tag??(e.default?null:e.tag);return o&&n.push(i.directives.tagString(o)),n.join(" ")}function Of(t,e,r,i){if(Ie.isPair(t))return t.toString(e,r,i);if(Ie.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let n,a=Ie.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>n=c});n??(n=$f(e.doc.schema.tags,a));let o=jf(a,n,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let s=typeof n.stringify=="function"?n.stringify(a,e,r,i):Ie.isScalar(a)?If.stringifyString(a,e,r,i):a.toString(e,r,i);return o?Ie.isScalar(a)||s[0]==="{"||s[0]==="["?`${o} ${s}`:`${o}
37
- ${e.indent}${s}`:s}Yn.createStringifyContext=Tf;Yn.stringify=Of});var Ms=v(Fs=>{"use strict";var me=P(),Ls=$(),Bs=Ut(),Kt=Wt();function Hf({key:t,value:e},r,i,n){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:d,simpleKeys:u}}=r,f=me.isNode(t)&&t.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(me.isCollection(t)||!me.isNode(t)&&typeof t=="object"){let _="With simple keys, collection cannot be used as a key value";throw new Error(_)}}let m=!u&&(!t||f&&e==null&&!r.inFlow||me.isCollection(t)||(me.isScalar(t)?t.type===Ls.Scalar.BLOCK_FOLDED||t.type===Ls.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!m&&(u||!a),indent:s+c});let g=!1,p=!1,h=Bs.stringify(t,r,()=>g=!0,()=>p=!0);if(!m&&!r.inFlow&&h.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(r.inFlow){if(a||e==null)return g&&i&&i(),h===""?"?":m?`? ${h}`:h}else if(a&&!u||e==null&&m)return h=`? ${h}`,f&&!g?h+=Kt.lineComment(h,r.indent,l(f)):p&&n&&n(),h;g&&(f=null),m?(f&&(h+=Kt.lineComment(h,r.indent,l(f))),h=`? ${h}
38
- ${s}:`):(h=`${h}:`,f&&(h+=Kt.lineComment(h,r.indent,l(f))));let w,N,k;me.isNode(e)?(w=!!e.spaceBefore,N=e.commentBefore,k=e.comment):(w=!1,N=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!m&&!f&&me.isScalar(e)&&(r.indentAtStart=h.length+1),p=!1,!d&&c.length>=2&&!r.inFlow&&!m&&me.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let S=!1,E=Bs.stringify(e,r,()=>S=!0,()=>p=!0),x=" ";if(f||w||N){if(x=w?`
39
- `:"",N){let _=l(N);x+=`
40
- ${Kt.indentComment(_,r.indent)}`}E===""&&!r.inFlow?x===`
41
- `&&k&&(x=`
26
+ `&&E!==" "&&E!==" ")break}let h=r.substring(f),v=h.indexOf(`
27
+ `);v===-1?u="-":r===h||v!==h.length-1?(u="+",a&&a()):u="",h&&(r=r.slice(0,-h.length),h[h.length-1]===`
28
+ `&&(h=h.slice(0,-1)),h=h.replace(Ra,`$&${l}`));let p=!1,m,w=-1;for(m=0;m<r.length;++m){let E=r[m];if(E===" ")p=!0;else if(E===`
29
+ `)w=m;else break}let y=r.substring(0,w<m?w+1:m);y&&(r=r.substring(y.length),y=y.replace(/\n+/g,`$&${l}`));let x=(p?l?"2":"1":"")+u;if(t&&(x+=" "+s(t.replace(/ ?[\r\n]+/g," ")),n&&n()),!d){let E=r.replace(/\n+/g,`
30
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),S=!1,I=Ai(i,!0);o!=="folded"&&e!==ae.Scalar.BLOCK_FOLDED&&(I.onOverflow=()=>{S=!0});let N=Le.foldFlowLines(`${y}${E}${h}`,l,Le.FOLD_BLOCK,I);if(!S)return`>${x}
31
+ ${l}${N}`}return r=r.replace(/\n+/g,`$&${l}`),`|${x}
32
+ ${l}${y}${r}${h}`}function Dp(t,e,r,i){let{type:n,value:a}=t,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:d}=e;if(s&&a.includes(`
33
+ `)||d&&/[[\]{},]/.test(a))return Ct(a,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||d||!a.includes(`
34
+ `)?Ct(a,e):_i(t,e,r,i);if(!s&&!d&&n!==ae.Scalar.PLAIN&&a.includes(`
35
+ `))return _i(t,e,r,i);if(Ii(a)){if(c==="")return e.forceBlockIndent=!0,_i(t,e,r,i);if(s&&c===l)return Ct(a,e)}let u=a.replace(/\n+/g,`$&
36
+ ${c}`);if(o){let f=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(u),{compat:h,tags:v}=e.doc.schema;if(v.some(f)||h?.some(f))return Ct(a,e)}return s?u:Le.foldFlowLines(u,c,Le.FOLD_FLOW,Ai(e,!1))}function Lp(t,e,r,i){let{implicitKey:n,inFlow:a}=e,o=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:s}=t;s!==ae.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=ae.Scalar.QUOTE_DOUBLE);let c=d=>{switch(d){case ae.Scalar.BLOCK_FOLDED:case ae.Scalar.BLOCK_LITERAL:return n||a?Ct(o.value,e):_i(o,e,r,i);case ae.Scalar.QUOTE_DOUBLE:return lr(o.value,e);case ae.Scalar.QUOTE_SINGLE:return Pa(o.value,e);case ae.Scalar.PLAIN:return Dp(o,e,r,i);default:return null}},l=c(s);if(l===null){let{defaultKeyType:d,defaultStringType:u}=e.options,f=n&&d||u;if(l=c(f),l===null)throw new Error(`Unsupported default string type ${f}`)}return l}Ec.stringifyString=Lp});var dr=g(_a=>{"use strict";var Bp=ki(),Be=R(),Mp=sr(),Fp=ur();function Vp(t,e){let r=Object.assign({blockQuote:!0,commentString:Mp.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,e),i;switch(r.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:t,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent=="number"?" ".repeat(r.indent):" ",inFlow:i,options:r}}function qp(t,e){if(e.tag){let n=t.filter(a=>a.tag===e.tag);if(n.length>0)return n.find(a=>a.format===e.format)??n[0]}let r,i;if(Be.isScalar(e)){i=e.value;let n=t.filter(a=>a.identify?.(i));if(n.length>1){let a=n.filter(o=>o.test);a.length>0&&(n=a)}r=n.find(a=>a.format===e.format)??n.find(a=>!a.format)}else i=e,r=t.find(n=>n.nodeClass&&i instanceof n.nodeClass);if(!r){let n=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${n} value`)}return r}function Wp(t,e,{anchors:r,doc:i}){if(!i.directives)return"";let n=[],a=(Be.isScalar(t)||Be.isCollection(t))&&t.anchor;a&&Bp.anchorIsValid(a)&&(r.add(a),n.push(`&${a}`));let o=t.tag??(e.default?null:e.tag);return o&&n.push(i.directives.tagString(o)),n.join(" ")}function zp(t,e,r,i){if(Be.isPair(t))return t.toString(e,r,i);if(Be.isAlias(t)){if(e.doc.directives)return t.toString(e);if(e.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(t):e.resolvedAliases=new Set([t]),t=t.resolve(e.doc)}let n,a=Be.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>n=c});n??(n=qp(e.doc.schema.tags,a));let o=Wp(a,n,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);let s=typeof n.stringify=="function"?n.stringify(a,e,r,i):Be.isScalar(a)?Fp.stringifyString(a,e,r,i):a.toString(e,r,i);return o?Be.isScalar(a)||s[0]==="{"||s[0]==="["?`${o} ${s}`:`${o}
37
+ ${e.indent}${s}`:s}_a.createStringifyContext=Vp;_a.stringify=zp});var Rc=g(Pc=>{"use strict";var ke=R(),xc=O(),Cc=dr(),fr=sr();function Gp({key:t,value:e},r,i,n){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:d,simpleKeys:u}}=r,f=ke.isNode(t)&&t.comment||null;if(u){if(f)throw new Error("With simple keys, key nodes cannot have comments");if(ke.isCollection(t)||!ke.isNode(t)&&typeof t=="object"){let I="With simple keys, collection cannot be used as a key value";throw new Error(I)}}let h=!u&&(!t||f&&e==null&&!r.inFlow||ke.isCollection(t)||(ke.isScalar(t)?t.type===xc.Scalar.BLOCK_FOLDED||t.type===xc.Scalar.BLOCK_LITERAL:typeof t=="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!h&&(u||!a),indent:s+c});let v=!1,p=!1,m=Cc.stringify(t,r,()=>v=!0,()=>p=!0);if(!h&&!r.inFlow&&m.length>1024){if(u)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(r.inFlow){if(a||e==null)return v&&i&&i(),m===""?"?":h?`? ${m}`:m}else if(a&&!u||e==null&&h)return m=`? ${m}`,f&&!v?m+=fr.lineComment(m,r.indent,l(f)):p&&n&&n(),m;v&&(f=null),h?(f&&(m+=fr.lineComment(m,r.indent,l(f))),m=`? ${m}
38
+ ${s}:`):(m=`${m}:`,f&&(m+=fr.lineComment(m,r.indent,l(f))));let w,y,k;ke.isNode(e)?(w=!!e.spaceBefore,y=e.commentBefore,k=e.comment):(w=!1,y=null,k=null,e&&typeof e=="object"&&(e=o.createNode(e))),r.implicitKey=!1,!h&&!f&&ke.isScalar(e)&&(r.indentAtStart=m.length+1),p=!1,!d&&c.length>=2&&!r.inFlow&&!h&&ke.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(r.indent=r.indent.substring(2));let x=!1,E=Cc.stringify(e,r,()=>x=!0,()=>p=!0),S=" ";if(f||w||y){if(S=w?`
39
+ `:"",y){let I=l(y);S+=`
40
+ ${fr.indentComment(I,r.indent)}`}E===""&&!r.inFlow?S===`
41
+ `&&k&&(S=`
42
42
 
43
- `):x+=`
44
- ${r.indent}`}else if(!m&&me.isCollection(e)){let _=E[0],y=E.indexOf(`
45
- `),j=y!==-1,Ce=r.inFlow??e.flow??e.items.length===0;if(j||!Ce){let lt=!1;if(j&&(_==="&"||_==="!")){let O=E.indexOf(" ");_==="&"&&O!==-1&&O<y&&E[O+1]==="!"&&(O=E.indexOf(" ",O+1)),(O===-1||y<O)&&(lt=!0)}lt||(x=`
43
+ `):S+=`
44
+ ${r.indent}`}else if(!h&&ke.isCollection(e)){let I=E[0],N=E.indexOf(`
45
+ `),H=N!==-1,je=r.inFlow??e.flow??e.items.length===0;if(H||!je){let kt=!1;if(H&&(I==="&"||I==="!")){let D=E.indexOf(" ");I==="&"&&D!==-1&&D<N&&E[D+1]==="!"&&(D=E.indexOf(" ",D+1)),(D===-1||N<D)&&(kt=!0)}kt||(S=`
46
46
  ${r.indent}`)}}else(E===""||E[0]===`
47
- `)&&(x="");return h+=x+E,r.inFlow?S&&i&&i():k&&!S?h+=Kt.lineComment(h,r.indent,l(k)):p&&n&&n(),h}Fs.stringifyPair=Hf});var Qn=v(Xn=>{"use strict";var Vs=Jr("process");function Df(t,...e){t==="debug"&&console.log(...e)}function Lf(t,e){(t==="debug"||t==="warn")&&(typeof Vs.emitWarning=="function"?Vs.emitWarning(e):console.warn(e))}Xn.debug=Df;Xn.warn=Lf});var fi=v(di=>{"use strict";var ui=P(),qs=$(),ci="<<",li={identify:t=>t===ci||typeof t=="symbol"&&t.description===ci,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new qs.Scalar(Symbol(ci)),{addToJSMap:Ws}),stringify:()=>ci},Bf=(t,e)=>(li.identify(e)||ui.isScalar(e)&&(!e.type||e.type===qs.Scalar.PLAIN)&&li.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===li.tag&&r.default);function Ws(t,e,r){let i=zs(t,r);if(ui.isSeq(i))for(let n of i.items)Zn(t,e,n);else if(Array.isArray(i))for(let n of i)Zn(t,e,n);else Zn(t,e,i)}function Zn(t,e,r){let i=zs(t,r);if(!ui.isMap(i))throw new Error("Merge sources must be maps or map aliases");let n=i.toJSON(null,t,Map);for(let[a,o]of n)e instanceof Map?e.has(a)||e.set(a,o):e instanceof Set?e.add(a):Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function zs(t,e){return t&&ui.isAlias(e)?e.resolve(t.doc,t):e}di.addMergeToJSMap=Ws;di.isMergeKey=Bf;di.merge=li});var ta=v(Us=>{"use strict";var Ff=Qn(),Gs=fi(),Mf=Ut(),Js=P(),ea=Re();function Vf(t,e,{key:r,value:i}){if(Js.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,i);else if(Gs.isMergeKey(t,r))Gs.addMergeToJSMap(t,e,i);else{let n=ea.toJS(r,"",t);if(e instanceof Map)e.set(n,ea.toJS(i,n,t));else if(e instanceof Set)e.add(n);else{let a=qf(r,n,t),o=ea.toJS(i,a,t);a in e?Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[a]=o}}return e}function qf(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(Js.isNode(t)&&r?.doc){let i=Mf.createStringifyContext(r.doc,{});i.anchors=new Set;for(let a of r.anchors.keys())i.anchors.add(a.anchor);i.inFlow=!0,i.inStringifyKey=!0;let n=t.toString(i);if(!r.mapKeyWarned){let a=JSON.stringify(n);a.length>40&&(a=a.substring(0,36)+'..."'),Ff.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return n}return JSON.stringify(e)}Us.addPairToJSMap=Vf});var Te=v(ra=>{"use strict";var Ks=qt(),Wf=Ms(),zf=ta(),pi=P();function Gf(t,e,r){let i=Ks.createNode(t,void 0,r),n=Ks.createNode(e,void 0,r);return new hi(i,n)}var hi=class t{constructor(e,r=null){Object.defineProperty(this,pi.NODE_TYPE,{value:pi.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:i}=this;return pi.isNode(r)&&(r=r.clone(e)),pi.isNode(i)&&(i=i.clone(e)),new t(r,i)}toJSON(e,r){let i=r?.mapAsMap?new Map:{};return zf.addPairToJSMap(r,i,this)}toString(e,r,i){return e?.doc?Wf.stringifyPair(this,e,r,i):JSON.stringify(this)}};ra.Pair=hi;ra.createPair=Gf});var ia=v(Xs=>{"use strict";var Ye=P(),Ys=Ut(),mi=Wt();function Jf(t,e,r){return(e.inFlow??t.flow?Kf:Uf)(t,e,r)}function Uf({comment:t,items:e},r,{blockItemPrefix:i,flowChars:n,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=r,d=Object.assign({},r,{indent:a,type:null}),u=!1,f=[];for(let g=0;g<e.length;++g){let p=e[g],h=null;if(Ye.isNode(p))!u&&p.spaceBefore&&f.push(""),vi(r,f,p.commentBefore,u),p.comment&&(h=p.comment);else if(Ye.isPair(p)){let N=Ye.isNode(p.key)?p.key:null;N&&(!u&&N.spaceBefore&&f.push(""),vi(r,f,N.commentBefore,u))}u=!1;let w=Ys.stringify(p,d,()=>h=null,()=>u=!0);h&&(w+=mi.lineComment(w,a,l(h))),u&&h&&(u=!1),f.push(i+w)}let m;if(f.length===0)m=n.start+n.end;else{m=f[0];for(let g=1;g<f.length;++g){let p=f[g];m+=p?`
47
+ `)&&(S="");return m+=S+E,r.inFlow?x&&i&&i():k&&!x?m+=fr.lineComment(m,r.indent,l(k)):p&&n&&n(),m}Pc.stringifyPair=Gp});var Ia=g(Aa=>{"use strict";var _c=gi("process");function Jp(t,...e){t==="debug"&&console.log(...e)}function Up(t,e){(t==="debug"||t==="warn")&&(typeof _c.emitWarning=="function"?_c.emitWarning(e):console.warn(e))}Aa.debug=Jp;Aa.warn=Up});var Hi=g(Oi=>{"use strict";var ji=R(),Ac=O(),Ti="<<",$i={identify:t=>t===Ti||typeof t=="symbol"&&t.description===Ti,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ac.Scalar(Symbol(Ti)),{addToJSMap:Ic}),stringify:()=>Ti},Kp=(t,e)=>($i.identify(e)||ji.isScalar(e)&&(!e.type||e.type===Ac.Scalar.PLAIN)&&$i.identify(e.value))&&t?.doc.schema.tags.some(r=>r.tag===$i.tag&&r.default);function Ic(t,e,r){let i=Tc(t,r);if(ji.isSeq(i))for(let n of i.items)Ta(t,e,n);else if(Array.isArray(i))for(let n of i)Ta(t,e,n);else Ta(t,e,i)}function Ta(t,e,r){let i=Tc(t,r);if(!ji.isMap(i))throw new Error("Merge sources must be maps or map aliases");let n=i.toJSON(null,t,Map);for(let[a,o]of n)e instanceof Map?e.has(a)||e.set(a,o):e instanceof Set?e.add(a):Object.prototype.hasOwnProperty.call(e,a)||Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function Tc(t,e){return t&&ji.isAlias(e)?e.resolve(t.doc,t):e}Oi.addMergeToJSMap=Ic;Oi.isMergeKey=Kp;Oi.merge=$i});var ja=g(Oc=>{"use strict";var Yp=Ia(),$c=Hi(),Xp=dr(),jc=R(),$a=He();function Qp(t,e,{key:r,value:i}){if(jc.isNode(r)&&r.addToJSMap)r.addToJSMap(t,e,i);else if($c.isMergeKey(t,r))$c.addMergeToJSMap(t,e,i);else{let n=$a.toJS(r,"",t);if(e instanceof Map)e.set(n,$a.toJS(i,n,t));else if(e instanceof Set)e.add(n);else{let a=Zp(r,n,t),o=$a.toJS(i,a,t);a in e?Object.defineProperty(e,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[a]=o}}return e}function Zp(t,e,r){if(e===null)return"";if(typeof e!="object")return String(e);if(jc.isNode(t)&&r?.doc){let i=Xp.createStringifyContext(r.doc,{});i.anchors=new Set;for(let a of r.anchors.keys())i.anchors.add(a.anchor);i.inFlow=!0,i.inStringifyKey=!0;let n=t.toString(i);if(!r.mapKeyWarned){let a=JSON.stringify(n);a.length>40&&(a=a.substring(0,36)+'..."'),Yp.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${a}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return n}return JSON.stringify(e)}Oc.addPairToJSMap=Qp});var Me=g(Oa=>{"use strict";var Hc=or(),eh=Rc(),th=ja(),Di=R();function rh(t,e,r){let i=Hc.createNode(t,void 0,r),n=Hc.createNode(e,void 0,r);return new Li(i,n)}var Li=class t{constructor(e,r=null){Object.defineProperty(this,Di.NODE_TYPE,{value:Di.PAIR}),this.key=e,this.value=r}clone(e){let{key:r,value:i}=this;return Di.isNode(r)&&(r=r.clone(e)),Di.isNode(i)&&(i=i.clone(e)),new t(r,i)}toJSON(e,r){let i=r?.mapAsMap?new Map:{};return th.addPairToJSMap(r,i,this)}toString(e,r,i){return e?.doc?eh.stringifyPair(this,e,r,i):JSON.stringify(this)}};Oa.Pair=Li;Oa.createPair=rh});var Ha=g(Lc=>{"use strict";var nt=R(),Dc=dr(),Bi=sr();function ih(t,e,r){return(e.inFlow??t.flow?ah:nh)(t,e,r)}function nh({comment:t,items:e},r,{blockItemPrefix:i,flowChars:n,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=r,d=Object.assign({},r,{indent:a,type:null}),u=!1,f=[];for(let v=0;v<e.length;++v){let p=e[v],m=null;if(nt.isNode(p))!u&&p.spaceBefore&&f.push(""),Mi(r,f,p.commentBefore,u),p.comment&&(m=p.comment);else if(nt.isPair(p)){let y=nt.isNode(p.key)?p.key:null;y&&(!u&&y.spaceBefore&&f.push(""),Mi(r,f,y.commentBefore,u))}u=!1;let w=Dc.stringify(p,d,()=>m=null,()=>u=!0);m&&(w+=Bi.lineComment(w,a,l(m))),u&&m&&(u=!1),f.push(i+w)}let h;if(f.length===0)h=n.start+n.end;else{h=f[0];for(let v=1;v<f.length;++v){let p=f[v];h+=p?`
48
48
  ${c}${p}`:`
49
- `}}return t?(m+=`
50
- `+mi.indentComment(l(t),c),s&&s()):u&&o&&o(),m}function Kf({items:t},e,{flowChars:r,itemIndent:i}){let{indent:n,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=e;i+=a;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,d=0,u=[];for(let g=0;g<t.length;++g){let p=t[g],h=null;if(Ye.isNode(p))p.spaceBefore&&u.push(""),vi(e,u,p.commentBefore,!1),p.comment&&(h=p.comment);else if(Ye.isPair(p)){let N=Ye.isNode(p.key)?p.key:null;N&&(N.spaceBefore&&u.push(""),vi(e,u,N.commentBefore,!1),N.comment&&(l=!0));let k=Ye.isNode(p.value)?p.value:null;k?(k.comment&&(h=k.comment),k.commentBefore&&(l=!0)):p.value==null&&N?.comment&&(h=N.comment)}h&&(l=!0);let w=Ys.stringify(p,c,()=>h=null);l||(l=u.length>d||w.includes(`
51
- `)),g<t.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=u.reduce((N,k)=>N+k.length+2,2)+(w.length+2)>e.options.lineWidth)),l&&(w+=",")),h&&(w+=mi.lineComment(w,i,s(h))),u.push(w),d=u.length}let{start:f,end:m}=r;if(u.length===0)return f+m;if(!l){let g=u.reduce((p,h)=>p+h.length+2,2);l=e.options.lineWidth>0&&g>e.options.lineWidth}if(l){let g=f;for(let p of u)g+=p?`
49
+ `}}return t?(h+=`
50
+ `+Bi.indentComment(l(t),c),s&&s()):u&&o&&o(),h}function ah({items:t},e,{flowChars:r,itemIndent:i}){let{indent:n,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=e;i+=a;let c=Object.assign({},e,{indent:i,inFlow:!0,type:null}),l=!1,d=0,u=[];for(let v=0;v<t.length;++v){let p=t[v],m=null;if(nt.isNode(p))p.spaceBefore&&u.push(""),Mi(e,u,p.commentBefore,!1),p.comment&&(m=p.comment);else if(nt.isPair(p)){let y=nt.isNode(p.key)?p.key:null;y&&(y.spaceBefore&&u.push(""),Mi(e,u,y.commentBefore,!1),y.comment&&(l=!0));let k=nt.isNode(p.value)?p.value:null;k?(k.comment&&(m=k.comment),k.commentBefore&&(l=!0)):p.value==null&&y?.comment&&(m=y.comment)}m&&(l=!0);let w=Dc.stringify(p,c,()=>m=null);l||(l=u.length>d||w.includes(`
51
+ `)),v<t.length-1?w+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=u.reduce((y,k)=>y+k.length+2,2)+(w.length+2)>e.options.lineWidth)),l&&(w+=",")),m&&(w+=Bi.lineComment(w,i,s(m))),u.push(w),d=u.length}let{start:f,end:h}=r;if(u.length===0)return f+h;if(!l){let v=u.reduce((p,m)=>p+m.length+2,2);l=e.options.lineWidth>0&&v>e.options.lineWidth}if(l){let v=f;for(let p of u)v+=p?`
52
52
  ${a}${n}${p}`:`
53
- `;return`${g}
54
- ${n}${m}`}else return`${f}${o}${u.join(" ")}${o}${m}`}function vi({indent:t,options:{commentString:e}},r,i,n){if(i&&n&&(i=i.replace(/^\n+/,"")),i){let a=mi.indentComment(e(i),t);r.push(a.trimStart())}}Xs.stringifyCollection=Jf});var je=v(aa=>{"use strict";var Yf=ia(),Xf=ta(),Qf=ri(),$e=P(),gi=Te(),Zf=$();function Yt(t,e){let r=$e.isScalar(e)?e.value:e;for(let i of t)if($e.isPair(i)&&(i.key===e||i.key===r||$e.isScalar(i.key)&&i.key.value===r))return i}var na=class extends Qf.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super($e.MAP,e),this.items=[]}static from(e,r,i){let{keepUndefined:n,replacer:a}=i,o=new this(e),s=(c,l)=>{if(typeof a=="function")l=a.call(r,c,l);else if(Array.isArray(a)&&!a.includes(c))return;(l!==void 0||n)&&o.items.push(gi.createPair(c,l,i))};if(r instanceof Map)for(let[c,l]of r)s(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))s(c,r[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let i;$e.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new gi.Pair(e,e?.value):i=new gi.Pair(e.key,e.value);let n=Yt(this.items,i.key),a=this.schema?.sortMapEntries;if(n){if(!r)throw new Error(`Key ${i.key} already set`);$e.isScalar(n.value)&&Zf.isScalarValue(i.value)?n.value.value=i.value:n.value=i.value}else if(a){let o=this.items.findIndex(s=>a(i,s)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let r=Yt(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let n=Yt(this.items,e)?.value;return(!r&&$e.isScalar(n)?n.value:n)??void 0}has(e){return!!Yt(this.items,e)}set(e,r){this.add(new gi.Pair(e,r),!0)}toJSON(e,r,i){let n=i?new i:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(n);for(let a of this.items)Xf.addPairToJSMap(r,n,a);return n}toString(e,r,i){if(!e)return JSON.stringify(this);for(let n of this.items)if(!$e.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),Yf.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:r})}};aa.YAMLMap=na;aa.findPair=Yt});var ht=v(Zs=>{"use strict";var ep=P(),Qs=je(),tp={collection:"map",default:!0,nodeClass:Qs.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return ep.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>Qs.YAMLMap.from(t,e,r)};Zs.map=tp});var Oe=v(ec=>{"use strict";var rp=qt(),ip=ia(),np=ri(),yi=P(),ap=$(),op=Re(),oa=class extends np.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(yi.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=wi(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let i=wi(e);if(typeof i!="number")return;let n=this.items[i];return!r&&yi.isScalar(n)?n.value:n}has(e){let r=wi(e);return typeof r=="number"&&r<this.items.length}set(e,r){let i=wi(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[i];yi.isScalar(n)&&ap.isScalarValue(r)?n.value=r:this.items[i]=r}toJSON(e,r){let i=[];r?.onCreate&&r.onCreate(i);let n=0;for(let a of this.items)i.push(op.toJS(a,String(n++),r));return i}toString(e,r,i){return e?ip.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:r}):JSON.stringify(this)}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r)){let o=0;for(let s of r){if(typeof n=="function"){let c=r instanceof Set?s:String(o++);s=n.call(r,c,s)}a.items.push(rp.createNode(s,void 0,i))}}return a}};function wi(t){let e=yi.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}ec.YAMLSeq=oa});var mt=v(rc=>{"use strict";var sp=P(),tc=Oe(),cp={collection:"seq",default:!0,nodeClass:tc.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return sp.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>tc.YAMLSeq.from(t,e,r)};rc.seq=cp});var Xt=v(ic=>{"use strict";var lp=Jt(),up={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,i){return e=Object.assign({actualString:!0},e),lp.stringifyString(t,e,r,i)}};ic.string=up});var Ni=v(oc=>{"use strict";var nc=$(),ac={identify:t=>t==null,createNode:()=>new nc.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new nc.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&ac.test.test(t)?t:e.options.nullStr};oc.nullTag=ac});var sa=v(cc=>{"use strict";var dp=$(),sc={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new dp.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&sc.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?r.options.trueStr:r.options.falseStr}};cc.boolTag=sc});var vt=v(lc=>{"use strict";function fp({format:t,minFractionDigits:e,tag:r,value:i}){if(typeof i=="bigint")return String(i);let n=typeof i=="number"?i:Number(i);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let a=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let s=e-(a.length-o-1);for(;s-- >0;)a+="0"}return a}lc.stringifyNumber=fp});var la=v(bi=>{"use strict";var pp=$(),ca=vt(),hp={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ca.stringifyNumber},mp={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():ca.stringifyNumber(t)}},vp={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new pp.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:ca.stringifyNumber};bi.float=vp;bi.floatExp=mp;bi.floatNaN=hp});var da=v(Si=>{"use strict";var uc=vt(),ki=t=>typeof t=="bigint"||Number.isInteger(t),ua=(t,e,r,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),r);function dc(t,e,r){let{value:i}=t;return ki(i)&&i>=0?r+i.toString(e):uc.stringifyNumber(t)}var gp={identify:t=>ki(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>ua(t,2,8,r),stringify:t=>dc(t,8,"0o")},wp={identify:ki,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>ua(t,0,10,r),stringify:uc.stringifyNumber},yp={identify:t=>ki(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>ua(t,2,16,r),stringify:t=>dc(t,16,"0x")};Si.int=wp;Si.intHex=yp;Si.intOct=gp});var pc=v(fc=>{"use strict";var Np=ht(),bp=Ni(),kp=mt(),Sp=Xt(),Ep=sa(),fa=la(),pa=da(),xp=[Np.map,kp.seq,Sp.string,bp.nullTag,Ep.boolTag,pa.intOct,pa.int,pa.intHex,fa.floatNaN,fa.floatExp,fa.float];fc.schema=xp});var vc=v(mc=>{"use strict";var Cp=$(),Pp=ht(),Rp=mt();function hc(t){return typeof t=="bigint"||Number.isInteger(t)}var Ei=({value:t})=>JSON.stringify(t),_p=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Ei},{identify:t=>t==null,createNode:()=>new Cp.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ei},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Ei},{identify:hc,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>hc(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Ei}],Ap={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Ip=[Pp.map,Rp.seq].concat(_p,Ap);mc.schema=Ip});var ma=v(gc=>{"use strict";var Qt=Jr("buffer"),ha=$(),Tp=Jt(),$p={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof Qt.Buffer=="function")return Qt.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(r.length);for(let n=0;n<r.length;++n)i[n]=r.charCodeAt(n);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},i,n,a){if(!r)return"";let o=r,s;if(typeof Qt.Buffer=="function")s=o instanceof Qt.Buffer?o.toString("base64"):Qt.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);s=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=ha.Scalar.BLOCK_LITERAL),e!==ha.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(s.length/c),d=new Array(l);for(let u=0,f=0;u<l;++u,f+=c)d[u]=s.substr(f,c);s=d.join(e===ha.Scalar.BLOCK_LITERAL?`
55
- `:" ")}return Tp.stringifyString({comment:t,type:e,value:s},i,n,a)}};gc.binary=$p});var Pi=v(Ci=>{"use strict";var xi=P(),va=Te(),jp=$(),Op=Oe();function wc(t,e){if(xi.isSeq(t))for(let r=0;r<t.items.length;++r){let i=t.items[r];if(!xi.isPair(i)){if(xi.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let n=i.items[0]||new va.Pair(new jp.Scalar(null));if(i.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${i.commentBefore}
53
+ `;return`${v}
54
+ ${n}${h}`}else return`${f}${o}${u.join(" ")}${o}${h}`}function Mi({indent:t,options:{commentString:e}},r,i,n){if(i&&n&&(i=i.replace(/^\n+/,"")),i){let a=Bi.indentComment(e(i),t);r.push(a.trimStart())}}Lc.stringifyCollection=ih});var Ve=g(La=>{"use strict";var oh=Ha(),sh=ja(),ch=Ci(),Fe=R(),Fi=Me(),lh=O();function pr(t,e){let r=Fe.isScalar(e)?e.value:e;for(let i of t)if(Fe.isPair(i)&&(i.key===e||i.key===r||Fe.isScalar(i.key)&&i.key.value===r))return i}var Da=class extends ch.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Fe.MAP,e),this.items=[]}static from(e,r,i){let{keepUndefined:n,replacer:a}=i,o=new this(e),s=(c,l)=>{if(typeof a=="function")l=a.call(r,c,l);else if(Array.isArray(a)&&!a.includes(c))return;(l!==void 0||n)&&o.items.push(Fi.createPair(c,l,i))};if(r instanceof Map)for(let[c,l]of r)s(c,l);else if(r&&typeof r=="object")for(let c of Object.keys(r))s(c,r[c]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,r){let i;Fe.isPair(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new Fi.Pair(e,e?.value):i=new Fi.Pair(e.key,e.value);let n=pr(this.items,i.key),a=this.schema?.sortMapEntries;if(n){if(!r)throw new Error(`Key ${i.key} already set`);Fe.isScalar(n.value)&&lh.isScalarValue(i.value)?n.value.value=i.value:n.value=i.value}else if(a){let o=this.items.findIndex(s=>a(i,s)<0);o===-1?this.items.push(i):this.items.splice(o,0,i)}else this.items.push(i)}delete(e){let r=pr(this.items,e);return r?this.items.splice(this.items.indexOf(r),1).length>0:!1}get(e,r){let n=pr(this.items,e)?.value;return(!r&&Fe.isScalar(n)?n.value:n)??void 0}has(e){return!!pr(this.items,e)}set(e,r){this.add(new Fi.Pair(e,r),!0)}toJSON(e,r,i){let n=i?new i:r?.mapAsMap?new Map:{};r?.onCreate&&r.onCreate(n);for(let a of this.items)sh.addPairToJSMap(r,n,a);return n}toString(e,r,i){if(!e)return JSON.stringify(this);for(let n of this.items)if(!Fe.isPair(n))throw new Error(`Map items must all be pairs; found ${JSON.stringify(n)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),oh.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:r})}};La.YAMLMap=Da;La.findPair=pr});var Pt=g(Mc=>{"use strict";var uh=R(),Bc=Ve(),dh={collection:"map",default:!0,nodeClass:Bc.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return uh.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,r)=>Bc.YAMLMap.from(t,e,r)};Mc.map=dh});var qe=g(Fc=>{"use strict";var fh=or(),ph=Ha(),hh=Ci(),qi=R(),mh=O(),vh=He(),Ba=class extends hh.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(qi.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let r=Vi(e);return typeof r!="number"?!1:this.items.splice(r,1).length>0}get(e,r){let i=Vi(e);if(typeof i!="number")return;let n=this.items[i];return!r&&qi.isScalar(n)?n.value:n}has(e){let r=Vi(e);return typeof r=="number"&&r<this.items.length}set(e,r){let i=Vi(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);let n=this.items[i];qi.isScalar(n)&&mh.isScalarValue(r)?n.value=r:this.items[i]=r}toJSON(e,r){let i=[];r?.onCreate&&r.onCreate(i);let n=0;for(let a of this.items)i.push(vh.toJS(a,String(n++),r));return i}toString(e,r,i){return e?ph.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:r}):JSON.stringify(this)}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r)){let o=0;for(let s of r){if(typeof n=="function"){let c=r instanceof Set?s:String(o++);s=n.call(r,c,s)}a.items.push(fh.createNode(s,void 0,i))}}return a}};function Vi(t){let e=qi.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Fc.YAMLSeq=Ba});var Rt=g(qc=>{"use strict";var gh=R(),Vc=qe(),wh={collection:"seq",default:!0,nodeClass:Vc.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return gh.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,r)=>Vc.YAMLSeq.from(t,e,r)};qc.seq=wh});var hr=g(Wc=>{"use strict";var yh=ur(),Nh={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,r,i){return e=Object.assign({actualString:!0},e),yh.stringifyString(t,e,r,i)}};Wc.string=Nh});var Wi=g(Jc=>{"use strict";var zc=O(),Gc={identify:t=>t==null,createNode:()=>new zc.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new zc.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Gc.test.test(t)?t:e.options.nullStr};Jc.nullTag=Gc});var Ma=g(Kc=>{"use strict";var bh=O(),Uc={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new bh.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},r){if(t&&Uc.test.test(t)){let i=t[0]==="t"||t[0]==="T";if(e===i)return t}return e?r.options.trueStr:r.options.falseStr}};Kc.boolTag=Uc});var _t=g(Yc=>{"use strict";function kh({format:t,minFractionDigits:e,tag:r,value:i}){if(typeof i=="bigint")return String(i);let n=typeof i=="number"?i:Number(i);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let a=Object.is(i,-0)?"-0":JSON.stringify(i);if(!t&&e&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(a)&&!a.includes("e")){let o=a.indexOf(".");o<0&&(o=a.length,a+=".");let s=e-(a.length-o-1);for(;s-- >0;)a+="0"}return a}Yc.stringifyNumber=kh});var Va=g(zi=>{"use strict";var Sh=O(),Fa=_t(),Eh={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Fa.stringifyNumber},xh={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():Fa.stringifyNumber(t)}},Ch={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){let e=new Sh.Scalar(parseFloat(t)),r=t.indexOf(".");return r!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-r-1),e},stringify:Fa.stringifyNumber};zi.float=Ch;zi.floatExp=xh;zi.floatNaN=Eh});var Wa=g(Ji=>{"use strict";var Xc=_t(),Gi=t=>typeof t=="bigint"||Number.isInteger(t),qa=(t,e,r,{intAsBigInt:i})=>i?BigInt(t):parseInt(t.substring(e),r);function Qc(t,e,r){let{value:i}=t;return Gi(i)&&i>=0?r+i.toString(e):Xc.stringifyNumber(t)}var Ph={identify:t=>Gi(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,r)=>qa(t,2,8,r),stringify:t=>Qc(t,8,"0o")},Rh={identify:Gi,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,r)=>qa(t,0,10,r),stringify:Xc.stringifyNumber},_h={identify:t=>Gi(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,r)=>qa(t,2,16,r),stringify:t=>Qc(t,16,"0x")};Ji.int=Rh;Ji.intHex=_h;Ji.intOct=Ph});var el=g(Zc=>{"use strict";var Ah=Pt(),Ih=Wi(),Th=Rt(),$h=hr(),jh=Ma(),za=Va(),Ga=Wa(),Oh=[Ah.map,Th.seq,$h.string,Ih.nullTag,jh.boolTag,Ga.intOct,Ga.int,Ga.intHex,za.floatNaN,za.floatExp,za.float];Zc.schema=Oh});var il=g(rl=>{"use strict";var Hh=O(),Dh=Pt(),Lh=Rt();function tl(t){return typeof t=="bigint"||Number.isInteger(t)}var Ui=({value:t})=>JSON.stringify(t),Bh=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Ui},{identify:t=>t==null,createNode:()=>new Hh.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ui},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Ui},{identify:tl,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:r})=>r?BigInt(t):parseInt(t,10),stringify:({value:t})=>tl(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:Ui}],Mh={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Fh=[Dh.map,Lh.seq].concat(Bh,Mh);rl.schema=Fh});var Ua=g(nl=>{"use strict";var mr=gi("buffer"),Ja=O(),Vh=ur(),qh={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof mr.Buffer=="function")return mr.Buffer.from(t,"base64");if(typeof atob=="function"){let r=atob(t.replace(/[\n\r]/g,"")),i=new Uint8Array(r.length);for(let n=0;n<r.length;++n)i[n]=r.charCodeAt(n);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:r},i,n,a){if(!r)return"";let o=r,s;if(typeof mr.Buffer=="function")s=o instanceof mr.Buffer?o.toString("base64"):mr.Buffer.from(o.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<o.length;++l)c+=String.fromCharCode(o[l]);s=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=Ja.Scalar.BLOCK_LITERAL),e!==Ja.Scalar.QUOTE_DOUBLE){let c=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),l=Math.ceil(s.length/c),d=new Array(l);for(let u=0,f=0;u<l;++u,f+=c)d[u]=s.substr(f,c);s=d.join(e===Ja.Scalar.BLOCK_LITERAL?`
55
+ `:" ")}return Vh.stringifyString({comment:t,type:e,value:s},i,n,a)}};nl.binary=qh});var Xi=g(Yi=>{"use strict";var Ki=R(),Ka=Me(),Wh=O(),zh=qe();function al(t,e){if(Ki.isSeq(t))for(let r=0;r<t.items.length;++r){let i=t.items[r];if(!Ki.isPair(i)){if(Ki.isMap(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");let n=i.items[0]||new Ka.Pair(new Wh.Scalar(null));if(i.commentBefore&&(n.key.commentBefore=n.key.commentBefore?`${i.commentBefore}
56
56
  ${n.key.commentBefore}`:i.commentBefore),i.comment){let a=n.value??n.key;a.comment=a.comment?`${i.comment}
57
- ${a.comment}`:i.comment}i=n}t.items[r]=xi.isPair(i)?i:new va.Pair(i)}}else e("Expected a sequence for this tag");return t}function yc(t,e,r){let{replacer:i}=r,n=new Op.YAMLSeq(t);n.tag="tag:yaml.org,2002:pairs";let a=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(a++),o));let s,c;if(Array.isArray(o))if(o.length===2)s=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)s=l[0],c=o[s];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else s=o;n.items.push(va.createPair(s,c,r))}return n}var Hp={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:wc,createNode:yc};Ci.createPairs=yc;Ci.pairs=Hp;Ci.resolvePairs=wc});var ya=v(wa=>{"use strict";var Nc=P(),ga=Re(),Zt=je(),Dp=Oe(),bc=Pi(),Xe=class t extends Dp.YAMLSeq{constructor(){super(),this.add=Zt.YAMLMap.prototype.add.bind(this),this.delete=Zt.YAMLMap.prototype.delete.bind(this),this.get=Zt.YAMLMap.prototype.get.bind(this),this.has=Zt.YAMLMap.prototype.has.bind(this),this.set=Zt.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let n of this.items){let a,o;if(Nc.isPair(n)?(a=ga.toJS(n.key,"",r),o=ga.toJS(n.value,a,r)):a=ga.toJS(n,"",r),i.has(a))throw new Error("Ordered maps must not include duplicate keys");i.set(a,o)}return i}static from(e,r,i){let n=bc.createPairs(e,r,i),a=new this;return a.items=n.items,a}};Xe.tag="tag:yaml.org,2002:omap";var Lp={collection:"seq",identify:t=>t instanceof Map,nodeClass:Xe,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=bc.resolvePairs(t,e),i=[];for(let{key:n}of r.items)Nc.isScalar(n)&&(i.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):i.push(n.value));return Object.assign(new Xe,r)},createNode:(t,e,r)=>Xe.from(t,e,r)};wa.YAMLOMap=Xe;wa.omap=Lp});var Cc=v(Na=>{"use strict";var kc=$();function Sc({value:t,source:e},r){return e&&(t?Ec:xc).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var Ec={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new kc.Scalar(!0),stringify:Sc},xc={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new kc.Scalar(!1),stringify:Sc};Na.falseTag=xc;Na.trueTag=Ec});var Pc=v(Ri=>{"use strict";var Bp=$(),ba=vt(),Fp={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:ba.stringifyNumber},Mp={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():ba.stringifyNumber(t)}},Vp={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Bp.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let i=t.substring(r+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:ba.stringifyNumber};Ri.float=Vp;Ri.floatExp=Mp;Ri.floatNaN=Fp});var _c=v(tr=>{"use strict";var Rc=vt(),er=t=>typeof t=="bigint"||Number.isInteger(t);function _i(t,e,r,{intAsBigInt:i}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return n==="-"?BigInt(-1)*o:o}let a=parseInt(t,r);return n==="-"?-1*a:a}function ka(t,e,r){let{value:i}=t;if(er(i)){let n=i.toString(e);return i<0?"-"+r+n.substr(1):r+n}return Rc.stringifyNumber(t)}var qp={identify:er,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>_i(t,2,2,r),stringify:t=>ka(t,2,"0b")},Wp={identify:er,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>_i(t,1,8,r),stringify:t=>ka(t,8,"0")},zp={identify:er,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>_i(t,0,10,r),stringify:Rc.stringifyNumber},Gp={identify:er,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>_i(t,2,16,r),stringify:t=>ka(t,16,"0x")};tr.int=zp;tr.intBin=qp;tr.intHex=Gp;tr.intOct=Wp});var Ea=v(Sa=>{"use strict";var Ti=P(),Ai=Te(),Ii=je(),Qe=class t extends Ii.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;Ti.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new Ai.Pair(e.key,null):r=new Ai.Pair(e,null),Ii.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let i=Ii.findPair(this.items,e);return!r&&Ti.isPair(i)?Ti.isScalar(i.key)?i.key.value:i.key:i}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let i=Ii.findPair(this.items,e);i&&!r?this.items.splice(this.items.indexOf(i),1):!i&&r&&this.items.push(new Ai.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,i);throw new Error("Set items must all have null values")}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof n=="function"&&(o=n.call(r,o,o)),a.items.push(Ai.createPair(o,null,i));return a}};Qe.tag="tag:yaml.org,2002:set";var Jp={collection:"map",identify:t=>t instanceof Set,nodeClass:Qe,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>Qe.from(t,e,r),resolve(t,e){if(Ti.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Qe,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};Sa.YAMLSet=Qe;Sa.set=Jp});var Ca=v($i=>{"use strict";var Up=vt();function xa(t,e){let r=t[0],i=r==="-"||r==="+"?t.substring(1):t,n=o=>e?BigInt(o):Number(o),a=i.replace(/_/g,"").split(":").reduce((o,s)=>o*n(60)+n(s),n(0));return r==="-"?n(-1)*a:a}function Ac(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Up.stringifyNumber(t);let i="";e<0&&(i="-",e*=r(-1));let n=r(60),a=[e%n];return e<60?a.unshift(0):(e=(e-a[0])/n,a.unshift(e%n),e>=60&&(e=(e-a[0])/n,a.unshift(e))),i+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Kp={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>xa(t,r),stringify:Ac},Yp={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>xa(t,!1),stringify:Ac},Ic={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(Ic.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,i,n,a,o,s]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,i-1,n,a||0,o||0,s||0,c),d=e[8];if(d&&d!=="Z"){let u=xa(d,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};$i.floatTime=Yp;$i.intTime=Kp;$i.timestamp=Ic});var jc=v($c=>{"use strict";var Xp=ht(),Qp=Ni(),Zp=mt(),eh=Xt(),th=ma(),Tc=Cc(),Pa=Pc(),ji=_c(),rh=fi(),ih=ya(),nh=Pi(),ah=Ea(),Ra=Ca(),oh=[Xp.map,Zp.seq,eh.string,Qp.nullTag,Tc.trueTag,Tc.falseTag,ji.intBin,ji.intOct,ji.int,ji.intHex,Pa.floatNaN,Pa.floatExp,Pa.float,th.binary,rh.merge,ih.omap,nh.pairs,ah.set,Ra.intTime,Ra.floatTime,Ra.timestamp];$c.schema=oh});var Wc=v(Ia=>{"use strict";var Lc=ht(),sh=Ni(),Bc=mt(),ch=Xt(),lh=sa(),_a=la(),Aa=da(),uh=pc(),dh=vc(),Fc=ma(),rr=fi(),Mc=ya(),Vc=Pi(),Oc=jc(),qc=Ea(),Oi=Ca(),Hc=new Map([["core",uh.schema],["failsafe",[Lc.map,Bc.seq,ch.string]],["json",dh.schema],["yaml11",Oc.schema],["yaml-1.1",Oc.schema]]),Dc={binary:Fc.binary,bool:lh.boolTag,float:_a.float,floatExp:_a.floatExp,floatNaN:_a.floatNaN,floatTime:Oi.floatTime,int:Aa.int,intHex:Aa.intHex,intOct:Aa.intOct,intTime:Oi.intTime,map:Lc.map,merge:rr.merge,null:sh.nullTag,omap:Mc.omap,pairs:Vc.pairs,seq:Bc.seq,set:qc.set,timestamp:Oi.timestamp},fh={"tag:yaml.org,2002:binary":Fc.binary,"tag:yaml.org,2002:merge":rr.merge,"tag:yaml.org,2002:omap":Mc.omap,"tag:yaml.org,2002:pairs":Vc.pairs,"tag:yaml.org,2002:set":qc.set,"tag:yaml.org,2002:timestamp":Oi.timestamp};function ph(t,e,r){let i=Hc.get(e);if(i&&!t)return r&&!i.includes(rr.merge)?i.concat(rr.merge):i.slice();let n=i;if(!n)if(Array.isArray(t))n=[];else{let a=Array.from(Hc.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${a} or define customTags array`)}if(Array.isArray(t))for(let a of t)n=n.concat(a);else typeof t=="function"&&(n=t(n.slice()));return r&&(n=n.concat(rr.merge)),n.reduce((a,o)=>{let s=typeof o=="string"?Dc[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(Dc).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return a.includes(s)||a.push(s),a},[])}Ia.coreKnownTags=fh;Ia.getTags=ph});var ja=v(zc=>{"use strict";var Ta=P(),hh=ht(),mh=mt(),vh=Xt(),Hi=Wc(),gh=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,$a=class t{constructor({compat:e,customTags:r,merge:i,resolveKnownTags:n,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?Hi.getTags(e,"compat"):e?Hi.getTags(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=n?Hi.coreKnownTags:{},this.tags=Hi.getTags(r,this.name,i),this.toStringOptions=s??null,Object.defineProperty(this,Ta.MAP,{value:hh.map}),Object.defineProperty(this,Ta.SCALAR,{value:vh.string}),Object.defineProperty(this,Ta.SEQ,{value:mh.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?gh:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};zc.Schema=$a});var Jc=v(Gc=>{"use strict";var wh=P(),Oa=Ut(),ir=Wt();function yh(t,e){let r=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&r.push("---");let n=Oa.createStringifyContext(t,e),{commentString:a}=n.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=a(t.commentBefore);r.unshift(ir.indentComment(c,""))}let o=!1,s=null;if(t.contents){if(wh.isNode(t.contents)){if(t.contents.spaceBefore&&i&&r.push(""),t.contents.commentBefore){let d=a(t.contents.commentBefore);r.push(ir.indentComment(d,""))}n.forceBlockIndent=!!t.comment,s=t.contents.comment}let c=s?void 0:()=>o=!0,l=Oa.stringify(t.contents,n,()=>s=null,c);s&&(l+=ir.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(Oa.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let c=a(t.comment);c.includes(`
58
- `)?(r.push("..."),r.push(ir.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||s)&&r[r.length-1]!==""&&r.push(""),r.push(ir.indentComment(a(c),"")))}return r.join(`
57
+ ${a.comment}`:i.comment}i=n}t.items[r]=Ki.isPair(i)?i:new Ka.Pair(i)}}else e("Expected a sequence for this tag");return t}function ol(t,e,r){let{replacer:i}=r,n=new zh.YAMLSeq(t);n.tag="tag:yaml.org,2002:pairs";let a=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof i=="function"&&(o=i.call(e,String(a++),o));let s,c;if(Array.isArray(o))if(o.length===2)s=o[0],c=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){let l=Object.keys(o);if(l.length===1)s=l[0],c=o[s];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else s=o;n.items.push(Ka.createPair(s,c,r))}return n}var Gh={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:al,createNode:ol};Yi.createPairs=ol;Yi.pairs=Gh;Yi.resolvePairs=al});var Qa=g(Xa=>{"use strict";var sl=R(),Ya=He(),vr=Ve(),Jh=qe(),cl=Xi(),at=class t extends Jh.YAMLSeq{constructor(){super(),this.add=vr.YAMLMap.prototype.add.bind(this),this.delete=vr.YAMLMap.prototype.delete.bind(this),this.get=vr.YAMLMap.prototype.get.bind(this),this.has=vr.YAMLMap.prototype.has.bind(this),this.set=vr.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let n of this.items){let a,o;if(sl.isPair(n)?(a=Ya.toJS(n.key,"",r),o=Ya.toJS(n.value,a,r)):a=Ya.toJS(n,"",r),i.has(a))throw new Error("Ordered maps must not include duplicate keys");i.set(a,o)}return i}static from(e,r,i){let n=cl.createPairs(e,r,i),a=new this;return a.items=n.items,a}};at.tag="tag:yaml.org,2002:omap";var Uh={collection:"seq",identify:t=>t instanceof Map,nodeClass:at,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let r=cl.resolvePairs(t,e),i=[];for(let{key:n}of r.items)sl.isScalar(n)&&(i.includes(n.value)?e(`Ordered maps must not include duplicate keys: ${n.value}`):i.push(n.value));return Object.assign(new at,r)},createNode:(t,e,r)=>at.from(t,e,r)};Xa.YAMLOMap=at;Xa.omap=Uh});var pl=g(Za=>{"use strict";var ll=O();function ul({value:t,source:e},r){return e&&(t?dl:fl).test.test(e)?e:t?r.options.trueStr:r.options.falseStr}var dl={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ll.Scalar(!0),stringify:ul},fl={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ll.Scalar(!1),stringify:ul};Za.falseTag=fl;Za.trueTag=dl});var hl=g(Qi=>{"use strict";var Kh=O(),eo=_t(),Yh={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:eo.stringifyNumber},Xh={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){let e=Number(t.value);return isFinite(e)?e.toExponential():eo.stringifyNumber(t)}},Qh={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){let e=new Kh.Scalar(parseFloat(t.replace(/_/g,""))),r=t.indexOf(".");if(r!==-1){let i=t.substring(r+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:eo.stringifyNumber};Qi.float=Qh;Qi.floatExp=Xh;Qi.floatNaN=Yh});var vl=g(wr=>{"use strict";var ml=_t(),gr=t=>typeof t=="bigint"||Number.isInteger(t);function Zi(t,e,r,{intAsBigInt:i}){let n=t[0];if((n==="-"||n==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),i){switch(r){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let o=BigInt(t);return n==="-"?BigInt(-1)*o:o}let a=parseInt(t,r);return n==="-"?-1*a:a}function to(t,e,r){let{value:i}=t;if(gr(i)){let n=i.toString(e);return i<0?"-"+r+n.substr(1):r+n}return ml.stringifyNumber(t)}var Zh={identify:gr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,r)=>Zi(t,2,2,r),stringify:t=>to(t,2,"0b")},em={identify:gr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,r)=>Zi(t,1,8,r),stringify:t=>to(t,8,"0")},tm={identify:gr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,r)=>Zi(t,0,10,r),stringify:ml.stringifyNumber},rm={identify:gr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,r)=>Zi(t,2,16,r),stringify:t=>to(t,16,"0x")};wr.int=tm;wr.intBin=Zh;wr.intHex=rm;wr.intOct=em});var io=g(ro=>{"use strict";var rn=R(),en=Me(),tn=Ve(),ot=class t extends tn.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let r;rn.isPair(e)?r=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?r=new en.Pair(e.key,null):r=new en.Pair(e,null),tn.findPair(this.items,r.key)||this.items.push(r)}get(e,r){let i=tn.findPair(this.items,e);return!r&&rn.isPair(i)?rn.isScalar(i.key)?i.key.value:i.key:i}set(e,r){if(typeof r!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof r}`);let i=tn.findPair(this.items,e);i&&!r?this.items.splice(this.items.indexOf(i),1):!i&&r&&this.items.push(new en.Pair(e))}toJSON(e,r){return super.toJSON(e,r,Set)}toString(e,r,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),r,i);throw new Error("Set items must all have null values")}static from(e,r,i){let{replacer:n}=i,a=new this(e);if(r&&Symbol.iterator in Object(r))for(let o of r)typeof n=="function"&&(o=n.call(r,o,o)),a.items.push(en.createPair(o,null,i));return a}};ot.tag="tag:yaml.org,2002:set";var im={collection:"map",identify:t=>t instanceof Set,nodeClass:ot,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,r)=>ot.from(t,e,r),resolve(t,e){if(rn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new ot,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ro.YAMLSet=ot;ro.set=im});var ao=g(nn=>{"use strict";var nm=_t();function no(t,e){let r=t[0],i=r==="-"||r==="+"?t.substring(1):t,n=o=>e?BigInt(o):Number(o),a=i.replace(/_/g,"").split(":").reduce((o,s)=>o*n(60)+n(s),n(0));return r==="-"?n(-1)*a:a}function gl(t){let{value:e}=t,r=o=>o;if(typeof e=="bigint")r=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return nm.stringifyNumber(t);let i="";e<0&&(i="-",e*=r(-1));let n=r(60),a=[e%n];return e<60?a.unshift(0):(e=(e-a[0])/n,a.unshift(e%n),e>=60&&(e=(e-a[0])/n,a.unshift(e))),i+a.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var am={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,e,{intAsBigInt:r})=>no(t,r),stringify:gl},om={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>no(t,!1),stringify:gl},wl={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){let e=t.match(wl.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,i,n,a,o,s]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(r,i-1,n,a||0,o||0,s||0,c),d=e[8];if(d&&d!=="Z"){let u=no(d,!1);Math.abs(u)<30&&(u*=60),l-=6e4*u}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};nn.floatTime=om;nn.intTime=am;nn.timestamp=wl});var bl=g(Nl=>{"use strict";var sm=Pt(),cm=Wi(),lm=Rt(),um=hr(),dm=Ua(),yl=pl(),oo=hl(),an=vl(),fm=Hi(),pm=Qa(),hm=Xi(),mm=io(),so=ao(),vm=[sm.map,lm.seq,um.string,cm.nullTag,yl.trueTag,yl.falseTag,an.intBin,an.intOct,an.int,an.intHex,oo.floatNaN,oo.floatExp,oo.float,dm.binary,fm.merge,pm.omap,hm.pairs,mm.set,so.intTime,so.floatTime,so.timestamp];Nl.schema=vm});var Il=g(uo=>{"use strict";var xl=Pt(),gm=Wi(),Cl=Rt(),wm=hr(),ym=Ma(),co=Va(),lo=Wa(),Nm=el(),bm=il(),Pl=Ua(),yr=Hi(),Rl=Qa(),_l=Xi(),kl=bl(),Al=io(),on=ao(),Sl=new Map([["core",Nm.schema],["failsafe",[xl.map,Cl.seq,wm.string]],["json",bm.schema],["yaml11",kl.schema],["yaml-1.1",kl.schema]]),El={binary:Pl.binary,bool:ym.boolTag,float:co.float,floatExp:co.floatExp,floatNaN:co.floatNaN,floatTime:on.floatTime,int:lo.int,intHex:lo.intHex,intOct:lo.intOct,intTime:on.intTime,map:xl.map,merge:yr.merge,null:gm.nullTag,omap:Rl.omap,pairs:_l.pairs,seq:Cl.seq,set:Al.set,timestamp:on.timestamp},km={"tag:yaml.org,2002:binary":Pl.binary,"tag:yaml.org,2002:merge":yr.merge,"tag:yaml.org,2002:omap":Rl.omap,"tag:yaml.org,2002:pairs":_l.pairs,"tag:yaml.org,2002:set":Al.set,"tag:yaml.org,2002:timestamp":on.timestamp};function Sm(t,e,r){let i=Sl.get(e);if(i&&!t)return r&&!i.includes(yr.merge)?i.concat(yr.merge):i.slice();let n=i;if(!n)if(Array.isArray(t))n=[];else{let a=Array.from(Sl.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${a} or define customTags array`)}if(Array.isArray(t))for(let a of t)n=n.concat(a);else typeof t=="function"&&(n=t(n.slice()));return r&&(n=n.concat(yr.merge)),n.reduce((a,o)=>{let s=typeof o=="string"?El[o]:o;if(!s){let c=JSON.stringify(o),l=Object.keys(El).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return a.includes(s)||a.push(s),a},[])}uo.coreKnownTags=km;uo.getTags=Sm});var ho=g(Tl=>{"use strict";var fo=R(),Em=Pt(),xm=Rt(),Cm=hr(),sn=Il(),Pm=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,po=class t{constructor({compat:e,customTags:r,merge:i,resolveKnownTags:n,schema:a,sortMapEntries:o,toStringDefaults:s}){this.compat=Array.isArray(e)?sn.getTags(e,"compat"):e?sn.getTags(null,e):null,this.name=typeof a=="string"&&a||"core",this.knownTags=n?sn.coreKnownTags:{},this.tags=sn.getTags(r,this.name,i),this.toStringOptions=s??null,Object.defineProperty(this,fo.MAP,{value:Em.map}),Object.defineProperty(this,fo.SCALAR,{value:Cm.string}),Object.defineProperty(this,fo.SEQ,{value:xm.seq}),this.sortMapEntries=typeof o=="function"?o:o===!0?Pm:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Tl.Schema=po});var jl=g($l=>{"use strict";var Rm=R(),mo=dr(),Nr=sr();function _m(t,e){let r=[],i=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(r.push(c),i=!0):t.directives.docStart&&(i=!0)}i&&r.push("---");let n=mo.createStringifyContext(t,e),{commentString:a}=n.options;if(t.commentBefore){r.length!==1&&r.unshift("");let c=a(t.commentBefore);r.unshift(Nr.indentComment(c,""))}let o=!1,s=null;if(t.contents){if(Rm.isNode(t.contents)){if(t.contents.spaceBefore&&i&&r.push(""),t.contents.commentBefore){let d=a(t.contents.commentBefore);r.push(Nr.indentComment(d,""))}n.forceBlockIndent=!!t.comment,s=t.contents.comment}let c=s?void 0:()=>o=!0,l=mo.stringify(t.contents,n,()=>s=null,c);s&&(l+=Nr.lineComment(l,"",a(s))),(l[0]==="|"||l[0]===">")&&r[r.length-1]==="---"?r[r.length-1]=`--- ${l}`:r.push(l)}else r.push(mo.stringify(t.contents,n));if(t.directives?.docEnd)if(t.comment){let c=a(t.comment);c.includes(`
58
+ `)?(r.push("..."),r.push(Nr.indentComment(c,""))):r.push(`... ${c}`)}else r.push("...");else{let c=t.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||s)&&r[r.length-1]!==""&&r.push(""),r.push(Nr.indentComment(a(c),"")))}return r.join(`
59
59
  `)+`
60
- `}Gc.stringifyDocument=yh});var nr=v(Uc=>{"use strict";var Nh=Vt(),gt=ri(),X=P(),bh=Te(),kh=Re(),Sh=ja(),Eh=Jc(),Ha=Qr(),xh=Fn(),Ch=qt(),Da=Bn(),La=class t{constructor(e,r,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,X.NODE_TYPE,{value:X.DOC});let n=null;typeof r=="function"||Array.isArray(r)?n=r:i===void 0&&r&&(i=r,r=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=a;let{version:o}=a;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new Da.Directives({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,n,i)}clone(){let e=Object.create(t.prototype,{[X.NODE_TYPE]:{value:X.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=X.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){wt(this.contents)&&this.contents.add(e)}addIn(e,r){wt(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let i=Ha.anchorNames(this);e.anchor=!r||i.has(r)?Ha.findNewAnchor(r||"a",i):r}return new Nh.Alias(e.anchor)}createNode(e,r,i){let n;if(typeof r=="function")e=r.call({"":e},"",e),n=r;else if(Array.isArray(r)){let h=N=>typeof N=="number"||N instanceof String||N instanceof Number,w=r.filter(h).map(String);w.length>0&&(r=r.concat(w)),n=r}else i===void 0&&r&&(i=r,r=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:c,onTagObj:l,tag:d}=i??{},{onAnchor:u,setAnchors:f,sourceObjects:m}=Ha.createNodeAnchors(this,o||"a"),g={aliasDuplicateObjects:a??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:n,schema:this.schema,sourceObjects:m},p=Ch.createNode(e,d,g);return s&&X.isCollection(p)&&(p.flow=!0),f(),p}createPair(e,r,i={}){let n=this.createNode(e,null,i),a=this.createNode(r,null,i);return new bh.Pair(n,a)}delete(e){return wt(this.contents)?this.contents.delete(e):!1}deleteIn(e){return gt.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):wt(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return X.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return gt.isEmptyPath(e)?!r&&X.isScalar(this.contents)?this.contents.value:this.contents:X.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return X.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return gt.isEmptyPath(e)?this.contents!==void 0:X.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=gt.collectionFromPath(this.schema,[e],r):wt(this.contents)&&this.contents.set(e,r)}setIn(e,r){gt.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=gt.collectionFromPath(this.schema,Array.from(e),r):wt(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Da.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Da.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(i)this.schema=new Sh.Schema(Object.assign(i,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:i,maxAliasCount:n,onAnchor:a,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},c=kh.toJS(this.contents,r??"",s);if(typeof a=="function")for(let{count:l,res:d}of s.anchors.values())a(d,l);return typeof o=="function"?xh.applyReviver(o,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return Eh.stringifyDocument(this,e)}};function wt(t){if(X.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Uc.Document=La});var sr=v(or=>{"use strict";var ar=class extends Error{constructor(e,r,i,n){super(),this.name=e,this.code=i,this.message=n,this.pos=r}},Ba=class extends ar{constructor(e,r,i){super("YAMLParseError",e,r,i)}},Fa=class extends ar{constructor(e,r,i){super("YAMLWarning",e,r,i)}},Ph=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(s=>e.linePos(s));let{line:i,col:n}=r.linePos[0];r.message+=` at line ${i}, column ${n}`;let a=n-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){let s=Math.min(a-39,o.length-79);o="…"+o.substring(s),a-=s-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,a))){let s=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);s.length>80&&(s=s.substring(0,79)+`…
60
+ `}$l.stringifyDocument=_m});var br=g(Ol=>{"use strict";var Am=ar(),At=Ci(),te=R(),Im=Me(),Tm=He(),$m=ho(),jm=jl(),vo=ki(),Om=ya(),Hm=or(),go=wa(),wo=class t{constructor(e,r,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,te.NODE_TYPE,{value:te.DOC});let n=null;typeof r=="function"||Array.isArray(r)?n=r:i===void 0&&r&&(i=r,r=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=a;let{version:o}=a;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new go.Directives({version:o}),this.setSchema(o,i),this.contents=e===void 0?null:this.createNode(e,n,i)}clone(){let e=Object.create(t.prototype,{[te.NODE_TYPE]:{value:te.DOC}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=te.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){It(this.contents)&&this.contents.add(e)}addIn(e,r){It(this.contents)&&this.contents.addIn(e,r)}createAlias(e,r){if(!e.anchor){let i=vo.anchorNames(this);e.anchor=!r||i.has(r)?vo.findNewAnchor(r||"a",i):r}return new Am.Alias(e.anchor)}createNode(e,r,i){let n;if(typeof r=="function")e=r.call({"":e},"",e),n=r;else if(Array.isArray(r)){let m=y=>typeof y=="number"||y instanceof String||y instanceof Number,w=r.filter(m).map(String);w.length>0&&(r=r.concat(w)),n=r}else i===void 0&&r&&(i=r,r=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:c,onTagObj:l,tag:d}=i??{},{onAnchor:u,setAnchors:f,sourceObjects:h}=vo.createNodeAnchors(this,o||"a"),v={aliasDuplicateObjects:a??!0,keepUndefined:c??!1,onAnchor:u,onTagObj:l,replacer:n,schema:this.schema,sourceObjects:h},p=Hm.createNode(e,d,v);return s&&te.isCollection(p)&&(p.flow=!0),f(),p}createPair(e,r,i={}){let n=this.createNode(e,null,i),a=this.createNode(r,null,i);return new Im.Pair(n,a)}delete(e){return It(this.contents)?this.contents.delete(e):!1}deleteIn(e){return At.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):It(this.contents)?this.contents.deleteIn(e):!1}get(e,r){return te.isCollection(this.contents)?this.contents.get(e,r):void 0}getIn(e,r){return At.isEmptyPath(e)?!r&&te.isScalar(this.contents)?this.contents.value:this.contents:te.isCollection(this.contents)?this.contents.getIn(e,r):void 0}has(e){return te.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return At.isEmptyPath(e)?this.contents!==void 0:te.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,r){this.contents==null?this.contents=At.collectionFromPath(this.schema,[e],r):It(this.contents)&&this.contents.set(e,r)}setIn(e,r){At.isEmptyPath(e)?this.contents=r:this.contents==null?this.contents=At.collectionFromPath(this.schema,Array.from(e),r):It(this.contents)&&this.contents.setIn(e,r)}setSchema(e,r={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new go.Directives({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new go.Directives({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{let n=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${n}`)}}if(r.schema instanceof Object)this.schema=r.schema;else if(i)this.schema=new $m.Schema(Object.assign(i,r));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:r,mapAsMap:i,maxAliasCount:n,onAnchor:a,reviver:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof n=="number"?n:100},c=Tm.toJS(this.contents,r??"",s);if(typeof a=="function")for(let{count:l,res:d}of s.anchors.values())a(d,l);return typeof o=="function"?Om.applyReviver(o,{"":c},"",c):c}toJSON(e,r){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:r})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let r=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${r}`)}return jm.stringifyDocument(this,e)}};function It(t){if(te.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}Ol.Document=wo});var Er=g(Sr=>{"use strict";var kr=class extends Error{constructor(e,r,i,n){super(),this.name=e,this.code=i,this.message=n,this.pos=r}},yo=class extends kr{constructor(e,r,i){super("YAMLParseError",e,r,i)}},No=class extends kr{constructor(e,r,i){super("YAMLWarning",e,r,i)}},Dm=(t,e)=>r=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map(s=>e.linePos(s));let{line:i,col:n}=r.linePos[0];r.message+=` at line ${i}, column ${n}`;let a=n-1,o=t.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(a>=60&&o.length>80){let s=Math.min(a-39,o.length-79);o="…"+o.substring(s),a-=s-1}if(o.length>80&&(o=o.substring(0,79)+"…"),i>1&&/^ *$/.test(o.substring(0,a))){let s=t.substring(e.lineStarts[i-2],e.lineStarts[i-1]);s.length>80&&(s=s.substring(0,79)+`…
61
61
  `),o=s+o}if(/[^ ]/.test(o)){let s=1,c=r.linePos[1];c?.line===i&&c.col>n&&(s=Math.max(1,Math.min(c.col-n,80-a)));let l=" ".repeat(a)+"^".repeat(s);r.message+=`:
62
62
 
63
63
  ${o}
64
64
  ${l}
65
- `}};or.YAMLError=ar;or.YAMLParseError=Ba;or.YAMLWarning=Fa;or.prettifyError=Ph});var cr=v(Kc=>{"use strict";function Rh(t,{flow:e,indicator:r,next:i,offset:n,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,d=s,u="",f="",m=!1,g=!1,p=null,h=null,w=null,N=null,k=null,S=null,E=null;for(let y of t)switch(g&&(y.type!=="space"&&y.type!=="newline"&&y.type!=="comma"&&a(y.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),p&&(l&&y.type!=="comment"&&y.type!=="newline"&&a(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),y.type){case"space":!e&&(r!=="doc-start"||i?.type!=="flow-collection")&&y.source.includes(" ")&&(p=y),d=!0;break;case"comment":{d||a(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let j=y.source.substring(1)||" ";u?u+=f+j:u=j,f="",l=!1;break}case"newline":l?u?u+=y.source:(!S||r!=="seq-item-ind")&&(c=!0):f+=y.source,l=!0,m=!0,(h||w)&&(N=y),d=!0;break;case"anchor":h&&a(y,"MULTIPLE_ANCHORS","A node can have at most one anchor"),y.source.endsWith(":")&&a(y.offset+y.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=y,E??(E=y.offset),l=!1,d=!1,g=!0;break;case"tag":{w&&a(y,"MULTIPLE_TAGS","A node can have at most one tag"),w=y,E??(E=y.offset),l=!1,d=!1,g=!0;break}case r:(h||w)&&a(y,"BAD_PROP_ORDER",`Anchors and tags must be after the ${y.source} indicator`),S&&a(y,"UNEXPECTED_TOKEN",`Unexpected ${y.source} in ${e??"collection"}`),S=y,l=r==="seq-item-ind"||r==="explicit-key-ind",d=!1;break;case"comma":if(e){k&&a(y,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=y,l=!1,d=!1;break}default:a(y,"UNEXPECTED_TOKEN",`Unexpected ${y.type} token`),l=!1,d=!1}let x=t[t.length-1],_=x?x.offset+x.source.length:n;return g&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&a(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&a(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:S,spaceBefore:c,comment:u,hasNewline:m,anchor:h,tag:w,newlineAfterProp:N,end:_,start:E??_}}Kc.resolveProps=Rh});var Di=v(Yc=>{"use strict";function Ma(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
66
- `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(Ma(e.key)||Ma(e.value))return!0}return!1;default:return!0}}Yc.containsNewline=Ma});var Va=v(Xc=>{"use strict";var _h=Di();function Ah(t,e,r){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&_h.containsNewline(e)&&r(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Xc.flowIndentCheck=Ah});var qa=v(Zc=>{"use strict";var Qc=P();function Ih(t,e,r){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let n=typeof i=="function"?i:(a,o)=>a===o||Qc.isScalar(a)&&Qc.isScalar(o)&&a.value===o.value;return e.some(a=>n(a.key,r))}Zc.mapIncludes=Ih});var al=v(nl=>{"use strict";var el=Te(),Th=je(),tl=cr(),$h=Di(),rl=Va(),jh=qa(),il="All mapping items must start at the same column";function Oh({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=a?.nodeClass??Th.YAMLMap,s=new o(r.schema);r.atRoot&&(r.atRoot=!1);let c=i.offset,l=null;for(let d of i.items){let{start:u,key:f,sep:m,value:g}=d,p=tl.resolveProps(u,{indicator:"explicit-key-ind",next:f??m?.[0],offset:c,onError:n,parentIndent:i.indent,startOnNewline:!0}),h=!p.found;if(h){if(f&&(f.type==="block-seq"?n(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==i.indent&&n(c,"BAD_INDENT",il)),!p.anchor&&!p.tag&&!m){l=p.end,p.comment&&(s.comment?s.comment+=`
67
- `+p.comment:s.comment=p.comment);continue}(p.newlineAfterProp||$h.containsNewline(f))&&n(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==i.indent&&n(c,"BAD_INDENT",il);r.atKey=!0;let w=p.end,N=f?t(r,f,p,n):e(r,w,u,null,p,n);r.schema.compat&&rl.flowIndentCheck(i.indent,f,n),r.atKey=!1,jh.mapIncludes(r,s.items,N)&&n(w,"DUPLICATE_KEY","Map keys must be unique");let k=tl.resolveProps(m??[],{indicator:"map-value-ind",next:g,offset:N.range[2],onError:n,parentIndent:i.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=k.end,k.found){h&&(g?.type==="block-map"&&!k.hasNewline&&n(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&p.start<k.found.offset-1024&&n(N.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let S=g?t(r,g,k,n):e(r,c,m,null,k,n);r.schema.compat&&rl.flowIndentCheck(i.indent,g,n),c=S.range[2];let E=new el.Pair(N,S);r.options.keepSourceTokens&&(E.srcToken=d),s.items.push(E)}else{h&&n(N.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(N.comment?N.comment+=`
68
- `+k.comment:N.comment=k.comment);let S=new el.Pair(N);r.options.keepSourceTokens&&(S.srcToken=d),s.items.push(S)}}return l&&l<c&&n(l,"IMPOSSIBLE","Map comment with trailing content"),s.range=[i.offset,c,l??c],s}nl.resolveBlockMap=Oh});var sl=v(ol=>{"use strict";var Hh=Oe(),Dh=cr(),Lh=Va();function Bh({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=a?.nodeClass??Hh.YAMLSeq,s=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=i.offset,l=null;for(let{start:d,value:u}of i.items){let f=Dh.resolveProps(d,{indicator:"seq-item-ind",next:u,offset:c,onError:n,parentIndent:i.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?n(f.end,"BAD_INDENT","All sequence items must start at the same column"):n(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(s.comment=f.comment);continue}let m=u?t(r,u,f,n):e(r,f.end,d,null,f,n);r.schema.compat&&Lh.flowIndentCheck(i.indent,u,n),c=m.range[2],s.items.push(m)}return s.range=[i.offset,c,l??c],s}ol.resolveBlockSeq=Bh});var yt=v(cl=>{"use strict";function Fh(t,e,r,i){let n="";if(t){let a=!1,o="";for(let s of t){let{source:c,type:l}=s;switch(l){case"space":a=!0;break;case"comment":{r&&!a&&i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=c.substring(1)||" ";n?n+=o+d:n=d,o="";break}case"newline":n&&(o+=c),a=!0;break;default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:n,offset:e}}cl.resolveEnd=Fh});var fl=v(dl=>{"use strict";var Mh=P(),Vh=Te(),ll=je(),qh=Oe(),Wh=yt(),ul=cr(),zh=Di(),Gh=qa(),Wa="Block collections are not allowed within flow collections",za=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Jh({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=i.start.source==="{",s=o?"flow map":"flow sequence",c=a?.nodeClass??(o?ll.YAMLMap:qh.YAMLSeq),l=new c(r.schema);l.flow=!0;let d=r.atRoot;d&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let u=i.offset+i.start.source.length;for(let h=0;h<i.items.length;++h){let w=i.items[h],{start:N,key:k,sep:S,value:E}=w,x=ul.resolveProps(N,{flow:s,indicator:"explicit-key-ind",next:k??S?.[0],offset:u,onError:n,parentIndent:i.indent,startOnNewline:!1});if(!x.found){if(!x.anchor&&!x.tag&&!S&&!E){h===0&&x.comma?n(x.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`):h<i.items.length-1&&n(x.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${s}`),x.comment&&(l.comment?l.comment+=`
69
- `+x.comment:l.comment=x.comment),u=x.end;continue}!o&&r.options.strict&&zh.containsNewline(k)&&n(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0)x.comma&&n(x.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`);else if(x.comma||n(x.start,"MISSING_CHAR",`Missing , between ${s} items`),x.comment){let _="";e:for(let y of N)switch(y.type){case"comma":case"space":break;case"comment":_=y.source.substring(1);break e;default:break e}if(_){let y=l.items[l.items.length-1];Mh.isPair(y)&&(y=y.value??y.key),y.comment?y.comment+=`
70
- `+_:y.comment=_,x.comment=x.comment.substring(_.length+1)}}if(!o&&!S&&!x.found){let _=E?t(r,E,x,n):e(r,x.end,S,null,x,n);l.items.push(_),u=_.range[2],za(E)&&n(_.range,"BLOCK_IN_FLOW",Wa)}else{r.atKey=!0;let _=x.end,y=k?t(r,k,x,n):e(r,_,N,null,x,n);za(k)&&n(y.range,"BLOCK_IN_FLOW",Wa),r.atKey=!1;let j=ul.resolveProps(S??[],{flow:s,indicator:"map-value-ind",next:E,offset:y.range[2],onError:n,parentIndent:i.indent,startOnNewline:!1});if(j.found){if(!o&&!x.found&&r.options.strict){if(S)for(let O of S){if(O===j.found)break;if(O.type==="newline"){n(O,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}x.start<j.found.offset-1024&&n(j.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source?.[0]===":"?n(E,"MISSING_CHAR",`Missing space after : in ${s}`):n(j.start,"MISSING_CHAR",`Missing , or : between ${s} items`));let Ce=E?t(r,E,j,n):j.found?e(r,j.end,S,null,j,n):null;Ce?za(E)&&n(Ce.range,"BLOCK_IN_FLOW",Wa):j.comment&&(y.comment?y.comment+=`
71
- `+j.comment:y.comment=j.comment);let lt=new Vh.Pair(y,Ce);if(r.options.keepSourceTokens&&(lt.srcToken=w),o){let O=l;Gh.mapIncludes(r,O.items,y)&&n(_,"DUPLICATE_KEY","Map keys must be unique"),O.items.push(lt)}else{let O=new ll.YAMLMap(r.schema);O.flow=!0,O.items.push(lt);let ds=(Ce??y).range;O.range=[y.range[0],ds[1],ds[2]],l.items.push(O)}u=Ce?Ce.range[2]:j.end}}let f=o?"}":"]",[m,...g]=i.end,p=u;if(m?.source===f)p=m.offset+m.source.length;else{let h=s[0].toUpperCase()+s.substring(1),w=d?`${h} must end with a ${f}`:`${h} in block collection must be sufficiently indented and end with a ${f}`;n(u,d?"MISSING_CHAR":"BAD_INDENT",w),m&&m.source.length!==1&&g.unshift(m)}if(g.length>0){let h=Wh.resolveEnd(g,p,r.options.strict,n);h.comment&&(l.comment?l.comment+=`
72
- `+h.comment:l.comment=h.comment),l.range=[i.offset,p,h.offset]}else l.range=[i.offset,p,p];return l}dl.resolveFlowCollection=Jh});var hl=v(pl=>{"use strict";var Uh=P(),Kh=$(),Yh=je(),Xh=Oe(),Qh=al(),Zh=sl(),em=fl();function Ga(t,e,r,i,n,a){let o=r.type==="block-map"?Qh.resolveBlockMap(t,e,r,i,a):r.type==="block-seq"?Zh.resolveBlockSeq(t,e,r,i,a):em.resolveFlowCollection(t,e,r,i,a),s=o.constructor;return n==="!"||n===s.tagName?(o.tag=s.tagName,o):(n&&(o.tag=n),o)}function tm(t,e,r,i,n){let a=i.tag,o=a?e.directives.tagName(a.source,f=>n(a,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:m}=i,g=f&&a?f.offset>a.offset?f:a:f??a;g&&(!m||m.offset<g.offset)&&n(g,"MISSING_CHAR","Missing newline after block sequence props")}let s=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===Yh.YAMLMap.tagName&&s==="map"||o===Xh.YAMLSeq.tagName&&s==="seq")return Ga(t,e,r,n,o);let c=e.schema.tags.find(f=>f.tag===o&&f.collection===s);if(!c){let f=e.schema.knownTags[o];if(f?.collection===s)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?n(a,"BAD_COLLECTION_TYPE",`${f.tag} used for ${s} collection, but expects ${f.collection??"scalar"}`,!0):n(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Ga(t,e,r,n,o)}let l=Ga(t,e,r,n,o,c),d=c.resolve?.(l,f=>n(a,"TAG_RESOLVE_FAILED",f),e.options)??l,u=Uh.isNode(d)?d:new Kh.Scalar(d);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}pl.composeCollection=tm});var Ua=v(ml=>{"use strict";var Ja=$();function rm(t,e,r){let i=e.offset,n=im(e,t.options.strict,r);if(!n)return{value:"",type:null,comment:"",range:[i,i,i]};let a=n.mode===">"?Ja.Scalar.BLOCK_FOLDED:Ja.Scalar.BLOCK_LITERAL,o=e.source?nm(e.source):[],s=o.length;for(let p=o.length-1;p>=0;--p){let h=o[p][1];if(h===""||h==="\r")s=p;else break}if(s===0){let p=n.chomp==="+"&&o.length>0?`
73
- `.repeat(Math.max(1,o.length-1)):"",h=i+n.length;return e.source&&(h+=e.source.length),{value:p,type:a,comment:n.comment,range:[i,h,h]}}let c=e.indent+n.indent,l=e.offset+n.length,d=0;for(let p=0;p<s;++p){let[h,w]=o[p];if(w===""||w==="\r")n.indent===0&&h.length>c&&(c=h.length);else{h.length<c&&r(l+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),n.indent===0&&(c=h.length),d=p,c===0&&!t.atRoot&&r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=h.length+w.length+1}for(let p=o.length-1;p>=s;--p)o[p][0].length>c&&(s=p+1);let u="",f="",m=!1;for(let p=0;p<d;++p)u+=o[p][0].slice(c)+`
74
- `;for(let p=d;p<s;++p){let[h,w]=o[p];l+=h.length+w.length+1;let N=w[w.length-1]==="\r";if(N&&(w=w.slice(0,-1)),w&&h.length<c){let S=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;r(l-w.length-(N?2:1),"BAD_INDENT",S),h=""}a===Ja.Scalar.BLOCK_LITERAL?(u+=f+h.slice(c)+w,f=`
75
- `):h.length>c||w[0]===" "?(f===" "?f=`
76
- `:!m&&f===`
65
+ `}};Sr.YAMLError=kr;Sr.YAMLParseError=yo;Sr.YAMLWarning=No;Sr.prettifyError=Dm});var xr=g(Hl=>{"use strict";function Lm(t,{flow:e,indicator:r,next:i,offset:n,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,d=s,u="",f="",h=!1,v=!1,p=null,m=null,w=null,y=null,k=null,x=null,E=null;for(let N of t)switch(v&&(N.type!=="space"&&N.type!=="newline"&&N.type!=="comma"&&a(N.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v=!1),p&&(l&&N.type!=="comment"&&N.type!=="newline"&&a(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),N.type){case"space":!e&&(r!=="doc-start"||i?.type!=="flow-collection")&&N.source.includes(" ")&&(p=N),d=!0;break;case"comment":{d||a(N,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let H=N.source.substring(1)||" ";u?u+=f+H:u=H,f="",l=!1;break}case"newline":l?u?u+=N.source:(!x||r!=="seq-item-ind")&&(c=!0):f+=N.source,l=!0,h=!0,(m||w)&&(y=N),d=!0;break;case"anchor":m&&a(N,"MULTIPLE_ANCHORS","A node can have at most one anchor"),N.source.endsWith(":")&&a(N.offset+N.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),m=N,E??(E=N.offset),l=!1,d=!1,v=!0;break;case"tag":{w&&a(N,"MULTIPLE_TAGS","A node can have at most one tag"),w=N,E??(E=N.offset),l=!1,d=!1,v=!0;break}case r:(m||w)&&a(N,"BAD_PROP_ORDER",`Anchors and tags must be after the ${N.source} indicator`),x&&a(N,"UNEXPECTED_TOKEN",`Unexpected ${N.source} in ${e??"collection"}`),x=N,l=r==="seq-item-ind"||r==="explicit-key-ind",d=!1;break;case"comma":if(e){k&&a(N,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=N,l=!1,d=!1;break}default:a(N,"UNEXPECTED_TOKEN",`Unexpected ${N.type} token`),l=!1,d=!1}let S=t[t.length-1],I=S?S.offset+S.source.length:n;return v&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&a(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(l&&p.indent<=o||i?.type==="block-map"||i?.type==="block-seq")&&a(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:x,spaceBefore:c,comment:u,hasNewline:h,anchor:m,tag:w,newlineAfterProp:y,end:I,start:E??I}}Hl.resolveProps=Lm});var cn=g(Dl=>{"use strict";function bo(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
66
+ `))return!0;if(t.end){for(let e of t.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(let e of t.items){for(let r of e.start)if(r.type==="newline")return!0;if(e.sep){for(let r of e.sep)if(r.type==="newline")return!0}if(bo(e.key)||bo(e.value))return!0}return!1;default:return!0}}Dl.containsNewline=bo});var ko=g(Ll=>{"use strict";var Bm=cn();function Mm(t,e,r){if(e?.type==="flow-collection"){let i=e.end[0];i.indent===t&&(i.source==="]"||i.source==="}")&&Bm.containsNewline(e)&&r(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Ll.flowIndentCheck=Mm});var So=g(Ml=>{"use strict";var Bl=R();function Fm(t,e,r){let{uniqueKeys:i}=t.options;if(i===!1)return!1;let n=typeof i=="function"?i:(a,o)=>a===o||Bl.isScalar(a)&&Bl.isScalar(o)&&a.value===o.value;return e.some(a=>n(a.key,r))}Ml.mapIncludes=Fm});var Gl=g(zl=>{"use strict";var Fl=Me(),Vm=Ve(),Vl=xr(),qm=cn(),ql=ko(),Wm=So(),Wl="All mapping items must start at the same column";function zm({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=a?.nodeClass??Vm.YAMLMap,s=new o(r.schema);r.atRoot&&(r.atRoot=!1);let c=i.offset,l=null;for(let d of i.items){let{start:u,key:f,sep:h,value:v}=d,p=Vl.resolveProps(u,{indicator:"explicit-key-ind",next:f??h?.[0],offset:c,onError:n,parentIndent:i.indent,startOnNewline:!0}),m=!p.found;if(m){if(f&&(f.type==="block-seq"?n(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in f&&f.indent!==i.indent&&n(c,"BAD_INDENT",Wl)),!p.anchor&&!p.tag&&!h){l=p.end,p.comment&&(s.comment?s.comment+=`
67
+ `+p.comment:s.comment=p.comment);continue}(p.newlineAfterProp||qm.containsNewline(f))&&n(f??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==i.indent&&n(c,"BAD_INDENT",Wl);r.atKey=!0;let w=p.end,y=f?t(r,f,p,n):e(r,w,u,null,p,n);r.schema.compat&&ql.flowIndentCheck(i.indent,f,n),r.atKey=!1,Wm.mapIncludes(r,s.items,y)&&n(w,"DUPLICATE_KEY","Map keys must be unique");let k=Vl.resolveProps(h??[],{indicator:"map-value-ind",next:v,offset:y.range[2],onError:n,parentIndent:i.indent,startOnNewline:!f||f.type==="block-scalar"});if(c=k.end,k.found){m&&(v?.type==="block-map"&&!k.hasNewline&&n(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),r.options.strict&&p.start<k.found.offset-1024&&n(y.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let x=v?t(r,v,k,n):e(r,c,h,null,k,n);r.schema.compat&&ql.flowIndentCheck(i.indent,v,n),c=x.range[2];let E=new Fl.Pair(y,x);r.options.keepSourceTokens&&(E.srcToken=d),s.items.push(E)}else{m&&n(y.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(y.comment?y.comment+=`
68
+ `+k.comment:y.comment=k.comment);let x=new Fl.Pair(y);r.options.keepSourceTokens&&(x.srcToken=d),s.items.push(x)}}return l&&l<c&&n(l,"IMPOSSIBLE","Map comment with trailing content"),s.range=[i.offset,c,l??c],s}zl.resolveBlockMap=zm});var Ul=g(Jl=>{"use strict";var Gm=qe(),Jm=xr(),Um=ko();function Km({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=a?.nodeClass??Gm.YAMLSeq,s=new o(r.schema);r.atRoot&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let c=i.offset,l=null;for(let{start:d,value:u}of i.items){let f=Jm.resolveProps(d,{indicator:"seq-item-ind",next:u,offset:c,onError:n,parentIndent:i.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||u)u?.type==="block-seq"?n(f.end,"BAD_INDENT","All sequence items must start at the same column"):n(c,"MISSING_CHAR","Sequence item without - indicator");else{l=f.end,f.comment&&(s.comment=f.comment);continue}let h=u?t(r,u,f,n):e(r,f.end,d,null,f,n);r.schema.compat&&Um.flowIndentCheck(i.indent,u,n),c=h.range[2],s.items.push(h)}return s.range=[i.offset,c,l??c],s}Jl.resolveBlockSeq=Km});var Tt=g(Kl=>{"use strict";function Ym(t,e,r,i){let n="";if(t){let a=!1,o="";for(let s of t){let{source:c,type:l}=s;switch(l){case"space":a=!0;break;case"comment":{r&&!a&&i(s,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=c.substring(1)||" ";n?n+=o+d:n=d,o="";break}case"newline":n&&(o+=c),a=!0;break;default:i(s,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:n,offset:e}}Kl.resolveEnd=Ym});var Zl=g(Ql=>{"use strict";var Xm=R(),Qm=Me(),Yl=Ve(),Zm=qe(),ev=Tt(),Xl=xr(),tv=cn(),rv=So(),Eo="Block collections are not allowed within flow collections",xo=t=>t&&(t.type==="block-map"||t.type==="block-seq");function iv({composeNode:t,composeEmptyNode:e},r,i,n,a){let o=i.start.source==="{",s=o?"flow map":"flow sequence",c=a?.nodeClass??(o?Yl.YAMLMap:Zm.YAMLSeq),l=new c(r.schema);l.flow=!0;let d=r.atRoot;d&&(r.atRoot=!1),r.atKey&&(r.atKey=!1);let u=i.offset+i.start.source.length;for(let m=0;m<i.items.length;++m){let w=i.items[m],{start:y,key:k,sep:x,value:E}=w,S=Xl.resolveProps(y,{flow:s,indicator:"explicit-key-ind",next:k??x?.[0],offset:u,onError:n,parentIndent:i.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!x&&!E){m===0&&S.comma?n(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`):m<i.items.length-1&&n(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${s}`),S.comment&&(l.comment?l.comment+=`
69
+ `+S.comment:l.comment=S.comment),u=S.end;continue}!o&&r.options.strict&&tv.containsNewline(k)&&n(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(m===0)S.comma&&n(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${s}`);else if(S.comma||n(S.start,"MISSING_CHAR",`Missing , between ${s} items`),S.comment){let I="";e:for(let N of y)switch(N.type){case"comma":case"space":break;case"comment":I=N.source.substring(1);break e;default:break e}if(I){let N=l.items[l.items.length-1];Xm.isPair(N)&&(N=N.value??N.key),N.comment?N.comment+=`
70
+ `+I:N.comment=I,S.comment=S.comment.substring(I.length+1)}}if(!o&&!x&&!S.found){let I=E?t(r,E,S,n):e(r,S.end,x,null,S,n);l.items.push(I),u=I.range[2],xo(E)&&n(I.range,"BLOCK_IN_FLOW",Eo)}else{r.atKey=!0;let I=S.end,N=k?t(r,k,S,n):e(r,I,y,null,S,n);xo(k)&&n(N.range,"BLOCK_IN_FLOW",Eo),r.atKey=!1;let H=Xl.resolveProps(x??[],{flow:s,indicator:"map-value-ind",next:E,offset:N.range[2],onError:n,parentIndent:i.indent,startOnNewline:!1});if(H.found){if(!o&&!S.found&&r.options.strict){if(x)for(let D of x){if(D===H.found)break;if(D.type==="newline"){n(D,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}S.start<H.found.offset-1024&&n(H.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else E&&("source"in E&&E.source?.[0]===":"?n(E,"MISSING_CHAR",`Missing space after : in ${s}`):n(H.start,"MISSING_CHAR",`Missing , or : between ${s} items`));let je=E?t(r,E,H,n):H.found?e(r,H.end,x,null,H,n):null;je?xo(E)&&n(je.range,"BLOCK_IN_FLOW",Eo):H.comment&&(N.comment?N.comment+=`
71
+ `+H.comment:N.comment=H.comment);let kt=new Qm.Pair(N,je);if(r.options.keepSourceTokens&&(kt.srcToken=w),o){let D=l;rv.mapIncludes(r,D.items,N)&&n(I,"DUPLICATE_KEY","Map keys must be unique"),D.items.push(kt)}else{let D=new Yl.YAMLMap(r.schema);D.flow=!0,D.items.push(kt);let Qs=(je??N).range;D.range=[N.range[0],Qs[1],Qs[2]],l.items.push(D)}u=je?je.range[2]:H.end}}let f=o?"}":"]",[h,...v]=i.end,p=u;if(h?.source===f)p=h.offset+h.source.length;else{let m=s[0].toUpperCase()+s.substring(1),w=d?`${m} must end with a ${f}`:`${m} in block collection must be sufficiently indented and end with a ${f}`;n(u,d?"MISSING_CHAR":"BAD_INDENT",w),h&&h.source.length!==1&&v.unshift(h)}if(v.length>0){let m=ev.resolveEnd(v,p,r.options.strict,n);m.comment&&(l.comment?l.comment+=`
72
+ `+m.comment:l.comment=m.comment),l.range=[i.offset,p,m.offset]}else l.range=[i.offset,p,p];return l}Ql.resolveFlowCollection=iv});var tu=g(eu=>{"use strict";var nv=R(),av=O(),ov=Ve(),sv=qe(),cv=Gl(),lv=Ul(),uv=Zl();function Co(t,e,r,i,n,a){let o=r.type==="block-map"?cv.resolveBlockMap(t,e,r,i,a):r.type==="block-seq"?lv.resolveBlockSeq(t,e,r,i,a):uv.resolveFlowCollection(t,e,r,i,a),s=o.constructor;return n==="!"||n===s.tagName?(o.tag=s.tagName,o):(n&&(o.tag=n),o)}function dv(t,e,r,i,n){let a=i.tag,o=a?e.directives.tagName(a.source,f=>n(a,"TAG_RESOLVE_FAILED",f)):null;if(r.type==="block-seq"){let{anchor:f,newlineAfterProp:h}=i,v=f&&a?f.offset>a.offset?f:a:f??a;v&&(!h||h.offset<v.offset)&&n(v,"MISSING_CHAR","Missing newline after block sequence props")}let s=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!a||!o||o==="!"||o===ov.YAMLMap.tagName&&s==="map"||o===sv.YAMLSeq.tagName&&s==="seq")return Co(t,e,r,n,o);let c=e.schema.tags.find(f=>f.tag===o&&f.collection===s);if(!c){let f=e.schema.knownTags[o];if(f?.collection===s)e.schema.tags.push(Object.assign({},f,{default:!1})),c=f;else return f?n(a,"BAD_COLLECTION_TYPE",`${f.tag} used for ${s} collection, but expects ${f.collection??"scalar"}`,!0):n(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Co(t,e,r,n,o)}let l=Co(t,e,r,n,o,c),d=c.resolve?.(l,f=>n(a,"TAG_RESOLVE_FAILED",f),e.options)??l,u=nv.isNode(d)?d:new av.Scalar(d);return u.range=l.range,u.tag=o,c?.format&&(u.format=c.format),u}eu.composeCollection=dv});var Ro=g(ru=>{"use strict";var Po=O();function fv(t,e,r){let i=e.offset,n=pv(e,t.options.strict,r);if(!n)return{value:"",type:null,comment:"",range:[i,i,i]};let a=n.mode===">"?Po.Scalar.BLOCK_FOLDED:Po.Scalar.BLOCK_LITERAL,o=e.source?hv(e.source):[],s=o.length;for(let p=o.length-1;p>=0;--p){let m=o[p][1];if(m===""||m==="\r")s=p;else break}if(s===0){let p=n.chomp==="+"&&o.length>0?`
73
+ `.repeat(Math.max(1,o.length-1)):"",m=i+n.length;return e.source&&(m+=e.source.length),{value:p,type:a,comment:n.comment,range:[i,m,m]}}let c=e.indent+n.indent,l=e.offset+n.length,d=0;for(let p=0;p<s;++p){let[m,w]=o[p];if(w===""||w==="\r")n.indent===0&&m.length>c&&(c=m.length);else{m.length<c&&r(l+m.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),n.indent===0&&(c=m.length),d=p,c===0&&!t.atRoot&&r(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=m.length+w.length+1}for(let p=o.length-1;p>=s;--p)o[p][0].length>c&&(s=p+1);let u="",f="",h=!1;for(let p=0;p<d;++p)u+=o[p][0].slice(c)+`
74
+ `;for(let p=d;p<s;++p){let[m,w]=o[p];l+=m.length+w.length+1;let y=w[w.length-1]==="\r";if(y&&(w=w.slice(0,-1)),w&&m.length<c){let x=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;r(l-w.length-(y?2:1),"BAD_INDENT",x),m=""}a===Po.Scalar.BLOCK_LITERAL?(u+=f+m.slice(c)+w,f=`
75
+ `):m.length>c||w[0]===" "?(f===" "?f=`
76
+ `:!h&&f===`
77
77
  `&&(f=`
78
78
 
79
- `),u+=f+h.slice(c)+w,f=`
80
- `,m=!0):w===""?f===`
79
+ `),u+=f+m.slice(c)+w,f=`
80
+ `,h=!0):w===""?f===`
81
81
  `?u+=`
82
82
  `:f=`
83
- `:(u+=f+w,f=" ",m=!1)}switch(n.chomp){case"-":break;case"+":for(let p=s;p<o.length;++p)u+=`
83
+ `:(u+=f+w,f=" ",h=!1)}switch(n.chomp){case"-":break;case"+":for(let p=s;p<o.length;++p)u+=`
84
84
  `+o[p][0].slice(c);u[u.length-1]!==`
85
85
  `&&(u+=`
86
86
  `);break;default:u+=`
87
- `}let g=i+n.length+e.source.length;return{value:u,type:a,comment:n.comment,range:[i,g,g]}}function im({offset:t,props:e},r,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:n}=e[0],a=n[0],o=0,s="",c=-1;for(let f=1;f<n.length;++f){let m=n[f];if(!s&&(m==="-"||m==="+"))s=m;else{let g=Number(m);!o&&g?o=g:c===-1&&(c=t+f)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let l=!1,d="",u=n.length;for(let f=1;f<e.length;++f){let m=e[f];switch(m.type){case"space":l=!0;case"newline":u+=m.source.length;break;case"comment":r&&!l&&i(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=m.source.length,d=m.source.substring(1);break;case"error":i(m,"UNEXPECTED_TOKEN",m.message),u+=m.source.length;break;default:{let g=`Unexpected token in block scalar header: ${m.type}`;i(m,"UNEXPECTED_TOKEN",g);let p=m.source;p&&typeof p=="string"&&(u+=p.length)}}}return{mode:a,indent:o,chomp:s,comment:d,length:u}}function nm(t){let e=t.split(/\n( *)/),r=e[0],i=r.match(/^( *)/),a=[i?.[1]?[i[1],r.slice(i[1].length)]:["",r]];for(let o=1;o<e.length;o+=2)a.push([e[o],e[o+1]]);return a}ml.resolveBlockScalar=rm});var Ya=v(gl=>{"use strict";var Ka=$(),am=yt();function om(t,e,r){let{offset:i,type:n,source:a,end:o}=t,s,c,l=(f,m,g)=>r(i+f,m,g);switch(n){case"scalar":s=Ka.Scalar.PLAIN,c=sm(a,l);break;case"single-quoted-scalar":s=Ka.Scalar.QUOTE_SINGLE,c=cm(a,l);break;case"double-quoted-scalar":s=Ka.Scalar.QUOTE_DOUBLE,c=lm(a,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[i,i+a.length,i+a.length]}}let d=i+a.length,u=am.resolveEnd(o,d,e,r);return{value:c,type:s,comment:u.comment,range:[i,d,u.offset]}}function sm(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),vl(t)}function cm(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),vl(t.slice(1,-1)).replace(/''/g,"'")}function vl(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
87
+ `}let v=i+n.length+e.source.length;return{value:u,type:a,comment:n.comment,range:[i,v,v]}}function pv({offset:t,props:e},r,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:n}=e[0],a=n[0],o=0,s="",c=-1;for(let f=1;f<n.length;++f){let h=n[f];if(!s&&(h==="-"||h==="+"))s=h;else{let v=Number(h);!o&&v?o=v:c===-1&&(c=t+f)}}c!==-1&&i(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let l=!1,d="",u=n.length;for(let f=1;f<e.length;++f){let h=e[f];switch(h.type){case"space":l=!0;case"newline":u+=h.source.length;break;case"comment":r&&!l&&i(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),u+=h.source.length,d=h.source.substring(1);break;case"error":i(h,"UNEXPECTED_TOKEN",h.message),u+=h.source.length;break;default:{let v=`Unexpected token in block scalar header: ${h.type}`;i(h,"UNEXPECTED_TOKEN",v);let p=h.source;p&&typeof p=="string"&&(u+=p.length)}}}return{mode:a,indent:o,chomp:s,comment:d,length:u}}function hv(t){let e=t.split(/\n( *)/),r=e[0],i=r.match(/^( *)/),a=[i?.[1]?[i[1],r.slice(i[1].length)]:["",r]];for(let o=1;o<e.length;o+=2)a.push([e[o],e[o+1]]);return a}ru.resolveBlockScalar=fv});var Ao=g(nu=>{"use strict";var _o=O(),mv=Tt();function vv(t,e,r){let{offset:i,type:n,source:a,end:o}=t,s,c,l=(f,h,v)=>r(i+f,h,v);switch(n){case"scalar":s=_o.Scalar.PLAIN,c=gv(a,l);break;case"single-quoted-scalar":s=_o.Scalar.QUOTE_SINGLE,c=wv(a,l);break;case"double-quoted-scalar":s=_o.Scalar.QUOTE_DOUBLE,c=yv(a,l);break;default:return r(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[i,i+a.length,i+a.length]}}let d=i+a.length,u=mv.resolveEnd(o,d,e,r);return{value:c,type:s,comment:u.comment,range:[i,d,u.offset]}}function gv(t,e){let r="";switch(t[0]){case" ":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${t[0]}`;break}case"@":case"`":{r=`reserved character ${t[0]}`;break}}return r&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`),iu(t)}function wv(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),iu(t.slice(1,-1)).replace(/''/g,"'")}function iu(t){let e,r;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
88
88
  `,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
89
89
  `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(t);if(!i)return t;let n=i[1],a=" ",o=e.lastIndex;for(r.lastIndex=o;i=r.exec(t);)i[1]===""?a===`
90
90
  `?n+=a:a=`
91
- `:(n+=a+i[1],a=" "),o=r.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,i=s.exec(t),n+a+(i?.[1]??"")}function lm(t,e){let r="";for(let i=1;i<t.length-1;++i){let n=t[i];if(!(n==="\r"&&t[i+1]===`
91
+ `:(n+=a+i[1],a=" "),o=r.lastIndex;let s=/[ \t]*(.*)/sy;return s.lastIndex=o,i=s.exec(t),n+a+(i?.[1]??"")}function yv(t,e){let r="";for(let i=1;i<t.length-1;++i){let n=t[i];if(!(n==="\r"&&t[i+1]===`
92
92
  `))if(n===`
93
- `){let{fold:a,offset:o}=um(t,i);r+=a,i=o}else if(n==="\\"){let a=t[++i],o=dm[a];if(o)r+=o;else if(a===`
93
+ `){let{fold:a,offset:o}=Nv(t,i);r+=a,i=o}else if(n==="\\"){let a=t[++i],o=bv[a];if(o)r+=o;else if(a===`
94
94
  `)for(a=t[i+1];a===" "||a===" ";)a=t[++i+1];else if(a==="\r"&&t[i+1]===`
95
- `)for(a=t[++i+1];a===" "||a===" ";)a=t[++i+1];else if(a==="x"||a==="u"||a==="U"){let s=a==="x"?2:a==="u"?4:8;r+=fm(t,i+1,s,e),i+=s}else{let s=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),r+=s}}else if(n===" "||n===" "){let a=i,o=t[i+1];for(;o===" "||o===" ";)o=t[++i+1];o!==`
95
+ `)for(a=t[++i+1];a===" "||a===" ";)a=t[++i+1];else if(a==="x"||a==="u"||a==="U"){let s=a==="x"?2:a==="u"?4:8;r+=kv(t,i+1,s,e),i+=s}else{let s=t.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),r+=s}}else if(n===" "||n===" "){let a=i,o=t[i+1];for(;o===" "||o===" ";)o=t[++i+1];o!==`
96
96
  `&&!(o==="\r"&&t[i+2]===`
97
- `)&&(r+=i>a?t.slice(a,i+1):n)}else r+=n}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function um(t,e){let r="",i=t[e+1];for(;(i===" "||i===" "||i===`
97
+ `)&&(r+=i>a?t.slice(a,i+1):n)}else r+=n}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),r}function Nv(t,e){let r="",i=t[e+1];for(;(i===" "||i===" "||i===`
98
98
  `||i==="\r")&&!(i==="\r"&&t[e+2]!==`
99
99
  `);)i===`
100
100
  `&&(r+=`
101
- `),e+=1,i=t[e+1];return r||(r=" "),{fold:r,offset:e}}var dm={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function fm(t,e,r,i){let n=t.substr(e,r),o=n.length===r&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;try{return String.fromCodePoint(o)}catch{let s=t.substr(e-2,r+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}gl.resolveFlowScalar=om});var Nl=v(yl=>{"use strict";var Ze=P(),wl=$(),pm=Ua(),hm=Ya();function mm(t,e,r,i){let{value:n,type:a,comment:o,range:s}=e.type==="block-scalar"?pm.resolveBlockScalar(t,e,i):hm.resolveFlowScalar(e,t.options.strict,i),c=r?t.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Ze.SCALAR]:c?l=vm(t.schema,n,c,r,i):e.type==="scalar"?l=gm(t,n,e,i):l=t.schema[Ze.SCALAR];let d;try{let u=l.resolve(n,f=>i(r??e,"TAG_RESOLVE_FAILED",f),t.options);d=Ze.isScalar(u)?u:new wl.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);i(r??e,"TAG_RESOLVE_FAILED",f),d=new wl.Scalar(n)}return d.range=s,d.source=n,a&&(d.type=a),c&&(d.tag=c),l.format&&(d.format=l.format),o&&(d.comment=o),d}function vm(t,e,r,i,n){if(r==="!")return t[Ze.SCALAR];let a=[];for(let s of t.tags)if(!s.collection&&s.tag===r)if(s.default&&s.test)a.push(s);else return s;for(let s of a)if(s.test?.test(e))return s;let o=t.knownTags[r];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(n(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[Ze.SCALAR])}function gm({atKey:t,directives:e,schema:r},i,n,a){let o=r.tags.find(s=>(s.default===!0||t&&s.default==="key")&&s.test?.test(i))||r[Ze.SCALAR];if(r.compat){let s=r.compat.find(c=>c.default&&c.test?.test(i))??r[Ze.SCALAR];if(o.tag!==s.tag){let c=e.tagString(o.tag),l=e.tagString(s.tag),d=`Value may be parsed as either ${c} or ${l}`;a(n,"TAG_RESOLVE_FAILED",d,!0)}}return o}yl.composeScalar=mm});var kl=v(bl=>{"use strict";function wm(t,e,r){if(e){r??(r=e.length);for(let i=r-1;i>=0;--i){let n=e[i];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++i];n?.type==="space";)t+=n.source.length,n=e[++i];break}}return t}bl.emptyScalarPosition=wm});var xl=v(Qa=>{"use strict";var ym=Vt(),Nm=P(),bm=hl(),Sl=Nl(),km=yt(),Sm=kl(),Em={composeNode:El,composeEmptyNode:Xa};function El(t,e,r,i){let n=t.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=r,l,d=!0;switch(e.type){case"alias":l=xm(t,e,i),(s||c)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=Sl.composeScalar(t,e,c,i),s&&(l.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=bm.composeCollection(Em,t,e,r,i),s&&(l.anchor=s.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);i(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",u),d=!1}}return l??(l=Xa(t,e.offset,void 0,null,r,i)),s&&l.anchor===""&&i(s,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!Nm.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&d&&(l.srcToken=e),l}function Xa(t,e,r,i,{spaceBefore:n,comment:a,anchor:o,tag:s,end:c},l){let d={type:"scalar",offset:Sm.emptyScalarPosition(e,r,i),indent:-1,source:""},u=Sl.composeScalar(t,d,s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function xm({options:t},{offset:e,source:r,end:i},n){let a=new ym.Alias(r.substring(1));a.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&n(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+r.length,s=km.resolveEnd(i,o,t.strict,n);return a.range=[e,o,s.offset],s.comment&&(a.comment=s.comment),a}Qa.composeEmptyNode=Xa;Qa.composeNode=El});var Rl=v(Pl=>{"use strict";var Cm=nr(),Cl=xl(),Pm=yt(),Rm=cr();function _m(t,e,{offset:r,start:i,value:n,end:a},o){let s=Object.assign({_directives:e},t),c=new Cm.Document(void 0,s),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=Rm.resolveProps(i,{indicator:"doc-start",next:n??a?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=n?Cl.composeNode(l,n,d,o):Cl.composeEmptyNode(l,d.end,i,null,d,o);let u=c.contents.range[2],f=Pm.resolveEnd(a,u,!1,o);return f.comment&&(c.comment=f.comment),c.range=[r,u,f.offset],c}Pl.composeDoc=_m});var eo=v(Il=>{"use strict";var Am=Jr("process"),Im=Bn(),Tm=nr(),lr=sr(),_l=P(),$m=Rl(),jm=yt();function ur(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function Al(t){let e="",r=!1,i=!1;for(let n=0;n<t.length;++n){let a=t[n];switch(a[0]){case"#":e+=(e===""?"":i?`
101
+ `),e+=1,i=t[e+1];return r||(r=" "),{fold:r,offset:e}}var bv={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function kv(t,e,r,i){let n=t.substr(e,r),o=n.length===r&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;try{return String.fromCodePoint(o)}catch{let s=t.substr(e-2,r+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${s}`),s}}nu.resolveFlowScalar=vv});var su=g(ou=>{"use strict";var st=R(),au=O(),Sv=Ro(),Ev=Ao();function xv(t,e,r,i){let{value:n,type:a,comment:o,range:s}=e.type==="block-scalar"?Sv.resolveBlockScalar(t,e,i):Ev.resolveFlowScalar(e,t.options.strict,i),c=r?t.directives.tagName(r.source,u=>i(r,"TAG_RESOLVE_FAILED",u)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[st.SCALAR]:c?l=Cv(t.schema,n,c,r,i):e.type==="scalar"?l=Pv(t,n,e,i):l=t.schema[st.SCALAR];let d;try{let u=l.resolve(n,f=>i(r??e,"TAG_RESOLVE_FAILED",f),t.options);d=st.isScalar(u)?u:new au.Scalar(u)}catch(u){let f=u instanceof Error?u.message:String(u);i(r??e,"TAG_RESOLVE_FAILED",f),d=new au.Scalar(n)}return d.range=s,d.source=n,a&&(d.type=a),c&&(d.tag=c),l.format&&(d.format=l.format),o&&(d.comment=o),d}function Cv(t,e,r,i,n){if(r==="!")return t[st.SCALAR];let a=[];for(let s of t.tags)if(!s.collection&&s.tag===r)if(s.default&&s.test)a.push(s);else return s;for(let s of a)if(s.test?.test(e))return s;let o=t.knownTags[r];return o&&!o.collection?(t.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(n(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),t[st.SCALAR])}function Pv({atKey:t,directives:e,schema:r},i,n,a){let o=r.tags.find(s=>(s.default===!0||t&&s.default==="key")&&s.test?.test(i))||r[st.SCALAR];if(r.compat){let s=r.compat.find(c=>c.default&&c.test?.test(i))??r[st.SCALAR];if(o.tag!==s.tag){let c=e.tagString(o.tag),l=e.tagString(s.tag),d=`Value may be parsed as either ${c} or ${l}`;a(n,"TAG_RESOLVE_FAILED",d,!0)}}return o}ou.composeScalar=xv});var lu=g(cu=>{"use strict";function Rv(t,e,r){if(e){r??(r=e.length);for(let i=r-1;i>=0;--i){let n=e[i];switch(n.type){case"space":case"comment":case"newline":t-=n.source.length;continue}for(n=e[++i];n?.type==="space";)t+=n.source.length,n=e[++i];break}}return t}cu.emptyScalarPosition=Rv});var fu=g(To=>{"use strict";var _v=ar(),Av=R(),Iv=tu(),uu=su(),Tv=Tt(),$v=lu(),jv={composeNode:du,composeEmptyNode:Io};function du(t,e,r,i){let n=t.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=r,l,d=!0;switch(e.type){case"alias":l=Ov(t,e,i),(s||c)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":l=uu.composeScalar(t,e,c,i),s&&(l.anchor=s.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=Iv.composeCollection(jv,t,e,r,i),s&&(l.anchor=s.source.substring(1))}catch(u){let f=u instanceof Error?u.message:String(u);i(e,"RESOURCE_EXHAUSTION",f)}break;default:{let u=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",u),d=!1}}return l??(l=Io(t,e.offset,void 0,null,r,i)),s&&l.anchor===""&&i(s,"BAD_ALIAS","Anchor cannot be an empty string"),n&&t.options.stringKeys&&(!Av.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&i(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),a&&(l.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?l.comment=o:l.commentBefore=o),t.options.keepSourceTokens&&d&&(l.srcToken=e),l}function Io(t,e,r,i,{spaceBefore:n,comment:a,anchor:o,tag:s,end:c},l){let d={type:"scalar",offset:$v.emptyScalarPosition(e,r,i),indent:-1,source:""},u=uu.composeScalar(t,d,s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===""&&l(o,"BAD_ALIAS","Anchor cannot be an empty string")),n&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Ov({options:t},{offset:e,source:r,end:i},n){let a=new _v.Alias(r.substring(1));a.source===""&&n(e,"BAD_ALIAS","Alias cannot be an empty string"),a.source.endsWith(":")&&n(e+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=e+r.length,s=Tv.resolveEnd(i,o,t.strict,n);return a.range=[e,o,s.offset],s.comment&&(a.comment=s.comment),a}To.composeEmptyNode=Io;To.composeNode=du});var mu=g(hu=>{"use strict";var Hv=br(),pu=fu(),Dv=Tt(),Lv=xr();function Bv(t,e,{offset:r,start:i,value:n,end:a},o){let s=Object.assign({_directives:e},t),c=new Hv.Document(void 0,s),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=Lv.resolveProps(i,{indicator:"doc-start",next:n??a?.[0],offset:r,onError:o,parentIndent:0,startOnNewline:!0});d.found&&(c.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!d.hasNewline&&o(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=n?pu.composeNode(l,n,d,o):pu.composeEmptyNode(l,d.end,i,null,d,o);let u=c.contents.range[2],f=Dv.resolveEnd(a,u,!1,o);return f.comment&&(c.comment=f.comment),c.range=[r,u,f.offset],c}hu.composeDoc=Bv});var jo=g(wu=>{"use strict";var Mv=gi("process"),Fv=wa(),Vv=br(),Cr=Er(),vu=R(),qv=mu(),Wv=Tt();function Pr(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];let{offset:e,source:r}=t;return[e,e+(typeof r=="string"?r.length:1)]}function gu(t){let e="",r=!1,i=!1;for(let n=0;n<t.length;++n){let a=t[n];switch(a[0]){case"#":e+=(e===""?"":i?`
103
103
 
104
104
  `:`
105
- `)+(a.substring(1)||" "),r=!0,i=!1;break;case"%":t[n+1]?.[0]!=="#"&&(n+=1),r=!1;break;default:r||(i=!0),r=!1}}return{comment:e,afterEmptyLine:i}}var Za=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,i,n,a)=>{let o=ur(r);a?this.warnings.push(new lr.YAMLWarning(o,i,n)):this.errors.push(new lr.YAMLParseError(o,i,n))},this.directives=new Im.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:i,afterEmptyLine:n}=Al(this.prelude);if(i){let a=e.contents;if(r)e.comment=e.comment?`${e.comment}
106
- ${i}`:i;else if(n||e.directives.docStart||!a)e.commentBefore=i;else if(_l.isCollection(a)&&!a.flow&&a.items.length>0){let o=a.items[0];_l.isPair(o)&&(o=o.key);let s=o.commentBefore;o.commentBefore=s?`${i}
105
+ `)+(a.substring(1)||" "),r=!0,i=!1;break;case"%":t[n+1]?.[0]!=="#"&&(n+=1),r=!1;break;default:r||(i=!0),r=!1}}return{comment:e,afterEmptyLine:i}}var $o=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(r,i,n,a)=>{let o=Pr(r);a?this.warnings.push(new Cr.YAMLWarning(o,i,n)):this.errors.push(new Cr.YAMLParseError(o,i,n))},this.directives=new Fv.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,r){let{comment:i,afterEmptyLine:n}=gu(this.prelude);if(i){let a=e.contents;if(r)e.comment=e.comment?`${e.comment}
106
+ ${i}`:i;else if(n||e.directives.docStart||!a)e.commentBefore=i;else if(vu.isCollection(a)&&!a.flow&&a.items.length>0){let o=a.items[0];vu.isPair(o)&&(o=o.key);let s=o.commentBefore;o.commentBefore=s?`${i}
107
107
  ${s}`:i}else{let o=a.commentBefore;a.commentBefore=o?`${i}
108
- ${o}`:i}}if(r){for(let a=0;a<this.errors.length;++a)e.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)e.warnings.push(this.warnings[a])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Al(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,i=-1){for(let n of e)yield*this.next(n);yield*this.end(r,i)}*next(e){switch(Am.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,i,n)=>{let a=ur(e);a[0]+=r,this.onError(a,"BAD_DIRECTIVE",i,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=$m.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new lr.YAMLParseError(ur(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new lr.YAMLParseError(ur(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let r=jm.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
109
- ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new lr.YAMLParseError(ur(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),n=new Tm.Document(void 0,i);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,r,r],this.decorate(n,!1),yield n}}};Il.Composer=Za});var jl=v(Li=>{"use strict";var Om=Ua(),Hm=Ya(),Dm=sr(),Tl=Jt();function Lm(t,e=!0,r){if(t){let i=(n,a,o)=>{let s=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(r)r(s,a,o);else throw new Dm.YAMLParseError([s,s+1],a,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Hm.resolveFlowScalar(t,e,i);case"block-scalar":return Om.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function Bm(t,e){let{implicitKey:r=!1,indent:i,inFlow:n=!1,offset:a=-1,type:o="PLAIN"}=e,s=Tl.stringifyString({type:o,value:t},{implicitKey:r,indent:i>0?" ".repeat(i):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
108
+ ${o}`:i}}if(r){for(let a=0;a<this.errors.length;++a)e.errors.push(this.errors[a]);for(let a=0;a<this.warnings.length;++a)e.warnings.push(this.warnings[a])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:gu(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,r=!1,i=-1){for(let n of e)yield*this.next(n);yield*this.end(r,i)}*next(e){switch(Mv.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(r,i,n)=>{let a=Pr(e);a[0]+=r,this.onError(a,"BAD_DIRECTIVE",i,n)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let r=qv.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!r.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(r,!1),this.doc&&(yield this.doc),this.doc=r,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let r=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new Cr.YAMLParseError(Pr(e),"UNEXPECTED_TOKEN",r);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){let i="Unexpected doc-end without preceding document";this.errors.push(new Cr.YAMLParseError(Pr(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;let r=Wv.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),r.comment){let i=this.doc.comment;this.doc.comment=i?`${i}
109
+ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.push(new Cr.YAMLParseError(Pr(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,r=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let i=Object.assign({_directives:this.directives},this.options),n=new Vv.Document(void 0,i);this.atDirectives&&this.onError(r,"MISSING_CHAR","Missing directives-end indicator line"),n.range=[0,r,r],this.decorate(n,!1),yield n}}};wu.Composer=$o});var bu=g(ln=>{"use strict";var zv=Ro(),Gv=Ao(),Jv=Er(),yu=ur();function Uv(t,e=!0,r){if(t){let i=(n,a,o)=>{let s=typeof n=="number"?n:Array.isArray(n)?n[0]:n.offset;if(r)r(s,a,o);else throw new Jv.YAMLParseError([s,s+1],a,o)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Gv.resolveFlowScalar(t,e,i);case"block-scalar":return zv.resolveBlockScalar({options:{strict:e}},t,i)}}return null}function Kv(t,e){let{implicitKey:r=!1,indent:i,inFlow:n=!1,offset:a=-1,type:o="PLAIN"}=e,s=yu.stringifyString({type:o,value:t},{implicitKey:r,indent:i>0?" ".repeat(i):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:i,source:`
110
110
  `}];switch(s[0]){case"|":case">":{let l=s.indexOf(`
111
111
  `),d=s.substring(0,l),u=s.substring(l+1)+`
112
- `,f=[{type:"block-scalar-header",offset:a,indent:i,source:d}];return $l(f,c)||f.push({type:"newline",offset:-1,indent:i,source:`
113
- `}),{type:"block-scalar",offset:a,indent:i,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:a,indent:i,source:s,end:c};case"'":return{type:"single-quoted-scalar",offset:a,indent:i,source:s,end:c};default:return{type:"scalar",offset:a,indent:i,source:s,end:c}}}function Fm(t,e,r={}){let{afterKey:i=!1,implicitKey:n=!1,inFlow:a=!1,type:o}=r,s="indent"in t?t.indent:null;if(i&&typeof s=="number"&&(s+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=Tl.stringifyString({type:o,value:e},{implicitKey:n||s===null,indent:s!==null&&s>0?" ".repeat(s):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Mm(t,c);break;case'"':to(t,c,"double-quoted-scalar");break;case"'":to(t,c,"single-quoted-scalar");break;default:to(t,c,"scalar")}}function Mm(t,e){let r=e.indexOf(`
112
+ `,f=[{type:"block-scalar-header",offset:a,indent:i,source:d}];return Nu(f,c)||f.push({type:"newline",offset:-1,indent:i,source:`
113
+ `}),{type:"block-scalar",offset:a,indent:i,props:f,source:u}}case'"':return{type:"double-quoted-scalar",offset:a,indent:i,source:s,end:c};case"'":return{type:"single-quoted-scalar",offset:a,indent:i,source:s,end:c};default:return{type:"scalar",offset:a,indent:i,source:s,end:c}}}function Yv(t,e,r={}){let{afterKey:i=!1,implicitKey:n=!1,inFlow:a=!1,type:o}=r,s="indent"in t?t.indent:null;if(i&&typeof s=="number"&&(s+=2),!o)switch(t.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let c=yu.stringifyString({type:o,value:e},{implicitKey:n||s===null,indent:s!==null&&s>0?" ".repeat(s):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Xv(t,c);break;case'"':Oo(t,c,"double-quoted-scalar");break;case"'":Oo(t,c,"single-quoted-scalar");break;default:Oo(t,c,"scalar")}}function Xv(t,e){let r=e.indexOf(`
114
114
  `),i=e.substring(0,r),n=e.substring(r+1)+`
115
- `;if(t.type==="block-scalar"){let a=t.props[0];if(a.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a.source=i,t.source=n}else{let{offset:a}=t,o="indent"in t?t.indent:-1,s=[{type:"block-scalar-header",offset:a,indent:o,source:i}];$l(s,"end"in t?t.end:void 0)||s.push({type:"newline",offset:-1,indent:o,source:`
116
- `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:s,source:n})}}function $l(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function to(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let i=t.props.slice(1),n=e.length;t.props[0].type==="block-scalar-header"&&(n-=t.props[0].source.length);for(let a of i)a.offset+=n;delete t.props,Object.assign(t,{type:r,source:e,end:i});break}case"block-map":case"block-seq":{let n={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
117
- `};delete t.items,Object.assign(t,{type:r,source:e,end:[n]});break}default:{let i="indent"in t?t.indent:-1,n="end"in t&&Array.isArray(t.end)?t.end.filter(a=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(let a of Object.keys(t))a!=="type"&&a!=="offset"&&delete t[a];Object.assign(t,{type:r,indent:i,source:e,end:n})}}}Li.createScalarToken=Bm;Li.resolveAsScalar=Lm;Li.setScalarValue=Fm});var Hl=v(Ol=>{"use strict";var Vm=t=>"type"in t?Fi(t):Bi(t);function Fi(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=Fi(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=Bi(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=Bi(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=Bi(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function Bi({start:t,key:e,sep:r,value:i}){let n="";for(let a of t)n+=a.source;if(e&&(n+=Fi(e)),r)for(let a of r)n+=a.source;return i&&(n+=Fi(i)),n}Ol.stringify=Vm});var Fl=v(Bl=>{"use strict";var ro=Symbol("break visit"),qm=Symbol("skip children"),Dl=Symbol("remove item");function et(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Ll(Object.freeze([]),t,e)}et.BREAK=ro;et.SKIP=qm;et.REMOVE=Dl;et.itemAtPath=(t,e)=>{let r=t;for(let[i,n]of e){let a=r?.[i];if(a&&"items"in a)r=a.items[n];else return}return r};et.parentCollection=(t,e)=>{let r=et.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],n=r?.[i];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function Ll(t,e,r){let i=r(e,t);if(typeof i=="symbol")return i;for(let n of["key","value"]){let a=e[n];if(a&&"items"in a){for(let o=0;o<a.items.length;++o){let s=Ll(Object.freeze(t.concat([[n,o]])),a.items[o],r);if(typeof s=="number")o=s-1;else{if(s===ro)return ro;s===Dl&&(a.items.splice(o,1),o-=1)}}typeof i=="function"&&n==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}Bl.visit=et});var Mi=v(J=>{"use strict";var io=jl(),Wm=Hl(),zm=Fl(),no="\uFEFF",ao="",oo="",so="",Gm=t=>!!t&&"items"in t,Jm=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function Um(t){switch(t){case no:return"<BOM>";case ao:return"<DOC>";case oo:return"<FLOW_END>";case so:return"<SCALAR>";default:return JSON.stringify(t)}}function Km(t){switch(t){case no:return"byte-order-mark";case ao:return"doc-mode";case oo:return"flow-error-end";case so:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
115
+ `;if(t.type==="block-scalar"){let a=t.props[0];if(a.type!=="block-scalar-header")throw new Error("Invalid block scalar header");a.source=i,t.source=n}else{let{offset:a}=t,o="indent"in t?t.indent:-1,s=[{type:"block-scalar-header",offset:a,indent:o,source:i}];Nu(s,"end"in t?t.end:void 0)||s.push({type:"newline",offset:-1,indent:o,source:`
116
+ `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:o,props:s,source:n})}}function Nu(t,e){if(e)for(let r of e)switch(r.type){case"space":case"comment":t.push(r);break;case"newline":return t.push(r),!0}return!1}function Oo(t,e,r){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=r,t.source=e;break;case"block-scalar":{let i=t.props.slice(1),n=e.length;t.props[0].type==="block-scalar-header"&&(n-=t.props[0].source.length);for(let a of i)a.offset+=n;delete t.props,Object.assign(t,{type:r,source:e,end:i});break}case"block-map":case"block-seq":{let n={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
117
+ `};delete t.items,Object.assign(t,{type:r,source:e,end:[n]});break}default:{let i="indent"in t?t.indent:-1,n="end"in t&&Array.isArray(t.end)?t.end.filter(a=>a.type==="space"||a.type==="comment"||a.type==="newline"):[];for(let a of Object.keys(t))a!=="type"&&a!=="offset"&&delete t[a];Object.assign(t,{type:r,indent:i,source:e,end:n})}}}ln.createScalarToken=Kv;ln.resolveAsScalar=Uv;ln.setScalarValue=Yv});var Su=g(ku=>{"use strict";var Qv=t=>"type"in t?dn(t):un(t);function dn(t){switch(t.type){case"block-scalar":{let e="";for(let r of t.props)e+=dn(r);return e+t.source}case"block-map":case"block-seq":{let e="";for(let r of t.items)e+=un(r);return e}case"flow-collection":{let e=t.start.source;for(let r of t.items)e+=un(r);for(let r of t.end)e+=r.source;return e}case"document":{let e=un(t);if(t.end)for(let r of t.end)e+=r.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let r of t.end)e+=r.source;return e}}}function un({start:t,key:e,sep:r,value:i}){let n="";for(let a of t)n+=a.source;if(e&&(n+=dn(e)),r)for(let a of r)n+=a.source;return i&&(n+=dn(i)),n}ku.stringify=Qv});var Pu=g(Cu=>{"use strict";var Ho=Symbol("break visit"),Zv=Symbol("skip children"),Eu=Symbol("remove item");function ct(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),xu(Object.freeze([]),t,e)}ct.BREAK=Ho;ct.SKIP=Zv;ct.REMOVE=Eu;ct.itemAtPath=(t,e)=>{let r=t;for(let[i,n]of e){let a=r?.[i];if(a&&"items"in a)r=a.items[n];else return}return r};ct.parentCollection=(t,e)=>{let r=ct.itemAtPath(t,e.slice(0,-1)),i=e[e.length-1][0],n=r?.[i];if(n&&"items"in n)return n;throw new Error("Parent collection not found")};function xu(t,e,r){let i=r(e,t);if(typeof i=="symbol")return i;for(let n of["key","value"]){let a=e[n];if(a&&"items"in a){for(let o=0;o<a.items.length;++o){let s=xu(Object.freeze(t.concat([[n,o]])),a.items[o],r);if(typeof s=="number")o=s-1;else{if(s===Ho)return Ho;s===Eu&&(a.items.splice(o,1),o-=1)}}typeof i=="function"&&n==="key"&&(i=i(e,t))}}return typeof i=="function"?i(e,t):i}Cu.visit=ct});var fn=g(Y=>{"use strict";var Do=bu(),eg=Su(),tg=Pu(),Lo="\uFEFF",Bo="",Mo="",Fo="",rg=t=>!!t&&"items"in t,ig=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function ng(t){switch(t){case Lo:return"<BOM>";case Bo:return"<DOC>";case Mo:return"<FLOW_END>";case Fo:return"<SCALAR>";default:return JSON.stringify(t)}}function ag(t){switch(t){case Lo:return"byte-order-mark";case Bo:return"doc-mode";case Mo:return"flow-error-end";case Fo:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
118
118
  `:case`\r
119
- `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}J.createScalarToken=io.createScalarToken;J.resolveAsScalar=io.resolveAsScalar;J.setScalarValue=io.setScalarValue;J.stringify=Wm.stringify;J.visit=zm.visit;J.BOM=no;J.DOCUMENT=ao;J.FLOW_END=oo;J.SCALAR=so;J.isCollection=Gm;J.isScalar=Jm;J.prettyToken=Um;J.tokenType=Km});var uo=v(Vl=>{"use strict";var dr=Mi();function te(t){switch(t){case void 0:case" ":case`
120
- `:case"\r":case" ":return!0;default:return!1}}var Ml=new Set("0123456789ABCDEFabcdef"),Ym=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Vi=new Set(",[]{}"),Xm=new Set(` ,[]{}
121
- \r `),co=t=>!t||Xm.has(t),lo=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let i=this.next??"stream";for(;i&&(r||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
119
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Y.createScalarToken=Do.createScalarToken;Y.resolveAsScalar=Do.resolveAsScalar;Y.setScalarValue=Do.setScalarValue;Y.stringify=eg.stringify;Y.visit=tg.visit;Y.BOM=Lo;Y.DOCUMENT=Bo;Y.FLOW_END=Mo;Y.SCALAR=Fo;Y.isCollection=rg;Y.isScalar=ig;Y.prettyToken=ng;Y.tokenType=ag});var Wo=g(_u=>{"use strict";var Rr=fn();function oe(t){switch(t){case void 0:case" ":case`
120
+ `:case"\r":case" ":return!0;default:return!1}}var Ru=new Set("0123456789ABCDEFabcdef"),og=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),pn=new Set(",[]{}"),sg=new Set(` ,[]{}
121
+ \r `),Vo=t=>!t||sg.has(t),qo=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,r=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!r;let i=this.next??"stream";for(;i&&(r||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,r=this.buffer[e];for(;r===" "||r===" ";)r=this.buffer[++e];return!r||r==="#"||r===`
122
122
  `?!0:r==="\r"?this.buffer[e+1]===`
123
123
  `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let r=this.buffer[e];if(this.indentNext>0){let i=0;for(;r===" ";)r=this.buffer[++i+e];if(r==="\r"){let n=this.buffer[i+e+1];if(n===`
124
124
  `||!n&&!this.atEnd)return e+i+1}return r===`
125
- `||i>=this.indentNext||!r&&!this.atEnd?e+i:-1}if(r==="-"||r==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&te(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
126
- `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===dr.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,i=e.indexOf("#");for(;i!==-1;){let a=e[i-1];if(a===" "||a===" "){r=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let a=e[r-1];if(a===" "||a===" ")r-=1;else break}let n=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield dr.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&te(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!te(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&te(r)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(co),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,i=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=i=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let n=this.getLine();if(n===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&n[0]!=="#"||i===0&&(n.startsWith("---")||n.startsWith("..."))&&te(n[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield dr.FLOW_END,yield*this.parseLineStart();let a=0;for(;n[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),n[a]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-a),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(co),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||te(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let a=0;for(;this.buffer[r-1-a]==="\\";)a+=1;if(a%2===0)break;r=this.buffer.indexOf('"',r+1)}let i=this.buffer.substring(0,r),n=i.indexOf(`
125
+ `||i>=this.indentNext||!r&&!this.atEnd?e+i:-1}if(r==="-"||r==="."){let i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&oe(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
126
+ `,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Rr.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let r=e.length,i=e.indexOf("#");for(;i!==-1;){let a=e[i-1];if(a===" "||a===" "){r=i-1;break}else i=e.indexOf("#",i+1)}for(;;){let a=e[r-1];if(a===" "||a===" ")r-=1;else break}let n=(yield*this.pushCount(r))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-n),this.pushNewline(),"stream"}if(this.atLineEnd()){let r=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-r),yield*this.pushNewline(),"stream"}return yield Rr.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let r=this.peek(3);if((r==="---"||r==="...")&&oe(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,r==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!oe(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,r]=this.peek(2);if(!r&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&oe(r)){let i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let r=yield*this.pushIndicators();switch(e[r]){case"#":yield*this.pushCount(e.length-r);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Vo),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return r+=yield*this.parseBlockScalarHeader(),r+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-r),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,r,i=-1;do e=yield*this.pushNewline(),e>0?(r=yield*this.pushSpaces(!1),this.indentValue=i=r):r=0,r+=yield*this.pushSpaces(!0);while(e+r>0);let n=this.getLine();if(n===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&n[0]!=="#"||i===0&&(n.startsWith("---")||n.startsWith("..."))&&oe(n[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(n[0]==="]"||n[0]==="}")))return this.flowLevel=0,yield Rr.FLOW_END,yield*this.parseLineStart();let a=0;for(;n[a]===",";)a+=yield*this.pushCount(1),a+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(a+=yield*this.pushIndicators(),n[a]){case void 0:return"flow";case"#":return yield*this.pushCount(n.length-a),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Vo),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let o=this.charAt(1);if(this.flowKey||oe(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),r=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;r!==-1&&this.buffer[r+1]==="'";)r=this.buffer.indexOf("'",r+2);else for(;r!==-1;){let a=0;for(;this.buffer[r-1-a]==="\\";)a+=1;if(a%2===0)break;r=this.buffer.indexOf('"',r+1)}let i=this.buffer.substring(0,r),n=i.indexOf(`
127
127
  `,this.pos);if(n!==-1){for(;n!==-1;){let a=this.continueScalar(n+1);if(a===-1)break;n=i.indexOf(`
128
- `,a)}n!==-1&&(r=n-(i[n-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>te(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,i;e:for(let a=this.pos;i=this.buffer[a];++a)switch(i){case" ":r+=1;break;case`
128
+ `,a)}n!==-1&&(r=n-(i[n-1]==="\r"?2:1))}if(r===-1){if(!this.atEnd)return this.setNext("quoted-scalar");r=this.buffer.length}return yield*this.pushToIndex(r+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let r=this.buffer[++e];if(r==="+")this.blockScalarKeep=!0;else if(r>"0"&&r<="9")this.blockScalarIndent=Number(r)-1;else if(r!=="-")break}return yield*this.pushUntil(r=>oe(r)||r==="#")}*parseBlockScalar(){let e=this.pos-1,r=0,i;e:for(let a=this.pos;i=this.buffer[a];++a)switch(i){case" ":r+=1;break;case`
129
129
  `:e=a,r=0;break;case"\r":{let o=this.buffer[a+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
130
130
  `)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(r>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=r:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let a=this.continueScalar(e+1);if(a===-1)break;e=this.buffer.indexOf(`
131
131
  `,a)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let n=e+1;for(i=this.buffer[n];i===" ";)i=this.buffer[++n];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
132
132
  `;)i=this.buffer[++n];e=n-1}else if(!this.blockScalarKeep)do{let a=e-1,o=this.buffer[a];o==="\r"&&(o=this.buffer[--a]);let s=a;for(;o===" ";)o=this.buffer[--a];if(o===`
133
- `&&a>=this.pos&&a+1+r>s)e=a;else break}while(!0);return yield dr.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,i=this.pos-1,n;for(;n=this.buffer[++i];)if(n===":"){let a=this.buffer[i+1];if(te(a)||e&&Vi.has(a))break;r=i}else if(te(n)){let a=this.buffer[i+1];if(n==="\r"&&(a===`
133
+ `&&a>=this.pos&&a+1+r>s)e=a;else break}while(!0);return yield Rr.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,r=this.pos-1,i=this.pos-1,n;for(;n=this.buffer[++i];)if(n===":"){let a=this.buffer[i+1];if(oe(a)||e&&pn.has(a))break;r=i}else if(oe(n)){let a=this.buffer[i+1];if(n==="\r"&&(a===`
134
134
  `?(i+=1,n=`
135
- `,a=this.buffer[i+1]):r=i),a==="#"||e&&Vi.has(a))break;if(n===`
136
- `){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&Vi.has(n))break;r=i}return!n&&!this.atEnd?this.setNext("plain-scalar"):(yield dr.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(co),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,i=this.charAt(1);if(te(i)||r&&Vi.has(i)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!te(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(Ym.has(r))r=this.buffer[++e];else if(r==="%"&&Ml.has(this.buffer[e+1])&&Ml.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
135
+ `,a=this.buffer[i+1]):r=i),a==="#"||e&&pn.has(a))break;if(n===`
136
+ `){let o=this.continueScalar(i+1);if(o===-1)break;i=Math.max(i,o-2)}}else{if(e&&pn.has(n))break;r=i}return!n&&!this.atEnd?this.setNext("plain-scalar"):(yield Rr.SCALAR,yield*this.pushToIndex(r+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,r){let i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(r&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(Vo),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let r=this.flowLevel>0,i=this.charAt(1);if(oe(i)||r&&pn.has(i)){r?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,r=this.buffer[e];for(;!oe(r)&&r!==">";)r=this.buffer[++e];return yield*this.pushToIndex(r===">"?e+1:e,!1)}else{let e=this.pos+1,r=this.buffer[e];for(;r;)if(og.has(r))r=this.buffer[++e];else if(r==="%"&&Ru.has(this.buffer[e+1])&&Ru.has(this.buffer[e+2]))r=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
137
137
  `?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
138
- `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,i;do i=this.buffer[++r];while(i===" "||e&&i===" ");let n=r-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=r),n}*pushUntil(e){let r=this.pos,i=this.buffer[r];for(;!e(i);)i=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};Vl.Lexer=lo});var po=v(ql=>{"use strict";var fo=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,i=this.lineStarts.length;for(;r<i;){let a=r+i>>1;this.lineStarts[a]<e?r=a+1:i=a}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let n=this.lineStarts[r-1];return{line:r,col:e-n+1}}}};ql.LineCounter=fo});var mo=v(Ul=>{"use strict";var Qm=Jr("process"),Wl=Mi(),Zm=uo();function He(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function zl(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Jl(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function qi(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function Nt(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function Wi(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function Gl(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!He(e.start,"explicit-key-ind")&&!He(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Jl(e.value)?e.value.end?Wi(e.value.end,e.sep):e.value.end=e.sep:Wi(e.start,e.sep),delete e.sep)}var ho=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Zm.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,r))yield*this.next(i);r||(yield*this.end())}*next(e){if(this.source=e,Qm.env.LOG_TOKENS&&console.log("|",Wl.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=Wl.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let i=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in i?i.indent:0:r.type==="flow-collection"&&i.type==="document"&&(r.indent=0),r.type==="flow-collection"&&Gl(r),i.type){case"document":i.value=r;break;case"block-scalar":i.props.push(r);break;case"block-map":{let n=i.items[i.items.length-1];if(n.value){i.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=r;else{Object.assign(n,{key:r,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=i.items[i.items.length-1];n.value?i.items.push({start:[],value:r}):n.value=r;break}case"flow-collection":{let n=i.items[i.items.length-1];!n||n.value?i.items.push({start:[],key:r,sep:[]}):n.sep?n.value=r:Object.assign(n,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let n=r.items[r.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&zl(n.start)===-1&&(r.indent===0||n.start.every(a=>a.type!=="comment"||a.indent<r.indent))&&(i.type==="document"?i.end=n.start:i.items.push({start:n.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{zl(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let r=qi(this.peek(2)),i=Nt(r),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
138
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let r=this.pos-1,i;do i=this.buffer[++r];while(i===" "||e&&i===" ");let n=r-this.pos;return n>0&&(yield this.buffer.substr(this.pos,n),this.pos=r),n}*pushUntil(e){let r=this.pos,i=this.buffer[r];for(;!e(i);)i=this.buffer[++r];return yield*this.pushToIndex(r,!1)}};_u.Lexer=qo});var Go=g(Au=>{"use strict";var zo=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let r=0,i=this.lineStarts.length;for(;r<i;){let a=r+i>>1;this.lineStarts[a]<e?r=a+1:i=a}if(this.lineStarts[r]===e)return{line:r+1,col:1};if(r===0)return{line:0,col:e};let n=this.lineStarts[r-1];return{line:r,col:e-n+1}}}};Au.LineCounter=zo});var Uo=g(Ou=>{"use strict";var cg=gi("process"),Iu=fn(),lg=Wo();function We(t,e){for(let r=0;r<t.length;++r)if(t[r].type===e)return!0;return!1}function Tu(t){for(let e=0;e<t.length;++e)switch(t[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function ju(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function hn(t){switch(t.type){case"document":return t.start;case"block-map":{let e=t.items[t.items.length-1];return e.sep??e.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function $t(t){if(t.length===0)return[];let e=t.length;e:for(;--e>=0;)switch(t[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++e]?.type==="space";);return t.splice(e,t.length)}function mn(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let r=0;r<e.length;++r)t.push(e[r])}function $u(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!We(e.start,"explicit-key-ind")&&!We(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,ju(e.value)?e.value.end?mn(e.value.end,e.sep):e.value.end=e.sep:mn(e.start,e.sep),delete e.sep)}var Jo=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new lg.Lexer,this.onNewLine=e}*parse(e,r=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let i of this.lexer.lex(e,r))yield*this.next(i);r||(yield*this.end())}*next(e){if(this.source=e,cg.env.LOG_TOKENS&&console.log("|",Iu.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=Iu.tokenType(e);if(r)if(r==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=r,yield*this.step(),r){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let r=e??this.stack.pop();if(!r)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield r;else{let i=this.peek(1);switch(r.type==="block-scalar"?r.indent="indent"in i?i.indent:0:r.type==="flow-collection"&&i.type==="document"&&(r.indent=0),r.type==="flow-collection"&&$u(r),i.type){case"document":i.value=r;break;case"block-scalar":i.props.push(r);break;case"block-map":{let n=i.items[i.items.length-1];if(n.value){i.items.push({start:[],key:r,sep:[]}),this.onKeyLine=!0;return}else if(n.sep)n.value=r;else{Object.assign(n,{key:r,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=i.items[i.items.length-1];n.value?i.items.push({start:[],value:r}):n.value=r;break}case"flow-collection":{let n=i.items[i.items.length-1];!n||n.value?i.items.push({start:[],key:r,sep:[]}):n.sep?n.value=r:Object.assign(n,{key:r,sep:[]});return}default:yield*this.pop(),yield*this.pop(r)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(r.type==="block-map"||r.type==="block-seq")){let n=r.items[r.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&Tu(n.start)===-1&&(r.indent===0||n.start.every(a=>a.type!=="comment"||a.indent<r.indent))&&(i.type==="document"?i.end=n.start:i.items.push({start:n.start}),r.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Tu(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let r=hn(this.peek(2)),i=$t(r),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let r=this.source.indexOf(`
139
139
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
140
- `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Wi(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,n=i&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",a=[];if(n&&r.sep&&!r.value){let o=[];for(let s=0;s<r.sep.length;++s){let c=r.sep[s];switch(c.type){case"newline":o.push(s);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":n||r.value?(a.push(this.sourceToken),e.items.push({start:a}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):n||r.value?(a.push(this.sourceToken),e.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(He(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(Jl(r.key)&&!He(r.sep,"newline")){let o=Nt(r.start),s=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:s,sep:c}]})}else a.length>0?r.sep=r.sep.concat(a,this.sourceToken):r.sep.push(this.sourceToken);else if(He(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=Nt(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||n?e.items.push({start:a,key:null,sep:[this.sourceToken]}):He(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);n||r.value?(e.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!r.explicitKey&&r.sep&&!He(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){Wi(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||He(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:n,sep:[]}):r.sep?this.stack.push(n):Object.assign(r,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let n=qi(i),a=Nt(n);Gl(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:a,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
140
+ `,r)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else if(r.sep)r.sep.push(this.sourceToken);else{if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){mn(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let i=!this.onKeyLine&&this.indent===e.indent,n=i&&(r.sep||r.explicitKey)&&this.type!=="seq-item-ind",a=[];if(n&&r.sep&&!r.value){let o=[];for(let s=0;s<r.sep.length;++s){let c=r.sep[s];switch(c.type){case"newline":o.push(s);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(a=r.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":n||r.value?(a.push(this.sourceToken),e.items.push({start:a}),this.onKeyLine=!0):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"explicit-key-ind":!r.sep&&!r.explicitKey?(r.start.push(this.sourceToken),r.explicitKey=!0):n||r.value?(a.push(this.sourceToken),e.items.push({start:a,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(r.explicitKey)if(r.sep)if(r.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(We(r.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(ju(r.key)&&!We(r.sep,"newline")){let o=$t(r.start),s=r.key,c=r.sep;c.push(this.sourceToken),delete r.key,delete r.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:s,sep:c}]})}else a.length>0?r.sep=r.sep.concat(a,this.sourceToken):r.sep.push(this.sourceToken);else if(We(r.start,"newline"))Object.assign(r,{key:null,sep:[this.sourceToken]});else{let o=$t(r.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else r.sep?r.value||n?e.items.push({start:a,key:null,sep:[this.sourceToken]}):We(r.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);n||r.value?(e.items.push({start:a,key:o,sep:[]}),this.onKeyLine=!0):r.sep?this.stack.push(o):(Object.assign(r,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{let o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!r.explicitKey&&r.sep&&!We(r.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:a});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let r=e.items[e.items.length-1];switch(this.type){case"newline":if(r.value){let i="end"in r.value?r.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else r.start.push(this.sourceToken);return;case"space":case"comment":if(r.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(r.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){mn(n,r.start),n.push(this.sourceToken),e.items.pop();return}}r.start.push(this.sourceToken)}return;case"anchor":case"tag":if(r.value||this.indent<=e.indent)break;r.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;r.value||We(r.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return}if(this.indent>e.indent){let i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let r=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!r||r.sep?e.items.push({start:[this.sourceToken]}):r.start.push(this.sourceToken);return;case"map-value-ind":!r||r.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):Object.assign(r,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!r||r.value?e.items.push({start:[this.sourceToken]}):r.sep?r.sep.push(this.sourceToken):r.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!r||r.value?e.items.push({start:[],key:n,sep:[]}):r.sep?this.stack.push(n):Object.assign(r,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{let i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){let n=hn(i),a=$t(n);$u(e);let o=e.end.splice(1,e.end.length);o.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:a,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let r=this.source.indexOf(`
141
141
  `)+1;for(;r!==0;)this.onNewLine(this.offset+r),r=this.source.indexOf(`
142
- `,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=qi(e),i=Nt(r);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=qi(e),i=Nt(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Ul.Parser=ho});var Zl=v(pr=>{"use strict";var Kl=eo(),ev=nr(),fr=sr(),tv=Qn(),rv=P(),iv=po(),Yl=mo();function Xl(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new iv.LineCounter||null,prettyErrors:e}}function nv(t,e={}){let{lineCounter:r,prettyErrors:i}=Xl(e),n=new Yl.Parser(r?.addNewLine),a=new Kl.Composer(e),o=Array.from(a.compose(n.parse(t)));if(i&&r)for(let s of o)s.errors.forEach(fr.prettifyError(t,r)),s.warnings.forEach(fr.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Ql(t,e={}){let{lineCounter:r,prettyErrors:i}=Xl(e),n=new Yl.Parser(r?.addNewLine),a=new Kl.Composer(e),o=null;for(let s of a.compose(n.parse(t),!0,t.length))if(!o)o=s;else if(o.options.logLevel!=="silent"){o.errors.push(new fr.YAMLParseError(s.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&r&&(o.errors.forEach(fr.prettifyError(t,r)),o.warnings.forEach(fr.prettifyError(t,r))),o}function av(t,e,r){let i;typeof e=="function"?i=e:r===void 0&&e&&typeof e=="object"&&(r=e);let n=Ql(t,r);if(!n)return null;if(n.warnings.forEach(a=>tv.warn(n.options.logLevel,a)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:i},r))}function ov(t,e,r){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let n=Math.round(r);r=n<1?void 0:n>8?{indent:8}:{indent:n}}if(t===void 0){let{keepUndefined:n}=r??e??{};if(!n)return}return rv.isDocument(t)&&!i?t.toString(r):new ev.Document(t,i,r).toString(r)}pr.parse=av;pr.parseAllDocuments=nv;pr.parseDocument=Ql;pr.stringify=ov});var ve=v(R=>{"use strict";var sv=eo(),cv=nr(),lv=ja(),vo=sr(),uv=Vt(),De=P(),dv=Te(),fv=$(),pv=je(),hv=Oe(),mv=Mi(),vv=uo(),gv=po(),wv=mo(),zi=Zl(),eu=Lt();R.Composer=sv.Composer;R.Document=cv.Document;R.Schema=lv.Schema;R.YAMLError=vo.YAMLError;R.YAMLParseError=vo.YAMLParseError;R.YAMLWarning=vo.YAMLWarning;R.Alias=uv.Alias;R.isAlias=De.isAlias;R.isCollection=De.isCollection;R.isDocument=De.isDocument;R.isMap=De.isMap;R.isNode=De.isNode;R.isPair=De.isPair;R.isScalar=De.isScalar;R.isSeq=De.isSeq;R.Pair=dv.Pair;R.Scalar=fv.Scalar;R.YAMLMap=pv.YAMLMap;R.YAMLSeq=hv.YAMLSeq;R.CST=mv;R.Lexer=vv.Lexer;R.LineCounter=gv.LineCounter;R.Parser=wv.Parser;R.parse=zi.parse;R.parseAllDocuments=zi.parseAllDocuments;R.parseDocument=zi.parseDocument;R.stringify=zi.stringify;R.visit=eu.visit;R.visitAsync=eu.visitAsync});import Le from"path";function su(t){let e=[...t],r=new Set(t);for(let i of ou)r.has(i)||(r.add(i),e.push(i));return e}function cu(t,e){return bt[e][t]}function kv(t,e,r,i){let n=/^(\s*)([a-z_]+):/u.exec(t);if(!n)return null;let a=n[1].length,o=n[2];if(a===0&&o in bt.en)return o;if(a===2&&e){let s=`${e}.${o}`;if(s in bt.en)return s}if(a===4&&e==="knowledge"&&i==="remote"){let s=`knowledge.remote.${o}`;if(s in bt.en)return s}if(a===4&&e==="knowledge"&&i==="local"){let s=`knowledge.local.${o}`;if(s in bt.en)return s}if(a===2&&e===null&&o==="hook")return"hook";if(a===2&&e==="hook"&&o==="allow_paths")return"hook.allow_paths";if(a===4&&e==="native"&&r==="snapshot"){let s=`native.snapshot.${o}`;if(s in bt.en)return s}return null}function wr(t,e){let r=[],i=null,n=null,a=null;for(let o of(0,vr.stringify)(t).trimEnd().split(`
143
- `)){let s=kv(o,i,n,a);if(s){let c=o.match(/^\s*/u)?.[0]??"";for(let l of cu(s,e).split(`
142
+ `,r)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let r=hn(e),i=$t(r);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let r=hn(e),i=$t(r);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,r){return this.type!=="comment"||this.indent<=r?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};Ou.Parser=Jo});var Mu=g(Ar=>{"use strict";var Hu=jo(),ug=br(),_r=Er(),dg=Ia(),fg=R(),pg=Go(),Du=Uo();function Lu(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new pg.LineCounter||null,prettyErrors:e}}function hg(t,e={}){let{lineCounter:r,prettyErrors:i}=Lu(e),n=new Du.Parser(r?.addNewLine),a=new Hu.Composer(e),o=Array.from(a.compose(n.parse(t)));if(i&&r)for(let s of o)s.errors.forEach(_r.prettifyError(t,r)),s.warnings.forEach(_r.prettifyError(t,r));return o.length>0?o:Object.assign([],{empty:!0},a.streamInfo())}function Bu(t,e={}){let{lineCounter:r,prettyErrors:i}=Lu(e),n=new Du.Parser(r?.addNewLine),a=new Hu.Composer(e),o=null;for(let s of a.compose(n.parse(t),!0,t.length))if(!o)o=s;else if(o.options.logLevel!=="silent"){o.errors.push(new _r.YAMLParseError(s.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&r&&(o.errors.forEach(_r.prettifyError(t,r)),o.warnings.forEach(_r.prettifyError(t,r))),o}function mg(t,e,r){let i;typeof e=="function"?i=e:r===void 0&&e&&typeof e=="object"&&(r=e);let n=Bu(t,r);if(!n)return null;if(n.warnings.forEach(a=>dg.warn(n.options.logLevel,a)),n.errors.length>0){if(n.options.logLevel!=="silent")throw n.errors[0];n.errors=[]}return n.toJS(Object.assign({reviver:i},r))}function vg(t,e,r){let i=null;if(typeof e=="function"||Array.isArray(e)?i=e:r===void 0&&e&&(r=e),typeof r=="string"&&(r=r.length),typeof r=="number"){let n=Math.round(r);r=n<1?void 0:n>8?{indent:8}:{indent:n}}if(t===void 0){let{keepUndefined:n}=r??e??{};if(!n)return}return fg.isDocument(t)&&!i?t.toString(r):new ug.Document(t,i,r).toString(r)}Ar.parse=mg;Ar.parseAllDocuments=hg;Ar.parseDocument=Bu;Ar.stringify=vg});var Se=g(_=>{"use strict";var gg=jo(),wg=br(),yg=ho(),Ko=Er(),Ng=ar(),ze=R(),bg=Me(),kg=O(),Sg=Ve(),Eg=qe(),xg=fn(),Cg=Wo(),Pg=Go(),Rg=Uo(),vn=Mu(),Fu=tr();_.Composer=gg.Composer;_.Document=wg.Document;_.Schema=yg.Schema;_.YAMLError=Ko.YAMLError;_.YAMLParseError=Ko.YAMLParseError;_.YAMLWarning=Ko.YAMLWarning;_.Alias=Ng.Alias;_.isAlias=ze.isAlias;_.isCollection=ze.isCollection;_.isDocument=ze.isDocument;_.isMap=ze.isMap;_.isNode=ze.isNode;_.isPair=ze.isPair;_.isScalar=ze.isScalar;_.isSeq=ze.isSeq;_.Pair=bg.Pair;_.Scalar=kg.Scalar;_.YAMLMap=Sg.YAMLMap;_.YAMLSeq=Eg.YAMLSeq;_.CST=xg;_.Lexer=Cg.Lexer;_.LineCounter=Pg.LineCounter;_.Parser=Rg.Parser;_.parse=vn.parse;_.parseAllDocuments=vn.parseAllDocuments;_.parseDocument=vn.parseDocument;_.stringify=vn.stringify;_.visit=Fu.visit;_.visitAsync=Fu.visitAsync});import Ge from"path";function Uu(t){let e=[...t],r=new Set(t);for(let i of Ju)r.has(i)||(r.add(i),e.push(i));return e}function Ku(t,e){return jt[e][t]}function Tg(t,e,r,i){let n=/^(\s*)([a-z_]+):/u.exec(t);if(!n)return null;let a=n[1].length,o=n[2];if(a===0&&o in jt.en)return o;if(a===2&&e){let s=`${e}.${o}`;if(s in jt.en)return s}if(a===4&&e==="knowledge"&&i==="remote"){let s=`knowledge.remote.${o}`;if(s in jt.en)return s}if(a===4&&e==="knowledge"&&i==="local"){let s=`knowledge.local.${o}`;if(s in jt.en)return s}if(a===2&&e===null&&o==="hook")return"hook";if(a===2&&e==="hook"&&o==="allow_paths")return"hook.allow_paths";if(a===4&&e==="native"&&r==="snapshot"){let s=`native.snapshot.${o}`;if(s in jt.en)return s}return null}function Or(t,e){let r=[],i=null,n=null,a=null;for(let o of(0,$r.stringify)(t).trimEnd().split(`
143
+ `)){let s=Tg(o,i,n,a);if(s){let c=o.match(/^\s*/u)?.[0]??"";for(let l of Ku(s,e).split(`
144
144
  `))r.push(`${c}${l}`)}r.push(o),/^[a-z_]+:/u.test(o)?(o.startsWith("native:")?i="native":o.startsWith("classic:")?i="classic":o.startsWith("hook:")?i="hook":o.startsWith("memory:")?i="memory":o.startsWith("knowledge:")?i="knowledge":i=null,n=null,a=null):/^ {2}[a-z_]+:/u.test(o)&&(i==="native"&&(n=o.startsWith(" snapshot:")?"snapshot":null),i==="knowledge"&&(a=o.startsWith(" local:")?"local":o.startsWith(" remote:")?"remote":null))}return r.push(""),r.join(`
145
- `)}function Sv(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||Le.posix.isAbsolute(r)||Le.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be a project-relative path`);if(r===".")return[];let i=r.replaceAll("\\","/").split("/");if(i.some(n=>n===".."))throw new Error(`${e} must stay inside the project root`);if(i.some(n=>n===""||n==="."))throw new Error(`${e} must not contain empty or dot path segments`);return i}function tt(t){let e=Sv(t,"native.artifact_root");return e.length===0?".":e.join("/")}function lu(t,e="docs"){let r=t??e;if(r!=="legacy"&&r!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return r}function Ki(t,e,r=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim().replaceAll("\\","/");if(i.length===0||Le.posix.isAbsolute(i)||Le.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be relative to its declared path base`);let n=i.split("/");if(n.some(a=>a===".."))throw new Error(`${e} must stay inside its declared path base`);if(n.some(a=>a===""||a==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!r&&/[*?]/u.test(i))throw new Error(`${e} cannot contain wildcards`);return n.join("/")}function ge(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function uu(t,e,r){let i=t??e;if(i!=="en"&&i!=="zh-CN")throw new Error(`${r} must be en or zh-CN`);return i}function yo(t,e){if(typeof t!="string"||t.length===0||t.includes("\\")||t.includes("\0")||t.startsWith("/")||t.split("/").includes(".."))throw new Error(`${e} contains an unsafe pattern`);if(t.length>Gi)throw new Error(`${e} exceeds ${Gi} characters`);let r=0;for(let i=0;i<t.length;i+=1)t[i]==="?"?r+=1:t[i]==="*"&&(r+=1,t[i+1]==="*"&&(i+=1));if(r>Ji)throw new Error(`${e} contains more than ${Ji} wildcard tokens`);return t}function nu(t,e,r){if(t===void 0)return[...r];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(i=>yo(i,e)))].sort((i,n)=>i.localeCompare(n,"en"))}function hr(t,e,r){let i=t??e;if(!Number.isSafeInteger(i)||i<1)throw new Error(`${r} must be a positive integer`);return i}function au(t,e,r){let i=hr(t,e,r);if(i>Math.floor(Number.MAX_SAFE_INTEGER/(1024*1024)))throw new Error(`${r} is too large to convert to bytes safely`);return i}function Ev(t){if(t===void 0)return{...U,include:[...U.include],exclude:[...U.exclude]};let e=ge(t,"native.snapshot");return{include:nu(e.include,"native.snapshot.include",U.include),exclude:nu(e.exclude,"native.snapshot.exclude",U.exclude),max_files:hr(e.max_files,U.max_files,"native.snapshot.max_files"),max_total_bytes:hr(e.max_total_bytes,U.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:hr(e.max_duration_ms,U.max_duration_ms,"native.snapshot.max_duration_ms"),max_selection_records:hr(e.max_selection_records,U.max_selection_records,"native.snapshot.max_selection_records")}}function xv(t){if(t===void 0)return;let e=ge(t,"native.pending_root_move"),r=e.id,i=e.from_artifact_root,n=e.to_artifact_root,a=e.stage;if(typeof r!="string"||!/^[a-f0-9-]{8,}$/u.test(r))throw new Error("native.pending_root_move.id is invalid");if(typeof i!="string"||typeof n!="string")throw new Error("native.pending_root_move roots must be strings");if(a!=="copying"&&a!=="ready"&&a!=="switched")throw new Error("native.pending_root_move.stage is invalid");let o;if(e.cleanup!==void 0){let s=ge(e.cleanup,"native.pending_root_move.cleanup"),c=s.kind,l=s.state,d=s.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof d!="string"||!/^[a-f0-9]{64}$/u.test(d))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");o={kind:c,state:l,manifestHash:d}}return{id:r,fromArtifactRoot:tt(i),toArtifactRoot:tt(n),stage:a,...o?{cleanup:o}:{}}}function Cv(t){if(t===void 0)return;let e=ge(t,"native.finish");if(e.pull_request===void 0)return{};let r=ge(e.pull_request,"native.finish.pull_request");if(r.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(r.command)||r.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(r.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let i=r.command.map((a,o)=>{if(typeof a!="string"||a.trim().length===0||a.length>4096||/[\0\r\n]/u.test(a))throw new Error(`native.finish.pull_request.command[${o}] must be a non-empty single-line string of at most 4096 characters`);return a});if(Le.posix.isAbsolute(i[0])||Le.win32.isAbsolute(i[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let n=r.timeout_ms??yv;if(!Number.isSafeInteger(n)||n<1||n>iu)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${iu}`);return{pull_request:{provider:"repository-command",command:i,timeout_ms:n}}}function Pv(t,e={}){let r=ge(t,"native"),i=r.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof i!="string")throw new Error("native.artifact_root must be a string");let n=r.clarification_mode??"batch";if(n!=="sequential"&&n!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let a=r.archive_confirmation??"automatic";if(a!=="automatic"&&a!=="required")throw new Error("native.archive_confirmation must be automatic or required");let o=r.max_verify_failures??go;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let s=r.document_writes??"allow";if(s!=="allow"&&s!=="revert")throw new Error("native.document_writes must be allow or revert");let c=xv(r.pending_root_move),l=Cv(r.finish);return{artifact_root:tt(i),language:uu(r.language,"en","native.language"),clarification_mode:n,archive_confirmation:a,max_verify_failures:o,...s==="revert"?{document_writes:s}:{},snapshot:Ev(r.snapshot),...l?{finish:l}:{},...c?{pending_root_move:c}:{}}}function Rv(t){let e=ge(t,"classic"),r=e.context_compression??"off";if(r!=="off"&&r!=="beta")throw new Error("classic.context_compression must be off or beta");let i=e.review_mode??"standard";if(i!=="off"&&i!=="standard"&&i!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let n=e.auto_transition??!0;if(typeof n!="boolean")throw new Error("classic.auto_transition must be true or false");let a=e.document_evidence??"neutral";if(a!=="neutral"&&a!=="strict")throw new Error("classic.document_evidence must be neutral or strict");return{artifact_layout:lu(e.artifact_layout),language:uu(e.language,"zh-CN","classic.language"),context_compression:r,review_mode:i,auto_transition:n,...a==="strict"?{document_evidence:a}:{}}}function _v(t){let r=ge(t,"hook").allow_paths??[];if(!Array.isArray(r))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(r.map((i,n)=>Ki(i,`hook.allow_paths[${n}]`)))]}}function Av(t){if(t===void 0)return{...mr};let e=ge(t,"memory"),r=e.learning??mr.learning,i=e.retrieval??mr.retrieval;if(typeof r!="boolean")throw new Error("memory.learning must be true or false");if(typeof i!="boolean")throw new Error("memory.retrieval must be true or false");return{learning:r,retrieval:i}}function No(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Iv(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||r.includes("\\")||r.includes("\0")||Le.posix.isAbsolute(r)||Le.win32.isAbsolute(r)||r.startsWith("~")||r.split("/").some(n=>n===""||n==="."||n===".."))throw new Error(`${e} must be a safe project-relative glob`);if(!r.toLowerCase().endsWith(".md"))throw new Error(`${e} must target a Markdown file ending in .md`);if(r.length>tu)throw new Error(`${e} exceeds ${tu} characters`);let i=0;for(let n=0;n<r.length;n+=1)r[n]==="?"?i+=1:r[n]==="*"&&(i+=1,r[n+1]==="*"&&(n+=1));if(i>ru)throw new Error(`${e} contains more than ${ru} wildcard tokens`);return r}function Tv(t){let e=No(t,"knowledge.local"),r=e.include??[];if(!Array.isArray(r))throw new Error("knowledge.local.include must be an array");let i={include:[...new Set(r.map((n,a)=>Iv(n,`knowledge.local.include[${a}]`)))],max_file_mb:au(e.max_file_mb,Ui.max_file_mb,"knowledge.local.max_file_mb"),max_total_mb:au(e.max_total_mb,Ui.max_total_mb,"knowledge.local.max_total_mb")};if(i.max_file_mb>i.max_total_mb)throw new Error("knowledge.local.max_file_mb must not exceed max_total_mb");return i}function $v(t){if(typeof t!="string"||t.trim().length===0)throw new Error("knowledge.remote.endpoint must be a non-empty URL");let e;try{e=new URL(t)}catch{throw new Error("knowledge.remote.endpoint must be a valid URL")}let r=e.hostname.toLowerCase().replace(/^\[|\]$/gu,""),i=r==="localhost"||r==="127.0.0.1"||r==="::1";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&i))throw new Error("knowledge.remote.endpoint must use HTTPS (HTTP is allowed for loopback)");return e.toString()}function jv(t){let e=No(t,"knowledge.remote"),r=$v(e.endpoint),i=e.token_env;if(i!==void 0&&(typeof i!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(i)))throw new Error("knowledge.remote.token_env must be an environment variable name");let n=e.scope;if(n!==void 0&&(typeof n!="string"||n.length>512))throw new Error("knowledge.remote.scope must be a string of at most 512 characters");let a=e.timeout_ms??5e3;if(typeof a!="number"||!Number.isSafeInteger(a)||a<100||a>3e4)throw new Error("knowledge.remote.timeout_ms must be an integer between 100 and 30000");return{endpoint:r,...i===void 0?{}:{token_env:i},...n===void 0?{}:{scope:n},timeout_ms:a}}function Ov(t){if(t===void 0)return{...wo};let e=No(t,"knowledge"),r=e.provider??"local";if(r!=="local"&&r!=="remote")throw new Error("knowledge.provider must be local or remote");let i=e.local===void 0?void 0:Tv(e.local);if(r==="local")return{provider:r,...i?{local:i}:{}};let n=e.remote===void 0?void 0:jv(e.remote);if(n===void 0)throw new Error("knowledge.remote must be configured when knowledge.provider is remote");return{provider:r,...i?{local:i}:{},remote:n}}function Hv(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function Dv(t,e,r,i,n,a,o,s){let c=t.schema!==void 0;if(!(c||t.default_workflow!==void 0||t.workflows!==void 0||!s.allowPartialProject&&t.native!==void 0)||s.allowPartialProject&&!c)return null;if(t.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(t.default_workflow!=="native"&&t.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let d=t.workflows??[t.default_workflow];if(!Array.isArray(d)||d.length===0||d.some(f=>f!=="native"&&f!=="classic"))throw new Error("workflows must contain native and/or classic");let u=[...new Set(d)];if(!u.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(u.includes("native")&&!n)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:u,ambient_resume:o,...e?{hook:e}:{},memory:r,knowledge:i,...n?{native:n}:{},...a?{classic:a}:{}}}function kt(t,e={}){let r=(0,vr.parseDocument)(t,{uniqueKeys:!0});if(r.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${r.errors[0].message}`);let i=r.toJS();if(i==null)return{value:{},config:null,ambient_resume:!0};if(typeof i!="object"||Array.isArray(i))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let n=i,a=Hv(n.ambient_resume),o=n.hook===void 0?void 0:_v(n.hook),s=Av(n.memory),c=Ov(n.knowledge),l=n.native===void 0?void 0:Pv(n.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),d=n.classic===void 0?void 0:Rv(n.classic),u=Dv(n,o,s,c,l,d,a,{allowPartialProject:e.allowPartialProject??!1});return{value:n,config:u,ambient_resume:a,memory:s,knowledge:c,...o?{hook:o}:{},...l?{native:l}:{},...d?{classic:d}:{}}}function du(t){return{id:t.id,from_artifact_root:t.fromArtifactRoot,to_artifact_root:t.toArtifactRoot,stage:t.stage,...t.cleanup?{cleanup:{kind:t.cleanup.kind,state:t.cleanup.state,manifest_hash:t.cleanup.manifestHash}}:{}}}function fu(t){let e=t.knowledge??{...wo};return{schema:t.schema,default_workflow:t.default_workflow,workflows:t.workflows??[t.default_workflow],ambient_resume:t.ambient_resume,memory:t.memory??{...mr},knowledge:{provider:e.provider,...e.local?{local:{include:[...e.local.include],max_file_mb:e.local.max_file_mb??Ui.max_file_mb,max_total_mb:e.local.max_total_mb??Ui.max_total_mb}}:{},...e.remote?{remote:{endpoint:e.remote.endpoint,timeout_ms:e.remote.timeout_ms,...e.remote.token_env===void 0?{}:{token_env:e.remote.token_env},...e.remote.scope===void 0?{}:{scope:e.remote.scope}}}:{}},...t.hook?{hook:{allow_paths:[...t.hook.allow_paths]}}:{},...t.native?{native:{artifact_root:t.native.artifact_root,language:t.native.language,clarification_mode:t.native.clarification_mode,archive_confirmation:t.native.archive_confirmation,max_verify_failures:t.native.max_verify_failures,...t.native.document_writes?{document_writes:t.native.document_writes}:{},...t.native.finish?.pull_request?{finish:{pull_request:{provider:t.native.finish.pull_request.provider,command:[...t.native.finish.pull_request.command],timeout_ms:t.native.finish.pull_request.timeout_ms}}}:{},...t.native.pending_root_move?{pending_root_move:du(t.native.pending_root_move)}:{}}}:{},...t.classic?{classic:{artifact_layout:t.classic.artifact_layout,language:t.classic.language,context_compression:t.classic.context_compression,review_mode:t.classic.review_mode,auto_transition:t.classic.auto_transition,...t.classic.document_evidence?{document_evidence:t.classic.document_evidence}:{}}}:{}}}function K(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function yr(t,e){let r=fu(e),i=kt((0,vr.stringify)(r)).config;if(!i)throw new Error("Unsupported Comet project schema");let n={...t,schema:i.schema,default_workflow:i.default_workflow,workflows:i.workflows,ambient_resume:i.ambient_resume};if(i.hook&&(n.hook={...K(t.hook),allow_paths:[...i.hook.allow_paths]}),i.memory){let a=K(t.memory);n.memory={...a,learning:i.memory.learning,retrieval:i.memory.retrieval}}if(i.knowledge){let a=K(t.knowledge),o={...a,provider:i.knowledge.provider};if(i.knowledge.local?o.local={...K(a.local),include:[...i.knowledge.local.include],max_file_mb:i.knowledge.local.max_file_mb,max_total_mb:i.knowledge.local.max_total_mb}:delete o.local,i.knowledge.remote){let c={...K(a.remote),endpoint:i.knowledge.remote.endpoint,timeout_ms:i.knowledge.remote.timeout_ms,...i.knowledge.remote.token_env===void 0?{}:{token_env:i.knowledge.remote.token_env},...i.knowledge.remote.scope===void 0?{}:{scope:i.knowledge.remote.scope}};i.knowledge.remote.token_env===void 0&&delete c.token_env,i.knowledge.remote.scope===void 0&&delete c.scope,o.remote=c}else delete o.remote;n.knowledge=o}if(i.native){let a=K(t.native),o={...a,artifact_root:i.native.artifact_root,language:i.native.language,clarification_mode:i.native.clarification_mode,archive_confirmation:i.native.archive_confirmation,max_verify_failures:i.native.max_verify_failures,...i.native.document_writes?{document_writes:i.native.document_writes}:{}};if(i.native.finish?.pull_request){let s=K(a.finish);o.finish={...s,pull_request:{...K(s.pull_request),provider:i.native.finish.pull_request.provider,command:[...i.native.finish.pull_request.command],timeout_ms:i.native.finish.pull_request.timeout_ms}}}else{let s={...K(a.finish)};delete s.pull_request,Object.keys(s).length>0?o.finish=s:delete o.finish}if(delete o.snapshot,i.native.pending_root_move){let s=K(a.pending_root_move),c=du(i.native.pending_root_move),l=K(s.cleanup),d=K(c.cleanup);o.pending_root_move={...s,...c,...c.cleanup?{cleanup:{...l,...d}}:{}}}else delete o.pending_root_move;n.native=o}return i.classic&&(n.classic={...K(t.classic),artifact_layout:i.classic.artifact_layout,language:i.classic.language,context_compression:i.classic.context_compression,review_mode:i.classic.review_mode,auto_transition:i.classic.auto_transition,...i.classic.document_evidence?{document_evidence:i.classic.document_evidence}:{}}),n}function Yi(t="docs",e="en"){return{schema:"comet.project.v1",default_workflow:"native",ambient_resume:!0,memory:{...mr},knowledge:{...wo},native:{artifact_root:tt(t),language:e,clarification_mode:"batch",archive_confirmation:"automatic",max_verify_failures:go,snapshot:{...U,include:[...U.include],exclude:[...U.exclude]}}}}var vr,gr,Gi,Ji,tu,ru,go,mr,Ui,wo,yv,iu,Nv,bv,ou,U,bt,Be=b(()=>{"use strict";vr=Pe(ve(),1),gr=Number.MAX_SAFE_INTEGER,Gi=1024,Ji=64,tu=1024,ru=64,go=5,mr={learning:!0,retrieval:!0},Ui={include:[],max_file_mb:1,max_total_mb:32},wo={provider:"local"},yv=12e4,iu=6e5,Nv=[".agents/skills/**",".amazonq/skills/**",".augment/skills/**",".bob/skills/**",".claude/skills/**",".cline/skills/**",".codebuddy/skills/**",".workbuddy/skills/**",".continue/skills/**",".cospec/skills/**",".crush/skills/**",".cursor/skills/**",".devin/skills/**",".dsh/skills/**",".factory/skills/**",".forge/skills/**",".gemini/skills/**",".github/skills/**",".grok/skills/**",".iflow/skills/**",".junie/skills/**",".kilocode/skills/**",".kimi-code/skills/**",".kiro/skills/**",".lingma/skills/**",".mimocode/skills/**",".opencode/skills/**",".omp/skills/**",".pi/skills/**",".qoder/skills/**",".qwen/skills/**",".roo/skills/**",".trae-cn/skills/**",".trae/skills/**",".windsurf/skills/**",".zcode/skills/**"],bv=["**/.idea/**","**/.vscode/**",".codex/skills/**","**/node_modules/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.svelte-kit/**","**/.vite/**","**/.parcel-cache/**","**/.turbo/**","**/.nx/cache/**","**/dist/**","**/build/**","**/out/**","**/coverage/**","**/.nyc_output/**","**/target/**","**/.gradle/**","**/.cxx/**","**/.externalNativeBuild/**","**/captures/**","**/__pycache__/**","**/.pytest_cache/**","**/.mypy_cache/**","**/.ruff_cache/**","**/.tox/**","**/.nox/**","**/.venv/**","**/venv/**","**/obj/**","**/CMakeFiles/**","**/cmake-build-*/**","**/.cache/**","**/tmp/**","**/temp/**","**/logs/**","**/*.tsbuildinfo","**/*.log","**/.DS_Store","**/Thumbs.db"],ou=[...Nv,...bv].sort((t,e)=>t.localeCompare(e,"en"));U={include:["**/*"],exclude:[...ou],max_files:1e4,max_total_bytes:1024*1024*1024,max_duration_ms:6e4,max_selection_records:2e4},bt={en:{schema:"# Configuration schema used by Comet. Do not edit this value.",default_workflow:"# Default workflow entered by /comet. Must also appear in workflows.",workflows:"# Workflows enabled in this project: native, classic, or both.",ambient_resume:`# Enables automatic recovery through the read-only Ambient Resume probe for both Native and Classic. Set false to disable it.
145
+ `)}function $g(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||Ge.posix.isAbsolute(r)||Ge.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be a project-relative path`);if(r===".")return[];let i=r.replaceAll("\\","/").split("/");if(i.some(n=>n===".."))throw new Error(`${e} must stay inside the project root`);if(i.some(n=>n===""||n==="."))throw new Error(`${e} must not contain empty or dot path segments`);return i}function lt(t){let e=$g(t,"native.artifact_root");return e.length===0?".":e.join("/")}function Yu(t,e="docs"){let r=t??e;if(r!=="legacy"&&r!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return r}function Nn(t,e,r=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let i=t.trim().replaceAll("\\","/");if(i.length===0||Ge.posix.isAbsolute(i)||Ge.win32.isAbsolute(i)||/^(?:~|[\\/])/u.test(i))throw new Error(`${e} must be relative to its declared path base`);let n=i.split("/");if(n.some(a=>a===".."))throw new Error(`${e} must stay inside its declared path base`);if(n.some(a=>a===""||a==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!r&&/[*?]/u.test(i))throw new Error(`${e} cannot contain wildcards`);return n.join("/")}function Ee(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Xu(t,e,r){let i=t??e;if(i!=="en"&&i!=="zh-CN")throw new Error(`${r} must be en or zh-CN`);return i}function Qo(t,e){if(typeof t!="string"||t.length===0||t.includes("\\")||t.includes("\0")||t.startsWith("/")||t.split("/").includes(".."))throw new Error(`${e} contains an unsafe pattern`);if(t.length>gn)throw new Error(`${e} exceeds ${gn} characters`);let r=0;for(let i=0;i<t.length;i+=1)t[i]==="?"?r+=1:t[i]==="*"&&(r+=1,t[i+1]==="*"&&(i+=1));if(r>wn)throw new Error(`${e} contains more than ${wn} wildcard tokens`);return t}function zu(t,e,r){if(t===void 0)return[...r];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(i=>Qo(i,e)))].sort((i,n)=>i.localeCompare(n,"en"))}function Ir(t,e,r){let i=t??e;if(!Number.isSafeInteger(i)||i<1)throw new Error(`${r} must be a positive integer`);return i}function Gu(t,e,r){let i=Ir(t,e,r);if(i>Math.floor(Number.MAX_SAFE_INTEGER/(1024*1024)))throw new Error(`${r} is too large to convert to bytes safely`);return i}function jg(t){if(t===void 0)return{...X,include:[...X.include],exclude:[...X.exclude]};let e=Ee(t,"native.snapshot");return{include:zu(e.include,"native.snapshot.include",X.include),exclude:zu(e.exclude,"native.snapshot.exclude",X.exclude),max_files:Ir(e.max_files,X.max_files,"native.snapshot.max_files"),max_total_bytes:Ir(e.max_total_bytes,X.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Ir(e.max_duration_ms,X.max_duration_ms,"native.snapshot.max_duration_ms"),max_selection_records:Ir(e.max_selection_records,X.max_selection_records,"native.snapshot.max_selection_records")}}function Og(t){if(t===void 0)return;let e=Ee(t,"native.pending_root_move"),r=e.id,i=e.from_artifact_root,n=e.to_artifact_root,a=e.stage;if(typeof r!="string"||!/^[a-f0-9-]{8,}$/u.test(r))throw new Error("native.pending_root_move.id is invalid");if(typeof i!="string"||typeof n!="string")throw new Error("native.pending_root_move roots must be strings");if(a!=="copying"&&a!=="ready"&&a!=="switched")throw new Error("native.pending_root_move.stage is invalid");let o;if(e.cleanup!==void 0){let s=Ee(e.cleanup,"native.pending_root_move.cleanup"),c=s.kind,l=s.state,d=s.manifest_hash;if(c!=="forward-source"&&c!=="restart-staging"&&c!=="rollback-destination"&&c!=="rollback-staging")throw new Error("native.pending_root_move.cleanup.kind is invalid");if(l!=="prepared"&&l!=="quarantined"&&l!=="deleting")throw new Error("native.pending_root_move.cleanup.state is invalid");if(typeof d!="string"||!/^[a-f0-9]{64}$/u.test(d))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");o={kind:c,state:l,manifestHash:d}}return{id:r,fromArtifactRoot:lt(i),toArtifactRoot:lt(n),stage:a,...o?{cleanup:o}:{}}}function Hg(t){if(t===void 0)return;let e=Ee(t,"native.finish");if(e.pull_request===void 0)return{};let r=Ee(e.pull_request,"native.finish.pull_request");if(r.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(r.command)||r.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(r.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let i=r.command.map((a,o)=>{if(typeof a!="string"||a.trim().length===0||a.length>4096||/[\0\r\n]/u.test(a))throw new Error(`native.finish.pull_request.command[${o}] must be a non-empty single-line string of at most 4096 characters`);return a});if(Ge.posix.isAbsolute(i[0])||Ge.win32.isAbsolute(i[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let n=r.timeout_ms??_g;if(!Number.isSafeInteger(n)||n<1||n>Wu)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${Wu}`);return{pull_request:{provider:"repository-command",command:i,timeout_ms:n}}}function Dg(t,e={}){let r=Ee(t,"native"),i=r.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof i!="string")throw new Error("native.artifact_root must be a string");let n=r.clarification_mode??"batch";if(n!=="sequential"&&n!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let a=r.archive_confirmation??"automatic";if(a!=="automatic"&&a!=="required")throw new Error("native.archive_confirmation must be automatic or required");let o=r.max_verify_failures??Yo;if(!Number.isSafeInteger(o)||o<1)throw new Error("native.max_verify_failures must be a positive integer");let s=r.document_writes??"allow";if(s!=="allow"&&s!=="revert")throw new Error("native.document_writes must be allow or revert");let c=Og(r.pending_root_move),l=Hg(r.finish);return{artifact_root:lt(i),language:Xu(r.language,"en","native.language"),clarification_mode:n,archive_confirmation:a,max_verify_failures:o,...s==="revert"?{document_writes:s}:{},snapshot:jg(r.snapshot),...l?{finish:l}:{},...c?{pending_root_move:c}:{}}}function Lg(t){let e=Ee(t,"classic"),r=e.context_compression??"off";if(r!=="off"&&r!=="beta")throw new Error("classic.context_compression must be off or beta");let i=e.review_mode??"standard";if(i!=="off"&&i!=="standard"&&i!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let n=e.auto_transition??!0;if(typeof n!="boolean")throw new Error("classic.auto_transition must be true or false");let a=e.document_evidence??"neutral";if(a!=="neutral"&&a!=="strict")throw new Error("classic.document_evidence must be neutral or strict");return{artifact_layout:Yu(e.artifact_layout),language:Xu(e.language,"zh-CN","classic.language"),context_compression:r,review_mode:i,auto_transition:n,...a==="strict"?{document_evidence:a}:{}}}function Bg(t){let r=Ee(t,"hook").allow_paths??[];if(!Array.isArray(r))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(r.map((i,n)=>Nn(i,`hook.allow_paths[${n}]`)))]}}function Mg(t){if(t===void 0)return{...Tr};let e=Ee(t,"memory"),r=e.learning??Tr.learning,i=e.retrieval??Tr.retrieval;if(typeof r!="boolean")throw new Error("memory.learning must be true or false");if(typeof i!="boolean")throw new Error("memory.retrieval must be true or false");return{learning:r,retrieval:i}}function Zo(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Fg(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim();if(r.length===0||r.includes("\\")||r.includes("\0")||Ge.posix.isAbsolute(r)||Ge.win32.isAbsolute(r)||r.startsWith("~")||r.split("/").some(n=>n===""||n==="."||n===".."))throw new Error(`${e} must be a safe project-relative glob`);if(!r.toLowerCase().endsWith(".md"))throw new Error(`${e} must target a Markdown file ending in .md`);if(r.length>Vu)throw new Error(`${e} exceeds ${Vu} characters`);let i=0;for(let n=0;n<r.length;n+=1)r[n]==="?"?i+=1:r[n]==="*"&&(i+=1,r[n+1]==="*"&&(n+=1));if(i>qu)throw new Error(`${e} contains more than ${qu} wildcard tokens`);return r}function Vg(t){let e=Zo(t,"knowledge.local"),r=e.include??[];if(!Array.isArray(r))throw new Error("knowledge.local.include must be an array");let i={include:[...new Set(r.map((n,a)=>Fg(n,`knowledge.local.include[${a}]`)))],max_file_mb:Gu(e.max_file_mb,yn.max_file_mb,"knowledge.local.max_file_mb"),max_total_mb:Gu(e.max_total_mb,yn.max_total_mb,"knowledge.local.max_total_mb")};if(i.max_file_mb>i.max_total_mb)throw new Error("knowledge.local.max_file_mb must not exceed max_total_mb");return i}function qg(t){if(typeof t!="string"||t.trim().length===0)throw new Error("knowledge.remote.endpoint must be a non-empty URL");let e;try{e=new URL(t)}catch{throw new Error("knowledge.remote.endpoint must be a valid URL")}let r=e.hostname.toLowerCase().replace(/^\[|\]$/gu,""),i=r==="localhost"||r==="127.0.0.1"||r==="::1";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&i))throw new Error("knowledge.remote.endpoint must use HTTPS (HTTP is allowed for loopback)");return e.toString()}function Wg(t){let e=Zo(t,"knowledge.remote"),r=qg(e.endpoint),i=e.token_env;if(i!==void 0&&(typeof i!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(i)))throw new Error("knowledge.remote.token_env must be an environment variable name");let n=e.scope;if(n!==void 0&&(typeof n!="string"||n.length>512))throw new Error("knowledge.remote.scope must be a string of at most 512 characters");let a=e.timeout_ms??5e3;if(typeof a!="number"||!Number.isSafeInteger(a)||a<100||a>3e4)throw new Error("knowledge.remote.timeout_ms must be an integer between 100 and 30000");return{endpoint:r,...i===void 0?{}:{token_env:i},...n===void 0?{}:{scope:n},timeout_ms:a}}function zg(t){if(t===void 0)return{...Xo};let e=Zo(t,"knowledge"),r=e.provider??"local";if(r!=="local"&&r!=="remote")throw new Error("knowledge.provider must be local or remote");let i=e.local===void 0?void 0:Vg(e.local);if(r==="local")return{provider:r,...i?{local:i}:{}};let n=e.remote===void 0?void 0:Wg(e.remote);if(n===void 0)throw new Error("knowledge.remote must be configured when knowledge.provider is remote");return{provider:r,...i?{local:i}:{},remote:n}}function Gg(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function Jg(t,e,r,i,n,a,o,s){let c=t.schema!==void 0;if(!(c||t.default_workflow!==void 0||t.workflows!==void 0||!s.allowPartialProject&&t.native!==void 0)||s.allowPartialProject&&!c)return null;if(t.schema!=="comet.project.v1")throw new Error("Unsupported Comet project schema");if(t.default_workflow!=="native"&&t.default_workflow!=="classic")throw new Error("default_workflow must be native or classic");let d=t.workflows??[t.default_workflow];if(!Array.isArray(d)||d.length===0||d.some(f=>f!=="native"&&f!=="classic"))throw new Error("workflows must contain native and/or classic");let u=[...new Set(d)];if(!u.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(u.includes("native")&&!n)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:u,ambient_resume:o,...e?{hook:e}:{},memory:r,knowledge:i,...n?{native:n}:{},...a?{classic:a}:{}}}function Ot(t,e={}){let r=(0,$r.parseDocument)(t,{uniqueKeys:!0});if(r.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${r.errors[0].message}`);let i=r.toJS();if(i==null)return{value:{},config:null,ambient_resume:!0};if(typeof i!="object"||Array.isArray(i))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let n=i,a=Gg(n.ambient_resume),o=n.hook===void 0?void 0:Bg(n.hook),s=Mg(n.memory),c=zg(n.knowledge),l=n.native===void 0?void 0:Dg(n.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),d=n.classic===void 0?void 0:Lg(n.classic),u=Jg(n,o,s,c,l,d,a,{allowPartialProject:e.allowPartialProject??!1});return{value:n,config:u,ambient_resume:a,memory:s,knowledge:c,...o?{hook:o}:{},...l?{native:l}:{},...d?{classic:d}:{}}}function Qu(t){return{id:t.id,from_artifact_root:t.fromArtifactRoot,to_artifact_root:t.toArtifactRoot,stage:t.stage,...t.cleanup?{cleanup:{kind:t.cleanup.kind,state:t.cleanup.state,manifest_hash:t.cleanup.manifestHash}}:{}}}function Zu(t){let e=t.knowledge??{...Xo};return{schema:t.schema,default_workflow:t.default_workflow,workflows:t.workflows??[t.default_workflow],ambient_resume:t.ambient_resume,memory:t.memory??{...Tr},knowledge:{provider:e.provider,...e.local?{local:{include:[...e.local.include],max_file_mb:e.local.max_file_mb??yn.max_file_mb,max_total_mb:e.local.max_total_mb??yn.max_total_mb}}:{},...e.remote?{remote:{endpoint:e.remote.endpoint,timeout_ms:e.remote.timeout_ms,...e.remote.token_env===void 0?{}:{token_env:e.remote.token_env},...e.remote.scope===void 0?{}:{scope:e.remote.scope}}}:{}},...t.hook?{hook:{allow_paths:[...t.hook.allow_paths]}}:{},...t.native?{native:{artifact_root:t.native.artifact_root,language:t.native.language,clarification_mode:t.native.clarification_mode,archive_confirmation:t.native.archive_confirmation,max_verify_failures:t.native.max_verify_failures,...t.native.document_writes?{document_writes:t.native.document_writes}:{},...t.native.finish?.pull_request?{finish:{pull_request:{provider:t.native.finish.pull_request.provider,command:[...t.native.finish.pull_request.command],timeout_ms:t.native.finish.pull_request.timeout_ms}}}:{},...t.native.pending_root_move?{pending_root_move:Qu(t.native.pending_root_move)}:{}}}:{},...t.classic?{classic:{artifact_layout:t.classic.artifact_layout,language:t.classic.language,context_compression:t.classic.context_compression,review_mode:t.classic.review_mode,auto_transition:t.classic.auto_transition,...t.classic.document_evidence?{document_evidence:t.classic.document_evidence}:{}}}:{}}}function Q(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}function Hr(t,e){let r=Zu(e),i=Ot((0,$r.stringify)(r)).config;if(!i)throw new Error("Unsupported Comet project schema");let n={...t,schema:i.schema,default_workflow:i.default_workflow,workflows:i.workflows,ambient_resume:i.ambient_resume};if(i.hook&&(n.hook={...Q(t.hook),allow_paths:[...i.hook.allow_paths]}),i.memory){let a=Q(t.memory);n.memory={...a,learning:i.memory.learning,retrieval:i.memory.retrieval}}if(i.knowledge){let a=Q(t.knowledge),o={...a,provider:i.knowledge.provider};if(i.knowledge.local?o.local={...Q(a.local),include:[...i.knowledge.local.include],max_file_mb:i.knowledge.local.max_file_mb,max_total_mb:i.knowledge.local.max_total_mb}:delete o.local,i.knowledge.remote){let c={...Q(a.remote),endpoint:i.knowledge.remote.endpoint,timeout_ms:i.knowledge.remote.timeout_ms,...i.knowledge.remote.token_env===void 0?{}:{token_env:i.knowledge.remote.token_env},...i.knowledge.remote.scope===void 0?{}:{scope:i.knowledge.remote.scope}};i.knowledge.remote.token_env===void 0&&delete c.token_env,i.knowledge.remote.scope===void 0&&delete c.scope,o.remote=c}else delete o.remote;n.knowledge=o}if(i.native){let a=Q(t.native),o={...a,artifact_root:i.native.artifact_root,language:i.native.language,clarification_mode:i.native.clarification_mode,archive_confirmation:i.native.archive_confirmation,max_verify_failures:i.native.max_verify_failures,...i.native.document_writes?{document_writes:i.native.document_writes}:{}};if(i.native.finish?.pull_request){let s=Q(a.finish);o.finish={...s,pull_request:{...Q(s.pull_request),provider:i.native.finish.pull_request.provider,command:[...i.native.finish.pull_request.command],timeout_ms:i.native.finish.pull_request.timeout_ms}}}else{let s={...Q(a.finish)};delete s.pull_request,Object.keys(s).length>0?o.finish=s:delete o.finish}if(delete o.snapshot,i.native.pending_root_move){let s=Q(a.pending_root_move),c=Qu(i.native.pending_root_move),l=Q(s.cleanup),d=Q(c.cleanup);o.pending_root_move={...s,...c,...c.cleanup?{cleanup:{...l,...d}}:{}}}else delete o.pending_root_move;n.native=o}return i.classic&&(n.classic={...Q(t.classic),artifact_layout:i.classic.artifact_layout,language:i.classic.language,context_compression:i.classic.context_compression,review_mode:i.classic.review_mode,auto_transition:i.classic.auto_transition,...i.classic.document_evidence?{document_evidence:i.classic.document_evidence}:{}}),n}function bn(t="docs",e="en"){return{schema:"comet.project.v1",default_workflow:"native",ambient_resume:!0,memory:{...Tr},knowledge:{...Xo},native:{artifact_root:lt(t),language:e,clarification_mode:"batch",archive_confirmation:"automatic",max_verify_failures:Yo,snapshot:{...X,include:[...X.include],exclude:[...X.exclude]}}}}var $r,jr,gn,wn,Vu,qu,Yo,Tr,yn,Xo,_g,Wu,Ag,Ig,Ju,X,jt,Je=b(()=>{"use strict";$r=Oe(Se(),1),jr=Number.MAX_SAFE_INTEGER,gn=1024,wn=64,Vu=1024,qu=64,Yo=5,Tr={learning:!0,retrieval:!0},yn={include:[],max_file_mb:1,max_total_mb:32},Xo={provider:"local"},_g=12e4,Wu=6e5,Ag=[".agents/skills/**",".amazonq/skills/**",".augment/skills/**",".bob/skills/**",".claude/skills/**",".cline/skills/**",".codebuddy/skills/**",".workbuddy/skills/**",".continue/skills/**",".cospec/skills/**",".crush/skills/**",".cursor/skills/**",".devin/skills/**",".dsh/skills/**",".factory/skills/**",".forge/skills/**",".gemini/skills/**",".github/skills/**",".grok/skills/**",".iflow/skills/**",".junie/skills/**",".kilocode/skills/**",".kimi-code/skills/**",".kiro/skills/**",".lingma/skills/**",".mimocode/skills/**",".opencode/skills/**",".omp/skills/**",".pi/skills/**",".qoder/skills/**",".qwen/skills/**",".roo/skills/**",".trae-cn/skills/**",".trae/skills/**",".windsurf/skills/**",".zcode/skills/**"],Ig=["**/.idea/**","**/.vscode/**",".codex/skills/**","**/node_modules/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.svelte-kit/**","**/.vite/**","**/.parcel-cache/**","**/.turbo/**","**/.nx/cache/**","**/dist/**","**/build/**","**/out/**","**/coverage/**","**/.nyc_output/**","**/target/**","**/.gradle/**","**/.cxx/**","**/.externalNativeBuild/**","**/captures/**","**/__pycache__/**","**/.pytest_cache/**","**/.mypy_cache/**","**/.ruff_cache/**","**/.tox/**","**/.nox/**","**/.venv/**","**/venv/**","**/obj/**","**/CMakeFiles/**","**/cmake-build-*/**","**/.cache/**","**/tmp/**","**/temp/**","**/logs/**","**/*.tsbuildinfo","**/*.log","**/.DS_Store","**/Thumbs.db"],Ju=[...Ag,...Ig].sort((t,e)=>t.localeCompare(e,"en"));X={include:["**/*"],exclude:[...Ju],max_files:1e4,max_total_bytes:1024*1024*1024,max_duration_ms:6e4,max_selection_records:2e4},jt={en:{schema:"# Configuration schema used by Comet. Do not edit this value.",default_workflow:"# Default workflow entered by /comet. Must also appear in workflows.",workflows:"# Workflows enabled in this project: native, classic, or both.",ambient_resume:`# Enables automatic recovery through the read-only Ambient Resume probe for both Native and Classic. Set false to disable it.
146
146
  # ambient_resume: true | false`,memory:"# Project policy for automatic personal-memory learning and retrieval.","memory.learning":`# Allows workflow events in this project to form new personal memories automatically.
147
147
  # learning: true | false`,"memory.retrieval":`# Allows personal memories to be injected into Agent context for this project.
148
148
  # retrieval: true | false`,knowledge:"# Project knowledge retrieval provider used by ordinary Comet tasks.","knowledge.provider":`# Provider for project knowledge.
@@ -170,32 +170,109 @@ ${r.comment}`:r.comment}this.doc.range[2]=r.offset;break}default:this.errors.pus
170
170
  # 可选值:off | beta`,"classic.review_mode":`# 新建 Classic change 默认使用的审查深度。
171
171
  # 可选值:off | standard | thorough`,"classic.auto_transition":`# Classic 阶段通过后是否自动进入下一阶段。
172
172
  # 可选值:true | false`,"classic.document_evidence":`# 文档编辑对已记录检查证据的影响:neutral 在只有文档文件变化时保持 build 和 verify 证据有效,strict 重新绑定工作区的全部文件。
173
- # 可选值:neutral | strict`}}});function Fe(t){return t!==0&&t!==0n&&t!=="0"}function Me(t,e){return Fe(t.dev)&&Fe(e.dev)&&Fe(t.ino)&&Fe(e.ino)}function D(t,e){let r=Fe(t.dev)&&Fe(e.dev);if(r&&t.dev!==e.dev)return!1;let i=Fe(t.ino)&&Fe(e.ino);return i&&t.ino!==e.ino?!1:r&&i?!0:t.birthtime===e.birthtime}var Nr=b(()=>{"use strict"});import{constants as Xi,promises as rt}from"fs";function bo(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function pu(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function br(t){return{dev:t.dev,ino:t.ino,birthtime:bo(t)}}function Qi(t,e){let r=br(t),i=br(e);return Me(r,i)?D(r,i):D(r,i)&&bo(t)===bo(e)&&pu(t)===pu(e)&&t.size===e.size}async function kr(t,e,r={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let i=r.label??"file",n=r.bigint===!0,a=await rt.lstat(t,{bigint:n});if(!a.isFile()||a.isSymbolicLink())throw new ue("not-regular-file",`${i} must be a regular file`);if(BigInt(a.size)>BigInt(e))throw new ue("too-large",`${i} exceeds ${e} bytes`);let o=await rt.realpath(t);await r.verify?.("pre-open",{realPath:o,identity:br(a)});let s=process.platform==="win32"?Xi.O_RDONLY:Xi.O_RDONLY|Xi.O_NOFOLLOW|Xi.O_NONBLOCK,c;try{c=await rt.open(t,s)}catch(l){throw l.code==="ELOOP"?new ue("not-regular-file",`${i} must be a regular file`,{cause:l}):l}try{let[l,d,u]=await Promise.all([c.stat({bigint:n}),rt.lstat(t,{bigint:n}),rt.realpath(t)]);if(!l.isFile()||!d.isFile()||d.isSymbolicLink()||u!==o||!Qi(a,l)||!Qi(a,d))throw new ue("changed",`${i} changed while opening`);await r.verify?.("post-open",{realPath:u,identity:br(l)}),await r.hooks?.afterOpen?.();let f=[],m=0,g=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let N=e+1-m,{bytesRead:k}=await c.read(g,0,Math.min(g.length,N),null);if(k===0)break;if(m+=k,m>e)throw new ue("too-large",`${i} exceeds ${e} bytes`);f.push(Buffer.from(g.subarray(0,k)))}await r.hooks?.beforeFinalCheck?.();let[p,h,w]=await Promise.all([c.stat({bigint:n}),rt.lstat(t,{bigint:n}),rt.realpath(t)]);if(!h.isFile()||h.isSymbolicLink()||w!==o||!Qi(a,p)||!Qi(a,h))throw new ue("changed",`${i} changed while reading`);return await r.verify?.("post-read",{realPath:w,identity:br(p)}),{bytes:Buffer.concat(f,m),stat:p,realPath:w}}finally{await c.close()}}var ue,Sr=b(()=>{"use strict";Nr();ue=class extends Error{reason;constructor(e,r,i){super(r,i),this.name="RaceSafeReadError",this.reason=e}}});import{promises as Zi}from"fs";import Ve from"path";function Lv(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function ko(t,e){let r=Ve.relative(t,e);return r===""||!Ve.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${Ve.sep}`)}async function hu(t,e){let r=Ve.resolve(t),i=await Zi.lstat(r);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return Zi.realpath(r)}async function mu(t,e,r,i){let n=t;for(let a=0;a<r.length;a++){n=Ve.join(n,r[a]);let o;try{o=await Zi.lstat(n)}catch(d){if(Lv(d))return{exists:!1,kind:"missing"};throw d}let s=Ve.relative(t,n).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${i.label} crosses a symbolic link or junction at ${s}`);let c=a===r.length-1;if(!c&&!o.isDirectory())throw new Error(`${i.label} ancestor ${s} must be a real directory`);if(c&&(i.expected==="file"&&!o.isFile()||i.expected==="directory"&&!o.isDirectory()||i.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${i.label} must be a real ${i.expected}`);let l=await Zi.realpath(n);if(!ko(e,l))throw new Error(`${i.label} resolves outside the project root`);if(c)return{exists:!0,kind:o.isFile()?"file":o.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function we(t,e,r){let i=Ki(e,r.label),n=Ve.resolve(t),a=await hu(n,r.label),o=i.split("/"),s=Ve.resolve(n,...o);if(!ko(n,s))throw new Error(`${r.label} must stay inside the project root`);let c=await mu(n,a,o,r);return{projectRoot:n,target:s,relative:i,exists:c.exists,kind:c.kind}}async function Q(t,e,r,i){let n=await we(t,e,{label:i.label,expected:"file"});if(!n.exists){let o=new Error(`${i.label} does not exist`);throw o.code="ENOENT",o}let a=await hu(n.projectRoot,i.label);return kr(n.target,r,{...i,verify:async(o,s)=>{if(!ko(a,s.realPath))throw new Error(`${i.label} resolves outside the project root`);await mu(n.projectRoot,a,n.relative.split("/"),{label:i.label,expected:"file"})}})}var qe=b(()=>{"use strict";Sr();Be()});import{createHash as Bv}from"crypto";function So(t,e){return t.exists===e.exists&&t.sha256===e.sha256}function Fv(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function en(t,e={}){return(await xr(t,e)).document}async function vu(t){try{return(await Q(t,Er,gr,{label:Er})).bytes}catch(e){if(Fv(e))return null;throw e}}function gu(t){return t?{exists:!0,sha256:Bv("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function tn(t){return gu(await vu(t))}async function xr(t,e={}){let r=await vu(t);return{document:r?kt(r.toString("utf8"),e):null,identity:gu(r)}}async function Eo(t){return(await en(t))?.config??null}var Er,St=b(()=>{"use strict";Be();qe();Er=".comet/config.yaml"});import{promises as Co}from"node:fs";async function Po(t,e){let r;for(let i=0;i<=xo.length;i+=1)try{return await t()}catch(n){r=n;let a=n.code;if(i===xo.length||!Mv.has(a??""))throw n;await new Promise(o=>setTimeout(o,xo[i]))}throw r}async function rn(t,e){await Po(()=>Co.rename(t,e),`rename ${e}`)}async function Ro(t){await Po(()=>Co.unlink(t),`unlink ${t}`)}async function nn(t,e){await Po(()=>Co.link(t,e),`link ${e}`)}var Mv,xo,_o=b(()=>{"use strict";Mv=new Set(["EPERM","EACCES","EBUSY","ENOTEMPTY"]),xo=[50,100,200]});import{randomUUID as Vv}from"crypto";import{constants as qv,promises as q}from"fs";import re from"path";async function Ao(t,e){try{return await nn(t,e),{linked:!0}}catch(r){let i=r.code;if(i!=="ENOTSUP"&&i!=="EOPNOTSUPP")throw r}return await q.copyFile(t,e,qv.COPYFILE_EXCL),{linked:!1}}function an(t,e){let r=re.relative(t,e);return r===""||!re.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${re.sep}`)}function on(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Wv(t,e){return D(t,on(e))}function sn(t,e){return D(on(t),on(e))}function zv(t,e){return sn(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function wu(t){let e=await q.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Contained atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await q.realpath(t),...on(e)}}async function Et(t){for(let e of t){let r=await q.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!Wv(e,r)||await q.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function Gv(t,e,r){let[i,n]=await Promise.all([q.lstat(t),q.realpath(t),Et(r)]);if(!i.isFile()||i.isSymbolicLink()||!sn(i,e)||!an(r[0].realPath,n))throw new Error("Contained atomic write temporary file changed after close");return i}async function Jv(t,e){let r=re.resolve(t),i=re.resolve(e);if(!an(r,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let n=[await wu(r)],a=re.relative(r,i).split(re.sep).filter(Boolean),o=r;for(let s of a){await Et(n),o=re.join(o,s);try{await q.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await wu(o);if(!an(n[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Et(n),n}async function Uv(t){let e;try{e=await q.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function Kv(t,e,r){let i=re.dirname(t),n=await Jv(r.containedRoot,i),a=re.join(i,`.${re.basename(t)}.${Vv()}.tmp`),o,s,c;try{await r.beforeTemporaryOpen?.(),o=await q.open(a,"wx"),s=await o.stat();let[l,d]=await Promise.all([q.lstat(a),q.realpath(a)]);if(await Et(n),!l.isFile()||l.isSymbolicLink()||!sn(s,l)||!an(n[0].realPath,d))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),c=await o.stat(),!sn(s,c))throw new Error("Contained atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Contained atomic write temporary file was not written");c=await Gv(a,c,n),await r.beforeCommit?.(),await Et(n);let u=await q.lstat(a);if(!u.isFile()||u.isSymbolicLink()||!c||!zv(u,c))throw new Error("Contained atomic write temporary file changed before commit");r.exclusive?(await Ao(a,t),await q.unlink(a)):await rn(a,t),await Uv(i)}catch(l){await o?.close();try{await Et(n),await q.rm(a,{force:!0})}catch{}throw l}}async function it(t,e,r){await Kv(t,e,r)}var xt=b(()=>{"use strict";_o();Nr()});var qb,Io=b(()=>{"use strict";xt();St();qe();qb=16*1024});async function To(t,e){if(!e)return;let r=await tn(t);if(!So(r,e))throw new Error("Project config changed before commit; rerun the operation")}var $o=b(()=>{"use strict";xt();Be();St();qe();Io()});var de=b(()=>{"use strict";Nr()});import{randomUUID as Qv}from"crypto";import{promises as W}from"fs";import ie from"path";function cn(t,e){let r=ie.relative(t,e);return r===""||!ie.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${ie.sep}`)}function Zv(t,e){return D({...t,birthtime:t.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function ln(t,e){return D({dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs},{dev:e.dev,ino:e.ino,birthtime:e.birthtimeMs})}function eg(t,e){return ln(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function yu(t){let e=await W.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Native atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await W.realpath(t),dev:e.dev,ino:e.ino,birthtimeMs:e.birthtimeMs}}async function Ct(t){for(let e of t){let r=await W.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!Zv(e,r)||await W.realpath(e.path)!==e.realPath)throw new Error(`Native atomic write parent changed before commit: ${e.path}`)}}async function tg(t,e,r){let[i,n]=await Promise.all([W.lstat(t),W.realpath(t),r?Ct(r):Promise.resolve()]);if(!i.isFile()||i.isSymbolicLink()||!ln(i,e)||r&&!cn(r[0].realPath,n))throw new Error("Native atomic write temporary file changed after close");return i}async function rg(t,e){let r=ie.resolve(t),i=ie.resolve(e);if(!cn(r,i))throw new Error(`Native atomic write parent is outside its managed root: ${e}`);let n=[await yu(r)],a=ie.relative(r,i).split(ie.sep).filter(Boolean),o=r;for(let s of a){await Ct(n),o=ie.join(o,s);try{await W.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await yu(o);if(!cn(n[0].realPath,c.realPath))throw new Error(`Native atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Ct(n),n}async function ig(t){let e;try{e=await W.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function ng(t,e,r={}){let i=ie.dirname(t),n=r.containedRoot?await rg(r.containedRoot,i):null;n||await W.mkdir(i,{recursive:!0});let a=ie.join(i,`.${ie.basename(t)}.${Qv()}.tmp`),o,s,c;try{if(await r.beforeTemporaryOpen?.(),o=await W.open(a,"wx"),s=await o.stat(),n){let[l,d]=await Promise.all([W.lstat(a),W.realpath(a)]);if(await Ct(n),!l.isFile()||l.isSymbolicLink()||!ln(s,l)||!cn(n[0].realPath,d))throw new Error("Native atomic write temporary file opened outside its managed parent")}if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),c=await o.stat(),!ln(s,c))throw new Error("Native atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Native atomic write temporary file was not written");if(c=await tg(a,c,n),await r.beforeCommit?.(),n){await Ct(n);let l=await W.lstat(a);if(!l.isFile()||l.isSymbolicLink()||!c||!eg(l,c))throw new Error("Native atomic write temporary file changed before commit")}r.exclusive?(await nn(a,t),await Ro(a)):await rn(a,t),await ig(i)}catch(l){if(await o?.close(),!n)await W.rm(a,{force:!0});else try{await Ct(n),await W.rm(a,{force:!0})}catch{}throw l}}async function ye(t,e,r={}){await ng(t,e,r)}var T=b(()=>{"use strict";_o();de()});import{existsSync as sk,promises as Ne}from"fs";import A from"path";import ag from"os";async function jo(t){try{return await Ne.lstat(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function og(t){try{let e=await Ne.readFile(t,"utf8");return/^schema:\s*comet\.project\.v1\s*$/mu.test(e)}catch(e){if(e.code==="ENOENT")return!1;throw e}}function Cr(t,e){let r=A.relative(t,e);return r===""||!A.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${A.sep}`)}async function Pt(t){let e=[],r=t;for(;!await jo(r);){let n=A.dirname(r);if(n===r)break;e.push(A.basename(r)),r=n}let i=await Ne.realpath(r);return A.resolve(i,...e.reverse())}async function Oo(t){try{return(await Ne.lstat(t)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function Ho(t){let e=A.resolve(t);try{(await Ne.stat(e)).isDirectory()||(e=A.dirname(e))}catch(n){if(n.code!=="ENOENT")throw n}let r=e,i=A.resolve(ag.homedir());for(;;){if(!(e===i&&r!==i)){let o=A.join(e,...un.split("/")),s=e===r||await og(o);if(await jo(o)&&s)return e}if(await jo(A.join(e,".git")))return e;let a=A.dirname(e);if(a===e)return r;e=a}}function Pr(t){return tt(t)}async function sg(t,e){let r=Pr(e),i=A.resolve(t,...r.split("/")),n=await Ne.realpath(t),a=await Pt(i);if(!Cr(n,a))throw new Error("native.artifact_root resolves outside the project root");return i}async function nt(t,e){let r=Pr(e),i=await sg(t,r),n=A.join(i,"comet");if(await Oo(n))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([Pt(i),Pt(n)]);if(!Cr(a,o))throw new Error("The configured Native comet root resolves outside its artifact root");let s=A.resolve(t),c=A.join(s,".comet","runtime","native");if(await Oo(c))throw new Error("The Native Runtime root must not be a symbolic link");let[l,d]=await Promise.all([Ne.realpath(s),Pt(c)]);if(!Cr(l,d))throw new Error("The Native Runtime root resolves outside the project root");return{projectRoot:s,configFile:A.join(t,...un.split("/")),artifactRoot:i,artifactRootRef:r,nativeRoot:n,specsDir:A.join(n,"specs"),changesDir:A.join(n,"changes"),archiveDir:A.join(n,"archive"),runtimeDir:c,changesRuntimeDir:A.join(c,"changes"),locksDir:A.join(c,"locks"),transactionsDir:A.join(c,"transactions")}}async function Nu(t){await Promise.all([t.specsDir,t.changesDir,t.archiveDir].map(async e=>{await L(t.nativeRoot,e),await Ne.mkdir(e,{recursive:!0})})),await Promise.all([t.changesRuntimeDir,t.locksDir,t.transactionsDir].map(async e=>{await L(t.projectRoot,e),await Ne.mkdir(e,{recursive:!0})}))}async function L(t,e){let r=A.resolve(t),i=A.resolve(e);if(!Cr(r,i))throw new Error(`Path is outside the Native root: ${e}`);if(await Oo(r))throw new Error(`Native root must not be a symbolic link: ${t}`);let[n,a]=await Promise.all([Pt(r),Pt(i)]);if(!Cr(n,a))throw new Error(`Path resolves outside the Native root: ${e}`);return i}var un,I=b(()=>{"use strict";Be();un=".comet/config.yaml"});import cg from"path";function ku(t="docs",e="en"){return Yi(t,e)}async function ne(t){let e=(await en(t))?.config??null;return e?.native?e:null}async function Rr(t,e,r={}){let i=await xr(t,{allowPartialProject:!0}),n=yr(i.document?.value??{},e),a=cg.join(t,...un.split("/"));await ye(a,wr(n,e.native.language==="zh-CN"?"zh-CN":"en"),{containedRoot:t,beforeCommit:async()=>{await r.beforeCommit?.(),await To(t,i.identity)}})}var bu,Y=b(()=>{"use strict";Be();St();$o();T();I();bu=su});function yg(t,e){return Wo[t][e]}function dn(t){return["outcome","scope","nonGoals","acceptanceExamples","constraints","decisions","openQuestions","verificationExpectations"].map(r=>`# ${yg(t,r)}
173
+ # 可选值:neutral | strict`}}});function Ue(t){return t!==0&&t!==0n&&t!=="0"}function Ke(t,e){return Ue(t.dev)&&Ue(e.dev)&&Ue(t.ino)&&Ue(e.ino)}function B(t,e){let r=Ue(t.dev)&&Ue(e.dev);if(r&&t.dev!==e.dev)return!1;let i=Ue(t.ino)&&Ue(e.ino);return i&&t.ino!==e.ino?!1:r&&i?!0:t.birthtime===e.birthtime}var Dr=b(()=>{"use strict"});import{constants as kn,promises as ut}from"fs";function es(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function ed(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function Lr(t){return{dev:t.dev,ino:t.ino,birthtime:es(t)}}function Sn(t,e){let r=Lr(t),i=Lr(e);return Ke(r,i)?B(r,i):B(r,i)&&es(t)===es(e)&&ed(t)===ed(e)&&t.size===e.size}async function Br(t,e,r={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let i=r.label??"file",n=r.bigint===!0,a=await ut.lstat(t,{bigint:n});if(!a.isFile()||a.isSymbolicLink())throw new me("not-regular-file",`${i} must be a regular file`);if(BigInt(a.size)>BigInt(e))throw new me("too-large",`${i} exceeds ${e} bytes`);let o=await ut.realpath(t);await r.verify?.("pre-open",{realPath:o,identity:Lr(a)});let s=process.platform==="win32"?kn.O_RDONLY:kn.O_RDONLY|kn.O_NOFOLLOW|kn.O_NONBLOCK,c;try{c=await ut.open(t,s)}catch(l){throw l.code==="ELOOP"?new me("not-regular-file",`${i} must be a regular file`,{cause:l}):l}try{let[l,d,u]=await Promise.all([c.stat({bigint:n}),ut.lstat(t,{bigint:n}),ut.realpath(t)]);if(!l.isFile()||!d.isFile()||d.isSymbolicLink()||u!==o||!Sn(a,l)||!Sn(a,d))throw new me("changed",`${i} changed while opening`);await r.verify?.("post-open",{realPath:u,identity:Lr(l)}),await r.hooks?.afterOpen?.();let f=[],h=0,v=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let y=e+1-h,{bytesRead:k}=await c.read(v,0,Math.min(v.length,y),null);if(k===0)break;if(h+=k,h>e)throw new me("too-large",`${i} exceeds ${e} bytes`);f.push(Buffer.from(v.subarray(0,k)))}await r.hooks?.beforeFinalCheck?.();let[p,m,w]=await Promise.all([c.stat({bigint:n}),ut.lstat(t,{bigint:n}),ut.realpath(t)]);if(!m.isFile()||m.isSymbolicLink()||w!==o||!Sn(a,p)||!Sn(a,m))throw new me("changed",`${i} changed while reading`);return await r.verify?.("post-read",{realPath:w,identity:Lr(p)}),{bytes:Buffer.concat(f,h),stat:p,realPath:w}}finally{await c.close()}}var me,Mr=b(()=>{"use strict";Dr();me=class extends Error{reason;constructor(e,r,i){super(r,i),this.name="RaceSafeReadError",this.reason=e}}});import{promises as En}from"fs";import Ye from"path";function Ug(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function ts(t,e){let r=Ye.relative(t,e);return r===""||!Ye.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${Ye.sep}`)}async function td(t,e){let r=Ye.resolve(t),i=await En.lstat(r);if(!i.isDirectory()||i.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return En.realpath(r)}async function rd(t,e,r,i){let n=t;for(let a=0;a<r.length;a++){n=Ye.join(n,r[a]);let o;try{o=await En.lstat(n)}catch(d){if(Ug(d))return{exists:!1,kind:"missing"};throw d}let s=Ye.relative(t,n).replaceAll("\\","/");if(o.isSymbolicLink())throw new Error(`${i.label} crosses a symbolic link or junction at ${s}`);let c=a===r.length-1;if(!c&&!o.isDirectory())throw new Error(`${i.label} ancestor ${s} must be a real directory`);if(c&&(i.expected==="file"&&!o.isFile()||i.expected==="directory"&&!o.isDirectory()||i.expected==="any"&&!o.isFile()&&!o.isDirectory()))throw new Error(`${i.label} must be a real ${i.expected}`);let l=await En.realpath(n);if(!ts(e,l))throw new Error(`${i.label} resolves outside the project root`);if(c)return{exists:!0,kind:o.isFile()?"file":o.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function xe(t,e,r){let i=Nn(e,r.label),n=Ye.resolve(t),a=await td(n,r.label),o=i.split("/"),s=Ye.resolve(n,...o);if(!ts(n,s))throw new Error(`${r.label} must stay inside the project root`);let c=await rd(n,a,o,r);return{projectRoot:n,target:s,relative:i,exists:c.exists,kind:c.kind}}async function Z(t,e,r,i){let n=await xe(t,e,{label:i.label,expected:"file"});if(!n.exists){let o=new Error(`${i.label} does not exist`);throw o.code="ENOENT",o}let a=await td(n.projectRoot,i.label);return Br(n.target,r,{...i,verify:async(o,s)=>{if(!ts(a,s.realPath))throw new Error(`${i.label} resolves outside the project root`);await rd(n.projectRoot,a,n.relative.split("/"),{label:i.label,expected:"file"})}})}var Ce=b(()=>{"use strict";Mr();Je()});import{createHash as Kg}from"crypto";function rs(t,e){return t.exists===e.exists&&t.sha256===e.sha256}function Yg(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function xn(t,e={}){return(await Vr(t,e)).document}async function id(t){try{return(await Z(t,Fr,jr,{label:Fr})).bytes}catch(e){if(Yg(e))return null;throw e}}function nd(t){return t?{exists:!0,sha256:Kg("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function Cn(t){return nd(await id(t))}async function Vr(t,e={}){let r=await id(t);return{document:r?Ot(r.toString("utf8"),e):null,identity:nd(r)}}async function is(t){return(await xn(t))?.config??null}var Fr,Ht=b(()=>{"use strict";Je();Ce();Fr=".comet/config.yaml"});import{promises as as}from"node:fs";async function os(t,e){let r;for(let i=0;i<=ns.length;i+=1)try{return await t()}catch(n){r=n;let a=n.code;if(i===ns.length||!Xg.has(a??""))throw n;await new Promise(o=>setTimeout(o,ns[i]))}throw r}async function Pn(t,e){await os(()=>as.rename(t,e),`rename ${e}`)}async function ss(t){await os(()=>as.unlink(t),`unlink ${t}`)}async function Rn(t,e){await os(()=>as.link(t,e),`link ${e}`)}var Xg,ns,cs=b(()=>{"use strict";Xg=new Set(["EPERM","EACCES","EBUSY","ENOTEMPTY"]),ns=[50,100,200]});import{randomUUID as Qg}from"crypto";import{constants as Zg,promises as G}from"fs";import se from"path";async function ls(t,e){try{return await Rn(t,e),{linked:!0}}catch(r){let i=r.code;if(i!=="ENOTSUP"&&i!=="EOPNOTSUPP")throw r}return await G.copyFile(t,e,Zg.COPYFILE_EXCL),{linked:!1}}function _n(t,e){let r=se.relative(t,e);return r===""||!se.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${se.sep}`)}function An(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function ew(t,e){return B(t,An(e))}function In(t,e){return B(An(t),An(e))}function tw(t,e){return In(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function ad(t){let e=await G.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Contained atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await G.realpath(t),...An(e)}}async function Dt(t){for(let e of t){let r=await G.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!ew(e,r)||await G.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function rw(t,e,r){let[i,n]=await Promise.all([G.lstat(t),G.realpath(t),Dt(r)]);if(!i.isFile()||i.isSymbolicLink()||!In(i,e)||!_n(r[0].realPath,n))throw new Error("Contained atomic write temporary file changed after close");return i}async function iw(t,e){let r=se.resolve(t),i=se.resolve(e);if(!_n(r,i))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let n=[await ad(r)],a=se.relative(r,i).split(se.sep).filter(Boolean),o=r;for(let s of a){await Dt(n),o=se.join(o,s);try{await G.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await ad(o);if(!_n(n[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Dt(n),n}async function nw(t){let e;try{e=await G.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function aw(t,e,r){let i=se.dirname(t),n=await iw(r.containedRoot,i),a=se.join(i,`.${se.basename(t)}.${Qg()}.tmp`),o,s,c;try{await r.beforeTemporaryOpen?.(),o=await G.open(a,"wx"),s=await o.stat();let[l,d]=await Promise.all([G.lstat(a),G.realpath(a)]);if(await Dt(n),!l.isFile()||l.isSymbolicLink()||!In(s,l)||!_n(n[0].realPath,d))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),c=await o.stat(),!In(s,c))throw new Error("Contained atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Contained atomic write temporary file was not written");c=await rw(a,c,n),await r.beforeCommit?.(),await Dt(n);let u=await G.lstat(a);if(!u.isFile()||u.isSymbolicLink()||!c||!tw(u,c))throw new Error("Contained atomic write temporary file changed before commit");r.exclusive?(await ls(a,t),await G.unlink(a)):await Pn(a,t),await nw(i)}catch(l){await o?.close();try{await Dt(n),await G.rm(a,{force:!0})}catch{}throw l}}async function dt(t,e,r){await aw(t,e,r)}var Lt=b(()=>{"use strict";cs();Dr()});var dE,us=b(()=>{"use strict";Lt();Ht();Ce();dE=16*1024});async function ds(t,e){if(!e)return;let r=await Cn(t);if(!rs(r,e))throw new Error("Project config changed before commit; rerun the operation")}var fs=b(()=>{"use strict";Lt();Je();Ht();Ce();us()});var ve=b(()=>{"use strict";Dr()});import{randomUUID as cw}from"crypto";import{promises as J}from"fs";import ce from"path";function Tn(t,e){let r=ce.relative(t,e);return r===""||!ce.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${ce.sep}`)}function lw(t,e){return B({...t,birthtime:t.birthtimeMs},{...e,birthtime:e.birthtimeMs})}function $n(t,e){return B({dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs},{dev:e.dev,ino:e.ino,birthtime:e.birthtimeMs})}function uw(t,e){return $n(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function od(t){let e=await J.lstat(t);if(!e.isDirectory()||e.isSymbolicLink())throw new Error(`Native atomic write parent must be a real directory: ${t}`);return{path:t,realPath:await J.realpath(t),dev:e.dev,ino:e.ino,birthtimeMs:e.birthtimeMs}}async function Bt(t){for(let e of t){let r=await J.lstat(e.path);if(!r.isDirectory()||r.isSymbolicLink()||!lw(e,r)||await J.realpath(e.path)!==e.realPath)throw new Error(`Native atomic write parent changed before commit: ${e.path}`)}}async function dw(t,e,r){let[i,n]=await Promise.all([J.lstat(t),J.realpath(t),r?Bt(r):Promise.resolve()]);if(!i.isFile()||i.isSymbolicLink()||!$n(i,e)||r&&!Tn(r[0].realPath,n))throw new Error("Native atomic write temporary file changed after close");return i}async function fw(t,e){let r=ce.resolve(t),i=ce.resolve(e);if(!Tn(r,i))throw new Error(`Native atomic write parent is outside its managed root: ${e}`);let n=[await od(r)],a=ce.relative(r,i).split(ce.sep).filter(Boolean),o=r;for(let s of a){await Bt(n),o=ce.join(o,s);try{await J.mkdir(o)}catch(l){if(l.code!=="EEXIST")throw l}let c=await od(o);if(!Tn(n[0].realPath,c.realPath))throw new Error(`Native atomic write parent resolves outside its managed root: ${o}`);n.push(c)}return await Bt(n),n}async function pw(t){let e;try{e=await J.open(t,"r"),await e.sync()}catch(r){let i=r.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(i??""))throw r}finally{await e?.close()}}async function hw(t,e,r={}){let i=ce.dirname(t),n=r.containedRoot?await fw(r.containedRoot,i):null;n||await J.mkdir(i,{recursive:!0});let a=ce.join(i,`.${ce.basename(t)}.${cw()}.tmp`),o,s,c;try{if(await r.beforeTemporaryOpen?.(),o=await J.open(a,"wx"),s=await o.stat(),n){let[l,d]=await Promise.all([J.lstat(a),J.realpath(a)]);if(await Bt(n),!l.isFile()||l.isSymbolicLink()||!$n(s,l)||!Tn(n[0].realPath,d))throw new Error("Native atomic write temporary file opened outside its managed parent")}if(typeof e=="string"?await o.writeFile(e,"utf8"):await o.writeFile(e),await o.sync(),c=await o.stat(),!$n(s,c))throw new Error("Native atomic write temporary file changed while writing");if(await o.close(),o=void 0,await r.afterTemporaryClose?.(),!c)throw new Error("Native atomic write temporary file was not written");if(c=await dw(a,c,n),await r.beforeCommit?.(),n){await Bt(n);let l=await J.lstat(a);if(!l.isFile()||l.isSymbolicLink()||!c||!uw(l,c))throw new Error("Native atomic write temporary file changed before commit")}r.exclusive?(await Rn(a,t),await ss(a)):await Pn(a,t),await pw(i)}catch(l){if(await o?.close(),!n)await J.rm(a,{force:!0});else try{await Bt(n),await J.rm(a,{force:!0})}catch{}throw l}}async function Pe(t,e,r={}){await hw(t,e,r)}var j=b(()=>{"use strict";cs();ve()});import{existsSync as _E,promises as Re}from"fs";import T from"path";import mw from"os";async function ps(t){try{return await Re.lstat(t),!0}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function vw(t){try{let e=await Re.readFile(t,"utf8");return/^schema:\s*comet\.project\.v1\s*$/mu.test(e)}catch(e){if(e.code==="ENOENT")return!1;throw e}}function qr(t,e){let r=T.relative(t,e);return r===""||!T.isAbsolute(r)&&r!==".."&&!r.startsWith(`..${T.sep}`)}async function Mt(t){let e=[],r=t;for(;!await ps(r);){let n=T.dirname(r);if(n===r)break;e.push(T.basename(r)),r=n}let i=await Re.realpath(r);return T.resolve(i,...e.reverse())}async function hs(t){try{return(await Re.lstat(t)).isSymbolicLink()}catch(e){if(e.code==="ENOENT")return!1;throw e}}async function ms(t){let e=T.resolve(t);try{(await Re.stat(e)).isDirectory()||(e=T.dirname(e))}catch(n){if(n.code!=="ENOENT")throw n}let r=e,i=T.resolve(mw.homedir());for(;;){if(!(e===i&&r!==i)){let o=T.join(e,...jn.split("/")),s=e===r||await vw(o);if(await ps(o)&&s)return e}if(await ps(T.join(e,".git")))return e;let a=T.dirname(e);if(a===e)return r;e=a}}function Wr(t){return lt(t)}async function gw(t,e){let r=Wr(e),i=T.resolve(t,...r.split("/")),n=await Re.realpath(t),a=await Mt(i);if(!qr(n,a))throw new Error("native.artifact_root resolves outside the project root");return i}async function ft(t,e){let r=Wr(e),i=await gw(t,r),n=T.join(i,"comet");if(await hs(n))throw new Error("The configured Native comet root must not be a symbolic link");let[a,o]=await Promise.all([Mt(i),Mt(n)]);if(!qr(a,o))throw new Error("The configured Native comet root resolves outside its artifact root");let s=T.resolve(t),c=T.join(s,".comet","runtime","native");if(await hs(c))throw new Error("The Native Runtime root must not be a symbolic link");let[l,d]=await Promise.all([Re.realpath(s),Mt(c)]);if(!qr(l,d))throw new Error("The Native Runtime root resolves outside the project root");return{projectRoot:s,configFile:T.join(t,...jn.split("/")),artifactRoot:i,artifactRootRef:r,nativeRoot:n,specsDir:T.join(n,"specs"),changesDir:T.join(n,"changes"),archiveDir:T.join(n,"archive"),runtimeDir:c,changesRuntimeDir:T.join(c,"changes"),locksDir:T.join(c,"locks"),transactionsDir:T.join(c,"transactions")}}async function sd(t){await Promise.all([t.specsDir,t.changesDir,t.archiveDir].map(async e=>{await M(t.nativeRoot,e),await Re.mkdir(e,{recursive:!0})})),await Promise.all([t.changesRuntimeDir,t.locksDir,t.transactionsDir].map(async e=>{await M(t.projectRoot,e),await Re.mkdir(e,{recursive:!0})}))}async function M(t,e){let r=T.resolve(t),i=T.resolve(e);if(!qr(r,i))throw new Error(`Path is outside the Native root: ${e}`);if(await hs(r))throw new Error(`Native root must not be a symbolic link: ${t}`);let[n,a]=await Promise.all([Mt(r),Mt(i)]);if(!qr(n,a))throw new Error(`Path resolves outside the Native root: ${e}`);return i}var jn,$=b(()=>{"use strict";Je();jn=".comet/config.yaml"});import ww from"path";function ld(t="docs",e="en"){return bn(t,e)}async function le(t){let e=(await xn(t))?.config??null;return e?.native?e:null}async function zr(t,e,r={}){let i=await Vr(t,{allowPartialProject:!0}),n=Hr(i.document?.value??{},e),a=ww.join(t,...jn.split("/"));await Pe(a,Or(n,e.native.language==="zh-CN"?"zh-CN":"en"),{containedRoot:t,beforeCommit:async()=>{await r.beforeCommit?.(),await ds(t,i.identity)}})}var cd,ee=b(()=>{"use strict";Je();Ht();fs();j();$();cd=Uu});import{AsyncLocalStorage as Ew}from"node:async_hooks";import{performance as pd}from"node:perf_hooks";function hd(t=0){xw+=1,Cw+=t;let e=Pw.getStore();e&&(e.gitCommands+=1,e.gitDurationMs+=t)}function On(t){let e=pd.now();try{return t()}finally{hd(pd.now()-e)}}var xw,Cw,Pw,Vt=b(()=>{"use strict";xw=0,Cw=0,Pw=new Ew});var YE,Gr=b(()=>{"use strict";YE=["$ProgressPreference = 'SilentlyContinue'","$encoded = $env:COMET_COMMAND_PAYLOAD","Remove-Item Env:COMET_COMMAND_PAYLOAD -ErrorAction SilentlyContinue","$json = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($encoded))","$payload = ConvertFrom-Json $json","$commandArgs = @($payload.arguments)","& $payload.command @commandArgs","if ($null -eq $LASTEXITCODE) { if ($?) { exit 0 } else { exit 1 } }","exit $LASTEXITCODE"].join("; ")});var ex,Hn=b(()=>{"use strict";Vt();Gr();ex=8*1024*1024});function Bw(t,e){return bs[t][e]}function Dn(t,e={}){let r=["outcome","scope","nonGoals","acceptanceExamples"];return e.compact||r.push("constraints","decisions","openQuestions","verificationExpectations"),r.map(i=>`# ${Bw(t,i)}
174
174
  `).join(`
175
- `)}var Wo,vg,gg,wg,Iu,at=b(()=>{"use strict";Wo={en:{outcome:"Outcome",scope:"Scope",nonGoals:"Non-goals",acceptanceExamples:"Acceptance examples",constraints:"Constraints and invariants",decisions:"Decisions",openQuestions:"Open questions",verificationExpectations:"Verification expectations"},"zh-CN":{outcome:"目标",scope:"范围",nonGoals:"非目标",acceptanceExamples:"验收示例",constraints:"约束与不变量",decisions:"决策",openQuestions:"待解决问题",verificationExpectations:"验证预期"}},vg={en:{verification:"Verification",currentResult:"Current result",acceptance:"Acceptance",checks:"Checks",blockers:"Blockers",risks:"Risks and skipped work",previousIterations:"Previous iterations",conclusion:"Conclusion"},"zh-CN":{verification:"验证",currentResult:"当前结果",acceptance:"验收",checks:"检查",blockers:"阻塞项",risks:"风险与跳过的工作",previousIterations:"之前的迭代",conclusion:"结论"}},gg={en:{acceptanceEvidence:"Acceptance evidence",commandsAndResults:"Commands and results",skippedChecks:"Skipped checks",specConsistency:"Spec consistency",knownLimitationsAndRisks:"Known limitations and risks",conclusion:"Conclusion"},"zh-CN":{acceptanceEvidence:"验收证据",commandsAndResults:"命令与结果",skippedChecks:"跳过的检查",specConsistency:"规格一致性",knownLimitationsAndRisks:"已知限制与风险",conclusion:"结论"}},wg=new Map,Iu=new Map;for(let t of Object.keys(Wo)){for(let[e,r]of Object.entries(Wo[t]))wg.set(r.toLocaleLowerCase("en-US"),e);for(let[e,r]of Object.entries(vg[t]))Iu.set(r.toLocaleLowerCase("en-US"),e);for(let[e,r]of Object.entries(gg[t]))Iu.set(r.toLocaleLowerCase("en-US"),e)}});var _r=b(()=>{"use strict"});var Ng,ae=b(()=>{"use strict";_r();de();Ng=1024*1024});var Wk,fn=b(()=>{"use strict";Wk=["$ProgressPreference = 'SilentlyContinue'","$encoded = $env:COMET_COMMAND_PAYLOAD","Remove-Item Env:COMET_COMMAND_PAYLOAD -ErrorAction SilentlyContinue","$json = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($encoded))","$payload = ConvertFrom-Json $json","$commandArgs = @($payload.arguments)","& $payload.command @commandArgs","if ($null -eq $LASTEXITCODE) { if ($?) { exit 0 } else { exit 1 } }","exit $LASTEXITCODE"].join("; ")});var Jk,Tu=b(()=>{"use strict";fn();Jk=8*1024*1024});var pn=b(()=>{"use strict";Tu()});import{AsyncLocalStorage as Eg}from"async_hooks";var iS,nS,aS,Ar=b(()=>{"use strict";Sr();pn();I();de();iS=16*1024,nS=900*1e3,aS=new Eg});var ju,Go=b(()=>{"use strict";ju=Pe(ve(),1)});var Ir=b(()=>{"use strict"});var Du,uS,Pg,dS,hn=b(()=>{"use strict";Ir();Du=["schema","name","language","phase","brief","approval","spec_changes","verification_result","verification_report","archived","created_at","run_id"],uS=new Set(Du),Pg=new Set([...Du,"minimum_runtime_version","revision"]),dS=new Set([...Pg,"approved_contract_hash","implementation_scope","verification_evidence","partial_allowance","verification_protocol"])});import{createHash as Rg}from"crypto";function oe(t){throw new TypeError(`Value is not valid canonical JSON: ${t}`)}function _g(t,e){e.has(t)&&oe("cyclic structures are not supported"),e.add(t);try{let r=Object.keys(t);for(let i=0;i<t.length;i+=1)Object.prototype.hasOwnProperty.call(t,i)||oe("sparse arrays are not supported");return(r.length!==t.length||r.some((i,n)=>i!==String(n)))&&oe("arrays must not have named enumerable properties"),Object.getOwnPropertySymbols(t).length>0&&oe("symbol properties are not supported"),`[${t.map(i=>Jo(i,e)).join(",")}]`}finally{e.delete(t)}}function Ag(t,e){let r=Object.getPrototypeOf(t);r!==Object.prototype&&r!==null&&oe("only plain objects are supported"),e.has(t)&&oe("cyclic structures are not supported"),Object.getOwnPropertySymbols(t).length>0&&oe("symbol properties are not supported"),e.add(t);try{let i=Object.getOwnPropertyDescriptors(t);return`{${Object.keys(t).sort().map(o=>{let s=i[o];return(!s||!("value"in s))&&oe("accessor properties are not supported"),`${JSON.stringify(o)}:${Jo(s.value,e)}`}).join(",")}}`}finally{e.delete(t)}}function Jo(t,e){if(t===null)return"null";switch(typeof t){case"boolean":return t?"true":"false";case"string":return JSON.stringify(t);case"number":return Number.isFinite(t)||oe("numbers must be finite"),JSON.stringify(Object.is(t,-0)?0:t);case"object":return Array.isArray(t)?_g(t,e):Ag(t,e);case"bigint":case"function":case"symbol":case"undefined":return oe(`${typeof t} values are not supported`)}return oe("unsupported value type")}function Uo(t){return Jo(t,new Set)}function B(t,e){if(t.length===0)throw new TypeError("Canonical hash tag must be non-empty");if(/[\r\n]/u.test(t))throw new TypeError("Canonical hash tag must not contain a line break");return Rg("sha256").update(`${t}
176
- ${Uo(e)}`).digest("hex")}var F=b(()=>{"use strict"});var gS,Lu,mn=b(()=>{"use strict";at();F();gS=Object.freeze({maxItems:16,maxTextBytes:512,maxContextItems:4,maxContextItemBytes:256,maxFailedCheckIds:16,maxSerializedBytes:32*1024}),Lu=Object.freeze({maxCriteria:1024})});var Ko=b(()=>{"use strict";mn()});var vn=b(()=>{"use strict"});var Bu,We=b(()=>{"use strict";Bu=Pe(ve(),1);T();vn()});var ot=b(()=>{"use strict"});var qu=b(()=>{"use strict";hn();Ko();We();ot();vn();Ir()});var Wu,FS,MS,Yo=b(()=>{"use strict";ae();Go();qu();Wu="[a-z][a-z0-9]*(?:-[a-z0-9]+)*",FS=new RegExp(`^portable-archive-(${Wu})\\.json$`,"u"),MS=new RegExp(`^portable-migration-(${Wu})\\.json$`,"u")});var fe=b(()=>{"use strict";T();de()});import{TextDecoder as Bg}from"util";var ZS,wn=b(()=>{"use strict";T();I();fe();ZS=new Bg("utf-8",{fatal:!0})});var V=b(()=>{"use strict";Y();Ar();Yo();wn()});import{createHash as Mg}from"crypto";function Z(t){return Mg("sha256").update(t).digest("hex")}var pe=b(()=>{"use strict"});var SE,EE,xE,CE,PE,RE,$r=b(()=>{"use strict";T();Y();pe();de();I();fe();_r();SE={maxFiles:1e4,maxFileBytes:1024*1024*1024,maxTotalBytes:1024*1024*1024,maxManifestBytes:1024*1024*1024},EE=64*1024,xE=64*1024,CE={maxRecords:2e4,maxBytes:8*1024*1024,maxRecordBytes:64*1024},PE={maxNodes:2e4,maxBytes:8*1024*1024,maxPathBytes:64*1024},RE=(1n<<256n)-1n});var rd,At=b(()=>{"use strict";F();$r();rd=1024*1024});var st=b(()=>{"use strict"});var Sn=b(()=>{"use strict";F();st();_r();At()});var nd,fw,pw,hw,gP,mw,wP,Zo=b(()=>{"use strict";F();nd="scoped-text-safety",fw=1,pw=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128}),hw="comet.native.checker-policy.v1",gP=B(hw,{policy:nd,version:fw,limits:pw,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"}),mw=["contract-before-does-not-match-scope","implementation-before-does-not-match-scope","contract-changed-during-check","implementation-changed-during-check","contract-after-does-not-match-scope","implementation-after-does-not-match-scope"],wP=new Set(mw)});var En=b(()=>{"use strict";F();Zo();st()});var ww,OP,It=b(()=>{"use strict";T();I();de();At();Sn();En();ww=rd,OP=3*ww});var es=b(()=>{"use strict"});var ud=b(()=>{"use strict"});var aI,xe=b(()=>{"use strict";ud();aI=8*1024*1024});var Zw,Cn=b(()=>{"use strict";Zw=Pe(ve(),1);ae()});var Pn,ts=b(()=>{"use strict";Pn=class extends Error{issues;constructor(e){let r=[e.missingFields.length?`missing: ${e.missingFields.join(", ")}`:"",e.unknownFields.length?`unknown: ${e.unknownFields.join(", ")}`:""].filter(Boolean).join("; ");super(`${e.context} fields are invalid at ${e.path||"/"} (${r})`),this.name="NativeInputValidationError",this.issues=[e]}}});var Lr=b(()=>{"use strict"});var Rn=b(()=>{"use strict";ts();Lr()});var $t=b(()=>{"use strict";F();Rn()});var Je=b(()=>{"use strict";T();F();Cn();I();$t()});var _n=b(()=>{"use strict";fn();es();st()});var fd=b(()=>{"use strict";xe();_n();F()});var rs=b(()=>{"use strict";xe();T()});Y();xt();qe();import{promises as lg}from"node:fs";import ug from"node:path";var Rt=".gitignore",Do=4*1024*1024,Bo="# >>> Comet managed project state >>>",Eu="# <<< Comet managed project state <<<";function dg(t){return t.includes(`\r
175
+ `)}var bs,Hw,Dw,Lw,Ed,ht=b(()=>{"use strict";bs={en:{outcome:"Outcome",scope:"Scope",nonGoals:"Non-goals",acceptanceExamples:"Acceptance examples",constraints:"Constraints and invariants",decisions:"Decisions",openQuestions:"Open questions",verificationExpectations:"Verification expectations"},"zh-CN":{outcome:"目标",scope:"范围",nonGoals:"非目标",acceptanceExamples:"验收示例",constraints:"约束与不变量",decisions:"决策",openQuestions:"待解决问题",verificationExpectations:"验证预期"}},Hw={en:{verification:"Verification",currentResult:"Current result",acceptance:"Acceptance",checks:"Checks",blockers:"Blockers",risks:"Risks and skipped work",previousIterations:"Previous iterations",conclusion:"Conclusion"},"zh-CN":{verification:"验证",currentResult:"当前结果",acceptance:"验收",checks:"检查",blockers:"阻塞项",risks:"风险与跳过的工作",previousIterations:"之前的迭代",conclusion:"结论"}},Dw={en:{acceptanceEvidence:"Acceptance evidence",commandsAndResults:"Commands and results",skippedChecks:"Skipped checks",specConsistency:"Spec consistency",knownLimitationsAndRisks:"Known limitations and risks",conclusion:"Conclusion"},"zh-CN":{acceptanceEvidence:"验收证据",commandsAndResults:"命令与结果",skippedChecks:"跳过的检查",specConsistency:"规格一致性",knownLimitationsAndRisks:"已知限制与风险",conclusion:"结论"}},Lw=new Map,Ed=new Map;for(let t of Object.keys(bs)){for(let[e,r]of Object.entries(bs[t]))Lw.set(r.toLocaleLowerCase("en-US"),e);for(let[e,r]of Object.entries(Hw[t]))Ed.set(r.toLocaleLowerCase("en-US"),e);for(let[e,r]of Object.entries(Dw[t]))Ed.set(r.toLocaleLowerCase("en-US"),e)}});var Ur=b(()=>{"use strict"});var Mw,ue=b(()=>{"use strict";Ur();ve();Mw=1024*1024});import{createHash as Fw,randomUUID as Ax}from"node:crypto";var Vw,Tx,xd=b(()=>{"use strict";Hn();Vw=`using System;
176
+ using System.Runtime.InteropServices;
177
+ class CometProcessIdentity {
178
+ [DllImport("kernel32.dll")] static extern IntPtr OpenProcess(uint access, bool inherit, int pid);
179
+ [DllImport("kernel32.dll")] static extern bool GetProcessTimes(IntPtr process, out long creation, out long exit, out long kernel, out long user);
180
+ [DllImport("kernel32.dll")] static extern bool CloseHandle(IntPtr handle);
181
+ static int Main(string[] args) {
182
+ int pid; if(args.Length != 1 || !int.TryParse(args[0], out pid) || pid <= 0) return 1;
183
+ IntPtr handle=OpenProcess(0x1000, false, pid); if(handle == IntPtr.Zero) return 1;
184
+ try { long creation, exit, kernel, user; if(!GetProcessTimes(handle,out creation,out exit,out kernel,out user)) return 1;
185
+ Console.WriteLine(DateTime.FromFileTimeUtc(creation).Ticks.ToString(System.Globalization.CultureInfo.InvariantCulture)); return 0;
186
+ } finally { CloseHandle(handle); }
187
+ }
188
+ }`,Tx=Fw("sha256").update(Vw).digest("hex")});var Ln=b(()=>{"use strict";Hn();xd()});import{AsyncLocalStorage as Ww}from"async_hooks";var qx,Wx,zx,Kr=b(()=>{"use strict";Mr();Ln();$();ve();qx=16*1024,Wx=900*1e3,zx=new Ww});var Pd,Ss=b(()=>{"use strict";Pd=Oe(Se(),1)});var Yr=b(()=>{"use strict"});var Ad,Yx,Jw,Xx,Bn=b(()=>{"use strict";Yr();Ad=["schema","name","language","phase","brief","approval","spec_changes","verification_result","verification_report","archived","created_at","run_id"],Yx=new Set(Ad),Jw=new Set([...Ad,"minimum_runtime_version","revision"]),Xx=new Set([...Jw,"approved_contract_hash","implementation_scope","verification_evidence","partial_allowance","verification_protocol"])});import{createHash as Uw}from"crypto";function de(t){throw new TypeError(`Value is not valid canonical JSON: ${t}`)}function Kw(t,e){e.has(t)&&de("cyclic structures are not supported"),e.add(t);try{let r=Object.keys(t);for(let i=0;i<t.length;i+=1)Object.prototype.hasOwnProperty.call(t,i)||de("sparse arrays are not supported");return(r.length!==t.length||r.some((i,n)=>i!==String(n)))&&de("arrays must not have named enumerable properties"),Object.getOwnPropertySymbols(t).length>0&&de("symbol properties are not supported"),`[${t.map(i=>Es(i,e)).join(",")}]`}finally{e.delete(t)}}function Yw(t,e){let r=Object.getPrototypeOf(t);r!==Object.prototype&&r!==null&&de("only plain objects are supported"),e.has(t)&&de("cyclic structures are not supported"),Object.getOwnPropertySymbols(t).length>0&&de("symbol properties are not supported"),e.add(t);try{let i=Object.getOwnPropertyDescriptors(t);return`{${Object.keys(t).sort().map(o=>{let s=i[o];return(!s||!("value"in s))&&de("accessor properties are not supported"),`${JSON.stringify(o)}:${Es(s.value,e)}`}).join(",")}}`}finally{e.delete(t)}}function Es(t,e){if(t===null)return"null";switch(typeof t){case"boolean":return t?"true":"false";case"string":return JSON.stringify(t);case"number":return Number.isFinite(t)||de("numbers must be finite"),JSON.stringify(Object.is(t,-0)?0:t);case"object":return Array.isArray(t)?Kw(t,e):Yw(t,e);case"bigint":case"function":case"symbol":case"undefined":return de(`${typeof t} values are not supported`)}return de("unsupported value type")}function xs(t){return Es(t,new Set)}function F(t,e){if(t.length===0)throw new TypeError("Canonical hash tag must be non-empty");if(/[\r\n]/u.test(t))throw new TypeError("Canonical hash tag must not contain a line break");return Uw("sha256").update(`${t}
189
+ ${xs(e)}`).digest("hex")}var V=b(()=>{"use strict"});var iC,Id,Mn=b(()=>{"use strict";ht();V();iC=Object.freeze({maxItems:16,maxTextBytes:512,maxContextItems:4,maxContextItemBytes:256,maxFailedCheckIds:16,maxSerializedBytes:32*1024}),Id=Object.freeze({maxCriteria:1024})});var Cs=b(()=>{"use strict";Mn()});var Fn,Vn=b(()=>{"use strict";Fn=class extends Error{issues;constructor(e){let r=[e.missingFields.length?`missing: ${e.missingFields.join(", ")}`:"",e.unknownFields.length?`unknown: ${e.unknownFields.join(", ")}`:""].filter(Boolean).join("; ");super(`${e.context} fields are invalid at ${e.path||"/"} (${r})`),this.name="NativeInputValidationError",this.issues=[e]}}});var qn,Wn=b(()=>{"use strict";Vn();qn=class extends Error{constructor(r,i){super(`Native Builder handoff is incomplete${r.length?`; missing: ${r.join(", ")}`:""}${i.length?`; not ready: ${i.join(", ")}`:""}. Complete acceptance_review for every requirement and its evidence before Verify`);this.missingIds=r;this.incompleteIds=i}missingIds;incompleteIds}});var zn=b(()=>{"use strict"});var Td,Xe=b(()=>{"use strict";Wn();Td=Oe(Se(),1);j();zn()});var mt=b(()=>{"use strict"});var Hd=b(()=>{"use strict";Bn();Cs();Xe();mt();zn();Yr()});var Dd,AC,IC,Ps=b(()=>{"use strict";ue();Ss();Hd();Dd="[a-z][a-z0-9]*(?:-[a-z0-9]+)*",AC=new RegExp(`^portable-archive-(${Dd})\\.json$`,"u"),IC=new RegExp(`^portable-migration-(${Dd})\\.json$`,"u")});var ge=b(()=>{"use strict";j();ve()});import{TextDecoder as cy}from"util";var qC,Jn=b(()=>{"use strict";j();$();ge();qC=new cy("utf-8",{fatal:!0})});var W=b(()=>{"use strict";ee();Kr();Ps();Jn()});import{createHash as uy}from"crypto";function ie(t){return uy("sha256").update(t).digest("hex")}var we=b(()=>{"use strict"});var hP,mP,vP,gP,wP,yP,Qr=b(()=>{"use strict";Vt();j();ee();we();ve();$();ge();Ur();hP={maxFiles:1e4,maxFileBytes:1024*1024*1024,maxTotalBytes:1024*1024*1024,maxManifestBytes:1024*1024*1024},mP=64*1024,vP=64*1024,gP={maxRecords:2e4,maxBytes:8*1024*1024,maxRecordBytes:64*1024},wP={maxNodes:2e4,maxBytes:8*1024*1024,maxPathBytes:64*1024},yP=(1n<<256n)-1n});var Kd,Gt=b(()=>{"use strict";V();Qr();Kd=1024*1024});var vt=b(()=>{"use strict"});var Qn=b(()=>{"use strict";V();vt();Ur();Gt()});var Xd,Dy,Ly,By,lA,My,uA,As=b(()=>{"use strict";V();Xd="scoped-text-safety",Dy=1,Ly=Object.freeze({maxFiles:256,maxFileBytes:2*1024*1024,maxTotalBytes:8*1024*1024,maxIssues:128}),By="comet.native.checker-policy.v1",lA=F(By,{policy:Xd,version:Dy,limits:Ly,checks:["conflict-marker","space-before-tab","trailing-whitespace"],binaryHandling:"skip-and-count"}),My=["contract-before-does-not-match-scope","implementation-before-does-not-match-scope","contract-changed-during-check","implementation-changed-during-check","contract-after-does-not-match-scope","implementation-after-does-not-match-scope"],uA=new Set(My)});var Zn=b(()=>{"use strict";V();As();vt()});var qy,PA,Jt=b(()=>{"use strict";j();$();ve();Gt();Qn();Zn();qy=Kd,PA=3*qy});var Is=b(()=>{"use strict"});var Y$,ye=b(()=>{"use strict";Vt();Y$=8*1024*1024});var bb,oa=b(()=>{"use strict";bb=Oe(Se(),1);ue()});var ci=b(()=>{"use strict"});var sa=b(()=>{"use strict";Vn();ci()});var Xt=b(()=>{"use strict";V();sa()});var tt=b(()=>{"use strict";j();V();oa();$();Xt()});var ca=b(()=>{"use strict";Gr();Is();vt()});var kf=b(()=>{"use strict";ye();ca();V()});var qs=b(()=>{"use strict";ye();j()});ee();Lt();Ce();import{promises as yw}from"node:fs";import Nw from"node:path";var Ft=".gitignore",vs=4*1024*1024,ws="# >>> Comet managed project state >>>",dd="# <<< Comet managed project state <<<";function bw(t){return t.includes(`\r
177
190
  `)?`\r
178
191
  `:`
179
- `}function fg(t){return t.match(/[^\r\n]*(?:\r\n|\n|\r|$)/gu)?.filter(Boolean)??[]}function pg(t){return t.replace(/(?:\r\n|\n|\r)$/u,"")}function xu(t){let e=[],r=!1;for(let i of fg(t)){let n=pg(i);if(n===Bo){if(r)throw new Error("Comet .gitignore managed block is malformed");r=!0;continue}if(n===Eu){if(!r)throw new Error("Comet .gitignore managed block is malformed");r=!1;continue}r||e.push(i)}if(r)throw new Error("Comet .gitignore managed block is incomplete");return e.join("")}function Su(t){let e=xu(t).split(/\r?\n/u).map(r=>r.trim());return e.includes(".comet/runtime/")&&e.includes(".comet/current-change.json")}function Lo(t){let e=dg(t),r=xu(t);return r.length>0&&!/(?:\r\n|\n|\r)$/u.test(r)&&(r+=e),r+[Bo,"!/.comet/","/.comet/*","!/.comet/config.yaml",Eu,""].join(e)}async function Fo(t){let e=ug.resolve(t),r=await we(e,Rt,{label:"project .gitignore",expected:"file"}),i="",n=new Uint8Array;if(r.exists&&(n=(await Q(e,Rt,Do,{label:"project .gitignore"})).bytes,i=Buffer.from(n).toString("utf8")),r.exists&&!i.includes(Bo)&&Su(i))return;let a=Lo(i);if(a!==i){try{await it(r.target,a,{containedRoot:e,exclusive:!r.exists,beforeCommit:r.exists?async()=>{if(!(await Q(e,Rt,Do,{label:"project .gitignore"})).bytes.equals(n))throw new Error("Project .gitignore changed before commit; rerun initialization")}:async()=>{if((await we(e,Rt,{label:"project .gitignore",expected:"file"})).exists)throw new Error("Project .gitignore was created before commit; rerun initialization")}})}catch(o){let s=o instanceof Error&&o.message==="Project .gitignore was created before commit; rerun initialization";if(r.exists||o.code!=="EEXIST"&&!s)throw o;let c=await Q(e,Rt,Do,{label:"project .gitignore"}),l=Buffer.from(c.bytes).toString("utf8");if(Lo(l)!==l&&!Su(l))throw o}await we(e,Rt,{label:"project .gitignore",expected:"file"}),await lg.access(r.target)}}I();Sr();import zr from"path";import{realpathSync as Gy}from"fs";import{execFileSync as hg}from"child_process";import mg from"fs";import Vo from"path";function Mo(t,e){return hg("git",["-C",t,...e],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:1e4,windowsHide:!0}).trim()}function qo(t,e){return Cu(t)===Cu(e)}function Cu(t){let e=Vo.resolve(t);try{let r=mg.realpathSync.native(e);return process.platform==="win32"?r.toLowerCase():r}catch{return process.platform==="win32"?e.toLowerCase():e}}function be(t){try{let e=Vo.resolve(Mo(t,["rev-parse","--show-toplevel"])),i=Mo(t,["worktree","list","--porcelain","-z"]).split("\0").find(o=>o.startsWith("worktree ")),n=i?Vo.resolve(i.slice(9)):e,a=null;try{a=Mo(t,["symbolic-ref","--quiet","--short","HEAD"])||null}catch{}return{isGitWorktree:!0,isSecondaryWorktree:!qo(e,n),currentWorktreeRoot:e,primaryWorktreeRoot:n,currentBranch:a}}catch{return{isGitWorktree:!1,isSecondaryWorktree:!1,currentWorktreeRoot:null,primaryWorktreeRoot:null,currentBranch:null}}}function Pu(t,e){let r=d=>d!==null&&typeof d=="object"&&!Array.isArray(d)?d:{},i=r(t),n=r(i.entry),a=r(i.state??n.state??i),o=r(i.preparation??i.workspace??n.workspace),s=r(i.continuation??n.continuation),c=typeof o.projectRoot=="string"&&o.projectRoot!=="."?o.projectRoot:e??null,l=a.stateVersion??a.state_version;return{phase:typeof a.phase=="string"?a.phase:null,status:typeof a.status=="string"?a.status:null,stateVersion:typeof l=="number"?l:null,workspace:{cwd:c},continuation:Object.keys(s).length?{...s,cwd:c}:null}}var ke={next:"NEXT:",relay:"RELAY TO USER:",detail:"DETAIL:",details:"--- machine projection (run with --json to consume it) ---"};function Ru(t){return t?t.command?`${ke.next} ${t.command}`:t.ask_user?`${ke.next} ${t.ask_user}`:null:null}function _u(t,e){let r=[t.summary],i=Ru(t.next);return i&&r.push(i),t.user_message&&r.push("",ke.relay,t.user_message),e!==void 0&&r.push("",ke.details,JSON.stringify(e,null,2)),`${r.join(`
192
+ `}function kw(t){return t.match(/[^\r\n]*(?:\r\n|\n|\r|$)/gu)?.filter(Boolean)??[]}function Sw(t){return t.replace(/(?:\r\n|\n|\r)$/u,"")}function fd(t){let e=[],r=!1;for(let i of kw(t)){let n=Sw(i);if(n===ws){if(r)throw new Error("Comet .gitignore managed block is malformed");r=!0;continue}if(n===dd){if(!r)throw new Error("Comet .gitignore managed block is malformed");r=!1;continue}r||e.push(i)}if(r)throw new Error("Comet .gitignore managed block is incomplete");return e.join("")}function ud(t){let e=fd(t).split(/\r?\n/u).map(r=>r.trim());return e.includes(".comet/runtime/")&&e.includes(".comet/current-change.json")}function gs(t){let e=bw(t),r=fd(t);return r.length>0&&!/(?:\r\n|\n|\r)$/u.test(r)&&(r+=e),r+[ws,"!/.comet/","/.comet/*","!/.comet/config.yaml",dd,""].join(e)}async function ys(t){let e=Nw.resolve(t),r=await xe(e,Ft,{label:"project .gitignore",expected:"file"}),i="",n=new Uint8Array;if(r.exists&&(n=(await Z(e,Ft,vs,{label:"project .gitignore"})).bytes,i=Buffer.from(n).toString("utf8")),r.exists&&!i.includes(ws)&&ud(i))return;let a=gs(i);if(a!==i){try{await dt(r.target,a,{containedRoot:e,exclusive:!r.exists,beforeCommit:r.exists?async()=>{if(!(await Z(e,Ft,vs,{label:"project .gitignore"})).bytes.equals(n))throw new Error("Project .gitignore changed before commit; rerun initialization")}:async()=>{if((await xe(e,Ft,{label:"project .gitignore",expected:"file"})).exists)throw new Error("Project .gitignore was created before commit; rerun initialization")}})}catch(o){let s=o instanceof Error&&o.message==="Project .gitignore was created before commit; rerun initialization";if(r.exists||o.code!=="EEXIST"&&!s)throw o;let c=await Z(e,Ft,vs,{label:"project .gitignore"}),l=Buffer.from(c.bytes).toString("utf8");if(gs(l)!==l&&!ud(l))throw o}await xe(e,Ft,{label:"project .gitignore",expected:"file"}),await yw.access(r.target)}}$();Mr();import mi from"path";import{realpathSync as hk}from"fs";Vt();Hn();import{execFileSync as Aw}from"child_process";import Iw from"fs";import pt from"path";import{AsyncLocalStorage as wd}from"node:async_hooks";Gr();var qt=new wd,Tw=new wd;function yd(t){return qt.getStore()?t():qt.run(new Map,t)}function $w(t){let e=qt.getStore();for(let r of t)e?.set(Wt(r.root),t);return t}function Ns(t,e){return On(()=>Aw("git",["-C",t,...e],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:1e4,windowsHide:!0}).trim())}function Jr(t,e){return Wt(t)===Wt(e)}function Wt(t){let e=pt.resolve(t);try{let r=Iw.realpathSync.native(e);return process.platform==="win32"?r.toLowerCase():r}catch{return process.platform==="win32"?e.toLowerCase():e}}function _e(t){try{let e=Tw.getStore()?.get(Wt(t)),r=qt.getStore()?.get(e??Wt(t));if(r){let c=vd(e??t,r);if(c)return c;if(r.length===0)return{isGitWorktree:!1,isSecondaryWorktree:!1,currentWorktreeRoot:null,primaryWorktreeRoot:null,currentBranch:null}}let i=pt.resolve(Ns(t,["rev-parse","--show-toplevel"])),n=qt.getStore()?.get(Wt(i))??jw(t),a=vd(i,n);if(qt.getStore()&&a)return a;let o=n[0]?.root??i,s=null;try{s=Ns(t,["symbolic-ref","--quiet","--short","HEAD"])||null}catch{}return{isGitWorktree:!0,isSecondaryWorktree:!Jr(i,o),currentWorktreeRoot:i,primaryWorktreeRoot:o,currentBranch:s}}catch{return{isGitWorktree:!1,isSecondaryWorktree:!1,currentWorktreeRoot:null,primaryWorktreeRoot:null,currentBranch:null}}}function jw(t){let e=Ow(Ns(t,["worktree","list","--porcelain","-z"]));return $w(e),e.map(r=>({...r}))}function Ow(t){let e=t.split("\0"),r=[],i=null;for(let n of e)n.startsWith("worktree ")?(i&&r.push(i),i={root:pt.resolve(n.slice(9)),branch:null,detached:!1}):i&&n.startsWith("branch refs/heads/")?i.branch=n.slice(18):i&&n==="detached"&&(i.detached=!0);return i&&r.push(i),r}function vd(t,e){let r=e.find(a=>Jr(pt.resolve(a.root),pt.resolve(t)));if(!r)return null;let i=pt.resolve(e[0].root),n=pt.resolve(r.root);return{isGitWorktree:!0,isSecondaryWorktree:!Jr(i,n),currentWorktreeRoot:n,primaryWorktreeRoot:i,currentBranch:r.branch}}function Nd(t,e){let r=d=>d!==null&&typeof d=="object"&&!Array.isArray(d)?d:{},i=r(t),n=r(i.entry),a=r(i.state??n.state??i),o=r(i.preparation??i.workspace??n.workspace),s=r(i.continuation??n.continuation),c=typeof o.projectRoot=="string"&&o.projectRoot!=="."?o.projectRoot:e??null,l=a.stateVersion??a.state_version;return{phase:typeof a.phase=="string"?a.phase:null,status:typeof a.status=="string"?a.status:null,stateVersion:typeof l=="number"?l:null,workspace:{cwd:c},continuation:Object.keys(s).length?{...s,cwd:c}:null}}var Ae={next:"NEXT:",relay:"RELAY TO USER:",detail:"DETAIL:",details:"--- machine projection (run with --json to consume it) ---"};function bd(t){return t?t.command?`${Ae.next} ${t.command}`:t.ask_user?`${Ae.next} ${t.ask_user}`:null:null}function kd(t,e){let r=[t.summary],i=bd(t.next);return i&&r.push(i),t.user_message&&r.push("",Ae.relay,t.user_message),e!==void 0&&r.push("",Ae.details,JSON.stringify(e,null,2)),`${r.join(`
180
193
  `)}
181
- `}function Au(t,e,r){let i=[t.summary],n=Ru(t.next);return n&&i.push(n),t.user_message&&i.push("",ke.relay,t.user_message),i.push("",`${ke.detail} ${e}`),r!==void 0&&i.push("",ke.details,JSON.stringify(r,null,2)),i.join(`
182
- `)}at();var td=Pe(ve(),1);ae();T();at();Y();V();I();fe();$r();V();I();xt();Be();var Ug=Pe(ve(),1);xt();Be();qe();qe();St();$o();var Kg=null;function Yg(t,e){let r=t;for(let i of e)r+="\0"+(typeof i=="string"?i:JSON.stringify(i));return r}function Ku(t,e){return(...r)=>{let i=Kg;if(i===null)return e(...r);let n=Yg(`async:${t}`,r),a=i.entries.get(n);if(a)return a.value;let o=e(...r).catch(s=>{throw i.entries.delete(n),s});return i.entries.set(n,{value:o}),o}}St();var zE=Ku("hookWritePolicy",async t=>(await Eo(t))?.hook??{allow_paths:[]});Sr();var Xg=16*1024;Io();Nr();var qx=Number.MAX_SAFE_INTEGER;T();de();var rC={runStateBytes:Number.MAX_SAFE_INTEGER,trajectoryBytes:Number.MAX_SAFE_INTEGER,trajectoryEvents:4096,trajectoryEventBytes:Number.MAX_SAFE_INTEGER,checkpointBytes:Number.MAX_SAFE_INTEGER,pendingActionBytes:Number.MAX_SAFE_INTEGER,contextBytes:Number.MAX_SAFE_INTEGER,artifactsBytes:Number.MAX_SAFE_INTEGER};T();ae();V();I();var vC=16*1024,gC=process.platform;Ir();hn();hn();var Nn=class extends Error{constructor(r,i,n){super(`Native change ${r} revision conflict: expected ${i}, actual ${n}`);this.change=r;this.expectedRevision=i;this.actualRevision=n;this.name="NativeChangeRevisionConflictError"}change;expectedRevision;actualRevision;code="native-change-revision-conflict"},jr=class extends Error{constructor(r,i){super(`Native working directory already contains active change${i.length===1?"":"s"} ${i.join(", ")}; create the new change in a separate worktree`);this.requestedIsolation=r;this.activeChanges=i;this.name="NativeWorkspaceIsolationRequiredError"}requestedIsolation;activeChanges;code="native-workspace-isolation-required"},bn=class extends Error{constructor(r,i,n,a,o,s=null,c=null){super(`Native change ${r} baseline is incomplete (${i} omitted entr${i===1?"y":"ies"}). Adjust native.snapshot scope or resource budgets in .comet/config.yaml, then retry.`);this.change=r;this.omittedCount=i;this.omittedByReason=n;this.samplePaths=a;this.sampleTruncated=o;this.effectiveLimits=s;this.policyHash=c;this.name="NativeBaselineIncompleteError"}change;omittedCount;omittedByReason;samplePaths;sampleTruncated;effectiveLimits;policyHash;code="native-baseline-incomplete"},zC=dn("en");ae();pe();I();var uw=["outcome","scope","nonGoals","acceptanceExamples"],eP=[...uw,"constraints","decisions","openQuestions","verificationExpectations"];F();ae();F();var dw=Object.freeze({maxChanges:32,maxSpecsPerChange:64,maxArtifactsPerChange:128,maxTotalSpecs:512,maxTotalArtifacts:1024,maxSignalsPerRelationship:8,maxRelationships:256,maxSerializedBytes:64*1024,maxNameBytes:128,maxCapabilityBytes:128,maxArtifactPathBytes:512});It();fe();Y();I();T();pe();Ar();V();I();fe();st();F();F();Sn();At();pe();var ad={root:"/comet/native-runtime",packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-native-runtime",version:"3",description:"Comet-owned state runtime for the Native workflow."},goal:{statement:"Advance a Native change only after its current guard passes.",inputs:[],outputs:[],success:["The Native change and Run state agree on the next phase."]},orchestration:{mode:"deterministic",entry:"shape",steps:[{id:"shape",action:{type:"checkpoint"},next:"build"},{id:"build",action:{type:"checkpoint"},next:"verify"},{id:"verify",action:{type:"checkpoint"},next:"archive"},{id:"archive",action:{type:"checkpoint"}}]},skills:[],agents:[],tools:[]},guardrails:{allowedSkills:[],allowedAgents:[],allowedTools:[],maxIterations:Number.MAX_SAFE_INTEGER,maxRetriesPerAction:2,confirmationRequiredFor:[]},evals:[]},Nw=Z("comet-native-runtime:v3:scope-reopen"),cR=[{skillVersion:"3",skillHash:Z("comet-native-runtime:v3:semantic-repair-budget")},{skillVersion:"2",skillHash:Z("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:Z("comet-native-runtime:v1")}];pe();pe();Ir();var sd=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],VR=new Set(sd),Pw=new Set([...sd,"minimum_runtime_version","revision"]),qR=new Set([...Pw,"operation"]),Rw=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),WR=new Set([...Rw,"implementationScopeHash","repairScopeHash","repairStagnation","returnToBuild"]);mn();ae();ae();mn();F();var KR={maxAcceptanceCriteria:Lu.maxCriteria};It();$r();At();Sn();import{execFile as Fw}from"node:child_process";fn();es();import{promisify as Mw}from"node:util";T();pe();I();fe();_r();st();V();T();Zo();I();de();It();V();st();var Dr=class extends Error{recovery;constructor(e,r){super(e),this.name="NativeReceiptScopeStaleError",this.recovery=r}};$r();En();At();var Q_=64*1024;var Z_=3600*1e3;var eA=Mw(Fw);En();var xn=class extends Error{details;constructor(e){let r=e.length===0?"Native verification receipt binding is invalid":`Native verification receipt binding is invalid (${e.length} receipt(s)): ${e.map(i=>`${i.ref}${i.acceptanceId?`[${i.acceptanceId}]`:""} -> ${i.mismatches.join("; ")}`).join(" | ")}`;super(r),this.name="NativeVerificationReceiptBindingError",this.details=e}};pe();fe();T();de();I();fe();wn();T();at();It();var eI=Object.freeze({maxScopeChanges:128,maxAcceptanceEntries:64,maxUnresolvedReasons:32,maxReceipts:32});pe();Ar();V();I();fe();Y();V();xe();T();vn();We();I();T();ae();F();var yy=Pe(ve(),1);xe();ae();F();Y();I();We();Cn();Cn();$t();Je();xe();pn();T();F();_n();V();I();fd();$t();Je();rs();xe();Y();rs();Ar();I();var An=class extends Error{constructor(r,i,n){super(r,n);this.preparation=i;this.name="NativeWorkspacePreparationError"}preparation};xe();Y();V();$t();Je();We();ot();Lr();Rn();V();Ko();Go();We();ot();T();at();Lr();I();at();It();Y();var gd=Pe(ve(),1);qe();var M$=new Set("a an and are as at be by for from in is it of on or that the this to with you your".split(" "));var J$=256*1024;We();ot();Je();var Py=dn("en");Y();V();$t();Je();We();ot();xe();pn();F();_n();V();ot();I();var RO=1024*1024*1024;V();Rn();Lr();Je();V();Je();V();Yo();var bH=16*1024;wn();var $n=class extends Error{constructor(r,i,n,a){super(`Canonical spec conflict for ${r}: expected ${i??"(missing)"}, actual ${n??"(missing)"}`);this.capability=r;this.expectedHash=i;this.actualHash=n;this.canonicalPath=a;this.name="NativeSpecConflictError"}capability;expectedHash;actualHash;canonicalPath;code="native-spec-conflict"},jn=class extends Error{constructor(r,i=r.ready?"Native Archive preflight no longer matches the expected hash":`Native Archive preflight is blocked: ${r.findingCodes.join(", ")}`){super(i);this.preflight=r;this.name="NativeArchivePreflightError"}preflight;code="native-archive-preflight"};I();Y();function C(t,e,r){return t==="zh-CN"?r:e}var as={shape:{en:"Shape (agreeing on requirements)",zh:"Shape(需求共识)"},build:{en:"Build",zh:"Build(实现)"},verify:{en:"Verify",zh:"Verify(验证)"},archive:{en:"Archive",zh:"Archive(归档)"}};function kd(t,e){return typeof t=="string"&&as[t]?C(e,as[t].en,as[t].zh):typeof t=="string"?t:""}function os(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&typeof e.passed=="number"&&typeof e.failed=="number"&&typeof e.blocked=="number"&&typeof e.pending=="number"}function Iy(t){let e={total:t.length,passed:0,failed:0,blocked:0,pending:0};for(let r of t){if(!r||typeof r!="object")return null;let i=r.result;if(i!=="passed"&&i!=="failed"&&i!=="blocked"&&i!=="pending")return null;e[i]+=1}return e}function Sd(t,e){let r=[];t.failed>0&&r.push(C(e,`${t.failed} failed`,`${t.failed} 项失败`)),t.blocked>0&&r.push(C(e,`${t.blocked} blocked`,`${t.blocked} 项受阻`)),t.pending>0&&r.push(C(e,`${t.pending} pending`,`${t.pending} 项待验`));let i=C(e,`acceptance ${t.passed}/${t.total} passed`,`验收 ${t.passed}/${t.total} 通过`);return r.length>0?`${i} (${r.join(", ")})`:i}function Ed(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;if(typeof e.change!="string"||e.disposition!=="continue"&&e.disposition!=="await-user"&&e.disposition!=="blocked"&&e.disposition!=="done"||e.commandArgs!==null&&e.commandArgs!==void 0&&!Array.isArray(e.commandArgs))return!1;let r=e.userCommunication;return!!(r&&typeof r=="object"&&typeof r.required=="boolean"&&(r.message===null||typeof r.message=="string")&&typeof r.agentInstruction=="string")}function ss(t){return/[\u4e00-\u9fff]/u.test(t.userCommunication.agentInstruction)?"zh-CN":"en"}function Ty(t,e,r){return t==="done"?C(r,"complete","已完成"):t==="await-user"?C(r,"waiting for a user decision","等待用户决定"):t==="blocked"?C(r,"paused: needs attention","已暂停,需要处理"):e?C(r,"waiting for a user decision","等待用户决定"):C(r,"ready to continue","可继续推进")}function $y(t,e,r){let i=ss(t),n=[];r&&n.push(r);let a=C(i,`Change ${t.change}`,`需求 ${t.change}`),o=kd(t.phase,i),s=Ty(t.disposition,t.userCommunication.required,i);n.push([a,o||null,s].filter(Boolean).join(" · ")),e&&e.total>0&&n.push(Sd(e,i));let c=t.userCommunication,l=xd(t,i);return{summary:n.join("; "),...l?{next:l}:{},...c.required&&c.message?{user_message:c.message}:{}}}function xd(t,e){let r=t.userCommunication;if(t.disposition==="await-user"&&r.required)return{ask_user:C(e,"Relay the message below, wait for the user decision, then run the matching option (run with --json to see the exact alternative commands).","先转述下方信息并等待用户选择,再执行对应命令(完整候选命令以 --json 输出为准)。")};if(t.commandArgs&&t.commandArgs.length>0)return{command:t.commandArgs.join(" ")};if(t.disposition==="done")return{ask_user:C(e,"No further workflow action; report the completed change to the user.","工作流已无后续动作;向用户报告该需求已完成即可。")};if(t.disposition==="blocked")return{ask_user:r.required&&r.message?r.agentInstruction:C(e,"Resolve the paused condition before continuing; run with --json for the structured diagnosis.","先解除暂停原因再继续;结构化诊断信息以 --json 输出为准。")}}function jy(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&Array.isArray(e.items)}function Oy(t,e){let r=typeof t.name=="string"?t.name:"(unnamed)",i=kd(t.phase,e),n=t.status==="await-user"?C(e,"waiting for a user decision","等待用户决定"):t.status==="blocked"?C(e,"paused","已暂停"):t.status==="done"?C(e,"complete","已完成"):C(e,"in progress","进行中"),a=os(t.acceptance)?`${C(e,", ",",")}${Sd(t.acceptance,e)}`:"";return` ${r} · ${i||String(t.phase??"?")} · ${n}${a}`}function Hy(t){for(let e of t){let r=e.continuation;if(r?.userCommunication&&typeof r.userCommunication.agentInstruction=="string"&&/[\u4e00-\u9fff]/u.test(r.userCommunication.agentInstruction))return"zh-CN"}return"en"}function Dy(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.healthy!="boolean"?!1:e.findings===void 0||Array.isArray(e.findings)}function Ly(t){if(t.healthy){let i=t.repaired?C("en","Diagnostics passed and the reported problem was repaired automatically.","诊断通过,报告的问题已自动修复。"):C("en","Diagnostics passed: no problems found.","诊断通过:未发现问题。"),n=By(t.continuation);return n?{summary:i,next:n}:{summary:i}}let r=Array.isArray(t.findings)?t.findings.length:0;return{summary:C("en",r>0?`Diagnostics found ${r} problem${r===1?"":"s"} that need attention before this change can continue.`:"Diagnostics found problems that need attention before this change can continue.",r>0?`诊断发现 ${r} 个需要处理的问题,处理后该需求才能继续。`:"诊断发现需要处理的问题,处理后该需求才能继续。"),next:{ask_user:C("en","Run with --json to read the structured findings; re-run with --repair once the cause is understood.","结构化诊断以 --json 输出为准;确认原因后再用 --repair 修复。")}}}function By(t){return Ed(t)?xd(t,ss(t)):void 0}function Cd(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t;if(Dy(e))return Ly(e);if(jy(e)){let i=Hy(e.items);return{summary:[e.total===e.items.length?C(i,`Native changes (${e.total})`,`Native 需求列表(共 ${e.total} 条)`):C(i,`Native changes (showing ${e.items.length} of ${e.total})`,`Native 需求列表(显示 ${e.items.length}/${e.total} 条)`),...e.items.map(a=>Oy(a,i))].join(`
183
- `)}}let r=e.continuation;if(Ed(r)){let i=ss(r),n=$y(r,Fy(e),Vy(e,i));return My(e)==="unconfirmed"?{...n,summary:`${n.summary}${C(i,"; the dispatched Verifier has not confirmed startup yet — verify the subagent actually launched before waiting on it",";已派发的 Verifier 尚未确认启动——先核实子代理确实启动,再继续等待")}`}:n}if(typeof e.artifactRoot=="string"&&typeof e.nativeRoot=="string"){let i=e.language==="zh-CN"?"zh-CN":"en",n="pendingRootMove"in e;return{summary:C(i,n?`Comet Native artifacts live under ${e.artifactRoot} (state root: ${e.nativeRoot}).`:`Initialized Comet Native at ${e.nativeRoot} (artifacts: ${e.artifactRoot}).`,n?`Comet Native 产物位于 ${e.artifactRoot}(状态根目录:${e.nativeRoot})。`:`Comet Native 已初始化于 ${e.nativeRoot}(产物目录:${e.artifactRoot})。`)}}}function Fy(t){if(os(t.acceptance))return t.acceptance;let e=t.state;if(e&&typeof e=="object"&&!Array.isArray(e)){let r=e;if(os(r.acceptance))return r.acceptance;if(Array.isArray(r.acceptance))return Iy(r.acceptance)}return null}function My(t){let e=t.localExecution;if(!e||typeof e!="object"||Array.isArray(e))return;let r=e.verifierStartup;if(!(!r||typeof r!="object"||Array.isArray(r)))return r.confirmation}function Vy(t,e){if(t.selected!==void 0&&typeof t.selected=="string")return C(e,`Selected ${t.selected}.`,`已选择需求 ${t.selected}。`);let r=t.migration;return r&&typeof r=="object"&&r.completed===!0?C(e,"Upgraded this change to the current Native format.","已将该需求升级到当前 Native 格式。"):null}function Pd(t){let r=t.data&&typeof t.data=="object"&&!Array.isArray(t.data)?t.data:{};switch(t.code){case"conflict":return{summary:C("en","This change was updated elsewhere while the command ran, so the command stopped without changing anything. Nothing was lost — reload the latest state and continue from there.","这条需求刚被另一个会话更新,本次命令未做任何改动。没有工作丢失——重新读取最新状态后继续即可。"),...typeof r.change=="string"?{next:{command:`comet native status ${r.change} --json`}}:{}};case"baseline-incomplete":return{summary:C("en","The safety snapshot for this change exceeded its configured size budget, so the command stopped before changing anything. Raise the snapshot limits in .comet/config.yaml or exclude out-of-scope data, then retry.","该需求的安全快照超出配置的容量预算,命令在改动任何内容前已停止。请在 .comet/config.yaml 中调高快照上限,或将范围外的数据加入排除列表后重试。"),next:{ask_user:C("en","Run with --json to see the exact limits, omitted paths, and supported fixes.","具体上限、被省略的路径和支持的修复方式以 --json 输出为准。")}};case"workspace-isolation-required":return{summary:C("en","This change runs in its own Git worktree to keep work isolated. Create the linked worktree first, then continue inside it.","这条需求需要在独立的 Git worktree 中执行以保证隔离。请先创建关联的 worktree,然后在其中继续。"),next:{ask_user:C("en","Run with --json to see the exact worktree creation command.","完整的 worktree 创建命令以 --json 输出为准。")}};case"workspace-preparation-incomplete":return{summary:C("en","The change workspace is not fully prepared (for example a branch or worktree is missing). Finish the preparation steps, then retry.","需求的工作区尚未准备完成(例如分支或 worktree 缺失)。请先完成准备步骤,再重试。"),next:{ask_user:C("en","Run with --json to see the remaining preparation steps.","剩余的准备步骤以 --json 输出为准。")}};case"implementation-scope-stale":return{summary:C("en","The recorded implementation scope no longer matches the current files. Refresh the scope, then retry.","记录的实现范围与当前文件不再一致。请刷新范围后重试。"),next:{ask_user:C("en","Run with --json to see the exact recovery steps.","具体恢复步骤以 --json 输出为准。")}};default:return}}ts();var Rd=["--project-root <path> Resolve the Native project from this working directory.","--json Emit the stable JSON command envelope.","--verbose Append the raw machine projection after the human/agent text.","--help Show help without requiring an initialized project."],cs=Object.freeze({"":{usage:"comet native <command> [options]",purpose:"Create, inspect, recover, and archive portable Native changes through Runtime-enforced, skill-coordinated steps.",agentQuickStart:["Run `comet native status --json` to discover active changes.","Select an existing change with `select`, or create one with `new`.","In `agent.workspace.cwd`, execute the exact `agent.continuation.commandArgs` returned by Runtime.","Use `agent.continuation.inputOptions` templates for JSON input; do not reconstruct fields from memory."],subcommands:["init Initialize Native project configuration.","root show Inspect the configured artifact root.","root move <artifact-root> Move the configured artifact root.","new <change-name> Create a change and prepare its workspace.","spec disassociate Revoke a capability association through Runtime.","spec remove Record a complete capability removal intent.","spec sync <change-name> <capability> --input <json-file> Audit local Markdown reference corrections.","show <change-name> Read formal artifacts and portable state.","status [<change-name>] Discover stable boundaries and Runner actions.","select <change-name> Select a change in its bound workspace.","next <change-name> Confirm or recover a stable workflow boundary.","archive <change-name> Preview and execute Archive plus workspace finish.","doctor [<change-name>] Diagnose, migrate, or rebuild local execution state."],options:Rd,output:"A human summary plus a NEXT step by default (RELAY TO USER blocks carry user decisions); use --json for the structured envelope, --verbose to append the raw machine projection.",examples:["comet native status --json","comet native status my-change --details --json","comet native next --help"]},init:{usage:"comet native init [--root <artifact-root>] [--language en|zh-CN]",purpose:"Create or normalize .comet/config.yaml and the configured Native directories.",options:["--root <artifact-root> Project-relative artifact root; defaults to docs.","--language en|zh-CN Language for newly generated Native artifacts."],output:"The resolved project configuration and Native paths.",examples:["comet native init --root docs --language zh-CN"]},root:{usage:"comet native root <show|move> [arguments]",purpose:"Inspect or transactionally move the configured Native artifact root.",subcommands:["show Print the configured artifact root and resolved paths.","move <artifact-root> Move Native artifacts and update project configuration."],output:"The current root projection or the completed move result.",examples:["comet native root show","comet native root move artifacts/native"]},"root show":{usage:"comet native root show",purpose:"Print the configured Native artifact root and resolved paths.",output:"The configured artifact root and resolved Native paths."},"root move":{usage:"comet native root move <artifact-root>",purpose:"Transactionally move Native artifacts and update project configuration.",output:"The source, destination, and committed root-move transaction result.",examples:["comet native root move artifacts/native"]},new:{usage:"comet native new <change-name> [--language en|zh-CN] [--task <text>] [--capability <id>] [--isolation current|branch|worktree] [--change-branch <branch>] [--target-branch <branch>] [--worktree-path <path>]",purpose:"Create a portable Native change and prepare the requested branch or linked worktree.",options:["--language en|zh-CN Artifact language; defaults to project configuration.","--task <text> Search Project Knowledge for an existing capability and save a revocable association draft.","--capability <id> Directly validate and associate an existing capability without retrieval.","--isolation <kind> current, branch, or worktree; defaults to current.","--change-branch <branch> Change branch; defaults to comet/<change-name>.","--target-branch <branch> Local base branch; defaults to the current branch.","--worktree-path <path> Worktree directory; defaults to .worktrees/<change-name>."],output:"The portable state, canonical artifact paths, workspace preparation result, and continuation with the next Runner action.",examples:["comet native new session-timeout --language zh-CN",'comet native new add-sms-login --task "add SMS login to authentication"',"comet native new session-timeout --isolation branch --target-branch main","comet native new session-timeout --isolation worktree --target-branch main"]},spec:{usage:`comet native spec disassociate <change-name> --expected-state-version <n> --expected-action disassociate-capability
194
+ `}function Sd(t,e,r){let i=[t.summary],n=bd(t.next);return n&&i.push(n),t.user_message&&i.push("",Ae.relay,t.user_message),i.push("",`${Ae.detail} ${e}`),r!==void 0&&i.push("",Ae.details,JSON.stringify(r,null,2)),i.join(`
195
+ `)}ht();var Ud=Oe(Se(),1);ue();j();ht();ee();W();$();ge();Qr();W();$();Lt();Je();var gy=Oe(Se(),1);Lt();Je();Ce();Ce();Ht();fs();import{AsyncLocalStorage as wy}from"node:async_hooks";var yy=new wy;function Ny(){let t=yy.getStore();return t?.active?t:null}function by(t,e){let r=t;for(let i of e)r+="\0"+(typeof i=="string"?i:JSON.stringify(i));return r}function Vd(t,e){return(...r)=>{let i=Ny();if(i===null)return e(...r);let n=by(`async:${t}`,r),a=i.entries.get(n);if(a)return a.value;let o=e(...r).catch(s=>{throw i.entries.get(n)?.value===o&&i.entries.delete(n),s});return i.entries.set(n,{value:o}),o}}Ht();var DP=Vd("hookWritePolicy",async t=>(await is(t))?.hook??{allow_paths:[]});Mr();var ky=16*1024;us();Dr();var OR=Number.MAX_SAFE_INTEGER;j();ve();var UR={runStateBytes:Number.MAX_SAFE_INTEGER,trajectoryBytes:Number.MAX_SAFE_INTEGER,trajectoryEvents:4096,trajectoryEventBytes:Number.MAX_SAFE_INTEGER,checkpointBytes:Number.MAX_SAFE_INTEGER,pendingActionBytes:Number.MAX_SAFE_INTEGER,contextBytes:Number.MAX_SAFE_INTEGER,artifactsBytes:Number.MAX_SAFE_INTEGER};j();ue();W();$();var c_=16*1024,l_=process.platform;Yr();Bn();Bn();var Kn=class extends Error{constructor(r,i,n){super(`Native change ${r} revision conflict: expected ${i}, actual ${n}`);this.change=r;this.expectedRevision=i;this.actualRevision=n;this.name="NativeChangeRevisionConflictError"}change;expectedRevision;actualRevision;code="native-change-revision-conflict"},Zr=class extends Error{constructor(r,i){super(`Native working directory already contains active change${i.length===1?"":"s"} ${i.join(", ")}; create the new change in a separate worktree`);this.requestedIsolation=r;this.activeChanges=i;this.name="NativeWorkspaceIsolationRequiredError"}requestedIsolation;activeChanges;code="native-workspace-isolation-required"},Yn=class extends Error{constructor(r,i,n,a,o,s=null,c=null){super(`Native change ${r} baseline is incomplete (${i} omitted entr${i===1?"y":"ies"}). Adjust native.snapshot scope or resource budgets in .comet/config.yaml, then retry.`);this.change=r;this.omittedCount=i;this.omittedByReason=n;this.samplePaths=a;this.sampleTruncated=o;this.effectiveLimits=s;this.policyHash=c;this.name="NativeBaselineIncompleteError"}change;omittedCount;omittedByReason;samplePaths;sampleTruncated;effectiveLimits;policyHash;code="native-baseline-incomplete"},D_=Dn("en");ue();we();$();var Oy=["outcome","scope","nonGoals","acceptanceExamples"],G_=[...Oy,"constraints","decisions","openQuestions","verificationExpectations"];var ei=class extends Error{constructor(r,i,n){super(r);this.findings=i;this.change=n;this.name="NativeDocumentConstraintError"}findings;change};V();ue();V();var Hy=Object.freeze({maxChanges:32,maxSpecsPerChange:64,maxArtifactsPerChange:128,maxTotalSpecs:512,maxTotalArtifacts:1024,maxSignalsPerRelationship:8,maxRelationships:256,maxSerializedBytes:64*1024,maxNameBytes:128,maxCapabilityBytes:128,maxArtifactPathBytes:512});Jt();ge();ee();$();j();we();Kr();W();$();ge();vt();V();V();Qn();Gt();we();var Qd={root:"/comet/native-runtime",packageKind:"runtime",definition:{apiVersion:"comet/v1alpha1",kind:"Skill",metadata:{name:"comet-native-runtime",version:"3",description:"Comet-owned state runtime for the Native workflow."},goal:{statement:"Advance a Native change only after its current guard passes.",inputs:[],outputs:[],success:["The Native change and Run state agree on the next phase."]},orchestration:{mode:"deterministic",entry:"shape",steps:[{id:"shape",action:{type:"checkpoint"},next:"build"},{id:"build",action:{type:"checkpoint"},next:"verify"},{id:"verify",action:{type:"checkpoint"},next:"archive"},{id:"archive",action:{type:"checkpoint"}}]},skills:[],agents:[],tools:[]},guardrails:{allowedSkills:[],allowedAgents:[],allowedTools:[],maxIterations:Number.MAX_SAFE_INTEGER,maxRetriesPerAction:2,confirmationRequiredFor:[]},evals:[]},zy=ie("comet-native-runtime:v3:scope-reopen"),eI=[{skillVersion:"3",skillHash:ie("comet-native-runtime:v3:semantic-repair-budget")},{skillVersion:"2",skillHash:ie("comet-native-runtime:v2:max-iterations-32")},{skillVersion:"1",skillHash:ie("comet-native-runtime:v1")}];we();we();Yr();var ef=["schema","id","change","evidenceHash","createdAt","previousState","nextState","previousRun","nextRun","eventData"],jI=new Set(ef),Qy=new Set([...ef,"minimum_runtime_version","revision"]),OI=new Set([...Qy,"operation"]),Zy=new Set(["previousPhase","nextPhase","evidenceHash","summary","artifacts","noCodeReason","verificationResult"]),HI=new Set([...Zy,"implementationScopeHash","repairScopeHash","repairStagnation","returnToBuild"]);Mn();ue();ue();Mn();V();var FI={maxAcceptanceCriteria:Id.maxCriteria};Jt();Qr();Gt();Qn();import{execFile as dN}from"node:child_process";Vt();Gr();Is();import{promisify as fN}from"node:util";j();we();$();ge();Ur();vt();W();j();As();$();ve();Jt();W();vt();var ii=class extends Error{recovery;constructor(e,r){super(e),this.name="NativeReceiptScopeStaleError",this.recovery=r}};Qr();Zn();Gt();var zT=64*1024;var GT=3600*1e3;var JT=fN(dN);Zn();var ea=class extends Error{details;constructor(e){let r=e.length===0?"Native verification receipt binding is invalid":`Native verification receipt binding is invalid (${e.length} receipt(s)): ${e.map(i=>`${i.ref}${i.acceptanceId?`[${i.acceptanceId}]`:""} -> ${i.mismatches.join("; ")}`).join(" | ")}`;super(r),this.name="NativeVerificationReceiptBindingError",this.details=e}};we();ge();j();ve();$();ge();Jn();j();ht();Jt();var J$=Object.freeze({maxScopeChanges:128,maxAcceptanceEntries:64,maxUnresolvedReasons:32,maxReceipts:32});we();Kr();W();$();ge();ee();W();ye();j();zn();Xe();$();function Os(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yt=Os();function ff(t){yt=t}var gt={exec:()=>null};function Kt(t){let e=[];return r=>{let i=Math.max(0,Math.min(3,r-1)),n=e[i];return n||(n=t(i),e[i]=n),n}}function P(t,e=""){let r=typeof t=="string"?t:t.source,i={replace:(n,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(z.caret,"$1"),r=r.replace(n,o),i},getRegex:()=>new RegExp(r,e)};return i}var EN=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),z={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Kt(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Kt(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Kt(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Kt(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Kt(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Kt(t=>new RegExp(`^ {0,${t}}>`))},xN=/^(?:[ \t]*(?:\n|$))+/,CN=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,PN=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,oi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,RN=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Hs=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,pf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,hf=P(pf).replace(/bull/g,Hs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),_N=P(pf).replace(/bull/g,Hs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ds=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,AN=/^[^\n]+/,Ls=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,IN=P(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ls).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),TN=P(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Hs).getRegex(),aa="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Bs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,$N=P("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Bs).replace("tag",aa).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),mf=t=>P(Ds).replace("hr",oi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",aa).getRegex(),jN=mf(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),ON=mf(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),HN=P(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ON).getRegex(),Ms={blockquote:HN,code:CN,def:IN,fences:PN,heading:RN,hr:oi,html:$N,lheading:hf,list:TN,newline:xN,paragraph:jN,table:gt,text:AN},af=P("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",oi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",aa).getRegex(),DN={...Ms,lheading:_N,table:af,paragraph:P(Ds).replace("hr",oi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",af).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",aa).getRegex()},LN={...Ms,html:P(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Bs).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:gt,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:P(Ds).replace("hr",oi).replace("heading",` *#{1,6} *[^
196
+ ]`).replace("lheading",hf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},BN=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,MN=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,vf=/^( {2,}|\\)\n(?!\s*$)/,FN=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,$e=/[\p{P}\p{S}]/u,Yt=/[\s\p{P}\p{S}]/u,si=/[^\s\p{P}\p{S}]/u,VN=P(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Yt).getRegex(),qN=/[\p{Pi}\p{Ps}"']/u,gf=/(?!~)[\p{P}\p{S}]/u,WN=/(?!~)[\s\p{P}\p{S}]/u,zN=/(?:[^\s\p{P}\p{S}]|~)/u,GN=P(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",EN?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),wf=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,JN=P(wf,"u").replace(/punct/g,$e).getRegex(),UN=P(wf,"u").replace(/punct/g,gf).getRegex(),KN=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,YN=P(KN,"u").replace(/openQuote/g,qN).replace(/punct/g,$e).getRegex(),yf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",XN=P(yf,"gu").replace(/notPunctSpace/g,si).replace(/punctSpace/g,Yt).replace(/punct/g,$e).getRegex(),QN=P(yf,"gu").replace(/notPunctSpace/g,zN).replace(/punctSpace/g,WN).replace(/punct/g,gf).getRegex(),ZN="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",eb=P(ZN,"gu").replace(/notPunctSpace/g,si).replace(/punctSpace/g,Yt).replace(/punct/g,$e).getRegex(),tb=P("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,si).replace(/punctSpace/g,Yt).replace(/punct/g,$e).getRegex(),rb="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",ib=P(rb,"gu").replace(/notPunctSpace/g,si).replace(/punctSpace/g,Yt).replace(/punct/g,$e).getRegex(),nb=P(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,$e).getRegex(),ab="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",ob=P(ab,"gu").replace(/notPunctSpace/g,si).replace(/punctSpace/g,Yt).replace(/punct/g,$e).getRegex(),sb=P(/\\(punct)/,"gu").replace(/punct/g,$e).getRegex(),cb=P(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),lb=P(Bs).replace("(?:-->|$)","-->").getRegex(),ub=P("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",lb).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ra=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,db=P(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",ra).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Nf=P(/^!?\[(label)\]\[(ref)\]/).replace("label",ra).replace("ref",Ls).getRegex(),bf=P(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ls).getRegex(),fb=P("reflink|nolink(?!\\()","g").replace("reflink",Nf).replace("nolink",bf).getRegex(),of=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Fs={_backpedal:gt,anyPunctuation:sb,autolink:cb,blockSkip:GN,br:vf,code:MN,del:gt,delLDelim:gt,delRDelim:gt,emStrongLDelim:JN,emStrongRDelimAst:XN,emStrongRDelimUnd:tb,escape:BN,link:db,nolink:bf,punctuation:VN,reflink:Nf,reflinkSearch:fb,tag:ub,text:FN,url:gt},pb={...Fs,emStrongLDelim:YN,emStrongRDelimAst:eb,emStrongRDelimUnd:ib,link:P(/^!?\[(label)\]\((.*?)\)/).replace("label",ra).getRegex(),reflink:P(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ra).getRegex()},Ts={...Fs,emStrongRDelimAst:QN,emStrongLDelim:UN,delLDelim:nb,delRDelim:ob,url:P(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",of).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:P(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",of).getRegex()},hb={...Ts,br:P(vf).replace("{2,}","*").getRegex(),text:P(Ts.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ta={normal:Ms,gfm:DN,pedantic:LN},ni={normal:Fs,gfm:Ts,breaks:hb,pedantic:pb},mb={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},sf=t=>mb[t];function Ne(t,e){if(e){if(z.escapeTest.test(t))return t.replace(z.escapeReplace,sf)}else if(z.escapeTestNoEncode.test(t))return t.replace(z.escapeReplaceNoEncode,sf);return t}function cf(t){try{t=encodeURI(t).replace(z.percentDecode,"%")}catch{return null}return t}function lf(t,e){let r=t.replace(z.findPipe,(a,o,s)=>{let c=!1,l=o;for(;--l>=0&&s[l]==="\\";)c=!c;return c?"|":" |"}),i=r.split(z.splitPipe),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i.at(-1)?.trim()&&i.pop(),e)if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(z.slashPipe,"|");return i}function et(t,e,r){let i=t.length;if(i===0)return"";let n=0;for(;n<i;){let a=t.charAt(i-n-1);if(a===e&&!r)n++;else if(a!==e&&r)n++;else break}return t.slice(0,i-n)}function uf(t){let e=t.split(`
197
+ `),r=e.length-1;for(;r>=0&&z.blankLine.test(e[r]);)r--;return e.length-r<=2?t:e.slice(0,r+1).join(`
198
+ `)}function vb(t,e){if(t.indexOf(e[1])===-1)return-1;let r=0;for(let i=0;i<t.length;i++)if(t[i]==="\\")i++;else if(t[i]===e[0])r++;else if(t[i]===e[1]&&(r--,r<0))return i;return r>0?-2:-1}function gb(t,e=0){let r=e,i="";for(let n of t)if(n===" "){let a=4-r%4;i+=" ".repeat(a),r+=a}else i+=n,r++;return i}function df(t,e,r,i,n){let a=e.href,o=e.title||null,s=t[1].replace(n.other.outputLinkReplace,"$1"),c=t[0].charAt(0)==="!";i.state.inLink=!0;let l=i.state.linkEmitted,d=i.state.inRawBlock;i.state.linkEmitted=!1;let u=i.inlineTokens(s),f=i.state.linkEmitted;if(i.state.linkEmitted=l,i.state.inLink=!1,!c){if(f){i.state.inRawBlock=d;return}i.state.linkEmitted=!0}return{type:c?"image":"link",raw:r,href:a,title:o,text:s,tokens:u}}function wb(t,e,r){let i=t.match(r.other.indentCodeCompensation);if(i===null)return e;let n=i[1];return e.split(`
199
+ `).map(a=>{let o=a.match(r.other.beginningSpace);if(o===null)return a;let[s]=o;return s.length>=n.length?a.slice(n.length):a}).join(`
200
+ `)}var ia=class{options;rules;lexer;constructor(t){this.options=t||yt}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=this.options.pedantic?e[0]:uf(e[0]),i=r.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:r,codeBlockStyle:"indented",text:i}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],i=wb(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:i}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let i=et(r,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(r=i.trim())}return{type:"heading",raw:et(e[0],`
201
+ `),depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:et(e[0],`
202
+ `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=et(e[0],`
203
+ `).split(`
204
+ `),i="",n="",a=[];for(;r.length>0;){let o=!1,s=[],c;for(c=0;c<r.length;c++)if(this.rules.other.blockquoteStart.test(r[c]))s.push(r[c]),o=!0;else if(!o)s.push(r[c]);else break;r=r.slice(c);let l=s.join(`
205
+ `),d=l.replace(this.rules.other.blockquoteSetextReplace,`
206
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
207
+ ${l}`:l,n=n?`${n}
208
+ ${d}`:d;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,a,!0),this.lexer.state.top=u,r.length===0)break;let f=a.at(-1);if(f?.type==="code")break;if(f?.type==="blockquote"){let h=f,v=r.join(`
209
+ `),p=h.raw+`
210
+ `+v.replace(this.rules.other.blockquoteSetextReplace2,""),m=this.blockquote(p);a[a.length-1]=m,i=`${i}
211
+ ${v}`,n=n.substring(0,n.length-h.text.length)+m.text;break}else if(f?.type==="list"){let h=f,v=h.raw+`
212
+ `+r.join(`
213
+ `),p=this.list(v);a[a.length-1]=p,i=i.substring(0,i.length-f.raw.length)+p.raw,n=n.substring(0,n.length-h.raw.length)+p.raw,r=v.substring(a.at(-1).raw.length).split(`
214
+ `);continue}}return{type:"blockquote",raw:i,tokens:a,text:n}}}list(t){let e=this.rules.block.list.exec(t);if(e){let r=e[1].trim(),i=r.length>1,n={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");let a=this.rules.other.listItemRegex(r),o=!1;for(;t;){let c=!1,l="",d="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;l=e[0],t=t.substring(l.length);let u=gb(e[2].split(`
215
+ `,1)[0],e[1].length),f=t.split(`
216
+ `,1)[0],h=!u.trim(),v=0;if(this.options.pedantic?(v=2,d=u.trimStart()):h?v=e[1].length+1:(v=u.search(this.rules.other.nonSpaceChar),v=v>4?1:v,d=u.slice(v),v+=e[1].length),h&&this.rules.other.blankLine.test(f)&&(l+=f+`
217
+ `,t=t.substring(f.length+1),c=!0),!c){let p=this.rules.other.nextBulletRegex(v),m=this.rules.other.hrRegex(v),w=this.rules.other.fencesBeginRegex(v),y=this.rules.other.headingBeginRegex(v),k=this.rules.other.htmlBeginRegex(v),x=this.rules.other.blockquoteBeginRegex(v);for(;t;){let E=t.split(`
218
+ `,1)[0],S;if(f=E,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),S=f):S=f.replace(this.rules.other.tabCharGlobal," "),w.test(f)||y.test(f)||k.test(f)||x.test(f)||p.test(f)||m.test(f))break;if(S.search(this.rules.other.nonSpaceChar)>=v||!f.trim())d+=`
219
+ `+S.slice(v);else{if(h||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(u)||y.test(u)||m.test(u))break;d+=`
220
+ `+f}h=!f.trim(),l+=E+`
221
+ `,t=t.substring(E.length+1),u=S.slice(v)}}n.loose||(o?n.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(o=!0)),n.items.push({type:"list_item",raw:l,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),n.raw+=l}let s=n.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let c of n.items)if(this.lexer.state.top=!1,c.tokens=this.lexer.blockTokens(c.text,[]),!n.loose){let l=c.tokens.filter(u=>u.type==="space"),d=l.length>0&&l.some(u=>this.rules.other.anyLine.test(u.raw));n.loose=d}for(let c of n.items){let l=c.tokens[0];if(c.task&&(l?.type==="text"||l?.type==="paragraph")){c.text=c.text.replace(this.rules.other.listReplaceTask,""),l.raw=l.raw.replace(this.rules.other.listReplaceTask,""),l.text=l.text.replace(this.rules.other.listReplaceTask,"");for(let u=this.lexer.inlineQueue.length-1;u>=0;u--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)){this.lexer.inlineQueue[u].src=this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask,"");break}let d=this.rules.other.listTaskCheckbox.exec(c.raw);if(d){let u={type:"checkbox",raw:d[0]+" ",checked:d[0]!=="[ ]"};c.checked=u.checked,n.loose?c.tokens[0]&&["paragraph","text"].includes(c.tokens[0].type)&&"tokens"in c.tokens[0]&&c.tokens[0].tokens?(c.tokens[0].raw=u.raw+c.tokens[0].raw,c.tokens[0].text=u.raw+c.tokens[0].text,c.tokens[0].tokens.unshift(u)):c.tokens.unshift({type:"paragraph",raw:u.raw,text:u.raw,tokens:[u]}):c.tokens.unshift(u)}}else c.task&&(c.task=!1)}if(n.loose)for(let c of n.items){c.loose=!0;for(let l of c.tokens)l.type==="text"&&(l.type="paragraph")}return n}}html(t){let e=this.rules.block.html.exec(t);if(e){let r=uf(e[0]);return{type:"html",block:!0,raw:r,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:r}}}def(t){let e=this.rules.block.def.exec(t);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",n=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:et(e[0],`
222
+ `),href:i,title:n}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=lf(e[1]),i=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),n=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
223
+ `):[],a={type:"table",raw:et(e[0],`
224
+ `),header:[],align:[],rows:[]};if(r.length===i.length){for(let o of i)this.rules.other.tableAlignRight.test(o)?a.align.push("right"):this.rules.other.tableAlignCenter.test(o)?a.align.push("center"):this.rules.other.tableAlignLeft.test(o)?a.align.push("left"):a.align.push(null);for(let o=0;o<r.length;o++)a.header.push({text:r[o],tokens:this.lexer.inline(r[o]),header:!0,align:a.align[o]});for(let o of n)a.rows.push(lf(o,a.header.length).map((s,c)=>({text:s,tokens:this.lexer.inline(s),header:!1,align:a.align[c]})));return a}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let r=e[1].trim();return{type:"heading",raw:et(e[0],`
225
+ `),depth:e[2].charAt(0)==="="?1:2,text:r,tokens:this.lexer.inline(r)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===`
226
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let a=et(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=vb(e[2],"()");if(a===-2)return;if(a>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let i=e[2],n="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(i);a&&(i=a[1],n=a[3])}else n=e[3]?e[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i=i.slice(1):i=i.slice(1,-1)),df(e,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let i=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[i.toLowerCase()];if(!n){let a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return df(r,n,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let i=this.rules.inline.emStrongLDelim.exec(t);if(!(!i||!i[1]&&!i[2]&&!i[3]&&!i[4]||i[4]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(i[1]||i[3])||!r||this.rules.inline.punctuation.exec(r))){let n=[...i[0]].length-1,a,o,s=n,c=0,l=i[0][0],d=r===l,u=l==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+n);(i=u.exec(e))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(o=[...a].length,i[3]||i[4]){s+=o;continue}else if(i[5]||i[6]){if(n%3&&!((n+o)%3)){c+=o;continue}if(d)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let f=[...i[0]][0].length,h=t.slice(0,n+i.index+f+o);if(Math.min(n,o)%2){let p=h.slice(1,-1);return{type:"em",raw:h,text:p,tokens:this.lexer.inlineTokens(p)}}let v=h.slice(2,-2);return{type:"strong",raw:h,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),i=this.rules.other.nonSpaceChar.test(r),n=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return i&&n&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,r=""){let i=this.rules.inline.delLDelim.exec(t);if(i&&(!i[1]||!r||this.rules.inline.punctuation.exec(r))){let n=[...i[0]].length-1,a,o,s=n,c=this.rules.inline.delRDelim;for(c.lastIndex=0,e=e.slice(-1*t.length+n);(i=c.exec(e))!==null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a||(o=[...a].length,o!==n))continue;if(i[3]||i[4]){s+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s);let l=[...i[0]][0].length,d=t.slice(0,n+i.index+l+o),u=d.slice(n,-n);return{type:"del",raw:d,text:u,tokens:this.lexer.inlineTokens(u)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,i;return e[2]==="@"?(r=e[1],i="mailto:"+r):(r=e[1],i=r),{type:"link",raw:e[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let r,i;if(e[2]==="@")r=e[0],i="mailto:"+r;else{let n;do n=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(n!==e[0]);r=e[0],e[1]==="www."?i="http://"+e[0]:i=e[0]}return{type:"link",raw:e[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},ne=class $s{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||yt,this.options.tokenizer=this.options.tokenizer||new ia,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let r={other:z,block:ta.normal,inline:ni.normal};this.options.pedantic?(r.block=ta.pedantic,r.inline=ni.pedantic):this.options.gfm&&(r.block=ta.gfm,this.options.breaks?r.inline=ni.breaks:r.inline=ni.gfm),this.tokenizer.rules=r}static get rules(){return{block:ta,inline:ni}}static lex(e,r){return new $s(r).lex(e)}static lexInline(e,r){return new $s(r).inlineTokens(e)}lex(e){e=e.replace(z.carriageReturn,`
227
+ `),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let i=this.inlineQueue[r];this.inlineTokens(i.src,i.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],i=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(z.tabCharGlobal," ").replace(z.spaceLine,""));let n=1/0;for(;e;){if(e.length<n)n=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let a;if(this.options.extensions?.block?.some(s=>(a=s.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);let s=r.at(-1);a.raw.length===1&&s!==void 0?s.raw+=`
228
+ `:r.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
229
+ `)?"":`
230
+ `)+a.raw,s.text+=`
231
+ `+a.text,this.inlineQueue.at(-1).src=s.text):r.push(a);continue}if(a=this.tokenizer.fences(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.heading(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.hr(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.blockquote(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.list(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.html(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.def(e)){e=e.substring(a.raw.length);let s=r.at(-1);s?.type==="paragraph"||s?.type==="text"?(s.raw+=(s.raw.endsWith(`
232
+ `)?"":`
233
+ `)+a.raw,s.text+=`
234
+ `+a.raw,this.inlineQueue.at(-1).src=s.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title},r.push(a));continue}if(a=this.tokenizer.table(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.lheading(e)){e=e.substring(a.raw.length),r.push(a);continue}let o=e;if(this.options.extensions?.startBlock){let s=1/0,c=e.slice(1),l;this.options.extensions.startBlock.forEach(d=>{l=d.call({lexer:this},c),typeof l=="number"&&l>=0&&(s=Math.min(s,l))}),s<1/0&&s>=0&&(o=e.substring(0,s+1))}if(this.state.top&&(a=this.tokenizer.paragraph(o))){let s=r.at(-1);i&&s?.type==="paragraph"?(s.raw+=(s.raw.endsWith(`
235
+ `)?"":`
236
+ `)+a.raw,s.text+=`
237
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(a),i=o.length!==e.length,e=e.substring(a.raw.length);continue}if(a=this.tokenizer.text(e)){e=e.substring(a.raw.length);let s=r.at(-1);s?.type==="text"?(s.raw+=(s.raw.endsWith(`
238
+ `)?"":`
239
+ `)+a.raw,s.text+=`
240
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=s.text):r.push(a);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}linkInText(e){if(!e.includes("["))return!1;let r=this.tokenizer.rules.inline.link;for(let i of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(r.test(i[0])&&e.charAt(i.index-1)!=="!")return!0;for(let i of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let n=i[0],a=n.lastIndexOf("[");if(!(n.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,n.slice(a+1,-1)))&&!(a>1&&this.linkInText(n.slice(1,a-1))))return!0}return!1}inlineTokens(e,r=[]){this.tokenizer.lexer=this;let i=e;if(this.tokens.links&&e.includes("[")){let s=this.tokenizer.rules.inline.reflinkSearch,c=l=>{let d=l.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,l.slice(d+1,-1)))return l;if(d>1&&l.charAt(0)!=="!"){let u=l.slice(1,d-1);if(this.linkInText(u))return"["+u.replace(s,c)+"]["+"a".repeat(l.length-d-2)+"]"}return"["+"a".repeat(l.length-2)+"]"};i=i.replace(s,c)}i=i.replace(this.tokenizer.rules.inline.anyPunctuation,s=>"+".repeat(s.length)),i=i.replace(this.tokenizer.rules.inline.blockSkip,(s,c,l)=>{let d=l?l.length:0;return s.slice(0,d)+"["+"a".repeat(s.length-d-2)+"]"}),i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let n=!1,a="",o=1/0;for(;e;){if(e.length<o)o=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}n||(a=""),n=!1;let s;if(this.options.extensions?.inline?.some(l=>(s=l.call({lexer:this},e,r))?(e=e.substring(s.raw.length),r.push(s),!0):!1))continue;if(s=this.tokenizer.escape(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.tag(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.link(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(s.raw.length);let l=r.at(-1);s.type==="text"&&l?.type==="text"?(l.raw+=s.raw,l.text+=s.text):r.push(s);continue}if(s=this.tokenizer.emStrong(e,i,a)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.codespan(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.br(e)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.del(e,i,a)){e=e.substring(s.raw.length),r.push(s);continue}if(s=this.tokenizer.autolink(e)){e=e.substring(s.raw.length),r.push(s);continue}if(!this.state.inLink&&(s=this.tokenizer.url(e))){e=e.substring(s.raw.length),r.push(s);continue}let c=e;if(this.options.extensions?.startInline){let l=1/0,d=e.slice(1),u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},d),typeof u=="number"&&u>=0&&(l=Math.min(l,u))}),l<1/0&&l>=0&&(c=e.substring(0,l+1))}if(s=this.tokenizer.inlineText(c)){e=e.substring(s.raw.length),s.raw.slice(-1)!=="_"&&(a=s.raw.slice(-1)),n=!0;let l=r.at(-1);l?.type==="text"?(l.raw+=s.raw,l.text+=s.text):r.push(s);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return r}infiniteLoopError(e){let r="Infinite loop on byte: "+e;if(this.options.silent)console.error(r);else throw new Error(r)}},na=class{options;parser;constructor(t){this.options=t||yt}space(t){return""}code({text:t,lang:e,escaped:r}){let i=(e||"").match(z.notSpaceStart)?.[0],n=t.replace(z.endingNewline,"")+`
241
+ `;return i?'<pre><code class="language-'+Ne(i)+'">'+(r?n:Ne(n,!0))+`</code></pre>
242
+ `:"<pre><code>"+(r?n:Ne(n,!0))+`</code></pre>
243
+ `}blockquote({tokens:t}){return`<blockquote>
244
+ ${this.parser.parse(t)}</blockquote>
245
+ `}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
246
+ `}hr(t){return`<hr>
247
+ `}list(t){let e=t.ordered,r=t.start,i="";for(let o=0;o<t.items.length;o++){let s=t.items[o];i+=this.listitem(s)}let n=e?"ol":"ul",a=e&&r!==1?' start="'+r+'"':"";return"<"+n+a+`>
248
+ `+i+"</"+n+`>
249
+ `}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
250
+ `}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
251
+ `}table(t){let e="",r="";for(let n=0;n<t.header.length;n++)r+=this.tablecell(t.header[n]);e+=this.tablerow({text:r});let i="";for(let n=0;n<t.rows.length;n++){let a=t.rows[n];r="";for(let o=0;o<a.length;o++)r+=this.tablecell(a[o]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
252
+ <thead>
253
+ `+e+`</thead>
254
+ `+i+`</table>
255
+ `}tablerow({text:t}){return`<tr>
256
+ ${t}</tr>
257
+ `}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
258
+ `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${Ne(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){let i=this.parser.parseInline(r),n=cf(t);if(n===null)return i;t=n;let a='<a href="'+t+'"';return e&&(a+=' title="'+Ne(e)+'"'),a+=">"+i+"</a>",a}image({href:t,title:e,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));let n=cf(t);if(n===null)return Ne(r);t=n;let a=`<img src="${t}" alt="${Ne(r)}"`;return e&&(a+=` title="${Ne(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:Ne(t.text)}},Vs=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},fe=class js{options;renderer;textRenderer;constructor(e){this.options=e||yt,this.options.renderer=this.options.renderer||new na,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Vs}static parse(e,r){return new js(r).parse(e)}static parseInline(e,r){return new js(r).parseInline(e)}parse(e){this.renderer.parser=this;let r="";for(let i=0;i<e.length;i++){let n=e[i];if(this.options.extensions?.renderers?.[n.type]){let o=n,s=this.options.extensions.renderers[o.type].call({parser:this},o);if(s!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(o.type)){r+=s||"";continue}}let a=n;switch(a.type){case"space":{r+=this.renderer.space(a);break}case"hr":{r+=this.renderer.hr(a);break}case"heading":{r+=this.renderer.heading(a);break}case"code":{r+=this.renderer.code(a);break}case"table":{r+=this.renderer.table(a);break}case"blockquote":{r+=this.renderer.blockquote(a);break}case"list":{r+=this.renderer.list(a);break}case"checkbox":{r+=this.renderer.checkbox(a);break}case"html":{r+=this.renderer.html(a);break}case"def":{r+=this.renderer.def(a);break}case"paragraph":{r+=this.renderer.paragraph(a);break}case"text":{r+=this.renderer.text(a);break}default:{let o='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return r}parseInline(e,r=this.renderer){this.renderer.parser=this;let i="";for(let n=0;n<e.length;n++){let a=e[n];if(this.options.extensions?.renderers?.[a.type]){let s=this.options.extensions.renderers[a.type].call({parser:this},a);if(s!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(a.type)){i+=s||"";continue}}let o=a;switch(o.type){case"escape":{i+=r.text(o);break}case"html":{i+=r.html(o);break}case"link":{i+=r.link(o);break}case"image":{i+=r.image(o);break}case"checkbox":{i+=r.checkbox(o);break}case"strong":{i+=r.strong(o);break}case"em":{i+=r.em(o);break}case"codespan":{i+=r.codespan(o);break}case"br":{i+=r.br(o);break}case"del":{i+=r.del(o);break}case"text":{i+=r.text(o);break}default:{let s='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return i}},ai=class{options;block;constructor(t){this.options=t||yt}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?ne.lex:ne.lexInline}provideParser(t=this.block){return t?fe.parse:fe.parseInline}},yb=class{defaults=Os();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=fe;Renderer=na;TextRenderer=Vs;Lexer=ne;Tokenizer=ia;Hooks=ai;constructor(...t){this.use(...t)}walkTokens(t,e){let r=[];for(let i of t)switch(r=r.concat(e.call(this,i)),i.type){case"table":{let n=i;for(let a of n.header)r=r.concat(this.walkTokens(a.tokens,e));for(let a of n.rows)for(let o of a)r=r.concat(this.walkTokens(o.tokens,e));break}case"list":{let n=i;r=r.concat(this.walkTokens(n.items,e));break}default:{let n=i;this.defaults.extensions?.childTokens?.[n.type]?this.defaults.extensions.childTokens[n.type].forEach(a=>{let o=n[a].flat(1/0);r=r.concat(this.walkTokens(o,e))}):n.tokens&&(r=r.concat(this.walkTokens(n.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let a=e.renderers[n.name];a?e.renderers[n.name]=function(...o){let s=n.renderer.apply(this,o);return s===!1&&(s=a.apply(this,o)),s}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[n.level];a?a.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),i.extensions=e),r.renderer){let n=this.defaults.renderer||new na(this.defaults);for(let a in r.renderer){if(!(a in n))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,s=r.renderer[o],c=n[o];n[o]=(...l)=>{let d=s.apply(n,l);return d===!1&&(d=c.apply(n,l)),d||""}}i.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new ia(this.defaults);for(let a in r.tokenizer){if(!(a in n))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,s=r.tokenizer[o],c=n[o];n[o]=(...l)=>{let d=s.apply(n,l);return d===!1&&(d=c.apply(n,l)),d}}i.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new ai;for(let a in r.hooks){if(!(a in n))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,s=r.hooks[o],c=n[o];ai.passThroughHooks.has(a)?n[o]=l=>{if(this.defaults.async&&ai.passThroughHooksRespectAsync.has(a))return(async()=>{let u=await s.call(n,l);return c.call(n,u)})();let d=s.call(n,l);return c.call(n,d)}:n[o]=(...l)=>{if(this.defaults.async)return(async()=>{let u=await s.apply(n,l);return u===!1&&(u=await c.apply(n,l)),u})();let d=s.apply(n,l);return d===!1&&(d=c.apply(n,l)),d}}i.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,a=r.walkTokens;i.walkTokens=function(o){let s=[];return s.push(a.call(this,o)),n&&(s=s.concat(n.call(this,o))),s}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return ne.lex(t,e??this.defaults)}parser(t,e){return fe.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let i={...r},n={...this.defaults,...i},a=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(n.hooks&&(n.hooks.options=n,n.hooks.block=t),n.async)return(async()=>{let o=n.hooks?await n.hooks.preprocess(e):e,s=await(n.hooks?await n.hooks.provideLexer(t):t?ne.lex:ne.lexInline)(o,n),c=n.hooks?await n.hooks.processAllTokens(s):s;n.walkTokens&&await Promise.all(this.walkTokens(c,n.walkTokens));let l=await(n.hooks?await n.hooks.provideParser(t):t?fe.parse:fe.parseInline)(c,n);return n.hooks?await n.hooks.postprocess(l):l})().catch(a);try{n.hooks&&(e=n.hooks.preprocess(e));let o=(n.hooks?n.hooks.provideLexer(t):t?ne.lex:ne.lexInline)(e,n);n.hooks&&(o=n.hooks.processAllTokens(o)),n.walkTokens&&this.walkTokens(o,n.walkTokens);let s=(n.hooks?n.hooks.provideParser(t):t?fe.parse:fe.parseInline)(o,n);return n.hooks&&(s=n.hooks.postprocess(s)),s}catch(o){return a(o)}}}onError(t,e){return r=>{if(r.message+=`
259
+ Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+Ne(r.message+"",!0)+"</pre>";return e?Promise.resolve(i):i}if(e)return Promise.reject(r);throw r}}},wt=new yb;function A(t,e){return wt.parse(t,e)}A.options=A.setOptions=function(t){return wt.setOptions(t),A.defaults=wt.defaults,ff(A.defaults),A};A.getDefaults=Os;A.defaults=yt;function Nb(...t){return wt.use(...t),A.defaults=wt.defaults,ff(A.defaults),A}A.use=Nb;A.walkTokens=function(t,e){return wt.walkTokens(t,e)};A.parseInline=wt.parseInline;A.Parser=fe;A.parser=fe.parse;A.Renderer=na;A.TextRenderer=Vs;A.Lexer=ne;A.lexer=ne.lex;A.Tokenizer=ia;A.Hooks=ai;A.parse=A;var uj=A.options,dj=A.setOptions,fj=A.walkTokens,pj=A.parseInline;var hj=fe.parse,mj=ne.lex;j();ue();V();var Fb=Oe(Se(),1);ye();ue();V();ee();$();Xe();oa();oa();Xt();tt();ye();Ln();j();V();ca();W();$();kf();Xt();tt();qs();ye();ee();qs();Kr();$();var la=class extends Error{constructor(r,i,n){super(r,n);this.preparation=i;this.name="NativeWorkspacePreparationError"}preparation};ye();ee();W();Xt();tt();Wn();Xe();mt();ci();sa();W();Cs();Ss();Xe();mt();j();ht();ci();$();ht();Jt();ee();var Pf=Oe(Se(),1);Ce();var qO=new Set("a an and are as at be by for from in is it of on or that the this to with you your".split(" "));var KO=256*1024;Xe();mt();tt();var Kb=Dn("en",{compact:!0});ee();W();Xt();tt();Xe();mt();ye();Ln();V();ye();Ce();j();var mD=8*1024*1024;ca();W();mt();$();var LD=1024*1024*1024;W();sa();ci();tt();W();tt();W();Ps();var T1=16*1024;Jn();var fa=class extends Error{constructor(r,i,n,a){super(`Canonical spec conflict for ${r}: expected ${i??"(missing)"}, actual ${n??"(missing)"}`);this.capability=r;this.expectedHash=i;this.actualHash=n;this.canonicalPath=a;this.name="NativeSpecConflictError"}capability;expectedHash;actualHash;canonicalPath;code="native-spec-conflict"},pa=class extends Error{constructor(r,i=r.ready?"Native Archive preflight no longer matches the expected hash":`Native Archive preflight is blocked: ${r.findingCodes.join(", ")}`){super(i);this.preflight=r;this.name="NativeArchivePreflightError"}preflight;code="native-archive-preflight"};$();ee();function C(t,e,r){return t==="zh-CN"?r:e}var Gs={shape:{en:"Shape (agreeing on requirements)",zh:"Shape(需求共识)"},build:{en:"Build",zh:"Build(实现)"},verify:{en:"Verify",zh:"Verify(验证)"},archive:{en:"Archive",zh:"Archive(归档)"}};function Tf(t,e){return typeof t=="string"&&Gs[t]?C(e,Gs[t].en,Gs[t].zh):typeof t=="string"?t:""}function Js(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&typeof e.passed=="number"&&typeof e.failed=="number"&&typeof e.blocked=="number"&&typeof e.pending=="number"}function Zb(t){let e={total:t.length,passed:0,failed:0,blocked:0,pending:0};for(let r of t){if(!r||typeof r!="object")return null;let i=r.result;if(i!=="passed"&&i!=="failed"&&i!=="blocked"&&i!=="pending")return null;e[i]+=1}return e}function $f(t,e){let r=[];t.failed>0&&r.push(C(e,`${t.failed} failed`,`${t.failed} 项失败`)),t.blocked>0&&r.push(C(e,`${t.blocked} blocked`,`${t.blocked} 项受阻`)),t.pending>0&&r.push(C(e,`${t.pending} pending`,`${t.pending} 项待验`));let i=C(e,`acceptance ${t.passed}/${t.total} passed`,`验收 ${t.passed}/${t.total} 通过`);return r.length>0?`${i} (${r.join(", ")})`:i}function jf(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;if(typeof e.change!="string"||e.disposition!=="continue"&&e.disposition!=="await-user"&&e.disposition!=="blocked"&&e.disposition!=="done"||e.commandArgs!==null&&e.commandArgs!==void 0&&!Array.isArray(e.commandArgs))return!1;let r=e.userCommunication;return!!(r&&typeof r=="object"&&typeof r.required=="boolean"&&(r.message===null||typeof r.message=="string")&&typeof r.agentInstruction=="string")}function Us(t){return/[\u4e00-\u9fff]/u.test(t.userCommunication.agentInstruction)?"zh-CN":"en"}function ek(t,e,r){return t==="done"?C(r,"complete","已完成"):t==="await-user"?C(r,"waiting for a user decision","等待用户决定"):t==="blocked"?C(r,"paused: needs attention","已暂停,需要处理"):e?C(r,"waiting for a user decision","等待用户决定"):C(r,"ready to continue","可继续推进")}function tk(t,e,r){let i=Us(t),n=[];r&&n.push(r);let a=C(i,`Change ${t.change}`,`需求 ${t.change}`),o=Tf(t.phase,i),s=ek(t.disposition,t.userCommunication.required,i);n.push([a,o||null,s].filter(Boolean).join(" · ")),e&&e.total>0&&n.push($f(e,i));let c=t.userCommunication,l=Of(t,i);return{summary:n.join("; "),...l?{next:l}:{},...c.required&&c.message?{user_message:c.message}:{}}}function Of(t,e){let r=t.userCommunication;if(t.disposition==="await-user"&&r.required)return{ask_user:C(e,"Relay the message below, wait for the user decision, then run the matching option (run with --json to see the exact alternative commands).","先转述下方信息并等待用户选择,再执行对应命令(完整候选命令以 --json 输出为准)。")};if(t.commandArgs&&t.commandArgs.length>0)return{command:t.commandArgs.join(" ")};if(t.disposition==="done")return{ask_user:C(e,"No further workflow action; report the completed change to the user.","工作流已无后续动作;向用户报告该需求已完成即可。")};if(t.disposition==="blocked")return{ask_user:r.required&&r.message?r.agentInstruction:C(e,"Resolve the paused condition before continuing; run with --json for the structured diagnosis.","先解除暂停原因再继续;结构化诊断信息以 --json 输出为准。")}}function rk(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.total=="number"&&Array.isArray(e.items)}function ik(t,e){let r=typeof t.name=="string"?t.name:"(unnamed)",i=Tf(t.phase,e),n=t.status==="await-user"?C(e,"waiting for a user decision","等待用户决定"):t.status==="blocked"?C(e,"paused","已暂停"):t.status==="done"?C(e,"complete","已完成"):C(e,"in progress","进行中"),a=Js(t.acceptance)?`${C(e,", ",",")}${$f(t.acceptance,e)}`:"";return` ${r} · ${i||String(t.phase??"?")} · ${n}${a}`}function nk(t){for(let e of t){let r=e.continuation;if(r?.userCommunication&&typeof r.userCommunication.agentInstruction=="string"&&/[\u4e00-\u9fff]/u.test(r.userCommunication.agentInstruction))return"zh-CN"}return"en"}function ak(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;let e=t;return typeof e.healthy!="boolean"?!1:e.findings===void 0||Array.isArray(e.findings)}function ok(t){if(t.healthy){let i=t.repaired?C("en","Diagnostics passed and the reported problem was repaired automatically.","诊断通过,报告的问题已自动修复。"):C("en","Diagnostics passed: no problems found.","诊断通过:未发现问题。"),n=sk(t.continuation);return n?{summary:i,next:n}:{summary:i}}let r=Array.isArray(t.findings)?t.findings.length:0;return{summary:C("en",r>0?`Diagnostics found ${r} problem${r===1?"":"s"} that need attention before this change can continue.`:"Diagnostics found problems that need attention before this change can continue.",r>0?`诊断发现 ${r} 个需要处理的问题,处理后该需求才能继续。`:"诊断发现需要处理的问题,处理后该需求才能继续。"),next:{ask_user:C("en","Run with --json to read the structured findings; re-run with --repair once the cause is understood.","结构化诊断以 --json 输出为准;确认原因后再用 --repair 修复。")}}}function sk(t){return jf(t)?Of(t,Us(t)):void 0}function Hf(t){if(!t||typeof t!="object"||Array.isArray(t))return;let e=t;if(ak(e))return ok(e);if(rk(e)){let i=nk(e.items);return{summary:[e.total===e.items.length?C(i,`Native changes (${e.total})`,`Native 需求列表(共 ${e.total} 条)`):C(i,`Native changes (showing ${e.items.length} of ${e.total})`,`Native 需求列表(显示 ${e.items.length}/${e.total} 条)`),...e.items.map(a=>ik(a,i))].join(`
260
+ `)}}let r=e.continuation;if(jf(r)){let i=Us(r),n=tk(r,ck(e),uk(e,i));return lk(e)==="unconfirmed"?{...n,summary:`${n.summary}${C(i,"; the dispatched Verifier has not confirmed startup yet — verify the subagent actually launched before waiting on it",";已派发的 Verifier 尚未确认启动——先核实子代理确实启动,再继续等待")}`}:n}if(typeof e.artifactRoot=="string"&&typeof e.nativeRoot=="string"){let i=e.language==="zh-CN"?"zh-CN":"en",n="pendingRootMove"in e;return{summary:C(i,n?`Comet Native artifacts live under ${e.artifactRoot} (state root: ${e.nativeRoot}).`:`Initialized Comet Native at ${e.nativeRoot} (artifacts: ${e.artifactRoot}).`,n?`Comet Native 产物位于 ${e.artifactRoot}(状态根目录:${e.nativeRoot})。`:`Comet Native 已初始化于 ${e.nativeRoot}(产物目录:${e.artifactRoot})。`)}}}function ck(t){if(Js(t.acceptance))return t.acceptance;let e=t.state;if(e&&typeof e=="object"&&!Array.isArray(e)){let r=e;if(Js(r.acceptance))return r.acceptance;if(Array.isArray(r.acceptance))return Zb(r.acceptance)}return null}function lk(t){let e=t.localExecution;if(!e||typeof e!="object"||Array.isArray(e))return;let r=e.verifierStartup;if(!(!r||typeof r!="object"||Array.isArray(r)))return r.confirmation}function uk(t,e){if(t.selected!==void 0&&typeof t.selected=="string")return C(e,`Selected ${t.selected}.`,`已选择需求 ${t.selected}。`);let r=t.migration;return r&&typeof r=="object"&&r.completed===!0?C(e,"Upgraded this change to the current Native format.","已将该需求升级到当前 Native 格式。"):null}function Df(t){let r=t.data&&typeof t.data=="object"&&!Array.isArray(t.data)?t.data:{};switch(t.code){case"document-invalid":return{summary:t.message,...typeof r.change=="string"?{next:{command:`comet native next ${r.change} --summary <summary>`}}:{}};case"conflict":return{summary:C("en","This change was updated elsewhere while the command ran, so the command stopped without changing anything. Nothing was lost — reload the latest state and continue from there.","这条需求刚被另一个会话更新,本次命令未做任何改动。没有工作丢失——重新读取最新状态后继续即可。"),...typeof r.change=="string"?{next:{command:`comet native status ${r.change} --json`}}:{}};case"baseline-incomplete":return{summary:C("en","The safety snapshot for this change exceeded its configured size budget, so the command stopped before changing anything. Raise the snapshot limits in .comet/config.yaml or exclude out-of-scope data, then retry.","该需求的安全快照超出配置的容量预算,命令在改动任何内容前已停止。请在 .comet/config.yaml 中调高快照上限,或将范围外的数据加入排除列表后重试。"),next:{ask_user:C("en","Run with --json to see the exact limits, omitted paths, and supported fixes.","具体上限、被省略的路径和支持的修复方式以 --json 输出为准。")}};case"workspace-isolation-required":return{summary:C("en","This change runs in its own Git worktree to keep work isolated. Create the linked worktree first, then continue inside it.","这条需求需要在独立的 Git worktree 中执行以保证隔离。请先创建关联的 worktree,然后在其中继续。"),next:{ask_user:C("en","Run with --json to see the exact worktree creation command.","完整的 worktree 创建命令以 --json 输出为准。")}};case"workspace-preparation-incomplete":return{summary:C("en","The change workspace is not fully prepared (for example a branch or worktree is missing). Finish the preparation steps, then retry.","需求的工作区尚未准备完成(例如分支或 worktree 缺失)。请先完成准备步骤,再重试。"),next:{ask_user:C("en","Run with --json to see the remaining preparation steps.","剩余的准备步骤以 --json 输出为准。")}};case"implementation-scope-stale":return{summary:C("en","The recorded implementation scope no longer matches the current files. Refresh the scope, then retry.","记录的实现范围与当前文件不再一致。请刷新范围后重试。"),next:{ask_user:C("en","Run with --json to see the exact recovery steps.","具体恢复步骤以 --json 输出为准。")}};default:return}}Vn();Wn();var Lf=["--project-root <path> Resolve the Native project from this working directory.","--json Emit the stable JSON command envelope.","--verbose Append the raw machine projection after the human/agent text.","--help Show help without requiring an initialized project."],Ks=Object.freeze({"":{usage:"comet native <command> [options]",purpose:"Create, inspect, recover, and archive portable Native changes through Runtime-enforced, skill-coordinated steps.",agentQuickStart:["Run `comet native status --json` to discover active changes.","Select an existing change with `select`, or create one with `new`.","In `agent.workspace.cwd`, execute the exact `agent.continuation.commandArgs` returned by Runtime.","Use `agent.continuation.inputOptions` templates for JSON input; do not reconstruct fields from memory."],subcommands:["init Initialize Native project configuration.","root show Inspect the configured artifact root.","root move <artifact-root> Move the configured artifact root.","new <change-name> Create a change and prepare its workspace.","spec disassociate Revoke a capability association through Runtime.","spec remove Record a complete capability removal intent.","spec sync <change-name> <capability> --input <json-file> Audit local Markdown reference corrections.","show <change-name> Read formal artifacts and portable state.","status [<change-name>] Discover stable boundaries and Runner actions.","select <change-name> Select a change in its bound workspace.","next <change-name> Confirm or recover a stable workflow boundary.","archive <change-name> Preview and execute Archive plus workspace finish.","doctor [<change-name>] Diagnose, migrate, or rebuild local execution state."],options:Lf,output:"A human summary plus a NEXT step by default (RELAY TO USER blocks carry user decisions); use --json for the structured envelope, --verbose to append the raw machine projection.",examples:["comet native status --json","comet native status my-change --details --json","comet native next --help"]},init:{usage:"comet native init [--root <artifact-root>] [--language en|zh-CN]",purpose:"Create or normalize .comet/config.yaml and the configured Native directories.",options:["--root <artifact-root> Project-relative artifact root; defaults to docs.","--language en|zh-CN Language for newly generated Native artifacts."],output:"The resolved project configuration and Native paths.",examples:["comet native init --root docs --language zh-CN"]},root:{usage:"comet native root <show|move> [arguments]",purpose:"Inspect or transactionally move the configured Native artifact root.",subcommands:["show Print the configured artifact root and resolved paths.","move <artifact-root> Move Native artifacts and update project configuration."],output:"The current root projection or the completed move result.",examples:["comet native root show","comet native root move artifacts/native"]},"root show":{usage:"comet native root show",purpose:"Print the configured Native artifact root and resolved paths.",output:"The configured artifact root and resolved Native paths."},"root move":{usage:"comet native root move <artifact-root>",purpose:"Transactionally move Native artifacts and update project configuration.",output:"The source, destination, and committed root-move transaction result.",examples:["comet native root move artifacts/native"]},new:{usage:"comet native new <change-name> [--language en|zh-CN] [--task <text>] [--capability <id>] [--isolation current|branch|worktree] [--change-branch <branch>] [--target-branch <branch>] [--worktree-path <path>]",purpose:"Create a portable Native change and prepare the requested branch or linked worktree.",options:["--language en|zh-CN Artifact language; defaults to project configuration.","--task <text> Search Project Knowledge for an existing capability and save a revocable association draft.","--capability <id> Directly validate and associate an existing capability without retrieval.","--isolation <kind> current, branch, or worktree; defaults to current.","--change-branch <branch> Change branch; defaults to comet/<change-name>.","--target-branch <branch> Local base branch; defaults to the current branch.","--worktree-path <path> Worktree directory; defaults to .worktrees/<change-name>."],output:"The portable state, canonical artifact paths, workspace preparation result, and continuation with the next Runner action.",examples:["comet native new session-timeout --language zh-CN",'comet native new add-sms-login --task "add SMS login to authentication"',"comet native new session-timeout --isolation branch --target-branch main","comet native new session-timeout --isolation worktree --target-branch main"]},spec:{usage:`comet native spec disassociate <change-name> --expected-state-version <n> --expected-action disassociate-capability
184
261
  comet native spec remove <change-name> <capability>
185
262
  comet native spec sync <change-name> <capability> --input <json-file>`,purpose:"Record a capability removal; create and modify intents use complete proposed Spec files.",subcommands:["disassociate <change-name> Revoke a capability association and return to Shape.","remove <change-name> <capability> Record a capability removal.","sync <change-name> <capability> --input <json-file> Audit local Markdown reference corrections without changing prose or acceptance."],output:"The updated portable state and continuation."},"spec remove":{usage:"comet native spec remove <change-name> <capability>",purpose:"Record removal of a capability in the complete target specification.",output:"The updated portable state and continuation with the next Runner action."},"spec disassociate":{usage:"comet native spec disassociate <change-name> --expected-state-version <n> --expected-action disassociate-capability",purpose:"Revoke a capability association through Runtime without hand-editing artifacts.",options:["--expected-state-version <n> State version returned by the latest status response.","--expected-action <action> Must be disassociate-capability."],output:"The updated portable state and continuation with the next Runner action."},"spec sync":{usage:"comet native spec sync <change-name> <capability> --input <json-file>",purpose:"Sync local Markdown link destinations in an already confirmed target spec; semantic edits require Shape.",options:["--input <json-file> Fields: expectedStateVersion, actor, reason, affectedAcceptanceIds, replacements [{from,to}]. Include all acceptance IDs from the affected spec."],output:"The audited portable state, preserved unaffected acceptance results and Build continuation for re-verification."},show:{usage:"comet native show <change-name>",purpose:"Read formal artifacts and portable state for one Native change.",output:"A compact summary and NEXT action by default. Use --json to read canonical artifact paths, the portable state, brief, complete proposed Specs, and continuation; legacy state is reported as migration-required. Fill command-template placeholders before executing NEXT commands."},check:{usage:"comet native check <change-name>",purpose:"Legacy-only verification command; not supported for current portable changes.",output:"For current changes, run comet native status <change-name> --json and follow the continuation to dispatch verification through comet native next."},status:{usage:"comet native status [<change-name>] [--cursor <token>] [--details]",purpose:"Discover portable stable boundaries, parent child readiness, or the exact next Runner action.",options:["--cursor <token> Continue a status-list page, or a named details/history page.","--details Include one fixed-size page of acceptance, Spec, handoff, verification, history, workspace, and report details."],output:"A compact v2 status page or one compact Loop projection with canonical artifact paths and local execution availability. Use --details and --cursor to read fixed-size detail pages; parent changes expose childSummary and readyChildren.",examples:["comet native status --json","comet native status session-timeout --details --json"]},select:{usage:"comet native select <change-name>",purpose:"Select one Native change after validating its workspace binding.",output:"The selected change record."},next:{usage:`comet native next <change-name> --summary <text> [--coordination-mode multi-session|single-session] [--max-parallel <n>] [--expected-state-version <n>] [--expected-action <action>]
186
263
  comet native next <change-name> --summary <text> [--confirmed|--accept-result|--revise-implementation|--revise-requirements|--retry-verifier|--resolve-verifier-blocker] [--expected-state-version <n>] [--expected-action <action>]
187
- comet native next <change-name> --runner-input <json-file> [--validate-only]`,purpose:"Confirm or recover an Agent boundary, advance parent child changes, handle Supervisor task operations, or use one skill-coordinated JSON bridge for Builder handoff, check-plan dispatch, and Verifier response/error.",options:["--summary <text> Required transition or recovery summary.","--confirmed Confirm the persisted Shape boundary with both expected guards, or confirm an explicitly degraded verifier-unavailable fallback before Archive.","--coordination-mode multi-session|single-session Select how a multi-child Supervisor proceeds while preparing its Shape confirmation; final Shape confirmation is a later, separate step.","--accept-result Accept the current skill-coordinated Verify result and make it archive-ready.","--revise-implementation Keep confirmed requirements unchanged and return Verify to Build for implementation revision.","--revise-requirements Return Verify or Archive to Shape when user-visible goals or acceptance criteria must change.","--retry-verifier Retry a failed or unavailable Verifier when the continuation allows it.","--resolve-verifier-blocker Resolve a semantic Verifier blocker without changing the candidate, then dispatch a new attempt.","--max-parallel <n> Supervisor task concurrency cap; defaults to 2, use 1 for serial fallback.","--expected-state-version <n> Continuation-issued guard that rejects stale public transition decisions.","--expected-action <action> Continuation-issued guard that binds the public transition decision to its intended action.","--runner-input <file> Skill-coordinated JSON: builder-handoff, dispatch-verifier, retry-checks, verifier-response, verifier-started, verifier-execution-error, or verifier-unavailable. Builder/dispatch identity fields are rejected; verifier responses must echo the current candidateId and verifierExecutionRef from the Verifier dispatch.","--validate-only Validate the Runner JSON shape and current boundary without writing state or starting a process; requires --runner-input."," Choose one object template from an inputOptions exclusiveGroup and save it as UTF-8 JSON (BOM accepted). Field errors return issues with JSON pointer, missingFields and unknownFields. Execute agent.continuation in agent.workspace.cwd; Supervisor results use task.returnAction."," builder-handoff fields: kind, summary, addressed_acceptance_ids, checks, verification_checks, known_limits, optional review. checks summarize development feedback. verification_checks is an optional Runtime plan executed after the candidate is frozen; a passing plan is reused without executing the same plan twice when dispatch-verifier receives the unchanged plan. If review is supplied, its fields are status=passed, summary, reviewer_execution_ref from a separate read-only review."," dispatch-verifier fields: kind, checks (an explicitly resolved plan; [] is allowed)."," retry-checks fields: kind, check_ids for repeatable interrupted Runtime checks from the current candidate; each check can be retried at most three times."," verifier-response fields: kind, candidateId, verifierExecutionRef, response (request-checks or final-result); copy the two binding fields from the current continuation."," verifier-started fields: kind, candidateId, verifierExecutionRef copied from verifierDispatch; the dispatched Verifier submits it as its first Runtime action so status can distinguish a registered dispatch from a Verifier that actually started. Repeating it is accepted without side effects."," verifier-execution-error fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch."," verifier-unavailable fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch; accepted only after the explicit Runtime check plan completed and passed."," Supervisor task fields: supervisor-builder-result (child, runId, candidateCommit), supervisor-builder-failure (child, runId, reason), supervisor-verifier-result (child, runId, verdict, verification data), supervisor-reconnect (child, runId), supervisor-cancel (child, runId, reason), or supervisor-integrate (child, checks)."," supervisor-checks fields: kind, child, runId, checks (non-empty repeatable Runtime check plans), materials [{name,content}], and optional retry_check_ids for interrupted checks from the same candidate, machine and workspace. Returns per-check execution state plus operationId, status and receiptRef. Repeated running plans return the same handle."," supervisor-verifier-result evidence fields: summary, checks (informal notes), acceptance [{id,result,reason}], receiptRef. verdict is pass, fail or blocked; every task acceptance ID must appear exactly once. Runtime receipts determine formal check status; receiptRef may be null for fail or blocked."," supervisor-integrate checks are non-empty Runtime check plans executed after the merge in the integration worktree, not declared statuses."],output:'A compact portable state summary, explicit skill-coordinated label, Runtime-owned check results, scoped verifierDispatch, bounded request-check response, continuation.runnerAction, machine-readable continuation.inputOptions, and continuation.userCommunication with a user-ready message and Agent relay guidance. Read acceptance text and other long fields from paged status --details output. Human-readable verification statuses include "Host independently verified", "Checks completed, but your confirmation is required", "Full verification was unavailable; only automatic checks completed", and "You accepted the incomplete verification result". This generic bridge is not trusted identity attestation: a passing result waits for explicit user confirmation before Archive.',examples:['comet native next session-timeout --summary "Shape confirmed" --confirmed --expected-state-version <n> --expected-action confirm-shape','comet native next session-timeout --summary "Current result accepted" --accept-result','comet native next session-timeout --summary "Implementation needs revision" --revise-implementation','comet native next session-timeout --summary "Acceptance criteria changed" --revise-requirements','comet native next session-timeout --summary "Retry verifier infrastructure" --retry-verifier','comet native next session-timeout --summary "Retry semantic verification" --resolve-verifier-blocker',"comet native next session-timeout --runner-input <temporary-json-file>"]},archive:{usage:`comet native archive <change-name> --dry-run [--finish merge|push|pull-request|keep]
188
- comet native archive <change-name> [--confirmed] [--serial-first <current-change>]`,purpose:"Preview or execute deterministic Archive after the portable state reaches archive-ready.",options:["--dry-run Run the complete read-only Archive and workspace-finish readiness check; it persists only an explicit --finish choice.","--finish <action> Persist merge, push, pull-request, or keep for an isolated workspace.","--serial-first <current-change> During execution only, confirm that this change archives before detected capability peers; the value must equal <change-name>.","--confirmed Confirm Archive when project policy requires it."],output:"Readiness, every blocker, and the exact next continuation, or the completed Archive transaction and workspace finish result. Execute the returned confirmed command only after ready is true; Archive does not repeat verification."},doctor:{usage:"comet native doctor [<change-name>] [--repair]",purpose:"Inspect portable state, migrate a legacy active change, or rebuild its local execution overlay.",options:["--repair Apply deterministic migration or rebuild from the portable stable boundary."],output:"Health, migration or recovery details, and the continuation with the next Runner action."}});function On(t,e){return`${t}:
264
+ comet native next <change-name> --runner-input <json-file> [--validate-only]`,purpose:"Confirm or recover an Agent boundary, advance parent child changes, handle Supervisor task operations, or use one skill-coordinated JSON bridge for Builder handoff, check-plan dispatch, and Verifier response/error.",options:["--summary <text> Required transition or recovery summary.","--confirmed Confirm the persisted Shape boundary with both expected guards, or confirm an explicitly degraded verifier-unavailable fallback before Archive.","--coordination-mode multi-session|single-session Choose how a multi-child Supervisor proceeds. Supply it with --confirmed at the persisted Shape boundary to confirm the full plan and mode together, or select it during preparation and confirm the plan afterward.","--accept-result Accept the current skill-coordinated Verify result and make it archive-ready.","--finish keep|merge|push|pull-request With --accept-result, record the explicitly chosen isolated-workspace finish in the same guarded decision.","--revise-implementation Keep confirmed requirements unchanged and return Verify to Build for implementation revision.","--revise-requirements Return Verify or Archive to Shape when user-visible goals or acceptance criteria must change.","--retry-verifier Retry a failed or unavailable Verifier when the continuation allows it.","--resolve-verifier-blocker Resolve a semantic Verifier blocker without changing the candidate, then dispatch a new attempt.","--max-parallel <n> Supervisor task concurrency cap; defaults to 2, use 1 for serial fallback.","--expected-state-version <n> Continuation-issued guard that rejects stale public transition decisions.","--expected-action <action> Continuation-issued guard that binds the public transition decision to its intended action.","--runner-input <file> Skill-coordinated JSON: builder-handoff, dispatch-verifier, retry-checks, verifier-response, verifier-started, verifier-execution-error, or verifier-unavailable. Builder/dispatch identity fields are rejected; verifier responses must echo the current candidateId and verifierExecutionRef from the Verifier dispatch.","--validate-only Validate the Runner JSON shape and current boundary without writing state or starting a process; requires --runner-input."," Choose one object template from an inputOptions exclusiveGroup and save it as UTF-8 JSON (BOM accepted). Field errors return issues with JSON pointer, missingFields and unknownFields. Execute agent.continuation in agent.workspace.cwd; Supervisor results use task.returnAction."," builder-handoff fields: kind, summary, addressed_acceptance_ids, acceptance_review, checks, verification_checks, known_limits, optional review. acceptance_review must cover every confirmed ID exactly once with id, status, evidence (concrete references or observations), and note. Only implemented-with-evidence with nonempty evidence is ready for handoff; implemented-no-evidence, not-implemented, and known-fail remain in Build. This Builder declaration does not replace independent verification. checks summarize development feedback. verification_checks is an optional Runtime plan executed after the candidate is frozen; a passing plan returns the Verifier dispatch immediately. Completed Runtime checks can carry to a new candidate only when the implementation, confirmed documents, plan, workspace, environment, and saved evidence still match. If review is supplied, its fields are status=passed, summary, reviewer_execution_ref from a separate read-only review."," dispatch-verifier fields: kind, checks (an explicitly resolved plan; [] is allowed)."," retry-checks fields: kind, check_ids for repeatable interrupted Runtime checks from the current candidate; each check can be retried at most three times."," verifier-response fields: kind, candidateId, verifierExecutionRef, response (request-checks or final-result); copy the two binding fields from the current continuation."," verifier-started fields: kind, candidateId, verifierExecutionRef copied from verifierDispatch; the dispatched Verifier submits it as its first Runtime action so status can distinguish a registered dispatch from a Verifier that actually started. Repeating it is accepted without side effects."," verifier-execution-error fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch."," verifier-unavailable fields: kind, summary, stateVersion, iteration, attempt, verifierExecutionRef copied from verifierDispatch; accepted only after the explicit Runtime check plan completed and passed."," Supervisor task fields: supervisor-builder-result (child, runId, candidateCommit), supervisor-builder-failure (child, runId, reason), supervisor-verifier-result (child, runId, verdict, verification data), supervisor-reconnect (child, runId), supervisor-cancel (child, runId, reason), or supervisor-integrate (child, checks)."," supervisor-checks fields: kind, child, runId, checks (non-empty repeatable Runtime check plans), materials [{name,content}], and optional retry_check_ids for interrupted checks from the same candidate, machine and workspace. Returns per-check execution state plus operationId, status and receiptRef. Repeated running plans return the same handle."," supervisor-verifier-result evidence fields: summary, checks (informal notes), acceptance [{id,result,reason}], receiptRef. verdict is pass, fail or blocked; every task acceptance ID must appear exactly once. Runtime receipts determine formal check status; receiptRef may be null for fail or blocked."," supervisor-integrate checks are non-empty Runtime check plans executed after the merge in the integration worktree, not declared statuses."],output:'A compact portable state summary, explicit skill-coordinated label, Runtime-owned check results, scoped verifierDispatch, bounded request-check response, continuation.runnerAction, machine-readable continuation.inputOptions, and continuation.userCommunication with a user-ready message and Agent relay guidance. Read acceptance text and other long fields from paged status --details output. Human-readable verification statuses include "Host independently verified", "Checks completed, but your confirmation is required", "Full verification was unavailable; only automatic checks completed", and "You accepted the incomplete verification result". This generic bridge is not trusted identity attestation: a passing result waits for explicit user confirmation before Archive.',examples:['comet native next session-timeout --summary "Shape confirmed" --confirmed --expected-state-version <n> --expected-action confirm-shape','comet native next session-timeout --summary "Current result accepted" --accept-result','comet native next session-timeout --summary "Implementation needs revision" --revise-implementation','comet native next session-timeout --summary "Acceptance criteria changed" --revise-requirements','comet native next session-timeout --summary "Retry verifier infrastructure" --retry-verifier','comet native next session-timeout --summary "Retry semantic verification" --resolve-verifier-blocker',"comet native next session-timeout --runner-input <temporary-json-file>"]},archive:{usage:`comet native archive <change-name> --dry-run [--finish merge|push|pull-request|keep] [--commit-message <text>] [--merge-message <text>]
265
+ comet native archive <change-name> [--confirmed] [--serial-first <current-change>] [--commit-message <text>] [--merge-message <text>]`,purpose:"Preview or execute deterministic Archive after the portable state reaches archive-ready.",options:["--dry-run Run the complete read-only Archive and workspace-finish readiness check; it persists only an explicit --finish choice.","--finish <action> Persist merge, push, pull-request, or keep for an isolated workspace.","--expected-state-version <n> Preserve this continuation-issued guard when confirming a new finish choice; stale choices are rejected before it is recorded.","--commit-message <text> Set the archive commit message; Unicode and multiline text are supported. Git hooks still run.","--merge-message <text> Set the local merge commit message; requires merge finish. Omit it to use Git defaults.","--serial-first <current-change> During execution only, confirm that this change archives before detected capability peers; the value must equal <change-name>.","--confirmed Confirm Archive when project policy requires it."],output:"Readiness, every blocker, actual prepared commitMessages (mergeMessage is null when no merge is planned), and the exact next continuation, or the completed Archive transaction and workspace finish result. Messages are retained for retries. After a Git hook rejects a message, provide a corrected message with --confirmed for the unfinished step; completed commits are never rewritten. Execute the returned confirmed command only after ready is true; Archive does not repeat verification."},doctor:{usage:"comet native doctor [<change-name>] [--repair]",purpose:"Inspect portable state, migrate a legacy active change, or rebuild its local execution overlay.",options:["--repair Apply deterministic migration or rebuild from the portable stable boundary."],output:"Health, migration or recovery details, and the continuation with the next Runner action."}});function ha(t,e){return`${t}:
189
266
  ${e.map(r=>` ${r}`).join(`
190
- `)}`}function qy(t){let e=t.filter(i=>i!=="--help");if(e.length===0)return"";let r=e.slice(0,2).join(" ");return cs[r]||e.length>1&&cs[e[0]]?.subcommands?r:e[0]}function Wy(t=[]){let e=qy(t),r=cs[e];if(!r)throw new Error(`Unknown Native help topic: ${e}`);let i=[`Usage: ${r.usage}`,"",r.purpose];r.agentQuickStart&&i.push("",On("Agent Quick Start",r.agentQuickStart)),r.subcommands&&i.push("",On("Commands",r.subcommands));let n=e===""?r.options:[...r.options??[],...Rd];return n&&n.length>0&&i.push("",On("Options",n)),i.push("",`Output:
191
- ${r.output}`),r.examples&&i.push("",On("Examples",r.examples)),e===""&&i.push("","Run `comet native <command> --help` for command-specific details."),{topic:e,usage:`${i.join(`
267
+ `)}`}function dk(t){let e=t.filter(i=>i!=="--help");if(e.length===0)return"";let r=e.slice(0,2).join(" ");return Ks[r]||e.length>1&&Ks[e[0]]?.subcommands?r:e[0]}function fk(t=[]){let e=dk(t),r=Ks[e];if(!r)throw new Error(`Unknown Native help topic: ${e}`);let i=[`Usage: ${r.usage}`,"",r.purpose];r.agentQuickStart&&i.push("",ha("Agent Quick Start",r.agentQuickStart)),r.subcommands&&i.push("",ha("Commands",r.subcommands));let n=e===""?r.options:[...r.options??[],...Lf];return n&&n.length>0&&i.push("",ha("Options",n)),i.push("",`Output:
268
+ ${r.output}`),r.examples&&i.push("",ha("Examples",r.examples)),e===""&&i.push("","Run `comet native <command> --help` for command-specific details."),{topic:e,usage:`${i.join(`
192
269
  `)}
193
- `}}var zy=Wy().usage;var AD=10*1024*1024,Ue=class extends Error{};function us(t,e){let r=t.flatMap((i,n)=>i===e?[n]:[]);if(r.length>1)throw new Ue(`${e} may only be provided once`);return r.length===0?!1:(t.splice(r[0],1),!0)}function Gr(t,e){let r=t.flatMap((a,o)=>a===e?[o]:[]);if(r.length>1)throw new Ue(`${e} may only be provided once`);if(r.length===0)return;let i=r[0],n=t[i+1];if(n===void 0||n.startsWith("--"))throw new Ue(`${e} requires a value`);return t.splice(i,2),n}function Ad(t){if(t.length>0)throw new Ue(`Unexpected argument: ${t[0]}`)}function Id(t,e="en"){let r=Gr(t,"--language")??e;if(r!=="en"&&r!=="zh-CN")throw new Ue("--language must be en or zh-CN");return r}function ls(t,e){let r=zr.normalize(_d(t)),i=zr.normalize(_d(e));return process.platform==="win32"?r.toLowerCase()===i.toLowerCase():r===i}function _d(t){let e=zr.resolve(t);try{return Gy.native(e)}catch{return e}}function Jy(t){let e=zr.resolve(t),r=be(process.cwd());if(!r.isSecondaryWorktree||r.currentWorktreeRoot===null||r.primaryWorktreeRoot===null)return e;let i=be(e);return!i.isGitWorktree||i.currentWorktreeRoot===null||i.primaryWorktreeRoot===null||!ls(r.primaryWorktreeRoot,i.primaryWorktreeRoot)||ls(r.currentWorktreeRoot,i.currentWorktreeRoot)?e:ls(process.cwd(),r.currentWorktreeRoot)?zr.resolve(process.cwd()):r.currentWorktreeRoot}async function Td(t){return t?Jy(t):Ho(process.cwd())}function $d(t){return JSON.stringify(t,null,2)+`
194
- `}function jd(t,e,r){return{command:t,exitCode:0,data:e,text:r??$d(e)}}function Uy(t,e){if(e instanceof Pn)return{command:t,exitCode:65,error:{code:"invalid-data",message:e.message,issues:e.issues}};if(e instanceof Ue)return{command:t,exitCode:64,error:{code:"usage",message:e.message}};if(e instanceof $n)return{command:t,exitCode:73,data:{capability:e.capability,expectedHash:e.expectedHash,actualHash:e.actualHash,canonicalPath:e.canonicalPath},error:{code:"conflict",message:e.message}};if(e instanceof jn)return{command:t,exitCode:73,data:e.preflight,error:{code:"conflict",message:e.message}};if(e instanceof Nn)return{command:t,exitCode:73,data:{change:e.change,expectedRevision:e.expectedRevision,actualRevision:e.actualRevision,outcome:"revision-conflict"},error:{code:"conflict",message:e.message}};if(e instanceof jr)return{command:t,exitCode:73,data:{requestedIsolation:e.requestedIsolation,activeChanges:e.activeChanges,requiredAction:"create-native-worktree"},error:{code:"workspace-isolation-required",message:e.message}};if(e instanceof An)return{command:t,exitCode:73,data:{preparation:e.preparation},error:{code:"workspace-preparation-incomplete",message:e.message}};if(e instanceof bn)return{command:t,exitCode:65,data:{change:e.change,complete:!1,omittedCount:e.omittedCount,omittedByReason:e.omittedByReason,samplePaths:e.samplePaths,sampleTruncated:e.sampleTruncated,effectiveLimits:e.effectiveLimits,policyHash:e.policyHash,configPath:".comet/config.yaml",supportedFixes:["increase native.snapshot.max_files, native.snapshot.max_total_bytes, or native.snapshot.max_duration_ms","add an explicit native.snapshot.exclude pattern for data outside implementation scope"],requiredAction:"resolve-native-baseline"},error:{code:"baseline-incomplete",message:e.message}};if(e instanceof xn)return{command:t,exitCode:65,data:{receiptBindingFailures:e.details},error:{code:"invalid-data",message:e.message}};if(e instanceof Dr)return{command:t,exitCode:65,data:e.recovery,error:{code:"implementation-scope-stale",message:e.message}};if(e instanceof Error){let r=e.code;if(r&&new Set(["EACCES","EPERM","EIO","EMFILE","ENFILE","ENOSPC","EROFS"]).has(r))return{command:t,exitCode:70,error:{code:"internal",message:e.message}};let i=/\b(lock|transaction|conflict|occupied|incomplete|recovery)\b/iu.test(e.message);return{command:t,exitCode:i?73:65,error:{code:i?"conflict":"invalid-data",message:e.message}}}return{command:t,exitCode:70,error:{code:"internal",message:String(e)}}}function Od(t,e){let r=Uy(t,e),i=r.error;if(!i)return r;let n=Pd({code:i.code,message:i.message,data:r.data});return n?{...r,envelope:n}:r}function Ky(t,e,r=!1){let i=t.envelope??Cd(t.data);return e?{exitCode:t.exitCode,stdout:JSON.stringify({command:t.command,exitCode:t.exitCode,agent:Pu(t.data,t.executionCwd),...i===void 0?{}:{summary:i.summary,...i.next===void 0?{}:{next:i.next},...i.user_message===void 0?{}:{user_message:i.user_message}},...t.data===void 0?{}:{data:t.data},...t.error===void 0?{}:{error:t.error}})+`
195
- `}:t.error?{exitCode:t.exitCode,stderr:i?Au(i,t.error.message,r?t.data:void 0):t.error.message}:i?{exitCode:t.exitCode,stdout:_u(i,r?t.data:void 0)}:r&&t.text!==void 0&&t.data!==void 0&&t.text!==$d(t.data)?{exitCode:t.exitCode,stdout:`${t.text}
196
- ${ke.details}
270
+ `}}var pk=fk().usage;var qB=10*1024*1024,rt=class extends Error{};function Xs(t,e){let r=t.flatMap((i,n)=>i===e?[n]:[]);if(r.length>1)throw new rt(`${e} may only be provided once`);return r.length===0?!1:(t.splice(r[0],1),!0)}function vi(t,e){let r=t.flatMap((a,o)=>a===e?[o]:[]);if(r.length>1)throw new rt(`${e} may only be provided once`);if(r.length===0)return;let i=r[0],n=t[i+1];if(n===void 0||n.startsWith("--"))throw new rt(`${e} requires a value`);return t.splice(i,2),n}function Mf(t){if(t.length>0)throw new rt(`Unexpected argument: ${t[0]}`)}function Ff(t,e="en"){let r=vi(t,"--language")??e;if(r!=="en"&&r!=="zh-CN")throw new rt("--language must be en or zh-CN");return r}function Ys(t,e){let r=mi.normalize(Bf(t)),i=mi.normalize(Bf(e));return process.platform==="win32"?r.toLowerCase()===i.toLowerCase():r===i}function Bf(t){let e=mi.resolve(t);try{return hk.native(e)}catch{return e}}function mk(t,e){let r=mi.resolve(e,t),i=_e(e);if(!i.isSecondaryWorktree||i.currentWorktreeRoot===null||i.primaryWorktreeRoot===null)return r;let n=_e(r);return!n.isGitWorktree||n.currentWorktreeRoot===null||n.primaryWorktreeRoot===null||!Ys(i.primaryWorktreeRoot,n.primaryWorktreeRoot)||Ys(i.currentWorktreeRoot,n.currentWorktreeRoot)?r:Ys(e,i.currentWorktreeRoot)?mi.resolve(e):i.currentWorktreeRoot}async function Vf(t,e=process.cwd()){return t?mk(t,e):ms(e)}function qf(t,e){return t==="status"||t==="show"||t==="root"&&e[0]==="show"}function Wf(t){return JSON.stringify(t,null,2)+`
271
+ `}function zf(t,e,r){return{command:t,exitCode:0,data:e,text:r??Wf(e)}}function vk(t,e){if(e instanceof ei)return{command:t,exitCode:65,data:{change:e.change,findings:e.findings},error:{code:"document-invalid",message:e.message}};if(e instanceof qn)return{command:t,exitCode:65,data:{builderReadiness:{ready:!1,missingIds:e.missingIds,incompleteIds:e.incompleteIds}},error:{code:"invalid-data",message:e.message}};if(e instanceof Fn)return{command:t,exitCode:65,error:{code:"invalid-data",message:e.message,issues:e.issues}};if(e instanceof rt)return{command:t,exitCode:64,error:{code:"usage",message:e.message}};if(e instanceof fa)return{command:t,exitCode:73,data:{capability:e.capability,expectedHash:e.expectedHash,actualHash:e.actualHash,canonicalPath:e.canonicalPath},error:{code:"conflict",message:e.message}};if(e instanceof pa)return{command:t,exitCode:73,data:e.preflight,error:{code:"conflict",message:e.message}};if(e instanceof Kn)return{command:t,exitCode:73,data:{change:e.change,expectedRevision:e.expectedRevision,actualRevision:e.actualRevision,outcome:"revision-conflict"},error:{code:"conflict",message:e.message}};if(e instanceof Zr)return{command:t,exitCode:73,data:{requestedIsolation:e.requestedIsolation,activeChanges:e.activeChanges,requiredAction:"create-native-worktree"},error:{code:"workspace-isolation-required",message:e.message}};if(e instanceof la)return{command:t,exitCode:73,data:{preparation:e.preparation},error:{code:"workspace-preparation-incomplete",message:e.message}};if(e instanceof Yn)return{command:t,exitCode:65,data:{change:e.change,complete:!1,omittedCount:e.omittedCount,omittedByReason:e.omittedByReason,samplePaths:e.samplePaths,sampleTruncated:e.sampleTruncated,effectiveLimits:e.effectiveLimits,policyHash:e.policyHash,configPath:".comet/config.yaml",supportedFixes:["increase native.snapshot.max_files, native.snapshot.max_total_bytes, or native.snapshot.max_duration_ms","add an explicit native.snapshot.exclude pattern for data outside implementation scope"],requiredAction:"resolve-native-baseline"},error:{code:"baseline-incomplete",message:e.message}};if(e instanceof ea)return{command:t,exitCode:65,data:{receiptBindingFailures:e.details},error:{code:"invalid-data",message:e.message}};if(e instanceof ii)return{command:t,exitCode:65,data:e.recovery,error:{code:"implementation-scope-stale",message:e.message}};if(e instanceof Error){let r=e.code;if(r&&new Set(["EACCES","EPERM","EIO","EMFILE","ENFILE","ENOSPC","EROFS"]).has(r))return{command:t,exitCode:70,error:{code:"internal",message:e.message}};let i=/\b(lock|transaction|conflict|occupied|incomplete|recovery)\b/iu.test(e.message);return{command:t,exitCode:i?73:65,error:{code:i?"conflict":"invalid-data",message:e.message}}}return{command:t,exitCode:70,error:{code:"internal",message:String(e)}}}function Gf(t,e){let r=vk(t,e),i=r.error;if(!i)return r;let n=Df({code:i.code,message:i.message,data:r.data});return n?{...r,envelope:n}:r}function gk(t,e,r=!1){let i=t.envelope??Hf(t.data);return e?{exitCode:t.exitCode,stdout:JSON.stringify({command:t.command,exitCode:t.exitCode,agent:Nd(t.data,t.executionCwd),...i===void 0?{}:{summary:i.summary,...i.next===void 0?{}:{next:i.next},...i.user_message===void 0?{}:{user_message:i.user_message}},...t.data===void 0?{}:{data:t.data},...t.error===void 0?{}:{error:t.error}})+`
272
+ `}:t.error?{exitCode:t.exitCode,stderr:i?Sd(i,t.error.message,r?t.data:void 0):t.error.message}:i?{exitCode:t.exitCode,stdout:kd(i,r?t.data:void 0)}:r&&t.text!==void 0&&t.data!==void 0&&t.text!==Wf(t.data)?{exitCode:t.exitCode,stdout:`${t.text}
273
+ ${Ae.details}
197
274
  ${JSON.stringify(t.data,null,2)}
198
- `}:{exitCode:t.exitCode,stdout:t.text}}function Yy(t,e,r=!1){let i=Ky(t,e,r),n=!1;if(i.stdout?.trim())try{let a=JSON.parse(i.stdout);n=!!a&&typeof a=="object"&&!Array.isArray(a)}catch{n=!1}return{output:i,structuredDataVisible:n}}function Hd(t,e,r=!1){return Yy(t,e,r).output}async function Dd(t,e){let r=Gr(t,"--root"),i=await ne(e),n=Id(t,i?.native.language??"en");if(Ad(t),i?.native.pending_root_move)throw new Error(`Native root move ${i.native.pending_root_move.id} is incomplete`);let a=Pr(r??i?.native.artifact_root??"docs");if(i&&r&&i.native.artifact_root!==a)throw new Error(`Configured Native artifact root is ${i.native.artifact_root}; refusing conflicting root ${a}`);let o=i?{...i,native:{...i.native,language:n,snapshot:{...i.native.snapshot,exclude:bu(i.native.snapshot.exclude)}}}:ku(a,n),s=await nt(e,o.native.artifact_root);return await Nu(s),await Fo(e),await Rr(e,o),jd("init",{projectRoot:e,artifactRoot:o.native.artifact_root,nativeRoot:s.nativeRoot,language:n},`Initialized Comet Native at ${s.nativeRoot}
199
- `)}async function Ld(t,e,r=process.argv.slice(2)){let i=r.indexOf("--"),n=i<0?[...r]:r.slice(0,i),a=i<0?[]:r.slice(i),o=n.includes("--json"),s=n.includes("--verbose"),c,l;try{us(n,"--json"),us(n,"--verbose"),c=Gr(n,"--project-root");let u=[...n,...a],f=await Td(c);l={executionCwd:f,...await e(u,f)}}catch(u){l=Od(t,u)}let d=Hd(l,o,s);return d.stdout&&process.stdout.write(d.stdout),d.stderr&&process.stderr.write(d.stderr+(d.stderr.endsWith(`
275
+ `}:{exitCode:t.exitCode,stdout:t.text}}function wk(t,e,r=!1){let i=gk(t,e,r),n=!1;if(i.stdout?.trim())try{let a=JSON.parse(i.stdout);n=!!a&&typeof a=="object"&&!Array.isArray(a)}catch{n=!1}return{output:i,structuredDataVisible:n}}function Jf(t,e,r=!1){return wk(t,e,r).output}async function Uf(t,e){let r=vi(t,"--root"),i=await le(e),n=Ff(t,i?.native.language??"en");if(Mf(t),i?.native.pending_root_move)throw new Error(`Native root move ${i.native.pending_root_move.id} is incomplete`);let a=Wr(r??i?.native.artifact_root??"docs");if(i&&r&&i.native.artifact_root!==a)throw new Error(`Configured Native artifact root is ${i.native.artifact_root}; refusing conflicting root ${a}`);let o=i?{...i,native:{...i.native,language:n,snapshot:{...i.native.snapshot,exclude:cd(i.native.snapshot.exclude)}}}:ld(a,n),s=await ft(e,o.native.artifact_root);return await sd(s),await ys(e),await zr(e,o),zf("init",{projectRoot:e,artifactRoot:o.native.artifact_root,nativeRoot:s.nativeRoot,language:n},`Initialized Comet Native at ${s.nativeRoot}
276
+ `)}async function Kf(t,e,r=process.argv.slice(2)){let i=r.indexOf("--"),n=i<0?[...r]:r.slice(0,i),a=i<0?[]:r.slice(i),o=n.includes("--json"),s=n.includes("--verbose"),c,l;try{Xs(n,"--json"),Xs(n,"--verbose"),c=vi(n,"--project-root");let u=[...n,...a],f=async()=>{let h=await Vf(c);return{executionCwd:h,...await e(u,h)}};l=qf(t,u)?await yd(f):await f()}catch(u){l=Gf(t,u)}let d=Jf(l,o,s);return d.stdout&&process.stdout.write(d.stdout),d.stderr&&process.stderr.write(d.stderr+(d.stderr.endsWith(`
200
277
  `)?"":`
201
- `)),d.exitCode}process.exitCode=await Ld("init",Dd);
278
+ `)),d.exitCode}process.exitCode=await Kf("init",Uf);