@rpamis/comet 0.4.3 → 0.4.5

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 (464) hide show
  1. package/README.md +372 -332
  2. package/assets/manifest.json +1 -1
  3. package/assets/skills/comet/scripts/comet-archive.mjs +113 -97
  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 +170 -157
  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 +272 -153
  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 +311 -296
  13. package/assets/skills/comet/scripts/comet-state.mjs +221 -207
  14. package/assets/skills/comet/scripts/comet-yaml-validate.mjs +25 -25
  15. package/assets/skills/comet-archive/SKILL.md +13 -9
  16. package/assets/skills/comet-build/SKILL.md +4 -6
  17. package/assets/skills/comet-classic/SKILL.md +1 -1
  18. package/assets/skills/comet-classic/reference/scripts.md +9 -1
  19. package/assets/skills/comet-design/SKILL.md +0 -2
  20. package/assets/skills/comet-hotfix/SKILL.md +1 -3
  21. package/assets/skills/comet-native/SKILL.md +8 -7
  22. package/assets/skills/comet-native/reference/artifacts.md +51 -7
  23. package/assets/skills/comet-native/reference/clarification.md +5 -5
  24. package/assets/skills/comet-native/reference/commands.md +15 -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 +257 -169
  28. package/assets/skills/comet-native/scripts/comet-native-doctor.mjs +238 -153
  29. package/assets/skills/comet-native/scripts/comet-native-hook-guard.mjs +241 -124
  30. package/assets/skills/comet-native/scripts/comet-native-init.mjs +189 -108
  31. package/assets/skills/comet-native/scripts/comet-native-new.mjs +220 -139
  32. package/assets/skills/comet-native/scripts/comet-native-next.mjs +245 -160
  33. package/assets/skills/comet-native/scripts/comet-native-root.mjs +210 -129
  34. package/assets/skills/comet-native/scripts/comet-native-runtime.mjs +284 -196
  35. package/assets/skills/comet-native/scripts/comet-native-select.mjs +212 -128
  36. package/assets/skills/comet-native/scripts/comet-native-show.mjs +207 -126
  37. package/assets/skills/comet-native/scripts/comet-native-spec.mjs +203 -118
  38. package/assets/skills/comet-native/scripts/comet-native-status.mjs +208 -124
  39. package/assets/skills/comet-open/SKILL.md +0 -2
  40. package/assets/skills/comet-tweak/SKILL.md +1 -1
  41. package/assets/skills/comet-verify/SKILL.md +0 -2
  42. package/assets/skills-zh/comet-archive/SKILL.md +13 -9
  43. package/assets/skills-zh/comet-build/SKILL.md +4 -6
  44. package/assets/skills-zh/comet-classic/SKILL.md +1 -1
  45. package/assets/skills-zh/comet-classic/reference/scripts.md +9 -1
  46. package/assets/skills-zh/comet-design/SKILL.md +0 -2
  47. package/assets/skills-zh/comet-hotfix/SKILL.md +1 -3
  48. package/assets/skills-zh/comet-native/SKILL.md +8 -7
  49. package/assets/skills-zh/comet-native/reference/artifacts.md +51 -7
  50. package/assets/skills-zh/comet-native/reference/clarification.md +5 -5
  51. package/assets/skills-zh/comet-native/reference/commands.md +16 -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 +1 -1
  56. package/assets/skills-zh/comet-verify/SKILL.md +0 -2
  57. package/bin/comet-daemon-router.js +23 -7
  58. package/bin/fast-runtime-router.js +1 -1
  59. package/dist/app/cli/index.js +1 -0
  60. package/dist/app/cli/index.js.map +1 -1
  61. package/dist/app/commands/daemon-server.d.ts.map +1 -1
  62. package/dist/app/commands/daemon-server.js +13 -2
  63. package/dist/app/commands/daemon-server.js.map +1 -1
  64. package/dist/app/commands/doctor.d.ts.map +1 -1
  65. package/dist/app/commands/doctor.js +17 -10
  66. package/dist/app/commands/doctor.js.map +1 -1
  67. package/dist/app/commands/i18n.d.ts +1 -1
  68. package/dist/app/commands/i18n.d.ts.map +1 -1
  69. package/dist/app/commands/i18n.js +4 -0
  70. package/dist/app/commands/i18n.js.map +1 -1
  71. package/dist/app/commands/project-knowledge.d.ts +2 -0
  72. package/dist/app/commands/project-knowledge.d.ts.map +1 -1
  73. package/dist/app/commands/project-knowledge.js +64 -7
  74. package/dist/app/commands/project-knowledge.js.map +1 -1
  75. package/dist/app/commands/uninstall.d.ts +1 -0
  76. package/dist/app/commands/uninstall.d.ts.map +1 -1
  77. package/dist/app/commands/uninstall.js +65 -10
  78. package/dist/app/commands/uninstall.js.map +1 -1
  79. package/dist/domains/agent-learning/coordinator.d.ts +8 -1
  80. package/dist/domains/agent-learning/coordinator.d.ts.map +1 -1
  81. package/dist/domains/agent-learning/coordinator.js +58 -0
  82. package/dist/domains/agent-learning/coordinator.js.map +1 -1
  83. package/dist/domains/agent-learning/experience-journal.d.ts +21 -1
  84. package/dist/domains/agent-learning/experience-journal.d.ts.map +1 -1
  85. package/dist/domains/agent-learning/experience-journal.js +190 -11
  86. package/dist/domains/agent-learning/experience-journal.js.map +1 -1
  87. package/dist/domains/bundle/bundle-platform.d.ts.map +1 -1
  88. package/dist/domains/bundle/bundle-platform.js +6 -1
  89. package/dist/domains/bundle/bundle-platform.js.map +1 -1
  90. package/dist/domains/comet-classic/classic-archive-entry.d.ts +1 -1
  91. package/dist/domains/comet-classic/classic-archive-entry.d.ts.map +1 -1
  92. package/dist/domains/comet-classic/classic-archive-entry.js +5 -2
  93. package/dist/domains/comet-classic/classic-archive-entry.js.map +1 -1
  94. package/dist/domains/comet-classic/classic-archive.d.ts.map +1 -1
  95. package/dist/domains/comet-classic/classic-archive.js +5 -1
  96. package/dist/domains/comet-classic/classic-archive.js.map +1 -1
  97. package/dist/domains/comet-classic/classic-branch-binding.d.ts.map +1 -1
  98. package/dist/domains/comet-classic/classic-branch-binding.js +5 -4
  99. package/dist/domains/comet-classic/classic-branch-binding.js.map +1 -1
  100. package/dist/domains/comet-classic/classic-check-entry.d.ts +1 -1
  101. package/dist/domains/comet-classic/classic-check-entry.d.ts.map +1 -1
  102. package/dist/domains/comet-classic/classic-check-entry.js +5 -2
  103. package/dist/domains/comet-classic/classic-check-entry.js.map +1 -1
  104. package/dist/domains/comet-classic/classic-check-snapshot.d.ts.map +1 -1
  105. package/dist/domains/comet-classic/classic-check-snapshot.js +68 -26
  106. package/dist/domains/comet-classic/classic-check-snapshot.js.map +1 -1
  107. package/dist/domains/comet-classic/classic-design-readiness.d.ts +1 -1
  108. package/dist/domains/comet-classic/classic-guard-entry.d.ts +1 -1
  109. package/dist/domains/comet-classic/classic-guard-entry.d.ts.map +1 -1
  110. package/dist/domains/comet-classic/classic-guard-entry.js +5 -2
  111. package/dist/domains/comet-classic/classic-guard-entry.js.map +1 -1
  112. package/dist/domains/comet-classic/classic-handoff-entry.d.ts +1 -1
  113. package/dist/domains/comet-classic/classic-handoff-entry.d.ts.map +1 -1
  114. package/dist/domains/comet-classic/classic-handoff-entry.js +5 -2
  115. package/dist/domains/comet-classic/classic-handoff-entry.js.map +1 -1
  116. package/dist/domains/comet-classic/classic-progress.d.ts +60 -2
  117. package/dist/domains/comet-classic/classic-progress.d.ts.map +1 -1
  118. package/dist/domains/comet-classic/classic-progress.js +199 -22
  119. package/dist/domains/comet-classic/classic-progress.js.map +1 -1
  120. package/dist/domains/comet-classic/classic-recovery.d.ts +20 -1
  121. package/dist/domains/comet-classic/classic-recovery.d.ts.map +1 -1
  122. package/dist/domains/comet-classic/classic-resume-probe.d.ts.map +1 -1
  123. package/dist/domains/comet-classic/classic-resume-probe.js +3 -2
  124. package/dist/domains/comet-classic/classic-resume-probe.js.map +1 -1
  125. package/dist/domains/comet-classic/classic-script-entry.d.ts +3 -1
  126. package/dist/domains/comet-classic/classic-script-entry.d.ts.map +1 -1
  127. package/dist/domains/comet-classic/classic-script-entry.js +34 -3
  128. package/dist/domains/comet-classic/classic-script-entry.js.map +1 -1
  129. package/dist/domains/comet-classic/classic-state-command.d.ts.map +1 -1
  130. package/dist/domains/comet-classic/classic-state-command.js +3 -2
  131. package/dist/domains/comet-classic/classic-state-command.js.map +1 -1
  132. package/dist/domains/comet-classic/classic-state-entry.d.ts +1 -1
  133. package/dist/domains/comet-classic/classic-state-entry.d.ts.map +1 -1
  134. package/dist/domains/comet-classic/classic-state-entry.js +5 -2
  135. package/dist/domains/comet-classic/classic-state-entry.js.map +1 -1
  136. package/dist/domains/comet-classic/classic-store.d.ts.map +1 -1
  137. package/dist/domains/comet-classic/classic-store.js +67 -1
  138. package/dist/domains/comet-classic/classic-store.js.map +1 -1
  139. package/dist/domains/comet-entry/resume-probe.d.ts.map +1 -1
  140. package/dist/domains/comet-entry/resume-probe.js +3 -2
  141. package/dist/domains/comet-entry/resume-probe.js.map +1 -1
  142. package/dist/domains/comet-native/native-acceptance.d.ts +5 -1
  143. package/dist/domains/comet-native/native-acceptance.d.ts.map +1 -1
  144. package/dist/domains/comet-native/native-acceptance.js +13 -2
  145. package/dist/domains/comet-native/native-acceptance.js.map +1 -1
  146. package/dist/domains/comet-native/native-archive-command.d.ts.map +1 -1
  147. package/dist/domains/comet-native/native-archive-command.js +167 -37
  148. package/dist/domains/comet-native/native-archive-command.js.map +1 -1
  149. package/dist/domains/comet-native/native-artifact-language.d.ts +10 -1
  150. package/dist/domains/comet-native/native-artifact-language.d.ts.map +1 -1
  151. package/dist/domains/comet-native/native-artifact-language.js +65 -12
  152. package/dist/domains/comet-native/native-artifact-language.js.map +1 -1
  153. package/dist/domains/comet-native/native-artifacts.d.ts +10 -1
  154. package/dist/domains/comet-native/native-artifacts.d.ts.map +1 -1
  155. package/dist/domains/comet-native/native-artifacts.js +130 -21
  156. package/dist/domains/comet-native/native-artifacts.js.map +1 -1
  157. package/dist/domains/comet-native/native-builder-acceptance-review.d.ts +16 -0
  158. package/dist/domains/comet-native/native-builder-acceptance-review.d.ts.map +1 -0
  159. package/dist/domains/comet-native/native-builder-acceptance-review.js +65 -0
  160. package/dist/domains/comet-native/native-builder-acceptance-review.js.map +1 -0
  161. package/dist/domains/comet-native/native-cli-help.d.ts.map +1 -1
  162. package/dist/domains/comet-native/native-cli-help.js +8 -4
  163. package/dist/domains/comet-native/native-cli-help.js.map +1 -1
  164. package/dist/domains/comet-native/native-cli-shared.d.ts +4 -2
  165. package/dist/domains/comet-native/native-cli-shared.d.ts.map +1 -1
  166. package/dist/domains/comet-native/native-cli-shared.js +37 -9
  167. package/dist/domains/comet-native/native-cli-shared.js.map +1 -1
  168. package/dist/domains/comet-native/native-cli.d.ts +4 -1
  169. package/dist/domains/comet-native/native-cli.d.ts.map +1 -1
  170. package/dist/domains/comet-native/native-cli.js +9 -5
  171. package/dist/domains/comet-native/native-cli.js.map +1 -1
  172. package/dist/domains/comet-native/native-doctor-command.d.ts.map +1 -1
  173. package/dist/domains/comet-native/native-doctor-command.js +144 -3
  174. package/dist/domains/comet-native/native-doctor-command.js.map +1 -1
  175. package/dist/domains/comet-native/native-git-provenance.d.ts.map +1 -1
  176. package/dist/domains/comet-native/native-git-provenance.js +3 -2
  177. package/dist/domains/comet-native/native-git-provenance.js.map +1 -1
  178. package/dist/domains/comet-native/native-hook-guard.d.ts.map +1 -1
  179. package/dist/domains/comet-native/native-hook-guard.js +57 -26
  180. package/dist/domains/comet-native/native-hook-guard.js.map +1 -1
  181. package/dist/domains/comet-native/native-local-execution.d.ts +1 -0
  182. package/dist/domains/comet-native/native-local-execution.d.ts.map +1 -1
  183. package/dist/domains/comet-native/native-local-execution.js +7 -0
  184. package/dist/domains/comet-native/native-local-execution.js.map +1 -1
  185. package/dist/domains/comet-native/native-lock.d.ts.map +1 -1
  186. package/dist/domains/comet-native/native-lock.js +12 -0
  187. package/dist/domains/comet-native/native-lock.js.map +1 -1
  188. package/dist/domains/comet-native/native-loop-runtime.d.ts +2 -0
  189. package/dist/domains/comet-native/native-loop-runtime.d.ts.map +1 -1
  190. package/dist/domains/comet-native/native-loop-runtime.js +6 -0
  191. package/dist/domains/comet-native/native-loop-runtime.js.map +1 -1
  192. package/dist/domains/comet-native/native-next-command.d.ts.map +1 -1
  193. package/dist/domains/comet-native/native-next-command.js +57 -28
  194. package/dist/domains/comet-native/native-next-command.js.map +1 -1
  195. package/dist/domains/comet-native/native-output-language.d.ts.map +1 -1
  196. package/dist/domains/comet-native/native-output-language.js +7 -0
  197. package/dist/domains/comet-native/native-output-language.js.map +1 -1
  198. package/dist/domains/comet-native/native-portable-acceptance.d.ts +2 -0
  199. package/dist/domains/comet-native/native-portable-acceptance.d.ts.map +1 -1
  200. package/dist/domains/comet-native/native-portable-acceptance.js +11 -1
  201. package/dist/domains/comet-native/native-portable-acceptance.js.map +1 -1
  202. package/dist/domains/comet-native/native-portable-archive.d.ts +1 -0
  203. package/dist/domains/comet-native/native-portable-archive.d.ts.map +1 -1
  204. package/dist/domains/comet-native/native-portable-archive.js +3 -0
  205. package/dist/domains/comet-native/native-portable-archive.js.map +1 -1
  206. package/dist/domains/comet-native/native-portable-checks.d.ts +14 -4
  207. package/dist/domains/comet-native/native-portable-checks.d.ts.map +1 -1
  208. package/dist/domains/comet-native/native-portable-checks.js +159 -60
  209. package/dist/domains/comet-native/native-portable-checks.js.map +1 -1
  210. package/dist/domains/comet-native/native-portable-continuation.d.ts +2 -1
  211. package/dist/domains/comet-native/native-portable-continuation.d.ts.map +1 -1
  212. package/dist/domains/comet-native/native-portable-continuation.js +121 -39
  213. package/dist/domains/comet-native/native-portable-continuation.js.map +1 -1
  214. package/dist/domains/comet-native/native-portable-requirements.d.ts +1 -0
  215. package/dist/domains/comet-native/native-portable-requirements.d.ts.map +1 -1
  216. package/dist/domains/comet-native/native-portable-requirements.js +68 -18
  217. package/dist/domains/comet-native/native-portable-requirements.js.map +1 -1
  218. package/dist/domains/comet-native/native-portable-shape-coordination.d.ts.map +1 -1
  219. package/dist/domains/comet-native/native-portable-shape-coordination.js +18 -5
  220. package/dist/domains/comet-native/native-portable-shape-coordination.js.map +1 -1
  221. package/dist/domains/comet-native/native-portable-state.d.ts.map +1 -1
  222. package/dist/domains/comet-native/native-portable-state.js +12 -3
  223. package/dist/domains/comet-native/native-portable-state.js.map +1 -1
  224. package/dist/domains/comet-native/native-portable-status.d.ts.map +1 -1
  225. package/dist/domains/comet-native/native-portable-status.js +10 -4
  226. package/dist/domains/comet-native/native-portable-status.js.map +1 -1
  227. package/dist/domains/comet-native/native-portable-types.d.ts +2 -1
  228. package/dist/domains/comet-native/native-portable-types.d.ts.map +1 -1
  229. package/dist/domains/comet-native/native-portable-types.js.map +1 -1
  230. package/dist/domains/comet-native/native-portable-verification.d.ts +3 -0
  231. package/dist/domains/comet-native/native-portable-verification.d.ts.map +1 -1
  232. package/dist/domains/comet-native/native-portable-verification.js +28 -35
  233. package/dist/domains/comet-native/native-portable-verification.js.map +1 -1
  234. package/dist/domains/comet-native/native-portable-verifier-coordination.d.ts +2 -0
  235. package/dist/domains/comet-native/native-portable-verifier-coordination.d.ts.map +1 -1
  236. package/dist/domains/comet-native/native-portable-verifier-coordination.js +9 -0
  237. package/dist/domains/comet-native/native-portable-verifier-coordination.js.map +1 -1
  238. package/dist/domains/comet-native/native-runner-input-artifacts.d.ts +9 -0
  239. package/dist/domains/comet-native/native-runner-input-artifacts.d.ts.map +1 -0
  240. package/dist/domains/comet-native/native-runner-input-artifacts.js +102 -0
  241. package/dist/domains/comet-native/native-runner-input-artifacts.js.map +1 -0
  242. package/dist/domains/comet-native/native-runner-input.d.ts +90 -64
  243. package/dist/domains/comet-native/native-runner-input.d.ts.map +1 -1
  244. package/dist/domains/comet-native/native-runner-input.js +107 -22
  245. package/dist/domains/comet-native/native-runner-input.js.map +1 -1
  246. package/dist/domains/comet-native/native-script-entry.d.ts.map +1 -1
  247. package/dist/domains/comet-native/native-script-entry.js +9 -3
  248. package/dist/domains/comet-native/native-script-entry.js.map +1 -1
  249. package/dist/domains/comet-native/native-snapshot.d.ts.map +1 -1
  250. package/dist/domains/comet-native/native-snapshot.js +7 -2
  251. package/dist/domains/comet-native/native-snapshot.js.map +1 -1
  252. package/dist/domains/comet-native/native-verification-receipt-runtime.d.ts.map +1 -1
  253. package/dist/domains/comet-native/native-verification-receipt-runtime.js +5 -4
  254. package/dist/domains/comet-native/native-verification-receipt-runtime.js.map +1 -1
  255. package/dist/domains/comet-native/native-workspace-finish.d.ts +26 -0
  256. package/dist/domains/comet-native/native-workspace-finish.d.ts.map +1 -1
  257. package/dist/domains/comet-native/native-workspace-finish.js +520 -15
  258. package/dist/domains/comet-native/native-workspace-finish.js.map +1 -1
  259. package/dist/domains/comet-plugin/integration.d.ts +1 -0
  260. package/dist/domains/comet-plugin/integration.d.ts.map +1 -1
  261. package/dist/domains/comet-plugin/integration.js +20 -10
  262. package/dist/domains/comet-plugin/integration.js.map +1 -1
  263. package/dist/domains/comet-plugin/plugin-runtime.d.ts +8 -2
  264. package/dist/domains/comet-plugin/plugin-runtime.d.ts.map +1 -1
  265. package/dist/domains/comet-plugin/plugin-runtime.js +18 -4
  266. package/dist/domains/comet-plugin/plugin-runtime.js.map +1 -1
  267. package/dist/domains/dashboard/project-directory.d.ts +4 -0
  268. package/dist/domains/dashboard/project-directory.d.ts.map +1 -1
  269. package/dist/domains/dashboard/project-directory.js +30 -2
  270. package/dist/domains/dashboard/project-directory.js.map +1 -1
  271. package/dist/domains/dashboard/server.d.ts.map +1 -1
  272. package/dist/domains/dashboard/server.js +28 -3
  273. package/dist/domains/dashboard/server.js.map +1 -1
  274. package/dist/domains/dashboard/web/assets/{abnfDiagram-VCTEODGH-qlcciI25.js → abnfDiagram-VCTEODGH-m9_t3fwH.js} +1 -1
  275. package/dist/domains/dashboard/web/assets/{arc-KVm4k9kp.js → arc-CDiwRrMg.js} +1 -1
  276. package/dist/domains/dashboard/web/assets/architecture-7GRP2DOG-ypJOsR2Y.js +1 -0
  277. package/dist/domains/dashboard/web/assets/{architectureDiagram-5GKGNRK7-C366RdBK.js → architectureDiagram-5GKGNRK7-Xwj-hlQB.js} +1 -1
  278. package/dist/domains/dashboard/web/assets/{blockDiagram-I7D4REHJ-DAuTc2OO.js → blockDiagram-I7D4REHJ-Cme6qNK_.js} +1 -1
  279. package/dist/domains/dashboard/web/assets/{c4Diagram-7LVT6UL2-CFB0RZmL.js → c4Diagram-7LVT6UL2-Cxs1dU7y.js} +1 -1
  280. package/dist/domains/dashboard/web/assets/channel-BFTjR7Ng.js +1 -0
  281. package/dist/domains/dashboard/web/assets/{chunk-4HAMMTFA-DTV6lyGQ.js → chunk-4HAMMTFA-DBQykIWE.js} +1 -1
  282. package/dist/domains/dashboard/web/assets/{chunk-75Z2AOVW-DgJm4cEX.js → chunk-75Z2AOVW-Dh-E6TAx.js} +1 -1
  283. package/dist/domains/dashboard/web/assets/{chunk-DU6HZSFF-NAtcgGZr.js → chunk-DU6HZSFF-W3lPaoVP.js} +2 -2
  284. package/dist/domains/dashboard/web/assets/{chunk-F27PBJKO-BcFXHZMJ.js → chunk-F27PBJKO-dzf1fpYi.js} +1 -1
  285. package/dist/domains/dashboard/web/assets/{chunk-GMAD6QVW-wNemar9b.js → chunk-GMAD6QVW-CeuSGVHV.js} +1 -1
  286. package/dist/domains/dashboard/web/assets/{chunk-GVQU2GXP-BiVCDO9d.js → chunk-GVQU2GXP-BrGrIBgk.js} +1 -1
  287. package/dist/domains/dashboard/web/assets/{chunk-IMKFNOWR-D9GDj4b6.js → chunk-IMKFNOWR-DXiTC1Xo.js} +1 -1
  288. package/dist/domains/dashboard/web/assets/{chunk-L3NEJ4N5-DkPl5vac.js → chunk-L3NEJ4N5-DnyD3Ocj.js} +1 -1
  289. package/dist/domains/dashboard/web/assets/{chunk-OSK3NFVY-RbbxGqtJ.js → chunk-OSK3NFVY-6vxhPm51.js} +1 -1
  290. package/dist/domains/dashboard/web/assets/{chunk-P2QGCYS3-B9_X57eT.js → chunk-P2QGCYS3-DChNsVqO.js} +1 -1
  291. package/dist/domains/dashboard/web/assets/{chunk-POPQ4Y6H-DE4bOH0D.js → chunk-POPQ4Y6H-RBgha6dE.js} +1 -1
  292. package/dist/domains/dashboard/web/assets/{chunk-PWAF6VOD-Bo-W1iA1.js → chunk-PWAF6VOD-CayoKmnh.js} +1 -1
  293. package/dist/domains/dashboard/web/assets/{chunk-SHT3W25Y-BhLxs4rZ.js → chunk-SHT3W25Y-sOkLJZoB.js} +1 -1
  294. package/dist/domains/dashboard/web/assets/{chunk-SVP7TREG-BCXfn8uF.js → chunk-SVP7TREG-j0QRwmsq.js} +1 -1
  295. package/dist/domains/dashboard/web/assets/{chunk-TICWLB2K-DqSBgE5L.js → chunk-TICWLB2K-D7Re_d_T.js} +1 -1
  296. package/dist/domains/dashboard/web/assets/{chunk-XXDRQBXY-Dbkt1xEZ.js → chunk-XXDRQBXY-BFV70fKF.js} +1 -1
  297. package/dist/domains/dashboard/web/assets/classDiagram-ZZMXUADV-gDSLbV2K.js +1 -0
  298. package/dist/domains/dashboard/web/assets/classDiagram-v2-VYDZK3BY-gDSLbV2K.js +1 -0
  299. package/dist/domains/dashboard/web/assets/{cose-bilkent-JH36ORCC-DrwNpMyX.js → cose-bilkent-JH36ORCC-k7gqx2Br.js} +1 -1
  300. package/dist/domains/dashboard/web/assets/{cynefin-OW5HDTMX-BbDlivxs.js → cynefin-OW5HDTMX-CWI6FZT8.js} +1 -1
  301. package/dist/domains/dashboard/web/assets/{cynefinDiagram-5FMLGOSQ-DmLmRN42.js → cynefinDiagram-5FMLGOSQ-D-O3RrOu.js} +1 -1
  302. package/dist/domains/dashboard/web/assets/{dagre-GXQ25YYZ-Cgm5DNgI.js → dagre-GXQ25YYZ-BR1jxWfn.js} +1 -1
  303. package/dist/domains/dashboard/web/assets/{diagram-S7CK7UJ4-Bnht1X2m.js → diagram-S7CK7UJ4-B6gXFYBj.js} +1 -1
  304. package/dist/domains/dashboard/web/assets/{diagram-UQ7AKVKN-LELTI4PR.js → diagram-UQ7AKVKN-BBW6aRk8.js} +1 -1
  305. package/dist/domains/dashboard/web/assets/{diagram-VSXAHHWV-Do0fZuNG.js → diagram-VSXAHHWV-BC0CZeyH.js} +1 -1
  306. package/dist/domains/dashboard/web/assets/{diagram-VX7I27RA-B0rZTUwt.js → diagram-VX7I27RA-BmwBIkwS.js} +1 -1
  307. package/dist/domains/dashboard/web/assets/{diagram-Z3DM3KII-wn8xCc_j.js → diagram-Z3DM3KII-DTZgX9SF.js} +1 -1
  308. package/dist/domains/dashboard/web/assets/{dist-CYwDKy2m.js → dist-brXLwleg.js} +1 -1
  309. package/dist/domains/dashboard/web/assets/{ebnfDiagram-PWID7BFC-CMDOpP2T.js → ebnfDiagram-PWID7BFC-CsMXo0C6.js} +1 -1
  310. package/dist/domains/dashboard/web/assets/{erDiagram-RLTQ6QDP-C2d43bdq.js → erDiagram-RLTQ6QDP-DQ9ewX94.js} +1 -1
  311. package/dist/domains/dashboard/web/assets/{es-BzaOcXwu.js → es-CgcAhzLf.js} +1 -1
  312. package/dist/domains/dashboard/web/assets/eventmodeling-NTZA5JFV-Ll12Q19y.js +1 -0
  313. package/dist/domains/dashboard/web/assets/flowDiagram-HODETNUW-Bf2-9XUn.js +1 -0
  314. package/dist/domains/dashboard/web/assets/{ganttDiagram-EL5Y4UJY-hTH7TzhY.js → ganttDiagram-EL5Y4UJY-DIFkXe6G.js} +1 -1
  315. package/dist/domains/dashboard/web/assets/{gitGraph-4MIJSDKK-C3CCywb-.js → gitGraph-4MIJSDKK-BHY8ZnpE.js} +1 -1
  316. package/dist/domains/dashboard/web/assets/{gitGraphDiagram-WWUBYQGX-DW6jDckj.js → gitGraphDiagram-WWUBYQGX-cBn9dMzs.js} +1 -1
  317. package/dist/domains/dashboard/web/assets/{index-CTZPz_mx.js → index-C_6nf1Fw.js} +3 -3
  318. package/dist/domains/dashboard/web/assets/{index-CWNqBYyI.css → index-Gaxnq6Jd.css} +1 -1
  319. package/dist/domains/dashboard/web/assets/{info-A6RAGUB7-Bg3eKis8.js → info-A6RAGUB7-DtUaS9jN.js} +1 -1
  320. package/dist/domains/dashboard/web/assets/{infoDiagram-27XIBGKW-7zk6ytVJ.js → infoDiagram-27XIBGKW-CIl0e_EN.js} +1 -1
  321. package/dist/domains/dashboard/web/assets/{ishikawaDiagram-5VMMS53U-CGDCTmCQ.js → ishikawaDiagram-5VMMS53U-DAdtPZ_c.js} +1 -1
  322. package/dist/domains/dashboard/web/assets/{journeyDiagram-3NMN7TZE-C8_L_e8a.js → journeyDiagram-3NMN7TZE-CBokRgde.js} +1 -1
  323. package/dist/domains/dashboard/web/assets/{kanban-definition-UXKFOSKX-D5x6qTgM.js → kanban-definition-UXKFOSKX-DrqCYJ-7.js} +1 -1
  324. package/dist/domains/dashboard/web/assets/katex-D29apahB.js +257 -0
  325. package/dist/domains/dashboard/web/assets/{line-DC93oja4.js → line-BDlVqlh4.js} +1 -1
  326. package/dist/domains/dashboard/web/assets/{linear-81TNubkB.js → linear-DTAzui9x.js} +1 -1
  327. package/dist/domains/dashboard/web/assets/{mermaid-parser.core-D60d8uy9.js → mermaid-parser.core-CFw-xbYY.js} +3 -3
  328. package/dist/domains/dashboard/web/assets/{mermaid.core-l4Wgjz2Q.js → mermaid.core-Ck7fB8UD.js} +4 -4
  329. package/dist/domains/dashboard/web/assets/{mindmap-definition-YA3MSWOX-Dfqu1201.js → mindmap-definition-YA3MSWOX-C7kb9KL9.js} +1 -1
  330. package/dist/domains/dashboard/web/assets/{packet-AYTQ26CC-CsFZBhTs.js → packet-AYTQ26CC-P8Mtt0tp.js} +1 -1
  331. package/dist/domains/dashboard/web/assets/{pegDiagram-XKGWAZYB-myFMaA7n.js → pegDiagram-XKGWAZYB-DUDD9qv5.js} +1 -1
  332. package/dist/domains/dashboard/web/assets/{pie-WAS4IAKB-FMuCTNSk.js → pie-WAS4IAKB-dEmLxiDR.js} +1 -1
  333. package/dist/domains/dashboard/web/assets/{pieDiagram-E7YTZNPT-CSR4B4Z1.js → pieDiagram-E7YTZNPT-BUssAcqk.js} +1 -1
  334. package/dist/domains/dashboard/web/assets/purify.es-Bvo9QlJ8.js +3 -0
  335. package/dist/domains/dashboard/web/assets/{quadrantDiagram-AXDQQJYC-BiE4kEeP.js → quadrantDiagram-AXDQQJYC-BzaAWdQL.js} +1 -1
  336. package/dist/domains/dashboard/web/assets/{radar-RG4KPBEZ-BZ-n7JtG.js → radar-RG4KPBEZ-mqtvaz9w.js} +1 -1
  337. package/dist/domains/dashboard/web/assets/{railroad-74A4TZTK-CWVtRfHu.js → railroad-74A4TZTK-7tTnGpoz.js} +1 -1
  338. package/dist/domains/dashboard/web/assets/railroad-abnf-HS5TGJTU-CpJvyBJM.js +1 -0
  339. package/dist/domains/dashboard/web/assets/railroad-ebnf-LZEXJU2U-BJ5g77l6.js +1 -0
  340. package/dist/domains/dashboard/web/assets/railroad-peg-WCYAUIDC-BslCK-Gr.js +1 -0
  341. package/dist/domains/dashboard/web/assets/{railroadDiagram-O6MQD6OU-CBj7v1de.js → railroadDiagram-O6MQD6OU-DM1AKXm0.js} +1 -1
  342. package/dist/domains/dashboard/web/assets/{requirementDiagram-BXWQKSXE-DSDgb54n.js → requirementDiagram-BXWQKSXE--H5KiPSc.js} +1 -1
  343. package/dist/domains/dashboard/web/assets/{sankeyDiagram-P5KCCOFB-1-oXLUAP.js → sankeyDiagram-P5KCCOFB-JweUq_u2.js} +1 -1
  344. package/dist/domains/dashboard/web/assets/{sequenceDiagram-WJ2MYXX4-DAF4nGs_.js → sequenceDiagram-WJ2MYXX4-pxb1iTGb.js} +1 -1
  345. package/dist/domains/dashboard/web/assets/{src-CTWLVUqE.js → src-joFOxopw.js} +1 -1
  346. package/dist/domains/dashboard/web/assets/{stateDiagram-D77RDMKH-DzENBaJT.js → stateDiagram-D77RDMKH-CDu5crd8.js} +1 -1
  347. package/dist/domains/dashboard/web/assets/stateDiagram-v2-MP3YSRHH-wV5AqWaM.js +1 -0
  348. package/dist/domains/dashboard/web/assets/{swimlanes-42K2YHIH-CnxFUZJc.js → swimlanes-42K2YHIH-ioSqowJ4.js} +1 -1
  349. package/dist/domains/dashboard/web/assets/swimlanesDiagram-VR7AAH4N-DOPLn-V5.js +8 -0
  350. package/dist/domains/dashboard/web/assets/{timeline-definition-24CTP7MA-KtvPzpZM.js → timeline-definition-24CTP7MA-2YXSYkS3.js} +1 -1
  351. package/dist/domains/dashboard/web/assets/{treeView-Q6P3EWNA-Bdu3P9iY.js → treeView-Q6P3EWNA-DEGims38.js} +1 -1
  352. package/dist/domains/dashboard/web/assets/{treemap-WGGIJYW6-DFnn23JR.js → treemap-WGGIJYW6-CJvBhTlR.js} +1 -1
  353. package/dist/domains/dashboard/web/assets/{vennDiagram-4TSXK5OY-BjpviP26.js → vennDiagram-4TSXK5OY-CHdNWhBK.js} +1 -1
  354. package/dist/domains/dashboard/web/assets/{wardley-WFR3VGLG-CEo4a-j4.js → wardley-WFR3VGLG-CVO9PCjo.js} +1 -1
  355. package/dist/domains/dashboard/web/assets/{wardleyDiagram-VM6X3IG4-Bf54n6im.js → wardleyDiagram-VM6X3IG4-RToPmij6.js} +1 -1
  356. package/dist/domains/dashboard/web/assets/{xychartDiagram-S5SC5T6Z-CU-hI0Cm.js → xychartDiagram-S5SC5T6Z-DaWHnpHE.js} +1 -1
  357. package/dist/domains/dashboard/web/index.html +2 -2
  358. package/dist/domains/project-knowledge/host-review.d.ts +15 -2
  359. package/dist/domains/project-knowledge/host-review.d.ts.map +1 -1
  360. package/dist/domains/project-knowledge/host-review.js +65 -25
  361. package/dist/domains/project-knowledge/host-review.js.map +1 -1
  362. package/dist/domains/project-knowledge/index.d.ts +1 -0
  363. package/dist/domains/project-knowledge/index.d.ts.map +1 -1
  364. package/dist/domains/project-knowledge/index.js +1 -0
  365. package/dist/domains/project-knowledge/index.js.map +1 -1
  366. package/dist/domains/project-knowledge/learning.d.ts +2 -1
  367. package/dist/domains/project-knowledge/learning.d.ts.map +1 -1
  368. package/dist/domains/project-knowledge/learning.js +6 -0
  369. package/dist/domains/project-knowledge/learning.js.map +1 -1
  370. package/dist/domains/project-knowledge/plugin.d.ts.map +1 -1
  371. package/dist/domains/project-knowledge/plugin.js +3 -1
  372. package/dist/domains/project-knowledge/plugin.js.map +1 -1
  373. package/dist/domains/skill/dsh-adapter.d.ts +5 -1
  374. package/dist/domains/skill/dsh-adapter.d.ts.map +1 -1
  375. package/dist/domains/skill/dsh-adapter.js +222 -87
  376. package/dist/domains/skill/dsh-adapter.js.map +1 -1
  377. package/dist/domains/skill/platform-inspect.d.ts +1 -0
  378. package/dist/domains/skill/platform-inspect.d.ts.map +1 -1
  379. package/dist/domains/skill/platform-inspect.js +8 -4
  380. package/dist/domains/skill/platform-inspect.js.map +1 -1
  381. package/dist/domains/skill/platform-install.d.ts.map +1 -1
  382. package/dist/domains/skill/platform-install.js +7 -7
  383. package/dist/domains/skill/platform-install.js.map +1 -1
  384. package/dist/domains/workflow-contract/hook-target-scope.d.ts.map +1 -1
  385. package/dist/domains/workflow-contract/hook-target-scope.js +2 -1
  386. package/dist/domains/workflow-contract/hook-target-scope.js.map +1 -1
  387. package/dist/platform/fs/file-system.d.ts +2 -0
  388. package/dist/platform/fs/file-system.d.ts.map +1 -1
  389. package/dist/platform/fs/file-system.js +11 -0
  390. package/dist/platform/fs/file-system.js.map +1 -1
  391. package/dist/platform/install/dsh-profiles.d.ts +3 -0
  392. package/dist/platform/install/dsh-profiles.d.ts.map +1 -0
  393. package/dist/platform/install/dsh-profiles.js +40 -0
  394. package/dist/platform/install/dsh-profiles.js.map +1 -0
  395. package/dist/platform/install/platforms.d.ts.map +1 -1
  396. package/dist/platform/install/platforms.js +1 -0
  397. package/dist/platform/install/platforms.js.map +1 -1
  398. package/dist/platform/install/project-registry.d.ts +7 -1
  399. package/dist/platform/install/project-registry.d.ts.map +1 -1
  400. package/dist/platform/install/project-registry.js +49 -5
  401. package/dist/platform/install/project-registry.js.map +1 -1
  402. package/dist/platform/paths/git-worktree-cache.d.ts +3 -0
  403. package/dist/platform/paths/git-worktree-cache.d.ts.map +1 -0
  404. package/dist/platform/paths/git-worktree-cache.js +109 -0
  405. package/dist/platform/paths/git-worktree-cache.js.map +1 -0
  406. package/dist/platform/paths/git-worktree.d.ts +6 -0
  407. package/dist/platform/paths/git-worktree.d.ts.map +1 -1
  408. package/dist/platform/paths/git-worktree.js +191 -30
  409. package/dist/platform/paths/git-worktree.js.map +1 -1
  410. package/dist/platform/paths/project-worktree-root.d.ts +3 -0
  411. package/dist/platform/paths/project-worktree-root.d.ts.map +1 -0
  412. package/dist/platform/paths/project-worktree-root.js +14 -0
  413. package/dist/platform/paths/project-worktree-root.js.map +1 -0
  414. package/dist/platform/process/comet-daemon.d.ts +3 -0
  415. package/dist/platform/process/comet-daemon.d.ts.map +1 -1
  416. package/dist/platform/process/comet-daemon.js +8 -6
  417. package/dist/platform/process/comet-daemon.js.map +1 -1
  418. package/dist/platform/process/external-command.d.ts +3 -0
  419. package/dist/platform/process/external-command.d.ts.map +1 -1
  420. package/dist/platform/process/external-command.js +69 -2
  421. package/dist/platform/process/external-command.js.map +1 -1
  422. package/dist/platform/process/git.d.ts.map +1 -1
  423. package/dist/platform/process/git.js +3 -4
  424. package/dist/platform/process/git.js.map +1 -1
  425. package/dist/platform/process/hook-adapter.d.ts +2 -0
  426. package/dist/platform/process/hook-adapter.d.ts.map +1 -1
  427. package/dist/platform/process/hook-adapter.js +45 -3
  428. package/dist/platform/process/hook-adapter.js.map +1 -1
  429. package/dist/platform/process/hook-read-cache.d.ts +2 -0
  430. package/dist/platform/process/hook-read-cache.d.ts.map +1 -1
  431. package/dist/platform/process/hook-read-cache.js +25 -13
  432. package/dist/platform/process/hook-read-cache.js.map +1 -1
  433. package/dist/platform/process/process-identity.d.ts.map +1 -1
  434. package/dist/platform/process/process-identity.js +18 -51
  435. package/dist/platform/process/process-identity.js.map +1 -1
  436. package/dist/platform/process/runtime-metrics.d.ts +10 -1
  437. package/dist/platform/process/runtime-metrics.d.ts.map +1 -1
  438. package/dist/platform/process/runtime-metrics.js +37 -2
  439. package/dist/platform/process/runtime-metrics.js.map +1 -1
  440. package/dist/platform/process/windows-process-broker.d.ts +1 -0
  441. package/dist/platform/process/windows-process-broker.d.ts.map +1 -1
  442. package/dist/platform/process/windows-process-broker.js +70 -11
  443. package/dist/platform/process/windows-process-broker.js.map +1 -1
  444. package/dist/platform/process/windows-process-identity.d.ts +6 -0
  445. package/dist/platform/process/windows-process-identity.d.ts.map +1 -0
  446. package/dist/platform/process/windows-process-identity.js +190 -0
  447. package/dist/platform/process/windows-process-identity.js.map +1 -0
  448. package/eval/local/tasks/comet-classic-layout-lifecycle/environment/current-comet-package.json +11 -3
  449. package/eval/local/tasks/comet-native-wave-f-dashboard-readonly/environment/current-comet-package.json +11 -3
  450. package/eval/local/tests/scaffold/test_task_resolution.py +6 -2
  451. package/package.json +14 -8
  452. package/dist/domains/dashboard/web/assets/architecture-7GRP2DOG-QeljAKq2.js +0 -1
  453. package/dist/domains/dashboard/web/assets/channel-_AqwP0KA.js +0 -1
  454. package/dist/domains/dashboard/web/assets/classDiagram-ZZMXUADV-CRo4aB_7.js +0 -1
  455. package/dist/domains/dashboard/web/assets/classDiagram-v2-VYDZK3BY-CRo4aB_7.js +0 -1
  456. package/dist/domains/dashboard/web/assets/eventmodeling-NTZA5JFV-KYANo3DQ.js +0 -1
  457. package/dist/domains/dashboard/web/assets/flowDiagram-HODETNUW-CSROlLuj.js +0 -1
  458. package/dist/domains/dashboard/web/assets/katex-CXMH3UgJ.js +0 -257
  459. package/dist/domains/dashboard/web/assets/purify.es-ChwZkWde.js +0 -3
  460. package/dist/domains/dashboard/web/assets/railroad-abnf-HS5TGJTU-CkHwwI2i.js +0 -1
  461. package/dist/domains/dashboard/web/assets/railroad-ebnf-LZEXJU2U-8xzEHL6v.js +0 -1
  462. package/dist/domains/dashboard/web/assets/railroad-peg-WCYAUIDC-nSHBw0tH.js +0 -1
  463. package/dist/domains/dashboard/web/assets/stateDiagram-v2-MP3YSRHH-CNw52Fkn.js +0 -1
  464. package/dist/domains/dashboard/web/assets/swimlanesDiagram-VR7AAH4N-6TRvbqqI.js +0 -8
@@ -1,157 +1,170 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __cometCreateRequire } from 'module';
3
3
  const require = __cometCreateRequire(import.meta.url);
4
- var Su=Object.create;var Ar=Object.defineProperty;var _u=Object.getOwnPropertyDescriptor;var Eu=Object.getOwnPropertyNames;var xu=Object.getPrototypeOf,Pu=Object.prototype.hasOwnProperty;var rn=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var O=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var w=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Ru=(t,e)=>{for(var n in e)Ar(t,n,{get:e[n],enumerable:!0})},Nu=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Eu(e))!Pu.call(t,i)&&i!==n&&Ar(t,i,{get:()=>e[i],enumerable:!(r=_u(e,i))||r.enumerable});return t};var on=(t,e,n)=>(n=t!=null?Su(xu(t)):{},Nu(e||!t||!t.__esModule?Ar(n,"default",{value:t,enumerable:!0}):n,t));var E=w(L=>{"use strict";var jr=Symbol.for("yaml.alias"),ts=Symbol.for("yaml.document"),sn=Symbol.for("yaml.map"),ns=Symbol.for("yaml.pair"),Lr=Symbol.for("yaml.scalar"),an=Symbol.for("yaml.seq"),oe=Symbol.for("yaml.node.type"),Au=t=>!!t&&typeof t=="object"&&t[oe]===jr,Iu=t=>!!t&&typeof t=="object"&&t[oe]===ts,Tu=t=>!!t&&typeof t=="object"&&t[oe]===sn,ju=t=>!!t&&typeof t=="object"&&t[oe]===ns,rs=t=>!!t&&typeof t=="object"&&t[oe]===Lr,Lu=t=>!!t&&typeof t=="object"&&t[oe]===an;function is(t){if(t&&typeof t=="object")switch(t[oe]){case sn:case an:return!0}return!1}function qu(t){if(t&&typeof t=="object")switch(t[oe]){case jr:case sn:case Lr:case an:return!0}return!1}var $u=t=>(rs(t)||is(t))&&!!t.anchor;L.ALIAS=jr;L.DOC=ts;L.MAP=sn;L.NODE_TYPE=oe;L.PAIR=ns;L.SCALAR=Lr;L.SEQ=an;L.hasAnchor=$u;L.isAlias=Au;L.isCollection=is;L.isDocument=Iu;L.isMap=Tu;L.isNode=qu;L.isPair=ju;L.isScalar=rs;L.isSeq=Lu});var lt=w(qr=>{"use strict";var T=E(),F=Symbol("break visit"),os=Symbol("skip children"),G=Symbol("remove node");function cn(t,e){let n=ss(e);T.isDocument(t)?Fe(null,t.contents,n,Object.freeze([t]))===G&&(t.contents=null):Fe(null,t,n,Object.freeze([]))}cn.BREAK=F;cn.SKIP=os;cn.REMOVE=G;function Fe(t,e,n,r){let i=as(t,e,n,r);if(T.isNode(i)||T.isPair(i))return cs(t,r,i),Fe(t,i,n,r);if(typeof i!="symbol"){if(T.isCollection(e)){r=Object.freeze(r.concat(e));for(let o=0;o<e.items.length;++o){let s=Fe(o,e.items[o],n,r);if(typeof s=="number")o=s-1;else{if(s===F)return F;s===G&&(e.items.splice(o,1),o-=1)}}}else if(T.isPair(e)){r=Object.freeze(r.concat(e));let o=Fe("key",e.key,n,r);if(o===F)return F;o===G&&(e.key=null);let s=Fe("value",e.value,n,r);if(s===F)return F;s===G&&(e.value=null)}}return i}async function ln(t,e){let n=ss(e);T.isDocument(t)?await Be(null,t.contents,n,Object.freeze([t]))===G&&(t.contents=null):await Be(null,t,n,Object.freeze([]))}ln.BREAK=F;ln.SKIP=os;ln.REMOVE=G;async function Be(t,e,n,r){let i=await as(t,e,n,r);if(T.isNode(i)||T.isPair(i))return cs(t,r,i),Be(t,i,n,r);if(typeof i!="symbol"){if(T.isCollection(e)){r=Object.freeze(r.concat(e));for(let o=0;o<e.items.length;++o){let s=await Be(o,e.items[o],n,r);if(typeof s=="number")o=s-1;else{if(s===F)return F;s===G&&(e.items.splice(o,1),o-=1)}}}else if(T.isPair(e)){r=Object.freeze(r.concat(e));let o=await Be("key",e.key,n,r);if(o===F)return F;o===G&&(e.key=null);let s=await Be("value",e.value,n,r);if(s===F)return F;s===G&&(e.value=null)}}return i}function ss(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 as(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(T.isMap(e))return n.Map?.(t,e,r);if(T.isSeq(e))return n.Seq?.(t,e,r);if(T.isPair(e))return n.Pair?.(t,e,r);if(T.isScalar(e))return n.Scalar?.(t,e,r);if(T.isAlias(e))return n.Alias?.(t,e,r)}function cs(t,e,n){let r=e[e.length-1];if(T.isCollection(r))r.items[t]=n;else if(T.isPair(r))t==="key"?r.key=n:r.value=n;else if(T.isDocument(r))r.contents=n;else{let i=T.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}qr.visit=cn;qr.visitAsync=ln});var $r=w(us=>{"use strict";var ls=E(),Du=lt(),Mu={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Wu=t=>t.replace(/[!,[\]{}]/g,e=>Mu[e]),ut=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}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,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[o,s]=r;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);let o=this.tags[r];if(o)try{return o+decodeURIComponent(i)}catch(s){return n(String(s)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+Wu(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(e&&r.length>0&&ls.isNode(e.contents)){let o={};Du.visit(e.contents,(s,a)=>{ls.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of r)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(`
5
- `)}};ut.defaultYaml={explicit:!1,version:"1.2"};ut.defaultTags={"!!":"tag:yaml.org,2002:"};us.Directives=ut});var un=w(ft=>{"use strict";var fs=E(),Fu=lt();function Bu(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function ds(t){let e=new Set;return Fu.visit(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function ms(t,e){for(let n=1;;++n){let r=`${t}${n}`;if(!e.has(r))return r}}function Uu(t,e){let n=[],r=new Map,i=null;return{onAnchor:o=>{n.push(o),i??(i=ds(t));let s=ms(e,i);return i.add(s),s},setAnchors:()=>{for(let o of n){let s=r.get(o);if(typeof s=="object"&&s.anchor&&(fs.isScalar(s.node)||fs.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:r}}ft.anchorIsValid=Bu;ft.anchorNames=ds;ft.createNodeAnchors=Uu;ft.findNewAnchor=ms});var Dr=w(ps=>{"use strict";function dt(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,o=r.length;i<o;++i){let s=r[i],a=dt(t,r,String(i),s);a===void 0?delete r[i]:a!==s&&(r[i]=a)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let o=r.get(i),s=dt(t,r,i,o);s===void 0?r.delete(i):s!==o&&r.set(i,s)}else if(r instanceof Set)for(let i of Array.from(r)){let o=dt(t,r,i,i);o===void 0?r.delete(i):o!==i&&(r.delete(i),r.add(o))}else for(let[i,o]of Object.entries(r)){let s=dt(t,r,i,o);s===void 0?delete r[i]:s!==o&&(r[i]=s)}return t.call(e,n,r)}ps.applyReviver=dt});var de=w(gs=>{"use strict";var Ku=E();function hs(t,e,n){if(Array.isArray(t))return t.map((r,i)=>hs(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!Ku.hasAnchor(t))return t.toJSON(e,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=o=>{r.res=o,delete n.onCreate};let i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!n?.keep?Number(t):t}gs.toJS=hs});var fn=w(ys=>{"use strict";var zu=Dr(),ws=E(),Ju=de(),Mr=class{constructor(e){Object.defineProperty(this,ws.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:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){if(!ws.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=Ju.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?zu.applyReviver(o,{"":a},"",a):a}};ys.NodeBase=Mr});var mt=w(vs=>{"use strict";var Yu=un(),Hu=lt(),Ue=E(),Vu=fn(),Gu=de(),Wr=class extends Vu.NodeBase{constructor(e){super(Ue.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],Hu.visit(e,{Node:(o,s)=>{(Ue.isAlias(s)||Ue.hasAnchor(s))&&r.push(s)}}),n&&(n.aliasResolveCache=r));let i;for(let o of r){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:o}=n,s=this.resolve(i,n);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(s);if(a||(Gu.toJS(s,null,n),a=r.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=dn(i,s,r)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,r){let i=`*${this.source}`;if(e){if(Yu.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function dn(t,e,n){if(Ue.isAlias(e)){let r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Ue.isCollection(e)){let r=0;for(let i of e.items){let o=dn(t,i,n);o>r&&(r=o)}return r}else if(Ue.isPair(e)){let r=dn(t,e.key,n),i=dn(t,e.value,n);return Math.max(r,i)}return 1}vs.Alias=Wr});var A=w(Fr=>{"use strict";var Xu=E(),Qu=fn(),Zu=de(),ef=t=>!t||typeof t!="function"&&typeof t!="object",me=class extends Qu.NodeBase{constructor(e){super(Xu.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:Zu.toJS(this.value,e,n)}toString(){return String(this.value)}};me.BLOCK_FOLDED="BLOCK_FOLDED";me.BLOCK_LITERAL="BLOCK_LITERAL";me.PLAIN="PLAIN";me.QUOTE_DOUBLE="QUOTE_DOUBLE";me.QUOTE_SINGLE="QUOTE_SINGLE";Fr.Scalar=me;Fr.isScalarValue=ef});var pt=w(ks=>{"use strict";var tf=mt(),Ne=E(),bs=A(),nf="tag:yaml.org,2002:";function rf(t,e,n){if(e){let r=n.filter(o=>o.tag===e),i=r.find(o=>!o.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>r.identify?.(t)&&!r.format)}function of(t,e,n){if(Ne.isDocument(t)&&(t=t.contents),Ne.isNode(t))return t;if(Ne.isPair(t)){let f=n.schema[Ne.MAP].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=n,c;if(r&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new tf.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=nf+e.slice(2));let l=rf(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new bs.Scalar(t);return c&&(c.node=f),f}l=t instanceof Map?s[Ne.MAP]:Symbol.iterator in Object(t)?s[Ne.SEQ]:s[Ne.MAP]}o&&(o(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new bs.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}ks.createNode=of});var pn=w(mn=>{"use strict";var sf=pt(),X=E(),af=fn();function Br(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=r,r=s}else r=new Map([[o,r]])}return sf.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Cs=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,Ur=class extends af.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>X.isNode(r)||X.isPair(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Cs(e))this.add(n);else{let[r,...i]=e,o=this.get(r,!0);if(X.isCollection(o))o.addIn(i,n);else if(o===void 0&&this.schema)this.set(r,Br(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){let[n,...r]=e;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(X.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){let[r,...i]=e,o=this.get(r,!0);return i.length===0?!n&&X.isScalar(o)?o.value:o:X.isCollection(o)?o.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!X.isPair(n))return!1;let r=n.value;return r==null||e&&X.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[n,...r]=e;if(r.length===0)return this.has(n);let i=this.get(n,!0);return X.isCollection(i)?i.hasIn(r):!1}setIn(e,n){let[r,...i]=e;if(i.length===0)this.set(r,n);else{let o=this.get(r,!0);if(X.isCollection(o))o.setIn(i,n);else if(o===void 0&&this.schema)this.set(r,Br(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};mn.Collection=Ur;mn.collectionFromPath=Br;mn.isEmptyPath=Cs});var ht=w(hn=>{"use strict";var cf=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Kr(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var lf=(t,e,n)=>t.endsWith(`
6
- `)?Kr(n,e):n.includes(`
4
+ var Ju=Object.create;var Kr=Object.defineProperty;var Yu=Object.getOwnPropertyDescriptor;var Hu=Object.getOwnPropertyNames;var Gu=Object.getPrototypeOf,Vu=Object.prototype.hasOwnProperty;var pn=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,n)=>(typeof require<"u"?require:e)[n]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var O=(t,e,n)=>()=>{if(n)throw n[0];try{return t&&(e=t(t=0)),e}catch(r){throw n=[r],r}};var w=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(n){throw e=0,n}},Xu=(t,e)=>{for(var n in e)Kr(t,n,{get:e[n],enumerable:!0})},Qu=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Hu(e))!Vu.call(t,i)&&i!==n&&Kr(t,i,{get:()=>e[i],enumerable:!(r=Yu(e,i))||r.enumerable});return t};var hn=(t,e,n)=>(n=t!=null?Ju(Gu(t)):{},Qu(e||!t||!t.__esModule?Kr(n,"default",{value:t,enumerable:!0}):n,t));var _=w($=>{"use strict";var Yr=Symbol.for("yaml.alias"),bs=Symbol.for("yaml.document"),yn=Symbol.for("yaml.map"),ks=Symbol.for("yaml.pair"),Hr=Symbol.for("yaml.scalar"),vn=Symbol.for("yaml.seq"),fe=Symbol.for("yaml.node.type"),of=t=>!!t&&typeof t=="object"&&t[fe]===Yr,sf=t=>!!t&&typeof t=="object"&&t[fe]===bs,af=t=>!!t&&typeof t=="object"&&t[fe]===yn,cf=t=>!!t&&typeof t=="object"&&t[fe]===ks,Cs=t=>!!t&&typeof t=="object"&&t[fe]===Hr,lf=t=>!!t&&typeof t=="object"&&t[fe]===vn;function Ss(t){if(t&&typeof t=="object")switch(t[fe]){case yn:case vn:return!0}return!1}function uf(t){if(t&&typeof t=="object")switch(t[fe]){case Yr:case yn:case Hr:case vn:return!0}return!1}var ff=t=>(Cs(t)||Ss(t))&&!!t.anchor;$.ALIAS=Yr;$.DOC=bs;$.MAP=yn;$.NODE_TYPE=fe;$.PAIR=ks;$.SCALAR=Hr;$.SEQ=vn;$.hasAnchor=ff;$.isAlias=of;$.isCollection=Ss;$.isDocument=sf;$.isMap=af;$.isNode=uf;$.isPair=cf;$.isScalar=Cs;$.isSeq=lf});var yt=w(Gr=>{"use strict";var j=_(),U=Symbol("break visit"),Es=Symbol("skip children"),ne=Symbol("remove node");function bn(t,e){let n=_s(e);j.isDocument(t)?Ge(null,t.contents,n,Object.freeze([t]))===ne&&(t.contents=null):Ge(null,t,n,Object.freeze([]))}bn.BREAK=U;bn.SKIP=Es;bn.REMOVE=ne;function Ge(t,e,n,r){let i=xs(t,e,n,r);if(j.isNode(i)||j.isPair(i))return Ps(t,r,i),Ge(t,i,n,r);if(typeof i!="symbol"){if(j.isCollection(e)){r=Object.freeze(r.concat(e));for(let o=0;o<e.items.length;++o){let s=Ge(o,e.items[o],n,r);if(typeof s=="number")o=s-1;else{if(s===U)return U;s===ne&&(e.items.splice(o,1),o-=1)}}}else if(j.isPair(e)){r=Object.freeze(r.concat(e));let o=Ge("key",e.key,n,r);if(o===U)return U;o===ne&&(e.key=null);let s=Ge("value",e.value,n,r);if(s===U)return U;s===ne&&(e.value=null)}}return i}async function kn(t,e){let n=_s(e);j.isDocument(t)?await Ve(null,t.contents,n,Object.freeze([t]))===ne&&(t.contents=null):await Ve(null,t,n,Object.freeze([]))}kn.BREAK=U;kn.SKIP=Es;kn.REMOVE=ne;async function Ve(t,e,n,r){let i=await xs(t,e,n,r);if(j.isNode(i)||j.isPair(i))return Ps(t,r,i),Ve(t,i,n,r);if(typeof i!="symbol"){if(j.isCollection(e)){r=Object.freeze(r.concat(e));for(let o=0;o<e.items.length;++o){let s=await Ve(o,e.items[o],n,r);if(typeof s=="number")o=s-1;else{if(s===U)return U;s===ne&&(e.items.splice(o,1),o-=1)}}}else if(j.isPair(e)){r=Object.freeze(r.concat(e));let o=await Ve("key",e.key,n,r);if(o===U)return U;o===ne&&(e.key=null);let s=await Ve("value",e.value,n,r);if(s===U)return U;s===ne&&(e.value=null)}}return i}function _s(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 xs(t,e,n,r){if(typeof n=="function")return n(t,e,r);if(j.isMap(e))return n.Map?.(t,e,r);if(j.isSeq(e))return n.Seq?.(t,e,r);if(j.isPair(e))return n.Pair?.(t,e,r);if(j.isScalar(e))return n.Scalar?.(t,e,r);if(j.isAlias(e))return n.Alias?.(t,e,r)}function Ps(t,e,n){let r=e[e.length-1];if(j.isCollection(r))r.items[t]=n;else if(j.isPair(r))t==="key"?r.key=n:r.value=n;else if(j.isDocument(r))r.contents=n;else{let i=j.isAlias(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}Gr.visit=bn;Gr.visitAsync=kn});var Vr=w(Ns=>{"use strict";var Rs=_(),df=yt(),mf={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},pf=t=>t.replace(/[!,[\]{}]/g,e=>mf[e]),vt=class t{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},t.defaultYaml,e),this.tags=Object.assign({},t.defaultTags,n)}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,n){this.atNextDocument&&(this.yaml={explicit:t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},t.defaultTags),this.atNextDocument=!1);let r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;let[o,s]=r;return this.tags[o]=s,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;let[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{let s=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,s),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let s=e.slice(2,-1);return s==="!"||s==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),s)}let[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);let o=this.tags[r];if(o)try{return o+decodeURIComponent(i)}catch(s){return n(String(s)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+pf(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),i;if(e&&r.length>0&&Rs.isNode(e.contents)){let o={};df.visit(e.contents,(s,a)=>{Rs.isNode(a)&&a.tag&&(o[a.tag]=!0)}),i=Object.keys(o)}else i=[];for(let[o,s]of r)o==="!!"&&s==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(s)))&&n.push(`%TAG ${o} ${s}`);return n.join(`
5
+ `)}};vt.defaultYaml={explicit:!1,version:"1.2"};vt.defaultTags={"!!":"tag:yaml.org,2002:"};Ns.Directives=vt});var Cn=w(bt=>{"use strict";var Os=_(),hf=yt();function gf(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){let n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function As(t){let e=new Set;return hf.visit(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function Is(t,e){for(let n=1;;++n){let r=`${t}${n}`;if(!e.has(r))return r}}function wf(t,e){let n=[],r=new Map,i=null;return{onAnchor:o=>{n.push(o),i??(i=As(t));let s=Is(e,i);return i.add(s),s},setAnchors:()=>{for(let o of n){let s=r.get(o);if(typeof s=="object"&&s.anchor&&(Os.isScalar(s.node)||Os.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=o,a}}},sourceObjects:r}}bt.anchorIsValid=gf;bt.anchorNames=As;bt.createNodeAnchors=wf;bt.findNewAnchor=Is});var Xr=w(Ts=>{"use strict";function kt(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,o=r.length;i<o;++i){let s=r[i],a=kt(t,r,String(i),s);a===void 0?delete r[i]:a!==s&&(r[i]=a)}else if(r instanceof Map)for(let i of Array.from(r.keys())){let o=r.get(i),s=kt(t,r,i,o);s===void 0?r.delete(i):s!==o&&r.set(i,s)}else if(r instanceof Set)for(let i of Array.from(r)){let o=kt(t,r,i,i);o===void 0?r.delete(i):o!==i&&(r.delete(i),r.add(o))}else for(let[i,o]of Object.entries(r)){let s=kt(t,r,i,o);s===void 0?delete r[i]:s!==o&&(r[i]=s)}return t.call(e,n,r)}Ts.applyReviver=kt});var ge=w(Ls=>{"use strict";var yf=_();function js(t,e,n){if(Array.isArray(t))return t.map((r,i)=>js(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!yf.hasAnchor(t))return t.toJSON(e,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=o=>{r.res=o,delete n.onCreate};let i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!n?.keep?Number(t):t}Ls.toJS=js});var Sn=w($s=>{"use strict";var vf=Xr(),qs=_(),bf=ge(),Qr=class{constructor(e){Object.defineProperty(this,qs.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:n,maxAliasCount:r,onAnchor:i,reviver:o}={}){if(!qs.isDocument(e))throw new TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=bf.toJS(this,"",s);if(typeof i=="function")for(let{count:c,res:l}of s.anchors.values())i(l,c);return typeof o=="function"?vf.applyReviver(o,{"":a},"",a):a}};$s.NodeBase=Qr});var Ct=w(Ms=>{"use strict";var kf=Cn(),Cf=yt(),Xe=_(),Sf=Sn(),Ef=ge(),Zr=class extends Sf.NodeBase{constructor(e){super(Xe.ALIAS),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,n){if(n?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let r;n?.aliasResolveCache?r=n.aliasResolveCache:(r=[],Cf.visit(e,{Node:(o,s)=>{(Xe.isAlias(s)||Xe.hasAnchor(s))&&r.push(s)}}),n&&(n.aliasResolveCache=r));let i;for(let o of r){if(o===this)break;o.anchor===this.source&&(i=o)}return i}toJSON(e,n){if(!n)return{source:this.source};let{anchors:r,doc:i,maxAliasCount:o}=n,s=this.resolve(i,n);if(!s){let c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(c)}let a=r.get(s);if(a||(Ef.toJS(s,null,n),a=r.get(s)),a?.res===void 0){let c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=En(i,s,r)),a.count*a.aliasCount>o)){let c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}return a.res}toString(e,n,r){let i=`*${this.source}`;if(e){if(kf.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(e.implicitKey)return`${i} `}return i}};function En(t,e,n){if(Xe.isAlias(e)){let r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Xe.isCollection(e)){let r=0;for(let i of e.items){let o=En(t,i,n);o>r&&(r=o)}return r}else if(Xe.isPair(e)){let r=En(t,e.key,n),i=En(t,e.value,n);return Math.max(r,i)}return 1}Ms.Alias=Zr});var A=w(ei=>{"use strict";var _f=_(),xf=Sn(),Pf=ge(),Rf=t=>!t||typeof t!="function"&&typeof t!="object",we=class extends xf.NodeBase{constructor(e){super(_f.SCALAR),this.value=e}toJSON(e,n){return n?.keep?this.value:Pf.toJS(this.value,e,n)}toString(){return String(this.value)}};we.BLOCK_FOLDED="BLOCK_FOLDED";we.BLOCK_LITERAL="BLOCK_LITERAL";we.PLAIN="PLAIN";we.QUOTE_DOUBLE="QUOTE_DOUBLE";we.QUOTE_SINGLE="QUOTE_SINGLE";ei.Scalar=we;ei.isScalarValue=Rf});var St=w(Ws=>{"use strict";var Nf=Ct(),$e=_(),Ds=A(),Of="tag:yaml.org,2002:";function Af(t,e,n){if(e){let r=n.filter(o=>o.tag===e),i=r.find(o=>!o.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>r.identify?.(t)&&!r.format)}function If(t,e,n){if($e.isDocument(t)&&(t=t.contents),$e.isNode(t))return t;if($e.isPair(t)){let f=n.schema[$e.MAP].createNode?.(n.schema,null,n);return f.items.push(t),f}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:o,schema:s,sourceObjects:a}=n,c;if(r&&t&&typeof t=="object"){if(c=a.get(t),c)return c.anchor??(c.anchor=i(t)),new Nf.Alias(c.anchor);c={anchor:null,node:null},a.set(t,c)}e?.startsWith("!!")&&(e=Of+e.slice(2));let l=Af(t,e,s.tags);if(!l){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){let f=new Ds.Scalar(t);return c&&(c.node=f),f}l=t instanceof Map?s[$e.MAP]:Symbol.iterator in Object(t)?s[$e.SEQ]:s[$e.MAP]}o&&(o(l),delete n.onTagObj);let u=l?.createNode?l.createNode(n.schema,t,n):typeof l?.nodeClass?.from=="function"?l.nodeClass.from(n.schema,t,n):new Ds.Scalar(t);return e?u.tag=e:l.default||(u.tag=l.tag),c&&(c.node=u),u}Ws.createNode=If});var xn=w(_n=>{"use strict";var Tf=St(),re=_(),jf=Sn();function ti(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){let o=e[i];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){let s=[];s[o]=r,r=s}else r=new Map([[o,r]])}return Tf.createNode(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}var Fs=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done,ni=class extends jf.NodeBase{constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){let n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>re.isNode(r)||re.isPair(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(Fs(e))this.add(n);else{let[r,...i]=e,o=this.get(r,!0);if(re.isCollection(o))o.addIn(i,n);else if(o===void 0&&this.schema)this.set(r,ti(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){let[n,...r]=e;if(r.length===0)return this.delete(n);let i=this.get(n,!0);if(re.isCollection(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){let[r,...i]=e,o=this.get(r,!0);return i.length===0?!n&&re.isScalar(o)?o.value:o:re.isCollection(o)?o.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!re.isPair(n))return!1;let r=n.value;return r==null||e&&re.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[n,...r]=e;if(r.length===0)return this.has(n);let i=this.get(n,!0);return re.isCollection(i)?i.hasIn(r):!1}setIn(e,n){let[r,...i]=e;if(i.length===0)this.set(r,n);else{let o=this.get(r,!0);if(re.isCollection(o))o.setIn(i,n);else if(o===void 0&&this.schema)this.set(r,ti(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};_n.Collection=ni;_n.collectionFromPath=ti;_n.isEmptyPath=Fs});var Et=w(Pn=>{"use strict";var Lf=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ri(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}var qf=(t,e,n)=>t.endsWith(`
6
+ `)?ri(n,e):n.includes(`
7
7
  `)?`
8
- `+Kr(n,e):(t.endsWith(" ")?"":" ")+n;hn.indentComment=Kr;hn.lineComment=lf;hn.stringifyComment=cf});var _s=w(gt=>{"use strict";var uf="flow",zr="block",gn="quoted";function ff(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;i<o&&(o=0);let c=Math.max(1+o,1+i-e.length);if(t.length<=c)return t;let l=[],u={},f=i-e.length;typeof r=="number"&&(r>i-Math.max(2,o)?l.push(0):f=i-r);let d,p,g=!1,m=-1,h=-1,v=-1;n===zr&&(m=Ss(t,m,e.length),m!==-1&&(f=m+c));for(let k;k=t[m+=1];){if(n===gn&&k==="\\"){switch(h=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}v=m}if(k===`
9
- `)n===zr&&(m=Ss(t,m,e.length)),f=m+e.length+c,d=void 0;else{if(k===" "&&p&&p!==" "&&p!==`
8
+ `+ri(n,e):(t.endsWith(" ")?"":" ")+n;Pn.indentComment=ri;Pn.lineComment=qf;Pn.stringifyComment=Lf});var Us=w(_t=>{"use strict";var $f="flow",ii="block",Rn="quoted";function Mf(t,e,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:o=20,onFold:s,onOverflow:a}={}){if(!i||i<0)return t;i<o&&(o=0);let c=Math.max(1+o,1+i-e.length);if(t.length<=c)return t;let l=[],u={},f=i-e.length;typeof r=="number"&&(r>i-Math.max(2,o)?l.push(0):f=i-r);let d,p,g=!1,m=-1,h=-1,y=-1;n===ii&&(m=Bs(t,m,e.length),m!==-1&&(f=m+c));for(let k;k=t[m+=1];){if(n===Rn&&k==="\\"){switch(h=m,t[m+1]){case"x":m+=3;break;case"u":m+=5;break;case"U":m+=9;break;default:m+=1}y=m}if(k===`
9
+ `)n===ii&&(m=Bs(t,m,e.length)),f=m+e.length+c,d=void 0;else{if(k===" "&&p&&p!==" "&&p!==`
10
10
  `&&p!==" "){let C=t[m+1];C&&C!==" "&&C!==`
11
- `&&C!==" "&&(d=m)}if(m>=f)if(d)l.push(d),f=d+c,d=void 0;else if(n===gn){for(;p===" "||p===" ";)p=k,k=t[m+=1],g=!0;let C=m>v+1?m-2:h-1;if(u[C])return t;l.push(C),u[C]=!0,f=C+c,d=void 0}else g=!0}p=k}if(g&&a&&a(),l.length===0)return t;s&&s();let b=t.slice(0,l[0]);for(let k=0;k<l.length;++k){let C=l[k],S=l[k+1]||t.length;C===0?b=`
12
- ${e}${t.slice(0,S)}`:(n===gn&&u[C]&&(b+=`${t[C]}\\`),b+=`
13
- ${e}${t.slice(C+1,S)}`)}return b}function Ss(t,e,n){let r=e,i=e+1,o=t[i];for(;o===" "||o===" ";)if(e<i+n)o=t[++e];else{do o=t[++e];while(o&&o!==`
14
- `);r=e,i=e+1,o=t[i]}return r}gt.FOLD_BLOCK=zr;gt.FOLD_FLOW=uf;gt.FOLD_QUOTED=gn;gt.foldFlowLines=ff});var yt=w(Es=>{"use strict";var Y=A(),pe=_s(),yn=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),vn=t=>/^(%|---|\.\.\.)/m.test(t);function df(t,e,n){if(!e||e<0)return!1;let r=e-n,i=t.length;if(i<=r)return!1;for(let o=0,s=0;o<i;++o)if(t[o]===`
15
- `){if(o-s>r)return!0;if(s=o+1,i-s<=r)return!1}return!0}function wt(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(vn(t)?" ":""),s="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(s+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{s+=n.slice(a,c);let u=n.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<i)c+=1;else{for(s+=n.slice(a,c)+`
11
+ `&&C!==" "&&(d=m)}if(m>=f)if(d)l.push(d),f=d+c,d=void 0;else if(n===Rn){for(;p===" "||p===" ";)p=k,k=t[m+=1],g=!0;let C=m>y+1?m-2:h-1;if(u[C])return t;l.push(C),u[C]=!0,f=C+c,d=void 0}else g=!0}p=k}if(g&&a&&a(),l.length===0)return t;s&&s();let b=t.slice(0,l[0]);for(let k=0;k<l.length;++k){let C=l[k],S=l[k+1]||t.length;C===0?b=`
12
+ ${e}${t.slice(0,S)}`:(n===Rn&&u[C]&&(b+=`${t[C]}\\`),b+=`
13
+ ${e}${t.slice(C+1,S)}`)}return b}function Bs(t,e,n){let r=e,i=e+1,o=t[i];for(;o===" "||o===" ";)if(e<i+n)o=t[++e];else{do o=t[++e];while(o&&o!==`
14
+ `);r=e,i=e+1,o=t[i]}return r}_t.FOLD_BLOCK=ii;_t.FOLD_FLOW=$f;_t.FOLD_QUOTED=Rn;_t.foldFlowLines=Mf});var Pt=w(Ks=>{"use strict";var ee=A(),ye=Us(),On=(t,e)=>({indentAtStart:e?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),An=t=>/^(%|---|\.\.\.)/m.test(t);function Df(t,e,n){if(!e||e<0)return!1;let r=e-n,i=t.length;if(i<=r)return!1;for(let o=0,s=0;o<i;++o)if(t[o]===`
15
+ `){if(o-s>r)return!0;if(s=o+1,i-s<=r)return!1}return!0}function xt(t,e){let n=JSON.stringify(t);if(e.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,o=e.indent||(An(t)?" ":""),s="",a=0;for(let c=0,l=n[c];l;l=n[++c])if(l===" "&&n[c+1]==="\\"&&n[c+2]==="n"&&(s+=n.slice(a,c)+"\\ ",c+=1,a=c,l="\\"),l==="\\")switch(n[c+1]){case"u":{s+=n.slice(a,c);let u=n.substr(c+2,4);switch(u){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:u.substr(0,2)==="00"?s+="\\x"+u.substr(2):s+=n.substr(c,6)}c+=5,a=c+1}break;case"n":if(r||n[c+2]==='"'||n.length<i)c+=1;else{for(s+=n.slice(a,c)+`
16
16
 
17
17
  `;n[c+2]==="\\"&&n[c+3]==="n"&&n[c+4]!=='"';)s+=`
18
- `,c+=2;s+=o,n[c+2]===" "&&(s+="\\"),c+=1,a=c+1}break;default:c+=1}return s=a?s+n.slice(a):n,r?s:pe.foldFlowLines(s,o,pe.FOLD_QUOTED,yn(e,!1))}function Jr(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
19
- `)||/[ \t]\n|\n[ \t]/.test(t))return wt(t,e);let n=e.indent||(vn(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20
- ${n}`)+"'";return e.implicitKey?r:pe.foldFlowLines(r,n,pe.FOLD_FLOW,yn(e,!1))}function Ke(t,e){let{singleQuote:n}=e.options,r;if(n===!1)r=wt;else{let i=t.includes('"'),o=t.includes("'");i&&!o?r=Jr:o&&!i?r=wt:r=n?Jr:wt}return r(t,e)}var Yr;try{Yr=new RegExp(`(^|(?<!
18
+ `,c+=2;s+=o,n[c+2]===" "&&(s+="\\"),c+=1,a=c+1}break;default:c+=1}return s=a?s+n.slice(a):n,r?s:ye.foldFlowLines(s,o,ye.FOLD_QUOTED,On(e,!1))}function oi(t,e){if(e.options.singleQuote===!1||e.implicitKey&&t.includes(`
19
+ `)||/[ \t]\n|\n[ \t]/.test(t))return xt(t,e);let n=e.indent||(An(t)?" ":""),r="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
20
+ ${n}`)+"'";return e.implicitKey?r:ye.foldFlowLines(r,n,ye.FOLD_FLOW,On(e,!1))}function Qe(t,e){let{singleQuote:n}=e.options,r;if(n===!1)r=xt;else{let i=t.includes('"'),o=t.includes("'");i&&!o?r=oi:o&&!i?r=xt:r=n?oi:xt}return r(t,e)}var si;try{si=new RegExp(`(^|(?<!
21
21
  ))
22
22
  +(?!
23
- |$)`,"g")}catch{Yr=/\n+(?!\n|$)/g}function wn({comment:t,type:e,value:n},r,i,o){let{blockQuote:s,commentString:a,lineWidth:c}=r.options;if(!s||/\n[\t ]+$/.test(n))return Ke(n,r);let l=r.indent||(r.forceBlockIndent||vn(n)?" ":""),u=s==="literal"?!0:s==="folded"||e===Y.Scalar.BLOCK_FOLDED?!1:e===Y.Scalar.BLOCK_LITERAL?!0:!df(n,c,l.length);if(!n)return u?`|
23
+ |$)`,"g")}catch{si=/\n+(?!\n|$)/g}function Nn({comment:t,type:e,value:n},r,i,o){let{blockQuote:s,commentString:a,lineWidth:c}=r.options;if(!s||/\n[\t ]+$/.test(n))return Qe(n,r);let l=r.indent||(r.forceBlockIndent||An(n)?" ":""),u=s==="literal"?!0:s==="folded"||e===ee.Scalar.BLOCK_FOLDED?!1:e===ee.Scalar.BLOCK_LITERAL?!0:!Df(n,c,l.length);if(!n)return u?`|
24
24
  `:`>
25
25
  `;let f,d;for(d=n.length;d>0;--d){let S=n[d-1];if(S!==`
26
26
  `&&S!==" "&&S!==" ")break}let p=n.substring(d),g=p.indexOf(`
27
27
  `);g===-1?f="-":n===p||g!==p.length-1?(f="+",o&&o()):f="",p&&(n=n.slice(0,-p.length),p[p.length-1]===`
28
- `&&(p=p.slice(0,-1)),p=p.replace(Yr,`$&${l}`));let m=!1,h,v=-1;for(h=0;h<n.length;++h){let S=n[h];if(S===" ")m=!0;else if(S===`
29
- `)v=h;else break}let b=n.substring(0,v<h?v+1:h);b&&(n=n.substring(b.length),b=b.replace(/\n+/g,`$&${l}`));let C=(m?l?"2":"1":"")+f;if(t&&(C+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let S=n.replace(/\n+/g,`
30
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),_=!1,P=yn(r,!0);s!=="folded"&&e!==Y.Scalar.BLOCK_FOLDED&&(P.onOverflow=()=>{_=!0});let y=pe.foldFlowLines(`${b}${S}${p}`,l,pe.FOLD_BLOCK,P);if(!_)return`>${C}
31
- ${l}${y}`}return n=n.replace(/\n+/g,`$&${l}`),`|${C}
32
- ${l}${b}${n}${p}`}function mf(t,e,n,r){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(`
33
- `)||u&&/[[\]{},]/.test(o))return Ke(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(`
34
- `)?Ke(o,e):wn(t,e,n,r);if(!a&&!u&&i!==Y.Scalar.PLAIN&&o.includes(`
35
- `))return wn(t,e,n,r);if(vn(o)){if(c==="")return e.forceBlockIndent=!0,wn(t,e,n,r);if(a&&c===l)return Ke(o,e)}let f=o.replace(/\n+/g,`$&
36
- ${c}`);if(s){let d=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),{compat:p,tags:g}=e.doc.schema;if(g.some(d)||p?.some(d))return Ke(o,e)}return a?f:pe.foldFlowLines(f,c,pe.FOLD_FLOW,yn(e,!1))}function pf(t,e,n,r){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==Y.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=Y.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case Y.Scalar.BLOCK_FOLDED:case Y.Scalar.BLOCK_LITERAL:return i||o?Ke(s.value,e):wn(s,e,n,r);case Y.Scalar.QUOTE_DOUBLE:return wt(s.value,e);case Y.Scalar.QUOTE_SINGLE:return Jr(s.value,e);case Y.Scalar.PLAIN:return mf(s,e,n,r);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=i&&u||f;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}Es.stringifyString=pf});var vt=w(Hr=>{"use strict";var hf=un(),he=E(),gf=ht(),wf=yt();function yf(t,e){let n=Object.assign({blockQuote:!0,commentString:gf.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),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function vf(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let n,r;if(he.isScalar(e)){r=e.value;let i=t.filter(o=>o.identify?.(r));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}n=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else r=e,n=t.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function bf(t,e,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],o=(he.isScalar(t)||he.isCollection(t))&&t.anchor;o&&hf.anchorIsValid(o)&&(n.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(r.directives.tagString(s)),i.join(" ")}function kf(t,e,n,r){if(he.isPair(t))return t.toString(e,n,r);if(he.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 i,o=he.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=vf(e.doc.schema.tags,o));let s=bf(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,n,r):he.isScalar(o)?wf.stringifyString(o,e,n,r):o.toString(e,n,r);return s?he.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
37
- ${e.indent}${a}`:a}Hr.createStringifyContext=yf;Hr.stringify=kf});var Ns=w(Rs=>{"use strict";var se=E(),xs=A(),Ps=vt(),bt=ht();function Cf({key:t,value:e},n,r,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=n,d=se.isNode(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(se.isCollection(t)||!se.isNode(t)&&typeof t=="object"){let P="With simple keys, collection cannot be used as a key value";throw new Error(P)}}let p=!f&&(!t||d&&e==null&&!n.inFlow||se.isCollection(t)||(se.isScalar(t)?t.type===xs.Scalar.BLOCK_FOLDED||t.type===xs.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!o),indent:a+c});let g=!1,m=!1,h=Ps.stringify(t,n,()=>g=!0,()=>m=!0);if(!p&&!n.inFlow&&h.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(o||e==null)return g&&r&&r(),h===""?"?":p?`? ${h}`:h}else if(o&&!f||e==null&&p)return h=`? ${h}`,d&&!g?h+=bt.lineComment(h,n.indent,l(d)):m&&i&&i(),h;g&&(d=null),p?(d&&(h+=bt.lineComment(h,n.indent,l(d))),h=`? ${h}
38
- ${a}:`):(h=`${h}:`,d&&(h+=bt.lineComment(h,n.indent,l(d))));let v,b,k;se.isNode(e)?(v=!!e.spaceBefore,b=e.commentBefore,k=e.comment):(v=!1,b=null,k=null,e&&typeof e=="object"&&(e=s.createNode(e))),n.implicitKey=!1,!p&&!d&&se.isScalar(e)&&(n.indentAtStart=h.length+1),m=!1,!u&&c.length>=2&&!n.inFlow&&!p&&se.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let C=!1,S=Ps.stringify(e,n,()=>C=!0,()=>m=!0),_=" ";if(d||v||b){if(_=v?`
39
- `:"",b){let P=l(b);_+=`
40
- ${bt.indentComment(P,n.indent)}`}S===""&&!n.inFlow?_===`
41
- `&&k&&(_=`
28
+ `&&(p=p.slice(0,-1)),p=p.replace(si,`$&${l}`));let m=!1,h,y=-1;for(h=0;h<n.length;++h){let S=n[h];if(S===" ")m=!0;else if(S===`
29
+ `)y=h;else break}let b=n.substring(0,y<h?y+1:h);b&&(n=n.substring(b.length),b=b.replace(/\n+/g,`$&${l}`));let C=(m?l?"2":"1":"")+f;if(t&&(C+=" "+a(t.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){let S=n.replace(/\n+/g,`
30
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${l}`),E=!1,P=On(r,!0);s!=="folded"&&e!==ee.Scalar.BLOCK_FOLDED&&(P.onOverflow=()=>{E=!0});let v=ye.foldFlowLines(`${b}${S}${p}`,l,ye.FOLD_BLOCK,P);if(!E)return`>${C}
31
+ ${l}${v}`}return n=n.replace(/\n+/g,`$&${l}`),`|${C}
32
+ ${l}${b}${n}${p}`}function Wf(t,e,n,r){let{type:i,value:o}=t,{actualString:s,implicitKey:a,indent:c,indentStep:l,inFlow:u}=e;if(a&&o.includes(`
33
+ `)||u&&/[[\]{},]/.test(o))return Qe(o,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return a||u||!o.includes(`
34
+ `)?Qe(o,e):Nn(t,e,n,r);if(!a&&!u&&i!==ee.Scalar.PLAIN&&o.includes(`
35
+ `))return Nn(t,e,n,r);if(An(o)){if(c==="")return e.forceBlockIndent=!0,Nn(t,e,n,r);if(a&&c===l)return Qe(o,e)}let f=o.replace(/\n+/g,`$&
36
+ ${c}`);if(s){let d=m=>m.default&&m.tag!=="tag:yaml.org,2002:str"&&m.test?.test(f),{compat:p,tags:g}=e.doc.schema;if(g.some(d)||p?.some(d))return Qe(o,e)}return a?f:ye.foldFlowLines(f,c,ye.FOLD_FLOW,On(e,!1))}function Ff(t,e,n,r){let{implicitKey:i,inFlow:o}=e,s=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)}),{type:a}=t;a!==ee.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value)&&(a=ee.Scalar.QUOTE_DOUBLE);let c=u=>{switch(u){case ee.Scalar.BLOCK_FOLDED:case ee.Scalar.BLOCK_LITERAL:return i||o?Qe(s.value,e):Nn(s,e,n,r);case ee.Scalar.QUOTE_DOUBLE:return xt(s.value,e);case ee.Scalar.QUOTE_SINGLE:return oi(s.value,e);case ee.Scalar.PLAIN:return Wf(s,e,n,r);default:return null}},l=c(a);if(l===null){let{defaultKeyType:u,defaultStringType:f}=e.options,d=i&&u||f;if(l=c(d),l===null)throw new Error(`Unsupported default string type ${d}`)}return l}Ks.stringifyString=Ff});var Rt=w(ai=>{"use strict";var Bf=Cn(),ve=_(),Uf=Et(),Kf=Pt();function zf(t,e){let n=Object.assign({blockQuote:!0,commentString:Uf.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),r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:t,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function Jf(t,e){if(e.tag){let i=t.filter(o=>o.tag===e.tag);if(i.length>0)return i.find(o=>o.format===e.format)??i[0]}let n,r;if(ve.isScalar(e)){r=e.value;let i=t.filter(o=>o.identify?.(r));if(i.length>1){let o=i.filter(s=>s.test);o.length>0&&(i=o)}n=i.find(o=>o.format===e.format)??i.find(o=>!o.format)}else r=e,n=t.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!n){let i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return n}function Yf(t,e,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],o=(ve.isScalar(t)||ve.isCollection(t))&&t.anchor;o&&Bf.anchorIsValid(o)&&(n.add(o),i.push(`&${o}`));let s=t.tag??(e.default?null:e.tag);return s&&i.push(r.directives.tagString(s)),i.join(" ")}function Hf(t,e,n,r){if(ve.isPair(t))return t.toString(e,n,r);if(ve.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 i,o=ve.isNode(t)?t:e.doc.createNode(t,{onTagObj:c=>i=c});i??(i=Jf(e.doc.schema.tags,o));let s=Yf(o,i,e);s.length>0&&(e.indentAtStart=(e.indentAtStart??0)+s.length+1);let a=typeof i.stringify=="function"?i.stringify(o,e,n,r):ve.isScalar(o)?Kf.stringifyString(o,e,n,r):o.toString(e,n,r);return s?ve.isScalar(o)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
37
+ ${e.indent}${a}`:a}ai.createStringifyContext=zf;ai.stringify=Hf});var Hs=w(Ys=>{"use strict";var de=_(),zs=A(),Js=Rt(),Nt=Et();function Gf({key:t,value:e},n,r,i){let{allNullValues:o,doc:s,indent:a,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:f}}=n,d=de.isNode(t)&&t.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(de.isCollection(t)||!de.isNode(t)&&typeof t=="object"){let P="With simple keys, collection cannot be used as a key value";throw new Error(P)}}let p=!f&&(!t||d&&e==null&&!n.inFlow||de.isCollection(t)||(de.isScalar(t)?t.type===zs.Scalar.BLOCK_FOLDED||t.type===zs.Scalar.BLOCK_LITERAL:typeof t=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(f||!o),indent:a+c});let g=!1,m=!1,h=Js.stringify(t,n,()=>g=!0,()=>m=!0);if(!p&&!n.inFlow&&h.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");p=!0}if(n.inFlow){if(o||e==null)return g&&r&&r(),h===""?"?":p?`? ${h}`:h}else if(o&&!f||e==null&&p)return h=`? ${h}`,d&&!g?h+=Nt.lineComment(h,n.indent,l(d)):m&&i&&i(),h;g&&(d=null),p?(d&&(h+=Nt.lineComment(h,n.indent,l(d))),h=`? ${h}
38
+ ${a}:`):(h=`${h}:`,d&&(h+=Nt.lineComment(h,n.indent,l(d))));let y,b,k;de.isNode(e)?(y=!!e.spaceBefore,b=e.commentBefore,k=e.comment):(y=!1,b=null,k=null,e&&typeof e=="object"&&(e=s.createNode(e))),n.implicitKey=!1,!p&&!d&&de.isScalar(e)&&(n.indentAtStart=h.length+1),m=!1,!u&&c.length>=2&&!n.inFlow&&!p&&de.isSeq(e)&&!e.flow&&!e.tag&&!e.anchor&&(n.indent=n.indent.substring(2));let C=!1,S=Js.stringify(e,n,()=>C=!0,()=>m=!0),E=" ";if(d||y||b){if(E=y?`
39
+ `:"",b){let P=l(b);E+=`
40
+ ${Nt.indentComment(P,n.indent)}`}S===""&&!n.inFlow?E===`
41
+ `&&k&&(E=`
42
42
 
43
- `):_+=`
44
- ${n.indent}`}else if(!p&&se.isCollection(e)){let P=S[0],y=S.indexOf(`
45
- `),N=y!==-1,J=n.inFlow??e.flow??e.items.length===0;if(N||!J){let ne=!1;if(N&&(P==="&"||P==="!")){let R=S.indexOf(" ");P==="&"&&R!==-1&&R<y&&S[R+1]==="!"&&(R=S.indexOf(" ",R+1)),(R===-1||y<R)&&(ne=!0)}ne||(_=`
43
+ `):E+=`
44
+ ${n.indent}`}else if(!p&&de.isCollection(e)){let P=S[0],v=S.indexOf(`
45
+ `),N=v!==-1,Q=n.inFlow??e.flow??e.items.length===0;if(N||!Q){let ce=!1;if(N&&(P==="&"||P==="!")){let R=S.indexOf(" ");P==="&"&&R!==-1&&R<v&&S[R+1]==="!"&&(R=S.indexOf(" ",R+1)),(R===-1||v<R)&&(ce=!0)}ce||(E=`
46
46
  ${n.indent}`)}}else(S===""||S[0]===`
47
- `)&&(_="");return h+=_+S,n.inFlow?C&&r&&r():k&&!C?h+=bt.lineComment(h,n.indent,l(k)):m&&i&&i(),h}Rs.stringifyPair=Cf});var Gr=w(Vr=>{"use strict";var Os=rn("process");function Sf(t,...e){t==="debug"&&console.log(...e)}function _f(t,e){(t==="debug"||t==="warn")&&(typeof Os.emitWarning=="function"?Os.emitWarning(e):console.warn(e))}Vr.debug=Sf;Vr.warn=_f});var _n=w(Sn=>{"use strict";var Cn=E(),As=A(),bn="<<",kn={identify:t=>t===bn||typeof t=="symbol"&&t.description===bn,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new As.Scalar(Symbol(bn)),{addToJSMap:Is}),stringify:()=>bn},Ef=(t,e)=>(kn.identify(e)||Cn.isScalar(e)&&(!e.type||e.type===As.Scalar.PLAIN)&&kn.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===kn.tag&&n.default);function Is(t,e,n){let r=Ts(t,n);if(Cn.isSeq(r))for(let i of r.items)Xr(t,e,i);else if(Array.isArray(r))for(let i of r)Xr(t,e,i);else Xr(t,e,r)}function Xr(t,e,n){let r=Ts(t,n);if(!Cn.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function Ts(t,e){return t&&Cn.isAlias(e)?e.resolve(t.doc,t):e}Sn.addMergeToJSMap=Is;Sn.isMergeKey=Ef;Sn.merge=kn});var Zr=w(qs=>{"use strict";var xf=Gr(),js=_n(),Pf=vt(),Ls=E(),Qr=de();function Rf(t,e,{key:n,value:r}){if(Ls.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(js.isMergeKey(t,n))js.addMergeToJSMap(t,e,r);else{let i=Qr.toJS(n,"",t);if(e instanceof Map)e.set(i,Qr.toJS(r,i,t));else if(e instanceof Set)e.add(i);else{let o=Nf(n,i,t),s=Qr.toJS(r,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function Nf(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(Ls.isNode(t)&&n?.doc){let r=Pf.createStringifyContext(n.doc,{});r.anchors=new Set;for(let o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=t.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),xf.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(e)}qs.addPairToJSMap=Rf});var ge=w(ei=>{"use strict";var $s=pt(),Of=Ns(),Af=Zr(),En=E();function If(t,e,n){let r=$s.createNode(t,void 0,n),i=$s.createNode(e,void 0,n);return new xn(r,i)}var xn=class t{constructor(e,n=null){Object.defineProperty(this,En.NODE_TYPE,{value:En.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return En.isNode(n)&&(n=n.clone(e)),En.isNode(r)&&(r=r.clone(e)),new t(n,r)}toJSON(e,n){let r=n?.mapAsMap?new Map:{};return Af.addPairToJSMap(n,r,this)}toString(e,n,r){return e?.doc?Of.stringifyPair(this,e,n,r):JSON.stringify(this)}};ei.Pair=xn;ei.createPair=If});var ti=w(Ms=>{"use strict";var Oe=E(),Ds=vt(),Pn=ht();function Tf(t,e,n){return(e.inFlow??t.flow?Lf:jf)(t,e,n)}function jf({comment:t,items:e},n,{blockItemPrefix:r,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:o,type:null}),f=!1,d=[];for(let g=0;g<e.length;++g){let m=e[g],h=null;if(Oe.isNode(m))!f&&m.spaceBefore&&d.push(""),Rn(n,d,m.commentBefore,f),m.comment&&(h=m.comment);else if(Oe.isPair(m)){let b=Oe.isNode(m.key)?m.key:null;b&&(!f&&b.spaceBefore&&d.push(""),Rn(n,d,b.commentBefore,f))}f=!1;let v=Ds.stringify(m,u,()=>h=null,()=>f=!0);h&&(v+=Pn.lineComment(v,o,l(h))),f&&h&&(f=!1),d.push(r+v)}let p;if(d.length===0)p=i.start+i.end;else{p=d[0];for(let g=1;g<d.length;++g){let m=d[g];p+=m?`
47
+ `)&&(E="");return h+=E+S,n.inFlow?C&&r&&r():k&&!C?h+=Nt.lineComment(h,n.indent,l(k)):m&&i&&i(),h}Ys.stringifyPair=Gf});var li=w(ci=>{"use strict";var Gs=pn("process");function Vf(t,...e){t==="debug"&&console.log(...e)}function Xf(t,e){(t==="debug"||t==="warn")&&(typeof Gs.emitWarning=="function"?Gs.emitWarning(e):console.warn(e))}ci.debug=Vf;ci.warn=Xf});var qn=w(Ln=>{"use strict";var jn=_(),Vs=A(),In="<<",Tn={identify:t=>t===In||typeof t=="symbol"&&t.description===In,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Vs.Scalar(Symbol(In)),{addToJSMap:Xs}),stringify:()=>In},Qf=(t,e)=>(Tn.identify(e)||jn.isScalar(e)&&(!e.type||e.type===Vs.Scalar.PLAIN)&&Tn.identify(e.value))&&t?.doc.schema.tags.some(n=>n.tag===Tn.tag&&n.default);function Xs(t,e,n){let r=Qs(t,n);if(jn.isSeq(r))for(let i of r.items)ui(t,e,i);else if(Array.isArray(r))for(let i of r)ui(t,e,i);else ui(t,e,r)}function ui(t,e,n){let r=Qs(t,n);if(!jn.isMap(r))throw new Error("Merge sources must be maps or map aliases");let i=r.toJSON(null,t,Map);for(let[o,s]of i)e instanceof Map?e.has(o)||e.set(o,s):e instanceof Set?e.add(o):Object.prototype.hasOwnProperty.call(e,o)||Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0});return e}function Qs(t,e){return t&&jn.isAlias(e)?e.resolve(t.doc,t):e}Ln.addMergeToJSMap=Xs;Ln.isMergeKey=Qf;Ln.merge=Tn});var di=w(ta=>{"use strict";var Zf=li(),Zs=qn(),ed=Rt(),ea=_(),fi=ge();function td(t,e,{key:n,value:r}){if(ea.isNode(n)&&n.addToJSMap)n.addToJSMap(t,e,r);else if(Zs.isMergeKey(t,n))Zs.addMergeToJSMap(t,e,r);else{let i=fi.toJS(n,"",t);if(e instanceof Map)e.set(i,fi.toJS(r,i,t));else if(e instanceof Set)e.add(i);else{let o=nd(n,i,t),s=fi.toJS(r,o,t);o in e?Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0}):e[o]=s}}return e}function nd(t,e,n){if(e===null)return"";if(typeof e!="object")return String(e);if(ea.isNode(t)&&n?.doc){let r=ed.createStringifyContext(n.doc,{});r.anchors=new Set;for(let o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;let i=t.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(i);o.length>40&&(o=o.substring(0,36)+'..."'),Zf.warn(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return i}return JSON.stringify(e)}ta.addPairToJSMap=td});var be=w(mi=>{"use strict";var na=St(),rd=Hs(),id=di(),$n=_();function od(t,e,n){let r=na.createNode(t,void 0,n),i=na.createNode(e,void 0,n);return new Mn(r,i)}var Mn=class t{constructor(e,n=null){Object.defineProperty(this,$n.NODE_TYPE,{value:$n.PAIR}),this.key=e,this.value=n}clone(e){let{key:n,value:r}=this;return $n.isNode(n)&&(n=n.clone(e)),$n.isNode(r)&&(r=r.clone(e)),new t(n,r)}toJSON(e,n){let r=n?.mapAsMap?new Map:{};return id.addPairToJSMap(n,r,this)}toString(e,n,r){return e?.doc?rd.stringifyPair(this,e,n,r):JSON.stringify(this)}};mi.Pair=Mn;mi.createPair=od});var pi=w(ia=>{"use strict";var Me=_(),ra=Rt(),Dn=Et();function sd(t,e,n){return(e.inFlow??t.flow?cd:ad)(t,e,n)}function ad({comment:t,items:e},n,{blockItemPrefix:r,flowChars:i,itemIndent:o,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:o,type:null}),f=!1,d=[];for(let g=0;g<e.length;++g){let m=e[g],h=null;if(Me.isNode(m))!f&&m.spaceBefore&&d.push(""),Wn(n,d,m.commentBefore,f),m.comment&&(h=m.comment);else if(Me.isPair(m)){let b=Me.isNode(m.key)?m.key:null;b&&(!f&&b.spaceBefore&&d.push(""),Wn(n,d,b.commentBefore,f))}f=!1;let y=ra.stringify(m,u,()=>h=null,()=>f=!0);h&&(y+=Dn.lineComment(y,o,l(h))),f&&h&&(f=!1),d.push(r+y)}let p;if(d.length===0)p=i.start+i.end;else{p=d[0];for(let g=1;g<d.length;++g){let m=d[g];p+=m?`
48
48
  ${c}${m}`:`
49
49
  `}}return t?(p+=`
50
- `+Pn.indentComment(l(t),c),a&&a()):f&&s&&s(),p}function Lf({items:t},e,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;r+=o;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),l=!1,u=0,f=[];for(let g=0;g<t.length;++g){let m=t[g],h=null;if(Oe.isNode(m))m.spaceBefore&&f.push(""),Rn(e,f,m.commentBefore,!1),m.comment&&(h=m.comment);else if(Oe.isPair(m)){let b=Oe.isNode(m.key)?m.key:null;b&&(b.spaceBefore&&f.push(""),Rn(e,f,b.commentBefore,!1),b.comment&&(l=!0));let k=Oe.isNode(m.value)?m.value:null;k?(k.comment&&(h=k.comment),k.commentBefore&&(l=!0)):m.value==null&&b?.comment&&(h=b.comment)}h&&(l=!0);let v=Ds.stringify(m,c,()=>h=null);l||(l=f.length>u||v.includes(`
51
- `)),g<t.length-1?v+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=f.reduce((b,k)=>b+k.length+2,2)+(v.length+2)>e.options.lineWidth)),l&&(v+=",")),h&&(v+=Pn.lineComment(v,r,a(h))),f.push(v),u=f.length}let{start:d,end:p}=n;if(f.length===0)return d+p;if(!l){let g=f.reduce((m,h)=>m+h.length+2,2);l=e.options.lineWidth>0&&g>e.options.lineWidth}if(l){let g=d;for(let m of f)g+=m?`
50
+ `+Dn.indentComment(l(t),c),a&&a()):f&&s&&s(),p}function cd({items:t},e,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:o,flowCollectionPadding:s,options:{commentString:a}}=e;r+=o;let c=Object.assign({},e,{indent:r,inFlow:!0,type:null}),l=!1,u=0,f=[];for(let g=0;g<t.length;++g){let m=t[g],h=null;if(Me.isNode(m))m.spaceBefore&&f.push(""),Wn(e,f,m.commentBefore,!1),m.comment&&(h=m.comment);else if(Me.isPair(m)){let b=Me.isNode(m.key)?m.key:null;b&&(b.spaceBefore&&f.push(""),Wn(e,f,b.commentBefore,!1),b.comment&&(l=!0));let k=Me.isNode(m.value)?m.value:null;k?(k.comment&&(h=k.comment),k.commentBefore&&(l=!0)):m.value==null&&b?.comment&&(h=b.comment)}h&&(l=!0);let y=ra.stringify(m,c,()=>h=null);l||(l=f.length>u||y.includes(`
51
+ `)),g<t.length-1?y+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(l||(l=f.reduce((b,k)=>b+k.length+2,2)+(y.length+2)>e.options.lineWidth)),l&&(y+=",")),h&&(y+=Dn.lineComment(y,r,a(h))),f.push(y),u=f.length}let{start:d,end:p}=n;if(f.length===0)return d+p;if(!l){let g=f.reduce((m,h)=>m+h.length+2,2);l=e.options.lineWidth>0&&g>e.options.lineWidth}if(l){let g=d;for(let m of f)g+=m?`
52
52
  ${o}${i}${m}`:`
53
53
  `;return`${g}
54
- ${i}${p}`}else return`${d}${s}${f.join(" ")}${s}${p}`}function Rn({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let o=Pn.indentComment(e(r),t);n.push(o.trimStart())}}Ms.stringifyCollection=Tf});var ye=w(ri=>{"use strict";var qf=ti(),$f=Zr(),Df=pn(),we=E(),Nn=ge(),Mf=A();function kt(t,e){let n=we.isScalar(e)?e.value:e;for(let r of t)if(we.isPair(r)&&(r.key===e||r.key===n||we.isScalar(r.key)&&r.key.value===n))return r}var ni=class extends Df.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(we.MAP,e),this.items=[]}static from(e,n,r){let{keepUndefined:i,replacer:o}=r,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(n,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(Nn.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,n){let r;we.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Nn.Pair(e,e?.value):r=new Nn.Pair(e.key,e.value);let i=kt(this.items,r.key),o=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);we.isScalar(i.value)&&Mf.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(o){let s=this.items.findIndex(a=>o(r,a)<0);s===-1?this.items.push(r):this.items.splice(s,0,r)}else this.items.push(r)}delete(e){let n=kt(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let i=kt(this.items,e)?.value;return(!n&&we.isScalar(i)?i.value:i)??void 0}has(e){return!!kt(this.items,e)}set(e,n){this.add(new Nn.Pair(e,n),!0)}toJSON(e,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let o of this.items)$f.addPairToJSMap(n,i,o);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!we.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),qf.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}};ri.YAMLMap=ni;ri.findPair=kt});var ze=w(Fs=>{"use strict";var Wf=E(),Ws=ye(),Ff={collection:"map",default:!0,nodeClass:Ws.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return Wf.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>Ws.YAMLMap.from(t,e,n)};Fs.map=Ff});var ve=w(Bs=>{"use strict";var Bf=pt(),Uf=ti(),Kf=pn(),An=E(),zf=A(),Jf=de(),ii=class extends Kf.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(An.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=On(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=On(e);if(typeof r!="number")return;let i=this.items[r];return!n&&An.isScalar(i)?i.value:i}has(e){let n=On(e);return typeof n=="number"&&n<this.items.length}set(e,n){let r=On(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[r];An.isScalar(i)&&zf.isScalarValue(n)?i.value=n:this.items[r]=n}toJSON(e,n){let r=[];n?.onCreate&&n.onCreate(r);let i=0;for(let o of this.items)r.push(Jf.toJS(o,String(i++),n));return r}toString(e,n,r){return e?Uf.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,o=new this(e);if(n&&Symbol.iterator in Object(n)){let s=0;for(let a of n){if(typeof i=="function"){let c=n instanceof Set?a:String(s++);a=i.call(n,c,a)}o.items.push(Bf.createNode(a,void 0,r))}}return o}};function On(t){let e=An.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}Bs.YAMLSeq=ii});var Je=w(Ks=>{"use strict";var Yf=E(),Us=ve(),Hf={collection:"seq",default:!0,nodeClass:Us.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return Yf.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>Us.YAMLSeq.from(t,e,n)};Ks.seq=Hf});var Ct=w(zs=>{"use strict";var Vf=yt(),Gf={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),Vf.stringifyString(t,e,n,r)}};zs.string=Gf});var In=w(Hs=>{"use strict";var Js=A(),Ys={identify:t=>t==null,createNode:()=>new Js.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Js.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&Ys.test.test(t)?t:e.options.nullStr};Hs.nullTag=Ys});var oi=w(Gs=>{"use strict";var Xf=A(),Vs={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Xf.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&Vs.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};Gs.boolTag=Vs});var Ye=w(Xs=>{"use strict";function Qf({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}Xs.stringifyNumber=Qf});var ai=w(Tn=>{"use strict";var Zf=A(),si=Ye(),ed={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:si.stringifyNumber},td={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():si.stringifyNumber(t)}},nd={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 Zf.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:si.stringifyNumber};Tn.float=nd;Tn.floatExp=td;Tn.floatNaN=ed});var li=w(Ln=>{"use strict";var Qs=Ye(),jn=t=>typeof t=="bigint"||Number.isInteger(t),ci=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function Zs(t,e,n){let{value:r}=t;return jn(r)&&r>=0?n+r.toString(e):Qs.stringifyNumber(t)}var rd={identify:t=>jn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>ci(t,2,8,n),stringify:t=>Zs(t,8,"0o")},id={identify:jn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>ci(t,0,10,n),stringify:Qs.stringifyNumber},od={identify:t=>jn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>ci(t,2,16,n),stringify:t=>Zs(t,16,"0x")};Ln.int=id;Ln.intHex=od;Ln.intOct=rd});var ta=w(ea=>{"use strict";var sd=ze(),ad=In(),cd=Je(),ld=Ct(),ud=oi(),ui=ai(),fi=li(),fd=[sd.map,cd.seq,ld.string,ad.nullTag,ud.boolTag,fi.intOct,fi.int,fi.intHex,ui.floatNaN,ui.floatExp,ui.float];ea.schema=fd});var ia=w(ra=>{"use strict";var dd=A(),md=ze(),pd=Je();function na(t){return typeof t=="bigint"||Number.isInteger(t)}var qn=({value:t})=>JSON.stringify(t),hd=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:qn},{identify:t=>t==null,createNode:()=>new dd.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:qn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:qn},{identify:na,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>na(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:qn}],gd={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},wd=[md.map,pd.seq].concat(hd,gd);ra.schema=wd});var mi=w(oa=>{"use strict";var St=rn("buffer"),di=A(),yd=yt(),vd={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof St.Buffer=="function")return St.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},r,i,o){if(!n)return"";let s=n,a;if(typeof St.Buffer=="function")a=s instanceof St.Buffer?s.toString("base64"):St.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<s.length;++l)c+=String.fromCharCode(s[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=di.Scalar.BLOCK_LITERAL),e!==di.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let f=0,d=0;f<l;++f,d+=c)u[f]=a.substr(d,c);a=u.join(e===di.Scalar.BLOCK_LITERAL?`
55
- `:" ")}return yd.stringifyString({comment:t,type:e,value:a},r,i,o)}};oa.binary=vd});var Mn=w(Dn=>{"use strict";var $n=E(),pi=ge(),bd=A(),kd=ve();function sa(t,e){if($n.isSeq(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!$n.isPair(r)){if($n.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let i=r.items[0]||new pi.Pair(new bd.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
54
+ ${i}${p}`}else return`${d}${s}${f.join(" ")}${s}${p}`}function Wn({indent:t,options:{commentString:e}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let o=Dn.indentComment(e(r),t);n.push(o.trimStart())}}ia.stringifyCollection=sd});var Ce=w(gi=>{"use strict";var ld=pi(),ud=di(),fd=xn(),ke=_(),Fn=be(),dd=A();function Ot(t,e){let n=ke.isScalar(e)?e.value:e;for(let r of t)if(ke.isPair(r)&&(r.key===e||r.key===n||ke.isScalar(r.key)&&r.key.value===n))return r}var hi=class extends fd.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(ke.MAP,e),this.items=[]}static from(e,n,r){let{keepUndefined:i,replacer:o}=r,s=new this(e),a=(c,l)=>{if(typeof o=="function")l=o.call(n,c,l);else if(Array.isArray(o)&&!o.includes(c))return;(l!==void 0||i)&&s.items.push(Fn.createPair(c,l,r))};if(n instanceof Map)for(let[c,l]of n)a(c,l);else if(n&&typeof n=="object")for(let c of Object.keys(n))a(c,n[c]);return typeof e.sortMapEntries=="function"&&s.items.sort(e.sortMapEntries),s}add(e,n){let r;ke.isPair(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new Fn.Pair(e,e?.value):r=new Fn.Pair(e.key,e.value);let i=Ot(this.items,r.key),o=this.schema?.sortMapEntries;if(i){if(!n)throw new Error(`Key ${r.key} already set`);ke.isScalar(i.value)&&dd.isScalarValue(r.value)?i.value.value=r.value:i.value=r.value}else if(o){let s=this.items.findIndex(a=>o(r,a)<0);s===-1?this.items.push(r):this.items.splice(s,0,r)}else this.items.push(r)}delete(e){let n=Ot(this.items,e);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(e,n){let i=Ot(this.items,e)?.value;return(!n&&ke.isScalar(i)?i.value:i)??void 0}has(e){return!!Ot(this.items,e)}set(e,n){this.add(new Fn.Pair(e,n),!0)}toJSON(e,n,r){let i=r?new r:n?.mapAsMap?new Map:{};n?.onCreate&&n.onCreate(i);for(let o of this.items)ud.addPairToJSMap(n,i,o);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let i of this.items)if(!ke.isPair(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),ld.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:n})}};gi.YAMLMap=hi;gi.findPair=Ot});var Ze=w(sa=>{"use strict";var md=_(),oa=Ce(),pd={collection:"map",default:!0,nodeClass:oa.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(t,e){return md.isMap(t)||e("Expected a mapping for this tag"),t},createNode:(t,e,n)=>oa.YAMLMap.from(t,e,n)};sa.map=pd});var Se=w(aa=>{"use strict";var hd=St(),gd=pi(),wd=xn(),Un=_(),yd=A(),vd=ge(),wi=class extends wd.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Un.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let n=Bn(e);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(e,n){let r=Bn(e);if(typeof r!="number")return;let i=this.items[r];return!n&&Un.isScalar(i)?i.value:i}has(e){let n=Bn(e);return typeof n=="number"&&n<this.items.length}set(e,n){let r=Bn(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);let i=this.items[r];Un.isScalar(i)&&yd.isScalarValue(n)?i.value=n:this.items[r]=n}toJSON(e,n){let r=[];n?.onCreate&&n.onCreate(r);let i=0;for(let o of this.items)r.push(vd.toJS(o,String(i++),n));return r}toString(e,n,r){return e?gd.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,o=new this(e);if(n&&Symbol.iterator in Object(n)){let s=0;for(let a of n){if(typeof i=="function"){let c=n instanceof Set?a:String(s++);a=i.call(n,c,a)}o.items.push(hd.createNode(a,void 0,r))}}return o}};function Bn(t){let e=Un.isScalar(t)?t.value:t;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}aa.YAMLSeq=wi});var et=w(la=>{"use strict";var bd=_(),ca=Se(),kd={collection:"seq",default:!0,nodeClass:ca.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(t,e){return bd.isSeq(t)||e("Expected a sequence for this tag"),t},createNode:(t,e,n)=>ca.YAMLSeq.from(t,e,n)};la.seq=kd});var At=w(ua=>{"use strict";var Cd=Pt(),Sd={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,e,n,r){return e=Object.assign({actualString:!0},e),Cd.stringifyString(t,e,n,r)}};ua.string=Sd});var Kn=w(ma=>{"use strict";var fa=A(),da={identify:t=>t==null,createNode:()=>new fa.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new fa.Scalar(null),stringify:({source:t},e)=>typeof t=="string"&&da.test.test(t)?t:e.options.nullStr};ma.nullTag=da});var yi=w(ha=>{"use strict";var Ed=A(),pa={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new Ed.Scalar(t[0]==="t"||t[0]==="T"),stringify({source:t,value:e},n){if(t&&pa.test.test(t)){let r=t[0]==="t"||t[0]==="T";if(e===r)return t}return e?n.options.trueStr:n.options.falseStr}};ha.boolTag=pa});var tt=w(ga=>{"use strict";function _d({format:t,minFractionDigits:e,tag:n,value:r}){if(typeof r=="bigint")return String(r);let i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!t&&e&&(!n||n==="tag:yaml.org,2002:float")&&/^-?\d/.test(o)&&!o.includes("e")){let s=o.indexOf(".");s<0&&(s=o.length,o+=".");let a=e-(o.length-s-1);for(;a-- >0;)o+="0"}return o}ga.stringifyNumber=_d});var bi=w(zn=>{"use strict";var xd=A(),vi=tt(),Pd={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:vi.stringifyNumber},Rd={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():vi.stringifyNumber(t)}},Nd={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 xd.Scalar(parseFloat(t)),n=t.indexOf(".");return n!==-1&&t[t.length-1]==="0"&&(e.minFractionDigits=t.length-n-1),e},stringify:vi.stringifyNumber};zn.float=Nd;zn.floatExp=Rd;zn.floatNaN=Pd});var Ci=w(Yn=>{"use strict";var wa=tt(),Jn=t=>typeof t=="bigint"||Number.isInteger(t),ki=(t,e,n,{intAsBigInt:r})=>r?BigInt(t):parseInt(t.substring(e),n);function ya(t,e,n){let{value:r}=t;return Jn(r)&&r>=0?n+r.toString(e):wa.stringifyNumber(t)}var Od={identify:t=>Jn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,e,n)=>ki(t,2,8,n),stringify:t=>ya(t,8,"0o")},Ad={identify:Jn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,e,n)=>ki(t,0,10,n),stringify:wa.stringifyNumber},Id={identify:t=>Jn(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,e,n)=>ki(t,2,16,n),stringify:t=>ya(t,16,"0x")};Yn.int=Ad;Yn.intHex=Id;Yn.intOct=Od});var ba=w(va=>{"use strict";var Td=Ze(),jd=Kn(),Ld=et(),qd=At(),$d=yi(),Si=bi(),Ei=Ci(),Md=[Td.map,Ld.seq,qd.string,jd.nullTag,$d.boolTag,Ei.intOct,Ei.int,Ei.intHex,Si.floatNaN,Si.floatExp,Si.float];va.schema=Md});var Sa=w(Ca=>{"use strict";var Dd=A(),Wd=Ze(),Fd=et();function ka(t){return typeof t=="bigint"||Number.isInteger(t)}var Hn=({value:t})=>JSON.stringify(t),Bd=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:Hn},{identify:t=>t==null,createNode:()=>new Dd.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Hn},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:Hn},{identify:ka,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,e,{intAsBigInt:n})=>n?BigInt(t):parseInt(t,10),stringify:({value:t})=>ka(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:Hn}],Ud={default:!0,tag:"",test:/^/,resolve(t,e){return e(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},Kd=[Wd.map,Fd.seq].concat(Bd,Ud);Ca.schema=Kd});var xi=w(Ea=>{"use strict";var It=pn("buffer"),_i=A(),zd=Pt(),Jd={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,e){if(typeof It.Buffer=="function")return It.Buffer.from(t,"base64");if(typeof atob=="function"){let n=atob(t.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let i=0;i<n.length;++i)r[i]=n.charCodeAt(i);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:e,value:n},r,i,o){if(!n)return"";let s=n,a;if(typeof It.Buffer=="function")a=s instanceof It.Buffer?s.toString("base64"):It.Buffer.from(s.buffer).toString("base64");else if(typeof btoa=="function"){let c="";for(let l=0;l<s.length;++l)c+=String.fromCharCode(s[l]);a=btoa(c)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=_i.Scalar.BLOCK_LITERAL),e!==_i.Scalar.QUOTE_DOUBLE){let c=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),l=Math.ceil(a.length/c),u=new Array(l);for(let f=0,d=0;f<l;++f,d+=c)u[f]=a.substr(d,c);a=u.join(e===_i.Scalar.BLOCK_LITERAL?`
55
+ `:" ")}return zd.stringifyString({comment:t,type:e,value:a},r,i,o)}};Ea.binary=Jd});var Xn=w(Vn=>{"use strict";var Gn=_(),Pi=be(),Yd=A(),Hd=Se();function _a(t,e){if(Gn.isSeq(t))for(let n=0;n<t.items.length;++n){let r=t.items[n];if(!Gn.isPair(r)){if(Gn.isMap(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");let i=r.items[0]||new Pi.Pair(new Yd.Scalar(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
56
56
  ${i.key.commentBefore}`:r.commentBefore),r.comment){let o=i.value??i.key;o.comment=o.comment?`${r.comment}
57
- ${o.comment}`:r.comment}r=i}t.items[n]=$n.isPair(r)?r:new pi.Pair(r)}}else e("Expected a sequence for this tag");return t}function aa(t,e,n){let{replacer:r}=n,i=new kd.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof r=="function"&&(s=r.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(pi.createPair(a,c,n))}return i}var Cd={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:sa,createNode:aa};Dn.createPairs=aa;Dn.pairs=Cd;Dn.resolvePairs=sa});var wi=w(gi=>{"use strict";var ca=E(),hi=de(),_t=ye(),Sd=ve(),la=Mn(),Ae=class t extends Sd.YAMLSeq{constructor(){super(),this.add=_t.YAMLMap.prototype.add.bind(this),this.delete=_t.YAMLMap.prototype.delete.bind(this),this.get=_t.YAMLMap.prototype.get.bind(this),this.has=_t.YAMLMap.prototype.has.bind(this),this.set=_t.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let o,s;if(ca.isPair(i)?(o=hi.toJS(i.key,"",n),s=hi.toJS(i.value,o,n)):o=hi.toJS(i,"",n),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,s)}return r}static from(e,n,r){let i=la.createPairs(e,n,r),o=new this;return o.items=i.items,o}};Ae.tag="tag:yaml.org,2002:omap";var _d={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ae,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=la.resolvePairs(t,e),r=[];for(let{key:i}of n.items)ca.isScalar(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Ae,n)},createNode:(t,e,n)=>Ae.from(t,e,n)};gi.YAMLOMap=Ae;gi.omap=_d});var pa=w(yi=>{"use strict";var ua=A();function fa({value:t,source:e},n){return e&&(t?da:ma).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var da={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 ua.Scalar(!0),stringify:fa},ma={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 ua.Scalar(!1),stringify:fa};yi.falseTag=ma;yi.trueTag=da});var ha=w(Wn=>{"use strict";var Ed=A(),vi=Ye(),xd={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:vi.stringifyNumber},Pd={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():vi.stringifyNumber(t)}},Rd={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 Ed.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:vi.stringifyNumber};Wn.float=Rd;Wn.floatExp=Pd;Wn.floatNaN=xd});var wa=w(xt=>{"use strict";var ga=Ye(),Et=t=>typeof t=="bigint"||Number.isInteger(t);function Fn(t,e,n,{intAsBigInt:r}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,n);return i==="-"?-1*o:o}function bi(t,e,n){let{value:r}=t;if(Et(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return ga.stringifyNumber(t)}var Nd={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Fn(t,2,2,n),stringify:t=>bi(t,2,"0b")},Od={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Fn(t,1,8,n),stringify:t=>bi(t,8,"0")},Ad={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Fn(t,0,10,n),stringify:ga.stringifyNumber},Id={identify:Et,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Fn(t,2,16,n),stringify:t=>bi(t,16,"0x")};xt.int=Ad;xt.intBin=Nd;xt.intHex=Id;xt.intOct=Od});var Ci=w(ki=>{"use strict";var Kn=E(),Bn=ge(),Un=ye(),Ie=class t extends Un.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;Kn.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new Bn.Pair(e.key,null):n=new Bn.Pair(e,null),Un.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=Un.findPair(this.items,e);return!n&&Kn.isPair(r)?Kn.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=Un.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Bn.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:i}=r,o=new this(e);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof i=="function"&&(s=i.call(n,s,s)),o.items.push(Bn.createPair(s,null,r));return o}};Ie.tag="tag:yaml.org,2002:set";var Td={collection:"map",identify:t=>t instanceof Set,nodeClass:Ie,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>Ie.from(t,e,n),resolve(t,e){if(Kn.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ie,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ki.YAMLSet=Ie;ki.set=Td});var _i=w(zn=>{"use strict";var jd=Ye();function Si(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=r.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return n==="-"?i(-1)*o:o}function ya(t){let{value:e}=t,n=s=>s;if(typeof e=="bigint")n=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return jd.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let i=n(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),r+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var Ld={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:n})=>Si(t,n),stringify:ya},qd={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=>Si(t,!1),stringify:ya},va={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(va.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let f=Si(u,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};zn.floatTime=qd;zn.intTime=Ld;zn.timestamp=va});var Ca=w(ka=>{"use strict";var $d=ze(),Dd=In(),Md=Je(),Wd=Ct(),Fd=mi(),ba=pa(),Ei=ha(),Jn=wa(),Bd=_n(),Ud=wi(),Kd=Mn(),zd=Ci(),xi=_i(),Jd=[$d.map,Md.seq,Wd.string,Dd.nullTag,ba.trueTag,ba.falseTag,Jn.intBin,Jn.intOct,Jn.int,Jn.intHex,Ei.floatNaN,Ei.floatExp,Ei.float,Fd.binary,Bd.merge,Ud.omap,Kd.pairs,zd.set,xi.intTime,xi.floatTime,xi.timestamp];ka.schema=Jd});var Ia=w(Ni=>{"use strict";var xa=ze(),Yd=In(),Pa=Je(),Hd=Ct(),Vd=oi(),Pi=ai(),Ri=li(),Gd=ta(),Xd=ia(),Ra=mi(),Pt=_n(),Na=wi(),Oa=Mn(),Sa=Ca(),Aa=Ci(),Yn=_i(),_a=new Map([["core",Gd.schema],["failsafe",[xa.map,Pa.seq,Hd.string]],["json",Xd.schema],["yaml11",Sa.schema],["yaml-1.1",Sa.schema]]),Ea={binary:Ra.binary,bool:Vd.boolTag,float:Pi.float,floatExp:Pi.floatExp,floatNaN:Pi.floatNaN,floatTime:Yn.floatTime,int:Ri.int,intHex:Ri.intHex,intOct:Ri.intOct,intTime:Yn.intTime,map:xa.map,merge:Pt.merge,null:Yd.nullTag,omap:Na.omap,pairs:Oa.pairs,seq:Pa.seq,set:Aa.set,timestamp:Yn.timestamp},Qd={"tag:yaml.org,2002:binary":Ra.binary,"tag:yaml.org,2002:merge":Pt.merge,"tag:yaml.org,2002:omap":Na.omap,"tag:yaml.org,2002:pairs":Oa.pairs,"tag:yaml.org,2002:set":Aa.set,"tag:yaml.org,2002:timestamp":Yn.timestamp};function Zd(t,e,n){let r=_a.get(e);if(r&&!t)return n&&!r.includes(Pt.merge)?r.concat(Pt.merge):r.slice();let i=r;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(_a.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return n&&(i=i.concat(Pt.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?Ea[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(Ea).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}Ni.coreKnownTags=Qd;Ni.getTags=Zd});var Ii=w(Ta=>{"use strict";var Oi=E(),em=ze(),tm=Je(),nm=Ct(),Hn=Ia(),rm=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Ai=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?Hn.getTags(e,"compat"):e?Hn.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?Hn.coreKnownTags:{},this.tags=Hn.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,Oi.MAP,{value:em.map}),Object.defineProperty(this,Oi.SCALAR,{value:nm.string}),Object.defineProperty(this,Oi.SEQ,{value:tm.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?rm:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Ta.Schema=Ai});var La=w(ja=>{"use strict";var im=E(),Ti=vt(),Rt=ht();function om(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let i=Ti.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=o(t.commentBefore);n.unshift(Rt.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(im.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);n.push(Rt.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=Ti.stringify(t.contents,i,()=>a=null,c);a&&(l+=Rt.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(Ti.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(`
58
- `)?(n.push("..."),n.push(Rt.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&n[n.length-1]!==""&&n.push(""),n.push(Rt.indentComment(o(c),"")))}return n.join(`
57
+ ${o.comment}`:r.comment}r=i}t.items[n]=Gn.isPair(r)?r:new Pi.Pair(r)}}else e("Expected a sequence for this tag");return t}function xa(t,e,n){let{replacer:r}=n,i=new Hd.YAMLSeq(t);i.tag="tag:yaml.org,2002:pairs";let o=0;if(e&&Symbol.iterator in Object(e))for(let s of e){typeof r=="function"&&(s=r.call(e,String(o++),s));let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw new TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let l=Object.keys(s);if(l.length===1)a=l[0],c=s[a];else throw new TypeError(`Expected tuple with one key, not ${l.length} keys`)}else a=s;i.items.push(Pi.createPair(a,c,n))}return i}var Gd={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:_a,createNode:xa};Vn.createPairs=xa;Vn.pairs=Gd;Vn.resolvePairs=_a});var Oi=w(Ni=>{"use strict";var Pa=_(),Ri=ge(),Tt=Ce(),Vd=Se(),Ra=Xn(),De=class t extends Vd.YAMLSeq{constructor(){super(),this.add=Tt.YAMLMap.prototype.add.bind(this),this.delete=Tt.YAMLMap.prototype.delete.bind(this),this.get=Tt.YAMLMap.prototype.get.bind(this),this.has=Tt.YAMLMap.prototype.has.bind(this),this.set=Tt.YAMLMap.prototype.set.bind(this),this.tag=t.tag}toJSON(e,n){if(!n)return super.toJSON(e);let r=new Map;n?.onCreate&&n.onCreate(r);for(let i of this.items){let o,s;if(Pa.isPair(i)?(o=Ri.toJS(i.key,"",n),s=Ri.toJS(i.value,o,n)):o=Ri.toJS(i,"",n),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,s)}return r}static from(e,n,r){let i=Ra.createPairs(e,n,r),o=new this;return o.items=i.items,o}};De.tag="tag:yaml.org,2002:omap";var Xd={collection:"seq",identify:t=>t instanceof Map,nodeClass:De,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,e){let n=Ra.resolvePairs(t,e),r=[];for(let{key:i}of n.items)Pa.isScalar(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new De,n)},createNode:(t,e,n)=>De.from(t,e,n)};Ni.YAMLOMap=De;Ni.omap=Xd});var Ta=w(Ai=>{"use strict";var Na=A();function Oa({value:t,source:e},n){return e&&(t?Aa:Ia).test.test(e)?e:t?n.options.trueStr:n.options.falseStr}var Aa={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 Na.Scalar(!0),stringify:Oa},Ia={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 Na.Scalar(!1),stringify:Oa};Ai.falseTag=Ia;Ai.trueTag=Aa});var ja=w(Qn=>{"use strict";var Qd=A(),Ii=tt(),Zd={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:Ii.stringifyNumber},em={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():Ii.stringifyNumber(t)}},tm={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 Qd.Scalar(parseFloat(t.replace(/_/g,""))),n=t.indexOf(".");if(n!==-1){let r=t.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Ii.stringifyNumber};Qn.float=tm;Qn.floatExp=em;Qn.floatNaN=Zd});var qa=w(Lt=>{"use strict";var La=tt(),jt=t=>typeof t=="bigint"||Number.isInteger(t);function Zn(t,e,n,{intAsBigInt:r}){let i=t[0];if((i==="-"||i==="+")&&(e+=1),t=t.substring(e).replace(/_/g,""),r){switch(n){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}let s=BigInt(t);return i==="-"?BigInt(-1)*s:s}let o=parseInt(t,n);return i==="-"?-1*o:o}function Ti(t,e,n){let{value:r}=t;if(jt(r)){let i=r.toString(e);return r<0?"-"+n+i.substr(1):n+i}return La.stringifyNumber(t)}var nm={identify:jt,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,e,n)=>Zn(t,2,2,n),stringify:t=>Ti(t,2,"0b")},rm={identify:jt,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,e,n)=>Zn(t,1,8,n),stringify:t=>Ti(t,8,"0")},im={identify:jt,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,e,n)=>Zn(t,0,10,n),stringify:La.stringifyNumber},om={identify:jt,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,e,n)=>Zn(t,2,16,n),stringify:t=>Ti(t,16,"0x")};Lt.int=im;Lt.intBin=nm;Lt.intHex=om;Lt.intOct=rm});var Li=w(ji=>{"use strict";var nr=_(),er=be(),tr=Ce(),We=class t extends tr.YAMLMap{constructor(e){super(e),this.tag=t.tag}add(e){let n;nr.isPair(e)?n=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?n=new er.Pair(e.key,null):n=new er.Pair(e,null),tr.findPair(this.items,n.key)||this.items.push(n)}get(e,n){let r=tr.findPair(this.items,e);return!n&&nr.isPair(r)?nr.isScalar(r.key)?r.key.value:r.key:r}set(e,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);let r=tr.findPair(this.items,e);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new er.Pair(e))}toJSON(e,n){return super.toJSON(e,n,Set)}toString(e,n,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(e,n,r){let{replacer:i}=r,o=new this(e);if(n&&Symbol.iterator in Object(n))for(let s of n)typeof i=="function"&&(s=i.call(n,s,s)),o.items.push(er.createPair(s,null,r));return o}};We.tag="tag:yaml.org,2002:set";var sm={collection:"map",identify:t=>t instanceof Set,nodeClass:We,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,e,n)=>We.from(t,e,n),resolve(t,e){if(nr.isMap(t)){if(t.hasAllNullValues(!0))return Object.assign(new We,t);e("Set items must all have null values")}else e("Expected a mapping for this tag");return t}};ji.YAMLSet=We;ji.set=sm});var $i=w(rr=>{"use strict";var am=tt();function qi(t,e){let n=t[0],r=n==="-"||n==="+"?t.substring(1):t,i=s=>e?BigInt(s):Number(s),o=r.replace(/_/g,"").split(":").reduce((s,a)=>s*i(60)+i(a),i(0));return n==="-"?i(-1)*o:o}function $a(t){let{value:e}=t,n=s=>s;if(typeof e=="bigint")n=s=>BigInt(s);else if(isNaN(e)||!isFinite(e))return am.stringifyNumber(t);let r="";e<0&&(r="-",e*=n(-1));let i=n(60),o=[e%i];return e<60?o.unshift(0):(e=(e-o[0])/i,o.unshift(e%i),e>=60&&(e=(e-o[0])/i,o.unshift(e))),r+o.map(s=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var cm={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:n})=>qi(t,n),stringify:$a},lm={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=>qi(t,!1),stringify:$a},Ma={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(Ma.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,o,s,a]=e.map(Number),c=e[7]?Number((e[7]+"00").substr(1,3)):0,l=Date.UTC(n,r-1,i,o||0,s||0,a||0,c),u=e[8];if(u&&u!=="Z"){let f=qi(u,!1);Math.abs(f)<30&&(f*=60),l-=6e4*f}return new Date(l)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};rr.floatTime=lm;rr.intTime=cm;rr.timestamp=Ma});var Fa=w(Wa=>{"use strict";var um=Ze(),fm=Kn(),dm=et(),mm=At(),pm=xi(),Da=Ta(),Mi=ja(),ir=qa(),hm=qn(),gm=Oi(),wm=Xn(),ym=Li(),Di=$i(),vm=[um.map,dm.seq,mm.string,fm.nullTag,Da.trueTag,Da.falseTag,ir.intBin,ir.intOct,ir.int,ir.intHex,Mi.floatNaN,Mi.floatExp,Mi.float,pm.binary,hm.merge,gm.omap,wm.pairs,ym.set,Di.intTime,Di.floatTime,Di.timestamp];Wa.schema=vm});var Xa=w(Bi=>{"use strict";var za=Ze(),bm=Kn(),Ja=et(),km=At(),Cm=yi(),Wi=bi(),Fi=Ci(),Sm=ba(),Em=Sa(),Ya=xi(),qt=qn(),Ha=Oi(),Ga=Xn(),Ba=Fa(),Va=Li(),or=$i(),Ua=new Map([["core",Sm.schema],["failsafe",[za.map,Ja.seq,km.string]],["json",Em.schema],["yaml11",Ba.schema],["yaml-1.1",Ba.schema]]),Ka={binary:Ya.binary,bool:Cm.boolTag,float:Wi.float,floatExp:Wi.floatExp,floatNaN:Wi.floatNaN,floatTime:or.floatTime,int:Fi.int,intHex:Fi.intHex,intOct:Fi.intOct,intTime:or.intTime,map:za.map,merge:qt.merge,null:bm.nullTag,omap:Ha.omap,pairs:Ga.pairs,seq:Ja.seq,set:Va.set,timestamp:or.timestamp},_m={"tag:yaml.org,2002:binary":Ya.binary,"tag:yaml.org,2002:merge":qt.merge,"tag:yaml.org,2002:omap":Ha.omap,"tag:yaml.org,2002:pairs":Ga.pairs,"tag:yaml.org,2002:set":Va.set,"tag:yaml.org,2002:timestamp":or.timestamp};function xm(t,e,n){let r=Ua.get(e);if(r&&!t)return n&&!r.includes(qt.merge)?r.concat(qt.merge):r.slice();let i=r;if(!i)if(Array.isArray(t))i=[];else{let o=Array.from(Ua.keys()).filter(s=>s!=="yaml11").map(s=>JSON.stringify(s)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${o} or define customTags array`)}if(Array.isArray(t))for(let o of t)i=i.concat(o);else typeof t=="function"&&(i=t(i.slice()));return n&&(i=i.concat(qt.merge)),i.reduce((o,s)=>{let a=typeof s=="string"?Ka[s]:s;if(!a){let c=JSON.stringify(s),l=Object.keys(Ka).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${c}; use one of ${l}`)}return o.includes(a)||o.push(a),o},[])}Bi.coreKnownTags=_m;Bi.getTags=xm});var zi=w(Qa=>{"use strict";var Ui=_(),Pm=Ze(),Rm=et(),Nm=At(),sr=Xa(),Om=(t,e)=>t.key<e.key?-1:t.key>e.key?1:0,Ki=class t{constructor({compat:e,customTags:n,merge:r,resolveKnownTags:i,schema:o,sortMapEntries:s,toStringDefaults:a}){this.compat=Array.isArray(e)?sr.getTags(e,"compat"):e?sr.getTags(null,e):null,this.name=typeof o=="string"&&o||"core",this.knownTags=i?sr.coreKnownTags:{},this.tags=sr.getTags(n,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,Ui.MAP,{value:Pm.map}),Object.defineProperty(this,Ui.SCALAR,{value:Nm.string}),Object.defineProperty(this,Ui.SEQ,{value:Rm.seq}),this.sortMapEntries=typeof s=="function"?s:s===!0?Om:null}clone(){let e=Object.create(t.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};Qa.Schema=Ki});var ec=w(Za=>{"use strict";var Am=_(),Ji=Rt(),$t=Et();function Im(t,e){let n=[],r=e.directives===!0;if(e.directives!==!1&&t.directives){let c=t.directives.toString(t);c?(n.push(c),r=!0):t.directives.docStart&&(r=!0)}r&&n.push("---");let i=Ji.createStringifyContext(t,e),{commentString:o}=i.options;if(t.commentBefore){n.length!==1&&n.unshift("");let c=o(t.commentBefore);n.unshift($t.indentComment(c,""))}let s=!1,a=null;if(t.contents){if(Am.isNode(t.contents)){if(t.contents.spaceBefore&&r&&n.push(""),t.contents.commentBefore){let u=o(t.contents.commentBefore);n.push($t.indentComment(u,""))}i.forceBlockIndent=!!t.comment,a=t.contents.comment}let c=a?void 0:()=>s=!0,l=Ji.stringify(t.contents,i,()=>a=null,c);a&&(l+=$t.lineComment(l,"",o(a))),(l[0]==="|"||l[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(Ji.stringify(t.contents,i));if(t.directives?.docEnd)if(t.comment){let c=o(t.comment);c.includes(`
58
+ `)?(n.push("..."),n.push($t.indentComment(c,""))):n.push(`... ${c}`)}else n.push("...");else{let c=t.comment;c&&s&&(c=c.replace(/^\n+/,"")),c&&((!s||a)&&n[n.length-1]!==""&&n.push(""),n.push($t.indentComment(o(c),"")))}return n.join(`
59
59
  `)+`
60
- `}ja.stringifyDocument=om});var Nt=w(qa=>{"use strict";var sm=mt(),He=pn(),z=E(),am=ge(),cm=de(),lm=Ii(),um=La(),ji=un(),fm=Dr(),dm=pt(),Li=$r(),qi=class t{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,z.NODE_TYPE,{value:z.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:s}=o;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new Li.Directives({version:s}),this.setSchema(s,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){let e=Object.create(t.prototype,{[z.NODE_TYPE]:{value:z.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=z.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){Ve(this.contents)&&this.contents.add(e)}addIn(e,n){Ve(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let r=ji.anchorNames(this);e.anchor=!n||r.has(n)?ji.findNewAnchor(n||"a",r):n}return new sm.Alias(e.anchor)}createNode(e,n,r){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){let h=b=>typeof b=="number"||b instanceof String||b instanceof Number,v=n.filter(h).map(String);v.length>0&&(n=n.concat(v)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:f,setAnchors:d,sourceObjects:p}=ji.createNodeAnchors(this,s||"a"),g={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},m=dm.createNode(e,u,g);return a&&z.isCollection(m)&&(m.flow=!0),d(),m}createPair(e,n,r={}){let i=this.createNode(e,null,r),o=this.createNode(n,null,r);return new am.Pair(i,o)}delete(e){return Ve(this.contents)?this.contents.delete(e):!1}deleteIn(e){return He.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):Ve(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return z.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return He.isEmptyPath(e)?!n&&z.isScalar(this.contents)?this.contents.value:this.contents:z.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return z.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return He.isEmptyPath(e)?this.contents!==void 0:z.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=He.collectionFromPath(this.schema,[e],n):Ve(this.contents)&&this.contents.set(e,n)}setIn(e,n){He.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=He.collectionFromPath(this.schema,Array.from(e),n):Ve(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Li.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Li.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new lm.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=cm.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?fm.applyReviver(s,{"":c},"",c):c}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}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 n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return um.stringifyDocument(this,e)}};function Ve(t){if(z.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}qa.Document=qi});var It=w(At=>{"use strict";var Ot=class extends Error{constructor(e,n,r,i){super(),this.name=e,this.code=r,this.message=i,this.pos=n}},$i=class extends Ot{constructor(e,n,r){super("YAMLParseError",e,n,r)}},Di=class extends Ot{constructor(e,n,r){super("YAMLWarning",e,n,r)}},mm=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="…"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"…"),r>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`…
60
+ `}Za.stringifyDocument=Im});var Mt=w(tc=>{"use strict";var Tm=Ct(),nt=xn(),G=_(),jm=be(),Lm=ge(),qm=zi(),$m=ec(),Yi=Cn(),Mm=Xr(),Dm=St(),Hi=Vr(),Gi=class t{constructor(e,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,G.NODE_TYPE,{value:G.DOC});let i=null;typeof n=="function"||Array.isArray(n)?i=n:r===void 0&&n&&(r=n,n=void 0);let o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:s}=o;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new Hi.Directives({version:s}),this.setSchema(s,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){let e=Object.create(t.prototype,{[G.NODE_TYPE]:{value:G.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=G.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){rt(this.contents)&&this.contents.add(e)}addIn(e,n){rt(this.contents)&&this.contents.addIn(e,n)}createAlias(e,n){if(!e.anchor){let r=Yi.anchorNames(this);e.anchor=!n||r.has(n)?Yi.findNewAnchor(n||"a",r):n}return new Tm.Alias(e.anchor)}createNode(e,n,r){let i;if(typeof n=="function")e=n.call({"":e},"",e),i=n;else if(Array.isArray(n)){let h=b=>typeof b=="number"||b instanceof String||b instanceof Number,y=n.filter(h).map(String);y.length>0&&(n=n.concat(y)),i=n}else r===void 0&&n&&(r=n,n=void 0);let{aliasDuplicateObjects:o,anchorPrefix:s,flow:a,keepUndefined:c,onTagObj:l,tag:u}=r??{},{onAnchor:f,setAnchors:d,sourceObjects:p}=Yi.createNodeAnchors(this,s||"a"),g={aliasDuplicateObjects:o??!0,keepUndefined:c??!1,onAnchor:f,onTagObj:l,replacer:i,schema:this.schema,sourceObjects:p},m=Dm.createNode(e,u,g);return a&&G.isCollection(m)&&(m.flow=!0),d(),m}createPair(e,n,r={}){let i=this.createNode(e,null,r),o=this.createNode(n,null,r);return new jm.Pair(i,o)}delete(e){return rt(this.contents)?this.contents.delete(e):!1}deleteIn(e){return nt.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):rt(this.contents)?this.contents.deleteIn(e):!1}get(e,n){return G.isCollection(this.contents)?this.contents.get(e,n):void 0}getIn(e,n){return nt.isEmptyPath(e)?!n&&G.isScalar(this.contents)?this.contents.value:this.contents:G.isCollection(this.contents)?this.contents.getIn(e,n):void 0}has(e){return G.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return nt.isEmptyPath(e)?this.contents!==void 0:G.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,n){this.contents==null?this.contents=nt.collectionFromPath(this.schema,[e],n):rt(this.contents)&&this.contents.set(e,n)}setIn(e,n){nt.isEmptyPath(e)?this.contents=n:this.contents==null?this.contents=nt.collectionFromPath(this.schema,Array.from(e),n):rt(this.contents)&&this.contents.setIn(e,n)}setSchema(e,n={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Hi.Directives({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Hi.Directives({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{let i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new qm.Schema(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:n,mapAsMap:r,maxAliasCount:i,onAnchor:o,reviver:s}={}){let a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},c=Lm.toJS(this.contents,n??"",a);if(typeof o=="function")for(let{count:l,res:u}of a.anchors.values())o(u,l);return typeof s=="function"?Mm.applyReviver(s,{"":c},"",c):c}toJSON(e,n){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:n})}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 n=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return $m.stringifyDocument(this,e)}};function rt(t){if(G.isCollection(t))return!0;throw new Error("Expected a YAML collection as document contents")}tc.Document=Gi});var Ft=w(Wt=>{"use strict";var Dt=class extends Error{constructor(e,n,r,i){super(),this.name=e,this.code=r,this.message=i,this.pos=n}},Vi=class extends Dt{constructor(e,n,r){super("YAMLParseError",e,n,r)}},Xi=class extends Dt{constructor(e,n,r){super("YAMLWarning",e,n,r)}},Wm=(t,e)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(a=>e.linePos(a));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let o=i-1,s=t.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&s.length>80){let a=Math.min(o-39,s.length-79);s="…"+s.substring(a),o-=a-1}if(s.length>80&&(s=s.substring(0,79)+"…"),r>1&&/^ *$/.test(s.substring(0,o))){let a=t.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`…
61
61
  `),s=a+s}if(/[^ ]/.test(s)){let a=1,c=n.linePos[1];c?.line===r&&c.col>i&&(a=Math.max(1,Math.min(c.col-i,80-o)));let l=" ".repeat(o)+"^".repeat(a);n.message+=`:
62
62
 
63
63
  ${s}
64
64
  ${l}
65
- `}};At.YAMLError=Ot;At.YAMLParseError=$i;At.YAMLWarning=Di;At.prettifyError=mm});var Tt=w($a=>{"use strict";function pm(t,{flow:e,indicator:n,next:r,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,f="",d="",p=!1,g=!1,m=null,h=null,v=null,b=null,k=null,C=null,S=null;for(let y of t)switch(g&&(y.type!=="space"&&y.type!=="newline"&&y.type!=="comma"&&o(y.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),m&&(l&&y.type!=="comment"&&y.type!=="newline"&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),y.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&y.source.includes(" ")&&(m=y),u=!0;break;case"comment":{u||o(y,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=y.source.substring(1)||" ";f?f+=d+N:f=N,d="",l=!1;break}case"newline":l?f?f+=y.source:(!C||n!=="seq-item-ind")&&(c=!0):d+=y.source,l=!0,p=!0,(h||v)&&(b=y),u=!0;break;case"anchor":h&&o(y,"MULTIPLE_ANCHORS","A node can have at most one anchor"),y.source.endsWith(":")&&o(y.offset+y.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=y,S??(S=y.offset),l=!1,u=!1,g=!0;break;case"tag":{v&&o(y,"MULTIPLE_TAGS","A node can have at most one tag"),v=y,S??(S=y.offset),l=!1,u=!1,g=!0;break}case n:(h||v)&&o(y,"BAD_PROP_ORDER",`Anchors and tags must be after the ${y.source} indicator`),C&&o(y,"UNEXPECTED_TOKEN",`Unexpected ${y.source} in ${e??"collection"}`),C=y,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){k&&o(y,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=y,l=!1,u=!1;break}default:o(y,"UNEXPECTED_TOKEN",`Unexpected ${y.type} token`),l=!1,u=!1}let _=t[t.length-1],P=_?_.offset+_.source.length:i;return g&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(l&&m.indent<=s||r?.type==="block-map"||r?.type==="block-seq")&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:C,spaceBefore:c,comment:f,hasNewline:p,anchor:h,tag:v,newlineAfterProp:b,end:P,start:S??P}}$a.resolveProps=pm});var Vn=w(Da=>{"use strict";function Mi(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 n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(Mi(e.key)||Mi(e.value))return!0}return!1;default:return!0}}Da.containsNewline=Mi});var Wi=w(Ma=>{"use strict";var hm=Vn();function gm(t,e,n){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&hm.containsNewline(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}Ma.flowIndentCheck=gm});var Fi=w(Fa=>{"use strict";var Wa=E();function wm(t,e,n){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let i=typeof r=="function"?r:(o,s)=>o===s||Wa.isScalar(o)&&Wa.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,n))}Fa.mapIncludes=wm});var Ya=w(Ja=>{"use strict";var Ba=ge(),ym=ye(),Ua=Tt(),vm=Vn(),Ka=Wi(),bm=Fi(),za="All mapping items must start at the same column";function km({composeNode:t,composeEmptyNode:e},n,r,i,o){let s=o?.nodeClass??ym.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:f,key:d,sep:p,value:g}=u,m=Ua.resolveProps(f,{indicator:"explicit-key-ind",next:d??p?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),h=!m.found;if(h){if(d&&(d.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==r.indent&&i(c,"BAD_INDENT",za)),!m.anchor&&!m.tag&&!p){l=m.end,m.comment&&(a.comment?a.comment+=`
67
- `+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||vm.containsNewline(d))&&i(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==r.indent&&i(c,"BAD_INDENT",za);n.atKey=!0;let v=m.end,b=d?t(n,d,m,i):e(n,v,f,null,m,i);n.schema.compat&&Ka.flowIndentCheck(r.indent,d,i),n.atKey=!1,bm.mapIncludes(n,a.items,b)&&i(v,"DUPLICATE_KEY","Map keys must be unique");let k=Ua.resolveProps(p??[],{indicator:"map-value-ind",next:g,offset:b.range[2],onError:i,parentIndent:r.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=k.end,k.found){h&&(g?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<k.found.offset-1024&&i(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let C=g?t(n,g,k,i):e(n,c,p,null,k,i);n.schema.compat&&Ka.flowIndentCheck(r.indent,g,i),c=C.range[2];let S=new Ba.Pair(b,C);n.options.keepSourceTokens&&(S.srcToken=u),a.items.push(S)}else{h&&i(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(b.comment?b.comment+=`
68
- `+k.comment:b.comment=k.comment);let C=new Ba.Pair(b);n.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}Ja.resolveBlockMap=km});var Va=w(Ha=>{"use strict";var Cm=ve(),Sm=Tt(),_m=Wi();function Em({composeNode:t,composeEmptyNode:e},n,r,i,o){let s=o?.nodeClass??Cm.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:f}of r.items){let d=Sm.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?i(d.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(a.comment=d.comment);continue}let p=f?t(n,f,d,i):e(n,d.end,u,null,d,i);n.schema.compat&&_m.flowIndentCheck(r.indent,f,i),c=p.range[2],a.items.push(p)}return a.range=[r.offset,c,l??c],a}Ha.resolveBlockSeq=Em});var Ge=w(Ga=>{"use strict";function xm(t,e,n,r){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{n&&!o&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}Ga.resolveEnd=xm});var ec=w(Za=>{"use strict";var Pm=E(),Rm=ge(),Xa=ye(),Nm=ve(),Om=Ge(),Qa=Tt(),Am=Vn(),Im=Fi(),Bi="Block collections are not allowed within flow collections",Ui=t=>t&&(t.type==="block-map"||t.type==="block-seq");function Tm({composeNode:t,composeEmptyNode:e},n,r,i,o){let s=r.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?Xa.YAMLMap:Nm.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let h=0;h<r.items.length;++h){let v=r.items[h],{start:b,key:k,sep:C,value:S}=v,_=Qa.resolveProps(b,{flow:a,indicator:"explicit-key-ind",next:k??C?.[0],offset:f,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!_.found){if(!_.anchor&&!_.tag&&!C&&!S){h===0&&_.comma?i(_.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):h<r.items.length-1&&i(_.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),_.comment&&(l.comment?l.comment+=`
69
- `+_.comment:l.comment=_.comment),f=_.end;continue}!s&&n.options.strict&&Am.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0)_.comma&&i(_.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(_.comma||i(_.start,"MISSING_CHAR",`Missing , between ${a} items`),_.comment){let P="";e:for(let y of b)switch(y.type){case"comma":case"space":break;case"comment":P=y.source.substring(1);break e;default:break e}if(P){let y=l.items[l.items.length-1];Pm.isPair(y)&&(y=y.value??y.key),y.comment?y.comment+=`
70
- `+P:y.comment=P,_.comment=_.comment.substring(P.length+1)}}if(!s&&!C&&!_.found){let P=S?t(n,S,_,i):e(n,_.end,C,null,_,i);l.items.push(P),f=P.range[2],Ui(S)&&i(P.range,"BLOCK_IN_FLOW",Bi)}else{n.atKey=!0;let P=_.end,y=k?t(n,k,_,i):e(n,P,b,null,_,i);Ui(k)&&i(y.range,"BLOCK_IN_FLOW",Bi),n.atKey=!1;let N=Qa.resolveProps(C??[],{flow:a,indicator:"map-value-ind",next:S,offset:y.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(N.found){if(!s&&!_.found&&n.options.strict){if(C)for(let R of C){if(R===N.found)break;if(R.type==="newline"){i(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}_.start<N.found.offset-1024&&i(N.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&S.source?.[0]===":"?i(S,"MISSING_CHAR",`Missing space after : in ${a}`):i(N.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let J=S?t(n,S,N,i):N.found?e(n,N.end,C,null,N,i):null;J?Ui(S)&&i(J.range,"BLOCK_IN_FLOW",Bi):N.comment&&(y.comment?y.comment+=`
71
- `+N.comment:y.comment=N.comment);let ne=new Rm.Pair(y,J);if(n.options.keepSourceTokens&&(ne.srcToken=v),s){let R=l;Im.mapIncludes(n,R.items,y)&&i(P,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(ne)}else{let R=new Xa.YAMLMap(n.schema);R.flow=!0,R.items.push(ne);let D=(J??y).range;R.range=[y.range[0],D[1],D[2]],l.items.push(R)}f=J?J.range[2]:N.end}}let d=s?"}":"]",[p,...g]=r.end,m=f;if(p?.source===d)m=p.offset+p.source.length;else{let h=a[0].toUpperCase()+a.substring(1),v=u?`${h} must end with a ${d}`:`${h} in block collection must be sufficiently indented and end with a ${d}`;i(f,u?"MISSING_CHAR":"BAD_INDENT",v),p&&p.source.length!==1&&g.unshift(p)}if(g.length>0){let h=Om.resolveEnd(g,m,n.options.strict,i);h.comment&&(l.comment?l.comment+=`
72
- `+h.comment:l.comment=h.comment),l.range=[r.offset,m,h.offset]}else l.range=[r.offset,m,m];return l}Za.resolveFlowCollection=Tm});var nc=w(tc=>{"use strict";var jm=E(),Lm=A(),qm=ye(),$m=ve(),Dm=Ya(),Mm=Va(),Wm=ec();function Ki(t,e,n,r,i,o){let s=n.type==="block-map"?Dm.resolveBlockMap(t,e,n,r,o):n.type==="block-seq"?Mm.resolveBlockSeq(t,e,n,r,o):Wm.resolveFlowCollection(t,e,n,r,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function Fm(t,e,n,r,i){let o=r.tag,s=o?e.directives.tagName(o.source,d=>i(o,"TAG_RESOLVE_FAILED",d)):null;if(n.type==="block-seq"){let{anchor:d,newlineAfterProp:p}=r,g=d&&o?d.offset>o.offset?d:o:d??o;g&&(!p||p.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===qm.YAMLMap.tagName&&a==="map"||s===$m.YAMLSeq.tagName&&a==="seq")return Ki(t,e,n,i,s);let c=e.schema.tags.find(d=>d.tag===s&&d.collection===a);if(!c){let d=e.schema.knownTags[s];if(d?.collection===a)e.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?i(o,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),Ki(t,e,n,i,s)}let l=Ki(t,e,n,i,s,c),u=c.resolve?.(l,d=>i(o,"TAG_RESOLVE_FAILED",d),e.options)??l,f=jm.isNode(u)?u:new Lm.Scalar(u);return f.range=l.range,f.tag=s,c?.format&&(f.format=c.format),f}tc.composeCollection=Fm});var Ji=w(rc=>{"use strict";var zi=A();function Bm(t,e,n){let r=e.offset,i=Um(e,t.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let o=i.mode===">"?zi.Scalar.BLOCK_FOLDED:zi.Scalar.BLOCK_LITERAL,s=e.source?Km(e.source):[],a=s.length;for(let m=s.length-1;m>=0;--m){let h=s[m][1];if(h===""||h==="\r")a=m;else break}if(a===0){let m=i.chomp==="+"&&s.length>0?`
73
- `.repeat(Math.max(1,s.length-1)):"",h=r+i.length;return e.source&&(h+=e.source.length),{value:m,type:o,comment:i.comment,range:[r,h,h]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let m=0;m<a;++m){let[h,v]=s[m];if(v===""||v==="\r")i.indent===0&&h.length>c&&(c=h.length);else{h.length<c&&n(l+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=h.length),u=m,c===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=h.length+v.length+1}for(let m=s.length-1;m>=a;--m)s[m][0].length>c&&(a=m+1);let f="",d="",p=!1;for(let m=0;m<u;++m)f+=s[m][0].slice(c)+`
74
- `;for(let m=u;m<a;++m){let[h,v]=s[m];l+=h.length+v.length+1;let b=v[v.length-1]==="\r";if(b&&(v=v.slice(0,-1)),v&&h.length<c){let C=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(l-v.length-(b?2:1),"BAD_INDENT",C),h=""}o===zi.Scalar.BLOCK_LITERAL?(f+=d+h.slice(c)+v,d=`
75
- `):h.length>c||v[0]===" "?(d===" "?d=`
65
+ `}};Wt.YAMLError=Dt;Wt.YAMLParseError=Vi;Wt.YAMLWarning=Xi;Wt.prettifyError=Wm});var Bt=w(nc=>{"use strict";function Fm(t,{flow:e,indicator:n,next:r,offset:i,onError:o,parentIndent:s,startOnNewline:a}){let c=!1,l=a,u=a,f="",d="",p=!1,g=!1,m=null,h=null,y=null,b=null,k=null,C=null,S=null;for(let v of t)switch(g&&(v.type!=="space"&&v.type!=="newline"&&v.type!=="comma"&&o(v.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g=!1),m&&(l&&v.type!=="comment"&&v.type!=="newline"&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),v.type){case"space":!e&&(n!=="doc-start"||r?.type!=="flow-collection")&&v.source.includes(" ")&&(m=v),u=!0;break;case"comment":{u||o(v,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let N=v.source.substring(1)||" ";f?f+=d+N:f=N,d="",l=!1;break}case"newline":l?f?f+=v.source:(!C||n!=="seq-item-ind")&&(c=!0):d+=v.source,l=!0,p=!0,(h||y)&&(b=v),u=!0;break;case"anchor":h&&o(v,"MULTIPLE_ANCHORS","A node can have at most one anchor"),v.source.endsWith(":")&&o(v.offset+v.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),h=v,S??(S=v.offset),l=!1,u=!1,g=!0;break;case"tag":{y&&o(v,"MULTIPLE_TAGS","A node can have at most one tag"),y=v,S??(S=v.offset),l=!1,u=!1,g=!0;break}case n:(h||y)&&o(v,"BAD_PROP_ORDER",`Anchors and tags must be after the ${v.source} indicator`),C&&o(v,"UNEXPECTED_TOKEN",`Unexpected ${v.source} in ${e??"collection"}`),C=v,l=n==="seq-item-ind"||n==="explicit-key-ind",u=!1;break;case"comma":if(e){k&&o(v,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),k=v,l=!1,u=!1;break}default:o(v,"UNEXPECTED_TOKEN",`Unexpected ${v.type} token`),l=!1,u=!1}let E=t[t.length-1],P=E?E.offset+E.source.length:i;return g&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(l&&m.indent<=s||r?.type==="block-map"||r?.type==="block-seq")&&o(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:k,found:C,spaceBefore:c,comment:f,hasNewline:p,anchor:h,tag:y,newlineAfterProp:b,end:P,start:S??P}}nc.resolveProps=Fm});var ar=w(rc=>{"use strict";function Qi(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 n of e.start)if(n.type==="newline")return!0;if(e.sep){for(let n of e.sep)if(n.type==="newline")return!0}if(Qi(e.key)||Qi(e.value))return!0}return!1;default:return!0}}rc.containsNewline=Qi});var Zi=w(ic=>{"use strict";var Bm=ar();function Um(t,e,n){if(e?.type==="flow-collection"){let r=e.end[0];r.indent===t&&(r.source==="]"||r.source==="}")&&Bm.containsNewline(e)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}ic.flowIndentCheck=Um});var eo=w(sc=>{"use strict";var oc=_();function Km(t,e,n){let{uniqueKeys:r}=t.options;if(r===!1)return!1;let i=typeof r=="function"?r:(o,s)=>o===s||oc.isScalar(o)&&oc.isScalar(s)&&o.value===s.value;return e.some(o=>i(o.key,n))}sc.mapIncludes=Km});var dc=w(fc=>{"use strict";var ac=be(),zm=Ce(),cc=Bt(),Jm=ar(),lc=Zi(),Ym=eo(),uc="All mapping items must start at the same column";function Hm({composeNode:t,composeEmptyNode:e},n,r,i,o){let s=o?.nodeClass??zm.YAMLMap,a=new s(n.schema);n.atRoot&&(n.atRoot=!1);let c=r.offset,l=null;for(let u of r.items){let{start:f,key:d,sep:p,value:g}=u,m=cc.resolveProps(f,{indicator:"explicit-key-ind",next:d??p?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0}),h=!m.found;if(h){if(d&&(d.type==="block-seq"?i(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==r.indent&&i(c,"BAD_INDENT",uc)),!m.anchor&&!m.tag&&!p){l=m.end,m.comment&&(a.comment?a.comment+=`
67
+ `+m.comment:a.comment=m.comment);continue}(m.newlineAfterProp||Jm.containsNewline(d))&&i(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else m.found?.indent!==r.indent&&i(c,"BAD_INDENT",uc);n.atKey=!0;let y=m.end,b=d?t(n,d,m,i):e(n,y,f,null,m,i);n.schema.compat&&lc.flowIndentCheck(r.indent,d,i),n.atKey=!1,Ym.mapIncludes(n,a.items,b)&&i(y,"DUPLICATE_KEY","Map keys must be unique");let k=cc.resolveProps(p??[],{indicator:"map-value-ind",next:g,offset:b.range[2],onError:i,parentIndent:r.indent,startOnNewline:!d||d.type==="block-scalar"});if(c=k.end,k.found){h&&(g?.type==="block-map"&&!k.hasNewline&&i(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&m.start<k.found.offset-1024&&i(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let C=g?t(n,g,k,i):e(n,c,p,null,k,i);n.schema.compat&&lc.flowIndentCheck(r.indent,g,i),c=C.range[2];let S=new ac.Pair(b,C);n.options.keepSourceTokens&&(S.srcToken=u),a.items.push(S)}else{h&&i(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),k.comment&&(b.comment?b.comment+=`
68
+ `+k.comment:b.comment=k.comment);let C=new ac.Pair(b);n.options.keepSourceTokens&&(C.srcToken=u),a.items.push(C)}}return l&&l<c&&i(l,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,c,l??c],a}fc.resolveBlockMap=Hm});var pc=w(mc=>{"use strict";var Gm=Se(),Vm=Bt(),Xm=Zi();function Qm({composeNode:t,composeEmptyNode:e},n,r,i,o){let s=o?.nodeClass??Gm.YAMLSeq,a=new s(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset,l=null;for(let{start:u,value:f}of r.items){let d=Vm.resolveProps(u,{indicator:"seq-item-ind",next:f,offset:c,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?i(d.end,"BAD_INDENT","All sequence items must start at the same column"):i(c,"MISSING_CHAR","Sequence item without - indicator");else{l=d.end,d.comment&&(a.comment=d.comment);continue}let p=f?t(n,f,d,i):e(n,d.end,u,null,d,i);n.schema.compat&&Xm.flowIndentCheck(r.indent,f,i),c=p.range[2],a.items.push(p)}return a.range=[r.offset,c,l??c],a}mc.resolveBlockSeq=Qm});var it=w(hc=>{"use strict";function Zm(t,e,n,r){let i="";if(t){let o=!1,s="";for(let a of t){let{source:c,type:l}=a;switch(l){case"space":o=!0;break;case"comment":{n&&!o&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let u=c.substring(1)||" ";i?i+=s+u:i=u,s="";break}case"newline":i&&(s+=c),o=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}e+=c.length}}return{comment:i,offset:e}}hc.resolveEnd=Zm});var vc=w(yc=>{"use strict";var ep=_(),tp=be(),gc=Ce(),np=Se(),rp=it(),wc=Bt(),ip=ar(),op=eo(),to="Block collections are not allowed within flow collections",no=t=>t&&(t.type==="block-map"||t.type==="block-seq");function sp({composeNode:t,composeEmptyNode:e},n,r,i,o){let s=r.start.source==="{",a=s?"flow map":"flow sequence",c=o?.nodeClass??(s?gc.YAMLMap:np.YAMLSeq),l=new c(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset+r.start.source.length;for(let h=0;h<r.items.length;++h){let y=r.items[h],{start:b,key:k,sep:C,value:S}=y,E=wc.resolveProps(b,{flow:a,indicator:"explicit-key-ind",next:k??C?.[0],offset:f,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!E.found){if(!E.anchor&&!E.tag&&!C&&!S){h===0&&E.comma?i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):h<r.items.length-1&&i(E.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),E.comment&&(l.comment?l.comment+=`
69
+ `+E.comment:l.comment=E.comment),f=E.end;continue}!s&&n.options.strict&&ip.containsNewline(k)&&i(k,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(h===0)E.comma&&i(E.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(E.comma||i(E.start,"MISSING_CHAR",`Missing , between ${a} items`),E.comment){let P="";e:for(let v of b)switch(v.type){case"comma":case"space":break;case"comment":P=v.source.substring(1);break e;default:break e}if(P){let v=l.items[l.items.length-1];ep.isPair(v)&&(v=v.value??v.key),v.comment?v.comment+=`
70
+ `+P:v.comment=P,E.comment=E.comment.substring(P.length+1)}}if(!s&&!C&&!E.found){let P=S?t(n,S,E,i):e(n,E.end,C,null,E,i);l.items.push(P),f=P.range[2],no(S)&&i(P.range,"BLOCK_IN_FLOW",to)}else{n.atKey=!0;let P=E.end,v=k?t(n,k,E,i):e(n,P,b,null,E,i);no(k)&&i(v.range,"BLOCK_IN_FLOW",to),n.atKey=!1;let N=wc.resolveProps(C??[],{flow:a,indicator:"map-value-ind",next:S,offset:v.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(N.found){if(!s&&!E.found&&n.options.strict){if(C)for(let R of C){if(R===N.found)break;if(R.type==="newline"){i(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}E.start<N.found.offset-1024&&i(N.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else S&&("source"in S&&S.source?.[0]===":"?i(S,"MISSING_CHAR",`Missing space after : in ${a}`):i(N.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let Q=S?t(n,S,N,i):N.found?e(n,N.end,C,null,N,i):null;Q?no(S)&&i(Q.range,"BLOCK_IN_FLOW",to):N.comment&&(v.comment?v.comment+=`
71
+ `+N.comment:v.comment=N.comment);let ce=new tp.Pair(v,Q);if(n.options.keepSourceTokens&&(ce.srcToken=y),s){let R=l;op.mapIncludes(n,R.items,v)&&i(P,"DUPLICATE_KEY","Map keys must be unique"),R.items.push(ce)}else{let R=new gc.YAMLMap(n.schema);R.flow=!0,R.items.push(ce);let T=(Q??v).range;R.range=[v.range[0],T[1],T[2]],l.items.push(R)}f=Q?Q.range[2]:N.end}}let d=s?"}":"]",[p,...g]=r.end,m=f;if(p?.source===d)m=p.offset+p.source.length;else{let h=a[0].toUpperCase()+a.substring(1),y=u?`${h} must end with a ${d}`:`${h} in block collection must be sufficiently indented and end with a ${d}`;i(f,u?"MISSING_CHAR":"BAD_INDENT",y),p&&p.source.length!==1&&g.unshift(p)}if(g.length>0){let h=rp.resolveEnd(g,m,n.options.strict,i);h.comment&&(l.comment?l.comment+=`
72
+ `+h.comment:l.comment=h.comment),l.range=[r.offset,m,h.offset]}else l.range=[r.offset,m,m];return l}yc.resolveFlowCollection=sp});var kc=w(bc=>{"use strict";var ap=_(),cp=A(),lp=Ce(),up=Se(),fp=dc(),dp=pc(),mp=vc();function ro(t,e,n,r,i,o){let s=n.type==="block-map"?fp.resolveBlockMap(t,e,n,r,o):n.type==="block-seq"?dp.resolveBlockSeq(t,e,n,r,o):mp.resolveFlowCollection(t,e,n,r,o),a=s.constructor;return i==="!"||i===a.tagName?(s.tag=a.tagName,s):(i&&(s.tag=i),s)}function pp(t,e,n,r,i){let o=r.tag,s=o?e.directives.tagName(o.source,d=>i(o,"TAG_RESOLVE_FAILED",d)):null;if(n.type==="block-seq"){let{anchor:d,newlineAfterProp:p}=r,g=d&&o?d.offset>o.offset?d:o:d??o;g&&(!p||p.offset<g.offset)&&i(g,"MISSING_CHAR","Missing newline after block sequence props")}let a=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!s||s==="!"||s===lp.YAMLMap.tagName&&a==="map"||s===up.YAMLSeq.tagName&&a==="seq")return ro(t,e,n,i,s);let c=e.schema.tags.find(d=>d.tag===s&&d.collection===a);if(!c){let d=e.schema.knownTags[s];if(d?.collection===a)e.schema.tags.push(Object.assign({},d,{default:!1})),c=d;else return d?i(o,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):i(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0),ro(t,e,n,i,s)}let l=ro(t,e,n,i,s,c),u=c.resolve?.(l,d=>i(o,"TAG_RESOLVE_FAILED",d),e.options)??l,f=ap.isNode(u)?u:new cp.Scalar(u);return f.range=l.range,f.tag=s,c?.format&&(f.format=c.format),f}bc.composeCollection=pp});var oo=w(Cc=>{"use strict";var io=A();function hp(t,e,n){let r=e.offset,i=gp(e,t.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let o=i.mode===">"?io.Scalar.BLOCK_FOLDED:io.Scalar.BLOCK_LITERAL,s=e.source?wp(e.source):[],a=s.length;for(let m=s.length-1;m>=0;--m){let h=s[m][1];if(h===""||h==="\r")a=m;else break}if(a===0){let m=i.chomp==="+"&&s.length>0?`
73
+ `.repeat(Math.max(1,s.length-1)):"",h=r+i.length;return e.source&&(h+=e.source.length),{value:m,type:o,comment:i.comment,range:[r,h,h]}}let c=e.indent+i.indent,l=e.offset+i.length,u=0;for(let m=0;m<a;++m){let[h,y]=s[m];if(y===""||y==="\r")i.indent===0&&h.length>c&&(c=h.length);else{h.length<c&&n(l+h.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(c=h.length),u=m,c===0&&!t.atRoot&&n(l,"BAD_INDENT","Block scalar values in collections must be indented");break}l+=h.length+y.length+1}for(let m=s.length-1;m>=a;--m)s[m][0].length>c&&(a=m+1);let f="",d="",p=!1;for(let m=0;m<u;++m)f+=s[m][0].slice(c)+`
74
+ `;for(let m=u;m<a;++m){let[h,y]=s[m];l+=h.length+y.length+1;let b=y[y.length-1]==="\r";if(b&&(y=y.slice(0,-1)),y&&h.length<c){let C=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;n(l-y.length-(b?2:1),"BAD_INDENT",C),h=""}o===io.Scalar.BLOCK_LITERAL?(f+=d+h.slice(c)+y,d=`
75
+ `):h.length>c||y[0]===" "?(d===" "?d=`
76
76
  `:!p&&d===`
77
77
  `&&(d=`
78
78
 
79
- `),f+=d+h.slice(c)+v,d=`
80
- `,p=!0):v===""?d===`
79
+ `),f+=d+h.slice(c)+y,d=`
80
+ `,p=!0):y===""?d===`
81
81
  `?f+=`
82
82
  `:d=`
83
- `:(f+=d+v,d=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let m=a;m<s.length;++m)f+=`
83
+ `:(f+=d+y,d=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let m=a;m<s.length;++m)f+=`
84
84
  `+s[m][0].slice(c);f[f.length-1]!==`
85
85
  `&&(f+=`
86
86
  `);break;default:f+=`
87
- `}let g=r+i.length+e.source.length;return{value:f,type:o,comment:i.comment,range:[r,g,g]}}function Um({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",c=-1;for(let d=1;d<i.length;++d){let p=i[d];if(!a&&(p==="-"||p==="+"))a=p;else{let g=Number(p);!s&&g?s=g:c===-1&&(c=t+d)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",f=i.length;for(let d=1;d<e.length;++d){let p=e[d];switch(p.type){case"space":l=!0;case"newline":f+=p.source.length;break;case"comment":n&&!l&&r(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,u=p.source.substring(1);break;case"error":r(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{let g=`Unexpected token in block scalar header: ${p.type}`;r(p,"UNEXPECTED_TOKEN",g);let m=p.source;m&&typeof m=="string"&&(f+=m.length)}}}return{mode:o,indent:s,chomp:a,comment:u,length:f}}function Km(t){let e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),o=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}rc.resolveBlockScalar=Bm});var Hi=w(oc=>{"use strict";var Yi=A(),zm=Ge();function Jm(t,e,n){let{offset:r,type:i,source:o,end:s}=t,a,c,l=(d,p,g)=>n(r+d,p,g);switch(i){case"scalar":a=Yi.Scalar.PLAIN,c=Ym(o,l);break;case"single-quoted-scalar":a=Yi.Scalar.QUOTE_SINGLE,c=Hm(o,l);break;case"double-quoted-scalar":a=Yi.Scalar.QUOTE_DOUBLE,c=Vm(o,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}let u=r+o.length,f=zm.resolveEnd(s,u,e,n);return{value:c,type:a,comment:f.comment,range:[r,u,f.offset]}}function Ym(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),ic(t)}function Hm(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),ic(t.slice(1,-1)).replace(/''/g,"'")}function ic(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
87
+ `}let g=r+i.length+e.source.length;return{value:f,type:o,comment:i.comment,range:[r,g,g]}}function gp({offset:t,props:e},n,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=e[0],o=i[0],s=0,a="",c=-1;for(let d=1;d<i.length;++d){let p=i[d];if(!a&&(p==="-"||p==="+"))a=p;else{let g=Number(p);!s&&g?s=g:c===-1&&(c=t+d)}}c!==-1&&r(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let l=!1,u="",f=i.length;for(let d=1;d<e.length;++d){let p=e[d];switch(p.type){case"space":l=!0;case"newline":f+=p.source.length;break;case"comment":n&&!l&&r(p,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=p.source.length,u=p.source.substring(1);break;case"error":r(p,"UNEXPECTED_TOKEN",p.message),f+=p.source.length;break;default:{let g=`Unexpected token in block scalar header: ${p.type}`;r(p,"UNEXPECTED_TOKEN",g);let m=p.source;m&&typeof m=="string"&&(f+=m.length)}}}return{mode:o,indent:s,chomp:a,comment:u,length:f}}function wp(t){let e=t.split(/\n( *)/),n=e[0],r=n.match(/^( *)/),o=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let s=1;s<e.length;s+=2)o.push([e[s],e[s+1]]);return o}Cc.resolveBlockScalar=hp});var ao=w(Ec=>{"use strict";var so=A(),yp=it();function vp(t,e,n){let{offset:r,type:i,source:o,end:s}=t,a,c,l=(d,p,g)=>n(r+d,p,g);switch(i){case"scalar":a=so.Scalar.PLAIN,c=bp(o,l);break;case"single-quoted-scalar":a=so.Scalar.QUOTE_SINGLE,c=kp(o,l);break;case"double-quoted-scalar":a=so.Scalar.QUOTE_DOUBLE,c=Cp(o,l);break;default:return n(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}let u=r+o.length,f=yp.resolveEnd(s,u,e,n);return{value:c,type:a,comment:f.comment,range:[r,u,f.offset]}}function bp(t,e){let n="";switch(t[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${t[0]}`;break}case"@":case"`":{n=`reserved character ${t[0]}`;break}}return n&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Sc(t)}function kp(t,e){return(t[t.length-1]!=="'"||t.length===1)&&e(t.length,"MISSING_CHAR","Missing closing 'quote"),Sc(t.slice(1,-1)).replace(/''/g,"'")}function Sc(t){let e,n;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
88
88
  `,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
89
89
  `,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(t);if(!r)return t;let i=r[1],o=" ",s=e.lastIndex;for(n.lastIndex=s;r=n.exec(t);)r[1]===""?o===`
90
90
  `?i+=o:o=`
91
- `:(i+=o+r[1],o=" "),s=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,r=a.exec(t),i+o+(r?.[1]??"")}function Vm(t,e){let n="";for(let r=1;r<t.length-1;++r){let i=t[r];if(!(i==="\r"&&t[r+1]===`
91
+ `:(i+=o+r[1],o=" "),s=n.lastIndex;let a=/[ \t]*(.*)/sy;return a.lastIndex=s,r=a.exec(t),i+o+(r?.[1]??"")}function Cp(t,e){let n="";for(let r=1;r<t.length-1;++r){let i=t[r];if(!(i==="\r"&&t[r+1]===`
92
92
  `))if(i===`
93
- `){let{fold:o,offset:s}=Gm(t,r);n+=o,r=s}else if(i==="\\"){let o=t[++r],s=Xm[o];if(s)n+=s;else if(o===`
93
+ `){let{fold:o,offset:s}=Sp(t,r);n+=o,r=s}else if(i==="\\"){let o=t[++r],s=Ep[o];if(s)n+=s;else if(o===`
94
94
  `)for(o=t[r+1];o===" "||o===" ";)o=t[++r+1];else if(o==="\r"&&t[r+1]===`
95
- `)for(o=t[++r+1];o===" "||o===" ";)o=t[++r+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;n+=Qm(t,r+1,a,e),r+=a}else{let a=t.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(i===" "||i===" "){let o=r,s=t[r+1];for(;s===" "||s===" ";)s=t[++r+1];s!==`
95
+ `)for(o=t[++r+1];o===" "||o===" ";)o=t[++r+1];else if(o==="x"||o==="u"||o==="U"){let a=o==="x"?2:o==="u"?4:8;n+=_p(t,r+1,a,e),r+=a}else{let a=t.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),n+=a}}else if(i===" "||i===" "){let o=r,s=t[r+1];for(;s===" "||s===" ";)s=t[++r+1];s!==`
96
96
  `&&!(s==="\r"&&t[r+2]===`
97
- `)&&(n+=r>o?t.slice(o,r+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function Gm(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===`
97
+ `)&&(n+=r>o?t.slice(o,r+1):i)}else n+=i}return(t[t.length-1]!=='"'||t.length===1)&&e(t.length,"MISSING_CHAR",'Missing closing "quote'),n}function Sp(t,e){let n="",r=t[e+1];for(;(r===" "||r===" "||r===`
98
98
  `||r==="\r")&&!(r==="\r"&&t[e+2]!==`
99
99
  `);)r===`
100
100
  `&&(n+=`
101
- `),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}var Xm={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Qm(t,e,n,r){let i=t.substr(e,n),s=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}oc.resolveFlowScalar=Jm});var cc=w(ac=>{"use strict";var Te=E(),sc=A(),Zm=Ji(),ep=Hi();function tp(t,e,n,r){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?Zm.resolveBlockScalar(t,e,r):ep.resolveFlowScalar(e,t.options.strict,r),c=n?t.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Te.SCALAR]:c?l=np(t.schema,i,c,n,r):e.type==="scalar"?l=rp(t,i,e,r):l=t.schema[Te.SCALAR];let u;try{let f=l.resolve(i,d=>r(n??e,"TAG_RESOLVE_FAILED",d),t.options);u=Te.isScalar(f)?f:new sc.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);r(n??e,"TAG_RESOLVE_FAILED",d),u=new sc.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function np(t,e,n,r,i){if(n==="!")return t[Te.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[n];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Te.SCALAR])}function rp({atKey:t,directives:e,schema:n},r,i,o){let s=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[Te.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(r))??n[Te.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}ac.composeScalar=tp});var uc=w(lc=>{"use strict";function ip(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let i=e[r];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++r];i?.type==="space";)t+=i.source.length,i=e[++r];break}}return t}lc.emptyScalarPosition=ip});var mc=w(Gi=>{"use strict";var op=mt(),sp=E(),ap=nc(),fc=cc(),cp=Ge(),lp=uc(),up={composeNode:dc,composeEmptyNode:Vi};function dc(t,e,n,r){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=n,l,u=!0;switch(e.type){case"alias":l=fp(t,e,r),(a||c)&&r(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=fc.composeScalar(t,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=ap.composeCollection(up,t,e,n,r),a&&(l.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);r(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",f),u=!1}}return l??(l=Vi(t,e.offset,void 0,null,n,r)),a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!sp.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function Vi(t,e,n,r,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:lp.emptyScalarPosition(e,n,r),indent:-1,source:""},f=fc.composeScalar(t,u,a,l);return s&&(f.anchor=s.source.substring(1),f.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),o&&(f.comment=o,f.range[2]=c),f}function fp({options:t},{offset:e,source:n,end:r},i){let o=new op.Alias(n.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+n.length,a=cp.resolveEnd(r,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}Gi.composeEmptyNode=Vi;Gi.composeNode=dc});var gc=w(hc=>{"use strict";var dp=Nt(),pc=mc(),mp=Ge(),pp=Tt();function hp(t,e,{offset:n,start:r,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new dp.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=pp.resolveProps(r,{indicator:"doc-start",next:i??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?pc.composeNode(l,i,u,s):pc.composeEmptyNode(l,u.end,r,null,u,s);let f=c.contents.range[2],d=mp.resolveEnd(o,f,!1,s);return d.comment&&(c.comment=d.comment),c.range=[n,f,d.offset],c}hc.composeDoc=hp});var Qi=w(vc=>{"use strict";var gp=rn("process"),wp=$r(),yp=Nt(),jt=It(),wc=E(),vp=gc(),bp=Ge();function Lt(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:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function yc(t){let e="",n=!1,r=!1;for(let i=0;i<t.length;++i){let o=t[i];switch(o[0]){case"#":e+=(e===""?"":r?`
101
+ `),e+=1,r=t[e+1];return n||(n=" "),{fold:n,offset:e}}var Ep={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
102
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function _p(t,e,n,r){let i=t.substr(e,n),s=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(s)}catch{let a=t.substr(e-2,n+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}Ec.resolveFlowScalar=vp});var Pc=w(xc=>{"use strict";var Fe=_(),_c=A(),xp=oo(),Pp=ao();function Rp(t,e,n,r){let{value:i,type:o,comment:s,range:a}=e.type==="block-scalar"?xp.resolveBlockScalar(t,e,r):Pp.resolveFlowScalar(e,t.options.strict,r),c=n?t.directives.tagName(n.source,f=>r(n,"TAG_RESOLVE_FAILED",f)):null,l;t.options.stringKeys&&t.atKey?l=t.schema[Fe.SCALAR]:c?l=Np(t.schema,i,c,n,r):e.type==="scalar"?l=Op(t,i,e,r):l=t.schema[Fe.SCALAR];let u;try{let f=l.resolve(i,d=>r(n??e,"TAG_RESOLVE_FAILED",d),t.options);u=Fe.isScalar(f)?f:new _c.Scalar(f)}catch(f){let d=f instanceof Error?f.message:String(f);r(n??e,"TAG_RESOLVE_FAILED",d),u=new _c.Scalar(i)}return u.range=a,u.source=i,o&&(u.type=o),c&&(u.tag=c),l.format&&(u.format=l.format),s&&(u.comment=s),u}function Np(t,e,n,r,i){if(n==="!")return t[Fe.SCALAR];let o=[];for(let a of t.tags)if(!a.collection&&a.tag===n)if(a.default&&a.test)o.push(a);else return a;for(let a of o)if(a.test?.test(e))return a;let s=t.knownTags[n];return s&&!s.collection?(t.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),t[Fe.SCALAR])}function Op({atKey:t,directives:e,schema:n},r,i,o){let s=n.tags.find(a=>(a.default===!0||t&&a.default==="key")&&a.test?.test(r))||n[Fe.SCALAR];if(n.compat){let a=n.compat.find(c=>c.default&&c.test?.test(r))??n[Fe.SCALAR];if(s.tag!==a.tag){let c=e.tagString(s.tag),l=e.tagString(a.tag),u=`Value may be parsed as either ${c} or ${l}`;o(i,"TAG_RESOLVE_FAILED",u,!0)}}return s}xc.composeScalar=Rp});var Nc=w(Rc=>{"use strict";function Ap(t,e,n){if(e){n??(n=e.length);for(let r=n-1;r>=0;--r){let i=e[r];switch(i.type){case"space":case"comment":case"newline":t-=i.source.length;continue}for(i=e[++r];i?.type==="space";)t+=i.source.length,i=e[++r];break}}return t}Rc.emptyScalarPosition=Ap});var Ic=w(lo=>{"use strict";var Ip=Ct(),Tp=_(),jp=kc(),Oc=Pc(),Lp=it(),qp=Nc(),$p={composeNode:Ac,composeEmptyNode:co};function Ac(t,e,n,r){let i=t.atKey,{spaceBefore:o,comment:s,anchor:a,tag:c}=n,l,u=!0;switch(e.type){case"alias":l=Mp(t,e,r),(a||c)&&r(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=Oc.composeScalar(t,e,c,r),a&&(l.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{l=jp.composeCollection($p,t,e,n,r),a&&(l.anchor=a.source.substring(1))}catch(f){let d=f instanceof Error?f.message:String(f);r(e,"RESOURCE_EXHAUSTION",d)}break;default:{let f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",f),u=!1}}return l??(l=co(t,e.offset,void 0,null,n,r)),a&&l.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&t.options.stringKeys&&(!Tp.isScalar(l)||typeof l.value!="string"||l.tag&&l.tag!=="tag:yaml.org,2002:str")&&r(c??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(l.spaceBefore=!0),s&&(e.type==="scalar"&&e.source===""?l.comment=s:l.commentBefore=s),t.options.keepSourceTokens&&u&&(l.srcToken=e),l}function co(t,e,n,r,{spaceBefore:i,comment:o,anchor:s,tag:a,end:c},l){let u={type:"scalar",offset:qp.emptyScalarPosition(e,n,r),indent:-1,source:""},f=Oc.composeScalar(t,u,a,l);return s&&(f.anchor=s.source.substring(1),f.anchor===""&&l(s,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),o&&(f.comment=o,f.range[2]=c),f}function Mp({options:t},{offset:e,source:n,end:r},i){let o=new Ip.Alias(n.substring(1));o.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&i(e+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=e+n.length,a=Lp.resolveEnd(r,s,t.strict,i);return o.range=[e,s,a.offset],a.comment&&(o.comment=a.comment),o}lo.composeEmptyNode=co;lo.composeNode=Ac});var Lc=w(jc=>{"use strict";var Dp=Mt(),Tc=Ic(),Wp=it(),Fp=Bt();function Bp(t,e,{offset:n,start:r,value:i,end:o},s){let a=Object.assign({_directives:e},t),c=new Dp.Document(void 0,a),l={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},u=Fp.resolveProps(r,{indicator:"doc-start",next:i??o?.[0],offset:n,onError:s,parentIndent:0,startOnNewline:!0});u.found&&(c.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&s(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),c.contents=i?Tc.composeNode(l,i,u,s):Tc.composeEmptyNode(l,u.end,r,null,u,s);let f=c.contents.range[2],d=Wp.resolveEnd(o,f,!1,s);return d.comment&&(c.comment=d.comment),c.range=[n,f,d.offset],c}jc.composeDoc=Bp});var fo=w(Mc=>{"use strict";var Up=pn("process"),Kp=Vr(),zp=Mt(),Ut=Ft(),qc=_(),Jp=Lc(),Yp=it();function Kt(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:n}=t;return[e,e+(typeof n=="string"?n.length:1)]}function $c(t){let e="",n=!1,r=!1;for(let i=0;i<t.length;++i){let o=t[i];switch(o[0]){case"#":e+=(e===""?"":r?`
103
103
 
104
104
  `:`
105
- `)+(o.substring(1)||" "),n=!0,r=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}var Xi=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,o)=>{let s=Lt(n);o?this.warnings.push(new jt.YAMLWarning(s,r,i)):this.errors.push(new jt.YAMLParseError(s,r,i))},this.directives=new wp.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:r,afterEmptyLine:i}=yc(this.prelude);if(r){let o=e.contents;if(n)e.comment=e.comment?`${e.comment}
106
- ${r}`:r;else if(i||e.directives.docStart||!o)e.commentBefore=r;else if(wc.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];wc.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${r}
105
+ `)+(o.substring(1)||" "),n=!0,r=!1;break;case"%":t[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:e,afterEmptyLine:r}}var uo=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,i,o)=>{let s=Kt(n);o?this.warnings.push(new Ut.YAMLWarning(s,r,i)):this.errors.push(new Ut.YAMLParseError(s,r,i))},this.directives=new Kp.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,n){let{comment:r,afterEmptyLine:i}=$c(this.prelude);if(r){let o=e.contents;if(n)e.comment=e.comment?`${e.comment}
106
+ ${r}`:r;else if(i||e.directives.docStart||!o)e.commentBefore=r;else if(qc.isCollection(o)&&!o.flow&&o.items.length>0){let s=o.items[0];qc.isPair(s)&&(s=s.key);let a=s.commentBefore;s.commentBefore=a?`${r}
107
107
  ${a}`:r}else{let s=o.commentBefore;o.commentBefore=s?`${r}
108
- ${s}`:r}}if(n){for(let o=0;o<this.errors.length;++o)e.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)e.warnings.push(this.warnings[o])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:yc(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(let i of e)yield*this.next(i);yield*this.end(n,r)}*next(e){switch(gp.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,r,i)=>{let o=Lt(e);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",r,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=vp.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new jt.YAMLParseError(Lt(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new jt.YAMLParseError(Lt(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=bp.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
109
- ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new jt.YAMLParseError(Lt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),i=new yp.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};vc.Composer=Xi});var Cc=w(Gn=>{"use strict";var kp=Ji(),Cp=Hi(),Sp=It(),bc=yt();function _p(t,e=!0,n){if(t){let r=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,o,s);else throw new Sp.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Cp.resolveFlowScalar(t,e,r);case"block-scalar":return kp.resolveBlockScalar({options:{strict:e}},t,r)}}return null}function Ep(t,e){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=bc.stringifyString({type:s,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,source:`
108
+ ${s}`:r}}if(n){for(let o=0;o<this.errors.length;++o)e.errors.push(this.errors[o]);for(let o=0;o<this.warnings.length;++o)e.warnings.push(this.warnings[o])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:$c(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,n=!1,r=-1){for(let i of e)yield*this.next(i);yield*this.end(n,r)}*next(e){switch(Up.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case"directive":this.directives.add(e.source,(n,r,i)=>{let o=Kt(e);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",r,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let n=Jp.composeDoc(this.options,this.directives,e,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let n=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Ut.YAMLParseError(Kt(e),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){let r="Unexpected doc-end without preceding document";this.errors.push(new Ut.YAMLParseError(Kt(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;let n=Yp.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
109
+ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Ut.YAMLParseError(Kt(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),i=new zp.Document(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,n,n],this.decorate(i,!1),yield i}}};Mc.Composer=uo});var Fc=w(cr=>{"use strict";var Hp=oo(),Gp=ao(),Vp=Ft(),Dc=Pt();function Xp(t,e=!0,n){if(t){let r=(i,o,s)=>{let a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(n)n(a,o,s);else throw new Vp.YAMLParseError([a,a+1],o,s)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Gp.resolveFlowScalar(t,e,r);case"block-scalar":return Hp.resolveBlockScalar({options:{strict:e}},t,r)}}return null}function Qp(t,e){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:o=-1,type:s="PLAIN"}=e,a=Dc.stringifyString({type:s,value:t},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),c=e.end??[{type:"newline",offset:-1,indent:r,source:`
110
110
  `}];switch(a[0]){case"|":case">":{let l=a.indexOf(`
111
111
  `),u=a.substring(0,l),f=a.substring(l+1)+`
112
- `,d=[{type:"block-scalar-header",offset:o,indent:r,source:u}];return kc(d,c)||d.push({type:"newline",offset:-1,indent:r,source:`
113
- `}),{type:"block-scalar",offset:o,indent:r,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:r,source:a,end:c};default:return{type:"scalar",offset:o,indent:r,source:a,end:c}}}function xp(t,e,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=n,a="indent"in t?t.indent:null;if(r&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=bc.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":Pp(t,c);break;case'"':Zi(t,c,"double-quoted-scalar");break;case"'":Zi(t,c,"single-quoted-scalar");break;default:Zi(t,c,"scalar")}}function Pp(t,e){let n=e.indexOf(`
112
+ `,d=[{type:"block-scalar-header",offset:o,indent:r,source:u}];return Wc(d,c)||d.push({type:"newline",offset:-1,indent:r,source:`
113
+ `}),{type:"block-scalar",offset:o,indent:r,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:o,indent:r,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:o,indent:r,source:a,end:c};default:return{type:"scalar",offset:o,indent:r,source:a,end:c}}}function Zp(t,e,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:o=!1,type:s}=n,a="indent"in t?t.indent:null;if(r&&typeof a=="number"&&(a+=2),!s)switch(t.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let l=t.props[0];if(l.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s=l.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=Dc.stringifyString({type:s,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":eh(t,c);break;case'"':mo(t,c,"double-quoted-scalar");break;case"'":mo(t,c,"single-quoted-scalar");break;default:mo(t,c,"scalar")}}function eh(t,e){let n=e.indexOf(`
114
114
  `),r=e.substring(0,n),i=e.substring(n+1)+`
115
- `;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=r,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:r}];kc(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:`
116
- `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function kc(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function Zi(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let r=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of r)o.offset+=i;delete t.props,Object.assign(t,{type:n,source:e,end:r});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
117
- `};delete t.items,Object.assign(t,{type:n,source:e,end:[i]});break}default:{let r="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:n,indent:r,source:e,end:i})}}}Gn.createScalarToken=Ep;Gn.resolveAsScalar=_p;Gn.setScalarValue=xp});var _c=w(Sc=>{"use strict";var Rp=t=>"type"in t?Qn(t):Xn(t);function Qn(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=Qn(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=Xn(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=Xn(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=Xn(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function Xn({start:t,key:e,sep:n,value:r}){let i="";for(let o of t)i+=o.source;if(e&&(i+=Qn(e)),n)for(let o of n)i+=o.source;return r&&(i+=Qn(r)),i}Sc.stringify=Rp});var Rc=w(Pc=>{"use strict";var eo=Symbol("break visit"),Np=Symbol("skip children"),Ec=Symbol("remove item");function je(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),xc(Object.freeze([]),t,e)}je.BREAK=eo;je.SKIP=Np;je.REMOVE=Ec;je.itemAtPath=(t,e)=>{let n=t;for(let[r,i]of e){let o=n?.[r];if(o&&"items"in o)n=o.items[i];else return}return n};je.parentCollection=(t,e)=>{let n=je.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function xc(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=xc(Object.freeze(t.concat([[i,s]])),o.items[s],n);if(typeof a=="number")s=a-1;else{if(a===eo)return eo;a===Ec&&(o.items.splice(s,1),s-=1)}}typeof r=="function"&&i==="key"&&(r=r(e,t))}}return typeof r=="function"?r(e,t):r}Pc.visit=je});var Zn=w(B=>{"use strict";var to=Cc(),Op=_c(),Ap=Rc(),no="\uFEFF",ro="",io="",oo="",Ip=t=>!!t&&"items"in t,Tp=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function jp(t){switch(t){case no:return"<BOM>";case ro:return"<DOC>";case io:return"<FLOW_END>";case oo:return"<SCALAR>";default:return JSON.stringify(t)}}function Lp(t){switch(t){case no:return"byte-order-mark";case ro:return"doc-mode";case io:return"flow-error-end";case oo:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
115
+ `;if(t.type==="block-scalar"){let o=t.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=r,t.source=i}else{let{offset:o}=t,s="indent"in t?t.indent:-1,a=[{type:"block-scalar-header",offset:o,indent:s,source:r}];Wc(a,"end"in t?t.end:void 0)||a.push({type:"newline",offset:-1,indent:s,source:`
116
+ `});for(let c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:"block-scalar",indent:s,props:a,source:i})}}function Wc(t,e){if(e)for(let n of e)switch(n.type){case"space":case"comment":t.push(n);break;case"newline":return t.push(n),!0}return!1}function mo(t,e,n){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=n,t.source=e;break;case"block-scalar":{let r=t.props.slice(1),i=e.length;t.props[0].type==="block-scalar-header"&&(i-=t.props[0].source.length);for(let o of r)o.offset+=i;delete t.props,Object.assign(t,{type:n,source:e,end:r});break}case"block-map":case"block-seq":{let i={type:"newline",offset:t.offset+e.length,indent:t.indent,source:`
117
+ `};delete t.items,Object.assign(t,{type:n,source:e,end:[i]});break}default:{let r="indent"in t?t.indent:-1,i="end"in t&&Array.isArray(t.end)?t.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(let o of Object.keys(t))o!=="type"&&o!=="offset"&&delete t[o];Object.assign(t,{type:n,indent:r,source:e,end:i})}}}cr.createScalarToken=Qp;cr.resolveAsScalar=Xp;cr.setScalarValue=Zp});var Uc=w(Bc=>{"use strict";var th=t=>"type"in t?ur(t):lr(t);function ur(t){switch(t.type){case"block-scalar":{let e="";for(let n of t.props)e+=ur(n);return e+t.source}case"block-map":case"block-seq":{let e="";for(let n of t.items)e+=lr(n);return e}case"flow-collection":{let e=t.start.source;for(let n of t.items)e+=lr(n);for(let n of t.end)e+=n.source;return e}case"document":{let e=lr(t);if(t.end)for(let n of t.end)e+=n.source;return e}default:{let e=t.source;if("end"in t&&t.end)for(let n of t.end)e+=n.source;return e}}}function lr({start:t,key:e,sep:n,value:r}){let i="";for(let o of t)i+=o.source;if(e&&(i+=ur(e)),n)for(let o of n)i+=o.source;return r&&(i+=ur(r)),i}Bc.stringify=th});var Yc=w(Jc=>{"use strict";var po=Symbol("break visit"),nh=Symbol("skip children"),Kc=Symbol("remove item");function Be(t,e){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),zc(Object.freeze([]),t,e)}Be.BREAK=po;Be.SKIP=nh;Be.REMOVE=Kc;Be.itemAtPath=(t,e)=>{let n=t;for(let[r,i]of e){let o=n?.[r];if(o&&"items"in o)n=o.items[i];else return}return n};Be.parentCollection=(t,e)=>{let n=Be.itemAtPath(t,e.slice(0,-1)),r=e[e.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function zc(t,e,n){let r=n(e,t);if(typeof r=="symbol")return r;for(let i of["key","value"]){let o=e[i];if(o&&"items"in o){for(let s=0;s<o.items.length;++s){let a=zc(Object.freeze(t.concat([[i,s]])),o.items[s],n);if(typeof a=="number")s=a-1;else{if(a===po)return po;a===Kc&&(o.items.splice(s,1),s-=1)}}typeof r=="function"&&i==="key"&&(r=r(e,t))}}return typeof r=="function"?r(e,t):r}Jc.visit=Be});var fr=w(K=>{"use strict";var ho=Fc(),rh=Uc(),ih=Yc(),go="\uFEFF",wo="",yo="",vo="",oh=t=>!!t&&"items"in t,sh=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function ah(t){switch(t){case go:return"<BOM>";case wo:return"<DOC>";case yo:return"<FLOW_END>";case vo:return"<SCALAR>";default:return JSON.stringify(t)}}function ch(t){switch(t){case go:return"byte-order-mark";case wo:return"doc-mode";case yo:return"flow-error-end";case vo: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}B.createScalarToken=to.createScalarToken;B.resolveAsScalar=to.resolveAsScalar;B.setScalarValue=to.setScalarValue;B.stringify=Op.stringify;B.visit=Ap.visit;B.BOM=no;B.DOCUMENT=ro;B.FLOW_END=io;B.SCALAR=oo;B.isCollection=Ip;B.isScalar=Tp;B.prettyToken=jp;B.tokenType=Lp});var co=w(Oc=>{"use strict";var qt=Zn();function H(t){switch(t){case void 0:case" ":case`
120
- `:case"\r":case" ":return!0;default:return!1}}var Nc=new Set("0123456789ABCDEFabcdef"),qp=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),er=new Set(",[]{}"),$p=new Set(` ,[]{}
121
- \r `),so=t=>!t||$p.has(t),ao=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,n=!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=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
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}K.createScalarToken=ho.createScalarToken;K.resolveAsScalar=ho.resolveAsScalar;K.setScalarValue=ho.setScalarValue;K.stringify=rh.stringify;K.visit=ih.visit;K.BOM=go;K.DOCUMENT=wo;K.FLOW_END=yo;K.SCALAR=vo;K.isCollection=oh;K.isScalar=sh;K.prettyToken=ah;K.tokenType=ch});var Co=w(Gc=>{"use strict";var zt=fr();function te(t){switch(t){case void 0:case" ":case`
120
+ `:case"\r":case" ":return!0;default:return!1}}var Hc=new Set("0123456789ABCDEFabcdef"),lh=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),dr=new Set(",[]{}"),uh=new Set(` ,[]{}
121
+ \r `),bo=t=>!t||uh.has(t),ko=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,n=!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=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,n=this.buffer[e];for(;n===" "||n===" ";)n=this.buffer[++e];return!n||n==="#"||n===`
122
122
  `?!0:n==="\r"?this.buffer[e+1]===`
123
123
  `:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let n=this.buffer[e];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+e];if(n==="\r"){let i=this.buffer[r+e+1];if(i===`
124
124
  `||!i&&!this.atEnd)return e+r+1}return n===`
125
- `||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&H(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]===qt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,r=e.indexOf("#");for(;r!==-1;){let o=e[r-1];if(o===" "||o===" "){n=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let o=e[n-1];if(o===" "||o===" ")n-=1;else break}let i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield qt.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 n=this.peek(3);if((n==="---"||n==="...")&&H(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!H(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&H(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);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(so),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&H(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield qt.FLOW_END,yield*this.parseLineStart();let o=0;for(;i[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),i[o]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-o),"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(so),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let s=this.charAt(1);if(this.flowKey||H(s)||s===",")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),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let o=0;for(;this.buffer[n-1-o]==="\\";)o+=1;if(o%2===0)break;n=this.buffer.indexOf('"',n+1)}let r=this.buffer.substring(0,n),i=r.indexOf(`
125
+ `||r>=this.indentNext||!n&&!this.atEnd?e+r:-1}if(n==="-"||n==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&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]===zt.BOM&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let n=e.length,r=e.indexOf("#");for(;r!==-1;){let o=e[r-1];if(o===" "||o===" "){n=r-1;break}else r=e.indexOf("#",r+1)}for(;;){let o=e[n-1];if(o===" "||o===" ")n-=1;else break}let i=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){let n=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-n),yield*this.pushNewline(),"stream"}return yield zt.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 n=this.peek(3);if((n==="---"||n==="...")&&te(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"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,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&te(n)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(e[n]){case"#":yield*this.pushCount(e.length-n);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(bo),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,n,r=-1;do e=yield*this.pushNewline(),e>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(e+n>0);let i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&te(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield zt.FLOW_END,yield*this.parseLineStart();let o=0;for(;i[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),i[o]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-o),"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(bo),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let s=this.charAt(1);if(this.flowKey||te(s)||s===",")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),n=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let o=0;for(;this.buffer[n-1-o]==="\\";)o+=1;if(o%2===0)break;n=this.buffer.indexOf('"',n+1)}let r=this.buffer.substring(0,n),i=r.indexOf(`
127
127
  `,this.pos);if(i!==-1){for(;i!==-1;){let o=this.continueScalar(i+1);if(o===-1)break;i=r.indexOf(`
128
- `,o)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>H(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let o=this.pos;r=this.buffer[o];++o)switch(r){case" ":n+=1;break;case`
128
+ `,o)}i!==-1&&(n=i-(r[i-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let n=this.buffer[++e];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>te(n)||n==="#")}*parseBlockScalar(){let e=this.pos-1,n=0,r;e:for(let o=this.pos;r=this.buffer[o];++o)switch(r){case" ":n+=1;break;case`
129
129
  `:e=o,n=0;break;case"\r":{let s=this.buffer[o+1];if(!s&&!this.atEnd)return this.setNext("block-scalar");if(s===`
130
130
  `)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let o=this.continueScalar(e+1);if(o===-1)break;e=this.buffer.indexOf(`
131
131
  `,o)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
132
132
  `;)r=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let o=e-1,s=this.buffer[o];s==="\r"&&(s=this.buffer[--o]);let a=o;for(;s===" ";)s=this.buffer[--o];if(s===`
133
- `&&o>=this.pos&&o+1+n>a)e=o;else break}while(!0);return yield qt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let o=this.buffer[r+1];if(H(o)||e&&er.has(o))break;n=r}else if(H(i)){let o=this.buffer[r+1];if(i==="\r"&&(o===`
133
+ `&&o>=this.pos&&o+1+n>a)e=o;else break}while(!0);return yield zt.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,n=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){let o=this.buffer[r+1];if(te(o)||e&&dr.has(o))break;n=r}else if(te(i)){let o=this.buffer[r+1];if(i==="\r"&&(o===`
134
134
  `?(r+=1,i=`
135
- `,o=this.buffer[r+1]):n=r),o==="#"||e&&er.has(o))break;if(i===`
136
- `){let s=this.continueScalar(r+1);if(s===-1)break;r=Math.max(r,s-2)}}else{if(e&&er.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield qt.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(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(so),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(H(r)||n&&er.has(r)){n?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,n=this.buffer[e];for(;!H(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(qp.has(n))n=this.buffer[++e];else if(n==="%"&&Nc.has(this.buffer[e+1])&&Nc.has(this.buffer[e+2]))n=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
135
+ `,o=this.buffer[r+1]):n=r),o==="#"||e&&dr.has(o))break;if(i===`
136
+ `){let s=this.continueScalar(r+1);if(s===-1)break;r=Math.max(r,s-2)}}else{if(e&&dr.has(i))break;n=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield zt.SCALAR,yield*this.pushToIndex(n+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,n){let r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(n&&(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(bo),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let n=this.flowLevel>0,r=this.charAt(1);if(te(r)||n&&dr.has(r)){n?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,n=this.buffer[e];for(;!te(n)&&n!==">";)n=this.buffer[++e];return yield*this.pushToIndex(n===">"?e+1:e,!1)}else{let e=this.pos+1,n=this.buffer[e];for(;n;)if(lh.has(n))n=this.buffer[++e];else if(n==="%"&&Hc.has(this.buffer[e+1])&&Hc.has(this.buffer[e+2]))n=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 n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Oc.Lexer=ao});var uo=w(Ac=>{"use strict";var lo=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n<r;){let o=n+r>>1;this.lineStarts[o]<e?n=o+1:r=o}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let i=this.lineStarts[n-1];return{line:n,col:e-i+1}}}};Ac.LineCounter=lo});var mo=w(qc=>{"use strict";var Dp=rn("process"),Ic=Zn(),Mp=co();function be(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Tc(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 Lc(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 tr(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 Xe(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 nr(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function jc(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!be(e.start,"explicit-key-ind")&&!be(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Lc(e.value)?e.value.end?nr(e.value.end,e.sep):e.value.end=e.sep:nr(e.start,e.sep),delete e.sep)}var fo=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 Mp.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,Dp.env.LOG_TOKENS&&console.log("|",Ic.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=Ic.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){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 r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,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 n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&jc(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Tc(i.start)===-1&&(n.indent===0||i.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.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":{Tc(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 n=this.startBlockValue(e);n?this.stack.push(n):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 n=tr(this.peek(2)),r=Xe(n),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}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 n=this.source.indexOf(`
138
+ `?yield*this.pushCount(2):0}*pushSpaces(e){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||e&&r===" ");let i=n-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=n),i}*pushUntil(e){let n=this.pos,r=this.buffer[n];for(;!e(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}};Gc.Lexer=ko});var Eo=w(Vc=>{"use strict";var So=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let n=0,r=this.lineStarts.length;for(;n<r;){let o=n+r>>1;this.lineStarts[o]<e?n=o+1:r=o}if(this.lineStarts[n]===e)return{line:n+1,col:1};if(n===0)return{line:0,col:e};let i=this.lineStarts[n-1];return{line:n,col:e-i+1}}}};Vc.LineCounter=So});var xo=w(tl=>{"use strict";var fh=pn("process"),Xc=fr(),dh=Co();function Ee(t,e){for(let n=0;n<t.length;++n)if(t[n].type===e)return!0;return!1}function Qc(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 el(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 mr(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 ot(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 pr(t,e){if(e.length<1e5)Array.prototype.push.apply(t,e);else for(let n=0;n<e.length;++n)t.push(e[n])}function Zc(t){if(t.start.type==="flow-seq-start")for(let e of t.items)e.sep&&!e.value&&!Ee(e.start,"explicit-key-ind")&&!Ee(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,el(e.value)?e.value.end?pr(e.value.end,e.sep):e.value.end=e.sep:pr(e.start,e.sep),delete e.sep)}var _o=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 dh.Lexer,this.onNewLine=e}*parse(e,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let r of this.lexer.lex(e,n))yield*this.next(r);n||(yield*this.end())}*next(e){if(this.source=e,fh.env.LOG_TOKENS&&console.log("|",Xc.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let n=Xc.tokenType(e);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){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 r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,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 n=e??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{let r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&Zc(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{let i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=n;else{Object.assign(i,{key:n,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{let i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:n}):i.value=n;break}case"flow-collection":{let i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:n,sep:[]}):i.sep?i.value=n:Object.assign(i,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){let i=n.items[n.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Qc(i.start)===-1&&(n.indent===0||i.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),n.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":{Qc(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 n=this.startBlockValue(e);n?this.stack.push(n):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 n=mr(this.peek(2)),r=ot(n),i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];let o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}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 n=this.source.indexOf(`
139
139
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
140
- `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){nr(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&n.sep&&!n.value){let s=[];for(let a=0;a<n.sep.length;++a){let c=n.sep[a];switch(c.type){case"newline":s.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(o.push(this.sourceToken),e.items.push({start:o,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(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(be(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(Lc(n.key)&&!be(n.sep,"newline")){let s=Xe(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(be(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=Xe(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):be(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||n.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!be(n.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 r&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){nr(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||be(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=tr(r),o=Xe(i);jc(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
140
+ `,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){pr(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,i=r&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind",o=[];if(i&&n.sep&&!n.value){let s=[];for(let a=0;a<n.sep.length;++a){let c=n.sep[a];switch(c.type){case"newline":s.push(a);break;case"space":break;case"comment":c.indent>e.indent&&(s.length=0);break;default:s.length=0}}s.length>=2&&(o=n.sep.splice(s[1]))}switch(this.type){case"anchor":case"tag":i||n.value?(o.push(this.sourceToken),e.items.push({start:o}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):i||n.value?(o.push(this.sourceToken),e.items.push({start:o,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(n.explicitKey)if(n.sep)if(n.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Ee(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]});else if(el(n.key)&&!Ee(n.sep,"newline")){let s=ot(n.start),a=n.key,c=n.sep;c.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:a,sep:c}]})}else o.length>0?n.sep=n.sep.concat(o,this.sourceToken):n.sep.push(this.sourceToken);else if(Ee(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{let s=ot(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||i?e.items.push({start:o,key:null,sep:[this.sourceToken]}):Ee(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let s=this.flowScalar(this.type);i||n.value?(e.items.push({start:o,key:s,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(s):(Object.assign(n,{key:s,sep:[]}),this.onKeyLine=!0);return}default:{let s=this.startBlockValue(e);if(s){if(s.type==="block-seq"){if(!n.explicitKey&&n.sep&&!Ee(n.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 r&&e.items.push({start:o});this.stack.push(s);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let n=e.items[e.items.length-1];switch(this.type){case"newline":if(n.value){let r="end"in n.value?n.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,e.indent)){let i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){pr(i,n.start),i.push(this.sourceToken),e.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=e.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;n.value||Ee(n.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let n=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?e.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?e.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);!n||n.value?e.items.push({start:[],key:i,sep:[]}):n.sep?this.stack.push(i):Object.assign(n,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let i=mr(r),o=ot(i);Zc(e);let s=e.end.splice(1,e.end.length);s.push(this.sourceToken);let a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:o,key:e,sep:s}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let n=this.source.indexOf(`
141
141
  `)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
142
- `,n)+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 n=tr(e),r=Xe(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=tr(e),r=Xe(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.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())}}};qc.Parser=fo});var Fc=w(Dt=>{"use strict";var $c=Qi(),Wp=Nt(),$t=It(),Fp=Gr(),Bp=E(),Up=uo(),Dc=mo();function Mc(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new Up.LineCounter||null,prettyErrors:e}}function Kp(t,e={}){let{lineCounter:n,prettyErrors:r}=Mc(e),i=new Dc.Parser(n?.addNewLine),o=new $c.Composer(e),s=Array.from(o.compose(i.parse(t)));if(r&&n)for(let a of s)a.errors.forEach($t.prettifyError(t,n)),a.warnings.forEach($t.prettifyError(t,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function Wc(t,e={}){let{lineCounter:n,prettyErrors:r}=Mc(e),i=new Dc.Parser(n?.addNewLine),o=new $c.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new $t.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach($t.prettifyError(t,n)),s.warnings.forEach($t.prettifyError(t,n))),s}function zp(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let i=Wc(t,n);if(!i)return null;if(i.warnings.forEach(o=>Fp.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function Jp(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=n??e??{};if(!i)return}return Bp.isDocument(t)&&!r?t.toString(n):new Wp.Document(t,r,n).toString(n)}Dt.parse=zp;Dt.parseAllDocuments=Kp;Dt.parseDocument=Wc;Dt.stringify=Jp});var Mt=w(x=>{"use strict";var Yp=Qi(),Hp=Nt(),Vp=Ii(),po=It(),Gp=mt(),ke=E(),Xp=ge(),Qp=A(),Zp=ye(),eh=ve(),th=Zn(),nh=co(),rh=uo(),ih=mo(),rr=Fc(),Bc=lt();x.Composer=Yp.Composer;x.Document=Hp.Document;x.Schema=Vp.Schema;x.YAMLError=po.YAMLError;x.YAMLParseError=po.YAMLParseError;x.YAMLWarning=po.YAMLWarning;x.Alias=Gp.Alias;x.isAlias=ke.isAlias;x.isCollection=ke.isCollection;x.isDocument=ke.isDocument;x.isMap=ke.isMap;x.isNode=ke.isNode;x.isPair=ke.isPair;x.isScalar=ke.isScalar;x.isSeq=ke.isSeq;x.Pair=Xp.Pair;x.Scalar=Qp.Scalar;x.YAMLMap=Zp.YAMLMap;x.YAMLSeq=eh.YAMLSeq;x.CST=th;x.Lexer=nh.Lexer;x.LineCounter=rh.LineCounter;x.Parser=ih.Parser;x.parse=rr.parse;x.parseAllDocuments=rr.parseAllDocuments;x.parseDocument=rr.parseDocument;x.stringify=rr.stringify;x.visit=Bc.visit;x.visitAsync=Bc.visitAsync});import Ce from"path";function fh(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim();if(n.length===0||Ce.posix.isAbsolute(n)||Ce.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be a project-relative path`);if(n===".")return[];let r=n.replaceAll("\\","/").split("/");if(r.some(i=>i===".."))throw new Error(`${e} must stay inside the project root`);if(r.some(i=>i===""||i==="."))throw new Error(`${e} must not contain empty or dot path segments`);return r}function ir(t){let e=fh(t,"native.artifact_root");return e.length===0?".":e.join("/")}function Vc(t,e="docs"){let n=t??e;if(n!=="legacy"&&n!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return n}function Qe(t,e,n=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim().replaceAll("\\","/");if(r.length===0||Ce.posix.isAbsolute(r)||Ce.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be relative to its declared path base`);let i=r.split("/");if(i.some(o=>o===".."))throw new Error(`${e} must stay inside its declared path base`);if(i.some(o=>o===""||o==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!n&&/[*?]/u.test(r))throw new Error(`${e} cannot contain wildcards`);return i.join("/")}function ae(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Gc(t,e,n){let r=t??e;if(r!=="en"&&r!=="zh-CN")throw new Error(`${n} must be en or zh-CN`);return r}function Xc(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>go)throw new Error(`${e} exceeds ${go} characters`);let n=0;for(let r=0;r<t.length;r+=1)t[r]==="?"?n+=1:t[r]==="*"&&(n+=1,t[r+1]==="*"&&(r+=1));if(n>wo)throw new Error(`${e} contains more than ${wo} wildcard tokens`);return t}function Yc(t,e,n){if(t===void 0)return[...n];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(r=>Xc(r,e)))].sort((r,i)=>r.localeCompare(i,"en"))}function Wt(t,e,n){let r=t??e;if(!Number.isSafeInteger(r)||r<1)throw new Error(`${n} must be a positive integer`);return r}function Hc(t,e,n){let r=Wt(t,e,n);if(r>Math.floor(Number.MAX_SAFE_INTEGER/(1024*1024)))throw new Error(`${n} is too large to convert to bytes safely`);return r}function dh(t){if(t===void 0)return{...Q,include:[...Q.include],exclude:[...Q.exclude]};let e=ae(t,"native.snapshot");return{include:Yc(e.include,"native.snapshot.include",Q.include),exclude:Yc(e.exclude,"native.snapshot.exclude",Q.exclude),max_files:Wt(e.max_files,Q.max_files,"native.snapshot.max_files"),max_total_bytes:Wt(e.max_total_bytes,Q.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Wt(e.max_duration_ms,Q.max_duration_ms,"native.snapshot.max_duration_ms"),max_selection_records:Wt(e.max_selection_records,Q.max_selection_records,"native.snapshot.max_selection_records")}}function mh(t){if(t===void 0)return;let e=ae(t,"native.pending_root_move"),n=e.id,r=e.from_artifact_root,i=e.to_artifact_root,o=e.stage;if(typeof n!="string"||!/^[a-f0-9-]{8,}$/u.test(n))throw new Error("native.pending_root_move.id is invalid");if(typeof r!="string"||typeof i!="string")throw new Error("native.pending_root_move roots must be strings");if(o!=="copying"&&o!=="ready"&&o!=="switched")throw new Error("native.pending_root_move.stage is invalid");let s;if(e.cleanup!==void 0){let a=ae(e.cleanup,"native.pending_root_move.cleanup"),c=a.kind,l=a.state,u=a.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 u!="string"||!/^[a-f0-9]{64}$/u.test(u))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");s={kind:c,state:l,manifestHash:u}}return{id:n,fromArtifactRoot:ir(r),toArtifactRoot:ir(i),stage:o,...s?{cleanup:s}:{}}}function ph(t){if(t===void 0)return;let e=ae(t,"native.finish");if(e.pull_request===void 0)return{};let n=ae(e.pull_request,"native.finish.pull_request");if(n.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(n.command)||n.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(n.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let r=n.command.map((o,s)=>{if(typeof o!="string"||o.trim().length===0||o.length>4096||/[\0\r\n]/u.test(o))throw new Error(`native.finish.pull_request.command[${s}] must be a non-empty single-line string of at most 4096 characters`);return o});if(Ce.posix.isAbsolute(r[0])||Ce.win32.isAbsolute(r[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let i=n.timeout_ms??ah;if(!Number.isSafeInteger(i)||i<1||i>Jc)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${Jc}`);return{pull_request:{provider:"repository-command",command:r,timeout_ms:i}}}function hh(t,e={}){let n=ae(t,"native"),r=n.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof r!="string")throw new Error("native.artifact_root must be a string");let i=n.clarification_mode??"batch";if(i!=="sequential"&&i!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let o=n.archive_confirmation??"automatic";if(o!=="automatic"&&o!=="required")throw new Error("native.archive_confirmation must be automatic or required");let s=n.max_verify_failures??oh;if(!Number.isSafeInteger(s)||s<1)throw new Error("native.max_verify_failures must be a positive integer");let a=n.document_writes??"allow";if(a!=="allow"&&a!=="revert")throw new Error("native.document_writes must be allow or revert");let c=mh(n.pending_root_move),l=ph(n.finish);return{artifact_root:ir(r),language:Gc(n.language,"en","native.language"),clarification_mode:i,archive_confirmation:o,max_verify_failures:s,...a==="revert"?{document_writes:a}:{},snapshot:dh(n.snapshot),...l?{finish:l}:{},...c?{pending_root_move:c}:{}}}function gh(t){let e=ae(t,"classic"),n=e.context_compression??"off";if(n!=="off"&&n!=="beta")throw new Error("classic.context_compression must be off or beta");let r=e.review_mode??"standard";if(r!=="off"&&r!=="standard"&&r!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let i=e.auto_transition??!0;if(typeof i!="boolean")throw new Error("classic.auto_transition must be true or false");let o=e.document_evidence??"neutral";if(o!=="neutral"&&o!=="strict")throw new Error("classic.document_evidence must be neutral or strict");return{artifact_layout:Vc(e.artifact_layout),language:Gc(e.language,"zh-CN","classic.language"),context_compression:n,review_mode:r,auto_transition:i,...o==="strict"?{document_evidence:o}:{}}}function wh(t){let n=ae(t,"hook").allow_paths??[];if(!Array.isArray(n))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(n.map((r,i)=>Qe(r,`hook.allow_paths[${i}]`)))]}}function yh(t){if(t===void 0)return{...ho};let e=ae(t,"memory"),n=e.learning??ho.learning,r=e.retrieval??ho.retrieval;if(typeof n!="boolean")throw new Error("memory.learning must be true or false");if(typeof r!="boolean")throw new Error("memory.retrieval must be true or false");return{learning:n,retrieval:r}}function vo(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function vh(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim();if(n.length===0||n.includes("\\")||n.includes("\0")||Ce.posix.isAbsolute(n)||Ce.win32.isAbsolute(n)||n.startsWith("~")||n.split("/").some(i=>i===""||i==="."||i===".."))throw new Error(`${e} must be a safe project-relative glob`);if(!n.toLowerCase().endsWith(".md"))throw new Error(`${e} must target a Markdown file ending in .md`);if(n.length>Uc)throw new Error(`${e} exceeds ${Uc} characters`);let r=0;for(let i=0;i<n.length;i+=1)n[i]==="?"?r+=1:n[i]==="*"&&(r+=1,n[i+1]==="*"&&(i+=1));if(r>Kc)throw new Error(`${e} contains more than ${Kc} wildcard tokens`);return n}function bh(t){let e=vo(t,"knowledge.local"),n=e.include??[];if(!Array.isArray(n))throw new Error("knowledge.local.include must be an array");let r={include:[...new Set(n.map((i,o)=>vh(i,`knowledge.local.include[${o}]`)))],max_file_mb:Hc(e.max_file_mb,zc.max_file_mb,"knowledge.local.max_file_mb"),max_total_mb:Hc(e.max_total_mb,zc.max_total_mb,"knowledge.local.max_total_mb")};if(r.max_file_mb>r.max_total_mb)throw new Error("knowledge.local.max_file_mb must not exceed max_total_mb");return r}function kh(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 n=e.hostname.toLowerCase().replace(/^\[|\]$/gu,""),r=n==="localhost"||n==="127.0.0.1"||n==="::1";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&r))throw new Error("knowledge.remote.endpoint must use HTTPS (HTTP is allowed for loopback)");return e.toString()}function Ch(t){let e=vo(t,"knowledge.remote"),n=kh(e.endpoint),r=e.token_env;if(r!==void 0&&(typeof r!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(r)))throw new Error("knowledge.remote.token_env must be an environment variable name");let i=e.scope;if(i!==void 0&&(typeof i!="string"||i.length>512))throw new Error("knowledge.remote.scope must be a string of at most 512 characters");let o=e.timeout_ms??5e3;if(typeof o!="number"||!Number.isSafeInteger(o)||o<100||o>3e4)throw new Error("knowledge.remote.timeout_ms must be an integer between 100 and 30000");return{endpoint:n,...r===void 0?{}:{token_env:r},...i===void 0?{}:{scope:i},timeout_ms:o}}function Sh(t){if(t===void 0)return{...sh};let e=vo(t,"knowledge"),n=e.provider??"local";if(n!=="local"&&n!=="remote")throw new Error("knowledge.provider must be local or remote");let r=e.local===void 0?void 0:bh(e.local);if(n==="local")return{provider:n,...r?{local:r}:{}};let i=e.remote===void 0?void 0:Ch(e.remote);if(i===void 0)throw new Error("knowledge.remote must be configured when knowledge.provider is remote");return{provider:n,...r?{local:r}:{},remote:i}}function _h(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function Eh(t,e,n,r,i,o,s,a){let c=t.schema!==void 0;if(!(c||t.default_workflow!==void 0||t.workflows!==void 0||!a.allowPartialProject&&t.native!==void 0)||a.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 u=t.workflows??[t.default_workflow];if(!Array.isArray(u)||u.length===0||u.some(d=>d!=="native"&&d!=="classic"))throw new Error("workflows must contain native and/or classic");let f=[...new Set(u)];if(!f.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(f.includes("native")&&!i)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:f,ambient_resume:s,...e?{hook:e}:{},memory:n,knowledge:r,...i?{native:i}:{},...o?{classic:o}:{}}}function Ze(t,e={}){let n=(0,yo.parseDocument)(t,{uniqueKeys:!0});if(n.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${n.errors[0].message}`);let r=n.toJS();if(r==null)return{value:{},config:null,ambient_resume:!0};if(typeof r!="object"||Array.isArray(r))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let i=r,o=_h(i.ambient_resume),s=i.hook===void 0?void 0:wh(i.hook),a=yh(i.memory),c=Sh(i.knowledge),l=i.native===void 0?void 0:hh(i.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),u=i.classic===void 0?void 0:gh(i.classic),f=Eh(i,s,a,c,l,u,o,{allowPartialProject:e.allowPartialProject??!1});return{value:i,config:f,ambient_resume:o,memory:a,knowledge:c,...s?{hook:s}:{},...l?{native:l}:{},...u?{classic:u}:{}}}var yo,Ft,go,wo,Uc,Kc,oh,ho,zc,sh,ah,Jc,ch,lh,uh,Q,Se=O(()=>{"use strict";yo=on(Mt(),1),Ft=Number.MAX_SAFE_INTEGER,go=1024,wo=64,Uc=1024,Kc=64,oh=5,ho={learning:!0,retrieval:!0},zc={include:[],max_file_mb:1,max_total_mb:32},sh={provider:"local"},ah=12e4,Jc=6e5,ch=[".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/**"],lh=["**/.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"],uh=[...ch,...lh].sort((t,e)=>t.localeCompare(e,"en")),Q={include:["**/*"],exclude:[...uh],max_files:1e4,max_total_bytes:1024*1024*1024,max_duration_ms:6e4,max_selection_records:2e4}});function _e(t){return t!==0&&t!==0n&&t!=="0"}function Qc(t,e){return _e(t.dev)&&_e(e.dev)&&_e(t.ino)&&_e(e.ino)}function Ee(t,e){let n=_e(t.dev)&&_e(e.dev);if(n&&t.dev!==e.dev)return!1;let r=_e(t.ino)&&_e(e.ino);return r&&t.ino!==e.ino?!1:n&&r?!0:t.birthtime===e.birthtime}var or=O(()=>{"use strict"});import{constants as sr,promises as Le}from"fs";function bo(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function Zc(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function Bt(t){return{dev:t.dev,ino:t.ino,birthtime:bo(t)}}function ar(t,e){let n=Bt(t),r=Bt(e);return Qc(n,r)?Ee(n,r):Ee(n,r)&&bo(t)===bo(e)&&Zc(t)===Zc(e)&&t.size===e.size}async function ko(t,e,n={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let r=n.label??"file",i=n.bigint===!0,o=await Le.lstat(t,{bigint:i});if(!o.isFile()||o.isSymbolicLink())throw new xe("not-regular-file",`${r} must be a regular file`);if(BigInt(o.size)>BigInt(e))throw new xe("too-large",`${r} exceeds ${e} bytes`);let s=await Le.realpath(t);await n.verify?.("pre-open",{realPath:s,identity:Bt(o)});let a=process.platform==="win32"?sr.O_RDONLY:sr.O_RDONLY|sr.O_NOFOLLOW|sr.O_NONBLOCK,c;try{c=await Le.open(t,a)}catch(l){throw l.code==="ELOOP"?new xe("not-regular-file",`${r} must be a regular file`,{cause:l}):l}try{let[l,u,f]=await Promise.all([c.stat({bigint:i}),Le.lstat(t,{bigint:i}),Le.realpath(t)]);if(!l.isFile()||!u.isFile()||u.isSymbolicLink()||f!==s||!ar(o,l)||!ar(o,u))throw new xe("changed",`${r} changed while opening`);await n.verify?.("post-open",{realPath:f,identity:Bt(l)}),await n.hooks?.afterOpen?.();let d=[],p=0,g=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let b=e+1-p,{bytesRead:k}=await c.read(g,0,Math.min(g.length,b),null);if(k===0)break;if(p+=k,p>e)throw new xe("too-large",`${r} exceeds ${e} bytes`);d.push(Buffer.from(g.subarray(0,k)))}await n.hooks?.beforeFinalCheck?.();let[m,h,v]=await Promise.all([c.stat({bigint:i}),Le.lstat(t,{bigint:i}),Le.realpath(t)]);if(!h.isFile()||h.isSymbolicLink()||v!==s||!ar(o,m)||!ar(o,h))throw new xe("changed",`${r} changed while reading`);return await n.verify?.("post-read",{realPath:v,identity:Bt(m)}),{bytes:Buffer.concat(d,p),stat:m,realPath:v}}finally{await c.close()}}var xe,Co=O(()=>{"use strict";or();xe=class extends Error{reason;constructor(e,n,r){super(n,r),this.name="RaceSafeReadError",this.reason=e}}});import{promises as cr}from"fs";import Pe from"path";function xh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function So(t,e){let n=Pe.relative(t,e);return n===""||!Pe.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${Pe.sep}`)}async function el(t,e){let n=Pe.resolve(t),r=await cr.lstat(n);if(!r.isDirectory()||r.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return cr.realpath(n)}async function tl(t,e,n,r){let i=t;for(let o=0;o<n.length;o++){i=Pe.join(i,n[o]);let s;try{s=await cr.lstat(i)}catch(u){if(xh(u))return{exists:!1,kind:"missing"};throw u}let a=Pe.relative(t,i).replaceAll("\\","/");if(s.isSymbolicLink())throw new Error(`${r.label} crosses a symbolic link or junction at ${a}`);let c=o===n.length-1;if(!c&&!s.isDirectory())throw new Error(`${r.label} ancestor ${a} must be a real directory`);if(c&&(r.expected==="file"&&!s.isFile()||r.expected==="directory"&&!s.isDirectory()||r.expected==="any"&&!s.isFile()&&!s.isDirectory()))throw new Error(`${r.label} must be a real ${r.expected}`);let l=await cr.realpath(i);if(!So(e,l))throw new Error(`${r.label} resolves outside the project root`);if(c)return{exists:!0,kind:s.isFile()?"file":s.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function $(t,e,n){let r=Qe(e,n.label),i=Pe.resolve(t),o=await el(i,n.label),s=r.split("/"),a=Pe.resolve(i,...s);if(!So(i,a))throw new Error(`${n.label} must stay inside the project root`);let c=await tl(i,o,s,n);return{projectRoot:i,target:a,relative:r,exists:c.exists,kind:c.kind}}async function U(t,e,n,r){let i=await $(t,e,{label:r.label,expected:"file"});if(!i.exists){let s=new Error(`${r.label} does not exist`);throw s.code="ENOENT",s}let o=await el(i.projectRoot,r.label);return ko(i.target,n,{...r,verify:async(s,a)=>{if(!So(o,a.realPath))throw new Error(`${r.label} resolves outside the project root`);await tl(i.projectRoot,o,i.relative.split("/"),{label:r.label,expected:"file"})}})}var V=O(()=>{"use strict";Co();Se()});import{createHash as Ph}from"crypto";function Rh(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Kt(t,e={}){return(await lr(t,e)).document}async function Nh(t){try{return(await U(t,Ut,Ft,{label:Ut})).bytes}catch(e){if(Rh(e))return null;throw e}}function Oh(t){return t?{exists:!0,sha256:Ph("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function lr(t,e={}){let n=await Nh(t);return{document:n?Ze(n.toString("utf8"),e):null,identity:Oh(n)}}async function _o(t){return(await Kt(t))?.config??null}var Ut,et=O(()=>{"use strict";Se();V();Ut=".comet/config.yaml"});import{promises as xo}from"node:fs";async function Po(t,e){let n;for(let r=0;r<=Eo.length;r+=1)try{return await t()}catch(i){n=i;let o=i.code;if(r===Eo.length||!Ah.has(o??""))throw i;await new Promise(s=>setTimeout(s,Eo[r]))}throw n}async function nl(t,e){await Po(()=>xo.rename(t,e),`rename ${e}`)}async function ur(t){await Po(()=>xo.unlink(t),`unlink ${t}`)}async function rl(t,e){await Po(()=>xo.link(t,e),`link ${e}`)}var Ah,Eo,Ro=O(()=>{"use strict";Ah=new Set(["EPERM","EACCES","EBUSY","ENOTEMPTY"]),Eo=[50,100,200]});import{randomUUID as Ih}from"crypto";import{constants as Th,promises as j}from"fs";import q from"path";async function No(t,e){try{return await rl(t,e),{linked:!0}}catch(n){let r=n.code;if(r!=="ENOTSUP"&&r!=="EOPNOTSUPP")throw n}return await j.copyFile(t,e,Th.COPYFILE_EXCL),{linked:!1}}function qe(t,e){let n=q.relative(t,e);return n===""||!q.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${q.sep}`)}function fr(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function jh(t,e){return Ee(t,fr(e))}function dr(t,e){return Ee(fr(t),fr(e))}function il(t,e){return dr(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function mr(t){let e=await j.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 j.realpath(t),...fr(e)}}async function ce(t){for(let e of t){let n=await j.lstat(e.path);if(!n.isDirectory()||n.isSymbolicLink()||!jh(e,n)||await j.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function Lh(t,e,n){let[r,i]=await Promise.all([j.lstat(t),j.realpath(t),ce(n)]);if(!r.isFile()||r.isSymbolicLink()||!dr(r,e)||!qe(n[0].realPath,i))throw new Error("Contained atomic write temporary file changed after close");return r}async function qh(t,e){let n=q.resolve(t),r=q.resolve(e);if(!qe(n,r))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let i=[await mr(n)],o=q.relative(n,r).split(q.sep).filter(Boolean),s=n;for(let a of o){await ce(i),s=q.join(s,a);try{await j.mkdir(s)}catch(l){if(l.code!=="EEXIST")throw l}let c=await mr(s);if(!qe(i[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${s}`);i.push(c)}return await ce(i),i}async function $h(t,e){let n=q.resolve(t),r=q.resolve(e);if(!qe(n,r))throw new Error(`Contained file parent is outside its managed root: ${e}`);let i=[await mr(n)],o=q.relative(n,r).split(q.sep).filter(Boolean),s=n;for(let a of o){s=q.join(s,a);try{let c=await mr(s);if(!qe(i[0].realPath,c.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${s}`);i.push(c)}catch(c){if(c.code==="ENOENT")return null;throw c}}return await ce(i),i}async function ol(t){let e;try{e=await j.open(t,"r"),await e.sync()}catch(n){let r=n.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(r??""))throw n}finally{await e?.close()}}async function Dh(t,e,n){let r=q.dirname(t),i=await qh(n.containedRoot,r),o=q.join(r,`.${q.basename(t)}.${Ih()}.tmp`),s,a,c;try{await n.beforeTemporaryOpen?.(),s=await j.open(o,"wx"),a=await s.stat();let[l,u]=await Promise.all([j.lstat(o),j.realpath(o)]);if(await ce(i),!l.isFile()||l.isSymbolicLink()||!dr(a,l)||!qe(i[0].realPath,u))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await s.writeFile(e,"utf8"):await s.writeFile(e),await s.sync(),c=await s.stat(),!dr(a,c))throw new Error("Contained atomic write temporary file changed while writing");if(await s.close(),s=void 0,await n.afterTemporaryClose?.(),!c)throw new Error("Contained atomic write temporary file was not written");c=await Lh(o,c,i),await n.beforeCommit?.(),await ce(i);let f=await j.lstat(o);if(!f.isFile()||f.isSymbolicLink()||!c||!il(f,c))throw new Error("Contained atomic write temporary file changed before commit");n.exclusive?(await No(o,t),await j.unlink(o)):await nl(o,t),await ol(r)}catch(l){await s?.close();try{await ce(i),await j.rm(o,{force:!0})}catch{}throw l}}async function Z(t,e,n){await Dh(t,e,n)}async function zt(t,e){let n=q.dirname(t),r=await $h(e.containedRoot,n);if(!r)return!1;let i,o;try{i=await j.lstat(t),o=await j.realpath(t)}catch(c){if(c.code==="ENOENT")return!1;throw c}if(!i.isFile()||i.isSymbolicLink()||!qe(r[0].realPath,o))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await ce(r);let[s,a]=await Promise.all([j.lstat(t),j.realpath(t)]);if(!s.isFile()||s.isSymbolicLink()||!il(i,s)||a!==o)throw new Error("Contained file removal target changed before removal");return await ur(t),await ce(r),await ol(n),!0}var Re=O(()=>{"use strict";Ro();or()});var Uv,Oo=O(()=>{"use strict";Re();et();V();Uv=16*1024});var Io=O(()=>{"use strict";Re();Se();et();V();Oo()});var hr=O(()=>{"use strict"});var xl=O(()=>{"use strict"});var qo=O(()=>{"use strict";hr()});var Pl=O(()=>{"use strict";hr();qo()});var kg,Rl=O(()=>{"use strict";kg=on(Mt(),1);Re();Se();V()});var Db,Nl=O(()=>{"use strict";Re();V();Db=4*1024*1024});function Sg(t,e){let n=t;for(let r of e)n+="\0"+(typeof r=="string"?r:JSON.stringify(r));return n}function Ol(t,e){return(...n)=>{let r=Cg;if(r===null)return e(...n);let i=Sg(`async:${t}`,n),o=r.entries.get(i);if(o)return o.value;let s=e(...n).catch(a=>{throw r.entries.delete(i),a});return r.entries.set(i,{value:s}),s}}var Cg,Al=O(()=>{"use strict";Cg=null});var Ub,Il=O(()=>{"use strict";Al();et();Ub=Ol("hookWritePolicy",async t=>(await _o(t))?.hook??{allow_paths:[]})});var _g,Tl=O(()=>{"use strict";Co();_g=16*1024});var jl=O(()=>{"use strict";hr();Re();xl();Pl();Se();Rl();V();et();Io();Nl();Il();Tl();Oo();qo()});import{TextDecoder as xg}from"util";function Ll(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function Pg(t,e){try{return new xg("utf-8",{fatal:!0}).decode(t.bytes)}catch(n){throw new Error(`${e} is not valid UTF-8`,{cause:n})}}async function $o(t,e,n,r,i={}){try{let o=await U(t,e,n,{label:r,hooks:i.hooks});return{result:o,text:Pg(o,r)}}catch(o){let s=o.code;if(s==="ENOENT"||s==="ENOTDIR")return null;throw o}}async function ql(t,e,n,r,i={}){return(await $o(t,e,n,r,i))?.text??null}async function $l(t,e,n,r,i,o={}){if(Buffer.byteLength(n,"utf8")>r)throw new Error(`${i} exceeds ${r} bytes`);let s=await $o(t,e,r,i),a=await $(t,e,{label:i,expected:"file"});await Z(a.target,n,{containedRoot:a.projectRoot,beforeCommit:async()=>{await o.beforeCommit?.();let c=await $o(t,e,r,i);if(!(!s&&!c)){if(!s||!c)throw new Error(`${i} changed before commit`);if(s.result.realPath!==c.result.realPath||!Ee(Ll(s.result.stat),Ll(c.result.stat))||s.text!==c.text)throw new Error(`${i} changed before commit`)}}})}async function Dl(t,e,n,r={}){let i=await $(t,e,{label:n,expected:"file"});return i.exists?zt(i.target,{containedRoot:i.projectRoot,beforeRemove:r.beforeRemove}):!1}var Ml=O(()=>{"use strict";jl();or()});var Ul={};Ru(Ul,{RUN_STATE_FILE:()=>gr,applyRunStateToDocument:()=>Fl,readRunState:()=>Do,removeRunState:()=>Mo,runStateFromDocument:()=>it,writeRunState:()=>wr});import Rg from"path";function Gt(t,e){let n=t[e];if(typeof n!="string"||n.length===0)throw new Error(`Invalid Run state: ${e} must be a non-empty string`);return n}function Vt(t,e){let n=Gt(t,e);if(Rg.isAbsolute(n)||/^(?:[A-Za-z]:|[\\/]|~)/u.test(n)||n.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Run state: ${e} must stay inside the change directory`);return n}function Ng(t){let e=t.run_retries??"{}",n;try{n=typeof e=="string"?JSON.parse(e):e}catch(r){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:r})}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let r of Object.values(n))if(!Number.isInteger(r)||Number(r)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return n}function it(t){if(!t.run_id)return null;let e=Gt(t,"run_id"),n=Gt(t,"skill"),r=Gt(t,"skill_version"),i=Gt(t,"skill_hash"),o=Vt(t,"pending_ref"),s=Vt(t,"trajectory_ref"),a=Vt(t,"context_ref"),c=Vt(t,"artifacts_ref"),l=Vt(t,"checkpoint_ref"),u=Number(t.iteration);if(!Number.isInteger(u)||u<0)throw new Error("Invalid Run state: iteration must be a non-negative integer");if(t.orchestration!=="deterministic"&&t.orchestration!=="adaptive")throw new Error("Invalid Run state: orchestration must be deterministic or adaptive");if(t.run_status!=="running"&&t.run_status!=="waiting"&&t.run_status!=="completed"&&t.run_status!=="failed")throw new Error("Invalid Run state: run_status is invalid");return{runId:e,skill:n,skillVersion:r,skillHash:i,orchestration:t.orchestration,currentStep:Wl(t,"current_step"),iteration:u,pending:Wl(t,"pending"),pendingRef:o,trajectoryRef:s,contextRef:a,artifactsRef:c,checkpointRef:l,status:t.run_status,retries:Ng(t)}}function Fl(t,e){e?t.run_id=e.runId:delete t.run_id}function Og(t){return{runId:t.runId,skill:t.skill,skillVersion:t.skillVersion,skillHash:t.skillHash,orchestration:t.orchestration,currentStep:t.currentStep,iteration:t.iteration,pending:t.pending,pendingRef:t.pendingRef,trajectoryRef:t.trajectoryRef,contextRef:t.contextRef,artifactsRef:t.artifactsRef,checkpointRef:t.checkpointRef,status:t.status,retries:t.retries}}function Ag(t){let e={run_id:t.runId,skill:t.skill,skill_version:t.skillVersion,skill_hash:t.skillHash,orchestration:t.orchestration,current_step:t.currentStep,iteration:t.iteration,pending:t.pending,pending_ref:t.pendingRef,trajectory_ref:t.trajectoryRef,context_ref:t.contextRef,artifacts_ref:t.artifactsRef,checkpoint_ref:t.checkpointRef,run_status:t.status,run_retries:JSON.stringify(t.retries)};return it(e)}async function Do(t,e={}){let n=await ql(t,gr,Bl,"Run state",e);if(n===null)return null;let r=JSON.parse(n);return Ag(r)}async function wr(t,e,n={}){await $l(t,gr,JSON.stringify(Og(e),null,2),Bl,"Run state",n)}async function Mo(t,e={}){await Dl(t,gr,"Run state",e)}var Wl,gr,Bl,yr=O(()=>{"use strict";Ml();Wl=(t,e)=>{let n=t[e];return n==null?null:String(n)};gr=".comet/run-state.json",Bl=Number.MAX_SAFE_INTEGER});function Zo(t){return t.charCodeAt(0)===65279?t.slice(1):t}import Cw from"node:path";import{promises as ll}from"fs";import I from"path";import{promises as es}from"fs";async function Ir(t){try{return await es.access(t),!0}catch(e){if(Ou(e))return!1;throw e}}async function Tr(t){try{return await es.readdir(t)}catch(e){let n=e?.code;if(n==="ENOENT"||n==="ENOTDIR")return[];throw e}}function Ou(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}Se();et();Io();V();var Jt=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},cl=".comet/config.yaml";function ul(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function fl(t){await $(t,cl,{label:cl,expected:"file"})}function dl(t,e){let n=I.resolve(t),r=e==="docs"?I.join(n,"docs"):n,i=I.join(r,"openspec"),o=I.join(n,"docs","superpowers");return{projectRoot:n,artifactLayout:e,openSpecBase:r,openSpecRoot:i,changesDir:I.join(i,"changes"),archiveDir:I.join(i,"changes","archive"),specsDir:I.join(i,"specs"),superpowersRoot:o,superpowersSpecsDir:I.join(o,"specs"),superpowersPlansDir:I.join(o,"plans"),superpowersReportsDir:I.join(o,"reports")}}async function Uh(t){await fl(t);let e=await Kt(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new Jt;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new Jt("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function Kh(t,e){return dl(t,e??await Uh(t))}async function zh(t){try{return await ll.lstat(t),!0}catch(e){if(ul(e))return!1;throw e}}async function Jh(t,e){let n=await Kh(t,e),r=n.artifactLayout==="legacy"?"docs":"legacy",i=dl(t,r).openSpecRoot,[o,s]=await Promise.all([$(n.projectRoot,tt(n.projectRoot,n.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),zh(i)]),a=o.exists;return{paths:n,configuredRootExists:a,alternateRoot:i,alternateRootExists:s,dualRoots:a&&s}}async function Yh(t){let e=[t.openSpecRoot,t.changesDir,t.archiveDir,t.specsDir,t.superpowersRoot,t.superpowersSpecsDir,t.superpowersPlansDir,t.superpowersReportsDir];for(let n of e){let r=tt(t.projectRoot,n);await $(t.projectRoot,r,{label:`Classic managed physical path ${r}`,expected:"directory"})}}async function Yt(t,e){let n=await Jh(t,e);if(await Yh(n.paths),!n.configuredRootExists){let r=tt(n.paths.projectRoot,n.paths.openSpecRoot),i=tt(n.paths.projectRoot,n.alternateRoot);throw new Jt(`Configured Classic OpenSpec root is missing: ${r} (alternate ${i} is ${n.alternateRootExists?"present":"missing"})`)}return n.paths}async function ml(t){let e=I.resolve(t),n=null;try{(await ll.lstat(e)).isDirectory()||(e=I.dirname(e))}catch(r){if(!ul(r))throw r}for(;;){I.basename(e)==="openspec"&&(n=I.dirname(e));let r=I.join(e,".comet","config.yaml"),i=!1;if(await Ir(r))try{await fl(e);let s=(await Kt(e))?.value;i=!!s&&typeof s=="object"&&!Array.isArray(s)&&(s.schema==="comet.project.v1"||s.default_workflow!==void 0||s.native!==void 0)}catch{}if(i||await Ir(I.join(e,".git")))return e;let o=I.dirname(e);if(o===e)return n??I.resolve(t);e=o}}function tt(t,e){return I.relative(I.resolve(t),e).replaceAll("\\","/")}import{execFile as Sw}from"child_process";import st from"path";import{AsyncLocalStorage as Gg}from"node:async_hooks";Ro();import{randomUUID as cg}from"node:crypto";import{promises as $e}from"node:fs";import Sl from"node:os";import Cl from"node:path";import{promises as yl}from"node:fs";import vl from"node:path";import{execFileSync as Qh}from"node:child_process";import wl from"node:path";import{existsSync as Hh}from"node:fs";import Ht from"node:path";var Vh=/[&|<>()^%"!\r\n]/u,cb=["$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("; ");function pl(t,e){let n=e.toLowerCase();return Object.entries(t).find(([r,i])=>r.toLowerCase()===n&&i!==void 0)?.[1]}function Gh(t){let e=(pl(t,"PATHEXT")??".COM;.EXE;.BAT;.CMD").split(";").map(n=>n.trim().toLowerCase()).filter(Boolean);return[...new Set([...e,".ps1"])]}function Xh(t,e,n){let i=Ht.win32.isAbsolute(t)||/[\\/]/u.test(t)?[""]:(pl(e,"PATH")??"").split(Ht.delimiter).map(a=>a.trim().replace(/^"(.*)"$/u,"$1")).filter(Boolean),s=Ht.win32.extname(t)?[t]:Gh(e).map(a=>`${t}${a}`);return i.flatMap(a=>s.map(c=>a?Ht.join(a,c):Ht.resolve(n,c)))}function hl(t,e,n){return Xh(t,e,n).find(r=>Hh(r))??t}function gl(t){if(t.some(e=>Vh.test(e)))throw new Error("Windows batch check arguments must not contain shell syntax")}var Zh=6e4,eg=8*1024*1024,nt=class extends Error{constructor(n,r,i,o){super(`${n} ${r.join(" ")} failed${i?`: ${i}`:""}`,o);this.command=n;this.args=r;this.stderr=i;this.name="ExternalCommandError",this.timedOut=o?.timedOut===!0}command;args;stderr;timedOut};function tg(t){return t instanceof Error&&(t.code==="ETIMEDOUT"||t.killed===!0&&t.signal==="SIGTERM")}function rt(t,e,n={}){let r=n.timeoutMs??Zh,i=n.maxBufferBytes??eg;if(!Number.isSafeInteger(r)||r<1)throw new Error("External command timeout must be a positive integer");if(!Number.isSafeInteger(i)||i<1)throw new Error("External command max buffer must be a positive integer");let o=wl.resolve(n.cwd??process.cwd()),s=n.env??process.env,a=process.platform==="win32"?hl(t,s,o):t,c=wl.win32.extname(a).toLowerCase(),l=c===".bat"||c===".cmd";process.platform==="win32"&&l&&gl(e);try{return Qh(a,[...e],{cwd:o,env:s,...n.input!==void 0?{input:n.input}:{},encoding:"utf8",stdio:[n.input===void 0?"ignore":"pipe","pipe","pipe"],timeout:r,maxBuffer:i,windowsHide:!0,shell:process.platform==="win32"&&l})}catch(u){let f=typeof u.stderr=="string"?u.stderr.trim():Buffer.isBuffer(u.stderr)?u.stderr.toString("utf8").trim():"";throw new nt(t,e,f,{cause:u,timedOut:tg(u)})}}var To=null,ng=6e4,rg=1e4,jo=new Map;function ig(t){let e=jo.get(t);if(!e)return;let n=e.value===null?rg:ng;if(Date.now()-e.at>n){jo.delete(t);return}return e.value}async function Lo(t){if(t===process.pid&&To!==null)return To;let e=ig(t);if(e!==void 0)return e;let n=await og(t);return t===process.pid&&n!==null&&(To=n),t!==process.pid&&jo.set(t,{value:n,at:Date.now()}),n}async function og(t){if(!Number.isSafeInteger(t)||t<=0)return null;try{if(process.platform==="linux"){let[e,n]=await Promise.all([yl.readFile(`/proc/${t}/stat`,"utf8"),yl.readFile("/proc/sys/kernel/random/boot_id","utf8")]),r=e.slice(e.lastIndexOf(")")+2).trim().split(/\s+/u)[19];return/^\d+$/u.test(r??"")?`linux:${n.trim()}:${r}`:null}if(process.platform==="win32")return await ag(t);if(process.platform==="darwin"){let e=rt("/bin/ps",["-p",String(t),"-o","lstart="],{timeoutMs:5e3,maxBufferBytes:4096,env:{...process.env,LC_ALL:"C",TZ:"UTC0"}}).trim();return e?`darwin:${e}`:null}}catch{}return null}function sg(t){let e=t.trim();return/^\d+$/u.test(e)?`win32-ps:${e}`:null}async function ag(t){try{let i=rt(vl.win32.join(process.env.SystemRoot??"C:\\Windows","System32","wbem","WMIC.exe"),["process","where",`processid=${t}`,"get","creationdate","/value"],{timeoutMs:5e3,maxBufferBytes:4096}),o=/^CreationDate=(\S+)/mu.exec(i);if(o)return`win32-wmic:${o[1]}`}catch{}let e=process.env.SystemRoot??"C:\\Windows",n=vl.win32.join(e,"System32","WindowsPowerShell","v1.0","powershell.exe"),r=rt(n,["-NoProfile","-NonInteractive","-Command",`(Get-Process -Id ${t} -ErrorAction Stop).StartTime.ToUniversalTime().Ticks.ToString()`],{timeoutMs:8e3,maxBufferBytes:4096}).trim();return sg(r)}var bl=new Set(["win32-wmic","win32-ps"]);function pr(t){let e=t.indexOf(":");return e===-1?"":t.slice(0,e)}async function kl(t,e){if(!Number.isSafeInteger(t)||t<=0)return"alive";try{process.kill(t,0)}catch(r){if(r.code==="ESRCH")return"dead"}if(!e)return"unknown";let n=await Lo(t);return n===e?"alive":n===null||pr(n)!==pr(e)&&bl.has(pr(n))&&bl.has(pr(e))?"unknown":"dead"}var lg=3e4,ug=20,fg=5*6e4,dg=1e4;async function _l(t,e,n={}){let r=Cl.resolve(t);await $e.mkdir(Cl.dirname(r),{recursive:!0});let i=Date.now(),o=n.timeoutMs??lg,s=n.retryMs??ug,a=n.malformedLockStaleMs??fg,c=await Lo(process.pid),l={pid:process.pid,nonce:cg(),createdAt:Date.now(),hostname:Sl.hostname(),...c===null?{}:{processIdentity:c}},u=!1;for(;!u;){let f;try{f=await $e.open(r,"wx"),await f.writeFile(JSON.stringify(l),"utf8"),u=!0}catch(d){if(d.code!=="EEXIST")throw d;if(await mg(r,a))continue;if(Date.now()-i>=o)throw new Error(`Timed out waiting for file lock: ${r}`,{cause:d});await new Promise(p=>setTimeout(p,s))}finally{await f?.close()}}try{return await e()}finally{await pg(r,l.nonce)}}async function mg(t,e){let n,r;try{[n,r]=await Promise.all([$e.readFile(t,"utf8"),$e.stat(t)])}catch(o){return o.code==="ENOENT"}let i=El(n);if(i!==null&&(i.hostname!==void 0&&i.hostname!==Sl.hostname()||await kl(i.pid,i.processIdentity)!=="dead"))return!1;if(i===null){let o=n.trim().length===0?dg:e;if(Date.now()-Number(r.mtimeMs)<o)return!1}try{return await $e.readFile(t,"utf8")!==n?!1:(await $e.rm(t),!0)}catch(o){return o.code==="ENOENT"}}async function pg(t,e){try{if(El(await $e.readFile(t,"utf8"))?.nonce!==e)return;await ur(t)}catch(n){let r=n.code;if(r==="ENOENT")return;process.stderr.write(`[comet] warning: could not remove lock file ${t} (${r??n}); it will be recovered automatically
143
- `)}}function El(t){try{let e=JSON.parse(t);return Number.isSafeInteger(e.pid)&&Number(e.pid)>0&&typeof e.nonce=="string"&&e.nonce.length>0&&typeof e.createdAt=="number"&&Number.isFinite(e.createdAt)&&(e.hostname===void 0||typeof e.hostname=="string"&&e.hostname.length>0)&&(e.processIdentity===void 0||typeof e.processIdentity=="string"&&e.processIdentity.length>0)?{pid:Number(e.pid),nonce:e.nonce,createdAt:e.createdAt,...e.hostname===void 0?{}:{hostname:e.hostname},...e.processIdentity===void 0?{}:{processIdentity:e.processIdentity}}:null}catch{return null}}V();var kr=on(Mt(),1);Re();V();yr();var Kl=["full","hotfix","tweak"],zl=1,Ig=["open","design","build","verify","archive"],Tg=["en","zh-CN"],jg=["off","beta"],Lg=["subagent-driven-development","executing-plans","direct","autonomous"],qg=["plan-ready"],$g=["confirmed"],Dg=["tdd","direct"],Mg=["off","standard","thorough"],Wg=["current","branch","worktree"],Fg=["light","full"],Bg=["pending","pass","fail"],Ug=["pending","handled"],Kg=["pending","confirmed"],De=["workflow","language","phase","context_compression","build_mode","build_pause","subagent_dispatch","tdd_mode","review_mode","isolation","bound_branch","verify_mode","auto_transition","base_ref","design_doc","plan","verify_result","verify_failures","check_epoch","verification_report","branch_status","created_at","verified_at","archive_confirmation","archived","direct_override","handoff_context","handoff_hash","classic_profile","classic_migration"],Xt=["run_id"],zg=new Set([...De,...Xt]),Jg=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function Wo(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ot(t,e){let n=t[e];if(n==null||n==="")return null;if(typeof n!="string")throw new Error(`Invalid Classic state: ${e} must be a string or null`);return n}function M(t,e,n,r=!0){let i=t[e];if(i==null||i===""){if(r)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="string"||!n.includes(i))throw new Error(`Invalid Classic state: ${e} must be one of ${n.join(", ")}${r?" or null":""}`);return i}function Fo(t,e,n=!0){let r=t[e];if(r==null||r===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof r!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return r}function Jl(t,e,n=0){let r=t[e];if(r==null||r==="")return n;if(typeof r!="number"||!Number.isSafeInteger(r)||r<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return r}function vr(t,e){let n=ot(t,e);if(n===null)return null;if(/^(?:[A-Za-z]:|[\\/]|~)/u.test(n)||n.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Classic state: ${e} must be a relative repository path`);return n}function Yg(t,e){let n=ot(t,e);if(n!==null&&!/^[a-f0-9]{64}$/u.test(n))throw new Error(`Invalid Classic state: ${e} must be a sha256 hex digest`);return n}function Hg(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==zl)throw new Error(`Invalid Classic state: classic_migration must be ${zl}`);return e}function Vg(t){if(!De.some(n=>Wo(t,n)))return null;for(let n of Jg)if(!Wo(t,n))return null;return{workflow:M(t,"workflow",Kl,!1),language:M(t,"language",Tg),phase:M(t,"phase",Ig,!1),contextCompression:M(t,"context_compression",jg),buildMode:M(t,"build_mode",Lg),buildPause:M(t,"build_pause",qg),subagentDispatch:M(t,"subagent_dispatch",$g),tddMode:M(t,"tdd_mode",Dg),reviewMode:M(t,"review_mode",Mg),isolation:M(t,"isolation",Wg),boundBranch:ot(t,"bound_branch"),verifyMode:M(t,"verify_mode",Fg),autoTransition:Fo(t,"auto_transition"),baseRef:ot(t,"base_ref"),designDoc:vr(t,"design_doc"),plan:vr(t,"plan"),verifyResult:M(t,"verify_result",Bg,!1),verifyFailures:Jl(t,"verify_failures"),...Wo(t,"check_epoch")?{checkEpoch:Jl(t,"check_epoch")}:{},verificationReport:vr(t,"verification_report"),branchStatus:M(t,"branch_status",Ug),createdAt:ot(t,"created_at"),verifiedAt:ot(t,"verified_at"),archiveConfirmation:M(t,"archive_confirmation",Kg),archived:Fo(t,"archived",!1),directOverride:Fo(t,"direct_override"),handoffContext:vr(t,"handoff_context"),handoffHash:Yg(t,"handoff_hash"),classicProfile:M(t,"classic_profile",Kl),classicMigration:Hg(t)}}function Yl(t,e){let n=e??null;if(n===null&&e===void 0&&t.run_id&&t.skill)try{n=it(t)}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(i.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:r})}return{classic:Vg(t),run:n,unknownKeys:Object.keys(t).filter(r=>!zg.has(r))}}yr();var Hl=new Gg,Vl=".comet-state-transaction.json";async function Xg(t,e){let n=st.resolve(t);return Hl.getStore()===n?e():(await $(n,".comet-state.lock",{label:"Classic state lock",expected:"file"}),_l(st.join(n,".comet-state.lock"),()=>Hl.run(n,async()=>(await Zg(n),e()))))}async function Gl(t,e){try{return(await U(t,e,Number.MAX_SAFE_INTEGER,{label:"Classic state transaction"})).bytes.toString("utf8")}catch(n){if(n.code==="ENOENT")return null;throw n}}function Qg(t){if(t===null)return null;if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Invalid Classic transaction Run");let e=t,n=it({run_id:e.runId,skill:e.skill,skill_version:e.skillVersion,skill_hash:e.skillHash,orchestration:e.orchestration,current_step:e.currentStep,iteration:e.iteration,pending:e.pending,pending_ref:e.pendingRef,trajectory_ref:e.trajectoryRef,context_ref:e.contextRef,artifacts_ref:e.artifactsRef,checkpoint_ref:e.checkpointRef,run_status:e.status,run_retries:e.retries});if(!n)throw new Error("Invalid Classic transaction Run identity");return n}async function Zg(t){let e=await Gl(t,Vl);if(e===null)return;let n=JSON.parse(e);if(!n||n.schema!=="comet.classic.state-transaction.v1"||n.beforeYaml!==null&&typeof n.beforeYaml!="string"||typeof n.afterYaml!="string")throw new Error("Invalid Classic state transaction");let r=await Gl(t,".comet.yaml");if(r!==n.beforeYaml&&r!==n.afterYaml)throw new Error("Classic state transaction conflicts with current YAML; preserve files for recovery");let i=Qg(r===n.afterYaml?n.afterRun:n.beforeRun);i?await wr(t,i):await Mo(t),await zt(st.join(t,Vl),{containedRoot:t})}function br(t){let e=t.toJS();if(e===null)return{};if(typeof e!="object"||Array.isArray(e))throw new Error("Invalid Classic state document: root must be a mapping");return e}function ew(t){let e=["skill","skill_version","skill_hash","orchestration","current_step","iteration","pending","pending_ref","trajectory_ref","context_ref","artifacts_ref","checkpoint_ref","run_status","run_retries"];for(let n of e)t.delete(n)}function tw(t){let e=!1;for(let n of["build_command","verify_command"])t.has(n)&&(t.delete(n),e=!0);return e}async function nw(t){let e;try{e=(await U(st.dirname(t),st.basename(t),Number.MAX_SAFE_INTEGER,{label:"Classic state document"})).bytes.toString("utf8")}catch(r){if(r.code!=="ENOENT")throw r;return new kr.Document({})}let n=(0,kr.parseDocument)(e);if(n.errors.length>0)throw new Error(`Invalid Classic state document: ${n.errors[0].message}`);return br(n),n}async function Bo(t,e={}){return Xg(t,()=>rw(t,e))}async function rw(t,e){let n=e.migrate!==!1,r=st.join(t,".comet.yaml"),i=await nw(r),o=br(i),s=tw(i);s&&(o=br(i));let a=await Do(t);if(!a&&o.run_id&&o.skill){let{runStateFromDocument:c}=await Promise.resolve().then(()=>(yr(),Ul));a=c(o),a&&n&&(await wr(t,a),ew(i),s=!0)}return s&&n&&await Z(r,i.toString(),{containedRoot:t}),Yl(br(i),a)}var nu=on(Mt(),1);import te from"node:path";import{createHash as _r,randomUUID as vC}from"node:crypto";var iw=new Set(["GIT_DIR","GIT_WORK_TREE","GIT_COMMON_DIR","GIT_INDEX_FILE","GIT_OBJECT_DIRECTORY","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_GRAFT_FILE","GIT_SHALLOW_FILE","GIT_PREFIX","GIT_IMPLICIT_WORK_TREE","GIT_NO_REPLACE_OBJECTS","GIT_REPLACE_REF_BASE","GIT_CONFIG","GIT_CONFIG_PARAMETERS","GIT_CONFIG_COUNT"]);function ow(t=process.env){return Object.fromEntries(Object.entries(t).filter(([e])=>{let n=e.toUpperCase();return!iw.has(n)&&!/^GIT_CONFIG_(KEY|VALUE)_\d+$/u.test(n)}))}function Xl(t){return{...ow(t.environment),...t.authentication?{}:{GIT_CONFIG_GLOBAL:process.platform==="win32"?"NUL":"/dev/null",GIT_CONFIG_NOSYSTEM:"1"},GIT_TERMINAL_PROMPT:"0",GCM_INTERACTIVE:"never",SSH_ASKPASS_REQUIRE:"never",GIT_NO_REPLACE_OBJECTS:"1",GH_PROMPT_DISABLED:"1"}}Re();Se();V();import Qt from"path";var sw=Number.MAX_SAFE_INTEGER;function Ql(t,e,n){let r=Qt.resolve(t),i=Qt.isAbsolute(e)?Qt.resolve(e):Qt.resolve(r,e),o=Qt.relative(r,i).replaceAll("\\","/");return{root:r,relative:Qe(o,n),target:i}}async function le(t,e,n){let r=Ql(t,e,n.label);return $(r.root,r.relative,n)}async function ue(t,e,n){return(await le(t,e,{label:n.label,expected:n.expected??"any"})).exists}async function Me(t,e,n){return(await aw(t,e,n)).toString("utf8")}async function aw(t,e,n){let r=Ql(t,e,n.label);return(await U(r.root,r.relative,n.maxBytes??sw,{label:n.label,hooks:n.hooks})).bytes}function We(t){if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Classic progress requires a JSON object");return t}function Ko(t,e){let n=Object.keys(t).filter(r=>!e.includes(r));if(n.length)throw new Error(`Unknown Classic progress field(s): ${n.join(", ")}; allowed fields: ${e.join(", ")}`)}function ee(t,e){if(typeof t!="string"||!t.trim()||t.length>4096||[...t].some(n=>n.charCodeAt(0)<32||n.charCodeAt(0)===127))throw new Error(`Invalid Classic progress ${e}`);return t}async function lw(t,e,n){let r=te.join(e,".comet",n);if(await ue(t,r,{label:"Classic progress",expected:"file"}))return JSON.parse(await Me(t,r,{label:"Classic progress"}))}function uw(t,e){let n=_r("sha256").update(e).digest("hex");return te.join(t,".comet","runtime","classic-delivery",`${n}.json`)}async function fw(t,e){let n=uw(t,e);if(!await ue(t,n,{label:"Classic delivery reauthorization",expected:"file"}))return null;let r=We(JSON.parse(await Me(t,n,{label:"Classic delivery reauthorization"})));if(Ko(r,["schemaVersion","changeIdentity","previousAuthorizationId","authorizationId","action","targetBranch","remote","authorizedRemoteUrl"]),r.schemaVersion!==1||r.changeIdentity!==e)throw new Error("Classic delivery reauthorization identity is invalid");let i=zo({action:r.action,targetBranch:r.targetBranch,...r.remote===void 0?{}:{remote:r.remote}},!0);if(i.commit!==void 0||i.prUrl!==void 0)throw new Error("Classic delivery reauthorization cannot change sealed commit or PR evidence");return{schemaVersion:1,changeIdentity:e,previousAuthorizationId:ee(r.previousAuthorizationId,"previousAuthorizationId"),authorizationId:ee(r.authorizationId,"authorizationId"),...i,...r.authorizedRemoteUrl===void 0?{}:{authorizedRemoteUrl:ee(r.authorizedRemoteUrl,"authorizedRemoteUrl")}}}function zo(t,e=!1){let n=We(t);if(Ko(n,["action","targetBranch","remote","commit","prUrl",...e?["schemaVersion","changeIdentity","authorizedRemoteUrl","authorizationId"]:[]]),!["local","push","pr"].includes(n.action))throw new Error(`Invalid Classic delivery action '${String(n.action)}'; actions: local|push|pr`);let r=ee(n.targetBranch,"targetBranch");if(r.startsWith("-")||/[~^:?*[\\\s]/u.test(r)||r.includes("..")||r.includes("@{"))throw new Error("Invalid Classic delivery targetBranch");let i={action:n.action,targetBranch:r};if(n.remote!==void 0){let o=ee(n.remote,"remote");if(!/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$/u.test(o))throw new Error("Classic delivery remote must be a name, not a URL");i.remote=o}if(n.commit!==void 0){let o=ee(n.commit,"commit");if(!/^(?:[a-fA-F0-9]{40}|[a-fA-F0-9]{64})$/u.test(o))throw new Error("Classic delivery commit must be a full object ID");i.commit=o.toLowerCase()}if(n.prUrl!==void 0){let o=ee(n.prUrl,"prUrl"),s=new URL(o);if(s.protocol!=="https:"||s.username||s.password)throw new Error("Invalid Classic delivery prUrl");i.prUrl=o}return i}function ru(t){let e=(0,nu.parseDocument)(t,{uniqueKeys:!0});if(e.errors.length)throw new Error("Invalid Classic delivery change state");return We(e.toJS())}function iu(t,e){if(typeof t.run_id=="string"&&t.run_id)return`run:${t.run_id}`;let n=t.archived===!0?te.basename(e).replace(/^\d{4}-\d{2}-\d{2}-/u,""):te.basename(e);if(typeof t.created_at!="string"||typeof t.base_ref!="string")throw new Error("Classic delivery requires stable change identity");return`legacy:${_r("sha256").update(JSON.stringify([n,t.created_at,t.base_ref])).digest("hex")}`}async function dw(t,e){return ru(await Me(t,te.join(e,".comet.yaml"),{label:"Classic delivery state"}))}var Sr=class extends Error{constructor(e,n){super(`Classic delivery git command timed out: ${[e,...n].join(" ")}`)}};function Uo(t,e,n,r){return rt(e,n,{cwd:t,timeoutMs:5e3,env:Xl({authentication:r})}).trim()}function tn(t,e,n,r=!1){try{return Uo(t,e,n,r)}catch{return null}}function mw(t,e,n,r=!1){try{return Uo(t,e,n,r)}catch(i){if(!(i instanceof nt)||!i.timedOut)return null;try{return Uo(t,e,n,r)}catch(o){if(o instanceof nt&&o.timedOut)throw new Sr(e,n);return null}}}function Zt(t,e){return tn(t,"git",["-C",t,...e])}function en(t,e){return mw(t,"git",["-C",t,...e])}function Zl(t,e,n=!1){return tn(t,"git",["-C",t,"remote","get-url",...n?["--push"]:[],e],!0)}function pw(t,e){let n=te.relative(t,e).replaceAll("\\","/");return[`:(literal)${n}`,...[".comet-state.lock",".comet-state-transaction.json"].map(r=>`:(exclude,literal)${n}/${r}`)]}function eu(t,e,n,r){let i=te.relative(t,e).replaceAll("\\","/"),o=pw(t,e),s=en(t,["show",`${n}:${i}/.comet.yaml`]);if(!s)return!1;try{let a=ru(s);return a.archived===!0&&iu(a,e)===r&&en(t,["merge-base","--is-ancestor",n,"HEAD"])!==null&&en(t,["diff","--quiet","--no-ext-diff","--no-textconv",n,"--",...o])!==null&&en(t,["ls-files","--others","--exclude-standard","--",...o])===""}catch(a){if(a instanceof Sr)throw a;return!1}}function hw(t,e){let n=`${_r("sha256").update(e).digest("hex")}.json`,r=en(t,["rev-parse","--path-format=absolute","--git-common-dir"]);return[{root:t,file:te.join(t,".comet","classic-deliveries",n)},...r?[{root:r,file:te.join(r,"comet","classic-deliveries",n)}]:[]]}async function gw(t,e){let n=null;for(let r of hw(t,e)){if(!await ue(r.root,r.file,{label:"Classic delivery receipt",expected:"file"}))continue;let i=We(JSON.parse(await Me(r.root,r.file,{label:"Classic delivery receipt"})));if(Ko(i,["schemaVersion","changeIdentity","authorizationId","invalidated","commit","prUrl"]),i.schemaVersion!==1||i.changeIdentity!==e)throw new Error("Invalid Classic delivery receipt schema or identity");if(i.invalidated!==void 0&&typeof i.invalidated!="boolean")throw new Error("Invalid Classic delivery receipt invalidation");let o=zo({action:"local",targetBranch:"main",...i.commit!==void 0?{commit:i.commit}:{},...i.prUrl!==void 0?{prUrl:i.prUrl}:{}}),s={schemaVersion:1,changeIdentity:e,authorizationId:ee(i.authorizationId,"authorizationId"),...i.invalidated===!0?{invalidated:!0}:{},...o.commit?{commit:o.commit}:{},...o.prUrl?{prUrl:o.prUrl}:{}};if(n&&JSON.stringify(n)!==JSON.stringify(s))throw new Error("Conflicting Classic delivery receipts");n=s}return n}function ww(t){return t.authorizationId===void 0?`legacy:${_r("sha256").update(JSON.stringify(t)).digest("hex")}`:ee(t.authorizationId,"authorizationId")}function tu(t,e,n){return e===n||Zt(t,["merge-base","--is-ancestor",e,n])!==null}function yw(t){let e=/^git@([^:/]+):([^/]+\/[^/]+)$/u.exec(t);try{let n=new URL(e?`ssh://git@${e[1]}/${e[2]}`:t);if(!["https:","ssh:"].includes(n.protocol)||n.password||n.search||n.hash||n.port||n.protocol==="https:"&&n.username)return null;let r=n.pathname.replace(/\.git\/?$/u,"").replace(/\/$/u,"").split("/").filter(Boolean);return r.length!==2||r.some(i=>!/^[a-zA-Z0-9_.-]+$/u.test(i))?null:`${n.hostname}/${r.join("/")}`.toLowerCase()}catch{return null}}function Cr(t,e){try{let n=new URL(t);if(n.protocol!=="https:"||n.username||n.password||n.port||n.search||n.hash)return null;let r=/^\/([^/]+)\/([^/]+)\/pull\/([1-9]\d*)\/?$/u.exec(n.pathname);return r&&`${n.hostname}/${r[1]}/${r[2]}`.toLowerCase()===e?`https://${n.hostname}/${r[1]}/${r[2]}/pull/${r[3]}`:null}catch{return null}}async function ou(t,e,n={}){let r=await lw(t,e,"delivery.json");if(r===void 0)return{delivery:null,verification:{status:"needsAuthorization"}};let i=We(r);if(i.schemaVersion!==1)throw new Error("Unsupported Classic delivery schemaVersion");let o=zo(i,!0),s=await dw(t,e),a=iu(s,e);if(i.changeIdentity!==a)throw new Error("Classic delivery change identity mismatch");let c=ww(i),l=await fw(t,a);if(l&&l.previousAuthorizationId!==c)throw new Error("Classic delivery reauthorization is stale for the sealed authorization");let u=l?{action:l.action,targetBranch:l.targetBranch,...l.remote===void 0?{}:{remote:l.remote}}:o,f=l?.authorizationId??c,d=await gw(t,a),p=d?.authorizationId===f?d:null;if(p?.invalidated)return{delivery:null,verification:{status:"needsAuthorization",invalidated:!0}};for(let D of["commit","prUrl"]){if(D==="commit"&&p?.[D]&&u[D]&&p[D]!==u[D])throw new Error("Classic delivery receipt conflicts with authorization evidence");p?.[D]&&(u[D]=p[D])}let g=i.authorizedRemoteUrl===void 0?void 0:ee(i.authorizedRemoteUrl,"authorizedRemoteUrl"),m=l?.authorizedRemoteUrl??g,h={...u,schemaVersion:1,changeIdentity:a,authorizationId:f,...m?{authorizedRemoteUrl:m}:{}},v=Zt(t,["symbolic-ref","--quiet","--short","HEAD"]),b=te.relative(t,e).replaceAll("\\","/"),k=null;!u.commit&&s.archived===!0&&(k=Zt(t,["log","-20","--format=%H","HEAD","--",`:(literal)${b}/.comet.yaml`])?.split(/\r?\n/u).find(fe=>/^[a-f0-9]{40,64}$/u.test(fe)&&eu(t,e,fe,a))??null);let C=u.commit??k,S=!!C&&Zt(t,["cat-file","-t",C])==="commit",_=s.archived===!0&&S&&eu(t,e,C,a),P=v===u.targetBranch&&(!s.bound_branch||l!==null||s.bound_branch===v)&&_,y=!1,N=!1,J=null,ne=n.verifyRemote&&u.action!=="local"?"unavailable":"notChecked",R="notChecked";if(n.verifyRemote&&P&&u.action!=="local"&&u.remote&&m&&Zl(t,u.remote)===m&&Zl(t,u.remote,!0)===m){let D=`refs/heads/${u.targetBranch}`,fe=tn(t,"git",["-C",t,"-c","protocol.allow=never","-c","protocol.https.allow=always","-c","protocol.ssh.allow=always","-c","protocol.file.allow=always","ls-remote","--refs",u.remote,D],!0),Go=fe?.split(/\r?\n/u)??[],Xo=Go.length===1?/^([a-f0-9]{40}|[a-f0-9]{64})\t(.+)$/u.exec(Go[0]):null,ct=Xo?.[2]===D?Xo[1]:null;y=!!C&&!!ct&&tu(t,C,ct),ne=y?"verified":fe===""?"missing":fe===null||!ct||Zt(t,["cat-file","-t",ct])!=="commit"?"unavailable":"missing";let re=yw(m),Pr=re&&u.prUrl?Cr(u.prUrl,re):null,Rr=y||fe==="",Qo=K=>K.headRefName===u.targetBranch&&typeof K.headRefOid=="string"&&/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u.test(K.headRefOid)&&(y?K.headRefOid===ct&&["OPEN","MERGED"].includes(K.state):fe===""&&K.state==="MERGED"&&!!C&&tu(t,C,K.headRefOid));if(Rr&&u.action==="pr"&&(R="unavailable"),Rr&&u.action==="pr"&&Pr&&re){let K=tn(t,"gh",["pr","view",Pr,"--repo",re,"--json","url,headRefName,headRefOid,state"],!0);try{let ie=K?We(JSON.parse(K)):null;N=!!ie&&typeof ie.url=="string"&&Cr(ie.url,re)===Pr&&Qo(ie),R=N?"verified":ie?"missing":"unavailable"}catch{N=!1,R="unavailable"}}else if(Rr&&u.action==="pr"&&!u.prUrl&&re){let K=tn(t,"gh",["pr","list","--repo",re,"--head",u.targetBranch,"--state","all","--json","url,headRefName,headRefOid,state","--limit","100"],!0);try{let ie=K===null?null:JSON.parse(K);if(!Array.isArray(ie)||ie.length>=100)throw new Error("Incomplete PR discovery");let Nr=ie.map(We).filter(Or=>typeof Or.url=="string"&&Cr(Or.url,re)&&Qo(Or));Nr.length===1?(J=Cr(Nr[0].url,re),N=!0,R="verified"):R=Nr.length===0?"missing":"unavailable"}catch{R="unavailable"}}}return{delivery:h,verification:{status:P&&(u.action==="local"||(u.action==="push"?y:N))?"complete":"needsVerification",currentBranch:v,commitExists:S,archiveCommitted:_,observedCommit:k,observedPrUrl:J,remoteVerified:y,prVerified:N,remoteStatus:ne,prStatus:R}}}import su from"path";function Er(t){return t?/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(t)?t.includes("..")?"Change name cannot contain '..' (path traversal not allowed)":null:`Invalid change name: '${t}'
144
- Valid format: lowercase kebab-case (a-z, 0-9, single hyphens)`:"Change name cannot be empty"}function vw(t){let e=Er(t);if(e)throw new Error(e)}function bw(t,e){return{label:tt(t,e),directory:e}}async function kw(t,e,n){let r=bw(t,e);if(!(await le(t,e,{label:n,expected:"directory"})).exists)return{change:r,exists:!1,stateExists:!1};let o=await le(t,su.join(e,".comet.yaml"),{label:`${n} state`,expected:"file"});return{change:r,exists:!0,stateExists:o.exists}}async function au(t,e=process.cwd()){vw(t);let n=await Yt(e),r=await kw(n.projectRoot,su.join(n.changesDir,t),`Classic active change ${t}`);return{...r.change,exists:r.exists,stateExists:r.stateExists}}var at="comet.resume_probe.v1";function cu(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function _w(t){if(!cu(t))throw new Error("Invalid CometResumeProbeInput: input must be an object");if(t.schema_version!==at)throw new Error(`Invalid CometResumeProbeInput: schema_version must be ${at}`);if(typeof t.utterance!="string")throw new Error("Invalid CometResumeProbeInput: utterance must be a string");let e=cu(t.agent_context)?t.agent_context:{};return{schema_version:at,utterance:t.utterance,locale:typeof t.locale=="string"?t.locale:"unknown",agent_context:{non_trivial_work:e.non_trivial_work===!0,already_in_comet_flow:e.already_in_comet_flow===!0}}}function W(t,e,n,r,i=[]){return{schema_version:at,action:t,changeName:e?.name??null,phase:e?.phase??null,nextCommand:t==="auto_resume"||t==="ask_user"?e?.nextCommand??null:null,confidence:n,reason:r,evidence:i}}async function Ew(t,e,n){return await ue(t,e,{label:n,expected:"file"})?Me(t,e,{label:n}):""}async function Yo(t,e,n){let r=["proposal.md","design.md","tasks.md"],i=[n.name,n.workflow,n.phase];for(let o of r)i.push(await Ew(t,`${e}/${o}`,`Classic change ${n.name} ${o}`));return i.join(`
145
- `).toLowerCase()}function xw(t){switch(t){case"open":return"/comet-open";case"design":return"/comet-design";case"build":return"/comet-build";case"verify":return"/comet-verify";case"archive":return"/comet-archive";default:return null}}function uu(t,e,n){let r=n.classic,i=n.unknownKeys.filter(o=>o!=="run_id");return r?i.length>0?{name:e,valid:!1,workflow:r.workflow,phase:r.phase,currentStep:null,nextCommand:null,runtimeMode:"invalid",runtimeEval:null,evidence:[],error:`unknown field(s): ${i.join(", ")}`}:{name:e,valid:!0,workflow:r.workflow,phase:r.phase,currentStep:null,nextCommand:xw(r.phase),runtimeMode:"engine-projection",runtimeEval:null,evidence:[]}:{name:e,valid:!1,workflow:"unknown",phase:"invalid",currentStep:null,nextCommand:null,runtimeMode:"invalid",runtimeEval:null,evidence:[],error:`${t} does not contain valid Comet state`}}async function Pw(t,e){return await ue(t,`${e}/proposal.md`,{label:"Classic proposal",expected:"file"})||await ue(t,`${e}/design.md`,{label:"Classic design",expected:"file"})||await ue(t,`${e}/tasks.md`,{label:"Classic tasks",expected:"file"})}async function Rw(t){let e=(await Yt(t)).changesDir;if(!(await le(t,e,{label:"Classic changes directory",expected:"directory"})).exists)return[];let r=await Tr(e),i=[];for(let o of r){if(o==="archive"||Er(o))continue;let s=await au(o,t);if(!s.exists)continue;let a=s.directory;if(!s.stateExists){if(!await Pw(t,a))continue;let h={name:o,workflow:"unknown",phase:"invalid",nextCommand:null,diagnostic:{name:o,valid:!1,workflow:"unknown",phase:"invalid",currentStep:null,nextCommand:null,runtimeMode:"invalid",runtimeEval:null,evidence:[],error:"missing Comet state"},buildPause:null,hasClassicProjection:!1,verifyResult:null,archived:!1,text:"",missingCometState:!0};h.text=await Yo(t,a,h),i.push(h);continue}let l=await Bo(a,{migrate:!1}),u=l.classic,f=uu(a,o,l),d=!!u,p=u?.phase??f.phase,g=u?.workflow??f.workflow;if(p==="archive"||u?.archived)continue;let m={name:o,workflow:g,phase:p,nextCommand:f.nextCommand,diagnostic:f,buildPause:u?.buildPause??null,hasClassicProjection:d,verifyResult:u?.verifyResult??null,archived:u?.archived??!1,text:"",missingCometState:!1};m.text=await Yo(t,a,m),i.push(m)}return i}function Nw(t){let e=/^\d{4}-\d{2}-\d{2}-(.+)$/u.exec(t)?.[1]??t;return Er(e)===null?e:null}async function Ow(t){let e=await Yt(t);if(!(await le(t,e.archiveDir,{label:"Classic archive directory",expected:"directory"})).exists)return[];let r=[];for(let i of await Tr(e.archiveDir)){let o=Nw(i);if(!o)continue;let s=Cw.join(e.archiveDir,i),a=await le(t,s,{label:`Classic archived change ${i}`,expected:"directory"});if(!a.exists)continue;let c=await Bo(a.target,{migrate:!1}),l=c.classic;if(!l?.archived||l.phase!=="archive")continue;let u=await ou(t,a.target);if(["complete","local-verified"].includes(u.verification.status))continue;let f=uu(a.target,o,c),d={name:o,workflow:l.workflow,phase:"archive",nextCommand:"/comet-archive",diagnostic:f,buildPause:null,hasClassicProjection:!0,verifyResult:l.verifyResult,archived:!0,text:"",missingCometState:!1};d.text=await Yo(t,a.target,d),r.push(d)}return r}var Aw=["continue","resume","carry on","finish","run it","commit","verify","archive","继续","接着","恢复","跑完","提交","验证","归档","修刚才"],Iw=["what","why","how","explain","summarize","reliable","靠谱吗","是什么","为什么","解释","总结","取名","命名"],Tw=new Set(["add","build","cache","change","code","design","docs","file","fix","implement","plan","readme","task","test","update","修改","更新","修复","添加","文档","任务","计划","实现"]),jw=["do not resume","don't resume","without comet","skip comet","不要恢复","不走 comet","不要走 comet","直接解释","只回答"];function Jo(t,e){return e.some(n=>t.includes(n))}function lu(t){return t.missingCometState||!t.hasClassicProjection||!t.diagnostic.valid||t.phase==="archive"||t.verifyResult==="fail"||t.diagnostic.runtimeEval&&!t.diagnostic.runtimeEval.passed?!0:t.phase!=="build"?!1:t.buildPause==="plan-ready"}function Lw(t,e){let n=t.toLowerCase(),r=[];n.includes(e.name.toLowerCase())&&r.push({source:"user",quote:e.name});let i=e.text.split(/[^a-zA-Z0-9_\-\u4e00-\u9fff/]+/u).map(s=>s.trim().toLowerCase()).filter(s=>s.length>=4&&!Tw.has(s)),o=[...new Set(i.filter(s=>n.includes(s)))].slice(0,3);for(let s of o)r.push({source:"repo",quote:s});return r}async function qw(t){return new Promise(e=>{Sw("git",["status","--short","--untracked-files=all"],{cwd:t,timeout:3e3,maxBuffer:2*1024*1024,windowsHide:!0},(n,r)=>{if(n||typeof r!="string"){e([]);return}e(r.split(/\r?\n/u).map(i=>i.trim()).filter(Boolean))})})}async function fu(t,e){let n=_w(e),r=n.utterance.trim(),i=r.toLowerCase();if(n.agent_context.already_in_comet_flow)return W("out_of_scope",null,"low","already in Comet flow");if(Jo(i,jw))return W("out_of_scope",null,"low","user opted out of Comet resume",[{source:"user",quote:r}]);let o=await Rw(t),s=new Set(o.map(({name:g})=>g)),a=(await Ow(t)).filter(({name:g})=>!s.has(g)),c=[...o,...a];if(c.length===0)return W("none",null,"none","no active Comet changes");let l=await qw(t);if(c.length>1){let g=c.find(m=>i.includes(m.name.toLowerCase()));return g?l.length>0?W("ask_user",g,"low","uncommitted worktree changes require attribution",[{source:"repo",quote:`${l.length} dirty file(s)`}]):lu(g)?W("ask_user",g,"low","active change is at a decision point"):W("auto_resume",g,"high","request names an active change",[{source:"user",quote:g.name}]):W("ask_user",null,"low","multiple active changes require a change name")}let[u]=c;if(l.length>0)return W("ask_user",u,"low","uncommitted worktree changes require attribution",[{source:"repo",quote:`${l.length} dirty file(s)`}]);if(lu(u))return u.archived?W("ask_user",u,"low","archived change has pending delivery",[{source:"state",quote:"archived: true"},{source:"state",quote:"delivery is not complete"}]):u.missingCometState?W("ask_user",u,"low","active OpenSpec change is missing Comet state"):W("ask_user",u,"low","active change is at a decision point",[{source:"state",quote:`phase: ${u.phase}`}]);let f=Jo(i,Aw);if(!n.agent_context.non_trivial_work&&Jo(i,Iw)&&!f)return W("out_of_scope",u,"low","user asked a question without workflow work");let p=Lw(r,u);return f||p.length>0?W("auto_resume",u,"high","single active change and request is related",[{source:"state",quote:`phase: ${u.phase}`},...p]):n.agent_context.non_trivial_work?W("ask_user",u,"low","single active change exists but request looks unrelated"):W("out_of_scope",u,"low","request is not workflow work")}import{AsyncLocalStorage as $w}from"async_hooks";import{promises as du}from"fs";import nn from"path";var Ho=new $w;function Dw(t,e){let n=nn.relative(t,e);return n===""||!nn.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${nn.sep}`)}async function Mw(t){let e=nn.resolve(t.invocationCwd??process.cwd()),n=nn.resolve(t.projectRoot??await ml(e)),[r,i]=await Promise.all([du.realpath(e),du.realpath(n)]);if(!Dw(i,r))throw new Error(`Classic command invocation cwd is outside the discovered project: ${e}`);return{invocationCwd:e,projectRoot:n,observations:new Map}}async function Ww(t,e){let n=Ho.getStore();if(n)return e(n);let r=await Mw(t);return Ho.run(r,()=>e(r))}function mu(){let t=Ho.getStore();if(!t)throw new Error("Classic command project context is unavailable");return t.projectRoot}function pu(t){return(e,n)=>Ww(n,()=>t(e,n))}function xr(t,e,n){return{exitCode:t,...e===void 0?{}:{stdout:e},...n===void 0?{}:{stderr:n}}}function hu(){return xr(64,void 0,`Usage: comet-resume-probe.mjs probe <input-json>
146
- Usage: comet-resume-probe.mjs probe --stdin`)}async function Fw(){let t=[];for await(let e of process.stdin)t.push(Buffer.isBuffer(e)?e:Buffer.from(String(e)));return Zo(Buffer.concat(t).toString("utf8"))}function Bw(t){return{schema_version:at,utterance:t,locale:"unknown",agent_context:{non_trivial_work:!0,already_in_comet_flow:!1}}}function Uw(t){try{return JSON.parse(t)}catch{return Bw(t)}}var gu=pu(async t=>{let[e,n]=t;if(e!=="probe")return hu();let r=n==="--stdin",i=r?await Fw():n;if(!i)return hu();try{let o=r?Uw(i):JSON.parse(i),s=await fu(mu(),o);return xr(0,`${JSON.stringify(s,null,2)}
147
- `)}catch(o){return o instanceof SyntaxError?xr(1,void 0,`Invalid JSON: ${o.message}`):xr(1,void 0,o instanceof Error?o.message:String(o))}});var wu=["open-complete","design-complete","build-complete","verify-pass","verify-fail","archive-confirm","archive-reopen","archived","preset-escalate"];var Kw=new Set([...Xt,"archive_confirmation","verify_failures","check_epoch","classic_profile","classic_migration","bound_branch"]),yu=new Set(De.filter(t=>!Kw.has(t))),Vo={workflow:["full","hotfix","tweak"],phase:["open","design","build","verify","archive"],context_compression:["off","beta"],build_mode:["subagent-driven-development","executing-plans","direct","autonomous"],build_pause:["null","plan-ready"],subagent_dispatch:["null","confirmed"],tdd_mode:["tdd","direct"],review_mode:["off","standard","thorough"],isolation:["current","branch","worktree"],verify_mode:["light","full"],auto_transition:["true","false"],verify_result:["pending","pass","fail"],branch_status:["pending","handled"],archive_confirmation:["pending","confirmed"],archived:["true","false"],direct_override:["true","false"],classic_profile:["full","hotfix","tweak"],classic_migration:["1"]};var zw=`
142
+ `,n)+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 n=mr(e),r=ot(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let n=mr(e),r=ot(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,n){return this.type!=="comment"||this.indent<=n?!1:e.every(r=>r.type==="newline"||r.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())}}};tl.Parser=_o});var sl=w(Yt=>{"use strict";var nl=fo(),mh=Mt(),Jt=Ft(),ph=li(),hh=_(),gh=Eo(),rl=xo();function il(t){let e=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||e&&new gh.LineCounter||null,prettyErrors:e}}function wh(t,e={}){let{lineCounter:n,prettyErrors:r}=il(e),i=new rl.Parser(n?.addNewLine),o=new nl.Composer(e),s=Array.from(o.compose(i.parse(t)));if(r&&n)for(let a of s)a.errors.forEach(Jt.prettifyError(t,n)),a.warnings.forEach(Jt.prettifyError(t,n));return s.length>0?s:Object.assign([],{empty:!0},o.streamInfo())}function ol(t,e={}){let{lineCounter:n,prettyErrors:r}=il(e),i=new rl.Parser(n?.addNewLine),o=new nl.Composer(e),s=null;for(let a of o.compose(i.parse(t),!0,t.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new Jt.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(s.errors.forEach(Jt.prettifyError(t,n)),s.warnings.forEach(Jt.prettifyError(t,n))),s}function yh(t,e,n){let r;typeof e=="function"?r=e:n===void 0&&e&&typeof e=="object"&&(n=e);let i=ol(t,n);if(!i)return null;if(i.warnings.forEach(o=>ph.warn(i.options.logLevel,o)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function vh(t,e,n){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:n===void 0&&e&&(n=e),typeof n=="string"&&(n=n.length),typeof n=="number"){let i=Math.round(n);n=i<1?void 0:i>8?{indent:8}:{indent:i}}if(t===void 0){let{keepUndefined:i}=n??e??{};if(!i)return}return hh.isDocument(t)&&!r?t.toString(n):new mh.Document(t,r,n).toString(n)}Yt.parse=yh;Yt.parseAllDocuments=wh;Yt.parseDocument=ol;Yt.stringify=vh});var Ht=w(x=>{"use strict";var bh=fo(),kh=Mt(),Ch=zi(),Po=Ft(),Sh=Ct(),_e=_(),Eh=be(),_h=A(),xh=Ce(),Ph=Se(),Rh=fr(),Nh=Co(),Oh=Eo(),Ah=xo(),hr=sl(),al=yt();x.Composer=bh.Composer;x.Document=kh.Document;x.Schema=Ch.Schema;x.YAMLError=Po.YAMLError;x.YAMLParseError=Po.YAMLParseError;x.YAMLWarning=Po.YAMLWarning;x.Alias=Sh.Alias;x.isAlias=_e.isAlias;x.isCollection=_e.isCollection;x.isDocument=_e.isDocument;x.isMap=_e.isMap;x.isNode=_e.isNode;x.isPair=_e.isPair;x.isScalar=_e.isScalar;x.isSeq=_e.isSeq;x.Pair=Eh.Pair;x.Scalar=_h.Scalar;x.YAMLMap=xh.YAMLMap;x.YAMLSeq=Ph.YAMLSeq;x.CST=Rh;x.Lexer=Nh.Lexer;x.LineCounter=Oh.LineCounter;x.Parser=Ah.Parser;x.parse=hr.parse;x.parseAllDocuments=hr.parseAllDocuments;x.parseDocument=hr.parseDocument;x.stringify=hr.stringify;x.visit=al.visit;x.visitAsync=al.visitAsync});import xe from"path";function Mh(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim();if(n.length===0||xe.posix.isAbsolute(n)||xe.win32.isAbsolute(n)||/^(?:~|[\\/])/u.test(n))throw new Error(`${e} must be a project-relative path`);if(n===".")return[];let r=n.replaceAll("\\","/").split("/");if(r.some(i=>i===".."))throw new Error(`${e} must stay inside the project root`);if(r.some(i=>i===""||i==="."))throw new Error(`${e} must not contain empty or dot path segments`);return r}function gr(t){let e=Mh(t,"native.artifact_root");return e.length===0?".":e.join("/")}function pl(t,e="docs"){let n=t??e;if(n!=="legacy"&&n!=="docs")throw new Error("classic.artifact_layout must be legacy or docs");return n}function st(t,e,n=!1){if(typeof t!="string")throw new Error(`${e} must be a string`);let r=t.trim().replaceAll("\\","/");if(r.length===0||xe.posix.isAbsolute(r)||xe.win32.isAbsolute(r)||/^(?:~|[\\/])/u.test(r))throw new Error(`${e} must be relative to its declared path base`);let i=r.split("/");if(i.some(o=>o===".."))throw new Error(`${e} must stay inside its declared path base`);if(i.some(o=>o===""||o==="."))throw new Error(`${e} must not contain empty or dot path segments`);if(!n&&/[*?]/u.test(r))throw new Error(`${e} cannot contain wildcards`);return i.join("/")}function me(t,e){if(!t||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function hl(t,e,n){let r=t??e;if(r!=="en"&&r!=="zh-CN")throw new Error(`${n} must be en or zh-CN`);return r}function gl(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>No)throw new Error(`${e} exceeds ${No} characters`);let n=0;for(let r=0;r<t.length;r+=1)t[r]==="?"?n+=1:t[r]==="*"&&(n+=1,t[r+1]==="*"&&(r+=1));if(n>Oo)throw new Error(`${e} contains more than ${Oo} wildcard tokens`);return t}function dl(t,e,n){if(t===void 0)return[...n];if(!Array.isArray(t))throw new Error(`${e} contains an unsafe pattern`);return[...new Set(t.map(r=>gl(r,e)))].sort((r,i)=>r.localeCompare(i,"en"))}function Gt(t,e,n){let r=t??e;if(!Number.isSafeInteger(r)||r<1)throw new Error(`${n} must be a positive integer`);return r}function ml(t,e,n){let r=Gt(t,e,n);if(r>Math.floor(Number.MAX_SAFE_INTEGER/(1024*1024)))throw new Error(`${n} is too large to convert to bytes safely`);return r}function Dh(t){if(t===void 0)return{...ie,include:[...ie.include],exclude:[...ie.exclude]};let e=me(t,"native.snapshot");return{include:dl(e.include,"native.snapshot.include",ie.include),exclude:dl(e.exclude,"native.snapshot.exclude",ie.exclude),max_files:Gt(e.max_files,ie.max_files,"native.snapshot.max_files"),max_total_bytes:Gt(e.max_total_bytes,ie.max_total_bytes,"native.snapshot.max_total_bytes"),max_duration_ms:Gt(e.max_duration_ms,ie.max_duration_ms,"native.snapshot.max_duration_ms"),max_selection_records:Gt(e.max_selection_records,ie.max_selection_records,"native.snapshot.max_selection_records")}}function Wh(t){if(t===void 0)return;let e=me(t,"native.pending_root_move"),n=e.id,r=e.from_artifact_root,i=e.to_artifact_root,o=e.stage;if(typeof n!="string"||!/^[a-f0-9-]{8,}$/u.test(n))throw new Error("native.pending_root_move.id is invalid");if(typeof r!="string"||typeof i!="string")throw new Error("native.pending_root_move roots must be strings");if(o!=="copying"&&o!=="ready"&&o!=="switched")throw new Error("native.pending_root_move.stage is invalid");let s;if(e.cleanup!==void 0){let a=me(e.cleanup,"native.pending_root_move.cleanup"),c=a.kind,l=a.state,u=a.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 u!="string"||!/^[a-f0-9]{64}$/u.test(u))throw new Error("native.pending_root_move.cleanup.manifest_hash is invalid");s={kind:c,state:l,manifestHash:u}}return{id:n,fromArtifactRoot:gr(r),toArtifactRoot:gr(i),stage:o,...s?{cleanup:s}:{}}}function Fh(t){if(t===void 0)return;let e=me(t,"native.finish");if(e.pull_request===void 0)return{};let n=me(e.pull_request,"native.finish.pull_request");if(n.provider!=="repository-command")throw new Error("native.finish.pull_request.provider must be repository-command");if(!Array.isArray(n.command)||n.command.length===0)throw new Error("native.finish.pull_request.command must be a non-empty array");if(n.command.length>64)throw new Error("native.finish.pull_request.command must contain at most 64 arguments");let r=n.command.map((o,s)=>{if(typeof o!="string"||o.trim().length===0||o.length>4096||/[\0\r\n]/u.test(o))throw new Error(`native.finish.pull_request.command[${s}] must be a non-empty single-line string of at most 4096 characters`);return o});if(xe.posix.isAbsolute(r[0])||xe.win32.isAbsolute(r[0]))throw new Error("native.finish.pull_request.command[0] must be a bare executable name or a project-relative path");let i=n.timeout_ms??jh;if(!Number.isSafeInteger(i)||i<1||i>fl)throw new Error(`native.finish.pull_request.timeout_ms must be an integer between 1 and ${fl}`);return{pull_request:{provider:"repository-command",command:r,timeout_ms:i}}}function Bh(t,e={}){let n=me(t,"native"),r=n.artifact_root??(e.allowMissingArtifactRoot?"docs":void 0);if(typeof r!="string")throw new Error("native.artifact_root must be a string");let i=n.clarification_mode??"batch";if(i!=="sequential"&&i!=="batch")throw new Error("native.clarification_mode must be sequential or batch");let o=n.archive_confirmation??"automatic";if(o!=="automatic"&&o!=="required")throw new Error("native.archive_confirmation must be automatic or required");let s=n.max_verify_failures??Ih;if(!Number.isSafeInteger(s)||s<1)throw new Error("native.max_verify_failures must be a positive integer");let a=n.document_writes??"allow";if(a!=="allow"&&a!=="revert")throw new Error("native.document_writes must be allow or revert");let c=Wh(n.pending_root_move),l=Fh(n.finish);return{artifact_root:gr(r),language:hl(n.language,"en","native.language"),clarification_mode:i,archive_confirmation:o,max_verify_failures:s,...a==="revert"?{document_writes:a}:{},snapshot:Dh(n.snapshot),...l?{finish:l}:{},...c?{pending_root_move:c}:{}}}function Uh(t){let e=me(t,"classic"),n=e.context_compression??"off";if(n!=="off"&&n!=="beta")throw new Error("classic.context_compression must be off or beta");let r=e.review_mode??"standard";if(r!=="off"&&r!=="standard"&&r!=="thorough")throw new Error("classic.review_mode must be off, standard, or thorough");let i=e.auto_transition??!0;if(typeof i!="boolean")throw new Error("classic.auto_transition must be true or false");let o=e.document_evidence??"neutral";if(o!=="neutral"&&o!=="strict")throw new Error("classic.document_evidence must be neutral or strict");return{artifact_layout:pl(e.artifact_layout),language:hl(e.language,"zh-CN","classic.language"),context_compression:n,review_mode:r,auto_transition:i,...o==="strict"?{document_evidence:o}:{}}}function Kh(t){let n=me(t,"hook").allow_paths??[];if(!Array.isArray(n))throw new Error("hook.allow_paths must be an array");return{allow_paths:[...new Set(n.map((r,i)=>st(r,`hook.allow_paths[${i}]`)))]}}function zh(t){if(t===void 0)return{...Ro};let e=me(t,"memory"),n=e.learning??Ro.learning,r=e.retrieval??Ro.retrieval;if(typeof n!="boolean")throw new Error("memory.learning must be true or false");if(typeof r!="boolean")throw new Error("memory.retrieval must be true or false");return{learning:n,retrieval:r}}function Io(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new Error(`${e} must be a mapping`);return t}function Jh(t,e){if(typeof t!="string")throw new Error(`${e} must be a string`);let n=t.trim();if(n.length===0||n.includes("\\")||n.includes("\0")||xe.posix.isAbsolute(n)||xe.win32.isAbsolute(n)||n.startsWith("~")||n.split("/").some(i=>i===""||i==="."||i===".."))throw new Error(`${e} must be a safe project-relative glob`);if(!n.toLowerCase().endsWith(".md"))throw new Error(`${e} must target a Markdown file ending in .md`);if(n.length>cl)throw new Error(`${e} exceeds ${cl} characters`);let r=0;for(let i=0;i<n.length;i+=1)n[i]==="?"?r+=1:n[i]==="*"&&(r+=1,n[i+1]==="*"&&(i+=1));if(r>ll)throw new Error(`${e} contains more than ${ll} wildcard tokens`);return n}function Yh(t){let e=Io(t,"knowledge.local"),n=e.include??[];if(!Array.isArray(n))throw new Error("knowledge.local.include must be an array");let r={include:[...new Set(n.map((i,o)=>Jh(i,`knowledge.local.include[${o}]`)))],max_file_mb:ml(e.max_file_mb,ul.max_file_mb,"knowledge.local.max_file_mb"),max_total_mb:ml(e.max_total_mb,ul.max_total_mb,"knowledge.local.max_total_mb")};if(r.max_file_mb>r.max_total_mb)throw new Error("knowledge.local.max_file_mb must not exceed max_total_mb");return r}function Hh(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 n=e.hostname.toLowerCase().replace(/^\[|\]$/gu,""),r=n==="localhost"||n==="127.0.0.1"||n==="::1";if(e.protocol!=="https:"&&!(e.protocol==="http:"&&r))throw new Error("knowledge.remote.endpoint must use HTTPS (HTTP is allowed for loopback)");return e.toString()}function Gh(t){let e=Io(t,"knowledge.remote"),n=Hh(e.endpoint),r=e.token_env;if(r!==void 0&&(typeof r!="string"||!/^[A-Za-z_][A-Za-z0-9_]*$/u.test(r)))throw new Error("knowledge.remote.token_env must be an environment variable name");let i=e.scope;if(i!==void 0&&(typeof i!="string"||i.length>512))throw new Error("knowledge.remote.scope must be a string of at most 512 characters");let o=e.timeout_ms??5e3;if(typeof o!="number"||!Number.isSafeInteger(o)||o<100||o>3e4)throw new Error("knowledge.remote.timeout_ms must be an integer between 100 and 30000");return{endpoint:n,...r===void 0?{}:{token_env:r},...i===void 0?{}:{scope:i},timeout_ms:o}}function Vh(t){if(t===void 0)return{...Th};let e=Io(t,"knowledge"),n=e.provider??"local";if(n!=="local"&&n!=="remote")throw new Error("knowledge.provider must be local or remote");let r=e.local===void 0?void 0:Yh(e.local);if(n==="local")return{provider:n,...r?{local:r}:{}};let i=e.remote===void 0?void 0:Gh(e.remote);if(i===void 0)throw new Error("knowledge.remote must be configured when knowledge.provider is remote");return{provider:n,...r?{local:r}:{},remote:i}}function Xh(t){let e=t??!0;if(typeof e!="boolean")throw new Error("ambient_resume must be true or false");return e}function Qh(t,e,n,r,i,o,s,a){let c=t.schema!==void 0;if(!(c||t.default_workflow!==void 0||t.workflows!==void 0||!a.allowPartialProject&&t.native!==void 0)||a.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 u=t.workflows??[t.default_workflow];if(!Array.isArray(u)||u.length===0||u.some(d=>d!=="native"&&d!=="classic"))throw new Error("workflows must contain native and/or classic");let f=[...new Set(u)];if(!f.includes(t.default_workflow))throw new Error("workflows must include default_workflow");if(f.includes("native")&&!i)throw new Error("native must be a mapping");return{schema:"comet.project.v1",default_workflow:t.default_workflow,workflows:f,ambient_resume:s,...e?{hook:e}:{},memory:n,knowledge:r,...i?{native:i}:{},...o?{classic:o}:{}}}function at(t,e={}){let n=(0,Ao.parseDocument)(t,{uniqueKeys:!0});if(n.errors.length>0)throw new Error(`Invalid .comet/config.yaml: ${n.errors[0].message}`);let r=n.toJS();if(r==null)return{value:{},config:null,ambient_resume:!0};if(typeof r!="object"||Array.isArray(r))throw new Error("Invalid .comet/config.yaml: root must be a mapping");let i=r,o=Xh(i.ambient_resume),s=i.hook===void 0?void 0:Kh(i.hook),a=zh(i.memory),c=Vh(i.knowledge),l=i.native===void 0?void 0:Bh(i.native,{allowMissingArtifactRoot:e.allowMissingNativeFields}),u=i.classic===void 0?void 0:Uh(i.classic),f=Qh(i,s,a,c,l,u,o,{allowPartialProject:e.allowPartialProject??!1});return{value:i,config:f,ambient_resume:o,memory:a,knowledge:c,...s?{hook:s}:{},...l?{native:l}:{},...u?{classic:u}:{}}}var Ao,Vt,No,Oo,cl,ll,Ih,Ro,ul,Th,jh,fl,Lh,qh,$h,ie,Pe=O(()=>{"use strict";Ao=hn(Ht(),1),Vt=Number.MAX_SAFE_INTEGER,No=1024,Oo=64,cl=1024,ll=64,Ih=5,Ro={learning:!0,retrieval:!0},ul={include:[],max_file_mb:1,max_total_mb:32},Th={provider:"local"},jh=12e4,fl=6e5,Lh=[".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/**"],qh=["**/.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"],$h=[...Lh,...qh].sort((t,e)=>t.localeCompare(e,"en")),ie={include:["**/*"],exclude:[...$h],max_files:1e4,max_total_bytes:1024*1024*1024,max_duration_ms:6e4,max_selection_records:2e4}});function Re(t){return t!==0&&t!==0n&&t!=="0"}function wl(t,e){return Re(t.dev)&&Re(e.dev)&&Re(t.ino)&&Re(e.ino)}function Ne(t,e){let n=Re(t.dev)&&Re(e.dev);if(n&&t.dev!==e.dev)return!1;let r=Re(t.ino)&&Re(e.ino);return r&&t.ino!==e.ino?!1:n&&r?!0:t.birthtime===e.birthtime}var wr=O(()=>{"use strict"});import{constants as Oe,promises as z}from"fs";import{createHash as Zh}from"node:crypto";function To(t){return"birthtimeNs"in t&&typeof t.birthtimeNs=="bigint"?t.birthtimeNs:t.birthtimeMs}function yl(t){return"ctimeNs"in t&&typeof t.ctimeNs=="bigint"?t.ctimeNs:t.ctimeMs}function Ie(t){return{dev:t.dev,ino:t.ino,birthtime:To(t)}}function Ae(t,e){let n=Ie(t),r=Ie(e);return wl(n,r)?Ne(n,r):Ne(n,r)&&To(t)===To(e)&&yl(t)===yl(e)&&t.size===e.size}async function jo(t,e,n={}){if(!Number.isSafeInteger(e)||e<1)throw new Error("race-safe read byte limit must be a positive integer");let r=n.label??"file",i=n.bigint===!0,o=await z.lstat(t,{bigint:i});if(!o.isFile()||o.isSymbolicLink())throw new V("not-regular-file",`${r} must be a regular file`);if(BigInt(o.size)>BigInt(e))throw new V("too-large",`${r} exceeds ${e} bytes`);let s=await z.realpath(t);await n.verify?.("pre-open",{realPath:s,identity:Ie(o)});let a=process.platform==="win32"?Oe.O_RDONLY:Oe.O_RDONLY|Oe.O_NOFOLLOW|Oe.O_NONBLOCK,c;try{c=await z.open(t,a)}catch(l){throw l.code==="ELOOP"?new V("not-regular-file",`${r} must be a regular file`,{cause:l}):l}try{let[l,u,f]=await Promise.all([c.stat({bigint:i}),z.lstat(t,{bigint:i}),z.realpath(t)]);if(!l.isFile()||!u.isFile()||u.isSymbolicLink()||f!==s||!Ae(o,l)||!Ae(o,u))throw new V("changed",`${r} changed while opening`);await n.verify?.("post-open",{realPath:f,identity:Ie(l)}),await n.hooks?.afterOpen?.();let d=[],p=0,g=Buffer.allocUnsafe(Math.min(64*1024,e+1));for(;;){let b=e+1-p,{bytesRead:k}=await c.read(g,0,Math.min(g.length,b),null);if(k===0)break;if(p+=k,p>e)throw new V("too-large",`${r} exceeds ${e} bytes`);d.push(Buffer.from(g.subarray(0,k)))}await n.hooks?.beforeFinalCheck?.();let[m,h,y]=await Promise.all([c.stat({bigint:i}),z.lstat(t,{bigint:i}),z.realpath(t)]);if(!h.isFile()||h.isSymbolicLink()||y!==s||!Ae(o,m)||!Ae(o,h))throw new V("changed",`${r} changed while reading`);return await n.verify?.("post-read",{realPath:y,identity:Ie(m)}),{bytes:Buffer.concat(d,p),stat:m,realPath:y}}finally{await c.close()}}async function vl(t,e={}){let n=e.label??"file",r=e.bigint===!0,i=await z.lstat(t,{bigint:r});if(!i.isFile()||i.isSymbolicLink())throw new V("not-regular-file",`${n} must be a regular file`);let o=await z.realpath(t);await e.verify?.("pre-open",{realPath:o,identity:Ie(i)});let s=process.platform==="win32"?Oe.O_RDONLY:Oe.O_RDONLY|Oe.O_NOFOLLOW|Oe.O_NONBLOCK,a;try{a=await z.open(t,s)}catch(c){throw c.code==="ELOOP"?new V("not-regular-file",`${n} must be a regular file`,{cause:c}):c}try{let[c,l,u]=await Promise.all([a.stat({bigint:r}),z.lstat(t,{bigint:r}),z.realpath(t)]);if(!c.isFile()||!l.isFile()||l.isSymbolicLink()||u!==o||!Ae(i,c)||!Ae(i,l))throw new V("changed",`${n} changed while opening`);await e.verify?.("post-open",{realPath:u,identity:Ie(c)}),await e.hooks?.afterOpen?.();let f=Zh(e.algorithm??"sha256"),d=Buffer.allocUnsafe(64*1024);for(;;){let{bytesRead:h}=await a.read(d,0,d.length,null);if(h===0)break;f.update(d.subarray(0,h))}await e.hooks?.beforeFinalCheck?.();let[p,g,m]=await Promise.all([a.stat({bigint:r}),z.lstat(t,{bigint:r}),z.realpath(t)]);if(!g.isFile()||g.isSymbolicLink()||m!==o||!Ae(i,p)||!Ae(i,g))throw new V("changed",`${n} changed while reading`);return await e.verify?.("post-read",{realPath:m,identity:Ie(p)}),{digest:f.digest("hex"),stat:p,realPath:m}}finally{await a.close()}}var V,Lo=O(()=>{"use strict";wr();V=class extends Error{reason;constructor(e,n,r){super(n,r),this.name="RaceSafeReadError",this.reason=e}}});import{promises as yr}from"fs";import Te from"path";async function bl(t,e,n){let r=await q(t,e,{label:n.label,expected:"file"});if(!r.exists){let o=new Error(`${n.label} does not exist`);throw o.code="ENOENT",o}let i=await qo(r.projectRoot,n.label);return vl(r.target,{...n,verify:async(o,s)=>{if(!vr(i,s.realPath))throw new Error(`${n.label} resolves outside the project root`);await $o(r.projectRoot,i,r.relative.split("/"),{label:n.label,expected:"file"})}})}function eg(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}function vr(t,e){let n=Te.relative(t,e);return n===""||!Te.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${Te.sep}`)}async function qo(t,e){let n=Te.resolve(t),r=await yr.lstat(n);if(!r.isDirectory()||r.isSymbolicLink())throw new Error(`${e} project root must be a real directory`);return yr.realpath(n)}async function $o(t,e,n,r){let i=t;for(let o=0;o<n.length;o++){i=Te.join(i,n[o]);let s;try{s=await yr.lstat(i)}catch(u){if(eg(u))return{exists:!1,kind:"missing"};throw u}let a=Te.relative(t,i).replaceAll("\\","/");if(s.isSymbolicLink())throw new Error(`${r.label} crosses a symbolic link or junction at ${a}`);let c=o===n.length-1;if(!c&&!s.isDirectory())throw new Error(`${r.label} ancestor ${a} must be a real directory`);if(c&&(r.expected==="file"&&!s.isFile()||r.expected==="directory"&&!s.isDirectory()||r.expected==="any"&&!s.isFile()&&!s.isDirectory()))throw new Error(`${r.label} must be a real ${r.expected}`);let l=await yr.realpath(i);if(!vr(e,l))throw new Error(`${r.label} resolves outside the project root`);if(c)return{exists:!0,kind:s.isFile()?"file":s.isDirectory()?"directory":"missing"}}return{exists:!0,kind:"directory"}}async function q(t,e,n){let r=st(e,n.label),i=Te.resolve(t),o=await qo(i,n.label),s=r.split("/"),a=Te.resolve(i,...s);if(!vr(i,a))throw new Error(`${n.label} must stay inside the project root`);let c=await $o(i,o,s,n);return{projectRoot:i,target:a,relative:r,exists:c.exists,kind:c.kind}}async function D(t,e,n,r){let i=await q(t,e,{label:r.label,expected:"file"});if(!i.exists){let s=new Error(`${r.label} does not exist`);throw s.code="ENOENT",s}let o=await qo(i.projectRoot,r.label);return jo(i.target,n,{...r,verify:async(s,a)=>{if(!vr(o,a.realPath))throw new Error(`${r.label} resolves outside the project root`);await $o(i.projectRoot,o,i.relative.split("/"),{label:r.label,expected:"file"})}})}var X=O(()=>{"use strict";Lo();Pe()});import{createHash as tg}from"crypto";function ng(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Qt(t,e={}){return(await br(t,e)).document}async function rg(t){try{return(await D(t,Xt,Vt,{label:Xt})).bytes}catch(e){if(ng(e))return null;throw e}}function ig(t){return t?{exists:!0,sha256:tg("sha256").update(t).digest("hex")}:{exists:!1,sha256:null}}async function br(t,e={}){let n=await rg(t);return{document:n?at(n.toString("utf8"),e):null,identity:ig(n)}}async function Mo(t){return(await Qt(t))?.config??null}var Xt,ct=O(()=>{"use strict";Pe();X();Xt=".comet/config.yaml"});import{promises as Wo}from"node:fs";async function Fo(t,e){let n;for(let r=0;r<=Do.length;r+=1)try{return await t()}catch(i){n=i;let o=i.code;if(r===Do.length||!og.has(o??""))throw i;await new Promise(s=>setTimeout(s,Do[r]))}throw n}async function kl(t,e){await Fo(()=>Wo.rename(t,e),`rename ${e}`)}async function kr(t){await Fo(()=>Wo.unlink(t),`unlink ${t}`)}async function Cl(t,e){await Fo(()=>Wo.link(t,e),`link ${e}`)}var og,Do,Bo=O(()=>{"use strict";og=new Set(["EPERM","EACCES","EBUSY","ENOTEMPTY"]),Do=[50,100,200]});import{randomUUID as sg}from"crypto";import{constants as ag,promises as L}from"fs";import M from"path";async function Uo(t,e){try{return await Cl(t,e),{linked:!0}}catch(n){let r=n.code;if(r!=="ENOTSUP"&&r!=="EOPNOTSUPP")throw n}return await L.copyFile(t,e,ag.COPYFILE_EXCL),{linked:!1}}function Ue(t,e){let n=M.relative(t,e);return n===""||!M.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${M.sep}`)}function Cr(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function cg(t,e){return Ne(t,Cr(e))}function Sr(t,e){return Ne(Cr(t),Cr(e))}function Sl(t,e){return Sr(t,e)&&t.birthtimeMs===e.birthtimeMs&&t.ctimeMs===e.ctimeMs&&t.mtimeMs===e.mtimeMs&&t.size===e.size}async function Er(t){let e=await L.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 L.realpath(t),...Cr(e)}}async function pe(t){for(let e of t){let n=await L.lstat(e.path);if(!n.isDirectory()||n.isSymbolicLink()||!cg(e,n)||await L.realpath(e.path)!==e.realPath)throw new Error(`Contained atomic write parent changed before commit: ${e.path}`)}}async function lg(t,e,n){let[r,i]=await Promise.all([L.lstat(t),L.realpath(t),pe(n)]);if(!r.isFile()||r.isSymbolicLink()||!Sr(r,e)||!Ue(n[0].realPath,i))throw new Error("Contained atomic write temporary file changed after close");return r}async function ug(t,e){let n=M.resolve(t),r=M.resolve(e);if(!Ue(n,r))throw new Error(`Contained atomic write parent is outside its managed root: ${e}`);let i=[await Er(n)],o=M.relative(n,r).split(M.sep).filter(Boolean),s=n;for(let a of o){await pe(i),s=M.join(s,a);try{await L.mkdir(s)}catch(l){if(l.code!=="EEXIST")throw l}let c=await Er(s);if(!Ue(i[0].realPath,c.realPath))throw new Error(`Contained atomic write parent resolves outside its managed root: ${s}`);i.push(c)}return await pe(i),i}async function fg(t,e){let n=M.resolve(t),r=M.resolve(e);if(!Ue(n,r))throw new Error(`Contained file parent is outside its managed root: ${e}`);let i=[await Er(n)],o=M.relative(n,r).split(M.sep).filter(Boolean),s=n;for(let a of o){s=M.join(s,a);try{let c=await Er(s);if(!Ue(i[0].realPath,c.realPath))throw new Error(`Contained file parent resolves outside its managed root: ${s}`);i.push(c)}catch(c){if(c.code==="ENOENT")return null;throw c}}return await pe(i),i}async function El(t){let e;try{e=await L.open(t,"r"),await e.sync()}catch(n){let r=n.code;if(!["EACCES","EBADF","EINVAL","EISDIR","ENOTSUP","EPERM"].includes(r??""))throw n}finally{await e?.close()}}async function dg(t,e,n){let r=M.dirname(t),i=await ug(n.containedRoot,r),o=M.join(r,`.${M.basename(t)}.${sg()}.tmp`),s,a,c;try{await n.beforeTemporaryOpen?.(),s=await L.open(o,"wx"),a=await s.stat();let[l,u]=await Promise.all([L.lstat(o),L.realpath(o)]);if(await pe(i),!l.isFile()||l.isSymbolicLink()||!Sr(a,l)||!Ue(i[0].realPath,u))throw new Error("Contained atomic write temporary file opened outside its managed parent");if(typeof e=="string"?await s.writeFile(e,"utf8"):await s.writeFile(e),await s.sync(),c=await s.stat(),!Sr(a,c))throw new Error("Contained atomic write temporary file changed while writing");if(await s.close(),s=void 0,await n.afterTemporaryClose?.(),!c)throw new Error("Contained atomic write temporary file was not written");c=await lg(o,c,i),await n.beforeCommit?.(),await pe(i);let f=await L.lstat(o);if(!f.isFile()||f.isSymbolicLink()||!c||!Sl(f,c))throw new Error("Contained atomic write temporary file changed before commit");n.exclusive?(await Uo(o,t),await L.unlink(o)):await kl(o,t),await El(r)}catch(l){await s?.close();try{await pe(i),await L.rm(o,{force:!0})}catch{}throw l}}async function oe(t,e,n){await dg(t,e,n)}async function Zt(t,e){let n=M.dirname(t),r=await fg(e.containedRoot,n);if(!r)return!1;let i,o;try{i=await L.lstat(t),o=await L.realpath(t)}catch(c){if(c.code==="ENOENT")return!1;throw c}if(!i.isFile()||i.isSymbolicLink()||!Ue(r[0].realPath,o))throw new Error("Contained file removal target must be a regular file inside its managed root");await e.beforeRemove?.(),await pe(r);let[s,a]=await Promise.all([L.lstat(t),L.realpath(t)]);if(!s.isFile()||s.isSymbolicLink()||!Sl(i,s)||a!==o)throw new Error("Contained file removal target changed before removal");return await kr(t),await pe(r),await El(n),!0}var je=O(()=>{"use strict";Bo();wr()});var Ob,Ko=O(()=>{"use strict";je();ct();X();Ob=16*1024});var Jo=O(()=>{"use strict";je();Pe();ct();X();Ko()});var Rr=O(()=>{"use strict"});var Gl=O(()=>{"use strict"});var es=O(()=>{"use strict";Rr()});var Vl=O(()=>{"use strict";Rr();es()});var Vg,Xl=O(()=>{"use strict";Vg=hn(Ht(),1);je();Pe();X()});var Ik,Ql=O(()=>{"use strict";je();X();Ik=4*1024*1024});import{AsyncLocalStorage as Xg}from"node:async_hooks";function Zg(){let t=Qg.getStore();return t?.active?t:null}function ew(t,e){let n=t;for(let r of e)n+="\0"+(typeof r=="string"?r:JSON.stringify(r));return n}function Zl(t,e){return(...n)=>{let r=Zg();if(r===null)return e(...n);let i=ew(`async:${t}`,n),o=r.entries.get(i);if(o)return o.value;let s=e(...n).catch(a=>{throw r.entries.get(i)?.value===s&&r.entries.delete(i),a});return r.entries.set(i,{value:s}),s}}var Qg,eu=O(()=>{"use strict";Qg=new Xg});var Mk,tu=O(()=>{"use strict";eu();ct();Mk=Zl("hookWritePolicy",async t=>(await Mo(t))?.hook??{allow_paths:[]})});var tw,nu=O(()=>{"use strict";Lo();tw=16*1024});var ru=O(()=>{"use strict";Rr();je();Gl();Vl();Pe();Xl();X();ct();Jo();Ql();tu();nu();Ko();es()});import{TextDecoder as rw}from"util";function iu(t){return{dev:t.dev,ino:t.ino,birthtime:t.birthtimeMs}}function iw(t,e){try{return new rw("utf-8",{fatal:!0}).decode(t.bytes)}catch(n){throw new Error(`${e} is not valid UTF-8`,{cause:n})}}async function ts(t,e,n,r,i={}){try{let o=await D(t,e,n,{label:r,hooks:i.hooks});return{result:o,text:iw(o,r)}}catch(o){let s=o.code;if(s==="ENOENT"||s==="ENOTDIR")return null;throw o}}async function ou(t,e,n,r,i={}){return(await ts(t,e,n,r,i))?.text??null}async function su(t,e,n,r,i,o={}){if(Buffer.byteLength(n,"utf8")>r)throw new Error(`${i} exceeds ${r} bytes`);let s=await ts(t,e,r,i),a=await q(t,e,{label:i,expected:"file"});await oe(a.target,n,{containedRoot:a.projectRoot,beforeCommit:async()=>{await o.beforeCommit?.();let c=await ts(t,e,r,i);if(!(!s&&!c)){if(!s||!c)throw new Error(`${i} changed before commit`);if(s.result.realPath!==c.result.realPath||!Ne(iu(s.result.stat),iu(c.result.stat))||s.text!==c.text)throw new Error(`${i} changed before commit`)}}})}async function au(t,e,n,r={}){let i=await q(t,e,{label:n,expected:"file"});return i.exists?Zt(i.target,{containedRoot:i.projectRoot,beforeRemove:r.beforeRemove}):!1}var cu=O(()=>{"use strict";ru();wr()});var du={};Xu(du,{RUN_STATE_FILE:()=>ft,applyRunStateToDocument:()=>uu,readRunState:()=>Nr,removeRunState:()=>ns,runStateFromDocument:()=>ut,writeRunState:()=>Or});import ow from"path";function sn(t,e){let n=t[e];if(typeof n!="string"||n.length===0)throw new Error(`Invalid Run state: ${e} must be a non-empty string`);return n}function on(t,e){let n=sn(t,e);if(ow.isAbsolute(n)||/^(?:[A-Za-z]:|[\\/]|~)/u.test(n)||n.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Run state: ${e} must stay inside the change directory`);return n}function sw(t){let e=t.run_retries??"{}",n;try{n=typeof e=="string"?JSON.parse(e):e}catch(r){throw new Error("Invalid Run state: run_retries must be a JSON object",{cause:r})}if(!n||typeof n!="object"||Array.isArray(n))throw new Error("Invalid Run state: run_retries must be a JSON object");for(let r of Object.values(n))if(!Number.isInteger(r)||Number(r)<0)throw new Error("Invalid Run state: retry counts must be non-negative integers");return n}function ut(t){if(!t.run_id)return null;let e=sn(t,"run_id"),n=sn(t,"skill"),r=sn(t,"skill_version"),i=sn(t,"skill_hash"),o=on(t,"pending_ref"),s=on(t,"trajectory_ref"),a=on(t,"context_ref"),c=on(t,"artifacts_ref"),l=on(t,"checkpoint_ref"),u=Number(t.iteration);if(!Number.isInteger(u)||u<0)throw new Error("Invalid Run state: iteration must be a non-negative integer");if(t.orchestration!=="deterministic"&&t.orchestration!=="adaptive")throw new Error("Invalid Run state: orchestration must be deterministic or adaptive");if(t.run_status!=="running"&&t.run_status!=="waiting"&&t.run_status!=="completed"&&t.run_status!=="failed")throw new Error("Invalid Run state: run_status is invalid");return{runId:e,skill:n,skillVersion:r,skillHash:i,orchestration:t.orchestration,currentStep:lu(t,"current_step"),iteration:u,pending:lu(t,"pending"),pendingRef:o,trajectoryRef:s,contextRef:a,artifactsRef:c,checkpointRef:l,status:t.run_status,retries:sw(t)}}function uu(t,e){e?t.run_id=e.runId:delete t.run_id}function aw(t){return{runId:t.runId,skill:t.skill,skillVersion:t.skillVersion,skillHash:t.skillHash,orchestration:t.orchestration,currentStep:t.currentStep,iteration:t.iteration,pending:t.pending,pendingRef:t.pendingRef,trajectoryRef:t.trajectoryRef,contextRef:t.contextRef,artifactsRef:t.artifactsRef,checkpointRef:t.checkpointRef,status:t.status,retries:t.retries}}function cw(t){let e={run_id:t.runId,skill:t.skill,skill_version:t.skillVersion,skill_hash:t.skillHash,orchestration:t.orchestration,current_step:t.currentStep,iteration:t.iteration,pending:t.pending,pending_ref:t.pendingRef,trajectory_ref:t.trajectoryRef,context_ref:t.contextRef,artifacts_ref:t.artifactsRef,checkpoint_ref:t.checkpointRef,run_status:t.status,run_retries:JSON.stringify(t.retries)};return ut(e)}async function Nr(t,e={}){let n=await ou(t,ft,fu,"Run state",e);if(n===null)return null;let r=JSON.parse(n);return cw(r)}async function Or(t,e,n={}){await su(t,ft,JSON.stringify(aw(e),null,2),fu,"Run state",n)}async function ns(t,e={}){await au(t,ft,"Run state",e)}var lu,ft,fu,Ar=O(()=>{"use strict";cu();lu=(t,e)=>{let n=t[e];return n==null?null:String(n)};ft=".comet/run-state.json",fu=Number.MAX_SAFE_INTEGER});function gs(t){return t.charCodeAt(0)===65279?t.slice(1):t}import{AsyncLocalStorage as Zu}from"node:async_hooks";import{performance as gn}from"node:perf_hooks";var ef=0,tf=0,nf=new Zu;function ws(t=0){ef+=1,tf+=t;let e=nf.getStore();e&&(e.gitCommands+=1,e.gitDurationMs+=t)}function ys(t){let e=gn.now();try{return t()}finally{ws(gn.now()-e)}}async function wn(t){let e=gn.now();try{return await t()}finally{ws(gn.now()-e)}}import oy from"node:path";import{promises as Rl}from"fs";import I from"path";import{promises as vs}from"fs";async function zr(t){try{return await vs.access(t),!0}catch(e){if(rf(e))return!1;throw e}}async function Jr(t){try{return await vs.readdir(t)}catch(e){let n=e?.code;if(n==="ENOENT"||n==="ENOTDIR")return[];throw e}}function rf(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}Pe();ct();Jo();X();var en=class extends Error{code="classic-layout-unavailable";constructor(e="Classic artifact layout is unavailable from .comet/config.yaml"){super(e),this.name="ClassicLayoutUnavailableError"}},Pl=".comet/config.yaml";function Nl(t){let e=t?.code;return e==="ENOENT"||e==="ENOTDIR"}async function Ol(t){await q(t,Pl,{label:Pl,expected:"file"})}function Al(t,e){let n=I.resolve(t),r=e==="docs"?I.join(n,"docs"):n,i=I.join(r,"openspec"),o=I.join(n,"docs","superpowers");return{projectRoot:n,artifactLayout:e,openSpecBase:r,openSpecRoot:i,changesDir:I.join(i,"changes"),archiveDir:I.join(i,"changes","archive"),specsDir:I.join(i,"specs"),superpowersRoot:o,superpowersSpecsDir:I.join(o,"specs"),superpowersPlansDir:I.join(o,"plans"),superpowersReportsDir:I.join(o,"reports")}}async function wg(t){await Ol(t);let e=await Qt(t,{allowPartialProject:!0,allowMissingNativeFields:!0});if(!e?.config)throw new en;if(!(e.config.workflows??[e.config.default_workflow]).includes("classic"))throw new en("Classic artifact layout is unavailable because Classic is not enabled");return e.classic?.artifact_layout??"legacy"}async function yg(t,e){return Al(t,e??await wg(t))}async function vg(t){try{return await Rl.lstat(t),!0}catch(e){if(Nl(e))return!1;throw e}}async function bg(t,e){let n=await yg(t,e),r=n.artifactLayout==="legacy"?"docs":"legacy",i=Al(t,r).openSpecRoot,[o,s]=await Promise.all([q(n.projectRoot,lt(n.projectRoot,n.openSpecRoot),{label:"Configured Classic OpenSpec root",expected:"directory"}),vg(i)]),a=o.exists;return{paths:n,configuredRootExists:a,alternateRoot:i,alternateRootExists:s,dualRoots:a&&s}}async function kg(t){let e=[t.openSpecRoot,t.changesDir,t.archiveDir,t.specsDir,t.superpowersRoot,t.superpowersSpecsDir,t.superpowersPlansDir,t.superpowersReportsDir];for(let n of e){let r=lt(t.projectRoot,n);await q(t.projectRoot,r,{label:`Classic managed physical path ${r}`,expected:"directory"})}}async function tn(t,e){let n=await bg(t,e);if(await kg(n.paths),!n.configuredRootExists){let r=lt(n.paths.projectRoot,n.paths.openSpecRoot),i=lt(n.paths.projectRoot,n.alternateRoot);throw new en(`Configured Classic OpenSpec root is missing: ${r} (alternate ${i} is ${n.alternateRootExists?"present":"missing"})`)}return n.paths}async function Il(t){let e=I.resolve(t),n=null;try{(await Rl.lstat(e)).isDirectory()||(e=I.dirname(e))}catch(r){if(!Nl(r))throw r}for(;;){I.basename(e)==="openspec"&&(n=I.dirname(e));let r=I.join(e,".comet","config.yaml"),i=!1;if(await zr(r))try{await Ol(e);let s=(await Qt(e))?.value;i=!!s&&typeof s=="object"&&!Array.isArray(s)&&(s.schema==="comet.project.v1"||s.default_workflow!==void 0||s.native!==void 0)}catch{}if(i||await zr(I.join(e,".git")))return e;let o=I.dirname(e);if(o===e)return n??I.resolve(t);e=o}}function lt(t,e){return I.relative(I.resolve(t),e).replaceAll("\\","/")}import{execFile as sy}from"child_process";import qe from"path";import{promises as Pw}from"node:fs";import{AsyncLocalStorage as Rw}from"node:async_hooks";Bo();import{randomUUID as $g}from"node:crypto";import{promises as ze}from"node:fs";import Jl from"node:os";import zl from"node:path";import{promises as Bl}from"node:fs";import{execFile as xg,execFileSync as Pg}from"node:child_process";import rn from"node:path";import{existsSync as Cg}from"node:fs";import nn from"node:path";var Sg=/[&|<>()^%"!\r\n]/u,Gb=["$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("; ");function Tl(t,e){let n=e.toLowerCase();return Object.entries(t).find(([r,i])=>r.toLowerCase()===n&&i!==void 0)?.[1]}function Eg(t){let e=(Tl(t,"PATHEXT")??".COM;.EXE;.BAT;.CMD").split(";").map(n=>n.trim().toLowerCase()).filter(Boolean);return[...new Set([...e,".ps1"])]}function _g(t,e,n){let i=nn.win32.isAbsolute(t)||/[\\/]/u.test(t)?[""]:(Tl(e,"PATH")??"").split(nn.delimiter).map(a=>a.trim().replace(/^"(.*)"$/u,"$1")).filter(Boolean),s=nn.win32.extname(t)?[t]:Eg(e).map(a=>`${t}${a}`);return i.flatMap(a=>s.map(c=>a?nn.join(a,c):nn.resolve(n,c)))}function Yo(t,e,n){return _g(t,e,n).find(r=>Cg(r))??t}function Ho(t){if(t.some(e=>Sg.test(e)))throw new Error("Windows batch check arguments must not contain shell syntax")}var jl=6e4,Ll=8*1024*1024;async function Ke(t,e,n={}){let r=n.timeoutMs??jl,i=n.maxBufferBytes??Ll;if(!Number.isSafeInteger(r)||r<1||!Number.isSafeInteger(i)||i<1)throw new Error("External command limits must be positive integers");let o=rn.resolve(n.cwd??process.cwd()),s=n.env??process.env,a=process.platform==="win32"?Yo(t,s,o):t,c=process.platform==="win32"&&/\.(?:bat|cmd)$/iu.test(a);c&&Ho(e);let l=()=>new Promise((u,f)=>{let d=!1,p=xg(a,[...e],{cwd:o,env:s,encoding:"utf8",maxBuffer:i,windowsHide:!0,shell:c},(y,b,k)=>{d||(d=!0,clearTimeout(h),n.signal?.removeEventListener("abort",m),y?f(new Le(t,e,k.trim(),{cause:y,timedOut:ql(y)})):u(b))}),g=y=>{d||(d=!0,clearTimeout(h),n.signal?.removeEventListener("abort",m),p.kill("SIGKILL"),p.stdin?.destroy(),p.stdout?.destroy(),p.stderr?.destroy(),p.unref(),f(new Le(t,e,"",{timedOut:y})))},m=()=>g(!1),h=setTimeout(()=>g(!0),r);n.signal?.addEventListener("abort",m,{once:!0}),n.signal?.aborted&&m(),p.stdin?.end(n.input)});return/^(?:git|git\.exe)$/iu.test(rn.win32.basename(t))?wn(l):l()}var Le=class extends Error{constructor(n,r,i,o){super(`${n} ${r.join(" ")} failed${i?`: ${i}`:""}`,o);this.command=n;this.args=r;this.stderr=i;this.name="ExternalCommandError",this.timedOut=o?.timedOut===!0}command;args;stderr;timedOut};function ql(t){return t instanceof Error&&(t.code==="ETIMEDOUT"||t.killed===!0&&t.signal==="SIGTERM")}function $l(t,e,n={}){let r=n.timeoutMs??jl,i=n.maxBufferBytes??Ll;if(!Number.isSafeInteger(r)||r<1)throw new Error("External command timeout must be a positive integer");if(!Number.isSafeInteger(i)||i<1)throw new Error("External command max buffer must be a positive integer");let o=rn.resolve(n.cwd??process.cwd()),s=n.env??process.env,a=process.platform==="win32"?Yo(t,s,o):t,c=rn.win32.extname(a).toLowerCase(),l=c===".bat"||c===".cmd";process.platform==="win32"&&l&&Ho(e);try{let u=()=>Pg(a,[...e],{cwd:o,env:s,...n.input!==void 0?{input:n.input}:{},encoding:"utf8",stdio:[n.input===void 0?"ignore":"pipe","pipe","pipe"],timeout:r,maxBuffer:i,windowsHide:!0,shell:process.platform==="win32"&&l});return/^(?:git|git\.exe)$/iu.test(rn.win32.basename(t))?ys(u):u()}catch(u){let f=typeof u.stderr=="string"?u.stderr.trim():Buffer.isBuffer(u.stderr)?u.stderr.toString("utf8").trim():"";throw new Le(t,e,f,{cause:u,timedOut:ql(u)})}}import{createHash as Vo,randomUUID as Rg}from"node:crypto";import{promises as H}from"node:fs";import Ng from"node:os";import J from"node:path";var Dl=`using System;
143
+ using System.Runtime.InteropServices;
144
+ class CometProcessIdentity {
145
+ [DllImport("kernel32.dll")] static extern IntPtr OpenProcess(uint access, bool inherit, int pid);
146
+ [DllImport("kernel32.dll")] static extern bool GetProcessTimes(IntPtr process, out long creation, out long exit, out long kernel, out long user);
147
+ [DllImport("kernel32.dll")] static extern bool CloseHandle(IntPtr handle);
148
+ static int Main(string[] args) {
149
+ int pid; if(args.Length != 1 || !int.TryParse(args[0], out pid) || pid <= 0) return 1;
150
+ IntPtr handle=OpenProcess(0x1000, false, pid); if(handle == IntPtr.Zero) return 1;
151
+ try { long creation, exit, kernel, user; if(!GetProcessTimes(handle,out creation,out exit,out kernel,out user)) return 1;
152
+ Console.WriteLine(DateTime.FromFileTimeUtc(creation).Ticks.ToString(System.Globalization.CultureInfo.InvariantCulture)); return 0;
153
+ } finally { CloseHandle(handle); }
154
+ }
155
+ }`,Og=Vo("sha256").update(Dl).digest("hex"),Ag=1e4,_r=new Map;async function Go(t,e){let n=await H.lstat(t,{bigint:!0});if(!n.isFile()||n.isSymbolicLink()||n.size>BigInt(e))throw new Error("Invalid process probe cache");let r=await H.readFile(t),i=await H.lstat(t,{bigint:!0});if(n.ino!==i.ino||n.ctimeNs!==i.ctimeNs||n.size!==i.size)throw new Error("Process probe cache changed");return r}async function Wl(t){try{let e=JSON.parse((await Go(J.join(t,"probe.json"),4096)).toString("utf8"));if(!/^probe-[a-f0-9-]+\.exe$/u.test(e.file??""))return null;let n=J.join(t,e.file),r=await Go(n,65536);return Vo("sha256").update(r).digest("hex")===e.hash?n:null}catch{return null}}async function Ig(t,e){let n,r=Rg(),i=J.join(t,`probe-${r}.cs`),o=J.join(t,`probe-${r}.exe`),s=J.join(t,`probe-${r}.json`);try{if(await H.mkdir(t,{recursive:!0,mode:448}),(await H.lstat(t)).isSymbolicLink())return null;n=await H.open(J.join(t,"prepare.lock"),"wx",384);let a=await Wl(t);if(a)return a;await H.writeFile(i,Dl,{flag:"wx",mode:384});let c;for(let u of["Framework64","Framework"]){let f=J.join(e,"Microsoft.NET",u,"v4.0.30319","csc.exe");try{await H.access(f),c=f;break}catch{}}if(!c)return null;await Ke(c,["/nologo","/target:exe","/platform:anycpu",`/out:${o}`,i],{timeoutMs:1500,maxBufferBytes:4096});let l=Vo("sha256").update(await Go(o,65536)).digest("hex");return await H.writeFile(s,JSON.stringify({file:J.basename(o),hash:l}),{flag:"wx",mode:384}),await H.rename(s,J.join(t,"probe.json")),o}catch{return null}finally{await H.unlink(i).catch(()=>{}),await H.unlink(s).catch(()=>{}),n&&(await n.close().catch(()=>{}),await H.unlink(J.join(t,"prepare.lock")).catch(()=>{}))}}async function Ml(t,e,n){try{let r=await Ke(J.join(e,"System32","wbem","WMIC.exe"),["process","where",`processid=${t}`,"get","creationdate","/value"],{timeoutMs:300,maxBufferBytes:4096,signal:n}),i=/^CreationDate=(\S+)/mu.exec(r);if(i)return`win32-wmic:${i[1]}`}catch{}if(n.aborted)return null;try{let i=(await Ke(J.join(e,"System32","WindowsPowerShell","v1.0","powershell.exe"),["-NoLogo","-NoProfile","-NonInteractive","-Command",`(Get-Process -Id ${t} -ErrorAction Stop).StartTime.ToUniversalTime().Ticks.ToString()`],{timeoutMs:1e3,maxBufferBytes:4096,signal:n})).trim();return/^\d+$/u.test(i)?`win32-ps:${i}`:null}catch{return null}}function Tg(t,e){let n=_r.get(t);if(n&&performance.now()<n.retryAfter)return n.promise;let r={promise:Ig(t,e),retryAfter:1/0};return _r.set(t,r),r.promise.then(i=>{_r.get(t)===r&&(i?_r.delete(t):r.retryAfter=performance.now()+Ag)}),r.promise}async function Fl(t,e={}){if(!Number.isSafeInteger(t)||t<=0)return null;let n=e.systemRoot??process.env.SystemRoot??"C:\\Windows",r=J.join(e.cacheRoot??J.join(Ng.tmpdir(),"comet-process-identity"),Og),i=async l=>{if(!l)return null;try{let f=(await Ke(l,[String(t)],{timeoutMs:1e3,maxBufferBytes:4096})).trim();return/^\d+$/u.test(f)?`win32-ps:${f}`:null}catch{return null}},o=await Wl(r);if(o){let l=await i(o);return l||Ml(t,n,new AbortController().signal)}let s=Tg(r,n),a=new AbortController,c=l=>{if(!l)throw new Error("Probe unavailable");return l};try{return await Promise.any([s.then(i).then(c),Ml(t,n,a.signal).then(c)])}catch{return null}finally{a.abort()}}var Xo=null,jg=1e4,Qo=new Map,xr=new Map;function Lg(t){let e=Qo.get(t);if(e){if(Date.now()-e.at>jg){Qo.delete(t);return}return e.value}}async function Zo(t){if(t===process.pid&&Xo!==null)return Xo;let e=Lg(t);if(e!==void 0)return e;let n=xr.get(t);n||(n=qg(t),xr.set(t,n));let r=await n;return xr.get(t)===n&&xr.delete(t),t===process.pid&&r!==null&&(Xo=r),r===null&&Qo.set(t,{value:null,at:Date.now()}),r}async function qg(t){if(!Number.isSafeInteger(t)||t<=0)return null;try{if(process.platform==="linux"){let[e,n]=await Promise.all([Bl.readFile(`/proc/${t}/stat`,"utf8"),Bl.readFile("/proc/sys/kernel/random/boot_id","utf8")]),r=e.slice(e.lastIndexOf(")")+2).trim().split(/\s+/u)[19];return/^\d+$/u.test(r??"")?`linux:${n.trim()}:${r}`:null}if(process.platform==="win32")return await Fl(t);if(process.platform==="darwin"){let e=(await Ke("/bin/ps",["-p",String(t),"-o","lstart="],{timeoutMs:5e3,maxBufferBytes:4096,env:{...process.env,LC_ALL:"C",TZ:"UTC0"}})).trim();return e?`darwin:${e}`:null}}catch{}return null}var Ul=new Set(["win32-wmic","win32-ps"]);function Pr(t){let e=t.indexOf(":");return e===-1?"":t.slice(0,e)}async function Kl(t,e){if(!Number.isSafeInteger(t)||t<=0)return"alive";try{process.kill(t,0)}catch(r){if(r.code==="ESRCH")return"dead"}if(!e)return"unknown";let n=await Zo(t);return n===e?"alive":n===null||Pr(n)!==Pr(e)&&Ul.has(Pr(n))&&Ul.has(Pr(e))?"unknown":"dead"}var Mg=3e4,Dg=20,Wg=5*6e4,Fg=1e4;async function Yl(t,e,n={}){let r=zl.resolve(t);await ze.mkdir(zl.dirname(r),{recursive:!0});let i=Date.now(),o=n.timeoutMs??Mg,s=n.retryMs??Dg,a=n.malformedLockStaleMs??Wg,c=await Zo(process.pid),l={pid:process.pid,nonce:$g(),createdAt:Date.now(),hostname:Jl.hostname(),...c===null?{}:{processIdentity:c}},u=!1;for(;!u;){let f;try{f=await ze.open(r,"wx"),await f.writeFile(JSON.stringify(l),"utf8"),u=!0}catch(d){if(d.code!=="EEXIST")throw d;if(await Bg(r,a))continue;if(Date.now()-i>=o)throw new Error(`Timed out waiting for file lock: ${r}`,{cause:d});await new Promise(p=>setTimeout(p,s))}finally{await f?.close()}}try{return await e()}finally{await Ug(r,l.nonce)}}async function Bg(t,e){let n,r;try{[n,r]=await Promise.all([ze.readFile(t,"utf8"),ze.stat(t)])}catch(o){return o.code==="ENOENT"}let i=Hl(n);if(i!==null&&(i.hostname!==void 0&&i.hostname!==Jl.hostname()||await Kl(i.pid,i.processIdentity)!=="dead"))return!1;if(i===null){let o=n.trim().length===0?Fg:e;if(Date.now()-Number(r.mtimeMs)<o)return!1}try{return await ze.readFile(t,"utf8")!==n?!1:(await ze.rm(t),!0)}catch(o){return o.code==="ENOENT"}}async function Ug(t,e){try{if(Hl(await ze.readFile(t,"utf8"))?.nonce!==e)return;await kr(t)}catch(n){let r=n.code;if(r==="ENOENT")return;process.stderr.write(`[comet] warning: could not remove lock file ${t} (${r??n}); it will be recovered automatically
156
+ `)}}function Hl(t){try{let e=JSON.parse(t);return Number.isSafeInteger(e.pid)&&Number(e.pid)>0&&typeof e.nonce=="string"&&e.nonce.length>0&&typeof e.createdAt=="number"&&Number.isFinite(e.createdAt)&&(e.hostname===void 0||typeof e.hostname=="string"&&e.hostname.length>0)&&(e.processIdentity===void 0||typeof e.processIdentity=="string"&&e.processIdentity.length>0)?{pid:Number(e.pid),nonce:e.nonce,createdAt:e.createdAt,...e.hostname===void 0?{}:{hostname:e.hostname},...e.processIdentity===void 0?{}:{processIdentity:e.processIdentity}}:null}catch{return null}}X();var jr=hn(Ht(),1);je();X();Ar();var mu=["full","hotfix","tweak"],pu=1,lw=["open","design","build","verify","archive"],uw=["en","zh-CN"],fw=["off","beta"],dw=["subagent-driven-development","executing-plans","direct","autonomous"],mw=["plan-ready"],pw=["confirmed"],hw=["tdd","direct"],gw=["off","standard","thorough"],ww=["current","branch","worktree"],yw=["light","full"],vw=["pending","pass","fail"],bw=["pending","handled"],kw=["pending","confirmed"],Je=["workflow","language","phase","context_compression","build_mode","build_pause","subagent_dispatch","tdd_mode","review_mode","isolation","bound_branch","verify_mode","auto_transition","base_ref","design_doc","plan","verify_result","verify_failures","check_epoch","verification_report","branch_status","created_at","verified_at","archive_confirmation","archived","direct_override","handoff_context","handoff_hash","classic_profile","classic_migration"],an=["run_id"],Cw=new Set([...Je,...an]),Sw=["workflow","phase","design_doc","plan","build_mode","isolation","verify_mode","verify_result","verified_at","archived"];function rs(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function dt(t,e){let n=t[e];if(n==null||n==="")return null;if(typeof n!="string")throw new Error(`Invalid Classic state: ${e} must be a string or null`);return n}function W(t,e,n,r=!0){let i=t[e];if(i==null||i===""){if(r)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof i!="string"||!n.includes(i))throw new Error(`Invalid Classic state: ${e} must be one of ${n.join(", ")}${r?" or null":""}`);return i}function is(t,e,n=!0){let r=t[e];if(r==null||r===""){if(n)return null;throw new Error(`Invalid Classic state: ${e} is required`)}if(typeof r!="boolean")throw new Error(`Invalid Classic state: ${e} must be true or false`);return r}function hu(t,e,n=0){let r=t[e];if(r==null||r==="")return n;if(typeof r!="number"||!Number.isSafeInteger(r)||r<0)throw new Error(`Invalid Classic state: ${e} must be a non-negative integer`);return r}function Ir(t,e){let n=dt(t,e);if(n===null)return null;if(/^(?:[A-Za-z]:|[\\/]|~)/u.test(n)||n.split(/[\\/]/u).includes(".."))throw new Error(`Invalid Classic state: ${e} must be a relative repository path`);return n}function Ew(t,e){let n=dt(t,e);if(n!==null&&!/^[a-f0-9]{64}$/u.test(n))throw new Error(`Invalid Classic state: ${e} must be a sha256 hex digest`);return n}function _w(t){let e=t.classic_migration;if(e==null||e==="")return null;if(e!==pu)throw new Error(`Invalid Classic state: classic_migration must be ${pu}`);return e}function xw(t){if(!Je.some(n=>rs(t,n)))return null;for(let n of Sw)if(!rs(t,n))return null;return{workflow:W(t,"workflow",mu,!1),language:W(t,"language",uw),phase:W(t,"phase",lw,!1),contextCompression:W(t,"context_compression",fw),buildMode:W(t,"build_mode",dw),buildPause:W(t,"build_pause",mw),subagentDispatch:W(t,"subagent_dispatch",pw),tddMode:W(t,"tdd_mode",hw),reviewMode:W(t,"review_mode",gw),isolation:W(t,"isolation",ww),boundBranch:dt(t,"bound_branch"),verifyMode:W(t,"verify_mode",yw),autoTransition:is(t,"auto_transition"),baseRef:dt(t,"base_ref"),designDoc:Ir(t,"design_doc"),plan:Ir(t,"plan"),verifyResult:W(t,"verify_result",vw,!1),verifyFailures:hu(t,"verify_failures"),...rs(t,"check_epoch")?{checkEpoch:hu(t,"check_epoch")}:{},verificationReport:Ir(t,"verification_report"),branchStatus:W(t,"branch_status",bw),createdAt:dt(t,"created_at"),verifiedAt:dt(t,"verified_at"),archiveConfirmation:W(t,"archive_confirmation",kw),archived:is(t,"archived",!1),directOverride:is(t,"direct_override"),handoffContext:Ir(t,"handoff_context"),handoffHash:Ew(t,"handoff_hash"),classicProfile:W(t,"classic_profile",mu),classicMigration:_w(t)}}function os(t,e){let n=e??null;if(n===null&&e===void 0&&t.run_id&&t.skill)try{n=ut(t)}catch(r){let i=r instanceof Error?r.message:String(r);throw new Error(i.replace(/^Invalid Run state:/u,"Invalid Classic state:"),{cause:r})}return{classic:xw(t),run:n,unknownKeys:Object.keys(t).filter(r=>!Cw.has(r))}}Ar();var ss=new Rw,Tr=".comet-state-transaction.json";async function Nw(t,e){let n=qe.resolve(t);return ss.getStore()===n?e():(await q(n,".comet-state.lock",{label:"Classic state lock",expected:"file"}),Yl(qe.join(n,".comet-state.lock"),()=>ss.run(n,async()=>(await Aw(n),e()))))}async function gu(t,e){try{return(await D(t,e,Number.MAX_SAFE_INTEGER,{label:"Classic state transaction"})).bytes.toString("utf8")}catch(n){if(n.code==="ENOENT")return null;throw n}}function Ow(t){if(t===null)return null;if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Invalid Classic transaction Run");let e=t,n=ut({run_id:e.runId,skill:e.skill,skill_version:e.skillVersion,skill_hash:e.skillHash,orchestration:e.orchestration,current_step:e.currentStep,iteration:e.iteration,pending:e.pending,pending_ref:e.pendingRef,trajectory_ref:e.trajectoryRef,context_ref:e.contextRef,artifacts_ref:e.artifactsRef,checkpoint_ref:e.checkpointRef,run_status:e.status,run_retries:e.retries});if(!n)throw new Error("Invalid Classic transaction Run identity");return n}async function Aw(t){let e=await gu(t,Tr);if(e===null)return;let n=JSON.parse(e);if(!n||n.schema!=="comet.classic.state-transaction.v1"||n.beforeYaml!==null&&typeof n.beforeYaml!="string"||typeof n.afterYaml!="string")throw new Error("Invalid Classic state transaction");let r=await gu(t,".comet.yaml");if(r!==n.beforeYaml&&r!==n.afterYaml)throw new Error("Classic state transaction conflicts with current YAML; preserve files for recovery");let i=Ow(r===n.afterYaml?n.afterRun:n.beforeRun);i?await Or(t,i):await ns(t),await Zt(qe.join(t,Tr),{containedRoot:t})}function cn(t){let e=t.toJS();if(e===null)return{};if(typeof e!="object"||Array.isArray(e))throw new Error("Invalid Classic state document: root must be a mapping");return e}function Iw(t){let e=["skill","skill_version","skill_hash","orchestration","current_step","iteration","pending","pending_ref","trajectory_ref","context_ref","artifacts_ref","checkpoint_ref","run_status","run_retries"];for(let n of e)t.delete(n)}function Tw(t){let e=!1;for(let n of["build_command","verify_command"])t.has(n)&&(t.delete(n),e=!0);return e}async function yu(t){let e;try{e=(await D(qe.dirname(t),qe.basename(t),Number.MAX_SAFE_INTEGER,{label:"Classic state document"})).bytes.toString("utf8")}catch(r){if(r.code!=="ENOENT")throw r;return new jr.Document({})}let n=(0,jr.parseDocument)(e);if(n.errors.length>0)throw new Error(`Invalid Classic state document: ${n.errors[0].message}`);return cn(n),n}async function as(t,e={}){if(ss.getStore()!==qe.resolve(t)){let n=await jw(t);if(n!==null)return n}return Nw(t,()=>Lw(t,e))}async function mt(t,e){let n=await q(t,e,{label:"Classic state snapshot",expected:"file"});if(!n.exists)return{stamp:"missing",comparable:!0};let r=await Pw.lstat(n.target,{bigint:!0});if(!r.isFile()||r.isSymbolicLink())throw new Error("Classic state file changed");return{stamp:[r.dev,r.ino,r.birthtimeNs,r.ctimeNs,r.mtimeNs,r.size].join(":"),comparable:r.dev!==0n&&r.ino!==0n&&r.ctimeNs>0n}}async function wu(t){if((await mt(t,".comet-state.lock")).stamp!=="missing"||(await mt(t,Tr)).stamp!=="missing")return null;let r=await mt(t,".comet.yaml"),i=await mt(t,ft);return!r.comparable||!i.comparable?null:{yaml:r.stamp,run:i.stamp}}async function jw(t){try{let e=await wu(t);if(e===null)return null;let n=await yu(qe.join(t,".comet.yaml")),r=cn(n);if(n.has("build_command")||n.has("verify_command"))return null;let i=await Nr(t);if(!i&&r.run_id&&r.skill)return null;let o=os(r,i),s=await wu(t);return s===null||e.yaml!==s.yaml||e.run!==s.run||(await mt(t,Tr)).stamp!=="missing"||(await mt(t,".comet-state.lock")).stamp!=="missing"?null:o}catch{return null}}async function Lw(t,e){let n=e.migrate!==!1,r=qe.join(t,".comet.yaml"),i=await yu(r),o=cn(i),s=Tw(i);s&&(o=cn(i));let a=await Nr(t);if(!a&&o.run_id&&o.skill){let{runStateFromDocument:c}=await Promise.resolve().then(()=>(Ar(),du));a=c(o),a&&n&&(await Or(t,a),Iw(i),s=!0)}return s&&n&&await oe(r,i.toString(),{containedRoot:t}),os(cn(i),a)}var Eu=hn(Ht(),1);X();import F from"node:path";import{createHash as $r,randomUUID as hS}from"node:crypto";import{promises as Fw}from"node:fs";var qw=new Set(["GIT_DIR","GIT_WORK_TREE","GIT_COMMON_DIR","GIT_INDEX_FILE","GIT_OBJECT_DIRECTORY","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_GRAFT_FILE","GIT_SHALLOW_FILE","GIT_PREFIX","GIT_IMPLICIT_WORK_TREE","GIT_NO_REPLACE_OBJECTS","GIT_REPLACE_REF_BASE","GIT_CONFIG","GIT_CONFIG_PARAMETERS","GIT_CONFIG_COUNT"]);function $w(t=process.env){return Object.fromEntries(Object.entries(t).filter(([e])=>{let n=e.toUpperCase();return!qw.has(n)&&!/^GIT_CONFIG_(KEY|VALUE)_\d+$/u.test(n)}))}function vu(t){return{...$w(t.environment),...t.authentication?{}:{GIT_CONFIG_GLOBAL:process.platform==="win32"?"NUL":"/dev/null",GIT_CONFIG_NOSYSTEM:"1"},GIT_TERMINAL_PROMPT:"0",GCM_INTERACTIVE:"never",SSH_ASKPASS_REQUIRE:"never",GIT_NO_REPLACE_OBJECTS:"1",GH_PROMPT_DISABLED:"1"}}je();Pe();X();import ln from"path";var Mw=Number.MAX_SAFE_INTEGER;function bu(t,e,n){let r=ln.resolve(t),i=ln.isAbsolute(e)?ln.resolve(e):ln.resolve(r,e),o=ln.relative(r,i).replaceAll("\\","/");return{root:r,relative:st(o,n),target:i}}async function se(t,e,n){let r=bu(t,e,n.label);return q(r.root,r.relative,n)}async function he(t,e,n){return(await se(t,e,{label:n.label,expected:n.expected??"any"})).exists}async function Ye(t,e,n){return(await Dw(t,e,n)).toString("utf8")}async function Dw(t,e,n){let r=bu(t,e,n.label);return(await D(r.root,r.relative,n.maxBytes??Mw,{label:n.label,hooks:n.hooks})).bytes}function He(t){if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Classic progress requires a JSON object");return t}function ls(t,e){let n=Object.keys(t).filter(r=>!e.includes(r));if(n.length)throw new Error(`Unknown Classic progress field(s): ${n.join(", ")}; allowed fields: ${e.join(", ")}`)}function ae(t,e){if(typeof t!="string"||!t.trim()||t.length>4096||[...t].some(n=>n.charCodeAt(0)<32||n.charCodeAt(0)===127))throw new Error(`Invalid Classic progress ${e}`);return t}async function Bw(t,e,n){let r=F.join(e,".comet",n);if(await he(t,r,{label:"Classic progress",expected:"file"}))return JSON.parse(await Ye(t,r,{label:"Classic progress"}))}function Uw(t,e){let n=$r("sha256").update(e).digest("hex");return F.join(t,".comet","runtime","classic-delivery",`${n}.json`)}async function Kw(t,e){let n=Uw(t,e);if(!await he(t,n,{label:"Classic delivery reauthorization",expected:"file"}))return null;let r=He(JSON.parse(await Ye(t,n,{label:"Classic delivery reauthorization"})));if(ls(r,["schemaVersion","changeIdentity","previousAuthorizationId","authorizationId","action","targetBranch","remote","authorizedRemoteUrl"]),r.schemaVersion!==1||r.changeIdentity!==e)throw new Error("Classic delivery reauthorization identity is invalid");let i=us({action:r.action,targetBranch:r.targetBranch,...r.remote===void 0?{}:{remote:r.remote}},!0);if(i.action==="archive-only")throw new Error("Classic archive-only delivery cannot be reauthorized");if(i.commit!==void 0||i.prUrl!==void 0)throw new Error("Classic delivery reauthorization cannot change sealed commit or PR evidence");return{schemaVersion:1,changeIdentity:e,previousAuthorizationId:ae(r.previousAuthorizationId,"previousAuthorizationId"),authorizationId:ae(r.authorizationId,"authorizationId"),...i,targetBranch:i.targetBranch,...r.authorizedRemoteUrl===void 0?{}:{authorizedRemoteUrl:ae(r.authorizedRemoteUrl,"authorizedRemoteUrl")}}}function us(t,e=!1){let n=He(t);if(ls(n,["action","targetBranch","remote","commit","prUrl",...e?["schemaVersion","changeIdentity","authorizedRemoteUrl","authorizationId"]:[]]),!["local","push","pr","archive-only"].includes(n.action))throw new Error(`Invalid Classic delivery action '${String(n.action)}'; actions: local|push|pr|archive-only`);if(n.action==="archive-only"){if(n.targetBranch!==void 0||n.remote!==void 0||n.commit!==void 0||n.prUrl!==void 0)throw new Error("Classic archive-only delivery cannot claim a Git branch, remote, commit, or PR");return{action:"archive-only"}}let r=ae(n.targetBranch,"targetBranch");if(r.startsWith("-")||/[~^:?*[\\\s]/u.test(r)||r.includes("..")||r.includes("@{"))throw new Error("Invalid Classic delivery targetBranch");let i={action:n.action,targetBranch:r};if(n.remote!==void 0){let o=ae(n.remote,"remote");if(!/^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$/u.test(o))throw new Error("Classic delivery remote must be a name, not a URL");i.remote=o}if(n.commit!==void 0){let o=ae(n.commit,"commit");if(!/^(?:[a-fA-F0-9]{40}|[a-fA-F0-9]{64})$/u.test(o))throw new Error("Classic delivery commit must be a full object ID");i.commit=o.toLowerCase()}if(n.prUrl!==void 0){let o=ae(n.prUrl,"prUrl"),s=new URL(o);if(s.protocol!=="https:"||s.username||s.password)throw new Error("Invalid Classic delivery prUrl");i.prUrl=o}return i}function _u(t){let e=(0,Eu.parseDocument)(t,{uniqueKeys:!0});if(e.errors.length)throw new Error("Invalid Classic delivery change state");return He(e.toJS())}function zw(t,e,n){return typeof t.run_id=="string"&&t.run_id?`run:${t.run_id}`:xu(t,e,n)}function xu(t,e,n){let r=t.archived===!0||F.basename(F.dirname(e))==="archive"?F.basename(e).replace(/^\d{4}-\d{2}-\d{2}-/u,""):F.basename(e);if(typeof t.created_at!="string"||typeof t.base_ref!="string"&&t.base_ref!==null)throw new Error("Classic delivery requires stable change identity");return`legacy:${$r("sha256").update(JSON.stringify([r,t.created_at,t.base_ref??F.resolve(n)])).digest("hex")}`}function Pu(t,e,n,r){let i=zw(e,n,r);if(t===i)return i;if(typeof t=="string"&&t.startsWith("legacy:")&&t===xu(e,n,r))return t;throw new Error("Classic delivery change identity mismatch")}async function Jw(t,e){return _u(await Ye(t,F.join(e,".comet.yaml"),{label:"Classic delivery state"}))}var qr=class extends Error{constructor(e,n){super(`Classic delivery git command timed out: ${[e,...n].join(" ")}`)}};function cs(t,e,n,r){return $l(e,n,{cwd:t,timeoutMs:5e3,env:vu({authentication:r})}).trim()}function dn(t,e,n,r=!1){try{return cs(t,e,n,r)}catch{return null}}function Yw(t,e,n,r=!1){try{return cs(t,e,n,r)}catch(i){if(!(i instanceof Le)||!i.timedOut)return null;try{return cs(t,e,n,r)}catch(o){if(o instanceof Le&&o.timedOut)throw new qr(e,n);return null}}}function un(t,e){return dn(t,"git",["-C",t,...e])}function fn(t,e){return Yw(t,"git",["-C",t,...e])}function ku(t,e,n=!1){return dn(t,"git",["-C",t,"remote","get-url",...n?["--push"]:[],e],!0)}function Hw(t,e){let n=F.relative(t,e).replaceAll("\\","/");return[`:(literal)${n}`,...[".comet-state.lock",".comet-state-transaction.json"].map(r=>`:(exclude,literal)${n}/${r}`)]}function Cu(t,e,n,r){let i=F.relative(t,e).replaceAll("\\","/"),o=Hw(t,e),s=fn(t,["show",`${n}:${i}/.comet.yaml`]);if(!s)return!1;try{let a=_u(s);return a.archived===!0&&Pu(r,a,e,t)===r&&fn(t,["merge-base","--is-ancestor",n,"HEAD"])!==null&&fn(t,["diff","--quiet","--no-ext-diff","--no-textconv",n,"--",...o])!==null&&fn(t,["ls-files","--others","--exclude-standard","--",...o])===""}catch(a){if(a instanceof qr)throw a;return!1}}async function Gw(t,e){let n={},r=async i=>{await se(t,i,{label:"Classic document archive",expected:"directory"});let o=(await Fw.readdir(i,{withFileTypes:!0})).sort((s,a)=>s.name<a.name?-1:s.name>a.name?1:0);for(let s of o){if([".comet-state.lock",".comet-state-transaction.json"].includes(s.name))continue;let a=F.join(i,s.name);if(s.isDirectory())await r(a);else if(s.isFile()){let c=F.relative(t,a).replaceAll("\\","/"),l=await bl(t,c,{label:"Classic document archive file"});n[c]=l.digest}else throw new Error(`Classic document archive contains unsupported entry: ${a}`);if(Object.keys(n).length>1e4)throw new Error("Classic document archive has too many files")}};return await r(e),n}function Vw(t,e){let n=Object.keys(t);return n.length===Object.keys(e).length&&n.every(r=>t[r]===e[r])}function Xw(t,e){let n=`${$r("sha256").update(e).digest("hex")}.json`,r=fn(t,["rev-parse","--path-format=absolute","--git-common-dir"]);return[{root:t,file:F.join(t,".comet","classic-deliveries",n)},...r?[{root:r,file:F.join(r,"comet","classic-deliveries",n)}]:[]]}async function Qw(t,e){let n=null;for(let r of Xw(t,e)){if(!await he(r.root,r.file,{label:"Classic delivery receipt",expected:"file"}))continue;let i=He(JSON.parse(await Ye(r.root,r.file,{label:"Classic delivery receipt"})));if(ls(i,["schemaVersion","changeIdentity","authorizationId","invalidated","commit","prUrl","archiveFiles"]),i.schemaVersion!==1||i.changeIdentity!==e)throw new Error("Invalid Classic delivery receipt schema or identity");if(i.invalidated!==void 0&&typeof i.invalidated!="boolean")throw new Error("Invalid Classic delivery receipt invalidation");let o=us({action:"local",targetBranch:"main",...i.commit!==void 0?{commit:i.commit}:{},...i.prUrl!==void 0?{prUrl:i.prUrl}:{}}),s={schemaVersion:1,changeIdentity:e,authorizationId:ae(i.authorizationId,"authorizationId"),...i.invalidated===!0?{invalidated:!0}:{},...o.commit?{commit:o.commit}:{},...o.prUrl?{prUrl:o.prUrl}:{},...i.archiveFiles===void 0?{}:{archiveFiles:Zw(i.archiveFiles)}};if(n&&JSON.stringify(n)!==JSON.stringify(s))throw new Error("Conflicting Classic delivery receipts");n=s}return n}function Zw(t){if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Invalid Classic document archive receipt");let e=t;if(Object.keys(e).length===0||Object.keys(e).length>1e4||Object.entries(e).some(([n,r])=>n.startsWith("/")||n.includes("\\")||n.split("/").some(i=>!i||i==="."||i==="..")||typeof r!="string"||!/^[a-f0-9]{64}$/u.test(r)))throw new Error("Invalid Classic document archive receipt");return e}function ey(t){return t.authorizationId===void 0?`legacy:${$r("sha256").update(JSON.stringify(t)).digest("hex")}`:ae(t.authorizationId,"authorizationId")}function Su(t,e,n){return e===n||un(t,["merge-base","--is-ancestor",e,n])!==null}function ty(t){let e=/^git@([^:/]+):([^/]+\/[^/]+)$/u.exec(t);try{let n=new URL(e?`ssh://git@${e[1]}/${e[2]}`:t);if(!["https:","ssh:"].includes(n.protocol)||n.password||n.search||n.hash||n.port||n.protocol==="https:"&&n.username)return null;let r=n.pathname.replace(/\.git\/?$/u,"").replace(/\/$/u,"").split("/").filter(Boolean);return r.length!==2||r.some(i=>!/^[a-zA-Z0-9_.-]+$/u.test(i))?null:`${n.hostname}/${r.join("/")}`.toLowerCase()}catch{return null}}function Lr(t,e){try{let n=new URL(t);if(n.protocol!=="https:"||n.username||n.password||n.port||n.search||n.hash)return null;let r=/^\/([^/]+)\/([^/]+)\/pull\/([1-9]\d*)\/?$/u.exec(n.pathname);return r&&`${n.hostname}/${r[1]}/${r[2]}`.toLowerCase()===e?`https://${n.hostname}/${r[1]}/${r[2]}/pull/${r[3]}`:null}catch{return null}}async function Ru(t,e,n={}){let r=await Bw(t,e,"delivery.json");if(r===void 0)return{delivery:null,verification:{status:"needsAuthorization"}};let i=He(r);if(i.schemaVersion!==1)throw new Error("Unsupported Classic delivery schemaVersion");let o=us(i,!0),s=await Jw(t,e),a=Pu(i.changeIdentity,s,e,t),c=ey(i),l=await Kw(t,a);if(l&&l.previousAuthorizationId!==c)throw new Error("Classic delivery reauthorization is stale for the sealed authorization");let u=l?{action:l.action,targetBranch:l.targetBranch,...l.remote===void 0?{}:{remote:l.remote}}:o,f=l?.authorizationId??c,d=await Qw(t,a),p=d?.authorizationId===f?d:null;if(p?.invalidated)return{delivery:null,verification:{status:"needsAuthorization",invalidated:!0}};for(let T of["commit","prUrl"]){if(T==="commit"&&p?.[T]&&u[T]&&p[T]!==u[T])throw new Error("Classic delivery receipt conflicts with authorization evidence");p?.[T]&&(u[T]=p[T])}let g=i.authorizedRemoteUrl===void 0?void 0:ae(i.authorizedRemoteUrl,"authorizedRemoteUrl"),m=l?.authorizedRemoteUrl??g,h={...u,schemaVersion:1,changeIdentity:a,authorizationId:f,...m?{authorizedRemoteUrl:m}:{}};if(u.action==="archive-only"){let T=!1;if(s.archived===!0&&p?.archiveFiles!==void 0){let Z=await Gw(t,e).catch(ht=>{let gt=ht?.code;if(gt==="ENOENT"||gt==="ENOTDIR")return null;throw ht});T=Z!==null&&Vw(p.archiveFiles,Z)}return{delivery:h,verification:{status:T?"complete":"needsVerification",archiveVerified:T}}}let y=un(t,["symbolic-ref","--quiet","--short","HEAD"]),b=F.relative(t,e).replaceAll("\\","/"),k=null;!u.commit&&s.archived===!0&&(k=un(t,["log","-20","--format=%H","HEAD","--",`:(literal)${b}/.comet.yaml`])?.split(/\r?\n/u).find(Z=>/^[a-f0-9]{40,64}$/u.test(Z)&&Cu(t,e,Z,a))??null);let C=u.commit??k,S=!!C&&un(t,["cat-file","-t",C])==="commit",E=s.archived===!0&&S&&Cu(t,e,C,a),P=y===u.targetBranch&&(!s.bound_branch||l!==null||s.bound_branch===y)&&E,v=!1,N=!1,Q=null,ce=n.verifyRemote&&u.action!=="local"?"unavailable":"notChecked",R="notChecked";if(n.verifyRemote&&P&&u.action!=="local"&&u.remote&&m&&ku(t,u.remote)===m&&ku(t,u.remote,!0)===m){let T=`refs/heads/${u.targetBranch}`,Z=dn(t,"git",["-C",t,"-c","protocol.allow=never","-c","protocol.https.allow=always","-c","protocol.ssh.allow=always","-c","protocol.file.allow=always","ls-remote","--refs",u.remote,T],!0),ht=Z?.split(/\r?\n/u)??[],gt=ht.length===1?/^([a-f0-9]{40}|[a-f0-9]{64})\t(.+)$/u.exec(ht[0]):null,wt=gt?.[2]===T?gt[1]:null;v=!!C&&!!wt&&Su(t,C,wt),ce=v?"verified":Z===""?"missing":Z===null||!wt||un(t,["cat-file","-t",wt])!=="commit"?"unavailable":"missing";let le=ty(m),Wr=le&&u.prUrl?Lr(u.prUrl,le):null,Fr=v||Z==="",hs=Y=>Y.headRefName===u.targetBranch&&typeof Y.headRefOid=="string"&&/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u.test(Y.headRefOid)&&(v?Y.headRefOid===wt&&["OPEN","MERGED"].includes(Y.state):Z===""&&Y.state==="MERGED"&&!!C&&Su(t,C,Y.headRefOid));if(Fr&&u.action==="pr"&&(R="unavailable"),Fr&&u.action==="pr"&&Wr&&le){let Y=dn(t,"gh",["pr","view",Wr,"--repo",le,"--json","url,headRefName,headRefOid,state"],!0);try{let ue=Y?He(JSON.parse(Y)):null;N=!!ue&&typeof ue.url=="string"&&Lr(ue.url,le)===Wr&&hs(ue),R=N?"verified":ue?"missing":"unavailable"}catch{N=!1,R="unavailable"}}else if(Fr&&u.action==="pr"&&!u.prUrl&&le){let Y=dn(t,"gh",["pr","list","--repo",le,"--head",u.targetBranch,"--state","all","--json","url,headRefName,headRefOid,state","--limit","100"],!0);try{let ue=Y===null?null:JSON.parse(Y);if(!Array.isArray(ue)||ue.length>=100)throw new Error("Incomplete PR discovery");let Br=ue.map(He).filter(Ur=>typeof Ur.url=="string"&&Lr(Ur.url,le)&&hs(Ur));Br.length===1?(Q=Lr(Br[0].url,le),N=!0,R="verified"):R=Br.length===0?"missing":"unavailable"}catch{R="unavailable"}}}return{delivery:h,verification:{status:P&&(u.action==="local"||(u.action==="push"?v:N))?"complete":"needsVerification",currentBranch:y,commitExists:S,archiveCommitted:E,observedCommit:k,observedPrUrl:Q,remoteVerified:v,prVerified:N,remoteStatus:ce,prStatus:R}}}import Nu from"path";function Mr(t){return t?/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u.test(t)?t.includes("..")?"Change name cannot contain '..' (path traversal not allowed)":null:`Invalid change name: '${t}'
157
+ Valid format: lowercase kebab-case (a-z, 0-9, single hyphens)`:"Change name cannot be empty"}function ny(t){let e=Mr(t);if(e)throw new Error(e)}function ry(t,e){return{label:lt(t,e),directory:e}}async function iy(t,e,n){let r=ry(t,e);if(!(await se(t,e,{label:n,expected:"directory"})).exists)return{change:r,exists:!1,stateExists:!1};let o=await se(t,Nu.join(e,".comet.yaml"),{label:`${n} state`,expected:"file"});return{change:r,exists:!0,stateExists:o.exists}}async function Ou(t,e=process.cwd()){ny(t);let n=await tn(e),r=await iy(n.projectRoot,Nu.join(n.changesDir,t),`Classic active change ${t}`);return{...r.change,exists:r.exists,stateExists:r.stateExists}}var pt="comet.resume_probe.v1";function Au(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function ay(t){if(!Au(t))throw new Error("Invalid CometResumeProbeInput: input must be an object");if(t.schema_version!==pt)throw new Error(`Invalid CometResumeProbeInput: schema_version must be ${pt}`);if(typeof t.utterance!="string")throw new Error("Invalid CometResumeProbeInput: utterance must be a string");let e=Au(t.agent_context)?t.agent_context:{};return{schema_version:pt,utterance:t.utterance,locale:typeof t.locale=="string"?t.locale:"unknown",agent_context:{non_trivial_work:e.non_trivial_work===!0,already_in_comet_flow:e.already_in_comet_flow===!0}}}function B(t,e,n,r,i=[]){return{schema_version:pt,action:t,changeName:e?.name??null,phase:e?.phase??null,nextCommand:t==="auto_resume"||t==="ask_user"?e?.nextCommand??null:null,confidence:n,reason:r,evidence:i}}async function cy(t,e,n){return await he(t,e,{label:n,expected:"file"})?Ye(t,e,{label:n}):""}async function ds(t,e,n){let r=["proposal.md","design.md","tasks.md"],i=[n.name,n.workflow,n.phase];for(let o of r)i.push(await cy(t,`${e}/${o}`,`Classic change ${n.name} ${o}`));return i.join(`
158
+ `).toLowerCase()}function ly(t){switch(t){case"open":return"/comet-open";case"design":return"/comet-design";case"build":return"/comet-build";case"verify":return"/comet-verify";case"archive":return"/comet-archive";default:return null}}function Tu(t,e,n){let r=n.classic,i=n.unknownKeys.filter(o=>o!=="run_id");return r?i.length>0?{name:e,valid:!1,workflow:r.workflow,phase:r.phase,currentStep:null,nextCommand:null,runtimeMode:"invalid",runtimeEval:null,evidence:[],error:`unknown field(s): ${i.join(", ")}`}:{name:e,valid:!0,workflow:r.workflow,phase:r.phase,currentStep:null,nextCommand:ly(r.phase),runtimeMode:"engine-projection",runtimeEval:null,evidence:[]}:{name:e,valid:!1,workflow:"unknown",phase:"invalid",currentStep:null,nextCommand:null,runtimeMode:"invalid",runtimeEval:null,evidence:[],error:`${t} does not contain valid Comet state`}}async function uy(t,e){return await he(t,`${e}/proposal.md`,{label:"Classic proposal",expected:"file"})||await he(t,`${e}/design.md`,{label:"Classic design",expected:"file"})||await he(t,`${e}/tasks.md`,{label:"Classic tasks",expected:"file"})}async function fy(t){let e=(await tn(t)).changesDir;if(!(await se(t,e,{label:"Classic changes directory",expected:"directory"})).exists)return[];let r=await Jr(e),i=[];for(let o of r){if(o==="archive"||Mr(o))continue;let s=await Ou(o,t);if(!s.exists)continue;let a=s.directory;if(!s.stateExists){if(!await uy(t,a))continue;let h={name:o,workflow:"unknown",phase:"invalid",nextCommand:null,diagnostic:{name:o,valid:!1,workflow:"unknown",phase:"invalid",currentStep:null,nextCommand:null,runtimeMode:"invalid",runtimeEval:null,evidence:[],error:"missing Comet state"},buildPause:null,hasClassicProjection:!1,verifyResult:null,archived:!1,text:"",missingCometState:!0};h.text=await ds(t,a,h),i.push(h);continue}let l=await as(a,{migrate:!1}),u=l.classic,f=Tu(a,o,l),d=!!u,p=u?.phase??f.phase,g=u?.workflow??f.workflow;if(p==="archive"||u?.archived)continue;let m={name:o,workflow:g,phase:p,nextCommand:f.nextCommand,diagnostic:f,buildPause:u?.buildPause??null,hasClassicProjection:d,verifyResult:u?.verifyResult??null,archived:u?.archived??!1,text:"",missingCometState:!1};m.text=await ds(t,a,m),i.push(m)}return i}function dy(t){let e=/^\d{4}-\d{2}-\d{2}-(.+)$/u.exec(t)?.[1]??t;return Mr(e)===null?e:null}async function my(t){let e=await tn(t);if(!(await se(t,e.archiveDir,{label:"Classic archive directory",expected:"directory"})).exists)return[];let r=[];for(let i of await Jr(e.archiveDir)){let o=dy(i);if(!o)continue;let s=oy.join(e.archiveDir,i),a=await se(t,s,{label:`Classic archived change ${i}`,expected:"directory"});if(!a.exists)continue;let c=await as(a.target,{migrate:!1}),l=c.classic;if(!l?.archived||l.phase!=="archive")continue;let u=await Ru(t,a.target);if(["complete","local-verified"].includes(u.verification.status))continue;let f=Tu(a.target,o,c),d={name:o,workflow:l.workflow,phase:"archive",nextCommand:"/comet-archive",diagnostic:f,buildPause:null,hasClassicProjection:!0,verifyResult:l.verifyResult,archived:!0,text:"",missingCometState:!1};d.text=await ds(t,a.target,d),r.push(d)}return r}var py=["continue","resume","carry on","finish","run it","commit","verify","archive","继续","接着","恢复","跑完","提交","验证","归档","修刚才"],hy=["what","why","how","explain","summarize","reliable","靠谱吗","是什么","为什么","解释","总结","取名","命名"],gy=new Set(["add","build","cache","change","code","design","docs","file","fix","implement","plan","readme","task","test","update","修改","更新","修复","添加","文档","任务","计划","实现"]),wy=["do not resume","don't resume","without comet","skip comet","不要恢复","不走 comet","不要走 comet","直接解释","只回答"];function fs(t,e){return e.some(n=>t.includes(n))}function Iu(t){return t.missingCometState||!t.hasClassicProjection||!t.diagnostic.valid||t.phase==="archive"||t.verifyResult==="fail"||t.diagnostic.runtimeEval&&!t.diagnostic.runtimeEval.passed?!0:t.phase!=="build"?!1:t.buildPause==="plan-ready"}function yy(t,e){let n=t.toLowerCase(),r=[];n.includes(e.name.toLowerCase())&&r.push({source:"user",quote:e.name});let i=e.text.split(/[^a-zA-Z0-9_\-\u4e00-\u9fff/]+/u).map(s=>s.trim().toLowerCase()).filter(s=>s.length>=4&&!gy.has(s)),o=[...new Set(i.filter(s=>n.includes(s)))].slice(0,3);for(let s of o)r.push({source:"repo",quote:s});return r}async function vy(t){return wn(()=>new Promise(e=>{sy("git",["status","--short","--untracked-files=all"],{cwd:t,timeout:3e3,maxBuffer:2*1024*1024,windowsHide:!0},(n,r)=>{if(n||typeof r!="string"){e([]);return}e(r.split(/\r?\n/u).map(i=>i.trim()).filter(Boolean))})}))}async function ju(t,e){let n=ay(e),r=n.utterance.trim(),i=r.toLowerCase();if(n.agent_context.already_in_comet_flow)return B("out_of_scope",null,"low","already in Comet flow");if(fs(i,wy))return B("out_of_scope",null,"low","user opted out of Comet resume",[{source:"user",quote:r}]);let o=await fy(t),s=new Set(o.map(({name:g})=>g)),a=(await my(t)).filter(({name:g})=>!s.has(g)),c=[...o,...a];if(c.length===0)return B("none",null,"none","no active Comet changes");let l=await vy(t);if(c.length>1){let g=c.find(m=>i.includes(m.name.toLowerCase()));return g?l.length>0?B("ask_user",g,"low","uncommitted worktree changes require attribution",[{source:"repo",quote:`${l.length} dirty file(s)`}]):Iu(g)?B("ask_user",g,"low","active change is at a decision point"):B("auto_resume",g,"high","request names an active change",[{source:"user",quote:g.name}]):B("ask_user",null,"low","multiple active changes require a change name")}let[u]=c;if(l.length>0)return B("ask_user",u,"low","uncommitted worktree changes require attribution",[{source:"repo",quote:`${l.length} dirty file(s)`}]);if(Iu(u))return u.archived?B("ask_user",u,"low","archived change has pending delivery",[{source:"state",quote:"archived: true"},{source:"state",quote:"delivery is not complete"}]):u.missingCometState?B("ask_user",u,"low","active OpenSpec change is missing Comet state"):B("ask_user",u,"low","active change is at a decision point",[{source:"state",quote:`phase: ${u.phase}`}]);let f=fs(i,py);if(!n.agent_context.non_trivial_work&&fs(i,hy)&&!f)return B("out_of_scope",u,"low","user asked a question without workflow work");let p=yy(r,u);return f||p.length>0?B("auto_resume",u,"high","single active change and request is related",[{source:"state",quote:`phase: ${u.phase}`},...p]):n.agent_context.non_trivial_work?B("ask_user",u,"low","single active change exists but request looks unrelated"):B("out_of_scope",u,"low","request is not workflow work")}import{AsyncLocalStorage as by}from"async_hooks";import{promises as Lu}from"fs";import mn from"path";var ms=new by;function ky(t,e){let n=mn.relative(t,e);return n===""||!mn.isAbsolute(n)&&n!==".."&&!n.startsWith(`..${mn.sep}`)}async function Cy(t){let e=mn.resolve(t.invocationCwd??process.cwd()),n=mn.resolve(t.projectRoot??await Il(e)),[r,i]=await Promise.all([Lu.realpath(e),Lu.realpath(n)]);if(!ky(i,r))throw new Error(`Classic command invocation cwd is outside the discovered project: ${e}`);return{invocationCwd:e,projectRoot:n,observations:new Map}}async function Sy(t,e){let n=ms.getStore();if(n)return e(n);let r=await Cy(t);return ms.run(r,()=>e(r))}function qu(){let t=ms.getStore();if(!t)throw new Error("Classic command project context is unavailable");return t.projectRoot}function $u(t){return(e,n)=>Sy(n,()=>t(e,n))}function Dr(t,e,n){return{exitCode:t,...e===void 0?{}:{stdout:e},...n===void 0?{}:{stderr:n}}}function Mu(){return Dr(64,void 0,`Usage: comet-resume-probe.mjs probe <input-json>
159
+ Usage: comet-resume-probe.mjs probe --stdin`)}async function Ey(){let t=[];for await(let e of process.stdin)t.push(Buffer.isBuffer(e)?e:Buffer.from(String(e)));return gs(Buffer.concat(t).toString("utf8"))}function _y(t){return{schema_version:pt,utterance:t,locale:"unknown",agent_context:{non_trivial_work:!0,already_in_comet_flow:!1}}}function xy(t){try{return JSON.parse(t)}catch{return _y(t)}}var Du=$u(async t=>{let[e,n]=t;if(e!=="probe")return Mu();let r=n==="--stdin",i=r?await Ey():n;if(!i)return Mu();try{let o=r?xy(i):JSON.parse(i),s=await ju(qu(),o);return Dr(0,`${JSON.stringify(s,null,2)}
160
+ `)}catch(o){return o instanceof SyntaxError?Dr(1,void 0,`Invalid JSON: ${o.message}`):Dr(1,void 0,o instanceof Error?o.message:String(o))}});var Wu=["open-complete","design-complete","build-complete","verify-pass","verify-fail","archive-confirm","archive-reopen","archived","preset-escalate"];var Py=new Set([...an,"archive_confirmation","verify_failures","check_epoch","classic_profile","classic_migration","bound_branch"]),Fu=new Set(Je.filter(t=>!Py.has(t))),ps={workflow:["full","hotfix","tweak"],phase:["open","design","build","verify","archive"],context_compression:["off","beta"],build_mode:["subagent-driven-development","executing-plans","direct","autonomous"],build_pause:["null","plan-ready"],subagent_dispatch:["null","confirmed"],tdd_mode:["tdd","direct"],review_mode:["off","standard","thorough"],isolation:["current","branch","worktree"],verify_mode:["light","full"],auto_transition:["true","false"],verify_result:["pending","pass","fail"],branch_status:["pending","handled"],archive_confirmation:["pending","confirmed"],archived:["true","false"],direct_override:["true","false"],classic_profile:["full","hotfix","tweak"],classic_migration:["1"]};var Ry=`
148
161
  Options: --json (machine-readable output), --help
149
162
  JSON: one object with command and exitCode; data, stdout, stderr, summary and next are optional.
150
163
  Use exitCode for success; do not parse human-readable stdout. Help text is in stdout in JSON mode.
151
- `;function vu(t,e){let n=e.indexOf("--"),r=n<0?e:e.slice(0,n);if(!r.includes("--help")&&!r.includes("-h"))return;let i={check:["comet check run <change> <build|verify> [--local] [--incremental] [--cwd <path>] [--timeout-ms <ms>] -- <program> [args...]","comet check rerun <change> <build|verify>","--local opts deterministic local checks into same-input reuse; other checks are single-use.","--incremental records phase-local evidence: guard previews accept it, --apply requires a full rerun.","Arguments after -- belong to the child. Windows batch arguments containing shell syntax are rejected.","","Executes a program for an active change and stores its log and input-bound evidence.","--local is not a location switch: all checks execute locally. It asserts deterministic inputs.","Use --local only when no network, external state or untracked ignored inputs affect the result.","Default evidence is single-use; reusable evidence requires matching inputs, environment and log.","--cwd: relative to the project root; default is the invocation directory; must stay inside the project.","Guard reuses evidence only when its cwd matches the guard invocation directory, or the command is declared with that cwd in a v2 check policy.","--timeout-ms: default 300000; integer range 1..3600000.","Place Comet options, including --json, before --. Child --help and --json after -- are forwarded.","","Result: data.scope, data.argv, data.cwd, data.exitCode, data.logRef, data.reusable; data.reused is optional.","Exit: 0 = success with stable inputs; child failures propagate; timeout = 124; invalid invocation/runtime error = 70.","A child exit of 0 with changed inputs returns exitCode 1. Use top-level exitCode, not data.exitCode.","On failure inspect data.logRef or stderr, fix the cause, then rerun. Recovery revalidates local evidence.","rerun repeats the latest Runtime-recorded argv, cwd, timeout and reuse tier without reconstructing shell syntax.","Optional .comet/check-policy.json binds declared deterministic commands by exact argv and cwd.",'A v1 single-command object stays valid; v2 {"commands":[...]} scopes each command separately.',"Editing one v2 command entry invalidates only that command's evidence; unmatched commands stay conservative.",'Default inputs are the working-tree files. Declare git: "all" for builds that read HEAD or the index,','env variable names whose values affect the result, and taskCheckboxes: "include" when completion marks matter.',"files accept literal paths and * ? ** globs; a new file matching a glob is checked without re-declaring.","Declare every real input; do not infer dependencies from the current diff.",'Policy example: {"version":2,"commands":[{"argv":["node","scripts/build.mjs"],"cwd":".","files":["src/**","package.json"],"git":"all"},{"argv":["node","--test"],"cwd":".","files":["src/**","test/**"],"taskCheckboxes":"ignore"}]}',"Build evidence does not substitute for verify evidence. A successful check does not advance the phase.","","Examples: (replace demo with your active change; these commands execute code)"," comet check run demo verify --json -- node --test"," comet check run demo build --local --cwd . -- npm run build"," comet check rerun demo build"],state:["comet state <command> [args]","init <change-name> <full|hotfix|tweak> [--isolation <current|branch|worktree>]","get <change-name> <field>","set <change-name> <field> <value> [<field> <value> ...]","complete-design <change-name> --design-doc <repo-relative-ref>","transition <change-name> <event>","check <change-name> <phase> [--recover] [--details]","scale <change-name>","artifacts <change-name>","record-check <change-name> <build|verify> --command <text> --exit-code <int> [--cwd <path>]","task-checkoff <file> <task-text>","tasks <change-name> [--assign-ids]","task-complete <change-name> <task-id> --expect <revision>","sync-plan <change-name>","checkpoint <change-name> [--file <json>]","delivery <change-name> [--file <json> | --verify]","select <change-name> | rebind <change-name> | next <change-name>","current | clear-selection","","Start with current or next <change-name> to inspect workflow guidance.","Advanced writes: init, set, transition, task-checkoff, select, rebind, clear-selection.","Use comet state <command> --help for details. --recover is for cold recovery, not normal progression.","After explicit design confirmation, complete-design registers the reference, refreshes handoff, and applies the guard; interrupted retries retain completed work.","Use data.artifactRefs for state references and task-authority markers; absolute paths are for file operations."],guard:["comet guard <change-name> <open|design|build|verify|archive> [--apply]","Validates phase requirements; --apply advances the phase after all checks pass.","Without --apply the phase stays unchanged, but this is NOT a read-only preview:","Build validation may execute a detected build and write evidence/logs.","Preview does not consume single-use evidence. Successful phase advancement consumes it atomically.","Failed or repeated previews preserve evidence; changed inputs still require a new check.","Do not poll guard for status. Use comet state next <change-name> for guidance.","On failure follow the reported next action; do not blindly retry side-effecting checks.","","Examples:"," comet guard demo build --apply --json"," comet state next demo --json"],handoff:["comet handoff <change-name> design --write [--full]","comet handoff <change-name> --hash-only"],archive:["comet archive <change-name> [--dry-run]"],validate:["comet classic validate <change-name>"],workspace:["comet classic workspace prepare <change-name> --isolation <current|branch|worktree> [--change-branch <branch>] [--target-branch <branch>] [--worktree-path <path>]","comet classic workspace resolve <change-name>"]},o={current:["comet state current","Reports the selected Classic change. Does not advance the phase."],next:["comet state next <change-name>","Reports the next workflow action. Does not execute build or verification checks."],select:["comet state select <change-name>","Writes the current change selection used by workflow routing."],rebind:["comet state rebind <change-name>","Updates the change branch binding to the current Git branch after validation."],"clear-selection":["comet state clear-selection","Clears the current change selection; does not delete change artifacts."],init:["comet state init <change-name> <full|hotfix|tweak> [--isolation <current|branch|worktree>]","Creates Classic workflow state. Follow the Open workflow for required user decisions."],scale:["comet state scale <change-name>","Reports a verification recommendation without changing verify_mode.","JSON: data.recommendation, data.selected and data.metrics. Scale is not a risk assessment.","Preserve an existing selection; record a new decision explicitly with state set when needed."],artifacts:["comet state artifacts <change-name>","Inspects the OpenSpec apply dependency closure, including dependencies of already-complete artifacts.","JSON: data.source, required, skipped, designRequired, files and problems. This does not execute implementation or verification.","Optional design is omitted only when the active schema excludes it from the required closure.","Skipped specs require explicit skip_specs: true, upstream support and no conflicting spec files.","Legacy changes without .openspec.yaml retain the existing Classic artifact requirements."],"task-checkoff":["comet state task-checkoff <file> <task-text>","Checks that exactly one matching task is already checked. Does not write the task file or execute the task."],tasks:["comet state tasks <change-name> [--assign-ids]","Reads tasks.md as the task completion authority. Fenced examples are excluded.","--assign-ids persists IDs for legacy/new tasks in Open, Design or Build; existing IDs remain unchanged.","Assign IDs before generating the design handoff and plan. ID assignment changes task requirements.","JSON: data.authority, data.revision, data.needsIds, data.tasks and data.progress.","Each task has id, text, completed and line. Never use line/order as task identity.","Example: comet state tasks demo --assign-ids --json"],"task-complete":["comet state task-complete <change-name> <task-id> --expect <revision>","Records accepted task completion during Build; does not execute or independently verify work.","Use the revision returned by state tasks. Changed requirements reject the write; refresh and reassess the task.","Writes tasks.md under the state lock and synchronizes explicitly ID-mapped legacy plan checkboxes. Retries repair interrupted projection writes.","Reconcile code, checks and review evidence before recording completion; unchecked does not mean unimplemented.","Unmapped legacy items are preserved and reported as mapping-required; never match tasks by position or wording."],"sync-plan":["comet state sync-plan <change-name>","Synchronizes legacy plan checkboxes from tasks.md by explicit comet-task IDs; does not execute or accept work.","Rejects missing or unknown plan IDs. Reconcile extra requirements into tasks.md before mapping.","New plans should reference task IDs without a second completion checklist."],checkpoint:["comet state checkpoint <change-name> [--file <json>]","Reads a structured coordination checkpoint, or records an explicitly bounded work package during Build.","Input: taskIds, revision, stage, sessionId, evidence, unresolved, reviewRounds.","Include schemaVersion: 1. JSON state is .comet/coordination.json, separate from the Engine checkpoint.","Stages: implementing|task-review|checkoff|done|blocked. Evidence is a coordination record, not automatic acceptance.","Runtime checks task IDs and revision and renders subagent-progress.md. Do not maintain its projection manually."],delivery:["comet state delivery <change-name> [--file <json> | --verify]","Reads delivery authorization and observed progress, or records the user-authorized local|push|pr action.","Input: action, targetBranch, optional remote, commit and prUrl. Recording never performs remote writes.","First authorization requires Archive with passing verification before archival. Missing legacy authorization is never inferred.","Resume only authorized unfinished steps; supplied commit or PR text alone does not prove delivery.","--verify performs bounded read-only remote/PR verification; normal entry never contacts the network."],get:["comet state get <change-name> <field>","Reads one stored field. The field value is returned in stdout, including in JSON mode.",`Fields: ${[...De,...Xt].join(", ")}`,"Example: comet state get demo phase --json"],set:["comet state set <change-name> <field> <value> [<field> <value> ...]","Advanced: validates all fields, then commits one atomic state update and reconciles Runtime state.","Invalid values or duplicate fields reject the whole update. Do not bypass workflow confirmations.","JSON: data.change and data.updated contain the committed field values.","Writable fields (enum values shown where applicable):",...[...yu].map(c=>` ${c}${Vo[c]?`: ${Vo[c].join("|")}`:c==="language"?": en|zh-CN":""}`),"Other Runtime-owned fields cannot be set manually. Artifact paths must stay within the project.","Example: comet state set demo verify_mode full","Example: comet state set demo build_mode executing-plans tdd_mode direct review_mode standard --json"],check:["comet state check <change-name> <open|design|build|verify|archive> [--recover] [--details]","Checks phase entry requirements; this is not a build/test execution command.","--recover is for cold recovery after context loss, not normal phase progression.","Recovery revalidates reusable local evidence and invalidates stale, damaged or single-use evidence.","It preserves completed work; resume from the checkpoint and rerun required checks before progressing.","JSON entry data includes layout, configuration, configurationReadiness, nextAction, compact taskState, planMapping and checks.","--recover additionally revalidates evidence and includes checkpoint references; --details expands tasks and checkpoint content.","Reconcile existing implementation and acceptance before dispatching work; unchecked tasks are not proof of missing implementation.","Read fresh state after changing configuration or advancing phases; do not reuse an earlier entry snapshot.","","Examples:"," comet state check demo build --json"," comet state check demo build --recover --json"],"record-check":["comet state record-check <change> <build|verify> --command <text> --exit-code <int> [--cwd <path>]","Advanced: writes a manual attestation; does not execute the command.","A manual attestation cannot satisfy Runtime build/verify evidence requirements, even with exit code 0.","Use comet check run to execute a check and obtain evidence that guard can validate.","--cwd: relative to project root, defaults to .; must stay inside the project.","","Examples:",' comet state record-check demo verify --command "external test run" --exit-code 1'," comet check run demo verify --json -- node --test"],transition:["comet state transition <change-name> <event>",`Events: ${wu.join(", ")}`,"Advanced: applies a state-machine event and writes workflow state. Required confirmations still apply.","This is not a substitute for the workflow Skill or phase guard. Use state next for the next action."]},s=r.find(c=>!c.startsWith("-")),a=t==="state"&&s&&o[s]||i[t];return a?`Usage: ${a.join(`
164
+ `;function Bu(t,e){let n=e.indexOf("--"),r=n<0?e:e.slice(0,n);if(!r.includes("--help")&&!r.includes("-h"))return;let i={check:["comet check run <change> <build|verify> [--local] [--incremental] [--cwd <path>] [--timeout-ms <ms>] -- <program> [args...]","comet check rerun <change> <build|verify>","--local opts deterministic local checks into same-input reuse; other checks are single-use.","--incremental records phase-local evidence: guard previews accept it, --apply requires a full rerun.","Arguments after -- belong to the child. Windows batch arguments containing shell syntax are rejected.","","Executes a program for an active change and stores its log and input-bound evidence.","--local is not a location switch: all checks execute locally. It asserts deterministic inputs.","Use --local only when no network, external state or untracked ignored inputs affect the result.","Default evidence is single-use; reusable evidence requires matching inputs, environment and log.","--cwd: relative to the project root; default is the invocation directory; must stay inside the project.","Guard reuses evidence only when its cwd matches the guard invocation directory, or the command is declared with that cwd in a v2 check policy.","--timeout-ms: default 300000; integer range 1..3600000.","Place Comet options, including --json, before --. Child --help and --json after -- are forwarded.","","Result: data.scope, data.argv, data.cwd, data.exitCode, data.logRef, data.reusable; data.reused is optional.","Exit: 0 = success with stable inputs; child failures propagate; timeout = 124; invalid invocation/runtime error = 70.","A child exit of 0 with changed inputs returns exitCode 1. Use top-level exitCode, not data.exitCode.","On failure inspect data.logRef or stderr, fix the cause, then rerun. Recovery revalidates local evidence.","rerun repeats the latest Runtime-recorded argv, cwd, timeout and reuse tier without reconstructing shell syntax.","Optional .comet/check-policy.json binds declared deterministic commands by exact argv and cwd.",'A v1 single-command object stays valid; v2 {"commands":[...]} scopes each command separately.',"Editing one v2 command entry invalidates only that command's evidence; unmatched commands stay conservative.",'Default inputs are the working-tree files. Declare git: "all" for builds that read HEAD or the index,','env variable names whose values affect the result, and taskCheckboxes: "include" when completion marks matter.',"files accept literal paths and * ? ** globs; a new file matching a glob is checked without re-declaring.","Declare every real input; do not infer dependencies from the current diff.",'Policy example: {"version":2,"commands":[{"argv":["node","scripts/build.mjs"],"cwd":".","files":["src/**","package.json"],"git":"all"},{"argv":["node","--test"],"cwd":".","files":["src/**","test/**"],"taskCheckboxes":"ignore"}]}',"Build evidence does not substitute for verify evidence. A successful check does not advance the phase.","","Examples: (replace demo with your active change; these commands execute code)"," comet check run demo verify --json -- node --test"," comet check run demo build --local --cwd . -- npm run build"," comet check rerun demo build"],state:["comet state <command> [args]","init <change-name> <full|hotfix|tweak> [--isolation <current|branch|worktree>]","get <change-name> <field>","set <change-name> <field> <value> [<field> <value> ...]","complete-design <change-name> --design-doc <repo-relative-ref>","transition <change-name> <event>","check <change-name> <phase> [--recover] [--details]","scale <change-name>","artifacts <change-name>","record-check <change-name> <build|verify> --command <text> --exit-code <int> [--cwd <path>]","task-checkoff <file> <task-text>","tasks <change-name> [--assign-ids]","task-complete <change-name> <task-id> --expect <revision>","sync-plan <change-name>","checkpoint <change-name> [--file <json>]","delivery <change-name> [--file <json> | --verify]","select <change-name> | rebind <change-name> | next <change-name>","current | clear-selection","","Start with current or next <change-name> to inspect workflow guidance.","Advanced writes: init, set, transition, task-checkoff, select, rebind, clear-selection.","Use comet state <command> --help for details. --recover is for cold recovery, not normal progression.","After explicit design confirmation, complete-design registers the reference, refreshes handoff, and applies the guard; interrupted retries retain completed work.","Use data.artifactRefs for state references and task-authority markers; absolute paths are for file operations."],guard:["comet guard <change-name> <open|design|build|verify|archive> [--apply]","Validates phase requirements; --apply advances the phase after all checks pass.","Without --apply the phase stays unchanged, but this is NOT a read-only preview:","Build validation may execute a detected build and write evidence/logs.","Preview does not consume single-use evidence. Successful phase advancement consumes it atomically.","Failed or repeated previews preserve evidence; changed inputs still require a new check.","Do not poll guard for status. Use comet state next <change-name> for guidance.","On failure follow the reported next action; do not blindly retry side-effecting checks.","","Examples:"," comet guard demo build --apply --json"," comet state next demo --json"],handoff:["comet handoff <change-name> design --write [--full]","comet handoff <change-name> --hash-only"],archive:["comet archive <change-name> [--dry-run]"],validate:["comet classic validate <change-name>"],workspace:["comet classic workspace prepare <change-name> --isolation <current|branch|worktree> [--change-branch <branch>] [--target-branch <branch>] [--worktree-path <path>]","comet classic workspace resolve <change-name>"]},o={current:["comet state current","Reports the selected Classic change. Does not advance the phase."],next:["comet state next <change-name>","Reports the next workflow action. Does not execute build or verification checks."],select:["comet state select <change-name>","Writes the current change selection used by workflow routing."],rebind:["comet state rebind <change-name>","Updates the change branch binding to the current Git branch after validation."],"clear-selection":["comet state clear-selection","Clears the current change selection; does not delete change artifacts."],init:["comet state init <change-name> <full|hotfix|tweak> [--isolation <current|branch|worktree>]","Creates Classic workflow state. Follow the Open workflow for required user decisions."],scale:["comet state scale <change-name>","Reports a verification recommendation without changing verify_mode.","JSON: data.recommendation, data.selected and data.metrics. Scale is not a risk assessment.","Preserve an existing selection; record a new decision explicitly with state set when needed."],artifacts:["comet state artifacts <change-name>","Inspects the OpenSpec apply dependency closure, including dependencies of already-complete artifacts.","JSON: data.source, required, skipped, designRequired, files and problems. This does not execute implementation or verification.","Optional design is omitted only when the active schema excludes it from the required closure.","Skipped specs require explicit skip_specs: true, upstream support and no conflicting spec files.","Legacy changes without .openspec.yaml retain the existing Classic artifact requirements."],"task-checkoff":["comet state task-checkoff <file> <task-text>","Checks that exactly one matching task is already checked. Does not write the task file or execute the task."],tasks:["comet state tasks <change-name> [--assign-ids]","Reads tasks.md as the task completion authority. Fenced examples are excluded.","--assign-ids persists IDs for legacy/new tasks in Open, Design or Build; existing IDs remain unchanged.","Assign IDs before generating the design handoff and plan. ID assignment changes task requirements.","JSON: data.authority, data.revision, data.needsIds, data.tasks and data.progress.","Each task has id, text, completed and line. Never use line/order as task identity.","Example: comet state tasks demo --assign-ids --json"],"task-complete":["comet state task-complete <change-name> <task-id> --expect <revision>","Records accepted task completion during Build; does not execute or independently verify work.","Use the revision returned by state tasks. Changed requirements reject the write; refresh and reassess the task.","Writes tasks.md under the state lock and synchronizes explicitly ID-mapped legacy plan checkboxes. Retries repair interrupted projection writes.","Reconcile code, checks and review evidence before recording completion; unchecked does not mean unimplemented.","Unmapped legacy items are preserved and reported as mapping-required; never match tasks by position or wording."],"sync-plan":["comet state sync-plan <change-name>","Synchronizes legacy plan checkboxes from tasks.md by explicit comet-task IDs; does not execute or accept work.","Rejects missing or unknown plan IDs. Reconcile extra requirements into tasks.md before mapping.","New plans should reference task IDs without a second completion checklist."],checkpoint:["comet state checkpoint <change-name> [--file <json>]","Reads a structured coordination checkpoint, or records an explicitly bounded work package during Build.","Input: taskIds, revision, stage, sessionId, evidence, unresolved, reviewRounds.","Include schemaVersion: 1. JSON state is .comet/coordination.json, separate from the Engine checkpoint.","Stages: implementing|task-review|checkoff|done|blocked. Evidence is a coordination record, not automatic acceptance.","Runtime checks task IDs and revision and renders subagent-progress.md. Do not maintain its projection manually."],delivery:["comet state delivery <change-name> [--file <json> | --verify]","Reads delivery authorization and observed progress, or records the user-authorized local|push|pr action.","Input: action, targetBranch, optional remote, commit and prUrl. Recording never performs remote writes.","First authorization requires Archive with passing verification before archival. Missing legacy authorization is never inferred.","Resume only authorized unfinished steps; supplied commit or PR text alone does not prove delivery.","--verify performs bounded read-only remote/PR verification; normal entry never contacts the network."],get:["comet state get <change-name> <field>","Reads one stored field. The field value is returned in stdout, including in JSON mode.",`Fields: ${[...Je,...an].join(", ")}`,"Example: comet state get demo phase --json"],set:["comet state set <change-name> <field> <value> [<field> <value> ...]","Advanced: validates all fields, then commits one atomic state update and reconciles Runtime state.","Invalid values or duplicate fields reject the whole update. Do not bypass workflow confirmations.","JSON: data.change and data.updated contain the committed field values.","Writable fields (enum values shown where applicable):",...[...Fu].map(c=>` ${c}${ps[c]?`: ${ps[c].join("|")}`:c==="language"?": en|zh-CN":""}`),"Other Runtime-owned fields cannot be set manually. Artifact paths must stay within the project.","Example: comet state set demo verify_mode full","Example: comet state set demo build_mode executing-plans tdd_mode direct review_mode standard --json"],check:["comet state check <change-name> <open|design|build|verify|archive> [--recover] [--details]","Checks phase entry requirements; this is not a build/test execution command.","--recover is for cold recovery after context loss, not normal phase progression.","Recovery revalidates reusable local evidence and invalidates stale, damaged or single-use evidence.","It preserves completed work; resume from the checkpoint and rerun required checks before progressing.","JSON entry data includes layout, configuration, configurationReadiness, nextAction, compact taskState, planMapping and checks.","--recover additionally revalidates evidence and includes checkpoint references; --details expands tasks and checkpoint content.","Reconcile existing implementation and acceptance before dispatching work; unchecked tasks are not proof of missing implementation.","Read fresh state after changing configuration or advancing phases; do not reuse an earlier entry snapshot.","","Examples:"," comet state check demo build --json"," comet state check demo build --recover --json"],"record-check":["comet state record-check <change> <build|verify> --command <text> --exit-code <int> [--cwd <path>]","Advanced: writes a manual attestation; does not execute the command.","A manual attestation cannot satisfy Runtime build/verify evidence requirements, even with exit code 0.","Use comet check run to execute a check and obtain evidence that guard can validate.","--cwd: relative to project root, defaults to .; must stay inside the project.","","Examples:",' comet state record-check demo verify --command "external test run" --exit-code 1'," comet check run demo verify --json -- node --test"],transition:["comet state transition <change-name> <event>",`Events: ${Wu.join(", ")}`,"Advanced: applies a state-machine event and writes workflow state. Required confirmations still apply.","This is not a substitute for the workflow Skill or phase guard. Use state next for the next action."]},s=r.find(c=>!c.startsWith("-")),a=t==="state"&&s&&o[s]||i[t];return a?`Usage: ${a.join(`
152
165
  `)}
153
- ${zw}Command placeholders must be replaced with actual values.
154
- `:void 0}function bu(t,e){let n=u=>u!==null&&typeof u=="object"&&!Array.isArray(u)?u:{},r=n(t),i=n(r.entry),o=n(r.state??i.state??r),s=n(r.preparation??r.workspace??i.workspace),a=n(r.continuation??i.continuation),c=typeof s.projectRoot=="string"&&s.projectRoot!=="."?s.projectRoot:e??null,l=o.stateVersion??o.state_version;return{phase:typeof o.phase=="string"?o.phase:null,status:typeof o.status=="string"?o.status:null,stateVersion:typeof l=="number"?l:null,workspace:{cwd:c},continuation:Object.keys(a).length?{...a,cwd:c}:null}}import{stripVTControlCharacters as Jw}from"node:util";function ku(t,e={}){return{code:"CLASSIC_COMMAND_FAILED",message:Jw(t instanceof Error?t.message:String(t)),...e}}function Yw(t,e){return{exitCode:e.exitCode,stdout:JSON.stringify({command:t,exitCode:e.exitCode,agent:bu(e.data),...e.data===void 0?{}:{data:e.data},...e.envelope===void 0?{}:{summary:e.envelope.summary,...e.envelope.next===void 0?{}:{next:e.envelope.next},...e.envelope.user_message===void 0?{}:{user_message:e.envelope.user_message}},...e.stdout===void 0?{}:{stdout:e.stdout},...e.stderr===void 0?{}:{stderr:e.stderr}})+`
155
- `,...e.envelope===void 0?{}:{envelope:e.envelope}}}async function Cu(t,e,n=process.argv.slice(2)){let r=n.indexOf("--"),i=l=>r<0||l<r,o=n.some((l,u)=>i(u)&&l==="--json"),s=n.filter((l,u)=>!i(u)||l!=="--json"),a;try{let l=vu(t,s);a=l?{exitCode:0,stdout:l}:await e(s,{json:o})}catch(l){a={exitCode:70,stderr:l instanceof Error?l.message:String(l),data:{issues:[ku(l)]}}}let c=o?Yw(t,a):a;return c.stdout&&process.stdout.write(c.stdout),c.stderr&&process.stderr.write(c.stderr+(c.stderr.endsWith(`
166
+ ${Ry}Command placeholders must be replaced with actual values.
167
+ `:void 0}function Uu(t,e){let n=u=>u!==null&&typeof u=="object"&&!Array.isArray(u)?u:{},r=n(t),i=n(r.entry),o=n(r.state??i.state??r),s=n(r.preparation??r.workspace??i.workspace),a=n(r.continuation??i.continuation),c=typeof s.projectRoot=="string"&&s.projectRoot!=="."?s.projectRoot:e??null,l=o.stateVersion??o.state_version;return{phase:typeof o.phase=="string"?o.phase:null,status:typeof o.status=="string"?o.status:null,stateVersion:typeof l=="number"?l:null,workspace:{cwd:c},continuation:Object.keys(a).length?{...a,cwd:c}:null}}import{stripVTControlCharacters as Ny}from"node:util";function Ku(t,e={}){return{code:"CLASSIC_COMMAND_FAILED",message:Ny(t instanceof Error?t.message:String(t)),...e}}function Oy(t,e){return{exitCode:e.exitCode,stdout:JSON.stringify({command:t,exitCode:e.exitCode,agent:Uu(e.data),...e.data===void 0?{}:{data:e.data},...e.envelope===void 0?{}:{summary:e.envelope.summary,...e.envelope.next===void 0?{}:{next:e.envelope.next},...e.envelope.user_message===void 0?{}:{user_message:e.envelope.user_message}},...e.stdout===void 0?{}:{stdout:e.stdout},...e.stderr===void 0?{}:{stderr:e.stderr}})+`
168
+ `,...e.envelope===void 0?{}:{envelope:e.envelope}}}async function Ay(t,e,n,r={}){let i=n.indexOf("--"),o=l=>i<0||l<i,s=n.some((l,u)=>o(u)&&l==="--json"),a=n.filter((l,u)=>!o(u)||l!=="--json"),c;try{let l=Bu(t,a);c=l?{exitCode:0,stdout:l}:await e(a,{json:s,invocationCwd:r.invocationCwd??process.cwd(),...r.projectRoot?{projectRoot:r.projectRoot}:{}})}catch(l){c={exitCode:70,stderr:l instanceof Error?l.message:String(l),data:{issues:[Ku(l)]}}}return s?Oy(t,c):c}async function zu(t,e,n=process.argv.slice(2)){let r=await Ay(t,e,n);return r.stdout&&process.stdout.write(r.stdout),r.stderr&&process.stderr.write(r.stderr+(r.stderr.endsWith(`
156
169
  `)?"":`
157
- `)),c.exitCode}process.exitCode=await Cu("resume-probe",gu);
170
+ `)),r.exitCode}process.exitCode=await zu("resume-probe",Du);